Node-Red configuration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

server-renderer.esm-browser.js 231KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034
  1. /**
  2. * @vue/server-renderer v3.4.38
  3. * (c) 2018-present Yuxi (Evan) You and Vue contributors
  4. * @license MIT
  5. **/
  6. /*! #__NO_SIDE_EFFECTS__ */
  7. // @__NO_SIDE_EFFECTS__
  8. function makeMap(str, expectsLowerCase) {
  9. const set = new Set(str.split(","));
  10. return (val) => set.has(val);
  11. }
  12. const EMPTY_OBJ = Object.freeze({}) ;
  13. const EMPTY_ARR = Object.freeze([]) ;
  14. const NOOP = () => {
  15. };
  16. const NO = () => false;
  17. const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
  18. (key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
  19. const isModelListener = (key) => key.startsWith("onUpdate:");
  20. const extend = Object.assign;
  21. const remove = (arr, el) => {
  22. const i = arr.indexOf(el);
  23. if (i > -1) {
  24. arr.splice(i, 1);
  25. }
  26. };
  27. const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
  28. const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
  29. const isArray = Array.isArray;
  30. const isMap = (val) => toTypeString(val) === "[object Map]";
  31. const isSet = (val) => toTypeString(val) === "[object Set]";
  32. const isDate = (val) => toTypeString(val) === "[object Date]";
  33. const isFunction = (val) => typeof val === "function";
  34. const isString = (val) => typeof val === "string";
  35. const isSymbol = (val) => typeof val === "symbol";
  36. const isObject = (val) => val !== null && typeof val === "object";
  37. const isPromise = (val) => {
  38. return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch);
  39. };
  40. const objectToString = Object.prototype.toString;
  41. const toTypeString = (value) => objectToString.call(value);
  42. const toRawType = (value) => {
  43. return toTypeString(value).slice(8, -1);
  44. };
  45. const isPlainObject = (val) => toTypeString(val) === "[object Object]";
  46. const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
  47. const isReservedProp = /* @__PURE__ */ makeMap(
  48. // the leading comma is intentional so empty string "" is also included
  49. ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
  50. );
  51. const isBuiltInDirective = /* @__PURE__ */ makeMap(
  52. "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"
  53. );
  54. const cacheStringFunction = (fn) => {
  55. const cache = /* @__PURE__ */ Object.create(null);
  56. return (str) => {
  57. const hit = cache[str];
  58. return hit || (cache[str] = fn(str));
  59. };
  60. };
  61. const camelizeRE = /-(\w)/g;
  62. const camelize = cacheStringFunction((str) => {
  63. return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
  64. });
  65. const hyphenateRE = /\B([A-Z])/g;
  66. const hyphenate = cacheStringFunction(
  67. (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
  68. );
  69. const capitalize = cacheStringFunction((str) => {
  70. return str.charAt(0).toUpperCase() + str.slice(1);
  71. });
  72. const toHandlerKey = cacheStringFunction((str) => {
  73. const s = str ? `on${capitalize(str)}` : ``;
  74. return s;
  75. });
  76. const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
  77. const invokeArrayFns = (fns, ...arg) => {
  78. for (let i = 0; i < fns.length; i++) {
  79. fns[i](...arg);
  80. }
  81. };
  82. const def = (obj, key, value, writable = false) => {
  83. Object.defineProperty(obj, key, {
  84. configurable: true,
  85. enumerable: false,
  86. writable,
  87. value
  88. });
  89. };
  90. const looseToNumber = (val) => {
  91. const n = parseFloat(val);
  92. return isNaN(n) ? val : n;
  93. };
  94. let _globalThis;
  95. const getGlobalThis = () => {
  96. return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
  97. };
  98. function normalizeStyle(value) {
  99. if (isArray(value)) {
  100. const res = {};
  101. for (let i = 0; i < value.length; i++) {
  102. const item = value[i];
  103. const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item);
  104. if (normalized) {
  105. for (const key in normalized) {
  106. res[key] = normalized[key];
  107. }
  108. }
  109. }
  110. return res;
  111. } else if (isString(value) || isObject(value)) {
  112. return value;
  113. }
  114. }
  115. const listDelimiterRE = /;(?![^(]*\))/g;
  116. const propertyDelimiterRE = /:([^]+)/;
  117. const styleCommentRE = /\/\*[^]*?\*\//g;
  118. function parseStringStyle(cssText) {
  119. const ret = {};
  120. cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
  121. if (item) {
  122. const tmp = item.split(propertyDelimiterRE);
  123. tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
  124. }
  125. });
  126. return ret;
  127. }
  128. function stringifyStyle(styles) {
  129. let ret = "";
  130. if (!styles || isString(styles)) {
  131. return ret;
  132. }
  133. for (const key in styles) {
  134. const value = styles[key];
  135. if (isString(value) || typeof value === "number") {
  136. const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
  137. ret += `${normalizedKey}:${value};`;
  138. }
  139. }
  140. return ret;
  141. }
  142. function normalizeClass(value) {
  143. let res = "";
  144. if (isString(value)) {
  145. res = value;
  146. } else if (isArray(value)) {
  147. for (let i = 0; i < value.length; i++) {
  148. const normalized = normalizeClass(value[i]);
  149. if (normalized) {
  150. res += normalized + " ";
  151. }
  152. }
  153. } else if (isObject(value)) {
  154. for (const name in value) {
  155. if (value[name]) {
  156. res += name + " ";
  157. }
  158. }
  159. }
  160. return res.trim();
  161. }
  162. const HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot";
  163. const SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view";
  164. const MATH_TAGS = "annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics";
  165. const VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr";
  166. const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
  167. const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
  168. const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
  169. const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);
  170. const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
  171. const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
  172. const isBooleanAttr = /* @__PURE__ */ makeMap(
  173. specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
  174. );
  175. function includeBooleanAttr(value) {
  176. return !!value || value === "";
  177. }
  178. const unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u0020]/;
  179. const attrValidationCache = {};
  180. function isSSRSafeAttrName(name) {
  181. if (attrValidationCache.hasOwnProperty(name)) {
  182. return attrValidationCache[name];
  183. }
  184. const isUnsafe = unsafeAttrCharRE.test(name);
  185. if (isUnsafe) {
  186. console.error(`unsafe attribute name: ${name}`);
  187. }
  188. return attrValidationCache[name] = !isUnsafe;
  189. }
  190. const propsToAttrMap = {
  191. acceptCharset: "accept-charset",
  192. className: "class",
  193. htmlFor: "for",
  194. httpEquiv: "http-equiv"
  195. };
  196. function isRenderableAttrValue(value) {
  197. if (value == null) {
  198. return false;
  199. }
  200. const type = typeof value;
  201. return type === "string" || type === "number" || type === "boolean";
  202. }
  203. const escapeRE = /["'&<>]/;
  204. function escapeHtml(string) {
  205. const str = "" + string;
  206. const match = escapeRE.exec(str);
  207. if (!match) {
  208. return str;
  209. }
  210. let html = "";
  211. let escaped;
  212. let index;
  213. let lastIndex = 0;
  214. for (index = match.index; index < str.length; index++) {
  215. switch (str.charCodeAt(index)) {
  216. case 34:
  217. escaped = "&quot;";
  218. break;
  219. case 38:
  220. escaped = "&amp;";
  221. break;
  222. case 39:
  223. escaped = "&#39;";
  224. break;
  225. case 60:
  226. escaped = "&lt;";
  227. break;
  228. case 62:
  229. escaped = "&gt;";
  230. break;
  231. default:
  232. continue;
  233. }
  234. if (lastIndex !== index) {
  235. html += str.slice(lastIndex, index);
  236. }
  237. lastIndex = index + 1;
  238. html += escaped;
  239. }
  240. return lastIndex !== index ? html + str.slice(lastIndex, index) : html;
  241. }
  242. const commentStripRE = /^-?>|<!--|-->|--!>|<!-$/g;
  243. function escapeHtmlComment(src) {
  244. return src.replace(commentStripRE, "");
  245. }
  246. function looseCompareArrays(a, b) {
  247. if (a.length !== b.length) return false;
  248. let equal = true;
  249. for (let i = 0; equal && i < a.length; i++) {
  250. equal = looseEqual(a[i], b[i]);
  251. }
  252. return equal;
  253. }
  254. function looseEqual(a, b) {
  255. if (a === b) return true;
  256. let aValidType = isDate(a);
  257. let bValidType = isDate(b);
  258. if (aValidType || bValidType) {
  259. return aValidType && bValidType ? a.getTime() === b.getTime() : false;
  260. }
  261. aValidType = isSymbol(a);
  262. bValidType = isSymbol(b);
  263. if (aValidType || bValidType) {
  264. return a === b;
  265. }
  266. aValidType = isArray(a);
  267. bValidType = isArray(b);
  268. if (aValidType || bValidType) {
  269. return aValidType && bValidType ? looseCompareArrays(a, b) : false;
  270. }
  271. aValidType = isObject(a);
  272. bValidType = isObject(b);
  273. if (aValidType || bValidType) {
  274. if (!aValidType || !bValidType) {
  275. return false;
  276. }
  277. const aKeysCount = Object.keys(a).length;
  278. const bKeysCount = Object.keys(b).length;
  279. if (aKeysCount !== bKeysCount) {
  280. return false;
  281. }
  282. for (const key in a) {
  283. const aHasKey = a.hasOwnProperty(key);
  284. const bHasKey = b.hasOwnProperty(key);
  285. if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) {
  286. return false;
  287. }
  288. }
  289. }
  290. return String(a) === String(b);
  291. }
  292. function looseIndexOf(arr, val) {
  293. return arr.findIndex((item) => looseEqual(item, val));
  294. }
  295. const isRef$1 = (val) => {
  296. return !!(val && val.__v_isRef === true);
  297. };
  298. const toDisplayString = (val) => {
  299. return isString(val) ? val : val == null ? "" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? isRef$1(val) ? toDisplayString(val.value) : JSON.stringify(val, replacer, 2) : String(val);
  300. };
  301. const replacer = (_key, val) => {
  302. if (isRef$1(val)) {
  303. return replacer(_key, val.value);
  304. } else if (isMap(val)) {
  305. return {
  306. [`Map(${val.size})`]: [...val.entries()].reduce(
  307. (entries, [key, val2], i) => {
  308. entries[stringifySymbol(key, i) + " =>"] = val2;
  309. return entries;
  310. },
  311. {}
  312. )
  313. };
  314. } else if (isSet(val)) {
  315. return {
  316. [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))
  317. };
  318. } else if (isSymbol(val)) {
  319. return stringifySymbol(val);
  320. } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
  321. return String(val);
  322. }
  323. return val;
  324. };
  325. const stringifySymbol = (v, i = "") => {
  326. var _a;
  327. return (
  328. // Symbol.description in es2019+ so we need to cast here to pass
  329. // the lib: es2016 check
  330. isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v
  331. );
  332. };
  333. function warn$2(msg, ...args) {
  334. console.warn(`[Vue warn] ${msg}`, ...args);
  335. }
  336. let activeEffectScope;
  337. class EffectScope {
  338. constructor(detached = false) {
  339. this.detached = detached;
  340. /**
  341. * @internal
  342. */
  343. this._active = true;
  344. /**
  345. * @internal
  346. */
  347. this.effects = [];
  348. /**
  349. * @internal
  350. */
  351. this.cleanups = [];
  352. this.parent = activeEffectScope;
  353. if (!detached && activeEffectScope) {
  354. this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(
  355. this
  356. ) - 1;
  357. }
  358. }
  359. get active() {
  360. return this._active;
  361. }
  362. run(fn) {
  363. if (this._active) {
  364. const currentEffectScope = activeEffectScope;
  365. try {
  366. activeEffectScope = this;
  367. return fn();
  368. } finally {
  369. activeEffectScope = currentEffectScope;
  370. }
  371. } else {
  372. warn$2(`cannot run an inactive effect scope.`);
  373. }
  374. }
  375. /**
  376. * This should only be called on non-detached scopes
  377. * @internal
  378. */
  379. on() {
  380. activeEffectScope = this;
  381. }
  382. /**
  383. * This should only be called on non-detached scopes
  384. * @internal
  385. */
  386. off() {
  387. activeEffectScope = this.parent;
  388. }
  389. stop(fromParent) {
  390. if (this._active) {
  391. let i, l;
  392. for (i = 0, l = this.effects.length; i < l; i++) {
  393. this.effects[i].stop();
  394. }
  395. for (i = 0, l = this.cleanups.length; i < l; i++) {
  396. this.cleanups[i]();
  397. }
  398. if (this.scopes) {
  399. for (i = 0, l = this.scopes.length; i < l; i++) {
  400. this.scopes[i].stop(true);
  401. }
  402. }
  403. if (!this.detached && this.parent && !fromParent) {
  404. const last = this.parent.scopes.pop();
  405. if (last && last !== this) {
  406. this.parent.scopes[this.index] = last;
  407. last.index = this.index;
  408. }
  409. }
  410. this.parent = void 0;
  411. this._active = false;
  412. }
  413. }
  414. }
  415. function recordEffectScope(effect, scope = activeEffectScope) {
  416. if (scope && scope.active) {
  417. scope.effects.push(effect);
  418. }
  419. }
  420. function getCurrentScope() {
  421. return activeEffectScope;
  422. }
  423. let activeEffect;
  424. class ReactiveEffect {
  425. constructor(fn, trigger, scheduler, scope) {
  426. this.fn = fn;
  427. this.trigger = trigger;
  428. this.scheduler = scheduler;
  429. this.active = true;
  430. this.deps = [];
  431. /**
  432. * @internal
  433. */
  434. this._dirtyLevel = 4;
  435. /**
  436. * @internal
  437. */
  438. this._trackId = 0;
  439. /**
  440. * @internal
  441. */
  442. this._runnings = 0;
  443. /**
  444. * @internal
  445. */
  446. this._shouldSchedule = false;
  447. /**
  448. * @internal
  449. */
  450. this._depsLength = 0;
  451. recordEffectScope(this, scope);
  452. }
  453. get dirty() {
  454. if (this._dirtyLevel === 2 || this._dirtyLevel === 3) {
  455. this._dirtyLevel = 1;
  456. pauseTracking();
  457. for (let i = 0; i < this._depsLength; i++) {
  458. const dep = this.deps[i];
  459. if (dep.computed) {
  460. triggerComputed(dep.computed);
  461. if (this._dirtyLevel >= 4) {
  462. break;
  463. }
  464. }
  465. }
  466. if (this._dirtyLevel === 1) {
  467. this._dirtyLevel = 0;
  468. }
  469. resetTracking();
  470. }
  471. return this._dirtyLevel >= 4;
  472. }
  473. set dirty(v) {
  474. this._dirtyLevel = v ? 4 : 0;
  475. }
  476. run() {
  477. this._dirtyLevel = 0;
  478. if (!this.active) {
  479. return this.fn();
  480. }
  481. let lastShouldTrack = shouldTrack;
  482. let lastEffect = activeEffect;
  483. try {
  484. shouldTrack = true;
  485. activeEffect = this;
  486. this._runnings++;
  487. preCleanupEffect(this);
  488. return this.fn();
  489. } finally {
  490. postCleanupEffect(this);
  491. this._runnings--;
  492. activeEffect = lastEffect;
  493. shouldTrack = lastShouldTrack;
  494. }
  495. }
  496. stop() {
  497. if (this.active) {
  498. preCleanupEffect(this);
  499. postCleanupEffect(this);
  500. this.onStop && this.onStop();
  501. this.active = false;
  502. }
  503. }
  504. }
  505. function triggerComputed(computed) {
  506. return computed.value;
  507. }
  508. function preCleanupEffect(effect2) {
  509. effect2._trackId++;
  510. effect2._depsLength = 0;
  511. }
  512. function postCleanupEffect(effect2) {
  513. if (effect2.deps.length > effect2._depsLength) {
  514. for (let i = effect2._depsLength; i < effect2.deps.length; i++) {
  515. cleanupDepEffect(effect2.deps[i], effect2);
  516. }
  517. effect2.deps.length = effect2._depsLength;
  518. }
  519. }
  520. function cleanupDepEffect(dep, effect2) {
  521. const trackId = dep.get(effect2);
  522. if (trackId !== void 0 && effect2._trackId !== trackId) {
  523. dep.delete(effect2);
  524. if (dep.size === 0) {
  525. dep.cleanup();
  526. }
  527. }
  528. }
  529. let shouldTrack = true;
  530. let pauseScheduleStack = 0;
  531. const trackStack = [];
  532. function pauseTracking() {
  533. trackStack.push(shouldTrack);
  534. shouldTrack = false;
  535. }
  536. function resetTracking() {
  537. const last = trackStack.pop();
  538. shouldTrack = last === void 0 ? true : last;
  539. }
  540. function pauseScheduling() {
  541. pauseScheduleStack++;
  542. }
  543. function resetScheduling() {
  544. pauseScheduleStack--;
  545. while (!pauseScheduleStack && queueEffectSchedulers.length) {
  546. queueEffectSchedulers.shift()();
  547. }
  548. }
  549. function trackEffect(effect2, dep, debuggerEventExtraInfo) {
  550. var _a;
  551. if (dep.get(effect2) !== effect2._trackId) {
  552. dep.set(effect2, effect2._trackId);
  553. const oldDep = effect2.deps[effect2._depsLength];
  554. if (oldDep !== dep) {
  555. if (oldDep) {
  556. cleanupDepEffect(oldDep, effect2);
  557. }
  558. effect2.deps[effect2._depsLength++] = dep;
  559. } else {
  560. effect2._depsLength++;
  561. }
  562. {
  563. (_a = effect2.onTrack) == null ? void 0 : _a.call(effect2, extend({ effect: effect2 }, debuggerEventExtraInfo));
  564. }
  565. }
  566. }
  567. const queueEffectSchedulers = [];
  568. function triggerEffects(dep, dirtyLevel, debuggerEventExtraInfo) {
  569. var _a;
  570. pauseScheduling();
  571. for (const effect2 of dep.keys()) {
  572. let tracking;
  573. if (effect2._dirtyLevel < dirtyLevel && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
  574. effect2._shouldSchedule || (effect2._shouldSchedule = effect2._dirtyLevel === 0);
  575. effect2._dirtyLevel = dirtyLevel;
  576. }
  577. if (effect2._shouldSchedule && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
  578. {
  579. (_a = effect2.onTrigger) == null ? void 0 : _a.call(effect2, extend({ effect: effect2 }, debuggerEventExtraInfo));
  580. }
  581. effect2.trigger();
  582. if ((!effect2._runnings || effect2.allowRecurse) && effect2._dirtyLevel !== 2) {
  583. effect2._shouldSchedule = false;
  584. if (effect2.scheduler) {
  585. queueEffectSchedulers.push(effect2.scheduler);
  586. }
  587. }
  588. }
  589. }
  590. resetScheduling();
  591. }
  592. const createDep = (cleanup, computed) => {
  593. const dep = /* @__PURE__ */ new Map();
  594. dep.cleanup = cleanup;
  595. dep.computed = computed;
  596. return dep;
  597. };
  598. const targetMap = /* @__PURE__ */ new WeakMap();
  599. const ITERATE_KEY = Symbol("iterate" );
  600. const MAP_KEY_ITERATE_KEY = Symbol("Map key iterate" );
  601. function track(target, type, key) {
  602. if (shouldTrack && activeEffect) {
  603. let depsMap = targetMap.get(target);
  604. if (!depsMap) {
  605. targetMap.set(target, depsMap = /* @__PURE__ */ new Map());
  606. }
  607. let dep = depsMap.get(key);
  608. if (!dep) {
  609. depsMap.set(key, dep = createDep(() => depsMap.delete(key)));
  610. }
  611. trackEffect(
  612. activeEffect,
  613. dep,
  614. {
  615. target,
  616. type,
  617. key
  618. }
  619. );
  620. }
  621. }
  622. function trigger(target, type, key, newValue, oldValue, oldTarget) {
  623. const depsMap = targetMap.get(target);
  624. if (!depsMap) {
  625. return;
  626. }
  627. let deps = [];
  628. if (type === "clear") {
  629. deps = [...depsMap.values()];
  630. } else if (key === "length" && isArray(target)) {
  631. const newLength = Number(newValue);
  632. depsMap.forEach((dep, key2) => {
  633. if (key2 === "length" || !isSymbol(key2) && key2 >= newLength) {
  634. deps.push(dep);
  635. }
  636. });
  637. } else {
  638. if (key !== void 0) {
  639. deps.push(depsMap.get(key));
  640. }
  641. switch (type) {
  642. case "add":
  643. if (!isArray(target)) {
  644. deps.push(depsMap.get(ITERATE_KEY));
  645. if (isMap(target)) {
  646. deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
  647. }
  648. } else if (isIntegerKey(key)) {
  649. deps.push(depsMap.get("length"));
  650. }
  651. break;
  652. case "delete":
  653. if (!isArray(target)) {
  654. deps.push(depsMap.get(ITERATE_KEY));
  655. if (isMap(target)) {
  656. deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
  657. }
  658. }
  659. break;
  660. case "set":
  661. if (isMap(target)) {
  662. deps.push(depsMap.get(ITERATE_KEY));
  663. }
  664. break;
  665. }
  666. }
  667. pauseScheduling();
  668. for (const dep of deps) {
  669. if (dep) {
  670. triggerEffects(
  671. dep,
  672. 4,
  673. {
  674. target,
  675. type,
  676. key,
  677. newValue,
  678. oldValue,
  679. oldTarget
  680. }
  681. );
  682. }
  683. }
  684. resetScheduling();
  685. }
  686. const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
  687. const builtInSymbols = new Set(
  688. /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
  689. );
  690. const arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations();
  691. function createArrayInstrumentations() {
  692. const instrumentations = {};
  693. ["includes", "indexOf", "lastIndexOf"].forEach((key) => {
  694. instrumentations[key] = function(...args) {
  695. const arr = toRaw(this);
  696. for (let i = 0, l = this.length; i < l; i++) {
  697. track(arr, "get", i + "");
  698. }
  699. const res = arr[key](...args);
  700. if (res === -1 || res === false) {
  701. return arr[key](...args.map(toRaw));
  702. } else {
  703. return res;
  704. }
  705. };
  706. });
  707. ["push", "pop", "shift", "unshift", "splice"].forEach((key) => {
  708. instrumentations[key] = function(...args) {
  709. pauseTracking();
  710. pauseScheduling();
  711. const res = toRaw(this)[key].apply(this, args);
  712. resetScheduling();
  713. resetTracking();
  714. return res;
  715. };
  716. });
  717. return instrumentations;
  718. }
  719. function hasOwnProperty(key) {
  720. if (!isSymbol(key)) key = String(key);
  721. const obj = toRaw(this);
  722. track(obj, "has", key);
  723. return obj.hasOwnProperty(key);
  724. }
  725. class BaseReactiveHandler {
  726. constructor(_isReadonly = false, _isShallow = false) {
  727. this._isReadonly = _isReadonly;
  728. this._isShallow = _isShallow;
  729. }
  730. get(target, key, receiver) {
  731. const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow;
  732. if (key === "__v_isReactive") {
  733. return !isReadonly2;
  734. } else if (key === "__v_isReadonly") {
  735. return isReadonly2;
  736. } else if (key === "__v_isShallow") {
  737. return isShallow2;
  738. } else if (key === "__v_raw") {
  739. if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
  740. // this means the receiver is a user proxy of the reactive proxy
  741. Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
  742. return target;
  743. }
  744. return;
  745. }
  746. const targetIsArray = isArray(target);
  747. if (!isReadonly2) {
  748. if (targetIsArray && hasOwn(arrayInstrumentations, key)) {
  749. return Reflect.get(arrayInstrumentations, key, receiver);
  750. }
  751. if (key === "hasOwnProperty") {
  752. return hasOwnProperty;
  753. }
  754. }
  755. const res = Reflect.get(target, key, receiver);
  756. if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
  757. return res;
  758. }
  759. if (!isReadonly2) {
  760. track(target, "get", key);
  761. }
  762. if (isShallow2) {
  763. return res;
  764. }
  765. if (isRef(res)) {
  766. return targetIsArray && isIntegerKey(key) ? res : res.value;
  767. }
  768. if (isObject(res)) {
  769. return isReadonly2 ? readonly(res) : reactive(res);
  770. }
  771. return res;
  772. }
  773. }
  774. class MutableReactiveHandler extends BaseReactiveHandler {
  775. constructor(isShallow2 = false) {
  776. super(false, isShallow2);
  777. }
  778. set(target, key, value, receiver) {
  779. let oldValue = target[key];
  780. if (!this._isShallow) {
  781. const isOldValueReadonly = isReadonly(oldValue);
  782. if (!isShallow(value) && !isReadonly(value)) {
  783. oldValue = toRaw(oldValue);
  784. value = toRaw(value);
  785. }
  786. if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
  787. if (isOldValueReadonly) {
  788. return false;
  789. } else {
  790. oldValue.value = value;
  791. return true;
  792. }
  793. }
  794. }
  795. const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key);
  796. const result = Reflect.set(target, key, value, receiver);
  797. if (target === toRaw(receiver)) {
  798. if (!hadKey) {
  799. trigger(target, "add", key, value);
  800. } else if (hasChanged(value, oldValue)) {
  801. trigger(target, "set", key, value, oldValue);
  802. }
  803. }
  804. return result;
  805. }
  806. deleteProperty(target, key) {
  807. const hadKey = hasOwn(target, key);
  808. const oldValue = target[key];
  809. const result = Reflect.deleteProperty(target, key);
  810. if (result && hadKey) {
  811. trigger(target, "delete", key, void 0, oldValue);
  812. }
  813. return result;
  814. }
  815. has(target, key) {
  816. const result = Reflect.has(target, key);
  817. if (!isSymbol(key) || !builtInSymbols.has(key)) {
  818. track(target, "has", key);
  819. }
  820. return result;
  821. }
  822. ownKeys(target) {
  823. track(
  824. target,
  825. "iterate",
  826. isArray(target) ? "length" : ITERATE_KEY
  827. );
  828. return Reflect.ownKeys(target);
  829. }
  830. }
  831. class ReadonlyReactiveHandler extends BaseReactiveHandler {
  832. constructor(isShallow2 = false) {
  833. super(true, isShallow2);
  834. }
  835. set(target, key) {
  836. {
  837. warn$2(
  838. `Set operation on key "${String(key)}" failed: target is readonly.`,
  839. target
  840. );
  841. }
  842. return true;
  843. }
  844. deleteProperty(target, key) {
  845. {
  846. warn$2(
  847. `Delete operation on key "${String(key)}" failed: target is readonly.`,
  848. target
  849. );
  850. }
  851. return true;
  852. }
  853. }
  854. const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();
  855. const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();
  856. const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(
  857. true
  858. );
  859. const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true);
  860. const toShallow = (value) => value;
  861. const getProto = (v) => Reflect.getPrototypeOf(v);
  862. function get(target, key, isReadonly2 = false, isShallow2 = false) {
  863. target = target["__v_raw"];
  864. const rawTarget = toRaw(target);
  865. const rawKey = toRaw(key);
  866. if (!isReadonly2) {
  867. if (hasChanged(key, rawKey)) {
  868. track(rawTarget, "get", key);
  869. }
  870. track(rawTarget, "get", rawKey);
  871. }
  872. const { has: has2 } = getProto(rawTarget);
  873. const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
  874. if (has2.call(rawTarget, key)) {
  875. return wrap(target.get(key));
  876. } else if (has2.call(rawTarget, rawKey)) {
  877. return wrap(target.get(rawKey));
  878. } else if (target !== rawTarget) {
  879. target.get(key);
  880. }
  881. }
  882. function has(key, isReadonly2 = false) {
  883. const target = this["__v_raw"];
  884. const rawTarget = toRaw(target);
  885. const rawKey = toRaw(key);
  886. if (!isReadonly2) {
  887. if (hasChanged(key, rawKey)) {
  888. track(rawTarget, "has", key);
  889. }
  890. track(rawTarget, "has", rawKey);
  891. }
  892. return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
  893. }
  894. function size(target, isReadonly2 = false) {
  895. target = target["__v_raw"];
  896. !isReadonly2 && track(toRaw(target), "iterate", ITERATE_KEY);
  897. return Reflect.get(target, "size", target);
  898. }
  899. function add(value, _isShallow = false) {
  900. if (!_isShallow && !isShallow(value) && !isReadonly(value)) {
  901. value = toRaw(value);
  902. }
  903. const target = toRaw(this);
  904. const proto = getProto(target);
  905. const hadKey = proto.has.call(target, value);
  906. if (!hadKey) {
  907. target.add(value);
  908. trigger(target, "add", value, value);
  909. }
  910. return this;
  911. }
  912. function set(key, value, _isShallow = false) {
  913. if (!_isShallow && !isShallow(value) && !isReadonly(value)) {
  914. value = toRaw(value);
  915. }
  916. const target = toRaw(this);
  917. const { has: has2, get: get2 } = getProto(target);
  918. let hadKey = has2.call(target, key);
  919. if (!hadKey) {
  920. key = toRaw(key);
  921. hadKey = has2.call(target, key);
  922. } else {
  923. checkIdentityKeys(target, has2, key);
  924. }
  925. const oldValue = get2.call(target, key);
  926. target.set(key, value);
  927. if (!hadKey) {
  928. trigger(target, "add", key, value);
  929. } else if (hasChanged(value, oldValue)) {
  930. trigger(target, "set", key, value, oldValue);
  931. }
  932. return this;
  933. }
  934. function deleteEntry(key) {
  935. const target = toRaw(this);
  936. const { has: has2, get: get2 } = getProto(target);
  937. let hadKey = has2.call(target, key);
  938. if (!hadKey) {
  939. key = toRaw(key);
  940. hadKey = has2.call(target, key);
  941. } else {
  942. checkIdentityKeys(target, has2, key);
  943. }
  944. const oldValue = get2 ? get2.call(target, key) : void 0;
  945. const result = target.delete(key);
  946. if (hadKey) {
  947. trigger(target, "delete", key, void 0, oldValue);
  948. }
  949. return result;
  950. }
  951. function clear() {
  952. const target = toRaw(this);
  953. const hadItems = target.size !== 0;
  954. const oldTarget = isMap(target) ? new Map(target) : new Set(target) ;
  955. const result = target.clear();
  956. if (hadItems) {
  957. trigger(target, "clear", void 0, void 0, oldTarget);
  958. }
  959. return result;
  960. }
  961. function createForEach(isReadonly2, isShallow2) {
  962. return function forEach(callback, thisArg) {
  963. const observed = this;
  964. const target = observed["__v_raw"];
  965. const rawTarget = toRaw(target);
  966. const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
  967. !isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY);
  968. return target.forEach((value, key) => {
  969. return callback.call(thisArg, wrap(value), wrap(key), observed);
  970. });
  971. };
  972. }
  973. function createIterableMethod(method, isReadonly2, isShallow2) {
  974. return function(...args) {
  975. const target = this["__v_raw"];
  976. const rawTarget = toRaw(target);
  977. const targetIsMap = isMap(rawTarget);
  978. const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
  979. const isKeyOnly = method === "keys" && targetIsMap;
  980. const innerIterator = target[method](...args);
  981. const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
  982. !isReadonly2 && track(
  983. rawTarget,
  984. "iterate",
  985. isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY
  986. );
  987. return {
  988. // iterator protocol
  989. next() {
  990. const { value, done } = innerIterator.next();
  991. return done ? { value, done } : {
  992. value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
  993. done
  994. };
  995. },
  996. // iterable protocol
  997. [Symbol.iterator]() {
  998. return this;
  999. }
  1000. };
  1001. };
  1002. }
  1003. function createReadonlyMethod(type) {
  1004. return function(...args) {
  1005. {
  1006. const key = args[0] ? `on key "${args[0]}" ` : ``;
  1007. warn$2(
  1008. `${capitalize(type)} operation ${key}failed: target is readonly.`,
  1009. toRaw(this)
  1010. );
  1011. }
  1012. return type === "delete" ? false : type === "clear" ? void 0 : this;
  1013. };
  1014. }
  1015. function createInstrumentations() {
  1016. const mutableInstrumentations2 = {
  1017. get(key) {
  1018. return get(this, key);
  1019. },
  1020. get size() {
  1021. return size(this);
  1022. },
  1023. has,
  1024. add,
  1025. set,
  1026. delete: deleteEntry,
  1027. clear,
  1028. forEach: createForEach(false, false)
  1029. };
  1030. const shallowInstrumentations2 = {
  1031. get(key) {
  1032. return get(this, key, false, true);
  1033. },
  1034. get size() {
  1035. return size(this);
  1036. },
  1037. has,
  1038. add(value) {
  1039. return add.call(this, value, true);
  1040. },
  1041. set(key, value) {
  1042. return set.call(this, key, value, true);
  1043. },
  1044. delete: deleteEntry,
  1045. clear,
  1046. forEach: createForEach(false, true)
  1047. };
  1048. const readonlyInstrumentations2 = {
  1049. get(key) {
  1050. return get(this, key, true);
  1051. },
  1052. get size() {
  1053. return size(this, true);
  1054. },
  1055. has(key) {
  1056. return has.call(this, key, true);
  1057. },
  1058. add: createReadonlyMethod("add"),
  1059. set: createReadonlyMethod("set"),
  1060. delete: createReadonlyMethod("delete"),
  1061. clear: createReadonlyMethod("clear"),
  1062. forEach: createForEach(true, false)
  1063. };
  1064. const shallowReadonlyInstrumentations2 = {
  1065. get(key) {
  1066. return get(this, key, true, true);
  1067. },
  1068. get size() {
  1069. return size(this, true);
  1070. },
  1071. has(key) {
  1072. return has.call(this, key, true);
  1073. },
  1074. add: createReadonlyMethod("add"),
  1075. set: createReadonlyMethod("set"),
  1076. delete: createReadonlyMethod("delete"),
  1077. clear: createReadonlyMethod("clear"),
  1078. forEach: createForEach(true, true)
  1079. };
  1080. const iteratorMethods = [
  1081. "keys",
  1082. "values",
  1083. "entries",
  1084. Symbol.iterator
  1085. ];
  1086. iteratorMethods.forEach((method) => {
  1087. mutableInstrumentations2[method] = createIterableMethod(method, false, false);
  1088. readonlyInstrumentations2[method] = createIterableMethod(method, true, false);
  1089. shallowInstrumentations2[method] = createIterableMethod(method, false, true);
  1090. shallowReadonlyInstrumentations2[method] = createIterableMethod(
  1091. method,
  1092. true,
  1093. true
  1094. );
  1095. });
  1096. return [
  1097. mutableInstrumentations2,
  1098. readonlyInstrumentations2,
  1099. shallowInstrumentations2,
  1100. shallowReadonlyInstrumentations2
  1101. ];
  1102. }
  1103. const [
  1104. mutableInstrumentations,
  1105. readonlyInstrumentations,
  1106. shallowInstrumentations,
  1107. shallowReadonlyInstrumentations
  1108. ] = /* @__PURE__ */ createInstrumentations();
  1109. function createInstrumentationGetter(isReadonly2, shallow) {
  1110. const instrumentations = shallow ? isReadonly2 ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly2 ? readonlyInstrumentations : mutableInstrumentations;
  1111. return (target, key, receiver) => {
  1112. if (key === "__v_isReactive") {
  1113. return !isReadonly2;
  1114. } else if (key === "__v_isReadonly") {
  1115. return isReadonly2;
  1116. } else if (key === "__v_raw") {
  1117. return target;
  1118. }
  1119. return Reflect.get(
  1120. hasOwn(instrumentations, key) && key in target ? instrumentations : target,
  1121. key,
  1122. receiver
  1123. );
  1124. };
  1125. }
  1126. const mutableCollectionHandlers = {
  1127. get: /* @__PURE__ */ createInstrumentationGetter(false, false)
  1128. };
  1129. const shallowCollectionHandlers = {
  1130. get: /* @__PURE__ */ createInstrumentationGetter(false, true)
  1131. };
  1132. const readonlyCollectionHandlers = {
  1133. get: /* @__PURE__ */ createInstrumentationGetter(true, false)
  1134. };
  1135. const shallowReadonlyCollectionHandlers = {
  1136. get: /* @__PURE__ */ createInstrumentationGetter(true, true)
  1137. };
  1138. function checkIdentityKeys(target, has2, key) {
  1139. const rawKey = toRaw(key);
  1140. if (rawKey !== key && has2.call(target, rawKey)) {
  1141. const type = toRawType(target);
  1142. warn$2(
  1143. `Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`
  1144. );
  1145. }
  1146. }
  1147. const reactiveMap = /* @__PURE__ */ new WeakMap();
  1148. const shallowReactiveMap = /* @__PURE__ */ new WeakMap();
  1149. const readonlyMap = /* @__PURE__ */ new WeakMap();
  1150. const shallowReadonlyMap = /* @__PURE__ */ new WeakMap();
  1151. function targetTypeMap(rawType) {
  1152. switch (rawType) {
  1153. case "Object":
  1154. case "Array":
  1155. return 1 /* COMMON */;
  1156. case "Map":
  1157. case "Set":
  1158. case "WeakMap":
  1159. case "WeakSet":
  1160. return 2 /* COLLECTION */;
  1161. default:
  1162. return 0 /* INVALID */;
  1163. }
  1164. }
  1165. function getTargetType(value) {
  1166. return value["__v_skip"] || !Object.isExtensible(value) ? 0 /* INVALID */ : targetTypeMap(toRawType(value));
  1167. }
  1168. function reactive(target) {
  1169. if (isReadonly(target)) {
  1170. return target;
  1171. }
  1172. return createReactiveObject(
  1173. target,
  1174. false,
  1175. mutableHandlers,
  1176. mutableCollectionHandlers,
  1177. reactiveMap
  1178. );
  1179. }
  1180. function shallowReactive(target) {
  1181. return createReactiveObject(
  1182. target,
  1183. false,
  1184. shallowReactiveHandlers,
  1185. shallowCollectionHandlers,
  1186. shallowReactiveMap
  1187. );
  1188. }
  1189. function readonly(target) {
  1190. return createReactiveObject(
  1191. target,
  1192. true,
  1193. readonlyHandlers,
  1194. readonlyCollectionHandlers,
  1195. readonlyMap
  1196. );
  1197. }
  1198. function shallowReadonly(target) {
  1199. return createReactiveObject(
  1200. target,
  1201. true,
  1202. shallowReadonlyHandlers,
  1203. shallowReadonlyCollectionHandlers,
  1204. shallowReadonlyMap
  1205. );
  1206. }
  1207. function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
  1208. if (!isObject(target)) {
  1209. {
  1210. warn$2(
  1211. `value cannot be made ${isReadonly2 ? "readonly" : "reactive"}: ${String(
  1212. target
  1213. )}`
  1214. );
  1215. }
  1216. return target;
  1217. }
  1218. if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
  1219. return target;
  1220. }
  1221. const existingProxy = proxyMap.get(target);
  1222. if (existingProxy) {
  1223. return existingProxy;
  1224. }
  1225. const targetType = getTargetType(target);
  1226. if (targetType === 0 /* INVALID */) {
  1227. return target;
  1228. }
  1229. const proxy = new Proxy(
  1230. target,
  1231. targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers
  1232. );
  1233. proxyMap.set(target, proxy);
  1234. return proxy;
  1235. }
  1236. function isReactive(value) {
  1237. if (isReadonly(value)) {
  1238. return isReactive(value["__v_raw"]);
  1239. }
  1240. return !!(value && value["__v_isReactive"]);
  1241. }
  1242. function isReadonly(value) {
  1243. return !!(value && value["__v_isReadonly"]);
  1244. }
  1245. function isShallow(value) {
  1246. return !!(value && value["__v_isShallow"]);
  1247. }
  1248. function isProxy(value) {
  1249. return value ? !!value["__v_raw"] : false;
  1250. }
  1251. function toRaw(observed) {
  1252. const raw = observed && observed["__v_raw"];
  1253. return raw ? toRaw(raw) : observed;
  1254. }
  1255. function markRaw(value) {
  1256. if (Object.isExtensible(value)) {
  1257. def(value, "__v_skip", true);
  1258. }
  1259. return value;
  1260. }
  1261. const toReactive = (value) => isObject(value) ? reactive(value) : value;
  1262. const toReadonly = (value) => isObject(value) ? readonly(value) : value;
  1263. const COMPUTED_SIDE_EFFECT_WARN = `Computed is still dirty after getter evaluation, likely because a computed is mutating its own dependency in its getter. State mutations in computed getters should be avoided. Check the docs for more details: https://vuejs.org/guide/essentials/computed.html#getters-should-be-side-effect-free`;
  1264. class ComputedRefImpl {
  1265. constructor(getter, _setter, isReadonly, isSSR) {
  1266. this.getter = getter;
  1267. this._setter = _setter;
  1268. this.dep = void 0;
  1269. this.__v_isRef = true;
  1270. this["__v_isReadonly"] = false;
  1271. this.effect = new ReactiveEffect(
  1272. () => getter(this._value),
  1273. () => triggerRefValue(
  1274. this,
  1275. this.effect._dirtyLevel === 2 ? 2 : 3
  1276. )
  1277. );
  1278. this.effect.computed = this;
  1279. this.effect.active = this._cacheable = !isSSR;
  1280. this["__v_isReadonly"] = isReadonly;
  1281. }
  1282. get value() {
  1283. const self = toRaw(this);
  1284. if ((!self._cacheable || self.effect.dirty) && hasChanged(self._value, self._value = self.effect.run())) {
  1285. triggerRefValue(self, 4);
  1286. }
  1287. trackRefValue(self);
  1288. if (self.effect._dirtyLevel >= 2) {
  1289. if (this._warnRecursive) {
  1290. warn$2(COMPUTED_SIDE_EFFECT_WARN, `
  1291. getter: `, this.getter);
  1292. }
  1293. triggerRefValue(self, 2);
  1294. }
  1295. return self._value;
  1296. }
  1297. set value(newValue) {
  1298. this._setter(newValue);
  1299. }
  1300. // #region polyfill _dirty for backward compatibility third party code for Vue <= 3.3.x
  1301. get _dirty() {
  1302. return this.effect.dirty;
  1303. }
  1304. set _dirty(v) {
  1305. this.effect.dirty = v;
  1306. }
  1307. // #endregion
  1308. }
  1309. function computed$1(getterOrOptions, debugOptions, isSSR = false) {
  1310. let getter;
  1311. let setter;
  1312. const onlyGetter = isFunction(getterOrOptions);
  1313. if (onlyGetter) {
  1314. getter = getterOrOptions;
  1315. setter = () => {
  1316. warn$2("Write operation failed: computed value is readonly");
  1317. } ;
  1318. } else {
  1319. getter = getterOrOptions.get;
  1320. setter = getterOrOptions.set;
  1321. }
  1322. const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR);
  1323. return cRef;
  1324. }
  1325. function trackRefValue(ref2) {
  1326. var _a;
  1327. if (shouldTrack && activeEffect) {
  1328. ref2 = toRaw(ref2);
  1329. trackEffect(
  1330. activeEffect,
  1331. (_a = ref2.dep) != null ? _a : ref2.dep = createDep(
  1332. () => ref2.dep = void 0,
  1333. ref2 instanceof ComputedRefImpl ? ref2 : void 0
  1334. ),
  1335. {
  1336. target: ref2,
  1337. type: "get",
  1338. key: "value"
  1339. }
  1340. );
  1341. }
  1342. }
  1343. function triggerRefValue(ref2, dirtyLevel = 4, newVal, oldVal) {
  1344. ref2 = toRaw(ref2);
  1345. const dep = ref2.dep;
  1346. if (dep) {
  1347. triggerEffects(
  1348. dep,
  1349. dirtyLevel,
  1350. {
  1351. target: ref2,
  1352. type: "set",
  1353. key: "value",
  1354. newValue: newVal,
  1355. oldValue: oldVal
  1356. }
  1357. );
  1358. }
  1359. }
  1360. function isRef(r) {
  1361. return !!(r && r.__v_isRef === true);
  1362. }
  1363. function unref(ref2) {
  1364. return isRef(ref2) ? ref2.value : ref2;
  1365. }
  1366. const shallowUnwrapHandlers = {
  1367. get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)),
  1368. set: (target, key, value, receiver) => {
  1369. const oldValue = target[key];
  1370. if (isRef(oldValue) && !isRef(value)) {
  1371. oldValue.value = value;
  1372. return true;
  1373. } else {
  1374. return Reflect.set(target, key, value, receiver);
  1375. }
  1376. }
  1377. };
  1378. function proxyRefs(objectWithRefs) {
  1379. return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
  1380. }
  1381. const stack = [];
  1382. function pushWarningContext(vnode) {
  1383. stack.push(vnode);
  1384. }
  1385. function popWarningContext() {
  1386. stack.pop();
  1387. }
  1388. let isWarning = false;
  1389. function warn$1(msg, ...args) {
  1390. if (isWarning) return;
  1391. isWarning = true;
  1392. pauseTracking();
  1393. const instance = stack.length ? stack[stack.length - 1].component : null;
  1394. const appWarnHandler = instance && instance.appContext.config.warnHandler;
  1395. const trace = getComponentTrace();
  1396. if (appWarnHandler) {
  1397. callWithErrorHandling(
  1398. appWarnHandler,
  1399. instance,
  1400. 11,
  1401. [
  1402. // eslint-disable-next-line no-restricted-syntax
  1403. msg + args.map((a) => {
  1404. var _a, _b;
  1405. return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a);
  1406. }).join(""),
  1407. instance && instance.proxy,
  1408. trace.map(
  1409. ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`
  1410. ).join("\n"),
  1411. trace
  1412. ]
  1413. );
  1414. } else {
  1415. const warnArgs = [`[Vue warn]: ${msg}`, ...args];
  1416. if (trace.length && // avoid spamming console during tests
  1417. true) {
  1418. warnArgs.push(`
  1419. `, ...formatTrace(trace));
  1420. }
  1421. console.warn(...warnArgs);
  1422. }
  1423. resetTracking();
  1424. isWarning = false;
  1425. }
  1426. function getComponentTrace() {
  1427. let currentVNode = stack[stack.length - 1];
  1428. if (!currentVNode) {
  1429. return [];
  1430. }
  1431. const normalizedStack = [];
  1432. while (currentVNode) {
  1433. const last = normalizedStack[0];
  1434. if (last && last.vnode === currentVNode) {
  1435. last.recurseCount++;
  1436. } else {
  1437. normalizedStack.push({
  1438. vnode: currentVNode,
  1439. recurseCount: 0
  1440. });
  1441. }
  1442. const parentInstance = currentVNode.component && currentVNode.component.parent;
  1443. currentVNode = parentInstance && parentInstance.vnode;
  1444. }
  1445. return normalizedStack;
  1446. }
  1447. function formatTrace(trace) {
  1448. const logs = [];
  1449. trace.forEach((entry, i) => {
  1450. logs.push(...i === 0 ? [] : [`
  1451. `], ...formatTraceEntry(entry));
  1452. });
  1453. return logs;
  1454. }
  1455. function formatTraceEntry({ vnode, recurseCount }) {
  1456. const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
  1457. const isRoot = vnode.component ? vnode.component.parent == null : false;
  1458. const open = ` at <${formatComponentName(
  1459. vnode.component,
  1460. vnode.type,
  1461. isRoot
  1462. )}`;
  1463. const close = `>` + postfix;
  1464. return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close];
  1465. }
  1466. function formatProps(props) {
  1467. const res = [];
  1468. const keys = Object.keys(props);
  1469. keys.slice(0, 3).forEach((key) => {
  1470. res.push(...formatProp(key, props[key]));
  1471. });
  1472. if (keys.length > 3) {
  1473. res.push(` ...`);
  1474. }
  1475. return res;
  1476. }
  1477. function formatProp(key, value, raw) {
  1478. if (isString(value)) {
  1479. value = JSON.stringify(value);
  1480. return raw ? value : [`${key}=${value}`];
  1481. } else if (typeof value === "number" || typeof value === "boolean" || value == null) {
  1482. return raw ? value : [`${key}=${value}`];
  1483. } else if (isRef(value)) {
  1484. value = formatProp(key, toRaw(value.value), true);
  1485. return raw ? value : [`${key}=Ref<`, value, `>`];
  1486. } else if (isFunction(value)) {
  1487. return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];
  1488. } else {
  1489. value = toRaw(value);
  1490. return raw ? value : [`${key}=`, value];
  1491. }
  1492. }
  1493. const ErrorTypeStrings = {
  1494. ["sp"]: "serverPrefetch hook",
  1495. ["bc"]: "beforeCreate hook",
  1496. ["c"]: "created hook",
  1497. ["bm"]: "beforeMount hook",
  1498. ["m"]: "mounted hook",
  1499. ["bu"]: "beforeUpdate hook",
  1500. ["u"]: "updated",
  1501. ["bum"]: "beforeUnmount hook",
  1502. ["um"]: "unmounted hook",
  1503. ["a"]: "activated hook",
  1504. ["da"]: "deactivated hook",
  1505. ["ec"]: "errorCaptured hook",
  1506. ["rtc"]: "renderTracked hook",
  1507. ["rtg"]: "renderTriggered hook",
  1508. [0]: "setup function",
  1509. [1]: "render function",
  1510. [2]: "watcher getter",
  1511. [3]: "watcher callback",
  1512. [4]: "watcher cleanup function",
  1513. [5]: "native event handler",
  1514. [6]: "component event handler",
  1515. [7]: "vnode hook",
  1516. [8]: "directive hook",
  1517. [9]: "transition hook",
  1518. [10]: "app errorHandler",
  1519. [11]: "app warnHandler",
  1520. [12]: "ref function",
  1521. [13]: "async component loader",
  1522. [14]: "scheduler flush",
  1523. [15]: "component update"
  1524. };
  1525. function callWithErrorHandling(fn, instance, type, args) {
  1526. try {
  1527. return args ? fn(...args) : fn();
  1528. } catch (err) {
  1529. handleError(err, instance, type);
  1530. }
  1531. }
  1532. function callWithAsyncErrorHandling(fn, instance, type, args) {
  1533. if (isFunction(fn)) {
  1534. const res = callWithErrorHandling(fn, instance, type, args);
  1535. if (res && isPromise(res)) {
  1536. res.catch((err) => {
  1537. handleError(err, instance, type);
  1538. });
  1539. }
  1540. return res;
  1541. }
  1542. if (isArray(fn)) {
  1543. const values = [];
  1544. for (let i = 0; i < fn.length; i++) {
  1545. values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
  1546. }
  1547. return values;
  1548. } else {
  1549. warn$1(
  1550. `Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}`
  1551. );
  1552. }
  1553. }
  1554. function handleError(err, instance, type, throwInDev = true) {
  1555. const contextVNode = instance ? instance.vnode : null;
  1556. if (instance) {
  1557. let cur = instance.parent;
  1558. const exposedInstance = instance.proxy;
  1559. const errorInfo = ErrorTypeStrings[type] ;
  1560. while (cur) {
  1561. const errorCapturedHooks = cur.ec;
  1562. if (errorCapturedHooks) {
  1563. for (let i = 0; i < errorCapturedHooks.length; i++) {
  1564. if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
  1565. return;
  1566. }
  1567. }
  1568. }
  1569. cur = cur.parent;
  1570. }
  1571. const appErrorHandler = instance.appContext.config.errorHandler;
  1572. if (appErrorHandler) {
  1573. pauseTracking();
  1574. callWithErrorHandling(
  1575. appErrorHandler,
  1576. null,
  1577. 10,
  1578. [err, exposedInstance, errorInfo]
  1579. );
  1580. resetTracking();
  1581. return;
  1582. }
  1583. }
  1584. logError(err, type, contextVNode, throwInDev);
  1585. }
  1586. function logError(err, type, contextVNode, throwInDev = true) {
  1587. {
  1588. const info = ErrorTypeStrings[type];
  1589. if (contextVNode) {
  1590. pushWarningContext(contextVNode);
  1591. }
  1592. warn$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
  1593. if (contextVNode) {
  1594. popWarningContext();
  1595. }
  1596. if (throwInDev) {
  1597. throw err;
  1598. } else {
  1599. console.error(err);
  1600. }
  1601. }
  1602. }
  1603. let isFlushing = false;
  1604. let isFlushPending = false;
  1605. const queue = [];
  1606. let flushIndex = 0;
  1607. const pendingPostFlushCbs = [];
  1608. let activePostFlushCbs = null;
  1609. let postFlushIndex = 0;
  1610. const resolvedPromise = /* @__PURE__ */ Promise.resolve();
  1611. let currentFlushPromise = null;
  1612. const RECURSION_LIMIT = 100;
  1613. function nextTick(fn) {
  1614. const p = currentFlushPromise || resolvedPromise;
  1615. return fn ? p.then(this ? fn.bind(this) : fn) : p;
  1616. }
  1617. function findInsertionIndex(id) {
  1618. let start = flushIndex + 1;
  1619. let end = queue.length;
  1620. while (start < end) {
  1621. const middle = start + end >>> 1;
  1622. const middleJob = queue[middle];
  1623. const middleJobId = getId(middleJob);
  1624. if (middleJobId < id || middleJobId === id && middleJob.pre) {
  1625. start = middle + 1;
  1626. } else {
  1627. end = middle;
  1628. }
  1629. }
  1630. return start;
  1631. }
  1632. function queueJob(job) {
  1633. if (!queue.length || !queue.includes(
  1634. job,
  1635. isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex
  1636. )) {
  1637. if (job.id == null) {
  1638. queue.push(job);
  1639. } else {
  1640. queue.splice(findInsertionIndex(job.id), 0, job);
  1641. }
  1642. queueFlush();
  1643. }
  1644. }
  1645. function queueFlush() {
  1646. if (!isFlushing && !isFlushPending) {
  1647. isFlushPending = true;
  1648. currentFlushPromise = resolvedPromise.then(flushJobs);
  1649. }
  1650. }
  1651. function invalidateJob(job) {
  1652. const i = queue.indexOf(job);
  1653. if (i > flushIndex) {
  1654. queue.splice(i, 1);
  1655. }
  1656. }
  1657. function queuePostFlushCb(cb) {
  1658. if (!isArray(cb)) {
  1659. if (!activePostFlushCbs || !activePostFlushCbs.includes(
  1660. cb,
  1661. cb.allowRecurse ? postFlushIndex + 1 : postFlushIndex
  1662. )) {
  1663. pendingPostFlushCbs.push(cb);
  1664. }
  1665. } else {
  1666. pendingPostFlushCbs.push(...cb);
  1667. }
  1668. queueFlush();
  1669. }
  1670. function flushPreFlushCbs(instance, seen, i = isFlushing ? flushIndex + 1 : 0) {
  1671. {
  1672. seen = seen || /* @__PURE__ */ new Map();
  1673. }
  1674. for (; i < queue.length; i++) {
  1675. const cb = queue[i];
  1676. if (cb && cb.pre) {
  1677. if (instance && cb.id !== instance.uid) {
  1678. continue;
  1679. }
  1680. if (checkRecursiveUpdates(seen, cb)) {
  1681. continue;
  1682. }
  1683. queue.splice(i, 1);
  1684. i--;
  1685. cb();
  1686. }
  1687. }
  1688. }
  1689. function flushPostFlushCbs(seen) {
  1690. if (pendingPostFlushCbs.length) {
  1691. const deduped = [...new Set(pendingPostFlushCbs)].sort(
  1692. (a, b) => getId(a) - getId(b)
  1693. );
  1694. pendingPostFlushCbs.length = 0;
  1695. if (activePostFlushCbs) {
  1696. activePostFlushCbs.push(...deduped);
  1697. return;
  1698. }
  1699. activePostFlushCbs = deduped;
  1700. {
  1701. seen = seen || /* @__PURE__ */ new Map();
  1702. }
  1703. for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
  1704. const cb = activePostFlushCbs[postFlushIndex];
  1705. if (checkRecursiveUpdates(seen, cb)) {
  1706. continue;
  1707. }
  1708. if (cb.active !== false) cb();
  1709. }
  1710. activePostFlushCbs = null;
  1711. postFlushIndex = 0;
  1712. }
  1713. }
  1714. const getId = (job) => job.id == null ? Infinity : job.id;
  1715. const comparator = (a, b) => {
  1716. const diff = getId(a) - getId(b);
  1717. if (diff === 0) {
  1718. if (a.pre && !b.pre) return -1;
  1719. if (b.pre && !a.pre) return 1;
  1720. }
  1721. return diff;
  1722. };
  1723. function flushJobs(seen) {
  1724. isFlushPending = false;
  1725. isFlushing = true;
  1726. {
  1727. seen = seen || /* @__PURE__ */ new Map();
  1728. }
  1729. queue.sort(comparator);
  1730. const check = (job) => checkRecursiveUpdates(seen, job) ;
  1731. try {
  1732. for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
  1733. const job = queue[flushIndex];
  1734. if (job && job.active !== false) {
  1735. if (check(job)) {
  1736. continue;
  1737. }
  1738. callWithErrorHandling(
  1739. job,
  1740. job.i,
  1741. job.i ? 15 : 14
  1742. );
  1743. }
  1744. }
  1745. } finally {
  1746. flushIndex = 0;
  1747. queue.length = 0;
  1748. flushPostFlushCbs(seen);
  1749. isFlushing = false;
  1750. currentFlushPromise = null;
  1751. if (queue.length || pendingPostFlushCbs.length) {
  1752. flushJobs(seen);
  1753. }
  1754. }
  1755. }
  1756. function checkRecursiveUpdates(seen, fn) {
  1757. if (!seen.has(fn)) {
  1758. seen.set(fn, 1);
  1759. } else {
  1760. const count = seen.get(fn);
  1761. if (count > RECURSION_LIMIT) {
  1762. const instance = fn.i;
  1763. const componentName = instance && getComponentName(instance.type);
  1764. handleError(
  1765. `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,
  1766. null,
  1767. 10
  1768. );
  1769. return true;
  1770. } else {
  1771. seen.set(fn, count + 1);
  1772. }
  1773. }
  1774. }
  1775. let isHmrUpdating = false;
  1776. const hmrDirtyComponents = /* @__PURE__ */ new Map();
  1777. {
  1778. getGlobalThis().__VUE_HMR_RUNTIME__ = {
  1779. createRecord: tryWrap(createRecord),
  1780. rerender: tryWrap(rerender),
  1781. reload: tryWrap(reload)
  1782. };
  1783. }
  1784. const map = /* @__PURE__ */ new Map();
  1785. function registerHMR(instance) {
  1786. const id = instance.type.__hmrId;
  1787. let record = map.get(id);
  1788. if (!record) {
  1789. createRecord(id, instance.type);
  1790. record = map.get(id);
  1791. }
  1792. record.instances.add(instance);
  1793. }
  1794. function unregisterHMR(instance) {
  1795. map.get(instance.type.__hmrId).instances.delete(instance);
  1796. }
  1797. function createRecord(id, initialDef) {
  1798. if (map.has(id)) {
  1799. return false;
  1800. }
  1801. map.set(id, {
  1802. initialDef: normalizeClassComponent(initialDef),
  1803. instances: /* @__PURE__ */ new Set()
  1804. });
  1805. return true;
  1806. }
  1807. function normalizeClassComponent(component) {
  1808. return isClassComponent(component) ? component.__vccOpts : component;
  1809. }
  1810. function rerender(id, newRender) {
  1811. const record = map.get(id);
  1812. if (!record) {
  1813. return;
  1814. }
  1815. record.initialDef.render = newRender;
  1816. [...record.instances].forEach((instance) => {
  1817. if (newRender) {
  1818. instance.render = newRender;
  1819. normalizeClassComponent(instance.type).render = newRender;
  1820. }
  1821. instance.renderCache = [];
  1822. isHmrUpdating = true;
  1823. instance.effect.dirty = true;
  1824. instance.update();
  1825. isHmrUpdating = false;
  1826. });
  1827. }
  1828. function reload(id, newComp) {
  1829. const record = map.get(id);
  1830. if (!record) return;
  1831. newComp = normalizeClassComponent(newComp);
  1832. updateComponentDef(record.initialDef, newComp);
  1833. const instances = [...record.instances];
  1834. for (let i = 0; i < instances.length; i++) {
  1835. const instance = instances[i];
  1836. const oldComp = normalizeClassComponent(instance.type);
  1837. let dirtyInstances = hmrDirtyComponents.get(oldComp);
  1838. if (!dirtyInstances) {
  1839. if (oldComp !== record.initialDef) {
  1840. updateComponentDef(oldComp, newComp);
  1841. }
  1842. hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
  1843. }
  1844. dirtyInstances.add(instance);
  1845. instance.appContext.propsCache.delete(instance.type);
  1846. instance.appContext.emitsCache.delete(instance.type);
  1847. instance.appContext.optionsCache.delete(instance.type);
  1848. if (instance.ceReload) {
  1849. dirtyInstances.add(instance);
  1850. instance.ceReload(newComp.styles);
  1851. dirtyInstances.delete(instance);
  1852. } else if (instance.parent) {
  1853. instance.parent.effect.dirty = true;
  1854. queueJob(() => {
  1855. instance.parent.update();
  1856. dirtyInstances.delete(instance);
  1857. });
  1858. } else if (instance.appContext.reload) {
  1859. instance.appContext.reload();
  1860. } else if (typeof window !== "undefined") {
  1861. window.location.reload();
  1862. } else {
  1863. console.warn(
  1864. "[HMR] Root or manually mounted instance modified. Full reload required."
  1865. );
  1866. }
  1867. }
  1868. queuePostFlushCb(() => {
  1869. hmrDirtyComponents.clear();
  1870. });
  1871. }
  1872. function updateComponentDef(oldComp, newComp) {
  1873. extend(oldComp, newComp);
  1874. for (const key in oldComp) {
  1875. if (key !== "__file" && !(key in newComp)) {
  1876. delete oldComp[key];
  1877. }
  1878. }
  1879. }
  1880. function tryWrap(fn) {
  1881. return (id, arg) => {
  1882. try {
  1883. return fn(id, arg);
  1884. } catch (e) {
  1885. console.error(e);
  1886. console.warn(
  1887. `[HMR] Something went wrong during Vue component hot-reload. Full reload required.`
  1888. );
  1889. }
  1890. };
  1891. }
  1892. let devtools;
  1893. let buffer = [];
  1894. let devtoolsNotInstalled = false;
  1895. function emit$1(event, ...args) {
  1896. if (devtools) {
  1897. devtools.emit(event, ...args);
  1898. } else if (!devtoolsNotInstalled) {
  1899. buffer.push({ event, args });
  1900. }
  1901. }
  1902. function setDevtoolsHook(hook, target) {
  1903. var _a, _b;
  1904. devtools = hook;
  1905. if (devtools) {
  1906. devtools.enabled = true;
  1907. buffer.forEach(({ event, args }) => devtools.emit(event, ...args));
  1908. buffer = [];
  1909. } else if (
  1910. // handle late devtools injection - only do this if we are in an actual
  1911. // browser environment to avoid the timer handle stalling test runner exit
  1912. // (#4815)
  1913. typeof window !== "undefined" && // some envs mock window but not fully
  1914. window.HTMLElement && // also exclude jsdom
  1915. // eslint-disable-next-line no-restricted-syntax
  1916. !((_b = (_a = window.navigator) == null ? void 0 : _a.userAgent) == null ? void 0 : _b.includes("jsdom"))
  1917. ) {
  1918. const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || [];
  1919. replay.push((newHook) => {
  1920. setDevtoolsHook(newHook, target);
  1921. });
  1922. setTimeout(() => {
  1923. if (!devtools) {
  1924. target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null;
  1925. devtoolsNotInstalled = true;
  1926. buffer = [];
  1927. }
  1928. }, 3e3);
  1929. } else {
  1930. devtoolsNotInstalled = true;
  1931. buffer = [];
  1932. }
  1933. }
  1934. function devtoolsInitApp(app, version) {
  1935. emit$1("app:init" /* APP_INIT */, app, version, {
  1936. Fragment,
  1937. Text,
  1938. Comment,
  1939. Static
  1940. });
  1941. }
  1942. function devtoolsUnmountApp(app) {
  1943. emit$1("app:unmount" /* APP_UNMOUNT */, app);
  1944. }
  1945. const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook(
  1946. "component:added" /* COMPONENT_ADDED */
  1947. );
  1948. const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook("component:updated" /* COMPONENT_UPDATED */);
  1949. const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook(
  1950. "component:removed" /* COMPONENT_REMOVED */
  1951. );
  1952. const devtoolsComponentRemoved = (component) => {
  1953. if (devtools && typeof devtools.cleanupBuffer === "function" && // remove the component if it wasn't buffered
  1954. !devtools.cleanupBuffer(component)) {
  1955. _devtoolsComponentRemoved(component);
  1956. }
  1957. };
  1958. /*! #__NO_SIDE_EFFECTS__ */
  1959. // @__NO_SIDE_EFFECTS__
  1960. function createDevtoolsComponentHook(hook) {
  1961. return (component) => {
  1962. emit$1(
  1963. hook,
  1964. component.appContext.app,
  1965. component.uid,
  1966. component.parent ? component.parent.uid : void 0,
  1967. component
  1968. );
  1969. };
  1970. }
  1971. const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook(
  1972. "perf:start" /* PERFORMANCE_START */
  1973. );
  1974. const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook(
  1975. "perf:end" /* PERFORMANCE_END */
  1976. );
  1977. function createDevtoolsPerformanceHook(hook) {
  1978. return (component, type, time) => {
  1979. emit$1(hook, component.appContext.app, component.uid, component, type, time);
  1980. };
  1981. }
  1982. function devtoolsComponentEmit(component, event, params) {
  1983. emit$1(
  1984. "component:emit" /* COMPONENT_EMIT */,
  1985. component.appContext.app,
  1986. component,
  1987. event,
  1988. params
  1989. );
  1990. }
  1991. let currentRenderingInstance = null;
  1992. let currentScopeId = null;
  1993. function setCurrentRenderingInstance$1(instance) {
  1994. const prev = currentRenderingInstance;
  1995. currentRenderingInstance = instance;
  1996. currentScopeId = instance && instance.type.__scopeId || null;
  1997. return prev;
  1998. }
  1999. function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
  2000. if (!ctx) return fn;
  2001. if (fn._n) {
  2002. return fn;
  2003. }
  2004. const renderFnWithContext = (...args) => {
  2005. if (renderFnWithContext._d) {
  2006. setBlockTracking(-1);
  2007. }
  2008. const prevInstance = setCurrentRenderingInstance$1(ctx);
  2009. let res;
  2010. try {
  2011. res = fn(...args);
  2012. } finally {
  2013. setCurrentRenderingInstance$1(prevInstance);
  2014. if (renderFnWithContext._d) {
  2015. setBlockTracking(1);
  2016. }
  2017. }
  2018. {
  2019. devtoolsComponentUpdated(ctx);
  2020. }
  2021. return res;
  2022. };
  2023. renderFnWithContext._n = true;
  2024. renderFnWithContext._c = true;
  2025. renderFnWithContext._d = true;
  2026. return renderFnWithContext;
  2027. }
  2028. function validateDirectiveName(name) {
  2029. if (isBuiltInDirective(name)) {
  2030. warn$1("Do not use built-in directive ids as custom directive id: " + name);
  2031. }
  2032. }
  2033. function invokeDirectiveHook(vnode, prevVNode, instance, name) {
  2034. const bindings = vnode.dirs;
  2035. const oldBindings = prevVNode && prevVNode.dirs;
  2036. for (let i = 0; i < bindings.length; i++) {
  2037. const binding = bindings[i];
  2038. if (oldBindings) {
  2039. binding.oldValue = oldBindings[i].value;
  2040. }
  2041. let hook = binding.dir[name];
  2042. if (hook) {
  2043. pauseTracking();
  2044. callWithAsyncErrorHandling(hook, instance, 8, [
  2045. vnode.el,
  2046. binding,
  2047. vnode,
  2048. prevVNode
  2049. ]);
  2050. resetTracking();
  2051. }
  2052. }
  2053. }
  2054. function setTransitionHooks(vnode, hooks) {
  2055. if (vnode.shapeFlag & 6 && vnode.component) {
  2056. setTransitionHooks(vnode.component.subTree, hooks);
  2057. } else if (vnode.shapeFlag & 128) {
  2058. vnode.ssContent.transition = hooks.clone(vnode.ssContent);
  2059. vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
  2060. } else {
  2061. vnode.transition = hooks;
  2062. }
  2063. }
  2064. const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
  2065. const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
  2066. function onActivated(hook, target) {
  2067. registerKeepAliveHook(hook, "a", target);
  2068. }
  2069. function onDeactivated(hook, target) {
  2070. registerKeepAliveHook(hook, "da", target);
  2071. }
  2072. function registerKeepAliveHook(hook, type, target = currentInstance) {
  2073. const wrappedHook = hook.__wdc || (hook.__wdc = () => {
  2074. let current = target;
  2075. while (current) {
  2076. if (current.isDeactivated) {
  2077. return;
  2078. }
  2079. current = current.parent;
  2080. }
  2081. return hook();
  2082. });
  2083. injectHook(type, wrappedHook, target);
  2084. if (target) {
  2085. let current = target.parent;
  2086. while (current && current.parent) {
  2087. if (isKeepAlive(current.parent.vnode)) {
  2088. injectToKeepAliveRoot(wrappedHook, type, target, current);
  2089. }
  2090. current = current.parent;
  2091. }
  2092. }
  2093. }
  2094. function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
  2095. const injected = injectHook(
  2096. type,
  2097. hook,
  2098. keepAliveRoot,
  2099. true
  2100. /* prepend */
  2101. );
  2102. onUnmounted(() => {
  2103. remove(keepAliveRoot[type], injected);
  2104. }, target);
  2105. }
  2106. function injectHook(type, hook, target = currentInstance, prepend = false) {
  2107. if (target) {
  2108. const hooks = target[type] || (target[type] = []);
  2109. const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
  2110. pauseTracking();
  2111. const reset = setCurrentInstance(target);
  2112. const res = callWithAsyncErrorHandling(hook, target, type, args);
  2113. reset();
  2114. resetTracking();
  2115. return res;
  2116. });
  2117. if (prepend) {
  2118. hooks.unshift(wrappedHook);
  2119. } else {
  2120. hooks.push(wrappedHook);
  2121. }
  2122. return wrappedHook;
  2123. } else {
  2124. const apiName = toHandlerKey(ErrorTypeStrings[type].replace(/ hook$/, ""));
  2125. warn$1(
  2126. `${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup().` + (` If you are using async setup(), make sure to register lifecycle hooks before the first await statement.` )
  2127. );
  2128. }
  2129. }
  2130. const createHook = (lifecycle) => (hook, target = currentInstance) => {
  2131. if (!isInSSRComponentSetup || lifecycle === "sp") {
  2132. injectHook(lifecycle, (...args) => hook(...args), target);
  2133. }
  2134. };
  2135. const onBeforeMount = createHook("bm");
  2136. const onMounted = createHook("m");
  2137. const onBeforeUpdate = createHook("bu");
  2138. const onUpdated = createHook("u");
  2139. const onBeforeUnmount = createHook("bum");
  2140. const onUnmounted = createHook("um");
  2141. const onServerPrefetch = createHook("sp");
  2142. const onRenderTriggered = createHook(
  2143. "rtg"
  2144. );
  2145. const onRenderTracked = createHook(
  2146. "rtc"
  2147. );
  2148. function onErrorCaptured(hook, target = currentInstance) {
  2149. injectHook("ec", hook, target);
  2150. }
  2151. const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
  2152. function ensureValidVNode$1(vnodes) {
  2153. return vnodes.some((child) => {
  2154. if (!isVNode$2(child)) return true;
  2155. if (child.type === Comment) return false;
  2156. if (child.type === Fragment && !ensureValidVNode$1(child.children))
  2157. return false;
  2158. return true;
  2159. }) ? vnodes : null;
  2160. }
  2161. const getPublicInstance = (i) => {
  2162. if (!i) return null;
  2163. if (isStatefulComponent(i)) return getComponentPublicInstance(i);
  2164. return getPublicInstance(i.parent);
  2165. };
  2166. const publicPropertiesMap = (
  2167. // Move PURE marker to new line to workaround compiler discarding it
  2168. // due to type annotation
  2169. /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), {
  2170. $: (i) => i,
  2171. $el: (i) => i.vnode.el,
  2172. $data: (i) => i.data,
  2173. $props: (i) => shallowReadonly(i.props) ,
  2174. $attrs: (i) => shallowReadonly(i.attrs) ,
  2175. $slots: (i) => shallowReadonly(i.slots) ,
  2176. $refs: (i) => shallowReadonly(i.refs) ,
  2177. $parent: (i) => getPublicInstance(i.parent),
  2178. $root: (i) => getPublicInstance(i.root),
  2179. $emit: (i) => i.emit,
  2180. $options: (i) => resolveMergedOptions(i) ,
  2181. $forceUpdate: (i) => i.f || (i.f = () => {
  2182. i.effect.dirty = true;
  2183. queueJob(i.update);
  2184. }),
  2185. $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)),
  2186. $watch: (i) => instanceWatch.bind(i)
  2187. })
  2188. );
  2189. const isReservedPrefix = (key) => key === "_" || key === "$";
  2190. const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
  2191. const PublicInstanceProxyHandlers = {
  2192. get({ _: instance }, key) {
  2193. if (key === "__v_skip") {
  2194. return true;
  2195. }
  2196. const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
  2197. if (key === "__isVue") {
  2198. return true;
  2199. }
  2200. let normalizedProps;
  2201. if (key[0] !== "$") {
  2202. const n = accessCache[key];
  2203. if (n !== void 0) {
  2204. switch (n) {
  2205. case 1 /* SETUP */:
  2206. return setupState[key];
  2207. case 2 /* DATA */:
  2208. return data[key];
  2209. case 4 /* CONTEXT */:
  2210. return ctx[key];
  2211. case 3 /* PROPS */:
  2212. return props[key];
  2213. }
  2214. } else if (hasSetupBinding(setupState, key)) {
  2215. accessCache[key] = 1 /* SETUP */;
  2216. return setupState[key];
  2217. } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
  2218. accessCache[key] = 2 /* DATA */;
  2219. return data[key];
  2220. } else if (
  2221. // only cache other properties when instance has declared (thus stable)
  2222. // props
  2223. (normalizedProps = instance.propsOptions[0]) && hasOwn(normalizedProps, key)
  2224. ) {
  2225. accessCache[key] = 3 /* PROPS */;
  2226. return props[key];
  2227. } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
  2228. accessCache[key] = 4 /* CONTEXT */;
  2229. return ctx[key];
  2230. } else if (shouldCacheAccess) {
  2231. accessCache[key] = 0 /* OTHER */;
  2232. }
  2233. }
  2234. const publicGetter = publicPropertiesMap[key];
  2235. let cssModule, globalProperties;
  2236. if (publicGetter) {
  2237. if (key === "$attrs") {
  2238. track(instance.attrs, "get", "");
  2239. markAttrsAccessed();
  2240. } else if (key === "$slots") {
  2241. track(instance, "get", key);
  2242. }
  2243. return publicGetter(instance);
  2244. } else if (
  2245. // css module (injected by vue-loader)
  2246. (cssModule = type.__cssModules) && (cssModule = cssModule[key])
  2247. ) {
  2248. return cssModule;
  2249. } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
  2250. accessCache[key] = 4 /* CONTEXT */;
  2251. return ctx[key];
  2252. } else if (
  2253. // global properties
  2254. globalProperties = appContext.config.globalProperties, hasOwn(globalProperties, key)
  2255. ) {
  2256. {
  2257. return globalProperties[key];
  2258. }
  2259. } else if (currentRenderingInstance && (!isString(key) || // #1091 avoid internal isRef/isVNode checks on component instance leading
  2260. // to infinite warning loop
  2261. key.indexOf("__v") !== 0)) {
  2262. if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn(data, key)) {
  2263. warn$1(
  2264. `Property ${JSON.stringify(
  2265. key
  2266. )} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`
  2267. );
  2268. } else if (instance === currentRenderingInstance) {
  2269. warn$1(
  2270. `Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.`
  2271. );
  2272. }
  2273. }
  2274. },
  2275. set({ _: instance }, key, value) {
  2276. const { data, setupState, ctx } = instance;
  2277. if (hasSetupBinding(setupState, key)) {
  2278. setupState[key] = value;
  2279. return true;
  2280. } else if (setupState.__isScriptSetup && hasOwn(setupState, key)) {
  2281. warn$1(`Cannot mutate <script setup> binding "${key}" from Options API.`);
  2282. return false;
  2283. } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
  2284. data[key] = value;
  2285. return true;
  2286. } else if (hasOwn(instance.props, key)) {
  2287. warn$1(`Attempting to mutate prop "${key}". Props are readonly.`);
  2288. return false;
  2289. }
  2290. if (key[0] === "$" && key.slice(1) in instance) {
  2291. warn$1(
  2292. `Attempting to mutate public property "${key}". Properties starting with $ are reserved and readonly.`
  2293. );
  2294. return false;
  2295. } else {
  2296. if (key in instance.appContext.config.globalProperties) {
  2297. Object.defineProperty(ctx, key, {
  2298. enumerable: true,
  2299. configurable: true,
  2300. value
  2301. });
  2302. } else {
  2303. ctx[key] = value;
  2304. }
  2305. }
  2306. return true;
  2307. },
  2308. has({
  2309. _: { data, setupState, accessCache, ctx, appContext, propsOptions }
  2310. }, key) {
  2311. let normalizedProps;
  2312. return !!accessCache[key] || data !== EMPTY_OBJ && hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key);
  2313. },
  2314. defineProperty(target, key, descriptor) {
  2315. if (descriptor.get != null) {
  2316. target._.accessCache[key] = 0;
  2317. } else if (hasOwn(descriptor, "value")) {
  2318. this.set(target, key, descriptor.value, null);
  2319. }
  2320. return Reflect.defineProperty(target, key, descriptor);
  2321. }
  2322. };
  2323. {
  2324. PublicInstanceProxyHandlers.ownKeys = (target) => {
  2325. warn$1(
  2326. `Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.`
  2327. );
  2328. return Reflect.ownKeys(target);
  2329. };
  2330. }
  2331. function createDevRenderContext(instance) {
  2332. const target = {};
  2333. Object.defineProperty(target, `_`, {
  2334. configurable: true,
  2335. enumerable: false,
  2336. get: () => instance
  2337. });
  2338. Object.keys(publicPropertiesMap).forEach((key) => {
  2339. Object.defineProperty(target, key, {
  2340. configurable: true,
  2341. enumerable: false,
  2342. get: () => publicPropertiesMap[key](instance),
  2343. // intercepted by the proxy so no need for implementation,
  2344. // but needed to prevent set errors
  2345. set: NOOP
  2346. });
  2347. });
  2348. return target;
  2349. }
  2350. function exposePropsOnRenderContext(instance) {
  2351. const {
  2352. ctx,
  2353. propsOptions: [propsOptions]
  2354. } = instance;
  2355. if (propsOptions) {
  2356. Object.keys(propsOptions).forEach((key) => {
  2357. Object.defineProperty(ctx, key, {
  2358. enumerable: true,
  2359. configurable: true,
  2360. get: () => instance.props[key],
  2361. set: NOOP
  2362. });
  2363. });
  2364. }
  2365. }
  2366. function exposeSetupStateOnRenderContext(instance) {
  2367. const { ctx, setupState } = instance;
  2368. Object.keys(toRaw(setupState)).forEach((key) => {
  2369. if (!setupState.__isScriptSetup) {
  2370. if (isReservedPrefix(key[0])) {
  2371. warn$1(
  2372. `setup() return property ${JSON.stringify(
  2373. key
  2374. )} should not start with "$" or "_" which are reserved prefixes for Vue internals.`
  2375. );
  2376. return;
  2377. }
  2378. Object.defineProperty(ctx, key, {
  2379. enumerable: true,
  2380. configurable: true,
  2381. get: () => setupState[key],
  2382. set: NOOP
  2383. });
  2384. }
  2385. });
  2386. }
  2387. function normalizePropsOrEmits(props) {
  2388. return isArray(props) ? props.reduce(
  2389. (normalized, p) => (normalized[p] = null, normalized),
  2390. {}
  2391. ) : props;
  2392. }
  2393. function createDuplicateChecker() {
  2394. const cache = /* @__PURE__ */ Object.create(null);
  2395. return (type, key) => {
  2396. if (cache[key]) {
  2397. warn$1(`${type} property "${key}" is already defined in ${cache[key]}.`);
  2398. } else {
  2399. cache[key] = type;
  2400. }
  2401. };
  2402. }
  2403. let shouldCacheAccess = true;
  2404. function applyOptions(instance) {
  2405. const options = resolveMergedOptions(instance);
  2406. const publicThis = instance.proxy;
  2407. const ctx = instance.ctx;
  2408. shouldCacheAccess = false;
  2409. if (options.beforeCreate) {
  2410. callHook(options.beforeCreate, instance, "bc");
  2411. }
  2412. const {
  2413. // state
  2414. data: dataOptions,
  2415. computed: computedOptions,
  2416. methods,
  2417. watch: watchOptions,
  2418. provide: provideOptions,
  2419. inject: injectOptions,
  2420. // lifecycle
  2421. created,
  2422. beforeMount,
  2423. mounted,
  2424. beforeUpdate,
  2425. updated,
  2426. activated,
  2427. deactivated,
  2428. beforeDestroy,
  2429. beforeUnmount,
  2430. destroyed,
  2431. unmounted,
  2432. render,
  2433. renderTracked,
  2434. renderTriggered,
  2435. errorCaptured,
  2436. serverPrefetch,
  2437. // public API
  2438. expose,
  2439. inheritAttrs,
  2440. // assets
  2441. components,
  2442. directives,
  2443. filters
  2444. } = options;
  2445. const checkDuplicateProperties = createDuplicateChecker() ;
  2446. {
  2447. const [propsOptions] = instance.propsOptions;
  2448. if (propsOptions) {
  2449. for (const key in propsOptions) {
  2450. checkDuplicateProperties("Props" /* PROPS */, key);
  2451. }
  2452. }
  2453. }
  2454. if (injectOptions) {
  2455. resolveInjections(injectOptions, ctx, checkDuplicateProperties);
  2456. }
  2457. if (methods) {
  2458. for (const key in methods) {
  2459. const methodHandler = methods[key];
  2460. if (isFunction(methodHandler)) {
  2461. {
  2462. Object.defineProperty(ctx, key, {
  2463. value: methodHandler.bind(publicThis),
  2464. configurable: true,
  2465. enumerable: true,
  2466. writable: true
  2467. });
  2468. }
  2469. {
  2470. checkDuplicateProperties("Methods" /* METHODS */, key);
  2471. }
  2472. } else {
  2473. warn$1(
  2474. `Method "${key}" has type "${typeof methodHandler}" in the component definition. Did you reference the function correctly?`
  2475. );
  2476. }
  2477. }
  2478. }
  2479. if (dataOptions) {
  2480. if (!isFunction(dataOptions)) {
  2481. warn$1(
  2482. `The data option must be a function. Plain object usage is no longer supported.`
  2483. );
  2484. }
  2485. const data = dataOptions.call(publicThis, publicThis);
  2486. if (isPromise(data)) {
  2487. warn$1(
  2488. `data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>.`
  2489. );
  2490. }
  2491. if (!isObject(data)) {
  2492. warn$1(`data() should return an object.`);
  2493. } else {
  2494. instance.data = reactive(data);
  2495. {
  2496. for (const key in data) {
  2497. checkDuplicateProperties("Data" /* DATA */, key);
  2498. if (!isReservedPrefix(key[0])) {
  2499. Object.defineProperty(ctx, key, {
  2500. configurable: true,
  2501. enumerable: true,
  2502. get: () => data[key],
  2503. set: NOOP
  2504. });
  2505. }
  2506. }
  2507. }
  2508. }
  2509. }
  2510. shouldCacheAccess = true;
  2511. if (computedOptions) {
  2512. for (const key in computedOptions) {
  2513. const opt = computedOptions[key];
  2514. const get = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
  2515. if (get === NOOP) {
  2516. warn$1(`Computed property "${key}" has no getter.`);
  2517. }
  2518. const set = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : () => {
  2519. warn$1(
  2520. `Write operation failed: computed property "${key}" is readonly.`
  2521. );
  2522. } ;
  2523. const c = computed({
  2524. get,
  2525. set
  2526. });
  2527. Object.defineProperty(ctx, key, {
  2528. enumerable: true,
  2529. configurable: true,
  2530. get: () => c.value,
  2531. set: (v) => c.value = v
  2532. });
  2533. {
  2534. checkDuplicateProperties("Computed" /* COMPUTED */, key);
  2535. }
  2536. }
  2537. }
  2538. if (watchOptions) {
  2539. for (const key in watchOptions) {
  2540. createWatcher(watchOptions[key], ctx, publicThis, key);
  2541. }
  2542. }
  2543. if (provideOptions) {
  2544. const provides = isFunction(provideOptions) ? provideOptions.call(publicThis) : provideOptions;
  2545. Reflect.ownKeys(provides).forEach((key) => {
  2546. provide(key, provides[key]);
  2547. });
  2548. }
  2549. if (created) {
  2550. callHook(created, instance, "c");
  2551. }
  2552. function registerLifecycleHook(register, hook) {
  2553. if (isArray(hook)) {
  2554. hook.forEach((_hook) => register(_hook.bind(publicThis)));
  2555. } else if (hook) {
  2556. register(hook.bind(publicThis));
  2557. }
  2558. }
  2559. registerLifecycleHook(onBeforeMount, beforeMount);
  2560. registerLifecycleHook(onMounted, mounted);
  2561. registerLifecycleHook(onBeforeUpdate, beforeUpdate);
  2562. registerLifecycleHook(onUpdated, updated);
  2563. registerLifecycleHook(onActivated, activated);
  2564. registerLifecycleHook(onDeactivated, deactivated);
  2565. registerLifecycleHook(onErrorCaptured, errorCaptured);
  2566. registerLifecycleHook(onRenderTracked, renderTracked);
  2567. registerLifecycleHook(onRenderTriggered, renderTriggered);
  2568. registerLifecycleHook(onBeforeUnmount, beforeUnmount);
  2569. registerLifecycleHook(onUnmounted, unmounted);
  2570. registerLifecycleHook(onServerPrefetch, serverPrefetch);
  2571. if (isArray(expose)) {
  2572. if (expose.length) {
  2573. const exposed = instance.exposed || (instance.exposed = {});
  2574. expose.forEach((key) => {
  2575. Object.defineProperty(exposed, key, {
  2576. get: () => publicThis[key],
  2577. set: (val) => publicThis[key] = val
  2578. });
  2579. });
  2580. } else if (!instance.exposed) {
  2581. instance.exposed = {};
  2582. }
  2583. }
  2584. if (render && instance.render === NOOP) {
  2585. instance.render = render;
  2586. }
  2587. if (inheritAttrs != null) {
  2588. instance.inheritAttrs = inheritAttrs;
  2589. }
  2590. if (components) instance.components = components;
  2591. if (directives) instance.directives = directives;
  2592. }
  2593. function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP) {
  2594. if (isArray(injectOptions)) {
  2595. injectOptions = normalizeInject(injectOptions);
  2596. }
  2597. for (const key in injectOptions) {
  2598. const opt = injectOptions[key];
  2599. let injected;
  2600. if (isObject(opt)) {
  2601. if ("default" in opt) {
  2602. injected = inject(
  2603. opt.from || key,
  2604. opt.default,
  2605. true
  2606. );
  2607. } else {
  2608. injected = inject(opt.from || key);
  2609. }
  2610. } else {
  2611. injected = inject(opt);
  2612. }
  2613. if (isRef(injected)) {
  2614. Object.defineProperty(ctx, key, {
  2615. enumerable: true,
  2616. configurable: true,
  2617. get: () => injected.value,
  2618. set: (v) => injected.value = v
  2619. });
  2620. } else {
  2621. ctx[key] = injected;
  2622. }
  2623. {
  2624. checkDuplicateProperties("Inject" /* INJECT */, key);
  2625. }
  2626. }
  2627. }
  2628. function callHook(hook, instance, type) {
  2629. callWithAsyncErrorHandling(
  2630. isArray(hook) ? hook.map((h) => h.bind(instance.proxy)) : hook.bind(instance.proxy),
  2631. instance,
  2632. type
  2633. );
  2634. }
  2635. function createWatcher(raw, ctx, publicThis, key) {
  2636. const getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key];
  2637. if (isString(raw)) {
  2638. const handler = ctx[raw];
  2639. if (isFunction(handler)) {
  2640. watch(getter, handler);
  2641. } else {
  2642. warn$1(`Invalid watch handler specified by key "${raw}"`, handler);
  2643. }
  2644. } else if (isFunction(raw)) {
  2645. watch(getter, raw.bind(publicThis));
  2646. } else if (isObject(raw)) {
  2647. if (isArray(raw)) {
  2648. raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
  2649. } else {
  2650. const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
  2651. if (isFunction(handler)) {
  2652. watch(getter, handler, raw);
  2653. } else {
  2654. warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler);
  2655. }
  2656. }
  2657. } else {
  2658. warn$1(`Invalid watch option: "${key}"`, raw);
  2659. }
  2660. }
  2661. function resolveMergedOptions(instance) {
  2662. const base = instance.type;
  2663. const { mixins, extends: extendsOptions } = base;
  2664. const {
  2665. mixins: globalMixins,
  2666. optionsCache: cache,
  2667. config: { optionMergeStrategies }
  2668. } = instance.appContext;
  2669. const cached = cache.get(base);
  2670. let resolved;
  2671. if (cached) {
  2672. resolved = cached;
  2673. } else if (!globalMixins.length && !mixins && !extendsOptions) {
  2674. {
  2675. resolved = base;
  2676. }
  2677. } else {
  2678. resolved = {};
  2679. if (globalMixins.length) {
  2680. globalMixins.forEach(
  2681. (m) => mergeOptions(resolved, m, optionMergeStrategies, true)
  2682. );
  2683. }
  2684. mergeOptions(resolved, base, optionMergeStrategies);
  2685. }
  2686. if (isObject(base)) {
  2687. cache.set(base, resolved);
  2688. }
  2689. return resolved;
  2690. }
  2691. function mergeOptions(to, from, strats, asMixin = false) {
  2692. const { mixins, extends: extendsOptions } = from;
  2693. if (extendsOptions) {
  2694. mergeOptions(to, extendsOptions, strats, true);
  2695. }
  2696. if (mixins) {
  2697. mixins.forEach(
  2698. (m) => mergeOptions(to, m, strats, true)
  2699. );
  2700. }
  2701. for (const key in from) {
  2702. if (asMixin && key === "expose") {
  2703. warn$1(
  2704. `"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.`
  2705. );
  2706. } else {
  2707. const strat = internalOptionMergeStrats[key] || strats && strats[key];
  2708. to[key] = strat ? strat(to[key], from[key]) : from[key];
  2709. }
  2710. }
  2711. return to;
  2712. }
  2713. const internalOptionMergeStrats = {
  2714. data: mergeDataFn,
  2715. props: mergeEmitsOrPropsOptions,
  2716. emits: mergeEmitsOrPropsOptions,
  2717. // objects
  2718. methods: mergeObjectOptions,
  2719. computed: mergeObjectOptions,
  2720. // lifecycle
  2721. beforeCreate: mergeAsArray,
  2722. created: mergeAsArray,
  2723. beforeMount: mergeAsArray,
  2724. mounted: mergeAsArray,
  2725. beforeUpdate: mergeAsArray,
  2726. updated: mergeAsArray,
  2727. beforeDestroy: mergeAsArray,
  2728. beforeUnmount: mergeAsArray,
  2729. destroyed: mergeAsArray,
  2730. unmounted: mergeAsArray,
  2731. activated: mergeAsArray,
  2732. deactivated: mergeAsArray,
  2733. errorCaptured: mergeAsArray,
  2734. serverPrefetch: mergeAsArray,
  2735. // assets
  2736. components: mergeObjectOptions,
  2737. directives: mergeObjectOptions,
  2738. // watch
  2739. watch: mergeWatchOptions,
  2740. // provide / inject
  2741. provide: mergeDataFn,
  2742. inject: mergeInject
  2743. };
  2744. function mergeDataFn(to, from) {
  2745. if (!from) {
  2746. return to;
  2747. }
  2748. if (!to) {
  2749. return from;
  2750. }
  2751. return function mergedDataFn() {
  2752. return (extend)(
  2753. isFunction(to) ? to.call(this, this) : to,
  2754. isFunction(from) ? from.call(this, this) : from
  2755. );
  2756. };
  2757. }
  2758. function mergeInject(to, from) {
  2759. return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
  2760. }
  2761. function normalizeInject(raw) {
  2762. if (isArray(raw)) {
  2763. const res = {};
  2764. for (let i = 0; i < raw.length; i++) {
  2765. res[raw[i]] = raw[i];
  2766. }
  2767. return res;
  2768. }
  2769. return raw;
  2770. }
  2771. function mergeAsArray(to, from) {
  2772. return to ? [...new Set([].concat(to, from))] : from;
  2773. }
  2774. function mergeObjectOptions(to, from) {
  2775. return to ? extend(/* @__PURE__ */ Object.create(null), to, from) : from;
  2776. }
  2777. function mergeEmitsOrPropsOptions(to, from) {
  2778. if (to) {
  2779. if (isArray(to) && isArray(from)) {
  2780. return [.../* @__PURE__ */ new Set([...to, ...from])];
  2781. }
  2782. return extend(
  2783. /* @__PURE__ */ Object.create(null),
  2784. normalizePropsOrEmits(to),
  2785. normalizePropsOrEmits(from != null ? from : {})
  2786. );
  2787. } else {
  2788. return from;
  2789. }
  2790. }
  2791. function mergeWatchOptions(to, from) {
  2792. if (!to) return from;
  2793. if (!from) return to;
  2794. const merged = extend(/* @__PURE__ */ Object.create(null), to);
  2795. for (const key in from) {
  2796. merged[key] = mergeAsArray(to[key], from[key]);
  2797. }
  2798. return merged;
  2799. }
  2800. function createAppContext() {
  2801. return {
  2802. app: null,
  2803. config: {
  2804. isNativeTag: NO,
  2805. performance: false,
  2806. globalProperties: {},
  2807. optionMergeStrategies: {},
  2808. errorHandler: void 0,
  2809. warnHandler: void 0,
  2810. compilerOptions: {}
  2811. },
  2812. mixins: [],
  2813. components: {},
  2814. directives: {},
  2815. provides: /* @__PURE__ */ Object.create(null),
  2816. optionsCache: /* @__PURE__ */ new WeakMap(),
  2817. propsCache: /* @__PURE__ */ new WeakMap(),
  2818. emitsCache: /* @__PURE__ */ new WeakMap()
  2819. };
  2820. }
  2821. let uid$1 = 0;
  2822. function createAppAPI(render, hydrate) {
  2823. return function createApp(rootComponent, rootProps = null) {
  2824. if (!isFunction(rootComponent)) {
  2825. rootComponent = extend({}, rootComponent);
  2826. }
  2827. if (rootProps != null && !isObject(rootProps)) {
  2828. warn$1(`root props passed to app.mount() must be an object.`);
  2829. rootProps = null;
  2830. }
  2831. const context = createAppContext();
  2832. const installedPlugins = /* @__PURE__ */ new WeakSet();
  2833. let isMounted = false;
  2834. const app = context.app = {
  2835. _uid: uid$1++,
  2836. _component: rootComponent,
  2837. _props: rootProps,
  2838. _container: null,
  2839. _context: context,
  2840. _instance: null,
  2841. version,
  2842. get config() {
  2843. return context.config;
  2844. },
  2845. set config(v) {
  2846. {
  2847. warn$1(
  2848. `app.config cannot be replaced. Modify individual options instead.`
  2849. );
  2850. }
  2851. },
  2852. use(plugin, ...options) {
  2853. if (installedPlugins.has(plugin)) {
  2854. warn$1(`Plugin has already been applied to target app.`);
  2855. } else if (plugin && isFunction(plugin.install)) {
  2856. installedPlugins.add(plugin);
  2857. plugin.install(app, ...options);
  2858. } else if (isFunction(plugin)) {
  2859. installedPlugins.add(plugin);
  2860. plugin(app, ...options);
  2861. } else {
  2862. warn$1(
  2863. `A plugin must either be a function or an object with an "install" function.`
  2864. );
  2865. }
  2866. return app;
  2867. },
  2868. mixin(mixin) {
  2869. {
  2870. if (!context.mixins.includes(mixin)) {
  2871. context.mixins.push(mixin);
  2872. } else {
  2873. warn$1(
  2874. "Mixin has already been applied to target app" + (mixin.name ? `: ${mixin.name}` : "")
  2875. );
  2876. }
  2877. }
  2878. return app;
  2879. },
  2880. component(name, component) {
  2881. {
  2882. validateComponentName(name, context.config);
  2883. }
  2884. if (!component) {
  2885. return context.components[name];
  2886. }
  2887. if (context.components[name]) {
  2888. warn$1(`Component "${name}" has already been registered in target app.`);
  2889. }
  2890. context.components[name] = component;
  2891. return app;
  2892. },
  2893. directive(name, directive) {
  2894. {
  2895. validateDirectiveName(name);
  2896. }
  2897. if (!directive) {
  2898. return context.directives[name];
  2899. }
  2900. if (context.directives[name]) {
  2901. warn$1(`Directive "${name}" has already been registered in target app.`);
  2902. }
  2903. context.directives[name] = directive;
  2904. return app;
  2905. },
  2906. mount(rootContainer, isHydrate, namespace) {
  2907. if (!isMounted) {
  2908. if (rootContainer.__vue_app__) {
  2909. warn$1(
  2910. `There is already an app instance mounted on the host container.
  2911. If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.`
  2912. );
  2913. }
  2914. const vnode = createVNode(rootComponent, rootProps);
  2915. vnode.appContext = context;
  2916. if (namespace === true) {
  2917. namespace = "svg";
  2918. } else if (namespace === false) {
  2919. namespace = void 0;
  2920. }
  2921. {
  2922. context.reload = () => {
  2923. render(
  2924. cloneVNode(vnode),
  2925. rootContainer,
  2926. namespace
  2927. );
  2928. };
  2929. }
  2930. if (isHydrate && hydrate) {
  2931. hydrate(vnode, rootContainer);
  2932. } else {
  2933. render(vnode, rootContainer, namespace);
  2934. }
  2935. isMounted = true;
  2936. app._container = rootContainer;
  2937. rootContainer.__vue_app__ = app;
  2938. {
  2939. app._instance = vnode.component;
  2940. devtoolsInitApp(app, version);
  2941. }
  2942. return getComponentPublicInstance(vnode.component);
  2943. } else {
  2944. warn$1(
  2945. `App has already been mounted.
  2946. If you want to remount the same app, move your app creation logic into a factory function and create fresh app instances for each mount - e.g. \`const createMyApp = () => createApp(App)\``
  2947. );
  2948. }
  2949. },
  2950. unmount() {
  2951. if (isMounted) {
  2952. render(null, app._container);
  2953. {
  2954. app._instance = null;
  2955. devtoolsUnmountApp(app);
  2956. }
  2957. delete app._container.__vue_app__;
  2958. } else {
  2959. warn$1(`Cannot unmount an app that is not mounted.`);
  2960. }
  2961. },
  2962. provide(key, value) {
  2963. if (key in context.provides) {
  2964. warn$1(
  2965. `App already provides property with key "${String(key)}". It will be overwritten with the new value.`
  2966. );
  2967. }
  2968. context.provides[key] = value;
  2969. return app;
  2970. },
  2971. runWithContext(fn) {
  2972. const lastApp = currentApp;
  2973. currentApp = app;
  2974. try {
  2975. return fn();
  2976. } finally {
  2977. currentApp = lastApp;
  2978. }
  2979. }
  2980. };
  2981. return app;
  2982. };
  2983. }
  2984. let currentApp = null;
  2985. function provide(key, value) {
  2986. if (!currentInstance) {
  2987. {
  2988. warn$1(`provide() can only be used inside setup().`);
  2989. }
  2990. } else {
  2991. let provides = currentInstance.provides;
  2992. const parentProvides = currentInstance.parent && currentInstance.parent.provides;
  2993. if (parentProvides === provides) {
  2994. provides = currentInstance.provides = Object.create(parentProvides);
  2995. }
  2996. provides[key] = value;
  2997. }
  2998. }
  2999. function inject(key, defaultValue, treatDefaultAsFactory = false) {
  3000. const instance = currentInstance || currentRenderingInstance;
  3001. if (instance || currentApp) {
  3002. const provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
  3003. if (provides && key in provides) {
  3004. return provides[key];
  3005. } else if (arguments.length > 1) {
  3006. return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
  3007. } else {
  3008. warn$1(`injection "${String(key)}" not found.`);
  3009. }
  3010. } else {
  3011. warn$1(`inject() can only be used inside setup() or functional components.`);
  3012. }
  3013. }
  3014. const internalObjectProto = {};
  3015. const createInternalObject = () => Object.create(internalObjectProto);
  3016. const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
  3017. function initProps(instance, rawProps, isStateful, isSSR = false) {
  3018. const props = {};
  3019. const attrs = createInternalObject();
  3020. instance.propsDefaults = /* @__PURE__ */ Object.create(null);
  3021. setFullProps(instance, rawProps, props, attrs);
  3022. for (const key in instance.propsOptions[0]) {
  3023. if (!(key in props)) {
  3024. props[key] = void 0;
  3025. }
  3026. }
  3027. {
  3028. validateProps(rawProps || {}, props, instance);
  3029. }
  3030. if (isStateful) {
  3031. instance.props = isSSR ? props : shallowReactive(props);
  3032. } else {
  3033. if (!instance.type.props) {
  3034. instance.props = attrs;
  3035. } else {
  3036. instance.props = props;
  3037. }
  3038. }
  3039. instance.attrs = attrs;
  3040. }
  3041. function isInHmrContext(instance) {
  3042. while (instance) {
  3043. if (instance.type.__hmrId) return true;
  3044. instance = instance.parent;
  3045. }
  3046. }
  3047. function updateProps(instance, rawProps, rawPrevProps, optimized) {
  3048. const {
  3049. props,
  3050. attrs,
  3051. vnode: { patchFlag }
  3052. } = instance;
  3053. const rawCurrentProps = toRaw(props);
  3054. const [options] = instance.propsOptions;
  3055. let hasAttrsChanged = false;
  3056. if (
  3057. // always force full diff in dev
  3058. // - #1942 if hmr is enabled with sfc component
  3059. // - vite#872 non-sfc component used by sfc component
  3060. !isInHmrContext(instance) && (optimized || patchFlag > 0) && !(patchFlag & 16)
  3061. ) {
  3062. if (patchFlag & 8) {
  3063. const propsToUpdate = instance.vnode.dynamicProps;
  3064. for (let i = 0; i < propsToUpdate.length; i++) {
  3065. let key = propsToUpdate[i];
  3066. if (isEmitListener(instance.emitsOptions, key)) {
  3067. continue;
  3068. }
  3069. const value = rawProps[key];
  3070. if (options) {
  3071. if (hasOwn(attrs, key)) {
  3072. if (value !== attrs[key]) {
  3073. attrs[key] = value;
  3074. hasAttrsChanged = true;
  3075. }
  3076. } else {
  3077. const camelizedKey = camelize(key);
  3078. props[camelizedKey] = resolvePropValue(
  3079. options,
  3080. rawCurrentProps,
  3081. camelizedKey,
  3082. value,
  3083. instance,
  3084. false
  3085. );
  3086. }
  3087. } else {
  3088. if (value !== attrs[key]) {
  3089. attrs[key] = value;
  3090. hasAttrsChanged = true;
  3091. }
  3092. }
  3093. }
  3094. }
  3095. } else {
  3096. if (setFullProps(instance, rawProps, props, attrs)) {
  3097. hasAttrsChanged = true;
  3098. }
  3099. let kebabKey;
  3100. for (const key in rawCurrentProps) {
  3101. if (!rawProps || // for camelCase
  3102. !hasOwn(rawProps, key) && // it's possible the original props was passed in as kebab-case
  3103. // and converted to camelCase (#955)
  3104. ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) {
  3105. if (options) {
  3106. if (rawPrevProps && // for camelCase
  3107. (rawPrevProps[key] !== void 0 || // for kebab-case
  3108. rawPrevProps[kebabKey] !== void 0)) {
  3109. props[key] = resolvePropValue(
  3110. options,
  3111. rawCurrentProps,
  3112. key,
  3113. void 0,
  3114. instance,
  3115. true
  3116. );
  3117. }
  3118. } else {
  3119. delete props[key];
  3120. }
  3121. }
  3122. }
  3123. if (attrs !== rawCurrentProps) {
  3124. for (const key in attrs) {
  3125. if (!rawProps || !hasOwn(rawProps, key) && true) {
  3126. delete attrs[key];
  3127. hasAttrsChanged = true;
  3128. }
  3129. }
  3130. }
  3131. }
  3132. if (hasAttrsChanged) {
  3133. trigger(instance.attrs, "set", "");
  3134. }
  3135. {
  3136. validateProps(rawProps || {}, props, instance);
  3137. }
  3138. }
  3139. function setFullProps(instance, rawProps, props, attrs) {
  3140. const [options, needCastKeys] = instance.propsOptions;
  3141. let hasAttrsChanged = false;
  3142. let rawCastValues;
  3143. if (rawProps) {
  3144. for (let key in rawProps) {
  3145. if (isReservedProp(key)) {
  3146. continue;
  3147. }
  3148. const value = rawProps[key];
  3149. let camelKey;
  3150. if (options && hasOwn(options, camelKey = camelize(key))) {
  3151. if (!needCastKeys || !needCastKeys.includes(camelKey)) {
  3152. props[camelKey] = value;
  3153. } else {
  3154. (rawCastValues || (rawCastValues = {}))[camelKey] = value;
  3155. }
  3156. } else if (!isEmitListener(instance.emitsOptions, key)) {
  3157. if (!(key in attrs) || value !== attrs[key]) {
  3158. attrs[key] = value;
  3159. hasAttrsChanged = true;
  3160. }
  3161. }
  3162. }
  3163. }
  3164. if (needCastKeys) {
  3165. const rawCurrentProps = toRaw(props);
  3166. const castValues = rawCastValues || EMPTY_OBJ;
  3167. for (let i = 0; i < needCastKeys.length; i++) {
  3168. const key = needCastKeys[i];
  3169. props[key] = resolvePropValue(
  3170. options,
  3171. rawCurrentProps,
  3172. key,
  3173. castValues[key],
  3174. instance,
  3175. !hasOwn(castValues, key)
  3176. );
  3177. }
  3178. }
  3179. return hasAttrsChanged;
  3180. }
  3181. function resolvePropValue(options, props, key, value, instance, isAbsent) {
  3182. const opt = options[key];
  3183. if (opt != null) {
  3184. const hasDefault = hasOwn(opt, "default");
  3185. if (hasDefault && value === void 0) {
  3186. const defaultValue = opt.default;
  3187. if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) {
  3188. const { propsDefaults } = instance;
  3189. if (key in propsDefaults) {
  3190. value = propsDefaults[key];
  3191. } else {
  3192. const reset = setCurrentInstance(instance);
  3193. value = propsDefaults[key] = defaultValue.call(
  3194. null,
  3195. props
  3196. );
  3197. reset();
  3198. }
  3199. } else {
  3200. value = defaultValue;
  3201. }
  3202. }
  3203. if (opt[0 /* shouldCast */]) {
  3204. if (isAbsent && !hasDefault) {
  3205. value = false;
  3206. } else if (opt[1 /* shouldCastTrue */] && (value === "" || value === hyphenate(key))) {
  3207. value = true;
  3208. }
  3209. }
  3210. }
  3211. return value;
  3212. }
  3213. const mixinPropsCache = /* @__PURE__ */ new WeakMap();
  3214. function normalizePropsOptions(comp, appContext, asMixin = false) {
  3215. const cache = asMixin ? mixinPropsCache : appContext.propsCache;
  3216. const cached = cache.get(comp);
  3217. if (cached) {
  3218. return cached;
  3219. }
  3220. const raw = comp.props;
  3221. const normalized = {};
  3222. const needCastKeys = [];
  3223. let hasExtends = false;
  3224. if (!isFunction(comp)) {
  3225. const extendProps = (raw2) => {
  3226. hasExtends = true;
  3227. const [props, keys] = normalizePropsOptions(raw2, appContext, true);
  3228. extend(normalized, props);
  3229. if (keys) needCastKeys.push(...keys);
  3230. };
  3231. if (!asMixin && appContext.mixins.length) {
  3232. appContext.mixins.forEach(extendProps);
  3233. }
  3234. if (comp.extends) {
  3235. extendProps(comp.extends);
  3236. }
  3237. if (comp.mixins) {
  3238. comp.mixins.forEach(extendProps);
  3239. }
  3240. }
  3241. if (!raw && !hasExtends) {
  3242. if (isObject(comp)) {
  3243. cache.set(comp, EMPTY_ARR);
  3244. }
  3245. return EMPTY_ARR;
  3246. }
  3247. if (isArray(raw)) {
  3248. for (let i = 0; i < raw.length; i++) {
  3249. if (!isString(raw[i])) {
  3250. warn$1(`props must be strings when using array syntax.`, raw[i]);
  3251. }
  3252. const normalizedKey = camelize(raw[i]);
  3253. if (validatePropName(normalizedKey)) {
  3254. normalized[normalizedKey] = EMPTY_OBJ;
  3255. }
  3256. }
  3257. } else if (raw) {
  3258. if (!isObject(raw)) {
  3259. warn$1(`invalid props options`, raw);
  3260. }
  3261. for (const key in raw) {
  3262. const normalizedKey = camelize(key);
  3263. if (validatePropName(normalizedKey)) {
  3264. const opt = raw[key];
  3265. const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt);
  3266. const propType = prop.type;
  3267. let shouldCast = false;
  3268. let shouldCastTrue = true;
  3269. if (isArray(propType)) {
  3270. for (let index = 0; index < propType.length; ++index) {
  3271. const type = propType[index];
  3272. const typeName = isFunction(type) && type.name;
  3273. if (typeName === "Boolean") {
  3274. shouldCast = true;
  3275. break;
  3276. } else if (typeName === "String") {
  3277. shouldCastTrue = false;
  3278. }
  3279. }
  3280. } else {
  3281. shouldCast = isFunction(propType) && propType.name === "Boolean";
  3282. }
  3283. prop[0 /* shouldCast */] = shouldCast;
  3284. prop[1 /* shouldCastTrue */] = shouldCastTrue;
  3285. if (shouldCast || hasOwn(prop, "default")) {
  3286. needCastKeys.push(normalizedKey);
  3287. }
  3288. }
  3289. }
  3290. }
  3291. const res = [normalized, needCastKeys];
  3292. if (isObject(comp)) {
  3293. cache.set(comp, res);
  3294. }
  3295. return res;
  3296. }
  3297. function validatePropName(key) {
  3298. if (key[0] !== "$" && !isReservedProp(key)) {
  3299. return true;
  3300. } else {
  3301. warn$1(`Invalid prop name: "${key}" is a reserved property.`);
  3302. }
  3303. return false;
  3304. }
  3305. function getType(ctor) {
  3306. if (ctor === null) {
  3307. return "null";
  3308. }
  3309. if (typeof ctor === "function") {
  3310. return ctor.name || "";
  3311. } else if (typeof ctor === "object") {
  3312. const name = ctor.constructor && ctor.constructor.name;
  3313. return name || "";
  3314. }
  3315. return "";
  3316. }
  3317. function validateProps(rawProps, props, instance) {
  3318. const resolvedValues = toRaw(props);
  3319. const options = instance.propsOptions[0];
  3320. for (const key in options) {
  3321. let opt = options[key];
  3322. if (opt == null) continue;
  3323. validateProp(
  3324. key,
  3325. resolvedValues[key],
  3326. opt,
  3327. shallowReadonly(resolvedValues) ,
  3328. !hasOwn(rawProps, key) && !hasOwn(rawProps, hyphenate(key))
  3329. );
  3330. }
  3331. }
  3332. function validateProp(name, value, prop, props, isAbsent) {
  3333. const { type, required, validator, skipCheck } = prop;
  3334. if (required && isAbsent) {
  3335. warn$1('Missing required prop: "' + name + '"');
  3336. return;
  3337. }
  3338. if (value == null && !required) {
  3339. return;
  3340. }
  3341. if (type != null && type !== true && !skipCheck) {
  3342. let isValid = false;
  3343. const types = isArray(type) ? type : [type];
  3344. const expectedTypes = [];
  3345. for (let i = 0; i < types.length && !isValid; i++) {
  3346. const { valid, expectedType } = assertType(value, types[i]);
  3347. expectedTypes.push(expectedType || "");
  3348. isValid = valid;
  3349. }
  3350. if (!isValid) {
  3351. warn$1(getInvalidTypeMessage(name, value, expectedTypes));
  3352. return;
  3353. }
  3354. }
  3355. if (validator && !validator(value, props)) {
  3356. warn$1('Invalid prop: custom validator check failed for prop "' + name + '".');
  3357. }
  3358. }
  3359. const isSimpleType = /* @__PURE__ */ makeMap(
  3360. "String,Number,Boolean,Function,Symbol,BigInt"
  3361. );
  3362. function assertType(value, type) {
  3363. let valid;
  3364. const expectedType = getType(type);
  3365. if (isSimpleType(expectedType)) {
  3366. const t = typeof value;
  3367. valid = t === expectedType.toLowerCase();
  3368. if (!valid && t === "object") {
  3369. valid = value instanceof type;
  3370. }
  3371. } else if (expectedType === "Object") {
  3372. valid = isObject(value);
  3373. } else if (expectedType === "Array") {
  3374. valid = isArray(value);
  3375. } else if (expectedType === "null") {
  3376. valid = value === null;
  3377. } else {
  3378. valid = value instanceof type;
  3379. }
  3380. return {
  3381. valid,
  3382. expectedType
  3383. };
  3384. }
  3385. function getInvalidTypeMessage(name, value, expectedTypes) {
  3386. if (expectedTypes.length === 0) {
  3387. return `Prop type [] for prop "${name}" won't match anything. Did you mean to use type Array instead?`;
  3388. }
  3389. let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(capitalize).join(" | ")}`;
  3390. const expectedType = expectedTypes[0];
  3391. const receivedType = toRawType(value);
  3392. const expectedValue = styleValue(value, expectedType);
  3393. const receivedValue = styleValue(value, receivedType);
  3394. if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) {
  3395. message += ` with value ${expectedValue}`;
  3396. }
  3397. message += `, got ${receivedType} `;
  3398. if (isExplicable(receivedType)) {
  3399. message += `with value ${receivedValue}.`;
  3400. }
  3401. return message;
  3402. }
  3403. function styleValue(value, type) {
  3404. if (type === "String") {
  3405. return `"${value}"`;
  3406. } else if (type === "Number") {
  3407. return `${Number(value)}`;
  3408. } else {
  3409. return `${value}`;
  3410. }
  3411. }
  3412. function isExplicable(type) {
  3413. const explicitTypes = ["string", "number", "boolean"];
  3414. return explicitTypes.some((elem) => type.toLowerCase() === elem);
  3415. }
  3416. function isBoolean(...args) {
  3417. return args.some((elem) => elem.toLowerCase() === "boolean");
  3418. }
  3419. const isInternalKey = (key) => key[0] === "_" || key === "$stable";
  3420. const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode$1) : [normalizeVNode$1(value)];
  3421. const normalizeSlot = (key, rawSlot, ctx) => {
  3422. if (rawSlot._n) {
  3423. return rawSlot;
  3424. }
  3425. const normalized = withCtx((...args) => {
  3426. if (currentInstance && (!ctx || ctx.root === currentInstance.root)) {
  3427. warn$1(
  3428. `Slot "${key}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.`
  3429. );
  3430. }
  3431. return normalizeSlotValue(rawSlot(...args));
  3432. }, ctx);
  3433. normalized._c = false;
  3434. return normalized;
  3435. };
  3436. const normalizeObjectSlots = (rawSlots, slots, instance) => {
  3437. const ctx = rawSlots._ctx;
  3438. for (const key in rawSlots) {
  3439. if (isInternalKey(key)) continue;
  3440. const value = rawSlots[key];
  3441. if (isFunction(value)) {
  3442. slots[key] = normalizeSlot(key, value, ctx);
  3443. } else if (value != null) {
  3444. {
  3445. warn$1(
  3446. `Non-function value encountered for slot "${key}". Prefer function slots for better performance.`
  3447. );
  3448. }
  3449. const normalized = normalizeSlotValue(value);
  3450. slots[key] = () => normalized;
  3451. }
  3452. }
  3453. };
  3454. const normalizeVNodeSlots = (instance, children) => {
  3455. if (!isKeepAlive(instance.vnode) && true) {
  3456. warn$1(
  3457. `Non-function value encountered for default slot. Prefer function slots for better performance.`
  3458. );
  3459. }
  3460. const normalized = normalizeSlotValue(children);
  3461. instance.slots.default = () => normalized;
  3462. };
  3463. const assignSlots = (slots, children, optimized) => {
  3464. for (const key in children) {
  3465. if (optimized || key !== "_") {
  3466. slots[key] = children[key];
  3467. }
  3468. }
  3469. };
  3470. const initSlots = (instance, children, optimized) => {
  3471. const slots = instance.slots = createInternalObject();
  3472. if (instance.vnode.shapeFlag & 32) {
  3473. const type = children._;
  3474. if (type) {
  3475. assignSlots(slots, children, optimized);
  3476. if (optimized) {
  3477. def(slots, "_", type, true);
  3478. }
  3479. } else {
  3480. normalizeObjectSlots(children, slots);
  3481. }
  3482. } else if (children) {
  3483. normalizeVNodeSlots(instance, children);
  3484. }
  3485. };
  3486. const updateSlots = (instance, children, optimized) => {
  3487. const { vnode, slots } = instance;
  3488. let needDeletionCheck = true;
  3489. let deletionComparisonTarget = EMPTY_OBJ;
  3490. if (vnode.shapeFlag & 32) {
  3491. const type = children._;
  3492. if (type) {
  3493. if (isHmrUpdating) {
  3494. assignSlots(slots, children, optimized);
  3495. trigger(instance, "set", "$slots");
  3496. } else if (optimized && type === 1) {
  3497. needDeletionCheck = false;
  3498. } else {
  3499. assignSlots(slots, children, optimized);
  3500. }
  3501. } else {
  3502. needDeletionCheck = !children.$stable;
  3503. normalizeObjectSlots(children, slots);
  3504. }
  3505. deletionComparisonTarget = children;
  3506. } else if (children) {
  3507. normalizeVNodeSlots(instance, children);
  3508. deletionComparisonTarget = { default: 1 };
  3509. }
  3510. if (needDeletionCheck) {
  3511. for (const key in slots) {
  3512. if (!isInternalKey(key) && deletionComparisonTarget[key] == null) {
  3513. delete slots[key];
  3514. }
  3515. }
  3516. }
  3517. };
  3518. function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
  3519. if (isArray(rawRef)) {
  3520. rawRef.forEach(
  3521. (r, i) => setRef(
  3522. r,
  3523. oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef),
  3524. parentSuspense,
  3525. vnode,
  3526. isUnmount
  3527. )
  3528. );
  3529. return;
  3530. }
  3531. if (isAsyncWrapper(vnode) && !isUnmount) {
  3532. return;
  3533. }
  3534. const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el;
  3535. const value = isUnmount ? null : refValue;
  3536. const { i: owner, r: ref } = rawRef;
  3537. if (!owner) {
  3538. warn$1(
  3539. `Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.`
  3540. );
  3541. return;
  3542. }
  3543. const oldRef = oldRawRef && oldRawRef.r;
  3544. const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
  3545. const setupState = owner.setupState;
  3546. if (oldRef != null && oldRef !== ref) {
  3547. if (isString(oldRef)) {
  3548. refs[oldRef] = null;
  3549. if (hasOwn(setupState, oldRef)) {
  3550. setupState[oldRef] = null;
  3551. }
  3552. } else if (isRef(oldRef)) {
  3553. oldRef.value = null;
  3554. }
  3555. }
  3556. if (isFunction(ref)) {
  3557. callWithErrorHandling(ref, owner, 12, [value, refs]);
  3558. } else {
  3559. const _isString = isString(ref);
  3560. const _isRef = isRef(ref);
  3561. if (_isString || _isRef) {
  3562. const doSet = () => {
  3563. if (rawRef.f) {
  3564. const existing = _isString ? hasOwn(setupState, ref) ? setupState[ref] : refs[ref] : ref.value;
  3565. if (isUnmount) {
  3566. isArray(existing) && remove(existing, refValue);
  3567. } else {
  3568. if (!isArray(existing)) {
  3569. if (_isString) {
  3570. refs[ref] = [refValue];
  3571. if (hasOwn(setupState, ref)) {
  3572. setupState[ref] = refs[ref];
  3573. }
  3574. } else {
  3575. ref.value = [refValue];
  3576. if (rawRef.k) refs[rawRef.k] = ref.value;
  3577. }
  3578. } else if (!existing.includes(refValue)) {
  3579. existing.push(refValue);
  3580. }
  3581. }
  3582. } else if (_isString) {
  3583. refs[ref] = value;
  3584. if (hasOwn(setupState, ref)) {
  3585. setupState[ref] = value;
  3586. }
  3587. } else if (_isRef) {
  3588. ref.value = value;
  3589. if (rawRef.k) refs[rawRef.k] = value;
  3590. } else {
  3591. warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
  3592. }
  3593. };
  3594. if (value) {
  3595. doSet.id = -1;
  3596. queuePostRenderEffect(doSet, parentSuspense);
  3597. } else {
  3598. doSet();
  3599. }
  3600. } else {
  3601. warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
  3602. }
  3603. }
  3604. }
  3605. const TeleportEndKey = Symbol("_vte");
  3606. const isTeleport = (type) => type.__isTeleport;
  3607. let supported;
  3608. let perf;
  3609. function startMeasure(instance, type) {
  3610. if (instance.appContext.config.performance && isSupported()) {
  3611. perf.mark(`vue-${type}-${instance.uid}`);
  3612. }
  3613. {
  3614. devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now());
  3615. }
  3616. }
  3617. function endMeasure(instance, type) {
  3618. if (instance.appContext.config.performance && isSupported()) {
  3619. const startTag = `vue-${type}-${instance.uid}`;
  3620. const endTag = startTag + `:end`;
  3621. perf.mark(endTag);
  3622. perf.measure(
  3623. `<${formatComponentName(instance, instance.type)}> ${type}`,
  3624. startTag,
  3625. endTag
  3626. );
  3627. perf.clearMarks(startTag);
  3628. perf.clearMarks(endTag);
  3629. }
  3630. {
  3631. devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now());
  3632. }
  3633. }
  3634. function isSupported() {
  3635. if (supported !== void 0) {
  3636. return supported;
  3637. }
  3638. if (typeof window !== "undefined" && window.performance) {
  3639. supported = true;
  3640. perf = window.performance;
  3641. } else {
  3642. supported = false;
  3643. }
  3644. return supported;
  3645. }
  3646. const queuePostRenderEffect = queueEffectWithSuspense ;
  3647. function createRenderer(options) {
  3648. return baseCreateRenderer(options);
  3649. }
  3650. function baseCreateRenderer(options, createHydrationFns) {
  3651. const target = getGlobalThis();
  3652. target.__VUE__ = true;
  3653. {
  3654. setDevtoolsHook(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target);
  3655. }
  3656. const {
  3657. insert: hostInsert,
  3658. remove: hostRemove,
  3659. patchProp: hostPatchProp,
  3660. createElement: hostCreateElement,
  3661. createText: hostCreateText,
  3662. createComment: hostCreateComment,
  3663. setText: hostSetText,
  3664. setElementText: hostSetElementText,
  3665. parentNode: hostParentNode,
  3666. nextSibling: hostNextSibling,
  3667. setScopeId: hostSetScopeId = NOOP,
  3668. insertStaticContent: hostInsertStaticContent
  3669. } = options;
  3670. const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = isHmrUpdating ? false : !!n2.dynamicChildren) => {
  3671. if (n1 === n2) {
  3672. return;
  3673. }
  3674. if (n1 && !isSameVNodeType(n1, n2)) {
  3675. anchor = getNextHostNode(n1);
  3676. unmount(n1, parentComponent, parentSuspense, true);
  3677. n1 = null;
  3678. }
  3679. if (n2.patchFlag === -2) {
  3680. optimized = false;
  3681. n2.dynamicChildren = null;
  3682. }
  3683. const { type, ref, shapeFlag } = n2;
  3684. switch (type) {
  3685. case Text:
  3686. processText(n1, n2, container, anchor);
  3687. break;
  3688. case Comment:
  3689. processCommentNode(n1, n2, container, anchor);
  3690. break;
  3691. case Static:
  3692. if (n1 == null) {
  3693. mountStaticNode(n2, container, anchor, namespace);
  3694. } else {
  3695. patchStaticNode(n1, n2, container, namespace);
  3696. }
  3697. break;
  3698. case Fragment:
  3699. processFragment(
  3700. n1,
  3701. n2,
  3702. container,
  3703. anchor,
  3704. parentComponent,
  3705. parentSuspense,
  3706. namespace,
  3707. slotScopeIds,
  3708. optimized
  3709. );
  3710. break;
  3711. default:
  3712. if (shapeFlag & 1) {
  3713. processElement(
  3714. n1,
  3715. n2,
  3716. container,
  3717. anchor,
  3718. parentComponent,
  3719. parentSuspense,
  3720. namespace,
  3721. slotScopeIds,
  3722. optimized
  3723. );
  3724. } else if (shapeFlag & 6) {
  3725. processComponent(
  3726. n1,
  3727. n2,
  3728. container,
  3729. anchor,
  3730. parentComponent,
  3731. parentSuspense,
  3732. namespace,
  3733. slotScopeIds,
  3734. optimized
  3735. );
  3736. } else if (shapeFlag & 64) {
  3737. type.process(
  3738. n1,
  3739. n2,
  3740. container,
  3741. anchor,
  3742. parentComponent,
  3743. parentSuspense,
  3744. namespace,
  3745. slotScopeIds,
  3746. optimized,
  3747. internals
  3748. );
  3749. } else if (shapeFlag & 128) {
  3750. type.process(
  3751. n1,
  3752. n2,
  3753. container,
  3754. anchor,
  3755. parentComponent,
  3756. parentSuspense,
  3757. namespace,
  3758. slotScopeIds,
  3759. optimized,
  3760. internals
  3761. );
  3762. } else {
  3763. warn$1("Invalid VNode type:", type, `(${typeof type})`);
  3764. }
  3765. }
  3766. if (ref != null && parentComponent) {
  3767. setRef(ref, n1 && n1.ref, parentSuspense, n2 || n1, !n2);
  3768. }
  3769. };
  3770. const processText = (n1, n2, container, anchor) => {
  3771. if (n1 == null) {
  3772. hostInsert(
  3773. n2.el = hostCreateText(n2.children),
  3774. container,
  3775. anchor
  3776. );
  3777. } else {
  3778. const el = n2.el = n1.el;
  3779. if (n2.children !== n1.children) {
  3780. hostSetText(el, n2.children);
  3781. }
  3782. }
  3783. };
  3784. const processCommentNode = (n1, n2, container, anchor) => {
  3785. if (n1 == null) {
  3786. hostInsert(
  3787. n2.el = hostCreateComment(n2.children || ""),
  3788. container,
  3789. anchor
  3790. );
  3791. } else {
  3792. n2.el = n1.el;
  3793. }
  3794. };
  3795. const mountStaticNode = (n2, container, anchor, namespace) => {
  3796. [n2.el, n2.anchor] = hostInsertStaticContent(
  3797. n2.children,
  3798. container,
  3799. anchor,
  3800. namespace,
  3801. n2.el,
  3802. n2.anchor
  3803. );
  3804. };
  3805. const patchStaticNode = (n1, n2, container, namespace) => {
  3806. if (n2.children !== n1.children) {
  3807. const anchor = hostNextSibling(n1.anchor);
  3808. removeStaticNode(n1);
  3809. [n2.el, n2.anchor] = hostInsertStaticContent(
  3810. n2.children,
  3811. container,
  3812. anchor,
  3813. namespace
  3814. );
  3815. } else {
  3816. n2.el = n1.el;
  3817. n2.anchor = n1.anchor;
  3818. }
  3819. };
  3820. const moveStaticNode = ({ el, anchor }, container, nextSibling) => {
  3821. let next;
  3822. while (el && el !== anchor) {
  3823. next = hostNextSibling(el);
  3824. hostInsert(el, container, nextSibling);
  3825. el = next;
  3826. }
  3827. hostInsert(anchor, container, nextSibling);
  3828. };
  3829. const removeStaticNode = ({ el, anchor }) => {
  3830. let next;
  3831. while (el && el !== anchor) {
  3832. next = hostNextSibling(el);
  3833. hostRemove(el);
  3834. el = next;
  3835. }
  3836. hostRemove(anchor);
  3837. };
  3838. const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  3839. if (n2.type === "svg") {
  3840. namespace = "svg";
  3841. } else if (n2.type === "math") {
  3842. namespace = "mathml";
  3843. }
  3844. if (n1 == null) {
  3845. mountElement(
  3846. n2,
  3847. container,
  3848. anchor,
  3849. parentComponent,
  3850. parentSuspense,
  3851. namespace,
  3852. slotScopeIds,
  3853. optimized
  3854. );
  3855. } else {
  3856. patchElement(
  3857. n1,
  3858. n2,
  3859. parentComponent,
  3860. parentSuspense,
  3861. namespace,
  3862. slotScopeIds,
  3863. optimized
  3864. );
  3865. }
  3866. };
  3867. const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  3868. let el;
  3869. let vnodeHook;
  3870. const { props, shapeFlag, transition, dirs } = vnode;
  3871. el = vnode.el = hostCreateElement(
  3872. vnode.type,
  3873. namespace,
  3874. props && props.is,
  3875. props
  3876. );
  3877. if (shapeFlag & 8) {
  3878. hostSetElementText(el, vnode.children);
  3879. } else if (shapeFlag & 16) {
  3880. mountChildren(
  3881. vnode.children,
  3882. el,
  3883. null,
  3884. parentComponent,
  3885. parentSuspense,
  3886. resolveChildrenNamespace(vnode, namespace),
  3887. slotScopeIds,
  3888. optimized
  3889. );
  3890. }
  3891. if (dirs) {
  3892. invokeDirectiveHook(vnode, null, parentComponent, "created");
  3893. }
  3894. setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
  3895. if (props) {
  3896. for (const key in props) {
  3897. if (key !== "value" && !isReservedProp(key)) {
  3898. hostPatchProp(el, key, null, props[key], namespace, parentComponent);
  3899. }
  3900. }
  3901. if ("value" in props) {
  3902. hostPatchProp(el, "value", null, props.value, namespace);
  3903. }
  3904. if (vnodeHook = props.onVnodeBeforeMount) {
  3905. invokeVNodeHook(vnodeHook, parentComponent, vnode);
  3906. }
  3907. }
  3908. {
  3909. def(el, "__vnode", vnode, true);
  3910. def(el, "__vueParentComponent", parentComponent, true);
  3911. }
  3912. if (dirs) {
  3913. invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
  3914. }
  3915. const needCallTransitionHooks = needTransition(parentSuspense, transition);
  3916. if (needCallTransitionHooks) {
  3917. transition.beforeEnter(el);
  3918. }
  3919. hostInsert(el, container, anchor);
  3920. if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
  3921. queuePostRenderEffect(() => {
  3922. vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
  3923. needCallTransitionHooks && transition.enter(el);
  3924. dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
  3925. }, parentSuspense);
  3926. }
  3927. };
  3928. const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => {
  3929. if (scopeId) {
  3930. hostSetScopeId(el, scopeId);
  3931. }
  3932. if (slotScopeIds) {
  3933. for (let i = 0; i < slotScopeIds.length; i++) {
  3934. hostSetScopeId(el, slotScopeIds[i]);
  3935. }
  3936. }
  3937. if (parentComponent) {
  3938. let subTree = parentComponent.subTree;
  3939. if (subTree.patchFlag > 0 && subTree.patchFlag & 2048) {
  3940. subTree = filterSingleRoot(subTree.children) || subTree;
  3941. }
  3942. if (vnode === subTree) {
  3943. const parentVNode = parentComponent.vnode;
  3944. setScopeId(
  3945. el,
  3946. parentVNode,
  3947. parentVNode.scopeId,
  3948. parentVNode.slotScopeIds,
  3949. parentComponent.parent
  3950. );
  3951. }
  3952. }
  3953. };
  3954. const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
  3955. for (let i = start; i < children.length; i++) {
  3956. const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode$1(children[i]);
  3957. patch(
  3958. null,
  3959. child,
  3960. container,
  3961. anchor,
  3962. parentComponent,
  3963. parentSuspense,
  3964. namespace,
  3965. slotScopeIds,
  3966. optimized
  3967. );
  3968. }
  3969. };
  3970. const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  3971. const el = n2.el = n1.el;
  3972. {
  3973. el.__vnode = n2;
  3974. }
  3975. let { patchFlag, dynamicChildren, dirs } = n2;
  3976. patchFlag |= n1.patchFlag & 16;
  3977. const oldProps = n1.props || EMPTY_OBJ;
  3978. const newProps = n2.props || EMPTY_OBJ;
  3979. let vnodeHook;
  3980. parentComponent && toggleRecurse(parentComponent, false);
  3981. if (vnodeHook = newProps.onVnodeBeforeUpdate) {
  3982. invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
  3983. }
  3984. if (dirs) {
  3985. invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
  3986. }
  3987. parentComponent && toggleRecurse(parentComponent, true);
  3988. if (isHmrUpdating) {
  3989. patchFlag = 0;
  3990. optimized = false;
  3991. dynamicChildren = null;
  3992. }
  3993. if (oldProps.innerHTML && newProps.innerHTML == null || oldProps.textContent && newProps.textContent == null) {
  3994. hostSetElementText(el, "");
  3995. }
  3996. if (dynamicChildren) {
  3997. patchBlockChildren(
  3998. n1.dynamicChildren,
  3999. dynamicChildren,
  4000. el,
  4001. parentComponent,
  4002. parentSuspense,
  4003. resolveChildrenNamespace(n2, namespace),
  4004. slotScopeIds
  4005. );
  4006. {
  4007. traverseStaticChildren(n1, n2);
  4008. }
  4009. } else if (!optimized) {
  4010. patchChildren(
  4011. n1,
  4012. n2,
  4013. el,
  4014. null,
  4015. parentComponent,
  4016. parentSuspense,
  4017. resolveChildrenNamespace(n2, namespace),
  4018. slotScopeIds,
  4019. false
  4020. );
  4021. }
  4022. if (patchFlag > 0) {
  4023. if (patchFlag & 16) {
  4024. patchProps(el, oldProps, newProps, parentComponent, namespace);
  4025. } else {
  4026. if (patchFlag & 2) {
  4027. if (oldProps.class !== newProps.class) {
  4028. hostPatchProp(el, "class", null, newProps.class, namespace);
  4029. }
  4030. }
  4031. if (patchFlag & 4) {
  4032. hostPatchProp(el, "style", oldProps.style, newProps.style, namespace);
  4033. }
  4034. if (patchFlag & 8) {
  4035. const propsToUpdate = n2.dynamicProps;
  4036. for (let i = 0; i < propsToUpdate.length; i++) {
  4037. const key = propsToUpdate[i];
  4038. const prev = oldProps[key];
  4039. const next = newProps[key];
  4040. if (next !== prev || key === "value") {
  4041. hostPatchProp(el, key, prev, next, namespace, parentComponent);
  4042. }
  4043. }
  4044. }
  4045. }
  4046. if (patchFlag & 1) {
  4047. if (n1.children !== n2.children) {
  4048. hostSetElementText(el, n2.children);
  4049. }
  4050. }
  4051. } else if (!optimized && dynamicChildren == null) {
  4052. patchProps(el, oldProps, newProps, parentComponent, namespace);
  4053. }
  4054. if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
  4055. queuePostRenderEffect(() => {
  4056. vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
  4057. dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
  4058. }, parentSuspense);
  4059. }
  4060. };
  4061. const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => {
  4062. for (let i = 0; i < newChildren.length; i++) {
  4063. const oldVNode = oldChildren[i];
  4064. const newVNode = newChildren[i];
  4065. const container = (
  4066. // oldVNode may be an errored async setup() component inside Suspense
  4067. // which will not have a mounted element
  4068. oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent
  4069. // of the Fragment itself so it can move its children.
  4070. (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement
  4071. // which also requires the correct parent container
  4072. !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.
  4073. oldVNode.shapeFlag & (6 | 64)) ? hostParentNode(oldVNode.el) : (
  4074. // In other cases, the parent container is not actually used so we
  4075. // just pass the block element here to avoid a DOM parentNode call.
  4076. fallbackContainer
  4077. )
  4078. );
  4079. patch(
  4080. oldVNode,
  4081. newVNode,
  4082. container,
  4083. null,
  4084. parentComponent,
  4085. parentSuspense,
  4086. namespace,
  4087. slotScopeIds,
  4088. true
  4089. );
  4090. }
  4091. };
  4092. const patchProps = (el, oldProps, newProps, parentComponent, namespace) => {
  4093. if (oldProps !== newProps) {
  4094. if (oldProps !== EMPTY_OBJ) {
  4095. for (const key in oldProps) {
  4096. if (!isReservedProp(key) && !(key in newProps)) {
  4097. hostPatchProp(
  4098. el,
  4099. key,
  4100. oldProps[key],
  4101. null,
  4102. namespace,
  4103. parentComponent
  4104. );
  4105. }
  4106. }
  4107. }
  4108. for (const key in newProps) {
  4109. if (isReservedProp(key)) continue;
  4110. const next = newProps[key];
  4111. const prev = oldProps[key];
  4112. if (next !== prev && key !== "value") {
  4113. hostPatchProp(el, key, prev, next, namespace, parentComponent);
  4114. }
  4115. }
  4116. if ("value" in newProps) {
  4117. hostPatchProp(el, "value", oldProps.value, newProps.value, namespace);
  4118. }
  4119. }
  4120. };
  4121. const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  4122. const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText("");
  4123. const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText("");
  4124. let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
  4125. if (
  4126. // #5523 dev root fragment may inherit directives
  4127. isHmrUpdating || patchFlag & 2048
  4128. ) {
  4129. patchFlag = 0;
  4130. optimized = false;
  4131. dynamicChildren = null;
  4132. }
  4133. if (fragmentSlotScopeIds) {
  4134. slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
  4135. }
  4136. if (n1 == null) {
  4137. hostInsert(fragmentStartAnchor, container, anchor);
  4138. hostInsert(fragmentEndAnchor, container, anchor);
  4139. mountChildren(
  4140. // #10007
  4141. // such fragment like `<></>` will be compiled into
  4142. // a fragment which doesn't have a children.
  4143. // In this case fallback to an empty array
  4144. n2.children || [],
  4145. container,
  4146. fragmentEndAnchor,
  4147. parentComponent,
  4148. parentSuspense,
  4149. namespace,
  4150. slotScopeIds,
  4151. optimized
  4152. );
  4153. } else {
  4154. if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result
  4155. // of renderSlot() with no valid children
  4156. n1.dynamicChildren) {
  4157. patchBlockChildren(
  4158. n1.dynamicChildren,
  4159. dynamicChildren,
  4160. container,
  4161. parentComponent,
  4162. parentSuspense,
  4163. namespace,
  4164. slotScopeIds
  4165. );
  4166. {
  4167. traverseStaticChildren(n1, n2);
  4168. }
  4169. } else {
  4170. patchChildren(
  4171. n1,
  4172. n2,
  4173. container,
  4174. fragmentEndAnchor,
  4175. parentComponent,
  4176. parentSuspense,
  4177. namespace,
  4178. slotScopeIds,
  4179. optimized
  4180. );
  4181. }
  4182. }
  4183. };
  4184. const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  4185. n2.slotScopeIds = slotScopeIds;
  4186. if (n1 == null) {
  4187. if (n2.shapeFlag & 512) {
  4188. parentComponent.ctx.activate(
  4189. n2,
  4190. container,
  4191. anchor,
  4192. namespace,
  4193. optimized
  4194. );
  4195. } else {
  4196. mountComponent(
  4197. n2,
  4198. container,
  4199. anchor,
  4200. parentComponent,
  4201. parentSuspense,
  4202. namespace,
  4203. optimized
  4204. );
  4205. }
  4206. } else {
  4207. updateComponent(n1, n2, optimized);
  4208. }
  4209. };
  4210. const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
  4211. const instance = (initialVNode.component = createComponentInstance$1(
  4212. initialVNode,
  4213. parentComponent,
  4214. parentSuspense
  4215. ));
  4216. if (instance.type.__hmrId) {
  4217. registerHMR(instance);
  4218. }
  4219. {
  4220. pushWarningContext(initialVNode);
  4221. startMeasure(instance, `mount`);
  4222. }
  4223. if (isKeepAlive(initialVNode)) {
  4224. instance.ctx.renderer = internals;
  4225. }
  4226. {
  4227. {
  4228. startMeasure(instance, `init`);
  4229. }
  4230. setupComponent$1(instance, false, optimized);
  4231. {
  4232. endMeasure(instance, `init`);
  4233. }
  4234. }
  4235. if (instance.asyncDep) {
  4236. parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
  4237. if (!initialVNode.el) {
  4238. const placeholder = instance.subTree = createVNode(Comment);
  4239. processCommentNode(null, placeholder, container, anchor);
  4240. }
  4241. } else {
  4242. setupRenderEffect(
  4243. instance,
  4244. initialVNode,
  4245. container,
  4246. anchor,
  4247. parentSuspense,
  4248. namespace,
  4249. optimized
  4250. );
  4251. }
  4252. {
  4253. popWarningContext();
  4254. endMeasure(instance, `mount`);
  4255. }
  4256. };
  4257. const updateComponent = (n1, n2, optimized) => {
  4258. const instance = n2.component = n1.component;
  4259. if (shouldUpdateComponent(n1, n2, optimized)) {
  4260. if (instance.asyncDep && !instance.asyncResolved) {
  4261. {
  4262. pushWarningContext(n2);
  4263. }
  4264. updateComponentPreRender(instance, n2, optimized);
  4265. {
  4266. popWarningContext();
  4267. }
  4268. return;
  4269. } else {
  4270. instance.next = n2;
  4271. invalidateJob(instance.update);
  4272. instance.effect.dirty = true;
  4273. instance.update();
  4274. }
  4275. } else {
  4276. n2.el = n1.el;
  4277. instance.vnode = n2;
  4278. }
  4279. };
  4280. const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
  4281. const componentUpdateFn = () => {
  4282. if (!instance.isMounted) {
  4283. let vnodeHook;
  4284. const { el, props } = initialVNode;
  4285. const { bm, m, parent } = instance;
  4286. const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
  4287. toggleRecurse(instance, false);
  4288. if (bm) {
  4289. invokeArrayFns(bm);
  4290. }
  4291. if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeBeforeMount)) {
  4292. invokeVNodeHook(vnodeHook, parent, initialVNode);
  4293. }
  4294. toggleRecurse(instance, true);
  4295. if (el && hydrateNode) {
  4296. const hydrateSubTree = () => {
  4297. {
  4298. startMeasure(instance, `render`);
  4299. }
  4300. instance.subTree = renderComponentRoot$1(instance);
  4301. {
  4302. endMeasure(instance, `render`);
  4303. }
  4304. {
  4305. startMeasure(instance, `hydrate`);
  4306. }
  4307. hydrateNode(
  4308. el,
  4309. instance.subTree,
  4310. instance,
  4311. parentSuspense,
  4312. null
  4313. );
  4314. {
  4315. endMeasure(instance, `hydrate`);
  4316. }
  4317. };
  4318. if (isAsyncWrapperVNode) {
  4319. initialVNode.type.__asyncLoader().then(
  4320. // note: we are moving the render call into an async callback,
  4321. // which means it won't track dependencies - but it's ok because
  4322. // a server-rendered async wrapper is already in resolved state
  4323. // and it will never need to change.
  4324. () => !instance.isUnmounted && hydrateSubTree()
  4325. );
  4326. } else {
  4327. hydrateSubTree();
  4328. }
  4329. } else {
  4330. {
  4331. startMeasure(instance, `render`);
  4332. }
  4333. const subTree = instance.subTree = renderComponentRoot$1(instance);
  4334. {
  4335. endMeasure(instance, `render`);
  4336. }
  4337. {
  4338. startMeasure(instance, `patch`);
  4339. }
  4340. patch(
  4341. null,
  4342. subTree,
  4343. container,
  4344. anchor,
  4345. instance,
  4346. parentSuspense,
  4347. namespace
  4348. );
  4349. {
  4350. endMeasure(instance, `patch`);
  4351. }
  4352. initialVNode.el = subTree.el;
  4353. }
  4354. if (m) {
  4355. queuePostRenderEffect(m, parentSuspense);
  4356. }
  4357. if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) {
  4358. const scopedInitialVNode = initialVNode;
  4359. queuePostRenderEffect(
  4360. () => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode),
  4361. parentSuspense
  4362. );
  4363. }
  4364. if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) {
  4365. instance.a && queuePostRenderEffect(instance.a, parentSuspense);
  4366. }
  4367. instance.isMounted = true;
  4368. {
  4369. devtoolsComponentAdded(instance);
  4370. }
  4371. initialVNode = container = anchor = null;
  4372. } else {
  4373. let { next, bu, u, parent, vnode } = instance;
  4374. {
  4375. const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
  4376. if (nonHydratedAsyncRoot) {
  4377. if (next) {
  4378. next.el = vnode.el;
  4379. updateComponentPreRender(instance, next, optimized);
  4380. }
  4381. nonHydratedAsyncRoot.asyncDep.then(() => {
  4382. if (!instance.isUnmounted) {
  4383. componentUpdateFn();
  4384. }
  4385. });
  4386. return;
  4387. }
  4388. }
  4389. let originNext = next;
  4390. let vnodeHook;
  4391. {
  4392. pushWarningContext(next || instance.vnode);
  4393. }
  4394. toggleRecurse(instance, false);
  4395. if (next) {
  4396. next.el = vnode.el;
  4397. updateComponentPreRender(instance, next, optimized);
  4398. } else {
  4399. next = vnode;
  4400. }
  4401. if (bu) {
  4402. invokeArrayFns(bu);
  4403. }
  4404. if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) {
  4405. invokeVNodeHook(vnodeHook, parent, next, vnode);
  4406. }
  4407. toggleRecurse(instance, true);
  4408. {
  4409. startMeasure(instance, `render`);
  4410. }
  4411. const nextTree = renderComponentRoot$1(instance);
  4412. {
  4413. endMeasure(instance, `render`);
  4414. }
  4415. const prevTree = instance.subTree;
  4416. instance.subTree = nextTree;
  4417. {
  4418. startMeasure(instance, `patch`);
  4419. }
  4420. patch(
  4421. prevTree,
  4422. nextTree,
  4423. // parent may have changed if it's in a teleport
  4424. hostParentNode(prevTree.el),
  4425. // anchor may have changed if it's in a fragment
  4426. getNextHostNode(prevTree),
  4427. instance,
  4428. parentSuspense,
  4429. namespace
  4430. );
  4431. {
  4432. endMeasure(instance, `patch`);
  4433. }
  4434. next.el = nextTree.el;
  4435. if (originNext === null) {
  4436. updateHOCHostEl(instance, nextTree.el);
  4437. }
  4438. if (u) {
  4439. queuePostRenderEffect(u, parentSuspense);
  4440. }
  4441. if (vnodeHook = next.props && next.props.onVnodeUpdated) {
  4442. queuePostRenderEffect(
  4443. () => invokeVNodeHook(vnodeHook, parent, next, vnode),
  4444. parentSuspense
  4445. );
  4446. }
  4447. {
  4448. devtoolsComponentUpdated(instance);
  4449. }
  4450. {
  4451. popWarningContext();
  4452. }
  4453. }
  4454. };
  4455. const effect = instance.effect = new ReactiveEffect(
  4456. componentUpdateFn,
  4457. NOOP,
  4458. () => queueJob(update),
  4459. instance.scope
  4460. // track it in component's effect scope
  4461. );
  4462. const update = instance.update = () => {
  4463. if (effect.dirty) {
  4464. effect.run();
  4465. }
  4466. };
  4467. update.i = instance;
  4468. update.id = instance.uid;
  4469. toggleRecurse(instance, true);
  4470. {
  4471. effect.onTrack = instance.rtc ? (e) => invokeArrayFns(instance.rtc, e) : void 0;
  4472. effect.onTrigger = instance.rtg ? (e) => invokeArrayFns(instance.rtg, e) : void 0;
  4473. }
  4474. update();
  4475. };
  4476. const updateComponentPreRender = (instance, nextVNode, optimized) => {
  4477. nextVNode.component = instance;
  4478. const prevProps = instance.vnode.props;
  4479. instance.vnode = nextVNode;
  4480. instance.next = null;
  4481. updateProps(instance, nextVNode.props, prevProps, optimized);
  4482. updateSlots(instance, nextVNode.children, optimized);
  4483. pauseTracking();
  4484. flushPreFlushCbs(instance);
  4485. resetTracking();
  4486. };
  4487. const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => {
  4488. const c1 = n1 && n1.children;
  4489. const prevShapeFlag = n1 ? n1.shapeFlag : 0;
  4490. const c2 = n2.children;
  4491. const { patchFlag, shapeFlag } = n2;
  4492. if (patchFlag > 0) {
  4493. if (patchFlag & 128) {
  4494. patchKeyedChildren(
  4495. c1,
  4496. c2,
  4497. container,
  4498. anchor,
  4499. parentComponent,
  4500. parentSuspense,
  4501. namespace,
  4502. slotScopeIds,
  4503. optimized
  4504. );
  4505. return;
  4506. } else if (patchFlag & 256) {
  4507. patchUnkeyedChildren(
  4508. c1,
  4509. c2,
  4510. container,
  4511. anchor,
  4512. parentComponent,
  4513. parentSuspense,
  4514. namespace,
  4515. slotScopeIds,
  4516. optimized
  4517. );
  4518. return;
  4519. }
  4520. }
  4521. if (shapeFlag & 8) {
  4522. if (prevShapeFlag & 16) {
  4523. unmountChildren(c1, parentComponent, parentSuspense);
  4524. }
  4525. if (c2 !== c1) {
  4526. hostSetElementText(container, c2);
  4527. }
  4528. } else {
  4529. if (prevShapeFlag & 16) {
  4530. if (shapeFlag & 16) {
  4531. patchKeyedChildren(
  4532. c1,
  4533. c2,
  4534. container,
  4535. anchor,
  4536. parentComponent,
  4537. parentSuspense,
  4538. namespace,
  4539. slotScopeIds,
  4540. optimized
  4541. );
  4542. } else {
  4543. unmountChildren(c1, parentComponent, parentSuspense, true);
  4544. }
  4545. } else {
  4546. if (prevShapeFlag & 8) {
  4547. hostSetElementText(container, "");
  4548. }
  4549. if (shapeFlag & 16) {
  4550. mountChildren(
  4551. c2,
  4552. container,
  4553. anchor,
  4554. parentComponent,
  4555. parentSuspense,
  4556. namespace,
  4557. slotScopeIds,
  4558. optimized
  4559. );
  4560. }
  4561. }
  4562. }
  4563. };
  4564. const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  4565. c1 = c1 || EMPTY_ARR;
  4566. c2 = c2 || EMPTY_ARR;
  4567. const oldLength = c1.length;
  4568. const newLength = c2.length;
  4569. const commonLength = Math.min(oldLength, newLength);
  4570. let i;
  4571. for (i = 0; i < commonLength; i++) {
  4572. const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode$1(c2[i]);
  4573. patch(
  4574. c1[i],
  4575. nextChild,
  4576. container,
  4577. null,
  4578. parentComponent,
  4579. parentSuspense,
  4580. namespace,
  4581. slotScopeIds,
  4582. optimized
  4583. );
  4584. }
  4585. if (oldLength > newLength) {
  4586. unmountChildren(
  4587. c1,
  4588. parentComponent,
  4589. parentSuspense,
  4590. true,
  4591. false,
  4592. commonLength
  4593. );
  4594. } else {
  4595. mountChildren(
  4596. c2,
  4597. container,
  4598. anchor,
  4599. parentComponent,
  4600. parentSuspense,
  4601. namespace,
  4602. slotScopeIds,
  4603. optimized,
  4604. commonLength
  4605. );
  4606. }
  4607. };
  4608. const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  4609. let i = 0;
  4610. const l2 = c2.length;
  4611. let e1 = c1.length - 1;
  4612. let e2 = l2 - 1;
  4613. while (i <= e1 && i <= e2) {
  4614. const n1 = c1[i];
  4615. const n2 = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode$1(c2[i]);
  4616. if (isSameVNodeType(n1, n2)) {
  4617. patch(
  4618. n1,
  4619. n2,
  4620. container,
  4621. null,
  4622. parentComponent,
  4623. parentSuspense,
  4624. namespace,
  4625. slotScopeIds,
  4626. optimized
  4627. );
  4628. } else {
  4629. break;
  4630. }
  4631. i++;
  4632. }
  4633. while (i <= e1 && i <= e2) {
  4634. const n1 = c1[e1];
  4635. const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode$1(c2[e2]);
  4636. if (isSameVNodeType(n1, n2)) {
  4637. patch(
  4638. n1,
  4639. n2,
  4640. container,
  4641. null,
  4642. parentComponent,
  4643. parentSuspense,
  4644. namespace,
  4645. slotScopeIds,
  4646. optimized
  4647. );
  4648. } else {
  4649. break;
  4650. }
  4651. e1--;
  4652. e2--;
  4653. }
  4654. if (i > e1) {
  4655. if (i <= e2) {
  4656. const nextPos = e2 + 1;
  4657. const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor;
  4658. while (i <= e2) {
  4659. patch(
  4660. null,
  4661. c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode$1(c2[i]),
  4662. container,
  4663. anchor,
  4664. parentComponent,
  4665. parentSuspense,
  4666. namespace,
  4667. slotScopeIds,
  4668. optimized
  4669. );
  4670. i++;
  4671. }
  4672. }
  4673. } else if (i > e2) {
  4674. while (i <= e1) {
  4675. unmount(c1[i], parentComponent, parentSuspense, true);
  4676. i++;
  4677. }
  4678. } else {
  4679. const s1 = i;
  4680. const s2 = i;
  4681. const keyToNewIndexMap = /* @__PURE__ */ new Map();
  4682. for (i = s2; i <= e2; i++) {
  4683. const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode$1(c2[i]);
  4684. if (nextChild.key != null) {
  4685. if (keyToNewIndexMap.has(nextChild.key)) {
  4686. warn$1(
  4687. `Duplicate keys found during update:`,
  4688. JSON.stringify(nextChild.key),
  4689. `Make sure keys are unique.`
  4690. );
  4691. }
  4692. keyToNewIndexMap.set(nextChild.key, i);
  4693. }
  4694. }
  4695. let j;
  4696. let patched = 0;
  4697. const toBePatched = e2 - s2 + 1;
  4698. let moved = false;
  4699. let maxNewIndexSoFar = 0;
  4700. const newIndexToOldIndexMap = new Array(toBePatched);
  4701. for (i = 0; i < toBePatched; i++) newIndexToOldIndexMap[i] = 0;
  4702. for (i = s1; i <= e1; i++) {
  4703. const prevChild = c1[i];
  4704. if (patched >= toBePatched) {
  4705. unmount(prevChild, parentComponent, parentSuspense, true);
  4706. continue;
  4707. }
  4708. let newIndex;
  4709. if (prevChild.key != null) {
  4710. newIndex = keyToNewIndexMap.get(prevChild.key);
  4711. } else {
  4712. for (j = s2; j <= e2; j++) {
  4713. if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) {
  4714. newIndex = j;
  4715. break;
  4716. }
  4717. }
  4718. }
  4719. if (newIndex === void 0) {
  4720. unmount(prevChild, parentComponent, parentSuspense, true);
  4721. } else {
  4722. newIndexToOldIndexMap[newIndex - s2] = i + 1;
  4723. if (newIndex >= maxNewIndexSoFar) {
  4724. maxNewIndexSoFar = newIndex;
  4725. } else {
  4726. moved = true;
  4727. }
  4728. patch(
  4729. prevChild,
  4730. c2[newIndex],
  4731. container,
  4732. null,
  4733. parentComponent,
  4734. parentSuspense,
  4735. namespace,
  4736. slotScopeIds,
  4737. optimized
  4738. );
  4739. patched++;
  4740. }
  4741. }
  4742. const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : EMPTY_ARR;
  4743. j = increasingNewIndexSequence.length - 1;
  4744. for (i = toBePatched - 1; i >= 0; i--) {
  4745. const nextIndex = s2 + i;
  4746. const nextChild = c2[nextIndex];
  4747. const anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor;
  4748. if (newIndexToOldIndexMap[i] === 0) {
  4749. patch(
  4750. null,
  4751. nextChild,
  4752. container,
  4753. anchor,
  4754. parentComponent,
  4755. parentSuspense,
  4756. namespace,
  4757. slotScopeIds,
  4758. optimized
  4759. );
  4760. } else if (moved) {
  4761. if (j < 0 || i !== increasingNewIndexSequence[j]) {
  4762. move(nextChild, container, anchor, 2);
  4763. } else {
  4764. j--;
  4765. }
  4766. }
  4767. }
  4768. }
  4769. };
  4770. const move = (vnode, container, anchor, moveType, parentSuspense = null) => {
  4771. const { el, type, transition, children, shapeFlag } = vnode;
  4772. if (shapeFlag & 6) {
  4773. move(vnode.component.subTree, container, anchor, moveType);
  4774. return;
  4775. }
  4776. if (shapeFlag & 128) {
  4777. vnode.suspense.move(container, anchor, moveType);
  4778. return;
  4779. }
  4780. if (shapeFlag & 64) {
  4781. type.move(vnode, container, anchor, internals);
  4782. return;
  4783. }
  4784. if (type === Fragment) {
  4785. hostInsert(el, container, anchor);
  4786. for (let i = 0; i < children.length; i++) {
  4787. move(children[i], container, anchor, moveType);
  4788. }
  4789. hostInsert(vnode.anchor, container, anchor);
  4790. return;
  4791. }
  4792. if (type === Static) {
  4793. moveStaticNode(vnode, container, anchor);
  4794. return;
  4795. }
  4796. const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
  4797. if (needTransition2) {
  4798. if (moveType === 0) {
  4799. transition.beforeEnter(el);
  4800. hostInsert(el, container, anchor);
  4801. queuePostRenderEffect(() => transition.enter(el), parentSuspense);
  4802. } else {
  4803. const { leave, delayLeave, afterLeave } = transition;
  4804. const remove2 = () => hostInsert(el, container, anchor);
  4805. const performLeave = () => {
  4806. leave(el, () => {
  4807. remove2();
  4808. afterLeave && afterLeave();
  4809. });
  4810. };
  4811. if (delayLeave) {
  4812. delayLeave(el, remove2, performLeave);
  4813. } else {
  4814. performLeave();
  4815. }
  4816. }
  4817. } else {
  4818. hostInsert(el, container, anchor);
  4819. }
  4820. };
  4821. const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
  4822. const {
  4823. type,
  4824. props,
  4825. ref,
  4826. children,
  4827. dynamicChildren,
  4828. shapeFlag,
  4829. patchFlag,
  4830. dirs,
  4831. cacheIndex
  4832. } = vnode;
  4833. if (patchFlag === -2) {
  4834. optimized = false;
  4835. }
  4836. if (ref != null) {
  4837. setRef(ref, null, parentSuspense, vnode, true);
  4838. }
  4839. if (cacheIndex != null) {
  4840. parentComponent.renderCache[cacheIndex] = void 0;
  4841. }
  4842. if (shapeFlag & 256) {
  4843. parentComponent.ctx.deactivate(vnode);
  4844. return;
  4845. }
  4846. const shouldInvokeDirs = shapeFlag & 1 && dirs;
  4847. const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
  4848. let vnodeHook;
  4849. if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) {
  4850. invokeVNodeHook(vnodeHook, parentComponent, vnode);
  4851. }
  4852. if (shapeFlag & 6) {
  4853. unmountComponent(vnode.component, parentSuspense, doRemove);
  4854. } else {
  4855. if (shapeFlag & 128) {
  4856. vnode.suspense.unmount(parentSuspense, doRemove);
  4857. return;
  4858. }
  4859. if (shouldInvokeDirs) {
  4860. invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
  4861. }
  4862. if (shapeFlag & 64) {
  4863. vnode.type.remove(
  4864. vnode,
  4865. parentComponent,
  4866. parentSuspense,
  4867. internals,
  4868. doRemove
  4869. );
  4870. } else if (dynamicChildren && // #5154
  4871. // when v-once is used inside a block, setBlockTracking(-1) marks the
  4872. // parent block with hasOnce: true
  4873. // so that it doesn't take the fast path during unmount - otherwise
  4874. // components nested in v-once are never unmounted.
  4875. !dynamicChildren.hasOnce && // #1153: fast path should not be taken for non-stable (v-for) fragments
  4876. (type !== Fragment || patchFlag > 0 && patchFlag & 64)) {
  4877. unmountChildren(
  4878. dynamicChildren,
  4879. parentComponent,
  4880. parentSuspense,
  4881. false,
  4882. true
  4883. );
  4884. } else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) {
  4885. unmountChildren(children, parentComponent, parentSuspense);
  4886. }
  4887. if (doRemove) {
  4888. remove(vnode);
  4889. }
  4890. }
  4891. if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) {
  4892. queuePostRenderEffect(() => {
  4893. vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
  4894. shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
  4895. }, parentSuspense);
  4896. }
  4897. };
  4898. const remove = (vnode) => {
  4899. const { type, el, anchor, transition } = vnode;
  4900. if (type === Fragment) {
  4901. if (vnode.patchFlag > 0 && vnode.patchFlag & 2048 && transition && !transition.persisted) {
  4902. vnode.children.forEach((child) => {
  4903. if (child.type === Comment) {
  4904. hostRemove(child.el);
  4905. } else {
  4906. remove(child);
  4907. }
  4908. });
  4909. } else {
  4910. removeFragment(el, anchor);
  4911. }
  4912. return;
  4913. }
  4914. if (type === Static) {
  4915. removeStaticNode(vnode);
  4916. return;
  4917. }
  4918. const performRemove = () => {
  4919. hostRemove(el);
  4920. if (transition && !transition.persisted && transition.afterLeave) {
  4921. transition.afterLeave();
  4922. }
  4923. };
  4924. if (vnode.shapeFlag & 1 && transition && !transition.persisted) {
  4925. const { leave, delayLeave } = transition;
  4926. const performLeave = () => leave(el, performRemove);
  4927. if (delayLeave) {
  4928. delayLeave(vnode.el, performRemove, performLeave);
  4929. } else {
  4930. performLeave();
  4931. }
  4932. } else {
  4933. performRemove();
  4934. }
  4935. };
  4936. const removeFragment = (cur, end) => {
  4937. let next;
  4938. while (cur !== end) {
  4939. next = hostNextSibling(cur);
  4940. hostRemove(cur);
  4941. cur = next;
  4942. }
  4943. hostRemove(end);
  4944. };
  4945. const unmountComponent = (instance, parentSuspense, doRemove) => {
  4946. if (instance.type.__hmrId) {
  4947. unregisterHMR(instance);
  4948. }
  4949. const { bum, scope, update, subTree, um, m, a } = instance;
  4950. invalidateMount(m);
  4951. invalidateMount(a);
  4952. if (bum) {
  4953. invokeArrayFns(bum);
  4954. }
  4955. scope.stop();
  4956. if (update) {
  4957. update.active = false;
  4958. unmount(subTree, instance, parentSuspense, doRemove);
  4959. }
  4960. if (um) {
  4961. queuePostRenderEffect(um, parentSuspense);
  4962. }
  4963. queuePostRenderEffect(() => {
  4964. instance.isUnmounted = true;
  4965. }, parentSuspense);
  4966. if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) {
  4967. parentSuspense.deps--;
  4968. if (parentSuspense.deps === 0) {
  4969. parentSuspense.resolve();
  4970. }
  4971. }
  4972. {
  4973. devtoolsComponentRemoved(instance);
  4974. }
  4975. };
  4976. const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {
  4977. for (let i = start; i < children.length; i++) {
  4978. unmount(children[i], parentComponent, parentSuspense, doRemove, optimized);
  4979. }
  4980. };
  4981. const getNextHostNode = (vnode) => {
  4982. if (vnode.shapeFlag & 6) {
  4983. return getNextHostNode(vnode.component.subTree);
  4984. }
  4985. if (vnode.shapeFlag & 128) {
  4986. return vnode.suspense.next();
  4987. }
  4988. const el = hostNextSibling(vnode.anchor || vnode.el);
  4989. const teleportEnd = el && el[TeleportEndKey];
  4990. return teleportEnd ? hostNextSibling(teleportEnd) : el;
  4991. };
  4992. let isFlushing = false;
  4993. const render = (vnode, container, namespace) => {
  4994. if (vnode == null) {
  4995. if (container._vnode) {
  4996. unmount(container._vnode, null, null, true);
  4997. }
  4998. } else {
  4999. patch(
  5000. container._vnode || null,
  5001. vnode,
  5002. container,
  5003. null,
  5004. null,
  5005. null,
  5006. namespace
  5007. );
  5008. }
  5009. container._vnode = vnode;
  5010. if (!isFlushing) {
  5011. isFlushing = true;
  5012. flushPreFlushCbs();
  5013. flushPostFlushCbs();
  5014. isFlushing = false;
  5015. }
  5016. };
  5017. const internals = {
  5018. p: patch,
  5019. um: unmount,
  5020. m: move,
  5021. r: remove,
  5022. mt: mountComponent,
  5023. mc: mountChildren,
  5024. pc: patchChildren,
  5025. pbc: patchBlockChildren,
  5026. n: getNextHostNode,
  5027. o: options
  5028. };
  5029. let hydrate;
  5030. let hydrateNode;
  5031. return {
  5032. render,
  5033. hydrate,
  5034. createApp: createAppAPI(render, hydrate)
  5035. };
  5036. }
  5037. function resolveChildrenNamespace({ type, props }, currentNamespace) {
  5038. return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
  5039. }
  5040. function toggleRecurse({ effect, update }, allowed) {
  5041. effect.allowRecurse = update.allowRecurse = allowed;
  5042. }
  5043. function needTransition(parentSuspense, transition) {
  5044. return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
  5045. }
  5046. function traverseStaticChildren(n1, n2, shallow = false) {
  5047. const ch1 = n1.children;
  5048. const ch2 = n2.children;
  5049. if (isArray(ch1) && isArray(ch2)) {
  5050. for (let i = 0; i < ch1.length; i++) {
  5051. const c1 = ch1[i];
  5052. let c2 = ch2[i];
  5053. if (c2.shapeFlag & 1 && !c2.dynamicChildren) {
  5054. if (c2.patchFlag <= 0 || c2.patchFlag === 32) {
  5055. c2 = ch2[i] = cloneIfMounted(ch2[i]);
  5056. c2.el = c1.el;
  5057. }
  5058. if (!shallow && c2.patchFlag !== -2)
  5059. traverseStaticChildren(c1, c2);
  5060. }
  5061. if (c2.type === Text) {
  5062. c2.el = c1.el;
  5063. }
  5064. if (c2.type === Comment && !c2.el) {
  5065. c2.el = c1.el;
  5066. }
  5067. }
  5068. }
  5069. }
  5070. function getSequence(arr) {
  5071. const p = arr.slice();
  5072. const result = [0];
  5073. let i, j, u, v, c;
  5074. const len = arr.length;
  5075. for (i = 0; i < len; i++) {
  5076. const arrI = arr[i];
  5077. if (arrI !== 0) {
  5078. j = result[result.length - 1];
  5079. if (arr[j] < arrI) {
  5080. p[i] = j;
  5081. result.push(i);
  5082. continue;
  5083. }
  5084. u = 0;
  5085. v = result.length - 1;
  5086. while (u < v) {
  5087. c = u + v >> 1;
  5088. if (arr[result[c]] < arrI) {
  5089. u = c + 1;
  5090. } else {
  5091. v = c;
  5092. }
  5093. }
  5094. if (arrI < arr[result[u]]) {
  5095. if (u > 0) {
  5096. p[i] = result[u - 1];
  5097. }
  5098. result[u] = i;
  5099. }
  5100. }
  5101. }
  5102. u = result.length;
  5103. v = result[u - 1];
  5104. while (u-- > 0) {
  5105. result[u] = v;
  5106. v = p[v];
  5107. }
  5108. return result;
  5109. }
  5110. function locateNonHydratedAsyncRoot(instance) {
  5111. const subComponent = instance.subTree.component;
  5112. if (subComponent) {
  5113. if (subComponent.asyncDep && !subComponent.asyncResolved) {
  5114. return subComponent;
  5115. } else {
  5116. return locateNonHydratedAsyncRoot(subComponent);
  5117. }
  5118. }
  5119. }
  5120. function invalidateMount(hooks) {
  5121. if (hooks) {
  5122. for (let i = 0; i < hooks.length; i++) hooks[i].active = false;
  5123. }
  5124. }
  5125. const ssrContextKey = Symbol.for("v-scx");
  5126. const useSSRContext = () => {
  5127. {
  5128. const ctx = inject(ssrContextKey);
  5129. if (!ctx) {
  5130. warn$1(
  5131. `Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.`
  5132. );
  5133. }
  5134. return ctx;
  5135. }
  5136. };
  5137. const INITIAL_WATCHER_VALUE = {};
  5138. function watch(source, cb, options) {
  5139. if (!isFunction(cb)) {
  5140. warn$1(
  5141. `\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.`
  5142. );
  5143. }
  5144. return doWatch(source, cb, options);
  5145. }
  5146. function doWatch(source, cb, {
  5147. immediate,
  5148. deep,
  5149. flush,
  5150. once,
  5151. onTrack,
  5152. onTrigger
  5153. } = EMPTY_OBJ) {
  5154. if (cb && once) {
  5155. const _cb = cb;
  5156. cb = (...args) => {
  5157. _cb(...args);
  5158. unwatch();
  5159. };
  5160. }
  5161. if (deep !== void 0 && typeof deep === "number") {
  5162. warn$1(
  5163. `watch() "deep" option with number value will be used as watch depth in future versions. Please use a boolean instead to avoid potential breakage.`
  5164. );
  5165. }
  5166. if (!cb) {
  5167. if (immediate !== void 0) {
  5168. warn$1(
  5169. `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`
  5170. );
  5171. }
  5172. if (deep !== void 0) {
  5173. warn$1(
  5174. `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
  5175. );
  5176. }
  5177. if (once !== void 0) {
  5178. warn$1(
  5179. `watch() "once" option is only respected when using the watch(source, callback, options?) signature.`
  5180. );
  5181. }
  5182. }
  5183. const warnInvalidSource = (s) => {
  5184. warn$1(
  5185. `Invalid watch source: `,
  5186. s,
  5187. `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`
  5188. );
  5189. };
  5190. const instance = currentInstance;
  5191. const reactiveGetter = (source2) => deep === true ? source2 : (
  5192. // for deep: false, only traverse root-level properties
  5193. traverse(source2, deep === false ? 1 : void 0)
  5194. );
  5195. let getter;
  5196. let forceTrigger = false;
  5197. let isMultiSource = false;
  5198. if (isRef(source)) {
  5199. getter = () => source.value;
  5200. forceTrigger = isShallow(source);
  5201. } else if (isReactive(source)) {
  5202. getter = () => reactiveGetter(source);
  5203. forceTrigger = true;
  5204. } else if (isArray(source)) {
  5205. isMultiSource = true;
  5206. forceTrigger = source.some((s) => isReactive(s) || isShallow(s));
  5207. getter = () => source.map((s) => {
  5208. if (isRef(s)) {
  5209. return s.value;
  5210. } else if (isReactive(s)) {
  5211. return reactiveGetter(s);
  5212. } else if (isFunction(s)) {
  5213. return callWithErrorHandling(s, instance, 2);
  5214. } else {
  5215. warnInvalidSource(s);
  5216. }
  5217. });
  5218. } else if (isFunction(source)) {
  5219. if (cb) {
  5220. getter = () => callWithErrorHandling(source, instance, 2);
  5221. } else {
  5222. getter = () => {
  5223. if (cleanup) {
  5224. cleanup();
  5225. }
  5226. return callWithAsyncErrorHandling(
  5227. source,
  5228. instance,
  5229. 3,
  5230. [onCleanup]
  5231. );
  5232. };
  5233. }
  5234. } else {
  5235. getter = NOOP;
  5236. warnInvalidSource(source);
  5237. }
  5238. if (cb && deep) {
  5239. const baseGetter = getter;
  5240. getter = () => traverse(baseGetter());
  5241. }
  5242. let cleanup;
  5243. let onCleanup = (fn) => {
  5244. cleanup = effect.onStop = () => {
  5245. callWithErrorHandling(fn, instance, 4);
  5246. cleanup = effect.onStop = void 0;
  5247. };
  5248. };
  5249. let ssrCleanup;
  5250. if (isInSSRComponentSetup) {
  5251. onCleanup = NOOP;
  5252. if (!cb) {
  5253. getter();
  5254. } else if (immediate) {
  5255. callWithAsyncErrorHandling(cb, instance, 3, [
  5256. getter(),
  5257. isMultiSource ? [] : void 0,
  5258. onCleanup
  5259. ]);
  5260. }
  5261. if (flush === "sync") {
  5262. const ctx = useSSRContext();
  5263. ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
  5264. } else {
  5265. return NOOP;
  5266. }
  5267. }
  5268. let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
  5269. const job = () => {
  5270. if (!effect.active || !effect.dirty) {
  5271. return;
  5272. }
  5273. if (cb) {
  5274. const newValue = effect.run();
  5275. if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue)) || false) {
  5276. if (cleanup) {
  5277. cleanup();
  5278. }
  5279. callWithAsyncErrorHandling(cb, instance, 3, [
  5280. newValue,
  5281. // pass undefined as the old value when it's changed for the first time
  5282. oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
  5283. onCleanup
  5284. ]);
  5285. oldValue = newValue;
  5286. }
  5287. } else {
  5288. effect.run();
  5289. }
  5290. };
  5291. job.allowRecurse = !!cb;
  5292. let scheduler;
  5293. if (flush === "sync") {
  5294. scheduler = job;
  5295. } else if (flush === "post") {
  5296. scheduler = () => queuePostRenderEffect(job, instance && instance.suspense);
  5297. } else {
  5298. job.pre = true;
  5299. if (instance) job.id = instance.uid;
  5300. scheduler = () => queueJob(job);
  5301. }
  5302. const effect = new ReactiveEffect(getter, NOOP, scheduler);
  5303. const scope = getCurrentScope();
  5304. const unwatch = () => {
  5305. effect.stop();
  5306. if (scope) {
  5307. remove(scope.effects, effect);
  5308. }
  5309. };
  5310. {
  5311. effect.onTrack = onTrack;
  5312. effect.onTrigger = onTrigger;
  5313. }
  5314. if (cb) {
  5315. if (immediate) {
  5316. job();
  5317. } else {
  5318. oldValue = effect.run();
  5319. }
  5320. } else if (flush === "post") {
  5321. queuePostRenderEffect(
  5322. effect.run.bind(effect),
  5323. instance && instance.suspense
  5324. );
  5325. } else {
  5326. effect.run();
  5327. }
  5328. if (ssrCleanup) ssrCleanup.push(unwatch);
  5329. return unwatch;
  5330. }
  5331. function instanceWatch(source, value, options) {
  5332. const publicThis = this.proxy;
  5333. const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
  5334. let cb;
  5335. if (isFunction(value)) {
  5336. cb = value;
  5337. } else {
  5338. cb = value.handler;
  5339. options = value;
  5340. }
  5341. const reset = setCurrentInstance(this);
  5342. const res = doWatch(getter, cb.bind(publicThis), options);
  5343. reset();
  5344. return res;
  5345. }
  5346. function createPathGetter(ctx, path) {
  5347. const segments = path.split(".");
  5348. return () => {
  5349. let cur = ctx;
  5350. for (let i = 0; i < segments.length && cur; i++) {
  5351. cur = cur[segments[i]];
  5352. }
  5353. return cur;
  5354. };
  5355. }
  5356. function traverse(value, depth = Infinity, seen) {
  5357. if (depth <= 0 || !isObject(value) || value["__v_skip"]) {
  5358. return value;
  5359. }
  5360. seen = seen || /* @__PURE__ */ new Set();
  5361. if (seen.has(value)) {
  5362. return value;
  5363. }
  5364. seen.add(value);
  5365. depth--;
  5366. if (isRef(value)) {
  5367. traverse(value.value, depth, seen);
  5368. } else if (isArray(value)) {
  5369. for (let i = 0; i < value.length; i++) {
  5370. traverse(value[i], depth, seen);
  5371. }
  5372. } else if (isSet(value) || isMap(value)) {
  5373. value.forEach((v) => {
  5374. traverse(v, depth, seen);
  5375. });
  5376. } else if (isPlainObject(value)) {
  5377. for (const key in value) {
  5378. traverse(value[key], depth, seen);
  5379. }
  5380. for (const key of Object.getOwnPropertySymbols(value)) {
  5381. if (Object.prototype.propertyIsEnumerable.call(value, key)) {
  5382. traverse(value[key], depth, seen);
  5383. }
  5384. }
  5385. }
  5386. return value;
  5387. }
  5388. const getModelModifiers = (props, modelName) => {
  5389. return modelName === "modelValue" || modelName === "model-value" ? props.modelModifiers : props[`${modelName}Modifiers`] || props[`${camelize(modelName)}Modifiers`] || props[`${hyphenate(modelName)}Modifiers`];
  5390. };
  5391. function emit(instance, event, ...rawArgs) {
  5392. if (instance.isUnmounted) return;
  5393. const props = instance.vnode.props || EMPTY_OBJ;
  5394. {
  5395. const {
  5396. emitsOptions,
  5397. propsOptions: [propsOptions]
  5398. } = instance;
  5399. if (emitsOptions) {
  5400. if (!(event in emitsOptions) && true) {
  5401. if (!propsOptions || !(toHandlerKey(camelize(event)) in propsOptions)) {
  5402. warn$1(
  5403. `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(camelize(event))}" prop.`
  5404. );
  5405. }
  5406. } else {
  5407. const validator = emitsOptions[event];
  5408. if (isFunction(validator)) {
  5409. const isValid = validator(...rawArgs);
  5410. if (!isValid) {
  5411. warn$1(
  5412. `Invalid event arguments: event validation failed for event "${event}".`
  5413. );
  5414. }
  5415. }
  5416. }
  5417. }
  5418. }
  5419. let args = rawArgs;
  5420. const isModelListener = event.startsWith("update:");
  5421. const modifiers = isModelListener && getModelModifiers(props, event.slice(7));
  5422. if (modifiers) {
  5423. if (modifiers.trim) {
  5424. args = rawArgs.map((a) => isString(a) ? a.trim() : a);
  5425. }
  5426. if (modifiers.number) {
  5427. args = rawArgs.map(looseToNumber);
  5428. }
  5429. }
  5430. {
  5431. devtoolsComponentEmit(instance, event, args);
  5432. }
  5433. {
  5434. const lowerCaseEvent = event.toLowerCase();
  5435. if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) {
  5436. warn$1(
  5437. `Event "${lowerCaseEvent}" is emitted in component ${formatComponentName(
  5438. instance,
  5439. instance.type
  5440. )} but the handler is registered for "${event}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${hyphenate(
  5441. event
  5442. )}" instead of "${event}".`
  5443. );
  5444. }
  5445. }
  5446. let handlerName;
  5447. let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249)
  5448. props[handlerName = toHandlerKey(camelize(event))];
  5449. if (!handler && isModelListener) {
  5450. handler = props[handlerName = toHandlerKey(hyphenate(event))];
  5451. }
  5452. if (handler) {
  5453. callWithAsyncErrorHandling(
  5454. handler,
  5455. instance,
  5456. 6,
  5457. args
  5458. );
  5459. }
  5460. const onceHandler = props[handlerName + `Once`];
  5461. if (onceHandler) {
  5462. if (!instance.emitted) {
  5463. instance.emitted = {};
  5464. } else if (instance.emitted[handlerName]) {
  5465. return;
  5466. }
  5467. instance.emitted[handlerName] = true;
  5468. callWithAsyncErrorHandling(
  5469. onceHandler,
  5470. instance,
  5471. 6,
  5472. args
  5473. );
  5474. }
  5475. }
  5476. function normalizeEmitsOptions(comp, appContext, asMixin = false) {
  5477. const cache = appContext.emitsCache;
  5478. const cached = cache.get(comp);
  5479. if (cached !== void 0) {
  5480. return cached;
  5481. }
  5482. const raw = comp.emits;
  5483. let normalized = {};
  5484. let hasExtends = false;
  5485. if (!isFunction(comp)) {
  5486. const extendEmits = (raw2) => {
  5487. const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
  5488. if (normalizedFromExtend) {
  5489. hasExtends = true;
  5490. extend(normalized, normalizedFromExtend);
  5491. }
  5492. };
  5493. if (!asMixin && appContext.mixins.length) {
  5494. appContext.mixins.forEach(extendEmits);
  5495. }
  5496. if (comp.extends) {
  5497. extendEmits(comp.extends);
  5498. }
  5499. if (comp.mixins) {
  5500. comp.mixins.forEach(extendEmits);
  5501. }
  5502. }
  5503. if (!raw && !hasExtends) {
  5504. if (isObject(comp)) {
  5505. cache.set(comp, null);
  5506. }
  5507. return null;
  5508. }
  5509. if (isArray(raw)) {
  5510. raw.forEach((key) => normalized[key] = null);
  5511. } else {
  5512. extend(normalized, raw);
  5513. }
  5514. if (isObject(comp)) {
  5515. cache.set(comp, normalized);
  5516. }
  5517. return normalized;
  5518. }
  5519. function isEmitListener(options, key) {
  5520. if (!options || !isOn(key)) {
  5521. return false;
  5522. }
  5523. key = key.slice(2).replace(/Once$/, "");
  5524. return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
  5525. }
  5526. let accessedAttrs = false;
  5527. function markAttrsAccessed() {
  5528. accessedAttrs = true;
  5529. }
  5530. function renderComponentRoot$1(instance) {
  5531. const {
  5532. type: Component,
  5533. vnode,
  5534. proxy,
  5535. withProxy,
  5536. propsOptions: [propsOptions],
  5537. slots,
  5538. attrs,
  5539. emit,
  5540. render,
  5541. renderCache,
  5542. props,
  5543. data,
  5544. setupState,
  5545. ctx,
  5546. inheritAttrs
  5547. } = instance;
  5548. const prev = setCurrentRenderingInstance$1(instance);
  5549. let result;
  5550. let fallthroughAttrs;
  5551. {
  5552. accessedAttrs = false;
  5553. }
  5554. try {
  5555. if (vnode.shapeFlag & 4) {
  5556. const proxyToUse = withProxy || proxy;
  5557. const thisProxy = setupState.__isScriptSetup ? new Proxy(proxyToUse, {
  5558. get(target, key, receiver) {
  5559. warn$1(
  5560. `Property '${String(
  5561. key
  5562. )}' was accessed via 'this'. Avoid using 'this' in templates.`
  5563. );
  5564. return Reflect.get(target, key, receiver);
  5565. }
  5566. }) : proxyToUse;
  5567. result = normalizeVNode$1(
  5568. render.call(
  5569. thisProxy,
  5570. proxyToUse,
  5571. renderCache,
  5572. true ? shallowReadonly(props) : props,
  5573. setupState,
  5574. data,
  5575. ctx
  5576. )
  5577. );
  5578. fallthroughAttrs = attrs;
  5579. } else {
  5580. const render2 = Component;
  5581. if (attrs === props) {
  5582. markAttrsAccessed();
  5583. }
  5584. result = normalizeVNode$1(
  5585. render2.length > 1 ? render2(
  5586. true ? shallowReadonly(props) : props,
  5587. true ? {
  5588. get attrs() {
  5589. markAttrsAccessed();
  5590. return shallowReadonly(attrs);
  5591. },
  5592. slots,
  5593. emit
  5594. } : { attrs, slots, emit }
  5595. ) : render2(
  5596. true ? shallowReadonly(props) : props,
  5597. null
  5598. )
  5599. );
  5600. fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs);
  5601. }
  5602. } catch (err) {
  5603. handleError(err, instance, 1);
  5604. result = createVNode(Comment);
  5605. }
  5606. let root = result;
  5607. let setRoot = void 0;
  5608. if (result.patchFlag > 0 && result.patchFlag & 2048) {
  5609. [root, setRoot] = getChildRoot(result);
  5610. }
  5611. if (fallthroughAttrs && inheritAttrs !== false) {
  5612. const keys = Object.keys(fallthroughAttrs);
  5613. const { shapeFlag } = root;
  5614. if (keys.length) {
  5615. if (shapeFlag & (1 | 6)) {
  5616. if (propsOptions && keys.some(isModelListener)) {
  5617. fallthroughAttrs = filterModelListeners(
  5618. fallthroughAttrs,
  5619. propsOptions
  5620. );
  5621. }
  5622. root = cloneVNode(root, fallthroughAttrs, false, true);
  5623. } else if (!accessedAttrs && root.type !== Comment) {
  5624. const allAttrs = Object.keys(attrs);
  5625. const eventAttrs = [];
  5626. const extraAttrs = [];
  5627. for (let i = 0, l = allAttrs.length; i < l; i++) {
  5628. const key = allAttrs[i];
  5629. if (isOn(key)) {
  5630. if (!isModelListener(key)) {
  5631. eventAttrs.push(key[2].toLowerCase() + key.slice(3));
  5632. }
  5633. } else {
  5634. extraAttrs.push(key);
  5635. }
  5636. }
  5637. if (extraAttrs.length) {
  5638. warn$1(
  5639. `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.`
  5640. );
  5641. }
  5642. if (eventAttrs.length) {
  5643. warn$1(
  5644. `Extraneous non-emits event listeners (${eventAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.`
  5645. );
  5646. }
  5647. }
  5648. }
  5649. }
  5650. if (vnode.dirs) {
  5651. if (!isElementRoot(root)) {
  5652. warn$1(
  5653. `Runtime directive used on component with non-element root node. The directives will not function as intended.`
  5654. );
  5655. }
  5656. root = cloneVNode(root, null, false, true);
  5657. root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
  5658. }
  5659. if (vnode.transition) {
  5660. if (!isElementRoot(root)) {
  5661. warn$1(
  5662. `Component inside <Transition> renders non-element root node that cannot be animated.`
  5663. );
  5664. }
  5665. root.transition = vnode.transition;
  5666. }
  5667. if (setRoot) {
  5668. setRoot(root);
  5669. } else {
  5670. result = root;
  5671. }
  5672. setCurrentRenderingInstance$1(prev);
  5673. return result;
  5674. }
  5675. const getChildRoot = (vnode) => {
  5676. const rawChildren = vnode.children;
  5677. const dynamicChildren = vnode.dynamicChildren;
  5678. const childRoot = filterSingleRoot(rawChildren, false);
  5679. if (!childRoot) {
  5680. return [vnode, void 0];
  5681. } else if (childRoot.patchFlag > 0 && childRoot.patchFlag & 2048) {
  5682. return getChildRoot(childRoot);
  5683. }
  5684. const index = rawChildren.indexOf(childRoot);
  5685. const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1;
  5686. const setRoot = (updatedRoot) => {
  5687. rawChildren[index] = updatedRoot;
  5688. if (dynamicChildren) {
  5689. if (dynamicIndex > -1) {
  5690. dynamicChildren[dynamicIndex] = updatedRoot;
  5691. } else if (updatedRoot.patchFlag > 0) {
  5692. vnode.dynamicChildren = [...dynamicChildren, updatedRoot];
  5693. }
  5694. }
  5695. };
  5696. return [normalizeVNode$1(childRoot), setRoot];
  5697. };
  5698. function filterSingleRoot(children, recurse = true) {
  5699. let singleRoot;
  5700. for (let i = 0; i < children.length; i++) {
  5701. const child = children[i];
  5702. if (isVNode$2(child)) {
  5703. if (child.type !== Comment || child.children === "v-if") {
  5704. if (singleRoot) {
  5705. return;
  5706. } else {
  5707. singleRoot = child;
  5708. if (recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) {
  5709. return filterSingleRoot(singleRoot.children);
  5710. }
  5711. }
  5712. }
  5713. } else {
  5714. return;
  5715. }
  5716. }
  5717. return singleRoot;
  5718. }
  5719. const getFunctionalFallthrough = (attrs) => {
  5720. let res;
  5721. for (const key in attrs) {
  5722. if (key === "class" || key === "style" || isOn(key)) {
  5723. (res || (res = {}))[key] = attrs[key];
  5724. }
  5725. }
  5726. return res;
  5727. };
  5728. const filterModelListeners = (attrs, props) => {
  5729. const res = {};
  5730. for (const key in attrs) {
  5731. if (!isModelListener(key) || !(key.slice(9) in props)) {
  5732. res[key] = attrs[key];
  5733. }
  5734. }
  5735. return res;
  5736. };
  5737. const isElementRoot = (vnode) => {
  5738. return vnode.shapeFlag & (6 | 1) || vnode.type === Comment;
  5739. };
  5740. function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
  5741. const { props: prevProps, children: prevChildren, component } = prevVNode;
  5742. const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;
  5743. const emits = component.emitsOptions;
  5744. if ((prevChildren || nextChildren) && isHmrUpdating) {
  5745. return true;
  5746. }
  5747. if (nextVNode.dirs || nextVNode.transition) {
  5748. return true;
  5749. }
  5750. if (optimized && patchFlag >= 0) {
  5751. if (patchFlag & 1024) {
  5752. return true;
  5753. }
  5754. if (patchFlag & 16) {
  5755. if (!prevProps) {
  5756. return !!nextProps;
  5757. }
  5758. return hasPropsChanged(prevProps, nextProps, emits);
  5759. } else if (patchFlag & 8) {
  5760. const dynamicProps = nextVNode.dynamicProps;
  5761. for (let i = 0; i < dynamicProps.length; i++) {
  5762. const key = dynamicProps[i];
  5763. if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) {
  5764. return true;
  5765. }
  5766. }
  5767. }
  5768. } else {
  5769. if (prevChildren || nextChildren) {
  5770. if (!nextChildren || !nextChildren.$stable) {
  5771. return true;
  5772. }
  5773. }
  5774. if (prevProps === nextProps) {
  5775. return false;
  5776. }
  5777. if (!prevProps) {
  5778. return !!nextProps;
  5779. }
  5780. if (!nextProps) {
  5781. return true;
  5782. }
  5783. return hasPropsChanged(prevProps, nextProps, emits);
  5784. }
  5785. return false;
  5786. }
  5787. function hasPropsChanged(prevProps, nextProps, emitsOptions) {
  5788. const nextKeys = Object.keys(nextProps);
  5789. if (nextKeys.length !== Object.keys(prevProps).length) {
  5790. return true;
  5791. }
  5792. for (let i = 0; i < nextKeys.length; i++) {
  5793. const key = nextKeys[i];
  5794. if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) {
  5795. return true;
  5796. }
  5797. }
  5798. return false;
  5799. }
  5800. function updateHOCHostEl({ vnode, parent }, el) {
  5801. while (parent) {
  5802. const root = parent.subTree;
  5803. if (root.suspense && root.suspense.activeBranch === vnode) {
  5804. root.el = vnode.el;
  5805. }
  5806. if (root === vnode) {
  5807. (vnode = parent.vnode).el = el;
  5808. parent = parent.parent;
  5809. } else {
  5810. break;
  5811. }
  5812. }
  5813. }
  5814. const isSuspense = (type) => type.__isSuspense;
  5815. function queueEffectWithSuspense(fn, suspense) {
  5816. if (suspense && suspense.pendingBranch) {
  5817. if (isArray(fn)) {
  5818. suspense.effects.push(...fn);
  5819. } else {
  5820. suspense.effects.push(fn);
  5821. }
  5822. } else {
  5823. queuePostFlushCb(fn);
  5824. }
  5825. }
  5826. const Fragment = Symbol.for("v-fgt");
  5827. const Text = Symbol.for("v-txt");
  5828. const Comment = Symbol.for("v-cmt");
  5829. const Static = Symbol.for("v-stc");
  5830. let currentBlock = null;
  5831. let isBlockTreeEnabled = 1;
  5832. function setBlockTracking(value) {
  5833. isBlockTreeEnabled += value;
  5834. if (value < 0 && currentBlock) {
  5835. currentBlock.hasOnce = true;
  5836. }
  5837. }
  5838. function isVNode$2(value) {
  5839. return value ? value.__v_isVNode === true : false;
  5840. }
  5841. function isSameVNodeType(n1, n2) {
  5842. if (n2.shapeFlag & 6 && n1.component) {
  5843. const dirtyInstances = hmrDirtyComponents.get(n2.type);
  5844. if (dirtyInstances && dirtyInstances.has(n1.component)) {
  5845. n1.shapeFlag &= ~256;
  5846. n2.shapeFlag &= ~512;
  5847. return false;
  5848. }
  5849. }
  5850. return n1.type === n2.type && n1.key === n2.key;
  5851. }
  5852. const createVNodeWithArgsTransform = (...args) => {
  5853. return _createVNode(
  5854. ...args
  5855. );
  5856. };
  5857. const normalizeKey = ({ key }) => key != null ? key : null;
  5858. const normalizeRef = ({
  5859. ref,
  5860. ref_key,
  5861. ref_for
  5862. }) => {
  5863. if (typeof ref === "number") {
  5864. ref = "" + ref;
  5865. }
  5866. return ref != null ? isString(ref) || isRef(ref) || isFunction(ref) ? { i: currentRenderingInstance, r: ref, k: ref_key, f: !!ref_for } : ref : null;
  5867. };
  5868. function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) {
  5869. const vnode = {
  5870. __v_isVNode: true,
  5871. __v_skip: true,
  5872. type,
  5873. props,
  5874. key: props && normalizeKey(props),
  5875. ref: props && normalizeRef(props),
  5876. scopeId: currentScopeId,
  5877. slotScopeIds: null,
  5878. children,
  5879. component: null,
  5880. suspense: null,
  5881. ssContent: null,
  5882. ssFallback: null,
  5883. dirs: null,
  5884. transition: null,
  5885. el: null,
  5886. anchor: null,
  5887. target: null,
  5888. targetStart: null,
  5889. targetAnchor: null,
  5890. staticCount: 0,
  5891. shapeFlag,
  5892. patchFlag,
  5893. dynamicProps,
  5894. dynamicChildren: null,
  5895. appContext: null,
  5896. ctx: currentRenderingInstance
  5897. };
  5898. if (needFullChildrenNormalization) {
  5899. normalizeChildren(vnode, children);
  5900. if (shapeFlag & 128) {
  5901. type.normalize(vnode);
  5902. }
  5903. } else if (children) {
  5904. vnode.shapeFlag |= isString(children) ? 8 : 16;
  5905. }
  5906. if (vnode.key !== vnode.key) {
  5907. warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
  5908. }
  5909. if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself
  5910. !isBlockNode && // has current parent block
  5911. currentBlock && // presence of a patch flag indicates this node needs patching on updates.
  5912. // component nodes also should always be patched, because even if the
  5913. // component doesn't need to update, it needs to persist the instance on to
  5914. // the next vnode so that it can be properly unmounted later.
  5915. (vnode.patchFlag > 0 || shapeFlag & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the
  5916. // vnode should not be considered dynamic due to handler caching.
  5917. vnode.patchFlag !== 32) {
  5918. currentBlock.push(vnode);
  5919. }
  5920. return vnode;
  5921. }
  5922. const createVNode = createVNodeWithArgsTransform ;
  5923. function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
  5924. if (!type || type === NULL_DYNAMIC_COMPONENT) {
  5925. if (!type) {
  5926. warn$1(`Invalid vnode type when creating vnode: ${type}.`);
  5927. }
  5928. type = Comment;
  5929. }
  5930. if (isVNode$2(type)) {
  5931. const cloned = cloneVNode(
  5932. type,
  5933. props,
  5934. true
  5935. /* mergeRef: true */
  5936. );
  5937. if (children) {
  5938. normalizeChildren(cloned, children);
  5939. }
  5940. if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
  5941. if (cloned.shapeFlag & 6) {
  5942. currentBlock[currentBlock.indexOf(type)] = cloned;
  5943. } else {
  5944. currentBlock.push(cloned);
  5945. }
  5946. }
  5947. cloned.patchFlag = -2;
  5948. return cloned;
  5949. }
  5950. if (isClassComponent(type)) {
  5951. type = type.__vccOpts;
  5952. }
  5953. if (props) {
  5954. props = guardReactiveProps(props);
  5955. let { class: klass, style } = props;
  5956. if (klass && !isString(klass)) {
  5957. props.class = normalizeClass(klass);
  5958. }
  5959. if (isObject(style)) {
  5960. if (isProxy(style) && !isArray(style)) {
  5961. style = extend({}, style);
  5962. }
  5963. props.style = normalizeStyle(style);
  5964. }
  5965. }
  5966. const shapeFlag = isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject(type) ? 4 : isFunction(type) ? 2 : 0;
  5967. if (shapeFlag & 4 && isProxy(type)) {
  5968. type = toRaw(type);
  5969. warn$1(
  5970. `Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with \`markRaw\` or using \`shallowRef\` instead of \`ref\`.`,
  5971. `
  5972. Component that was made reactive: `,
  5973. type
  5974. );
  5975. }
  5976. return createBaseVNode(
  5977. type,
  5978. props,
  5979. children,
  5980. patchFlag,
  5981. dynamicProps,
  5982. shapeFlag,
  5983. isBlockNode,
  5984. true
  5985. );
  5986. }
  5987. function guardReactiveProps(props) {
  5988. if (!props) return null;
  5989. return isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
  5990. }
  5991. function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
  5992. const { props, ref, patchFlag, children, transition } = vnode;
  5993. const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props;
  5994. const cloned = {
  5995. __v_isVNode: true,
  5996. __v_skip: true,
  5997. type: vnode.type,
  5998. props: mergedProps,
  5999. key: mergedProps && normalizeKey(mergedProps),
  6000. ref: extraProps && extraProps.ref ? (
  6001. // #2078 in the case of <component :is="vnode" ref="extra"/>
  6002. // if the vnode itself already has a ref, cloneVNode will need to merge
  6003. // the refs so the single vnode can be set on multiple refs
  6004. mergeRef && ref ? isArray(ref) ? ref.concat(normalizeRef(extraProps)) : [ref, normalizeRef(extraProps)] : normalizeRef(extraProps)
  6005. ) : ref,
  6006. scopeId: vnode.scopeId,
  6007. slotScopeIds: vnode.slotScopeIds,
  6008. children: patchFlag === -1 && isArray(children) ? children.map(deepCloneVNode) : children,
  6009. target: vnode.target,
  6010. targetStart: vnode.targetStart,
  6011. targetAnchor: vnode.targetAnchor,
  6012. staticCount: vnode.staticCount,
  6013. shapeFlag: vnode.shapeFlag,
  6014. // if the vnode is cloned with extra props, we can no longer assume its
  6015. // existing patch flag to be reliable and need to add the FULL_PROPS flag.
  6016. // note: preserve flag for fragments since they use the flag for children
  6017. // fast paths only.
  6018. patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag,
  6019. dynamicProps: vnode.dynamicProps,
  6020. dynamicChildren: vnode.dynamicChildren,
  6021. appContext: vnode.appContext,
  6022. dirs: vnode.dirs,
  6023. transition,
  6024. // These should technically only be non-null on mounted VNodes. However,
  6025. // they *should* be copied for kept-alive vnodes. So we just always copy
  6026. // them since them being non-null during a mount doesn't affect the logic as
  6027. // they will simply be overwritten.
  6028. component: vnode.component,
  6029. suspense: vnode.suspense,
  6030. ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
  6031. ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
  6032. el: vnode.el,
  6033. anchor: vnode.anchor,
  6034. ctx: vnode.ctx,
  6035. ce: vnode.ce
  6036. };
  6037. if (transition && cloneTransition) {
  6038. setTransitionHooks(
  6039. cloned,
  6040. transition.clone(cloned)
  6041. );
  6042. }
  6043. return cloned;
  6044. }
  6045. function deepCloneVNode(vnode) {
  6046. const cloned = cloneVNode(vnode);
  6047. if (isArray(vnode.children)) {
  6048. cloned.children = vnode.children.map(deepCloneVNode);
  6049. }
  6050. return cloned;
  6051. }
  6052. function createTextVNode(text = " ", flag = 0) {
  6053. return createVNode(Text, null, text, flag);
  6054. }
  6055. function normalizeVNode$1(child) {
  6056. if (child == null || typeof child === "boolean") {
  6057. return createVNode(Comment);
  6058. } else if (isArray(child)) {
  6059. return createVNode(
  6060. Fragment,
  6061. null,
  6062. // #3666, avoid reference pollution when reusing vnode
  6063. child.slice()
  6064. );
  6065. } else if (typeof child === "object") {
  6066. return cloneIfMounted(child);
  6067. } else {
  6068. return createVNode(Text, null, String(child));
  6069. }
  6070. }
  6071. function cloneIfMounted(child) {
  6072. return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child);
  6073. }
  6074. function normalizeChildren(vnode, children) {
  6075. let type = 0;
  6076. const { shapeFlag } = vnode;
  6077. if (children == null) {
  6078. children = null;
  6079. } else if (isArray(children)) {
  6080. type = 16;
  6081. } else if (typeof children === "object") {
  6082. if (shapeFlag & (1 | 64)) {
  6083. const slot = children.default;
  6084. if (slot) {
  6085. slot._c && (slot._d = false);
  6086. normalizeChildren(vnode, slot());
  6087. slot._c && (slot._d = true);
  6088. }
  6089. return;
  6090. } else {
  6091. type = 32;
  6092. const slotFlag = children._;
  6093. if (!slotFlag && !isInternalObject(children)) {
  6094. children._ctx = currentRenderingInstance;
  6095. } else if (slotFlag === 3 && currentRenderingInstance) {
  6096. if (currentRenderingInstance.slots._ === 1) {
  6097. children._ = 1;
  6098. } else {
  6099. children._ = 2;
  6100. vnode.patchFlag |= 1024;
  6101. }
  6102. }
  6103. }
  6104. } else if (isFunction(children)) {
  6105. children = { default: children, _ctx: currentRenderingInstance };
  6106. type = 32;
  6107. } else {
  6108. children = String(children);
  6109. if (shapeFlag & 64) {
  6110. type = 16;
  6111. children = [createTextVNode(children)];
  6112. } else {
  6113. type = 8;
  6114. }
  6115. }
  6116. vnode.children = children;
  6117. vnode.shapeFlag |= type;
  6118. }
  6119. function mergeProps(...args) {
  6120. const ret = {};
  6121. for (let i = 0; i < args.length; i++) {
  6122. const toMerge = args[i];
  6123. for (const key in toMerge) {
  6124. if (key === "class") {
  6125. if (ret.class !== toMerge.class) {
  6126. ret.class = normalizeClass([ret.class, toMerge.class]);
  6127. }
  6128. } else if (key === "style") {
  6129. ret.style = normalizeStyle([ret.style, toMerge.style]);
  6130. } else if (isOn(key)) {
  6131. const existing = ret[key];
  6132. const incoming = toMerge[key];
  6133. if (incoming && existing !== incoming && !(isArray(existing) && existing.includes(incoming))) {
  6134. ret[key] = existing ? [].concat(existing, incoming) : incoming;
  6135. }
  6136. } else if (key !== "") {
  6137. ret[key] = toMerge[key];
  6138. }
  6139. }
  6140. }
  6141. return ret;
  6142. }
  6143. function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
  6144. callWithAsyncErrorHandling(hook, instance, 7, [
  6145. vnode,
  6146. prevVNode
  6147. ]);
  6148. }
  6149. const emptyAppContext = createAppContext();
  6150. let uid = 0;
  6151. function createComponentInstance$1(vnode, parent, suspense) {
  6152. const type = vnode.type;
  6153. const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
  6154. const instance = {
  6155. uid: uid++,
  6156. vnode,
  6157. type,
  6158. parent,
  6159. appContext,
  6160. root: null,
  6161. // to be immediately set
  6162. next: null,
  6163. subTree: null,
  6164. // will be set synchronously right after creation
  6165. effect: null,
  6166. update: null,
  6167. // will be set synchronously right after creation
  6168. scope: new EffectScope(
  6169. true
  6170. /* detached */
  6171. ),
  6172. render: null,
  6173. proxy: null,
  6174. exposed: null,
  6175. exposeProxy: null,
  6176. withProxy: null,
  6177. provides: parent ? parent.provides : Object.create(appContext.provides),
  6178. accessCache: null,
  6179. renderCache: [],
  6180. // local resolved assets
  6181. components: null,
  6182. directives: null,
  6183. // resolved props and emits options
  6184. propsOptions: normalizePropsOptions(type, appContext),
  6185. emitsOptions: normalizeEmitsOptions(type, appContext),
  6186. // emit
  6187. emit: null,
  6188. // to be set immediately
  6189. emitted: null,
  6190. // props default value
  6191. propsDefaults: EMPTY_OBJ,
  6192. // inheritAttrs
  6193. inheritAttrs: type.inheritAttrs,
  6194. // state
  6195. ctx: EMPTY_OBJ,
  6196. data: EMPTY_OBJ,
  6197. props: EMPTY_OBJ,
  6198. attrs: EMPTY_OBJ,
  6199. slots: EMPTY_OBJ,
  6200. refs: EMPTY_OBJ,
  6201. setupState: EMPTY_OBJ,
  6202. setupContext: null,
  6203. // suspense related
  6204. suspense,
  6205. suspenseId: suspense ? suspense.pendingId : 0,
  6206. asyncDep: null,
  6207. asyncResolved: false,
  6208. // lifecycle hooks
  6209. // not using enums here because it results in computed properties
  6210. isMounted: false,
  6211. isUnmounted: false,
  6212. isDeactivated: false,
  6213. bc: null,
  6214. c: null,
  6215. bm: null,
  6216. m: null,
  6217. bu: null,
  6218. u: null,
  6219. um: null,
  6220. bum: null,
  6221. da: null,
  6222. a: null,
  6223. rtg: null,
  6224. rtc: null,
  6225. ec: null,
  6226. sp: null
  6227. };
  6228. {
  6229. instance.ctx = createDevRenderContext(instance);
  6230. }
  6231. instance.root = parent ? parent.root : instance;
  6232. instance.emit = emit.bind(null, instance);
  6233. if (vnode.ce) {
  6234. vnode.ce(instance);
  6235. }
  6236. return instance;
  6237. }
  6238. let currentInstance = null;
  6239. const getCurrentInstance = () => currentInstance || currentRenderingInstance;
  6240. let internalSetCurrentInstance;
  6241. let setInSSRSetupState;
  6242. {
  6243. const g = getGlobalThis();
  6244. const registerGlobalSetter = (key, setter) => {
  6245. let setters;
  6246. if (!(setters = g[key])) setters = g[key] = [];
  6247. setters.push(setter);
  6248. return (v) => {
  6249. if (setters.length > 1) setters.forEach((set) => set(v));
  6250. else setters[0](v);
  6251. };
  6252. };
  6253. internalSetCurrentInstance = registerGlobalSetter(
  6254. `__VUE_INSTANCE_SETTERS__`,
  6255. (v) => currentInstance = v
  6256. );
  6257. setInSSRSetupState = registerGlobalSetter(
  6258. `__VUE_SSR_SETTERS__`,
  6259. (v) => isInSSRComponentSetup = v
  6260. );
  6261. }
  6262. const setCurrentInstance = (instance) => {
  6263. const prev = currentInstance;
  6264. internalSetCurrentInstance(instance);
  6265. instance.scope.on();
  6266. return () => {
  6267. instance.scope.off();
  6268. internalSetCurrentInstance(prev);
  6269. };
  6270. };
  6271. const unsetCurrentInstance = () => {
  6272. currentInstance && currentInstance.scope.off();
  6273. internalSetCurrentInstance(null);
  6274. };
  6275. const isBuiltInTag = /* @__PURE__ */ makeMap("slot,component");
  6276. function validateComponentName(name, { isNativeTag }) {
  6277. if (isBuiltInTag(name) || isNativeTag(name)) {
  6278. warn$1(
  6279. "Do not use built-in or reserved HTML elements as component id: " + name
  6280. );
  6281. }
  6282. }
  6283. function isStatefulComponent(instance) {
  6284. return instance.vnode.shapeFlag & 4;
  6285. }
  6286. let isInSSRComponentSetup = false;
  6287. function setupComponent$1(instance, isSSR = false, optimized = false) {
  6288. isSSR && setInSSRSetupState(isSSR);
  6289. const { props, children } = instance.vnode;
  6290. const isStateful = isStatefulComponent(instance);
  6291. initProps(instance, props, isStateful, isSSR);
  6292. initSlots(instance, children, optimized);
  6293. const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
  6294. isSSR && setInSSRSetupState(false);
  6295. return setupResult;
  6296. }
  6297. function setupStatefulComponent(instance, isSSR) {
  6298. var _a;
  6299. const Component = instance.type;
  6300. {
  6301. if (Component.name) {
  6302. validateComponentName(Component.name, instance.appContext.config);
  6303. }
  6304. if (Component.components) {
  6305. const names = Object.keys(Component.components);
  6306. for (let i = 0; i < names.length; i++) {
  6307. validateComponentName(names[i], instance.appContext.config);
  6308. }
  6309. }
  6310. if (Component.directives) {
  6311. const names = Object.keys(Component.directives);
  6312. for (let i = 0; i < names.length; i++) {
  6313. validateDirectiveName(names[i]);
  6314. }
  6315. }
  6316. if (Component.compilerOptions && isRuntimeOnly()) {
  6317. warn$1(
  6318. `"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.`
  6319. );
  6320. }
  6321. }
  6322. instance.accessCache = /* @__PURE__ */ Object.create(null);
  6323. instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers);
  6324. {
  6325. exposePropsOnRenderContext(instance);
  6326. }
  6327. const { setup } = Component;
  6328. if (setup) {
  6329. const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
  6330. const reset = setCurrentInstance(instance);
  6331. pauseTracking();
  6332. const setupResult = callWithErrorHandling(
  6333. setup,
  6334. instance,
  6335. 0,
  6336. [
  6337. shallowReadonly(instance.props) ,
  6338. setupContext
  6339. ]
  6340. );
  6341. resetTracking();
  6342. reset();
  6343. if (isPromise(setupResult)) {
  6344. setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
  6345. if (isSSR) {
  6346. return setupResult.then((resolvedResult) => {
  6347. handleSetupResult(instance, resolvedResult, isSSR);
  6348. }).catch((e) => {
  6349. handleError(e, instance, 0);
  6350. });
  6351. } else {
  6352. instance.asyncDep = setupResult;
  6353. if (!instance.suspense) {
  6354. const name = (_a = Component.name) != null ? _a : "Anonymous";
  6355. warn$1(
  6356. `Component <${name}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.`
  6357. );
  6358. }
  6359. }
  6360. } else {
  6361. handleSetupResult(instance, setupResult, isSSR);
  6362. }
  6363. } else {
  6364. finishComponentSetup(instance, isSSR);
  6365. }
  6366. }
  6367. function handleSetupResult(instance, setupResult, isSSR) {
  6368. if (isFunction(setupResult)) {
  6369. if (instance.type.__ssrInlineRender) {
  6370. instance.ssrRender = setupResult;
  6371. } else {
  6372. instance.render = setupResult;
  6373. }
  6374. } else if (isObject(setupResult)) {
  6375. if (isVNode$2(setupResult)) {
  6376. warn$1(
  6377. `setup() should not return VNodes directly - return a render function instead.`
  6378. );
  6379. }
  6380. {
  6381. instance.devtoolsRawSetupState = setupResult;
  6382. }
  6383. instance.setupState = proxyRefs(setupResult);
  6384. {
  6385. exposeSetupStateOnRenderContext(instance);
  6386. }
  6387. } else if (setupResult !== void 0) {
  6388. warn$1(
  6389. `setup() should return an object. Received: ${setupResult === null ? "null" : typeof setupResult}`
  6390. );
  6391. }
  6392. finishComponentSetup(instance, isSSR);
  6393. }
  6394. let compile;
  6395. const isRuntimeOnly = () => !compile;
  6396. function finishComponentSetup(instance, isSSR, skipOptions) {
  6397. const Component = instance.type;
  6398. if (!instance.render) {
  6399. if (!isSSR && compile && !Component.render) {
  6400. const template = Component.template || resolveMergedOptions(instance).template;
  6401. if (template) {
  6402. {
  6403. startMeasure(instance, `compile`);
  6404. }
  6405. const { isCustomElement, compilerOptions } = instance.appContext.config;
  6406. const { delimiters, compilerOptions: componentCompilerOptions } = Component;
  6407. const finalCompilerOptions = extend(
  6408. extend(
  6409. {
  6410. isCustomElement,
  6411. delimiters
  6412. },
  6413. compilerOptions
  6414. ),
  6415. componentCompilerOptions
  6416. );
  6417. Component.render = compile(template, finalCompilerOptions);
  6418. {
  6419. endMeasure(instance, `compile`);
  6420. }
  6421. }
  6422. }
  6423. instance.render = Component.render || NOOP;
  6424. }
  6425. {
  6426. const reset = setCurrentInstance(instance);
  6427. pauseTracking();
  6428. try {
  6429. applyOptions(instance);
  6430. } finally {
  6431. resetTracking();
  6432. reset();
  6433. }
  6434. }
  6435. if (!Component.render && instance.render === NOOP && !isSSR) {
  6436. if (Component.template) {
  6437. warn$1(
  6438. `Component provided template option but runtime compilation is not supported in this build of Vue.` + (` Use "vue.esm-browser.js" instead.` )
  6439. );
  6440. } else {
  6441. warn$1(`Component is missing template or render function: `, Component);
  6442. }
  6443. }
  6444. }
  6445. const attrsProxyHandlers = {
  6446. get(target, key) {
  6447. markAttrsAccessed();
  6448. track(target, "get", "");
  6449. return target[key];
  6450. },
  6451. set() {
  6452. warn$1(`setupContext.attrs is readonly.`);
  6453. return false;
  6454. },
  6455. deleteProperty() {
  6456. warn$1(`setupContext.attrs is readonly.`);
  6457. return false;
  6458. }
  6459. } ;
  6460. function getSlotsProxy(instance) {
  6461. return new Proxy(instance.slots, {
  6462. get(target, key) {
  6463. track(instance, "get", "$slots");
  6464. return target[key];
  6465. }
  6466. });
  6467. }
  6468. function createSetupContext(instance) {
  6469. const expose = (exposed) => {
  6470. {
  6471. if (instance.exposed) {
  6472. warn$1(`expose() should be called only once per setup().`);
  6473. }
  6474. if (exposed != null) {
  6475. let exposedType = typeof exposed;
  6476. if (exposedType === "object") {
  6477. if (isArray(exposed)) {
  6478. exposedType = "array";
  6479. } else if (isRef(exposed)) {
  6480. exposedType = "ref";
  6481. }
  6482. }
  6483. if (exposedType !== "object") {
  6484. warn$1(
  6485. `expose() should be passed a plain object, received ${exposedType}.`
  6486. );
  6487. }
  6488. }
  6489. }
  6490. instance.exposed = exposed || {};
  6491. };
  6492. {
  6493. let attrsProxy;
  6494. let slotsProxy;
  6495. return Object.freeze({
  6496. get attrs() {
  6497. return attrsProxy || (attrsProxy = new Proxy(instance.attrs, attrsProxyHandlers));
  6498. },
  6499. get slots() {
  6500. return slotsProxy || (slotsProxy = getSlotsProxy(instance));
  6501. },
  6502. get emit() {
  6503. return (event, ...args) => instance.emit(event, ...args);
  6504. },
  6505. expose
  6506. });
  6507. }
  6508. }
  6509. function getComponentPublicInstance(instance) {
  6510. if (instance.exposed) {
  6511. return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
  6512. get(target, key) {
  6513. if (key in target) {
  6514. return target[key];
  6515. } else if (key in publicPropertiesMap) {
  6516. return publicPropertiesMap[key](instance);
  6517. }
  6518. },
  6519. has(target, key) {
  6520. return key in target || key in publicPropertiesMap;
  6521. }
  6522. }));
  6523. } else {
  6524. return instance.proxy;
  6525. }
  6526. }
  6527. const classifyRE = /(?:^|[-_])(\w)/g;
  6528. const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, "");
  6529. function getComponentName(Component, includeInferred = true) {
  6530. return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
  6531. }
  6532. function formatComponentName(instance, Component, isRoot = false) {
  6533. let name = getComponentName(Component);
  6534. if (!name && Component.__file) {
  6535. const match = Component.__file.match(/([^/\\]+)\.\w+$/);
  6536. if (match) {
  6537. name = match[1];
  6538. }
  6539. }
  6540. if (!name && instance && instance.parent) {
  6541. const inferFromRegistry = (registry) => {
  6542. for (const key in registry) {
  6543. if (registry[key] === Component) {
  6544. return key;
  6545. }
  6546. }
  6547. };
  6548. name = inferFromRegistry(
  6549. instance.components || instance.parent.type.components
  6550. ) || inferFromRegistry(instance.appContext.components);
  6551. }
  6552. return name ? classify(name) : isRoot ? `App` : `Anonymous`;
  6553. }
  6554. function isClassComponent(value) {
  6555. return isFunction(value) && "__vccOpts" in value;
  6556. }
  6557. const computed = (getterOrOptions, debugOptions) => {
  6558. const c = computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
  6559. {
  6560. const i = getCurrentInstance();
  6561. if (i && i.appContext.config.warnRecursiveComputed) {
  6562. c._warnRecursive = true;
  6563. }
  6564. }
  6565. return c;
  6566. };
  6567. const version = "3.4.38";
  6568. const warn = warn$1 ;
  6569. const _ssrUtils = {
  6570. createComponentInstance: createComponentInstance$1,
  6571. setupComponent: setupComponent$1,
  6572. renderComponentRoot: renderComponentRoot$1,
  6573. setCurrentRenderingInstance: setCurrentRenderingInstance$1,
  6574. isVNode: isVNode$2,
  6575. normalizeVNode: normalizeVNode$1,
  6576. getComponentPublicInstance,
  6577. ensureValidVNode: ensureValidVNode$1
  6578. };
  6579. const ssrUtils = _ssrUtils ;
  6580. const svgNS = "http://www.w3.org/2000/svg";
  6581. const mathmlNS = "http://www.w3.org/1998/Math/MathML";
  6582. const doc = typeof document !== "undefined" ? document : null;
  6583. const templateContainer = doc && /* @__PURE__ */ doc.createElement("template");
  6584. const nodeOps = {
  6585. insert: (child, parent, anchor) => {
  6586. parent.insertBefore(child, anchor || null);
  6587. },
  6588. remove: (child) => {
  6589. const parent = child.parentNode;
  6590. if (parent) {
  6591. parent.removeChild(child);
  6592. }
  6593. },
  6594. createElement: (tag, namespace, is, props) => {
  6595. const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : is ? doc.createElement(tag, { is }) : doc.createElement(tag);
  6596. if (tag === "select" && props && props.multiple != null) {
  6597. el.setAttribute("multiple", props.multiple);
  6598. }
  6599. return el;
  6600. },
  6601. createText: (text) => doc.createTextNode(text),
  6602. createComment: (text) => doc.createComment(text),
  6603. setText: (node, text) => {
  6604. node.nodeValue = text;
  6605. },
  6606. setElementText: (el, text) => {
  6607. el.textContent = text;
  6608. },
  6609. parentNode: (node) => node.parentNode,
  6610. nextSibling: (node) => node.nextSibling,
  6611. querySelector: (selector) => doc.querySelector(selector),
  6612. setScopeId(el, id) {
  6613. el.setAttribute(id, "");
  6614. },
  6615. // __UNSAFE__
  6616. // Reason: innerHTML.
  6617. // Static content here can only come from compiled templates.
  6618. // As long as the user only uses trusted templates, this is safe.
  6619. insertStaticContent(content, parent, anchor, namespace, start, end) {
  6620. const before = anchor ? anchor.previousSibling : parent.lastChild;
  6621. if (start && (start === end || start.nextSibling)) {
  6622. while (true) {
  6623. parent.insertBefore(start.cloneNode(true), anchor);
  6624. if (start === end || !(start = start.nextSibling)) break;
  6625. }
  6626. } else {
  6627. templateContainer.innerHTML = namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content;
  6628. const template = templateContainer.content;
  6629. if (namespace === "svg" || namespace === "mathml") {
  6630. const wrapper = template.firstChild;
  6631. while (wrapper.firstChild) {
  6632. template.appendChild(wrapper.firstChild);
  6633. }
  6634. template.removeChild(wrapper);
  6635. }
  6636. parent.insertBefore(template, anchor);
  6637. }
  6638. return [
  6639. // first
  6640. before ? before.nextSibling : parent.firstChild,
  6641. // last
  6642. anchor ? anchor.previousSibling : parent.lastChild
  6643. ];
  6644. }
  6645. };
  6646. const vtcKey = Symbol("_vtc");
  6647. function patchClass(el, value, isSVG) {
  6648. const transitionClasses = el[vtcKey];
  6649. if (transitionClasses) {
  6650. value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" ");
  6651. }
  6652. if (value == null) {
  6653. el.removeAttribute("class");
  6654. } else if (isSVG) {
  6655. el.setAttribute("class", value);
  6656. } else {
  6657. el.className = value;
  6658. }
  6659. }
  6660. const vShowOriginalDisplay = Symbol("_vod");
  6661. const vShowHidden = Symbol("_vsh");
  6662. const CSS_VAR_TEXT = Symbol("CSS_VAR_TEXT" );
  6663. const displayRE = /(^|;)\s*display\s*:/;
  6664. function patchStyle(el, prev, next) {
  6665. const style = el.style;
  6666. const isCssString = isString(next);
  6667. let hasControlledDisplay = false;
  6668. if (next && !isCssString) {
  6669. if (prev) {
  6670. if (!isString(prev)) {
  6671. for (const key in prev) {
  6672. if (next[key] == null) {
  6673. setStyle(style, key, "");
  6674. }
  6675. }
  6676. } else {
  6677. for (const prevStyle of prev.split(";")) {
  6678. const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
  6679. if (next[key] == null) {
  6680. setStyle(style, key, "");
  6681. }
  6682. }
  6683. }
  6684. }
  6685. for (const key in next) {
  6686. if (key === "display") {
  6687. hasControlledDisplay = true;
  6688. }
  6689. setStyle(style, key, next[key]);
  6690. }
  6691. } else {
  6692. if (isCssString) {
  6693. if (prev !== next) {
  6694. const cssVarText = style[CSS_VAR_TEXT];
  6695. if (cssVarText) {
  6696. next += ";" + cssVarText;
  6697. }
  6698. style.cssText = next;
  6699. hasControlledDisplay = displayRE.test(next);
  6700. }
  6701. } else if (prev) {
  6702. el.removeAttribute("style");
  6703. }
  6704. }
  6705. if (vShowOriginalDisplay in el) {
  6706. el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
  6707. if (el[vShowHidden]) {
  6708. style.display = "none";
  6709. }
  6710. }
  6711. }
  6712. const semicolonRE = /[^\\];\s*$/;
  6713. const importantRE = /\s*!important$/;
  6714. function setStyle(style, name, val) {
  6715. if (isArray(val)) {
  6716. val.forEach((v) => setStyle(style, name, v));
  6717. } else {
  6718. if (val == null) val = "";
  6719. {
  6720. if (semicolonRE.test(val)) {
  6721. warn(
  6722. `Unexpected semicolon at the end of '${name}' style value: '${val}'`
  6723. );
  6724. }
  6725. }
  6726. if (name.startsWith("--")) {
  6727. style.setProperty(name, val);
  6728. } else {
  6729. const prefixed = autoPrefix(style, name);
  6730. if (importantRE.test(val)) {
  6731. style.setProperty(
  6732. hyphenate(prefixed),
  6733. val.replace(importantRE, ""),
  6734. "important"
  6735. );
  6736. } else {
  6737. style[prefixed] = val;
  6738. }
  6739. }
  6740. }
  6741. }
  6742. const prefixes = ["Webkit", "Moz", "ms"];
  6743. const prefixCache = {};
  6744. function autoPrefix(style, rawName) {
  6745. const cached = prefixCache[rawName];
  6746. if (cached) {
  6747. return cached;
  6748. }
  6749. let name = camelize(rawName);
  6750. if (name !== "filter" && name in style) {
  6751. return prefixCache[rawName] = name;
  6752. }
  6753. name = capitalize(name);
  6754. for (let i = 0; i < prefixes.length; i++) {
  6755. const prefixed = prefixes[i] + name;
  6756. if (prefixed in style) {
  6757. return prefixCache[rawName] = prefixed;
  6758. }
  6759. }
  6760. return rawName;
  6761. }
  6762. const xlinkNS = "http://www.w3.org/1999/xlink";
  6763. function patchAttr(el, key, value, isSVG, instance, isBoolean = isSpecialBooleanAttr(key)) {
  6764. if (isSVG && key.startsWith("xlink:")) {
  6765. if (value == null) {
  6766. el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
  6767. } else {
  6768. el.setAttributeNS(xlinkNS, key, value);
  6769. }
  6770. } else {
  6771. if (value == null || isBoolean && !includeBooleanAttr(value)) {
  6772. el.removeAttribute(key);
  6773. } else {
  6774. el.setAttribute(
  6775. key,
  6776. isBoolean ? "" : isSymbol(value) ? String(value) : value
  6777. );
  6778. }
  6779. }
  6780. }
  6781. function patchDOMProp(el, key, value, parentComponent) {
  6782. if (key === "innerHTML" || key === "textContent") {
  6783. if (value == null) return;
  6784. el[key] = value;
  6785. return;
  6786. }
  6787. const tag = el.tagName;
  6788. if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
  6789. !tag.includes("-")) {
  6790. const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
  6791. const newValue = value == null ? "" : String(value);
  6792. if (oldValue !== newValue || !("_value" in el)) {
  6793. el.value = newValue;
  6794. }
  6795. if (value == null) {
  6796. el.removeAttribute(key);
  6797. }
  6798. el._value = value;
  6799. return;
  6800. }
  6801. let needRemove = false;
  6802. if (value === "" || value == null) {
  6803. const type = typeof el[key];
  6804. if (type === "boolean") {
  6805. value = includeBooleanAttr(value);
  6806. } else if (value == null && type === "string") {
  6807. value = "";
  6808. needRemove = true;
  6809. } else if (type === "number") {
  6810. value = 0;
  6811. needRemove = true;
  6812. }
  6813. }
  6814. try {
  6815. el[key] = value;
  6816. } catch (e) {
  6817. if (!needRemove) {
  6818. warn(
  6819. `Failed setting prop "${key}" on <${tag.toLowerCase()}>: value ${value} is invalid.`,
  6820. e
  6821. );
  6822. }
  6823. }
  6824. needRemove && el.removeAttribute(key);
  6825. }
  6826. function addEventListener(el, event, handler, options) {
  6827. el.addEventListener(event, handler, options);
  6828. }
  6829. function removeEventListener(el, event, handler, options) {
  6830. el.removeEventListener(event, handler, options);
  6831. }
  6832. const veiKey = Symbol("_vei");
  6833. function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
  6834. const invokers = el[veiKey] || (el[veiKey] = {});
  6835. const existingInvoker = invokers[rawName];
  6836. if (nextValue && existingInvoker) {
  6837. existingInvoker.value = sanitizeEventValue(nextValue, rawName) ;
  6838. } else {
  6839. const [name, options] = parseName(rawName);
  6840. if (nextValue) {
  6841. const invoker = invokers[rawName] = createInvoker(
  6842. sanitizeEventValue(nextValue, rawName) ,
  6843. instance
  6844. );
  6845. addEventListener(el, name, invoker, options);
  6846. } else if (existingInvoker) {
  6847. removeEventListener(el, name, existingInvoker, options);
  6848. invokers[rawName] = void 0;
  6849. }
  6850. }
  6851. }
  6852. const optionsModifierRE = /(?:Once|Passive|Capture)$/;
  6853. function parseName(name) {
  6854. let options;
  6855. if (optionsModifierRE.test(name)) {
  6856. options = {};
  6857. let m;
  6858. while (m = name.match(optionsModifierRE)) {
  6859. name = name.slice(0, name.length - m[0].length);
  6860. options[m[0].toLowerCase()] = true;
  6861. }
  6862. }
  6863. const event = name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2));
  6864. return [event, options];
  6865. }
  6866. let cachedNow = 0;
  6867. const p = /* @__PURE__ */ Promise.resolve();
  6868. const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now());
  6869. function createInvoker(initialValue, instance) {
  6870. const invoker = (e) => {
  6871. if (!e._vts) {
  6872. e._vts = Date.now();
  6873. } else if (e._vts <= invoker.attached) {
  6874. return;
  6875. }
  6876. callWithAsyncErrorHandling(
  6877. patchStopImmediatePropagation(e, invoker.value),
  6878. instance,
  6879. 5,
  6880. [e]
  6881. );
  6882. };
  6883. invoker.value = initialValue;
  6884. invoker.attached = getNow();
  6885. return invoker;
  6886. }
  6887. function sanitizeEventValue(value, propName) {
  6888. if (isFunction(value) || isArray(value)) {
  6889. return value;
  6890. }
  6891. warn(
  6892. `Wrong type passed as event handler to ${propName} - did you forget @ or : in front of your prop?
  6893. Expected function or array of functions, received type ${typeof value}.`
  6894. );
  6895. return NOOP;
  6896. }
  6897. function patchStopImmediatePropagation(e, value) {
  6898. if (isArray(value)) {
  6899. const originalStop = e.stopImmediatePropagation;
  6900. e.stopImmediatePropagation = () => {
  6901. originalStop.call(e);
  6902. e._stopped = true;
  6903. };
  6904. return value.map(
  6905. (fn) => (e2) => !e2._stopped && fn && fn(e2)
  6906. );
  6907. } else {
  6908. return value;
  6909. }
  6910. }
  6911. const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
  6912. key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
  6913. const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => {
  6914. const isSVG = namespace === "svg";
  6915. if (key === "class") {
  6916. patchClass(el, nextValue, isSVG);
  6917. } else if (key === "style") {
  6918. patchStyle(el, prevValue, nextValue);
  6919. } else if (isOn(key)) {
  6920. if (!isModelListener(key)) {
  6921. patchEvent(el, key, prevValue, nextValue, parentComponent);
  6922. }
  6923. } else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) {
  6924. patchDOMProp(el, key, nextValue);
  6925. if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) {
  6926. patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value");
  6927. }
  6928. } else {
  6929. if (key === "true-value") {
  6930. el._trueValue = nextValue;
  6931. } else if (key === "false-value") {
  6932. el._falseValue = nextValue;
  6933. }
  6934. patchAttr(el, key, nextValue, isSVG);
  6935. }
  6936. };
  6937. function shouldSetAsProp(el, key, value, isSVG) {
  6938. if (isSVG) {
  6939. if (key === "innerHTML" || key === "textContent") {
  6940. return true;
  6941. }
  6942. if (key in el && isNativeOn(key) && isFunction(value)) {
  6943. return true;
  6944. }
  6945. return false;
  6946. }
  6947. if (key === "spellcheck" || key === "draggable" || key === "translate") {
  6948. return false;
  6949. }
  6950. if (key === "form") {
  6951. return false;
  6952. }
  6953. if (key === "list" && el.tagName === "INPUT") {
  6954. return false;
  6955. }
  6956. if (key === "type" && el.tagName === "TEXTAREA") {
  6957. return false;
  6958. }
  6959. if (key === "width" || key === "height") {
  6960. const tag = el.tagName;
  6961. if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") {
  6962. return false;
  6963. }
  6964. }
  6965. if (isNativeOn(key) && isString(value)) {
  6966. return false;
  6967. }
  6968. return key in el;
  6969. }
  6970. const getModelAssigner = (vnode) => {
  6971. const fn = vnode.props["onUpdate:modelValue"] || false;
  6972. return isArray(fn) ? (value) => invokeArrayFns(fn, value) : fn;
  6973. };
  6974. function onCompositionStart(e) {
  6975. e.target.composing = true;
  6976. }
  6977. function onCompositionEnd(e) {
  6978. const target = e.target;
  6979. if (target.composing) {
  6980. target.composing = false;
  6981. target.dispatchEvent(new Event("input"));
  6982. }
  6983. }
  6984. const assignKey = Symbol("_assign");
  6985. const vModelText = {
  6986. created(el, { modifiers: { lazy, trim, number } }, vnode) {
  6987. el[assignKey] = getModelAssigner(vnode);
  6988. const castToNumber = number || vnode.props && vnode.props.type === "number";
  6989. addEventListener(el, lazy ? "change" : "input", (e) => {
  6990. if (e.target.composing) return;
  6991. let domValue = el.value;
  6992. if (trim) {
  6993. domValue = domValue.trim();
  6994. }
  6995. if (castToNumber) {
  6996. domValue = looseToNumber(domValue);
  6997. }
  6998. el[assignKey](domValue);
  6999. });
  7000. if (trim) {
  7001. addEventListener(el, "change", () => {
  7002. el.value = el.value.trim();
  7003. });
  7004. }
  7005. if (!lazy) {
  7006. addEventListener(el, "compositionstart", onCompositionStart);
  7007. addEventListener(el, "compositionend", onCompositionEnd);
  7008. addEventListener(el, "change", onCompositionEnd);
  7009. }
  7010. },
  7011. // set value on mounted so it's after min/max for type="range"
  7012. mounted(el, { value }) {
  7013. el.value = value == null ? "" : value;
  7014. },
  7015. beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
  7016. el[assignKey] = getModelAssigner(vnode);
  7017. if (el.composing) return;
  7018. const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? looseToNumber(el.value) : el.value;
  7019. const newValue = value == null ? "" : value;
  7020. if (elValue === newValue) {
  7021. return;
  7022. }
  7023. if (document.activeElement === el && el.type !== "range") {
  7024. if (lazy && value === oldValue) {
  7025. return;
  7026. }
  7027. if (trim && el.value.trim() === newValue) {
  7028. return;
  7029. }
  7030. }
  7031. el.value = newValue;
  7032. }
  7033. };
  7034. const vModelCheckbox = {
  7035. // #4096 array checkboxes need to be deep traversed
  7036. deep: true,
  7037. created(el, _, vnode) {
  7038. el[assignKey] = getModelAssigner(vnode);
  7039. addEventListener(el, "change", () => {
  7040. const modelValue = el._modelValue;
  7041. const elementValue = getValue(el);
  7042. const checked = el.checked;
  7043. const assign = el[assignKey];
  7044. if (isArray(modelValue)) {
  7045. const index = looseIndexOf(modelValue, elementValue);
  7046. const found = index !== -1;
  7047. if (checked && !found) {
  7048. assign(modelValue.concat(elementValue));
  7049. } else if (!checked && found) {
  7050. const filtered = [...modelValue];
  7051. filtered.splice(index, 1);
  7052. assign(filtered);
  7053. }
  7054. } else if (isSet(modelValue)) {
  7055. const cloned = new Set(modelValue);
  7056. if (checked) {
  7057. cloned.add(elementValue);
  7058. } else {
  7059. cloned.delete(elementValue);
  7060. }
  7061. assign(cloned);
  7062. } else {
  7063. assign(getCheckboxValue(el, checked));
  7064. }
  7065. });
  7066. },
  7067. // set initial checked on mount to wait for true-value/false-value
  7068. mounted: setChecked,
  7069. beforeUpdate(el, binding, vnode) {
  7070. el[assignKey] = getModelAssigner(vnode);
  7071. setChecked(el, binding, vnode);
  7072. }
  7073. };
  7074. function setChecked(el, { value, oldValue }, vnode) {
  7075. el._modelValue = value;
  7076. if (isArray(value)) {
  7077. el.checked = looseIndexOf(value, vnode.props.value) > -1;
  7078. } else if (isSet(value)) {
  7079. el.checked = value.has(vnode.props.value);
  7080. } else if (value !== oldValue) {
  7081. el.checked = looseEqual(value, getCheckboxValue(el, true));
  7082. }
  7083. }
  7084. const vModelRadio = {
  7085. created(el, { value }, vnode) {
  7086. el.checked = looseEqual(value, vnode.props.value);
  7087. el[assignKey] = getModelAssigner(vnode);
  7088. addEventListener(el, "change", () => {
  7089. el[assignKey](getValue(el));
  7090. });
  7091. },
  7092. beforeUpdate(el, { value, oldValue }, vnode) {
  7093. el[assignKey] = getModelAssigner(vnode);
  7094. if (value !== oldValue) {
  7095. el.checked = looseEqual(value, vnode.props.value);
  7096. }
  7097. }
  7098. };
  7099. function getValue(el) {
  7100. return "_value" in el ? el._value : el.value;
  7101. }
  7102. function getCheckboxValue(el, checked) {
  7103. const key = checked ? "_trueValue" : "_falseValue";
  7104. return key in el ? el[key] : checked;
  7105. }
  7106. function initVModelForSSR() {
  7107. vModelText.getSSRProps = ({ value }) => ({ value });
  7108. vModelRadio.getSSRProps = ({ value }, vnode) => {
  7109. if (vnode.props && looseEqual(vnode.props.value, value)) {
  7110. return { checked: true };
  7111. }
  7112. };
  7113. vModelCheckbox.getSSRProps = ({ value }, vnode) => {
  7114. if (isArray(value)) {
  7115. if (vnode.props && looseIndexOf(value, vnode.props.value) > -1) {
  7116. return { checked: true };
  7117. }
  7118. } else if (isSet(value)) {
  7119. if (vnode.props && value.has(vnode.props.value)) {
  7120. return { checked: true };
  7121. }
  7122. } else if (value) {
  7123. return { checked: true };
  7124. }
  7125. };
  7126. }
  7127. const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
  7128. let renderer;
  7129. function ensureRenderer() {
  7130. return renderer || (renderer = createRenderer(rendererOptions));
  7131. }
  7132. const createApp = (...args) => {
  7133. const app = ensureRenderer().createApp(...args);
  7134. {
  7135. injectNativeTagCheck(app);
  7136. injectCompilerOptionsCheck(app);
  7137. }
  7138. const { mount } = app;
  7139. app.mount = (containerOrSelector) => {
  7140. const container = normalizeContainer(containerOrSelector);
  7141. if (!container) return;
  7142. const component = app._component;
  7143. if (!isFunction(component) && !component.render && !component.template) {
  7144. component.template = container.innerHTML;
  7145. }
  7146. container.innerHTML = "";
  7147. const proxy = mount(container, false, resolveRootNamespace(container));
  7148. if (container instanceof Element) {
  7149. container.removeAttribute("v-cloak");
  7150. container.setAttribute("data-v-app", "");
  7151. }
  7152. return proxy;
  7153. };
  7154. return app;
  7155. };
  7156. function resolveRootNamespace(container) {
  7157. if (container instanceof SVGElement) {
  7158. return "svg";
  7159. }
  7160. if (typeof MathMLElement === "function" && container instanceof MathMLElement) {
  7161. return "mathml";
  7162. }
  7163. }
  7164. function injectNativeTagCheck(app) {
  7165. Object.defineProperty(app.config, "isNativeTag", {
  7166. value: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag),
  7167. writable: false
  7168. });
  7169. }
  7170. function injectCompilerOptionsCheck(app) {
  7171. {
  7172. const isCustomElement = app.config.isCustomElement;
  7173. Object.defineProperty(app.config, "isCustomElement", {
  7174. get() {
  7175. return isCustomElement;
  7176. },
  7177. set() {
  7178. warn(
  7179. `The \`isCustomElement\` config option is deprecated. Use \`compilerOptions.isCustomElement\` instead.`
  7180. );
  7181. }
  7182. });
  7183. const compilerOptions = app.config.compilerOptions;
  7184. const msg = `The \`compilerOptions\` config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, \`compilerOptions\` must be passed to \`@vue/compiler-dom\` in the build setup instead.
  7185. - For vue-loader: pass it via vue-loader's \`compilerOptions\` loader option.
  7186. - For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader
  7187. - For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-sfc`;
  7188. Object.defineProperty(app.config, "compilerOptions", {
  7189. get() {
  7190. warn(msg);
  7191. return compilerOptions;
  7192. },
  7193. set() {
  7194. warn(msg);
  7195. }
  7196. });
  7197. }
  7198. }
  7199. function normalizeContainer(container) {
  7200. if (isString(container)) {
  7201. const res = document.querySelector(container);
  7202. if (!res) {
  7203. warn(
  7204. `Failed to mount app: mount target selector "${container}" returned null.`
  7205. );
  7206. }
  7207. return res;
  7208. }
  7209. if (window.ShadowRoot && container instanceof window.ShadowRoot && container.mode === "closed") {
  7210. warn(
  7211. `mounting on a ShadowRoot with \`{mode: "closed"}\` may lead to unpredictable bugs`
  7212. );
  7213. }
  7214. return container;
  7215. }
  7216. let ssrDirectiveInitialized = false;
  7217. const initDirectivesForSSR = () => {
  7218. if (!ssrDirectiveInitialized) {
  7219. ssrDirectiveInitialized = true;
  7220. initVModelForSSR();
  7221. }
  7222. } ;
  7223. const shouldIgnoreProp = /* @__PURE__ */ makeMap(
  7224. `,key,ref,innerHTML,textContent,ref_key,ref_for`
  7225. );
  7226. function ssrRenderAttrs(props, tag) {
  7227. let ret = "";
  7228. for (const key in props) {
  7229. if (shouldIgnoreProp(key) || isOn(key) || tag === "textarea" && key === "value") {
  7230. continue;
  7231. }
  7232. const value = props[key];
  7233. if (key === "class") {
  7234. ret += ` class="${ssrRenderClass(value)}"`;
  7235. } else if (key === "style") {
  7236. ret += ` style="${ssrRenderStyle(value)}"`;
  7237. } else {
  7238. ret += ssrRenderDynamicAttr(key, value, tag);
  7239. }
  7240. }
  7241. return ret;
  7242. }
  7243. function ssrRenderDynamicAttr(key, value, tag) {
  7244. if (!isRenderableAttrValue(value)) {
  7245. return ``;
  7246. }
  7247. const attrKey = tag && (tag.indexOf("-") > 0 || isSVGTag(tag)) ? key : propsToAttrMap[key] || key.toLowerCase();
  7248. if (isBooleanAttr(attrKey)) {
  7249. return includeBooleanAttr(value) ? ` ${attrKey}` : ``;
  7250. } else if (isSSRSafeAttrName(attrKey)) {
  7251. return value === "" ? ` ${attrKey}` : ` ${attrKey}="${escapeHtml(value)}"`;
  7252. } else {
  7253. console.warn(
  7254. `[@vue/server-renderer] Skipped rendering unsafe attribute name: ${attrKey}`
  7255. );
  7256. return ``;
  7257. }
  7258. }
  7259. function ssrRenderAttr(key, value) {
  7260. if (!isRenderableAttrValue(value)) {
  7261. return ``;
  7262. }
  7263. return ` ${key}="${escapeHtml(value)}"`;
  7264. }
  7265. function ssrRenderClass(raw) {
  7266. return escapeHtml(normalizeClass(raw));
  7267. }
  7268. function ssrRenderStyle(raw) {
  7269. if (!raw) {
  7270. return "";
  7271. }
  7272. if (isString(raw)) {
  7273. return escapeHtml(raw);
  7274. }
  7275. const styles = normalizeStyle(raw);
  7276. return escapeHtml(stringifyStyle(styles));
  7277. }
  7278. function ssrRenderComponent(comp, props = null, children = null, parentComponent = null, slotScopeId) {
  7279. return renderComponentVNode(
  7280. createVNode(comp, props, children),
  7281. parentComponent,
  7282. slotScopeId
  7283. );
  7284. }
  7285. const { ensureValidVNode } = ssrUtils;
  7286. function ssrRenderSlot(slots, slotName, slotProps, fallbackRenderFn, push, parentComponent, slotScopeId) {
  7287. push(`<!--[-->`);
  7288. ssrRenderSlotInner(
  7289. slots,
  7290. slotName,
  7291. slotProps,
  7292. fallbackRenderFn,
  7293. push,
  7294. parentComponent,
  7295. slotScopeId
  7296. );
  7297. push(`<!--]-->`);
  7298. }
  7299. function ssrRenderSlotInner(slots, slotName, slotProps, fallbackRenderFn, push, parentComponent, slotScopeId, transition) {
  7300. const slotFn = slots[slotName];
  7301. if (slotFn) {
  7302. const slotBuffer = [];
  7303. const bufferedPush = (item) => {
  7304. slotBuffer.push(item);
  7305. };
  7306. const ret = slotFn(
  7307. slotProps,
  7308. bufferedPush,
  7309. parentComponent,
  7310. slotScopeId ? " " + slotScopeId : ""
  7311. );
  7312. if (isArray(ret)) {
  7313. const validSlotContent = ensureValidVNode(ret);
  7314. if (validSlotContent) {
  7315. renderVNodeChildren(
  7316. push,
  7317. validSlotContent,
  7318. parentComponent,
  7319. slotScopeId
  7320. );
  7321. } else if (fallbackRenderFn) {
  7322. fallbackRenderFn();
  7323. }
  7324. } else {
  7325. let isEmptySlot = true;
  7326. if (transition) {
  7327. isEmptySlot = false;
  7328. } else {
  7329. for (let i = 0; i < slotBuffer.length; i++) {
  7330. if (!isComment(slotBuffer[i])) {
  7331. isEmptySlot = false;
  7332. break;
  7333. }
  7334. }
  7335. }
  7336. if (isEmptySlot) {
  7337. if (fallbackRenderFn) {
  7338. fallbackRenderFn();
  7339. }
  7340. } else {
  7341. let start = 0;
  7342. let end = slotBuffer.length;
  7343. if (transition && slotBuffer[0] === "<!--[-->" && slotBuffer[end - 1] === "<!--]-->") {
  7344. start++;
  7345. end--;
  7346. }
  7347. for (let i = start; i < end; i++) {
  7348. push(slotBuffer[i]);
  7349. }
  7350. }
  7351. }
  7352. } else if (fallbackRenderFn) {
  7353. fallbackRenderFn();
  7354. }
  7355. }
  7356. const commentTestRE = /^<!--[\s\S]*-->$/;
  7357. const commentRE = /<!--[^]*?-->/gm;
  7358. function isComment(item) {
  7359. if (typeof item !== "string" || !commentTestRE.test(item)) return false;
  7360. if (item.length <= 8) return true;
  7361. return !item.replace(commentRE, "").trim();
  7362. }
  7363. function ssrRenderTeleport(parentPush, contentRenderFn, target, disabled, parentComponent) {
  7364. parentPush("<!--teleport start-->");
  7365. const context = parentComponent.appContext.provides[ssrContextKey];
  7366. const teleportBuffers = context.__teleportBuffers || (context.__teleportBuffers = {});
  7367. const targetBuffer = teleportBuffers[target] || (teleportBuffers[target] = []);
  7368. const bufferIndex = targetBuffer.length;
  7369. let teleportContent;
  7370. if (disabled) {
  7371. contentRenderFn(parentPush);
  7372. teleportContent = `<!--teleport start anchor--><!--teleport anchor-->`;
  7373. } else {
  7374. const { getBuffer, push } = createBuffer();
  7375. push(`<!--teleport start anchor-->`);
  7376. contentRenderFn(push);
  7377. push(`<!--teleport anchor-->`);
  7378. teleportContent = getBuffer();
  7379. }
  7380. targetBuffer.splice(bufferIndex, 0, teleportContent);
  7381. parentPush("<!--teleport end-->");
  7382. }
  7383. function ssrInterpolate(value) {
  7384. return escapeHtml(toDisplayString(value));
  7385. }
  7386. function ssrRenderList(source, renderItem) {
  7387. if (isArray(source) || isString(source)) {
  7388. for (let i = 0, l = source.length; i < l; i++) {
  7389. renderItem(source[i], i);
  7390. }
  7391. } else if (typeof source === "number") {
  7392. if (!Number.isInteger(source)) {
  7393. warn(`The v-for range expect an integer value but got ${source}.`);
  7394. return;
  7395. }
  7396. for (let i = 0; i < source; i++) {
  7397. renderItem(i + 1, i);
  7398. }
  7399. } else if (isObject(source)) {
  7400. if (source[Symbol.iterator]) {
  7401. const arr = Array.from(source);
  7402. for (let i = 0, l = arr.length; i < l; i++) {
  7403. renderItem(arr[i], i);
  7404. }
  7405. } else {
  7406. const keys = Object.keys(source);
  7407. for (let i = 0, l = keys.length; i < l; i++) {
  7408. const key = keys[i];
  7409. renderItem(source[key], key, i);
  7410. }
  7411. }
  7412. }
  7413. }
  7414. async function ssrRenderSuspense(push, { default: renderContent }) {
  7415. if (renderContent) {
  7416. renderContent();
  7417. } else {
  7418. push(`<!---->`);
  7419. }
  7420. }
  7421. function ssrGetDirectiveProps(instance, dir, value, arg, modifiers = {}) {
  7422. if (typeof dir !== "function" && dir.getSSRProps) {
  7423. return dir.getSSRProps(
  7424. {
  7425. dir,
  7426. instance: ssrUtils.getComponentPublicInstance(instance.$),
  7427. value,
  7428. oldValue: void 0,
  7429. arg,
  7430. modifiers
  7431. },
  7432. null
  7433. ) || {};
  7434. }
  7435. return {};
  7436. }
  7437. const ssrLooseEqual = looseEqual;
  7438. function ssrLooseContain(arr, value) {
  7439. return looseIndexOf(arr, value) > -1;
  7440. }
  7441. function ssrRenderDynamicModel(type, model, value) {
  7442. switch (type) {
  7443. case "radio":
  7444. return looseEqual(model, value) ? " checked" : "";
  7445. case "checkbox":
  7446. return (isArray(model) ? ssrLooseContain(model, value) : model) ? " checked" : "";
  7447. default:
  7448. return ssrRenderAttr("value", model);
  7449. }
  7450. }
  7451. function ssrGetDynamicModelProps(existingProps = {}, model) {
  7452. const { type, value } = existingProps;
  7453. switch (type) {
  7454. case "radio":
  7455. return looseEqual(model, value) ? { checked: true } : null;
  7456. case "checkbox":
  7457. return (isArray(model) ? ssrLooseContain(model, value) : model) ? { checked: true } : null;
  7458. default:
  7459. return { value: model };
  7460. }
  7461. }
  7462. function ssrCompile(template, instance) {
  7463. {
  7464. throw new Error(
  7465. `On-the-fly template compilation is not supported in the ESM build of @vue/server-renderer. All templates must be pre-compiled into render functions.`
  7466. );
  7467. }
  7468. }
  7469. const {
  7470. createComponentInstance,
  7471. setCurrentRenderingInstance,
  7472. setupComponent,
  7473. renderComponentRoot,
  7474. normalizeVNode
  7475. } = ssrUtils;
  7476. function createBuffer() {
  7477. let appendable = false;
  7478. const buffer = [];
  7479. return {
  7480. getBuffer() {
  7481. return buffer;
  7482. },
  7483. push(item) {
  7484. const isStringItem = isString(item);
  7485. if (appendable && isStringItem) {
  7486. buffer[buffer.length - 1] += item;
  7487. return;
  7488. }
  7489. buffer.push(item);
  7490. appendable = isStringItem;
  7491. if (isPromise(item) || isArray(item) && item.hasAsync) {
  7492. buffer.hasAsync = true;
  7493. }
  7494. }
  7495. };
  7496. }
  7497. function renderComponentVNode(vnode, parentComponent = null, slotScopeId) {
  7498. const instance = createComponentInstance(vnode, parentComponent, null);
  7499. const res = setupComponent(
  7500. instance,
  7501. true
  7502. /* isSSR */
  7503. );
  7504. const hasAsyncSetup = isPromise(res);
  7505. const prefetches = instance.sp;
  7506. if (hasAsyncSetup || prefetches) {
  7507. let p = hasAsyncSetup ? res : Promise.resolve();
  7508. if (prefetches) {
  7509. p = p.then(
  7510. () => Promise.all(
  7511. prefetches.map((prefetch) => prefetch.call(instance.proxy))
  7512. )
  7513. ).catch(NOOP);
  7514. }
  7515. return p.then(() => renderComponentSubTree(instance, slotScopeId));
  7516. } else {
  7517. return renderComponentSubTree(instance, slotScopeId);
  7518. }
  7519. }
  7520. function renderComponentSubTree(instance, slotScopeId) {
  7521. const comp = instance.type;
  7522. const { getBuffer, push } = createBuffer();
  7523. if (isFunction(comp)) {
  7524. let root = renderComponentRoot(instance);
  7525. if (!comp.props) {
  7526. for (const key in instance.attrs) {
  7527. if (key.startsWith(`data-v-`)) {
  7528. (root.props || (root.props = {}))[key] = ``;
  7529. }
  7530. }
  7531. }
  7532. renderVNode(push, instance.subTree = root, instance, slotScopeId);
  7533. } else {
  7534. if ((!instance.render || instance.render === NOOP) && !instance.ssrRender && !comp.ssrRender && isString(comp.template)) {
  7535. comp.ssrRender = ssrCompile(comp.template);
  7536. }
  7537. for (const e of instance.scope.effects) {
  7538. if (e.computed) {
  7539. e.computed._dirty = true;
  7540. e.computed._cacheable = true;
  7541. }
  7542. }
  7543. const ssrRender = instance.ssrRender || comp.ssrRender;
  7544. if (ssrRender) {
  7545. let attrs = instance.inheritAttrs !== false ? instance.attrs : void 0;
  7546. let hasCloned = false;
  7547. let cur = instance;
  7548. while (true) {
  7549. const scopeId = cur.vnode.scopeId;
  7550. if (scopeId) {
  7551. if (!hasCloned) {
  7552. attrs = { ...attrs };
  7553. hasCloned = true;
  7554. }
  7555. attrs[scopeId] = "";
  7556. }
  7557. const parent = cur.parent;
  7558. if (parent && parent.subTree && parent.subTree === cur.vnode) {
  7559. cur = parent;
  7560. } else {
  7561. break;
  7562. }
  7563. }
  7564. if (slotScopeId) {
  7565. if (!hasCloned) attrs = { ...attrs };
  7566. const slotScopeIdList = slotScopeId.trim().split(" ");
  7567. for (let i = 0; i < slotScopeIdList.length; i++) {
  7568. attrs[slotScopeIdList[i]] = "";
  7569. }
  7570. }
  7571. const prev = setCurrentRenderingInstance(instance);
  7572. try {
  7573. ssrRender(
  7574. instance.proxy,
  7575. push,
  7576. instance,
  7577. attrs,
  7578. // compiler-optimized bindings
  7579. instance.props,
  7580. instance.setupState,
  7581. instance.data,
  7582. instance.ctx
  7583. );
  7584. } finally {
  7585. setCurrentRenderingInstance(prev);
  7586. }
  7587. } else if (instance.render && instance.render !== NOOP) {
  7588. renderVNode(
  7589. push,
  7590. instance.subTree = renderComponentRoot(instance),
  7591. instance,
  7592. slotScopeId
  7593. );
  7594. } else {
  7595. const componentName = comp.name || comp.__file || `<Anonymous>`;
  7596. warn(`Component ${componentName} is missing template or render function.`);
  7597. push(`<!---->`);
  7598. }
  7599. }
  7600. return getBuffer();
  7601. }
  7602. function renderVNode(push, vnode, parentComponent, slotScopeId) {
  7603. const { type, shapeFlag, children } = vnode;
  7604. switch (type) {
  7605. case Text:
  7606. push(escapeHtml(children));
  7607. break;
  7608. case Comment:
  7609. push(
  7610. children ? `<!--${escapeHtmlComment(children)}-->` : `<!---->`
  7611. );
  7612. break;
  7613. case Static:
  7614. push(children);
  7615. break;
  7616. case Fragment:
  7617. if (vnode.slotScopeIds) {
  7618. slotScopeId = (slotScopeId ? slotScopeId + " " : "") + vnode.slotScopeIds.join(" ");
  7619. }
  7620. push(`<!--[-->`);
  7621. renderVNodeChildren(
  7622. push,
  7623. children,
  7624. parentComponent,
  7625. slotScopeId
  7626. );
  7627. push(`<!--]-->`);
  7628. break;
  7629. default:
  7630. if (shapeFlag & 1) {
  7631. renderElementVNode(push, vnode, parentComponent, slotScopeId);
  7632. } else if (shapeFlag & 6) {
  7633. push(renderComponentVNode(vnode, parentComponent, slotScopeId));
  7634. } else if (shapeFlag & 64) {
  7635. renderTeleportVNode(push, vnode, parentComponent, slotScopeId);
  7636. } else if (shapeFlag & 128) {
  7637. renderVNode(push, vnode.ssContent, parentComponent, slotScopeId);
  7638. } else {
  7639. warn(
  7640. "[@vue/server-renderer] Invalid VNode type:",
  7641. type,
  7642. `(${typeof type})`
  7643. );
  7644. }
  7645. }
  7646. }
  7647. function renderVNodeChildren(push, children, parentComponent, slotScopeId) {
  7648. for (let i = 0; i < children.length; i++) {
  7649. renderVNode(push, normalizeVNode(children[i]), parentComponent, slotScopeId);
  7650. }
  7651. }
  7652. function renderElementVNode(push, vnode, parentComponent, slotScopeId) {
  7653. const tag = vnode.type;
  7654. let { props, children, shapeFlag, scopeId, dirs } = vnode;
  7655. let openTag = `<${tag}`;
  7656. if (dirs) {
  7657. props = applySSRDirectives(vnode, props, dirs);
  7658. }
  7659. if (props) {
  7660. openTag += ssrRenderAttrs(props, tag);
  7661. }
  7662. if (scopeId) {
  7663. openTag += ` ${scopeId}`;
  7664. }
  7665. let curParent = parentComponent;
  7666. let curVnode = vnode;
  7667. while (curParent && curVnode === curParent.subTree) {
  7668. curVnode = curParent.vnode;
  7669. if (curVnode.scopeId) {
  7670. openTag += ` ${curVnode.scopeId}`;
  7671. }
  7672. curParent = curParent.parent;
  7673. }
  7674. if (slotScopeId) {
  7675. openTag += ` ${slotScopeId}`;
  7676. }
  7677. push(openTag + `>`);
  7678. if (!isVoidTag(tag)) {
  7679. let hasChildrenOverride = false;
  7680. if (props) {
  7681. if (props.innerHTML) {
  7682. hasChildrenOverride = true;
  7683. push(props.innerHTML);
  7684. } else if (props.textContent) {
  7685. hasChildrenOverride = true;
  7686. push(escapeHtml(props.textContent));
  7687. } else if (tag === "textarea" && props.value) {
  7688. hasChildrenOverride = true;
  7689. push(escapeHtml(props.value));
  7690. }
  7691. }
  7692. if (!hasChildrenOverride) {
  7693. if (shapeFlag & 8) {
  7694. push(escapeHtml(children));
  7695. } else if (shapeFlag & 16) {
  7696. renderVNodeChildren(
  7697. push,
  7698. children,
  7699. parentComponent,
  7700. slotScopeId
  7701. );
  7702. }
  7703. }
  7704. push(`</${tag}>`);
  7705. }
  7706. }
  7707. function applySSRDirectives(vnode, rawProps, dirs) {
  7708. const toMerge = [];
  7709. for (let i = 0; i < dirs.length; i++) {
  7710. const binding = dirs[i];
  7711. const {
  7712. dir: { getSSRProps }
  7713. } = binding;
  7714. if (getSSRProps) {
  7715. const props = getSSRProps(binding, vnode);
  7716. if (props) toMerge.push(props);
  7717. }
  7718. }
  7719. return mergeProps(rawProps || {}, ...toMerge);
  7720. }
  7721. function renderTeleportVNode(push, vnode, parentComponent, slotScopeId) {
  7722. const target = vnode.props && vnode.props.to;
  7723. const disabled = vnode.props && vnode.props.disabled;
  7724. if (!target) {
  7725. if (!disabled) {
  7726. warn(`[@vue/server-renderer] Teleport is missing target prop.`);
  7727. }
  7728. return [];
  7729. }
  7730. if (!isString(target)) {
  7731. warn(
  7732. `[@vue/server-renderer] Teleport target must be a query selector string.`
  7733. );
  7734. return [];
  7735. }
  7736. ssrRenderTeleport(
  7737. push,
  7738. (push2) => {
  7739. renderVNodeChildren(
  7740. push2,
  7741. vnode.children,
  7742. parentComponent,
  7743. slotScopeId
  7744. );
  7745. },
  7746. target,
  7747. disabled || disabled === "",
  7748. parentComponent
  7749. );
  7750. }
  7751. const { isVNode: isVNode$1 } = ssrUtils;
  7752. function nestedUnrollBuffer(buffer, parentRet, startIndex) {
  7753. if (!buffer.hasAsync) {
  7754. return parentRet + unrollBufferSync$1(buffer);
  7755. }
  7756. let ret = parentRet;
  7757. for (let i = startIndex; i < buffer.length; i += 1) {
  7758. const item = buffer[i];
  7759. if (isString(item)) {
  7760. ret += item;
  7761. continue;
  7762. }
  7763. if (isPromise(item)) {
  7764. return item.then((nestedItem) => {
  7765. buffer[i] = nestedItem;
  7766. return nestedUnrollBuffer(buffer, ret, i);
  7767. });
  7768. }
  7769. const result = nestedUnrollBuffer(item, ret, 0);
  7770. if (isPromise(result)) {
  7771. return result.then((nestedItem) => {
  7772. buffer[i] = nestedItem;
  7773. return nestedUnrollBuffer(buffer, "", i);
  7774. });
  7775. }
  7776. ret = result;
  7777. }
  7778. return ret;
  7779. }
  7780. function unrollBuffer$1(buffer) {
  7781. return nestedUnrollBuffer(buffer, "", 0);
  7782. }
  7783. function unrollBufferSync$1(buffer) {
  7784. let ret = "";
  7785. for (let i = 0; i < buffer.length; i++) {
  7786. let item = buffer[i];
  7787. if (isString(item)) {
  7788. ret += item;
  7789. } else {
  7790. ret += unrollBufferSync$1(item);
  7791. }
  7792. }
  7793. return ret;
  7794. }
  7795. async function renderToString(input, context = {}) {
  7796. if (isVNode$1(input)) {
  7797. return renderToString(createApp({ render: () => input }), context);
  7798. }
  7799. const vnode = createVNode(input._component, input._props);
  7800. vnode.appContext = input._context;
  7801. input.provide(ssrContextKey, context);
  7802. const buffer = await renderComponentVNode(vnode);
  7803. const result = await unrollBuffer$1(buffer);
  7804. await resolveTeleports(context);
  7805. if (context.__watcherHandles) {
  7806. for (const unwatch of context.__watcherHandles) {
  7807. unwatch();
  7808. }
  7809. }
  7810. return result;
  7811. }
  7812. async function resolveTeleports(context) {
  7813. if (context.__teleportBuffers) {
  7814. context.teleports = context.teleports || {};
  7815. for (const key in context.__teleportBuffers) {
  7816. context.teleports[key] = await unrollBuffer$1(
  7817. await Promise.all([context.__teleportBuffers[key]])
  7818. );
  7819. }
  7820. }
  7821. }
  7822. const { isVNode } = ssrUtils;
  7823. async function unrollBuffer(buffer, stream) {
  7824. if (buffer.hasAsync) {
  7825. for (let i = 0; i < buffer.length; i++) {
  7826. let item = buffer[i];
  7827. if (isPromise(item)) {
  7828. item = await item;
  7829. }
  7830. if (isString(item)) {
  7831. stream.push(item);
  7832. } else {
  7833. await unrollBuffer(item, stream);
  7834. }
  7835. }
  7836. } else {
  7837. unrollBufferSync(buffer, stream);
  7838. }
  7839. }
  7840. function unrollBufferSync(buffer, stream) {
  7841. for (let i = 0; i < buffer.length; i++) {
  7842. let item = buffer[i];
  7843. if (isString(item)) {
  7844. stream.push(item);
  7845. } else {
  7846. unrollBufferSync(item, stream);
  7847. }
  7848. }
  7849. }
  7850. function renderToSimpleStream(input, context, stream) {
  7851. if (isVNode(input)) {
  7852. return renderToSimpleStream(
  7853. createApp({ render: () => input }),
  7854. context,
  7855. stream
  7856. );
  7857. }
  7858. const vnode = createVNode(input._component, input._props);
  7859. vnode.appContext = input._context;
  7860. input.provide(ssrContextKey, context);
  7861. Promise.resolve(renderComponentVNode(vnode)).then((buffer) => unrollBuffer(buffer, stream)).then(() => resolveTeleports(context)).then(() => {
  7862. if (context.__watcherHandles) {
  7863. for (const unwatch of context.__watcherHandles) {
  7864. unwatch();
  7865. }
  7866. }
  7867. }).then(() => stream.push(null)).catch((error) => {
  7868. stream.destroy(error);
  7869. });
  7870. return stream;
  7871. }
  7872. function renderToStream(input, context = {}) {
  7873. console.warn(
  7874. `[@vue/server-renderer] renderToStream is deprecated - use renderToNodeStream instead.`
  7875. );
  7876. return renderToNodeStream(input, context);
  7877. }
  7878. function renderToNodeStream(input, context = {}) {
  7879. {
  7880. throw new Error(
  7881. `ESM build of renderToStream() does not support renderToNodeStream(). Use pipeToNodeWritable() with an existing Node.js Writable stream instance instead.`
  7882. );
  7883. }
  7884. }
  7885. function pipeToNodeWritable(input, context = {}, writable) {
  7886. renderToSimpleStream(input, context, {
  7887. push(content) {
  7888. if (content != null) {
  7889. writable.write(content);
  7890. } else {
  7891. writable.end();
  7892. }
  7893. },
  7894. destroy(err) {
  7895. writable.destroy(err);
  7896. }
  7897. });
  7898. }
  7899. function renderToWebStream(input, context = {}) {
  7900. if (typeof ReadableStream !== "function") {
  7901. throw new Error(
  7902. `ReadableStream constructor is not available in the global scope. If the target environment does support web streams, consider using pipeToWebWritable() with an existing WritableStream instance instead.`
  7903. );
  7904. }
  7905. const encoder = new TextEncoder();
  7906. let cancelled = false;
  7907. return new ReadableStream({
  7908. start(controller) {
  7909. renderToSimpleStream(input, context, {
  7910. push(content) {
  7911. if (cancelled) return;
  7912. if (content != null) {
  7913. controller.enqueue(encoder.encode(content));
  7914. } else {
  7915. controller.close();
  7916. }
  7917. },
  7918. destroy(err) {
  7919. controller.error(err);
  7920. }
  7921. });
  7922. },
  7923. cancel() {
  7924. cancelled = true;
  7925. }
  7926. });
  7927. }
  7928. function pipeToWebWritable(input, context = {}, writable) {
  7929. const writer = writable.getWriter();
  7930. const encoder = new TextEncoder();
  7931. let hasReady = false;
  7932. try {
  7933. hasReady = isPromise(writer.ready);
  7934. } catch (e) {
  7935. }
  7936. renderToSimpleStream(input, context, {
  7937. async push(content) {
  7938. if (hasReady) {
  7939. await writer.ready;
  7940. }
  7941. if (content != null) {
  7942. return writer.write(encoder.encode(content));
  7943. } else {
  7944. return writer.close();
  7945. }
  7946. },
  7947. destroy(err) {
  7948. console.log(err);
  7949. writer.close();
  7950. }
  7951. });
  7952. }
  7953. initDirectivesForSSR();
  7954. export { pipeToNodeWritable, pipeToWebWritable, renderToNodeStream, renderToSimpleStream, renderToStream, renderToString, renderToWebStream, ssrGetDirectiveProps, ssrGetDynamicModelProps, includeBooleanAttr as ssrIncludeBooleanAttr, ssrInterpolate, ssrLooseContain, ssrLooseEqual, ssrRenderAttr, ssrRenderAttrs, ssrRenderClass, ssrRenderComponent, ssrRenderDynamicAttr, ssrRenderDynamicModel, ssrRenderList, ssrRenderSlot, ssrRenderSlotInner, ssrRenderStyle, ssrRenderSuspense, ssrRenderTeleport, renderVNode as ssrRenderVNode };