vue-dev.7a51ac2d.js 294 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076
  1. /**
  2. * @vue/shared v3.5.26
  3. * (c) 2018-present Yuxi (Evan) You and Vue contributors
  4. * @license MIT
  5. **/
  6. // @__NO_SIDE_EFFECTS__
  7. function makeMap(str) {
  8. const map = /* @__PURE__ */ Object.create(null);
  9. for (const key of str.split(","))
  10. map[key] = 1;
  11. return (val) => val in map;
  12. }
  13. const EMPTY_OBJ = {};
  14. const EMPTY_ARR = [];
  15. const NOOP = () => {
  16. };
  17. const NO = () => false;
  18. const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
  19. (key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
  20. const isModelListener = (key) => key.startsWith("onUpdate:");
  21. const extend = Object.assign;
  22. const remove = (arr, el) => {
  23. const i = arr.indexOf(el);
  24. if (i > -1) {
  25. arr.splice(i, 1);
  26. }
  27. };
  28. const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
  29. const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
  30. const isArray$1 = Array.isArray;
  31. const isMap = (val) => toTypeString(val) === "[object Map]";
  32. const isSet = (val) => toTypeString(val) === "[object Set]";
  33. const isDate = (val) => toTypeString(val) === "[object Date]";
  34. const isFunction = (val) => typeof val === "function";
  35. const isString = (val) => typeof val === "string";
  36. const isSymbol = (val) => typeof val === "symbol";
  37. const isObject = (val) => val !== null && typeof val === "object";
  38. const isPromise = (val) => {
  39. return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch);
  40. };
  41. const objectToString = Object.prototype.toString;
  42. const toTypeString = (value) => objectToString.call(value);
  43. const toRawType = (value) => {
  44. return toTypeString(value).slice(8, -1);
  45. };
  46. const isPlainObject$1 = (val) => toTypeString(val) === "[object Object]";
  47. const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
  48. const isReservedProp = /* @__PURE__ */ makeMap(
  49. // the leading comma is intentional so empty string "" is also included
  50. ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
  51. );
  52. const cacheStringFunction = (fn) => {
  53. const cache = /* @__PURE__ */ Object.create(null);
  54. return (str) => {
  55. const hit = cache[str];
  56. return hit || (cache[str] = fn(str));
  57. };
  58. };
  59. const camelizeRE = /-\w/g;
  60. const camelize = cacheStringFunction(
  61. (str) => {
  62. return str.replace(camelizeRE, (c) => c.slice(1).toUpperCase());
  63. }
  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(
  73. (str) => {
  74. const s = str ? `on${capitalize(str)}` : ``;
  75. return s;
  76. }
  77. );
  78. const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
  79. const invokeArrayFns = (fns, ...arg) => {
  80. for (let i = 0; i < fns.length; i++) {
  81. fns[i](...arg);
  82. }
  83. };
  84. const def = (obj, key, value, writable = false) => {
  85. Object.defineProperty(obj, key, {
  86. configurable: true,
  87. enumerable: false,
  88. writable,
  89. value
  90. });
  91. };
  92. const looseToNumber = (val) => {
  93. const n = parseFloat(val);
  94. return isNaN(n) ? val : n;
  95. };
  96. const toNumber = (val) => {
  97. const n = isString(val) ? Number(val) : NaN;
  98. return isNaN(n) ? val : n;
  99. };
  100. let _globalThis;
  101. const getGlobalThis = () => {
  102. return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
  103. };
  104. function normalizeStyle(value) {
  105. if (isArray$1(value)) {
  106. const res = {};
  107. for (let i = 0; i < value.length; i++) {
  108. const item = value[i];
  109. const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item);
  110. if (normalized) {
  111. for (const key in normalized) {
  112. res[key] = normalized[key];
  113. }
  114. }
  115. }
  116. return res;
  117. } else if (isString(value) || isObject(value)) {
  118. return value;
  119. }
  120. }
  121. const listDelimiterRE = /;(?![^(]*\))/g;
  122. const propertyDelimiterRE = /:([^]+)/;
  123. const styleCommentRE = /\/\*[^]*?\*\//g;
  124. function parseStringStyle(cssText) {
  125. const ret = {};
  126. cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
  127. if (item) {
  128. const tmp = item.split(propertyDelimiterRE);
  129. tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
  130. }
  131. });
  132. return ret;
  133. }
  134. function normalizeClass(value) {
  135. let res = "";
  136. if (isString(value)) {
  137. res = value;
  138. } else if (isArray$1(value)) {
  139. for (let i = 0; i < value.length; i++) {
  140. const normalized = normalizeClass(value[i]);
  141. if (normalized) {
  142. res += normalized + " ";
  143. }
  144. }
  145. } else if (isObject(value)) {
  146. for (const name in value) {
  147. if (value[name]) {
  148. res += name + " ";
  149. }
  150. }
  151. }
  152. return res.trim();
  153. }
  154. function normalizeProps(props) {
  155. if (!props)
  156. return null;
  157. let { class: klass, style } = props;
  158. if (klass && !isString(klass)) {
  159. props.class = normalizeClass(klass);
  160. }
  161. if (style) {
  162. props.style = normalizeStyle(style);
  163. }
  164. return props;
  165. }
  166. const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
  167. const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
  168. function includeBooleanAttr(value) {
  169. return !!value || value === "";
  170. }
  171. function looseCompareArrays(a, b) {
  172. if (a.length !== b.length)
  173. return false;
  174. let equal = true;
  175. for (let i = 0; equal && i < a.length; i++) {
  176. equal = looseEqual(a[i], b[i]);
  177. }
  178. return equal;
  179. }
  180. function looseEqual(a, b) {
  181. if (a === b)
  182. return true;
  183. let aValidType = isDate(a);
  184. let bValidType = isDate(b);
  185. if (aValidType || bValidType) {
  186. return aValidType && bValidType ? a.getTime() === b.getTime() : false;
  187. }
  188. aValidType = isSymbol(a);
  189. bValidType = isSymbol(b);
  190. if (aValidType || bValidType) {
  191. return a === b;
  192. }
  193. aValidType = isArray$1(a);
  194. bValidType = isArray$1(b);
  195. if (aValidType || bValidType) {
  196. return aValidType && bValidType ? looseCompareArrays(a, b) : false;
  197. }
  198. aValidType = isObject(a);
  199. bValidType = isObject(b);
  200. if (aValidType || bValidType) {
  201. if (!aValidType || !bValidType) {
  202. return false;
  203. }
  204. const aKeysCount = Object.keys(a).length;
  205. const bKeysCount = Object.keys(b).length;
  206. if (aKeysCount !== bKeysCount) {
  207. return false;
  208. }
  209. for (const key in a) {
  210. const aHasKey = a.hasOwnProperty(key);
  211. const bHasKey = b.hasOwnProperty(key);
  212. if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) {
  213. return false;
  214. }
  215. }
  216. }
  217. return String(a) === String(b);
  218. }
  219. function looseIndexOf(arr, val) {
  220. return arr.findIndex((item) => looseEqual(item, val));
  221. }
  222. const isRef$1 = (val) => {
  223. return !!(val && val["__v_isRef"] === true);
  224. };
  225. const toDisplayString = (val) => {
  226. return isString(val) ? val : val == null ? "" : isArray$1(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? isRef$1(val) ? toDisplayString(val.value) : JSON.stringify(val, replacer, 2) : String(val);
  227. };
  228. const replacer = (_key, val) => {
  229. if (isRef$1(val)) {
  230. return replacer(_key, val.value);
  231. } else if (isMap(val)) {
  232. return {
  233. [`Map(${val.size})`]: [...val.entries()].reduce(
  234. (entries, [key, val2], i) => {
  235. entries[stringifySymbol(key, i) + " =>"] = val2;
  236. return entries;
  237. },
  238. {}
  239. )
  240. };
  241. } else if (isSet(val)) {
  242. return {
  243. [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))
  244. };
  245. } else if (isSymbol(val)) {
  246. return stringifySymbol(val);
  247. } else if (isObject(val) && !isArray$1(val) && !isPlainObject$1(val)) {
  248. return String(val);
  249. }
  250. return val;
  251. };
  252. const stringifySymbol = (v, i = "") => {
  253. var _a;
  254. return (
  255. // Symbol.description in es2019+ so we need to cast here to pass
  256. // the lib: es2016 check
  257. isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v
  258. );
  259. };
  260. /**
  261. * @vue/reactivity v3.5.26
  262. * (c) 2018-present Yuxi (Evan) You and Vue contributors
  263. * @license MIT
  264. **/
  265. let activeEffectScope;
  266. class EffectScope {
  267. constructor(detached = false) {
  268. this.detached = detached;
  269. this._active = true;
  270. this._on = 0;
  271. this.effects = [];
  272. this.cleanups = [];
  273. this._isPaused = false;
  274. this.parent = activeEffectScope;
  275. if (!detached && activeEffectScope) {
  276. this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(
  277. this
  278. ) - 1;
  279. }
  280. }
  281. get active() {
  282. return this._active;
  283. }
  284. pause() {
  285. if (this._active) {
  286. this._isPaused = true;
  287. let i, l;
  288. if (this.scopes) {
  289. for (i = 0, l = this.scopes.length; i < l; i++) {
  290. this.scopes[i].pause();
  291. }
  292. }
  293. for (i = 0, l = this.effects.length; i < l; i++) {
  294. this.effects[i].pause();
  295. }
  296. }
  297. }
  298. /**
  299. * Resumes the effect scope, including all child scopes and effects.
  300. */
  301. resume() {
  302. if (this._active) {
  303. if (this._isPaused) {
  304. this._isPaused = false;
  305. let i, l;
  306. if (this.scopes) {
  307. for (i = 0, l = this.scopes.length; i < l; i++) {
  308. this.scopes[i].resume();
  309. }
  310. }
  311. for (i = 0, l = this.effects.length; i < l; i++) {
  312. this.effects[i].resume();
  313. }
  314. }
  315. }
  316. }
  317. run(fn) {
  318. if (this._active) {
  319. const currentEffectScope = activeEffectScope;
  320. try {
  321. activeEffectScope = this;
  322. return fn();
  323. } finally {
  324. activeEffectScope = currentEffectScope;
  325. }
  326. }
  327. }
  328. /**
  329. * This should only be called on non-detached scopes
  330. * @internal
  331. */
  332. on() {
  333. if (++this._on === 1) {
  334. this.prevScope = activeEffectScope;
  335. activeEffectScope = this;
  336. }
  337. }
  338. /**
  339. * This should only be called on non-detached scopes
  340. * @internal
  341. */
  342. off() {
  343. if (this._on > 0 && --this._on === 0) {
  344. activeEffectScope = this.prevScope;
  345. this.prevScope = void 0;
  346. }
  347. }
  348. stop(fromParent) {
  349. if (this._active) {
  350. this._active = false;
  351. let i, l;
  352. for (i = 0, l = this.effects.length; i < l; i++) {
  353. this.effects[i].stop();
  354. }
  355. this.effects.length = 0;
  356. for (i = 0, l = this.cleanups.length; i < l; i++) {
  357. this.cleanups[i]();
  358. }
  359. this.cleanups.length = 0;
  360. if (this.scopes) {
  361. for (i = 0, l = this.scopes.length; i < l; i++) {
  362. this.scopes[i].stop(true);
  363. }
  364. this.scopes.length = 0;
  365. }
  366. if (!this.detached && this.parent && !fromParent) {
  367. const last = this.parent.scopes.pop();
  368. if (last && last !== this) {
  369. this.parent.scopes[this.index] = last;
  370. last.index = this.index;
  371. }
  372. }
  373. this.parent = void 0;
  374. }
  375. }
  376. }
  377. function effectScope(detached) {
  378. return new EffectScope(detached);
  379. }
  380. function getCurrentScope() {
  381. return activeEffectScope;
  382. }
  383. function onScopeDispose(fn, failSilently = false) {
  384. if (activeEffectScope) {
  385. activeEffectScope.cleanups.push(fn);
  386. }
  387. }
  388. let activeSub;
  389. const pausedQueueEffects = /* @__PURE__ */ new WeakSet();
  390. class ReactiveEffect {
  391. constructor(fn) {
  392. this.fn = fn;
  393. this.deps = void 0;
  394. this.depsTail = void 0;
  395. this.flags = 1 | 4;
  396. this.next = void 0;
  397. this.cleanup = void 0;
  398. this.scheduler = void 0;
  399. if (activeEffectScope && activeEffectScope.active) {
  400. activeEffectScope.effects.push(this);
  401. }
  402. }
  403. pause() {
  404. this.flags |= 64;
  405. }
  406. resume() {
  407. if (this.flags & 64) {
  408. this.flags &= -65;
  409. if (pausedQueueEffects.has(this)) {
  410. pausedQueueEffects.delete(this);
  411. this.trigger();
  412. }
  413. }
  414. }
  415. /**
  416. * @internal
  417. */
  418. notify() {
  419. if (this.flags & 2 && !(this.flags & 32)) {
  420. return;
  421. }
  422. if (!(this.flags & 8)) {
  423. batch(this);
  424. }
  425. }
  426. run() {
  427. if (!(this.flags & 1)) {
  428. return this.fn();
  429. }
  430. this.flags |= 2;
  431. cleanupEffect(this);
  432. prepareDeps(this);
  433. const prevEffect = activeSub;
  434. const prevShouldTrack = shouldTrack;
  435. activeSub = this;
  436. shouldTrack = true;
  437. try {
  438. return this.fn();
  439. } finally {
  440. cleanupDeps(this);
  441. activeSub = prevEffect;
  442. shouldTrack = prevShouldTrack;
  443. this.flags &= -3;
  444. }
  445. }
  446. stop() {
  447. if (this.flags & 1) {
  448. for (let link = this.deps; link; link = link.nextDep) {
  449. removeSub(link);
  450. }
  451. this.deps = this.depsTail = void 0;
  452. cleanupEffect(this);
  453. this.onStop && this.onStop();
  454. this.flags &= -2;
  455. }
  456. }
  457. trigger() {
  458. if (this.flags & 64) {
  459. pausedQueueEffects.add(this);
  460. } else if (this.scheduler) {
  461. this.scheduler();
  462. } else {
  463. this.runIfDirty();
  464. }
  465. }
  466. /**
  467. * @internal
  468. */
  469. runIfDirty() {
  470. if (isDirty(this)) {
  471. this.run();
  472. }
  473. }
  474. get dirty() {
  475. return isDirty(this);
  476. }
  477. }
  478. let batchDepth = 0;
  479. let batchedSub;
  480. let batchedComputed;
  481. function batch(sub, isComputed2 = false) {
  482. sub.flags |= 8;
  483. if (isComputed2) {
  484. sub.next = batchedComputed;
  485. batchedComputed = sub;
  486. return;
  487. }
  488. sub.next = batchedSub;
  489. batchedSub = sub;
  490. }
  491. function startBatch() {
  492. batchDepth++;
  493. }
  494. function endBatch() {
  495. if (--batchDepth > 0) {
  496. return;
  497. }
  498. if (batchedComputed) {
  499. let e = batchedComputed;
  500. batchedComputed = void 0;
  501. while (e) {
  502. const next = e.next;
  503. e.next = void 0;
  504. e.flags &= -9;
  505. e = next;
  506. }
  507. }
  508. let error;
  509. while (batchedSub) {
  510. let e = batchedSub;
  511. batchedSub = void 0;
  512. while (e) {
  513. const next = e.next;
  514. e.next = void 0;
  515. e.flags &= -9;
  516. if (e.flags & 1) {
  517. try {
  518. ;
  519. e.trigger();
  520. } catch (err) {
  521. if (!error)
  522. error = err;
  523. }
  524. }
  525. e = next;
  526. }
  527. }
  528. if (error)
  529. throw error;
  530. }
  531. function prepareDeps(sub) {
  532. for (let link = sub.deps; link; link = link.nextDep) {
  533. link.version = -1;
  534. link.prevActiveLink = link.dep.activeLink;
  535. link.dep.activeLink = link;
  536. }
  537. }
  538. function cleanupDeps(sub) {
  539. let head;
  540. let tail = sub.depsTail;
  541. let link = tail;
  542. while (link) {
  543. const prev = link.prevDep;
  544. if (link.version === -1) {
  545. if (link === tail)
  546. tail = prev;
  547. removeSub(link);
  548. removeDep(link);
  549. } else {
  550. head = link;
  551. }
  552. link.dep.activeLink = link.prevActiveLink;
  553. link.prevActiveLink = void 0;
  554. link = prev;
  555. }
  556. sub.deps = head;
  557. sub.depsTail = tail;
  558. }
  559. function isDirty(sub) {
  560. for (let link = sub.deps; link; link = link.nextDep) {
  561. if (link.dep.version !== link.version || link.dep.computed && (refreshComputed(link.dep.computed) || link.dep.version !== link.version)) {
  562. return true;
  563. }
  564. }
  565. if (sub._dirty) {
  566. return true;
  567. }
  568. return false;
  569. }
  570. function refreshComputed(computed2) {
  571. if (computed2.flags & 4 && !(computed2.flags & 16)) {
  572. return;
  573. }
  574. computed2.flags &= -17;
  575. if (computed2.globalVersion === globalVersion) {
  576. return;
  577. }
  578. computed2.globalVersion = globalVersion;
  579. if (!computed2.isSSR && computed2.flags & 128 && (!computed2.deps && !computed2._dirty || !isDirty(computed2))) {
  580. return;
  581. }
  582. computed2.flags |= 2;
  583. const dep = computed2.dep;
  584. const prevSub = activeSub;
  585. const prevShouldTrack = shouldTrack;
  586. activeSub = computed2;
  587. shouldTrack = true;
  588. try {
  589. prepareDeps(computed2);
  590. const value = computed2.fn(computed2._value);
  591. if (dep.version === 0 || hasChanged(value, computed2._value)) {
  592. computed2.flags |= 128;
  593. computed2._value = value;
  594. dep.version++;
  595. }
  596. } catch (err) {
  597. dep.version++;
  598. throw err;
  599. } finally {
  600. activeSub = prevSub;
  601. shouldTrack = prevShouldTrack;
  602. cleanupDeps(computed2);
  603. computed2.flags &= -3;
  604. }
  605. }
  606. function removeSub(link, soft = false) {
  607. const { dep, prevSub, nextSub } = link;
  608. if (prevSub) {
  609. prevSub.nextSub = nextSub;
  610. link.prevSub = void 0;
  611. }
  612. if (nextSub) {
  613. nextSub.prevSub = prevSub;
  614. link.nextSub = void 0;
  615. }
  616. if (dep.subs === link) {
  617. dep.subs = prevSub;
  618. if (!prevSub && dep.computed) {
  619. dep.computed.flags &= -5;
  620. for (let l = dep.computed.deps; l; l = l.nextDep) {
  621. removeSub(l, true);
  622. }
  623. }
  624. }
  625. if (!soft && !--dep.sc && dep.map) {
  626. dep.map.delete(dep.key);
  627. }
  628. }
  629. function removeDep(link) {
  630. const { prevDep, nextDep } = link;
  631. if (prevDep) {
  632. prevDep.nextDep = nextDep;
  633. link.prevDep = void 0;
  634. }
  635. if (nextDep) {
  636. nextDep.prevDep = prevDep;
  637. link.nextDep = void 0;
  638. }
  639. }
  640. let shouldTrack = true;
  641. const trackStack = [];
  642. function pauseTracking() {
  643. trackStack.push(shouldTrack);
  644. shouldTrack = false;
  645. }
  646. function resetTracking() {
  647. const last = trackStack.pop();
  648. shouldTrack = last === void 0 ? true : last;
  649. }
  650. function cleanupEffect(e) {
  651. const { cleanup } = e;
  652. e.cleanup = void 0;
  653. if (cleanup) {
  654. const prevSub = activeSub;
  655. activeSub = void 0;
  656. try {
  657. cleanup();
  658. } finally {
  659. activeSub = prevSub;
  660. }
  661. }
  662. }
  663. let globalVersion = 0;
  664. class Link {
  665. constructor(sub, dep) {
  666. this.sub = sub;
  667. this.dep = dep;
  668. this.version = dep.version;
  669. this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0;
  670. }
  671. }
  672. class Dep {
  673. // TODO isolatedDeclarations "__v_skip"
  674. constructor(computed2) {
  675. this.computed = computed2;
  676. this.version = 0;
  677. this.activeLink = void 0;
  678. this.subs = void 0;
  679. this.map = void 0;
  680. this.key = void 0;
  681. this.sc = 0;
  682. this.__v_skip = true;
  683. }
  684. track(debugInfo) {
  685. if (!activeSub || !shouldTrack || activeSub === this.computed) {
  686. return;
  687. }
  688. let link = this.activeLink;
  689. if (link === void 0 || link.sub !== activeSub) {
  690. link = this.activeLink = new Link(activeSub, this);
  691. if (!activeSub.deps) {
  692. activeSub.deps = activeSub.depsTail = link;
  693. } else {
  694. link.prevDep = activeSub.depsTail;
  695. activeSub.depsTail.nextDep = link;
  696. activeSub.depsTail = link;
  697. }
  698. addSub(link);
  699. } else if (link.version === -1) {
  700. link.version = this.version;
  701. if (link.nextDep) {
  702. const next = link.nextDep;
  703. next.prevDep = link.prevDep;
  704. if (link.prevDep) {
  705. link.prevDep.nextDep = next;
  706. }
  707. link.prevDep = activeSub.depsTail;
  708. link.nextDep = void 0;
  709. activeSub.depsTail.nextDep = link;
  710. activeSub.depsTail = link;
  711. if (activeSub.deps === link) {
  712. activeSub.deps = next;
  713. }
  714. }
  715. }
  716. return link;
  717. }
  718. trigger(debugInfo) {
  719. this.version++;
  720. globalVersion++;
  721. this.notify(debugInfo);
  722. }
  723. notify(debugInfo) {
  724. startBatch();
  725. try {
  726. if (false)
  727. ;
  728. for (let link = this.subs; link; link = link.prevSub) {
  729. if (link.sub.notify()) {
  730. ;
  731. link.sub.dep.notify();
  732. }
  733. }
  734. } finally {
  735. endBatch();
  736. }
  737. }
  738. }
  739. function addSub(link) {
  740. link.dep.sc++;
  741. if (link.sub.flags & 4) {
  742. const computed2 = link.dep.computed;
  743. if (computed2 && !link.dep.subs) {
  744. computed2.flags |= 4 | 16;
  745. for (let l = computed2.deps; l; l = l.nextDep) {
  746. addSub(l);
  747. }
  748. }
  749. const currentTail = link.dep.subs;
  750. if (currentTail !== link) {
  751. link.prevSub = currentTail;
  752. if (currentTail)
  753. currentTail.nextSub = link;
  754. }
  755. link.dep.subs = link;
  756. }
  757. }
  758. const targetMap = /* @__PURE__ */ new WeakMap();
  759. const ITERATE_KEY = /* @__PURE__ */ Symbol(
  760. ""
  761. );
  762. const MAP_KEY_ITERATE_KEY = /* @__PURE__ */ Symbol(
  763. ""
  764. );
  765. const ARRAY_ITERATE_KEY = /* @__PURE__ */ Symbol(
  766. ""
  767. );
  768. function track(target, type, key) {
  769. if (shouldTrack && activeSub) {
  770. let depsMap = targetMap.get(target);
  771. if (!depsMap) {
  772. targetMap.set(target, depsMap = /* @__PURE__ */ new Map());
  773. }
  774. let dep = depsMap.get(key);
  775. if (!dep) {
  776. depsMap.set(key, dep = new Dep());
  777. dep.map = depsMap;
  778. dep.key = key;
  779. }
  780. {
  781. dep.track();
  782. }
  783. }
  784. }
  785. function trigger(target, type, key, newValue, oldValue, oldTarget) {
  786. const depsMap = targetMap.get(target);
  787. if (!depsMap) {
  788. globalVersion++;
  789. return;
  790. }
  791. const run = (dep) => {
  792. if (dep) {
  793. {
  794. dep.trigger();
  795. }
  796. }
  797. };
  798. startBatch();
  799. if (type === "clear") {
  800. depsMap.forEach(run);
  801. } else {
  802. const targetIsArray = isArray$1(target);
  803. const isArrayIndex = targetIsArray && isIntegerKey(key);
  804. if (targetIsArray && key === "length") {
  805. const newLength = Number(newValue);
  806. depsMap.forEach((dep, key2) => {
  807. if (key2 === "length" || key2 === ARRAY_ITERATE_KEY || !isSymbol(key2) && key2 >= newLength) {
  808. run(dep);
  809. }
  810. });
  811. } else {
  812. if (key !== void 0 || depsMap.has(void 0)) {
  813. run(depsMap.get(key));
  814. }
  815. if (isArrayIndex) {
  816. run(depsMap.get(ARRAY_ITERATE_KEY));
  817. }
  818. switch (type) {
  819. case "add":
  820. if (!targetIsArray) {
  821. run(depsMap.get(ITERATE_KEY));
  822. if (isMap(target)) {
  823. run(depsMap.get(MAP_KEY_ITERATE_KEY));
  824. }
  825. } else if (isArrayIndex) {
  826. run(depsMap.get("length"));
  827. }
  828. break;
  829. case "delete":
  830. if (!targetIsArray) {
  831. run(depsMap.get(ITERATE_KEY));
  832. if (isMap(target)) {
  833. run(depsMap.get(MAP_KEY_ITERATE_KEY));
  834. }
  835. }
  836. break;
  837. case "set":
  838. if (isMap(target)) {
  839. run(depsMap.get(ITERATE_KEY));
  840. }
  841. break;
  842. }
  843. }
  844. }
  845. endBatch();
  846. }
  847. function getDepFromReactive(object, key) {
  848. const depMap = targetMap.get(object);
  849. return depMap && depMap.get(key);
  850. }
  851. function reactiveReadArray(array) {
  852. const raw = toRaw(array);
  853. if (raw === array)
  854. return raw;
  855. track(raw, "iterate", ARRAY_ITERATE_KEY);
  856. return isShallow(array) ? raw : raw.map(toReactive);
  857. }
  858. function shallowReadArray(arr) {
  859. track(arr = toRaw(arr), "iterate", ARRAY_ITERATE_KEY);
  860. return arr;
  861. }
  862. function toWrapped(target, item) {
  863. if (isReadonly(target)) {
  864. return isReactive(target) ? toReadonly(toReactive(item)) : toReadonly(item);
  865. }
  866. return toReactive(item);
  867. }
  868. const arrayInstrumentations = {
  869. __proto__: null,
  870. [Symbol.iterator]() {
  871. return iterator(this, Symbol.iterator, (item) => toWrapped(this, item));
  872. },
  873. concat(...args) {
  874. return reactiveReadArray(this).concat(
  875. ...args.map((x) => isArray$1(x) ? reactiveReadArray(x) : x)
  876. );
  877. },
  878. entries() {
  879. return iterator(this, "entries", (value) => {
  880. value[1] = toWrapped(this, value[1]);
  881. return value;
  882. });
  883. },
  884. every(fn, thisArg) {
  885. return apply(this, "every", fn, thisArg, void 0, arguments);
  886. },
  887. filter(fn, thisArg) {
  888. return apply(
  889. this,
  890. "filter",
  891. fn,
  892. thisArg,
  893. (v) => v.map((item) => toWrapped(this, item)),
  894. arguments
  895. );
  896. },
  897. find(fn, thisArg) {
  898. return apply(
  899. this,
  900. "find",
  901. fn,
  902. thisArg,
  903. (item) => toWrapped(this, item),
  904. arguments
  905. );
  906. },
  907. findIndex(fn, thisArg) {
  908. return apply(this, "findIndex", fn, thisArg, void 0, arguments);
  909. },
  910. findLast(fn, thisArg) {
  911. return apply(
  912. this,
  913. "findLast",
  914. fn,
  915. thisArg,
  916. (item) => toWrapped(this, item),
  917. arguments
  918. );
  919. },
  920. findLastIndex(fn, thisArg) {
  921. return apply(this, "findLastIndex", fn, thisArg, void 0, arguments);
  922. },
  923. // flat, flatMap could benefit from ARRAY_ITERATE but are not straight-forward to implement
  924. forEach(fn, thisArg) {
  925. return apply(this, "forEach", fn, thisArg, void 0, arguments);
  926. },
  927. includes(...args) {
  928. return searchProxy(this, "includes", args);
  929. },
  930. indexOf(...args) {
  931. return searchProxy(this, "indexOf", args);
  932. },
  933. join(separator) {
  934. return reactiveReadArray(this).join(separator);
  935. },
  936. // keys() iterator only reads `length`, no optimization required
  937. lastIndexOf(...args) {
  938. return searchProxy(this, "lastIndexOf", args);
  939. },
  940. map(fn, thisArg) {
  941. return apply(this, "map", fn, thisArg, void 0, arguments);
  942. },
  943. pop() {
  944. return noTracking(this, "pop");
  945. },
  946. push(...args) {
  947. return noTracking(this, "push", args);
  948. },
  949. reduce(fn, ...args) {
  950. return reduce(this, "reduce", fn, args);
  951. },
  952. reduceRight(fn, ...args) {
  953. return reduce(this, "reduceRight", fn, args);
  954. },
  955. shift() {
  956. return noTracking(this, "shift");
  957. },
  958. // slice could use ARRAY_ITERATE but also seems to beg for range tracking
  959. some(fn, thisArg) {
  960. return apply(this, "some", fn, thisArg, void 0, arguments);
  961. },
  962. splice(...args) {
  963. return noTracking(this, "splice", args);
  964. },
  965. toReversed() {
  966. return reactiveReadArray(this).toReversed();
  967. },
  968. toSorted(comparer) {
  969. return reactiveReadArray(this).toSorted(comparer);
  970. },
  971. toSpliced(...args) {
  972. return reactiveReadArray(this).toSpliced(...args);
  973. },
  974. unshift(...args) {
  975. return noTracking(this, "unshift", args);
  976. },
  977. values() {
  978. return iterator(this, "values", (item) => toWrapped(this, item));
  979. }
  980. };
  981. function iterator(self2, method, wrapValue) {
  982. const arr = shallowReadArray(self2);
  983. const iter = arr[method]();
  984. if (arr !== self2 && !isShallow(self2)) {
  985. iter._next = iter.next;
  986. iter.next = () => {
  987. const result = iter._next();
  988. if (!result.done) {
  989. result.value = wrapValue(result.value);
  990. }
  991. return result;
  992. };
  993. }
  994. return iter;
  995. }
  996. const arrayProto = Array.prototype;
  997. function apply(self2, method, fn, thisArg, wrappedRetFn, args) {
  998. const arr = shallowReadArray(self2);
  999. const needsWrap = arr !== self2 && !isShallow(self2);
  1000. const methodFn = arr[method];
  1001. if (methodFn !== arrayProto[method]) {
  1002. const result2 = methodFn.apply(self2, args);
  1003. return needsWrap ? toReactive(result2) : result2;
  1004. }
  1005. let wrappedFn = fn;
  1006. if (arr !== self2) {
  1007. if (needsWrap) {
  1008. wrappedFn = function(item, index) {
  1009. return fn.call(this, toWrapped(self2, item), index, self2);
  1010. };
  1011. } else if (fn.length > 2) {
  1012. wrappedFn = function(item, index) {
  1013. return fn.call(this, item, index, self2);
  1014. };
  1015. }
  1016. }
  1017. const result = methodFn.call(arr, wrappedFn, thisArg);
  1018. return needsWrap && wrappedRetFn ? wrappedRetFn(result) : result;
  1019. }
  1020. function reduce(self2, method, fn, args) {
  1021. const arr = shallowReadArray(self2);
  1022. let wrappedFn = fn;
  1023. if (arr !== self2) {
  1024. if (!isShallow(self2)) {
  1025. wrappedFn = function(acc, item, index) {
  1026. return fn.call(this, acc, toWrapped(self2, item), index, self2);
  1027. };
  1028. } else if (fn.length > 3) {
  1029. wrappedFn = function(acc, item, index) {
  1030. return fn.call(this, acc, item, index, self2);
  1031. };
  1032. }
  1033. }
  1034. return arr[method](wrappedFn, ...args);
  1035. }
  1036. function searchProxy(self2, method, args) {
  1037. const arr = toRaw(self2);
  1038. track(arr, "iterate", ARRAY_ITERATE_KEY);
  1039. const res = arr[method](...args);
  1040. if ((res === -1 || res === false) && isProxy(args[0])) {
  1041. args[0] = toRaw(args[0]);
  1042. return arr[method](...args);
  1043. }
  1044. return res;
  1045. }
  1046. function noTracking(self2, method, args = []) {
  1047. pauseTracking();
  1048. startBatch();
  1049. const res = toRaw(self2)[method].apply(self2, args);
  1050. endBatch();
  1051. resetTracking();
  1052. return res;
  1053. }
  1054. const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
  1055. const builtInSymbols = new Set(
  1056. /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
  1057. );
  1058. function hasOwnProperty(key) {
  1059. if (!isSymbol(key))
  1060. key = String(key);
  1061. const obj = toRaw(this);
  1062. track(obj, "has", key);
  1063. return obj.hasOwnProperty(key);
  1064. }
  1065. class BaseReactiveHandler {
  1066. constructor(_isReadonly = false, _isShallow = false) {
  1067. this._isReadonly = _isReadonly;
  1068. this._isShallow = _isShallow;
  1069. }
  1070. get(target, key, receiver) {
  1071. if (key === "__v_skip")
  1072. return target["__v_skip"];
  1073. const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow;
  1074. if (key === "__v_isReactive") {
  1075. return !isReadonly2;
  1076. } else if (key === "__v_isReadonly") {
  1077. return isReadonly2;
  1078. } else if (key === "__v_isShallow") {
  1079. return isShallow2;
  1080. } else if (key === "__v_raw") {
  1081. if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
  1082. // this means the receiver is a user proxy of the reactive proxy
  1083. Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
  1084. return target;
  1085. }
  1086. return;
  1087. }
  1088. const targetIsArray = isArray$1(target);
  1089. if (!isReadonly2) {
  1090. let fn;
  1091. if (targetIsArray && (fn = arrayInstrumentations[key])) {
  1092. return fn;
  1093. }
  1094. if (key === "hasOwnProperty") {
  1095. return hasOwnProperty;
  1096. }
  1097. }
  1098. const res = Reflect.get(
  1099. target,
  1100. key,
  1101. // if this is a proxy wrapping a ref, return methods using the raw ref
  1102. // as receiver so that we don't have to call `toRaw` on the ref in all
  1103. // its class methods
  1104. isRef(target) ? target : receiver
  1105. );
  1106. if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
  1107. return res;
  1108. }
  1109. if (!isReadonly2) {
  1110. track(target, "get", key);
  1111. }
  1112. if (isShallow2) {
  1113. return res;
  1114. }
  1115. if (isRef(res)) {
  1116. const value = targetIsArray && isIntegerKey(key) ? res : res.value;
  1117. return isReadonly2 && isObject(value) ? readonly(value) : value;
  1118. }
  1119. if (isObject(res)) {
  1120. return isReadonly2 ? readonly(res) : reactive(res);
  1121. }
  1122. return res;
  1123. }
  1124. }
  1125. class MutableReactiveHandler extends BaseReactiveHandler {
  1126. constructor(isShallow2 = false) {
  1127. super(false, isShallow2);
  1128. }
  1129. set(target, key, value, receiver) {
  1130. let oldValue = target[key];
  1131. const isArrayWithIntegerKey = isArray$1(target) && isIntegerKey(key);
  1132. if (!this._isShallow) {
  1133. const isOldValueReadonly = isReadonly(oldValue);
  1134. if (!isShallow(value) && !isReadonly(value)) {
  1135. oldValue = toRaw(oldValue);
  1136. value = toRaw(value);
  1137. }
  1138. if (!isArrayWithIntegerKey && isRef(oldValue) && !isRef(value)) {
  1139. if (isOldValueReadonly) {
  1140. return true;
  1141. } else {
  1142. oldValue.value = value;
  1143. return true;
  1144. }
  1145. }
  1146. }
  1147. const hadKey = isArrayWithIntegerKey ? Number(key) < target.length : hasOwn(target, key);
  1148. const result = Reflect.set(
  1149. target,
  1150. key,
  1151. value,
  1152. isRef(target) ? target : receiver
  1153. );
  1154. if (target === toRaw(receiver)) {
  1155. if (!hadKey) {
  1156. trigger(target, "add", key, value);
  1157. } else if (hasChanged(value, oldValue)) {
  1158. trigger(target, "set", key, value);
  1159. }
  1160. }
  1161. return result;
  1162. }
  1163. deleteProperty(target, key) {
  1164. const hadKey = hasOwn(target, key);
  1165. target[key];
  1166. const result = Reflect.deleteProperty(target, key);
  1167. if (result && hadKey) {
  1168. trigger(target, "delete", key, void 0);
  1169. }
  1170. return result;
  1171. }
  1172. has(target, key) {
  1173. const result = Reflect.has(target, key);
  1174. if (!isSymbol(key) || !builtInSymbols.has(key)) {
  1175. track(target, "has", key);
  1176. }
  1177. return result;
  1178. }
  1179. ownKeys(target) {
  1180. track(
  1181. target,
  1182. "iterate",
  1183. isArray$1(target) ? "length" : ITERATE_KEY
  1184. );
  1185. return Reflect.ownKeys(target);
  1186. }
  1187. }
  1188. class ReadonlyReactiveHandler extends BaseReactiveHandler {
  1189. constructor(isShallow2 = false) {
  1190. super(true, isShallow2);
  1191. }
  1192. set(target, key) {
  1193. return true;
  1194. }
  1195. deleteProperty(target, key) {
  1196. return true;
  1197. }
  1198. }
  1199. const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();
  1200. const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();
  1201. const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(true);
  1202. const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true);
  1203. const toShallow = (value) => value;
  1204. const getProto = (v) => Reflect.getPrototypeOf(v);
  1205. function createIterableMethod(method, isReadonly2, isShallow2) {
  1206. return function(...args) {
  1207. const target = this["__v_raw"];
  1208. const rawTarget = toRaw(target);
  1209. const targetIsMap = isMap(rawTarget);
  1210. const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
  1211. const isKeyOnly = method === "keys" && targetIsMap;
  1212. const innerIterator = target[method](...args);
  1213. const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
  1214. !isReadonly2 && track(
  1215. rawTarget,
  1216. "iterate",
  1217. isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY
  1218. );
  1219. return {
  1220. // iterator protocol
  1221. next() {
  1222. const { value, done } = innerIterator.next();
  1223. return done ? { value, done } : {
  1224. value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
  1225. done
  1226. };
  1227. },
  1228. // iterable protocol
  1229. [Symbol.iterator]() {
  1230. return this;
  1231. }
  1232. };
  1233. };
  1234. }
  1235. function createReadonlyMethod(type) {
  1236. return function(...args) {
  1237. return type === "delete" ? false : type === "clear" ? void 0 : this;
  1238. };
  1239. }
  1240. function createInstrumentations(readonly2, shallow) {
  1241. const instrumentations = {
  1242. get(key) {
  1243. const target = this["__v_raw"];
  1244. const rawTarget = toRaw(target);
  1245. const rawKey = toRaw(key);
  1246. if (!readonly2) {
  1247. if (hasChanged(key, rawKey)) {
  1248. track(rawTarget, "get", key);
  1249. }
  1250. track(rawTarget, "get", rawKey);
  1251. }
  1252. const { has } = getProto(rawTarget);
  1253. const wrap = shallow ? toShallow : readonly2 ? toReadonly : toReactive;
  1254. if (has.call(rawTarget, key)) {
  1255. return wrap(target.get(key));
  1256. } else if (has.call(rawTarget, rawKey)) {
  1257. return wrap(target.get(rawKey));
  1258. } else if (target !== rawTarget) {
  1259. target.get(key);
  1260. }
  1261. },
  1262. get size() {
  1263. const target = this["__v_raw"];
  1264. !readonly2 && track(toRaw(target), "iterate", ITERATE_KEY);
  1265. return target.size;
  1266. },
  1267. has(key) {
  1268. const target = this["__v_raw"];
  1269. const rawTarget = toRaw(target);
  1270. const rawKey = toRaw(key);
  1271. if (!readonly2) {
  1272. if (hasChanged(key, rawKey)) {
  1273. track(rawTarget, "has", key);
  1274. }
  1275. track(rawTarget, "has", rawKey);
  1276. }
  1277. return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
  1278. },
  1279. forEach(callback, thisArg) {
  1280. const observed = this;
  1281. const target = observed["__v_raw"];
  1282. const rawTarget = toRaw(target);
  1283. const wrap = shallow ? toShallow : readonly2 ? toReadonly : toReactive;
  1284. !readonly2 && track(rawTarget, "iterate", ITERATE_KEY);
  1285. return target.forEach((value, key) => {
  1286. return callback.call(thisArg, wrap(value), wrap(key), observed);
  1287. });
  1288. }
  1289. };
  1290. extend(
  1291. instrumentations,
  1292. readonly2 ? {
  1293. add: createReadonlyMethod("add"),
  1294. set: createReadonlyMethod("set"),
  1295. delete: createReadonlyMethod("delete"),
  1296. clear: createReadonlyMethod("clear")
  1297. } : {
  1298. add(value) {
  1299. if (!shallow && !isShallow(value) && !isReadonly(value)) {
  1300. value = toRaw(value);
  1301. }
  1302. const target = toRaw(this);
  1303. const proto = getProto(target);
  1304. const hadKey = proto.has.call(target, value);
  1305. if (!hadKey) {
  1306. target.add(value);
  1307. trigger(target, "add", value, value);
  1308. }
  1309. return this;
  1310. },
  1311. set(key, value) {
  1312. if (!shallow && !isShallow(value) && !isReadonly(value)) {
  1313. value = toRaw(value);
  1314. }
  1315. const target = toRaw(this);
  1316. const { has, get } = getProto(target);
  1317. let hadKey = has.call(target, key);
  1318. if (!hadKey) {
  1319. key = toRaw(key);
  1320. hadKey = has.call(target, key);
  1321. }
  1322. const oldValue = get.call(target, key);
  1323. target.set(key, value);
  1324. if (!hadKey) {
  1325. trigger(target, "add", key, value);
  1326. } else if (hasChanged(value, oldValue)) {
  1327. trigger(target, "set", key, value);
  1328. }
  1329. return this;
  1330. },
  1331. delete(key) {
  1332. const target = toRaw(this);
  1333. const { has, get } = getProto(target);
  1334. let hadKey = has.call(target, key);
  1335. if (!hadKey) {
  1336. key = toRaw(key);
  1337. hadKey = has.call(target, key);
  1338. }
  1339. get ? get.call(target, key) : void 0;
  1340. const result = target.delete(key);
  1341. if (hadKey) {
  1342. trigger(target, "delete", key, void 0);
  1343. }
  1344. return result;
  1345. },
  1346. clear() {
  1347. const target = toRaw(this);
  1348. const hadItems = target.size !== 0;
  1349. const result = target.clear();
  1350. if (hadItems) {
  1351. trigger(
  1352. target,
  1353. "clear",
  1354. void 0,
  1355. void 0
  1356. );
  1357. }
  1358. return result;
  1359. }
  1360. }
  1361. );
  1362. const iteratorMethods = [
  1363. "keys",
  1364. "values",
  1365. "entries",
  1366. Symbol.iterator
  1367. ];
  1368. iteratorMethods.forEach((method) => {
  1369. instrumentations[method] = createIterableMethod(method, readonly2, shallow);
  1370. });
  1371. return instrumentations;
  1372. }
  1373. function createInstrumentationGetter(isReadonly2, shallow) {
  1374. const instrumentations = createInstrumentations(isReadonly2, shallow);
  1375. return (target, key, receiver) => {
  1376. if (key === "__v_isReactive") {
  1377. return !isReadonly2;
  1378. } else if (key === "__v_isReadonly") {
  1379. return isReadonly2;
  1380. } else if (key === "__v_raw") {
  1381. return target;
  1382. }
  1383. return Reflect.get(
  1384. hasOwn(instrumentations, key) && key in target ? instrumentations : target,
  1385. key,
  1386. receiver
  1387. );
  1388. };
  1389. }
  1390. const mutableCollectionHandlers = {
  1391. get: /* @__PURE__ */ createInstrumentationGetter(false, false)
  1392. };
  1393. const shallowCollectionHandlers = {
  1394. get: /* @__PURE__ */ createInstrumentationGetter(false, true)
  1395. };
  1396. const readonlyCollectionHandlers = {
  1397. get: /* @__PURE__ */ createInstrumentationGetter(true, false)
  1398. };
  1399. const shallowReadonlyCollectionHandlers = {
  1400. get: /* @__PURE__ */ createInstrumentationGetter(true, true)
  1401. };
  1402. const reactiveMap = /* @__PURE__ */ new WeakMap();
  1403. const shallowReactiveMap = /* @__PURE__ */ new WeakMap();
  1404. const readonlyMap = /* @__PURE__ */ new WeakMap();
  1405. const shallowReadonlyMap = /* @__PURE__ */ new WeakMap();
  1406. function targetTypeMap(rawType) {
  1407. switch (rawType) {
  1408. case "Object":
  1409. case "Array":
  1410. return 1;
  1411. case "Map":
  1412. case "Set":
  1413. case "WeakMap":
  1414. case "WeakSet":
  1415. return 2;
  1416. default:
  1417. return 0;
  1418. }
  1419. }
  1420. function getTargetType(value) {
  1421. return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
  1422. }
  1423. function reactive(target) {
  1424. if (isReadonly(target)) {
  1425. return target;
  1426. }
  1427. return createReactiveObject(
  1428. target,
  1429. false,
  1430. mutableHandlers,
  1431. mutableCollectionHandlers,
  1432. reactiveMap
  1433. );
  1434. }
  1435. function shallowReactive(target) {
  1436. return createReactiveObject(
  1437. target,
  1438. false,
  1439. shallowReactiveHandlers,
  1440. shallowCollectionHandlers,
  1441. shallowReactiveMap
  1442. );
  1443. }
  1444. function readonly(target) {
  1445. return createReactiveObject(
  1446. target,
  1447. true,
  1448. readonlyHandlers,
  1449. readonlyCollectionHandlers,
  1450. readonlyMap
  1451. );
  1452. }
  1453. function shallowReadonly(target) {
  1454. return createReactiveObject(
  1455. target,
  1456. true,
  1457. shallowReadonlyHandlers,
  1458. shallowReadonlyCollectionHandlers,
  1459. shallowReadonlyMap
  1460. );
  1461. }
  1462. function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
  1463. if (!isObject(target)) {
  1464. return target;
  1465. }
  1466. if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
  1467. return target;
  1468. }
  1469. const targetType = getTargetType(target);
  1470. if (targetType === 0) {
  1471. return target;
  1472. }
  1473. const existingProxy = proxyMap.get(target);
  1474. if (existingProxy) {
  1475. return existingProxy;
  1476. }
  1477. const proxy = new Proxy(
  1478. target,
  1479. targetType === 2 ? collectionHandlers : baseHandlers
  1480. );
  1481. proxyMap.set(target, proxy);
  1482. return proxy;
  1483. }
  1484. function isReactive(value) {
  1485. if (isReadonly(value)) {
  1486. return isReactive(value["__v_raw"]);
  1487. }
  1488. return !!(value && value["__v_isReactive"]);
  1489. }
  1490. function isReadonly(value) {
  1491. return !!(value && value["__v_isReadonly"]);
  1492. }
  1493. function isShallow(value) {
  1494. return !!(value && value["__v_isShallow"]);
  1495. }
  1496. function isProxy(value) {
  1497. return value ? !!value["__v_raw"] : false;
  1498. }
  1499. function toRaw(observed) {
  1500. const raw = observed && observed["__v_raw"];
  1501. return raw ? toRaw(raw) : observed;
  1502. }
  1503. function markRaw(value) {
  1504. if (!hasOwn(value, "__v_skip") && Object.isExtensible(value)) {
  1505. def(value, "__v_skip", true);
  1506. }
  1507. return value;
  1508. }
  1509. const toReactive = (value) => isObject(value) ? reactive(value) : value;
  1510. const toReadonly = (value) => isObject(value) ? readonly(value) : value;
  1511. function isRef(r) {
  1512. return r ? r["__v_isRef"] === true : false;
  1513. }
  1514. function ref(value) {
  1515. return createRef(value, false);
  1516. }
  1517. function shallowRef(value) {
  1518. return createRef(value, true);
  1519. }
  1520. function createRef(rawValue, shallow) {
  1521. if (isRef(rawValue)) {
  1522. return rawValue;
  1523. }
  1524. return new RefImpl(rawValue, shallow);
  1525. }
  1526. class RefImpl {
  1527. constructor(value, isShallow2) {
  1528. this.dep = new Dep();
  1529. this["__v_isRef"] = true;
  1530. this["__v_isShallow"] = false;
  1531. this._rawValue = isShallow2 ? value : toRaw(value);
  1532. this._value = isShallow2 ? value : toReactive(value);
  1533. this["__v_isShallow"] = isShallow2;
  1534. }
  1535. get value() {
  1536. {
  1537. this.dep.track();
  1538. }
  1539. return this._value;
  1540. }
  1541. set value(newValue) {
  1542. const oldValue = this._rawValue;
  1543. const useDirectValue = this["__v_isShallow"] || isShallow(newValue) || isReadonly(newValue);
  1544. newValue = useDirectValue ? newValue : toRaw(newValue);
  1545. if (hasChanged(newValue, oldValue)) {
  1546. this._rawValue = newValue;
  1547. this._value = useDirectValue ? newValue : toReactive(newValue);
  1548. {
  1549. this.dep.trigger();
  1550. }
  1551. }
  1552. }
  1553. }
  1554. function triggerRef(ref2) {
  1555. if (ref2.dep) {
  1556. {
  1557. ref2.dep.trigger();
  1558. }
  1559. }
  1560. }
  1561. function unref(ref2) {
  1562. return isRef(ref2) ? ref2.value : ref2;
  1563. }
  1564. const shallowUnwrapHandlers = {
  1565. get: (target, key, receiver) => key === "__v_raw" ? target : unref(Reflect.get(target, key, receiver)),
  1566. set: (target, key, value, receiver) => {
  1567. const oldValue = target[key];
  1568. if (isRef(oldValue) && !isRef(value)) {
  1569. oldValue.value = value;
  1570. return true;
  1571. } else {
  1572. return Reflect.set(target, key, value, receiver);
  1573. }
  1574. }
  1575. };
  1576. function proxyRefs(objectWithRefs) {
  1577. return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
  1578. }
  1579. function toRefs(object) {
  1580. const ret = isArray$1(object) ? new Array(object.length) : {};
  1581. for (const key in object) {
  1582. ret[key] = propertyToRef(object, key);
  1583. }
  1584. return ret;
  1585. }
  1586. class ObjectRefImpl {
  1587. constructor(_object, _key, _defaultValue) {
  1588. this._object = _object;
  1589. this._key = _key;
  1590. this._defaultValue = _defaultValue;
  1591. this["__v_isRef"] = true;
  1592. this._value = void 0;
  1593. this._raw = toRaw(_object);
  1594. let shallow = true;
  1595. let obj = _object;
  1596. if (!isArray$1(_object) || !isIntegerKey(String(_key))) {
  1597. do {
  1598. shallow = !isProxy(obj) || isShallow(obj);
  1599. } while (shallow && (obj = obj["__v_raw"]));
  1600. }
  1601. this._shallow = shallow;
  1602. }
  1603. get value() {
  1604. let val = this._object[this._key];
  1605. if (this._shallow) {
  1606. val = unref(val);
  1607. }
  1608. return this._value = val === void 0 ? this._defaultValue : val;
  1609. }
  1610. set value(newVal) {
  1611. if (this._shallow && isRef(this._raw[this._key])) {
  1612. const nestedRef = this._object[this._key];
  1613. if (isRef(nestedRef)) {
  1614. nestedRef.value = newVal;
  1615. return;
  1616. }
  1617. }
  1618. this._object[this._key] = newVal;
  1619. }
  1620. get dep() {
  1621. return getDepFromReactive(this._raw, this._key);
  1622. }
  1623. }
  1624. class GetterRefImpl {
  1625. constructor(_getter) {
  1626. this._getter = _getter;
  1627. this["__v_isRef"] = true;
  1628. this["__v_isReadonly"] = true;
  1629. this._value = void 0;
  1630. }
  1631. get value() {
  1632. return this._value = this._getter();
  1633. }
  1634. }
  1635. function toRef(source, key, defaultValue) {
  1636. if (isRef(source)) {
  1637. return source;
  1638. } else if (isFunction(source)) {
  1639. return new GetterRefImpl(source);
  1640. } else if (isObject(source) && arguments.length > 1) {
  1641. return propertyToRef(source, key, defaultValue);
  1642. } else {
  1643. return ref(source);
  1644. }
  1645. }
  1646. function propertyToRef(source, key, defaultValue) {
  1647. return new ObjectRefImpl(source, key, defaultValue);
  1648. }
  1649. class ComputedRefImpl {
  1650. constructor(fn, setter, isSSR) {
  1651. this.fn = fn;
  1652. this.setter = setter;
  1653. this._value = void 0;
  1654. this.dep = new Dep(this);
  1655. this.__v_isRef = true;
  1656. this.deps = void 0;
  1657. this.depsTail = void 0;
  1658. this.flags = 16;
  1659. this.globalVersion = globalVersion - 1;
  1660. this.next = void 0;
  1661. this.effect = this;
  1662. this["__v_isReadonly"] = !setter;
  1663. this.isSSR = isSSR;
  1664. }
  1665. /**
  1666. * @internal
  1667. */
  1668. notify() {
  1669. this.flags |= 16;
  1670. if (!(this.flags & 8) && // avoid infinite self recursion
  1671. activeSub !== this) {
  1672. batch(this, true);
  1673. return true;
  1674. }
  1675. }
  1676. get value() {
  1677. const link = this.dep.track();
  1678. refreshComputed(this);
  1679. if (link) {
  1680. link.version = this.dep.version;
  1681. }
  1682. return this._value;
  1683. }
  1684. set value(newValue) {
  1685. if (this.setter) {
  1686. this.setter(newValue);
  1687. }
  1688. }
  1689. }
  1690. function computed$1(getterOrOptions, debugOptions, isSSR = false) {
  1691. let getter;
  1692. let setter;
  1693. if (isFunction(getterOrOptions)) {
  1694. getter = getterOrOptions;
  1695. } else {
  1696. getter = getterOrOptions.get;
  1697. setter = getterOrOptions.set;
  1698. }
  1699. const cRef = new ComputedRefImpl(getter, setter, isSSR);
  1700. return cRef;
  1701. }
  1702. const INITIAL_WATCHER_VALUE = {};
  1703. const cleanupMap = /* @__PURE__ */ new WeakMap();
  1704. let activeWatcher = void 0;
  1705. function onWatcherCleanup(cleanupFn, failSilently = false, owner = activeWatcher) {
  1706. if (owner) {
  1707. let cleanups = cleanupMap.get(owner);
  1708. if (!cleanups)
  1709. cleanupMap.set(owner, cleanups = []);
  1710. cleanups.push(cleanupFn);
  1711. }
  1712. }
  1713. function watch$1(source, cb, options = EMPTY_OBJ) {
  1714. const { immediate, deep, once, scheduler, augmentJob, call } = options;
  1715. const reactiveGetter = (source2) => {
  1716. if (deep)
  1717. return source2;
  1718. if (isShallow(source2) || deep === false || deep === 0)
  1719. return traverse(source2, 1);
  1720. return traverse(source2);
  1721. };
  1722. let effect;
  1723. let getter;
  1724. let cleanup;
  1725. let boundCleanup;
  1726. let forceTrigger = false;
  1727. let isMultiSource = false;
  1728. if (isRef(source)) {
  1729. getter = () => source.value;
  1730. forceTrigger = isShallow(source);
  1731. } else if (isReactive(source)) {
  1732. getter = () => reactiveGetter(source);
  1733. forceTrigger = true;
  1734. } else if (isArray$1(source)) {
  1735. isMultiSource = true;
  1736. forceTrigger = source.some((s) => isReactive(s) || isShallow(s));
  1737. getter = () => source.map((s) => {
  1738. if (isRef(s)) {
  1739. return s.value;
  1740. } else if (isReactive(s)) {
  1741. return reactiveGetter(s);
  1742. } else if (isFunction(s)) {
  1743. return call ? call(s, 2) : s();
  1744. } else
  1745. ;
  1746. });
  1747. } else if (isFunction(source)) {
  1748. if (cb) {
  1749. getter = call ? () => call(source, 2) : source;
  1750. } else {
  1751. getter = () => {
  1752. if (cleanup) {
  1753. pauseTracking();
  1754. try {
  1755. cleanup();
  1756. } finally {
  1757. resetTracking();
  1758. }
  1759. }
  1760. const currentEffect = activeWatcher;
  1761. activeWatcher = effect;
  1762. try {
  1763. return call ? call(source, 3, [boundCleanup]) : source(boundCleanup);
  1764. } finally {
  1765. activeWatcher = currentEffect;
  1766. }
  1767. };
  1768. }
  1769. } else {
  1770. getter = NOOP;
  1771. }
  1772. if (cb && deep) {
  1773. const baseGetter = getter;
  1774. const depth = deep === true ? Infinity : deep;
  1775. getter = () => traverse(baseGetter(), depth);
  1776. }
  1777. const scope = getCurrentScope();
  1778. const watchHandle = () => {
  1779. effect.stop();
  1780. if (scope && scope.active) {
  1781. remove(scope.effects, effect);
  1782. }
  1783. };
  1784. if (once && cb) {
  1785. const _cb = cb;
  1786. cb = (...args) => {
  1787. _cb(...args);
  1788. watchHandle();
  1789. };
  1790. }
  1791. let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
  1792. const job = (immediateFirstRun) => {
  1793. if (!(effect.flags & 1) || !effect.dirty && !immediateFirstRun) {
  1794. return;
  1795. }
  1796. if (cb) {
  1797. const newValue = effect.run();
  1798. if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
  1799. if (cleanup) {
  1800. cleanup();
  1801. }
  1802. const currentWatcher = activeWatcher;
  1803. activeWatcher = effect;
  1804. try {
  1805. const args = [
  1806. newValue,
  1807. // pass undefined as the old value when it's changed for the first time
  1808. oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
  1809. boundCleanup
  1810. ];
  1811. oldValue = newValue;
  1812. call ? call(cb, 3, args) : (
  1813. // @ts-expect-error
  1814. cb(...args)
  1815. );
  1816. } finally {
  1817. activeWatcher = currentWatcher;
  1818. }
  1819. }
  1820. } else {
  1821. effect.run();
  1822. }
  1823. };
  1824. if (augmentJob) {
  1825. augmentJob(job);
  1826. }
  1827. effect = new ReactiveEffect(getter);
  1828. effect.scheduler = scheduler ? () => scheduler(job, false) : job;
  1829. boundCleanup = (fn) => onWatcherCleanup(fn, false, effect);
  1830. cleanup = effect.onStop = () => {
  1831. const cleanups = cleanupMap.get(effect);
  1832. if (cleanups) {
  1833. if (call) {
  1834. call(cleanups, 4);
  1835. } else {
  1836. for (const cleanup2 of cleanups)
  1837. cleanup2();
  1838. }
  1839. cleanupMap.delete(effect);
  1840. }
  1841. };
  1842. if (cb) {
  1843. if (immediate) {
  1844. job(true);
  1845. } else {
  1846. oldValue = effect.run();
  1847. }
  1848. } else if (scheduler) {
  1849. scheduler(job.bind(null, true), true);
  1850. } else {
  1851. effect.run();
  1852. }
  1853. watchHandle.pause = effect.pause.bind(effect);
  1854. watchHandle.resume = effect.resume.bind(effect);
  1855. watchHandle.stop = watchHandle;
  1856. return watchHandle;
  1857. }
  1858. function traverse(value, depth = Infinity, seen) {
  1859. if (depth <= 0 || !isObject(value) || value["__v_skip"]) {
  1860. return value;
  1861. }
  1862. seen = seen || /* @__PURE__ */ new Map();
  1863. if ((seen.get(value) || 0) >= depth) {
  1864. return value;
  1865. }
  1866. seen.set(value, depth);
  1867. depth--;
  1868. if (isRef(value)) {
  1869. traverse(value.value, depth, seen);
  1870. } else if (isArray$1(value)) {
  1871. for (let i = 0; i < value.length; i++) {
  1872. traverse(value[i], depth, seen);
  1873. }
  1874. } else if (isSet(value) || isMap(value)) {
  1875. value.forEach((v) => {
  1876. traverse(v, depth, seen);
  1877. });
  1878. } else if (isPlainObject$1(value)) {
  1879. for (const key in value) {
  1880. traverse(value[key], depth, seen);
  1881. }
  1882. for (const key of Object.getOwnPropertySymbols(value)) {
  1883. if (Object.prototype.propertyIsEnumerable.call(value, key)) {
  1884. traverse(value[key], depth, seen);
  1885. }
  1886. }
  1887. }
  1888. return value;
  1889. }
  1890. /**
  1891. * @vue/runtime-core v3.5.26
  1892. * (c) 2018-present Yuxi (Evan) You and Vue contributors
  1893. * @license MIT
  1894. **/
  1895. const stack = [];
  1896. let isWarning = false;
  1897. function warn$1(msg, ...args) {
  1898. if (isWarning)
  1899. return;
  1900. isWarning = true;
  1901. pauseTracking();
  1902. const instance = stack.length ? stack[stack.length - 1].component : null;
  1903. const appWarnHandler = instance && instance.appContext.config.warnHandler;
  1904. const trace = getComponentTrace();
  1905. if (appWarnHandler) {
  1906. callWithErrorHandling(
  1907. appWarnHandler,
  1908. instance,
  1909. 11,
  1910. [
  1911. // eslint-disable-next-line no-restricted-syntax
  1912. msg + args.map((a) => {
  1913. var _a, _b;
  1914. return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a);
  1915. }).join(""),
  1916. instance && instance.proxy,
  1917. trace.map(
  1918. ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`
  1919. ).join("\n"),
  1920. trace
  1921. ]
  1922. );
  1923. } else {
  1924. const warnArgs = [`[Vue warn]: ${msg}`, ...args];
  1925. if (trace.length && // avoid spamming console during tests
  1926. true) {
  1927. warnArgs.push(`
  1928. `, ...formatTrace(trace));
  1929. }
  1930. console.warn(...warnArgs);
  1931. }
  1932. resetTracking();
  1933. isWarning = false;
  1934. }
  1935. function getComponentTrace() {
  1936. let currentVNode = stack[stack.length - 1];
  1937. if (!currentVNode) {
  1938. return [];
  1939. }
  1940. const normalizedStack = [];
  1941. while (currentVNode) {
  1942. const last = normalizedStack[0];
  1943. if (last && last.vnode === currentVNode) {
  1944. last.recurseCount++;
  1945. } else {
  1946. normalizedStack.push({
  1947. vnode: currentVNode,
  1948. recurseCount: 0
  1949. });
  1950. }
  1951. const parentInstance = currentVNode.component && currentVNode.component.parent;
  1952. currentVNode = parentInstance && parentInstance.vnode;
  1953. }
  1954. return normalizedStack;
  1955. }
  1956. function formatTrace(trace) {
  1957. const logs = [];
  1958. trace.forEach((entry, i) => {
  1959. logs.push(...i === 0 ? [] : [`
  1960. `], ...formatTraceEntry(entry));
  1961. });
  1962. return logs;
  1963. }
  1964. function formatTraceEntry({ vnode, recurseCount }) {
  1965. const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
  1966. const isRoot = vnode.component ? vnode.component.parent == null : false;
  1967. const open = ` at <${formatComponentName(
  1968. vnode.component,
  1969. vnode.type,
  1970. isRoot
  1971. )}`;
  1972. const close = `>` + postfix;
  1973. return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close];
  1974. }
  1975. function formatProps(props) {
  1976. const res = [];
  1977. const keys = Object.keys(props);
  1978. keys.slice(0, 3).forEach((key) => {
  1979. res.push(...formatProp(key, props[key]));
  1980. });
  1981. if (keys.length > 3) {
  1982. res.push(` ...`);
  1983. }
  1984. return res;
  1985. }
  1986. function formatProp(key, value, raw) {
  1987. if (isString(value)) {
  1988. value = JSON.stringify(value);
  1989. return raw ? value : [`${key}=${value}`];
  1990. } else if (typeof value === "number" || typeof value === "boolean" || value == null) {
  1991. return raw ? value : [`${key}=${value}`];
  1992. } else if (isRef(value)) {
  1993. value = formatProp(key, toRaw(value.value), true);
  1994. return raw ? value : [`${key}=Ref<`, value, `>`];
  1995. } else if (isFunction(value)) {
  1996. return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];
  1997. } else {
  1998. value = toRaw(value);
  1999. return raw ? value : [`${key}=`, value];
  2000. }
  2001. }
  2002. function callWithErrorHandling(fn, instance, type, args) {
  2003. try {
  2004. return args ? fn(...args) : fn();
  2005. } catch (err) {
  2006. handleError(err, instance, type);
  2007. }
  2008. }
  2009. function callWithAsyncErrorHandling(fn, instance, type, args) {
  2010. if (isFunction(fn)) {
  2011. const res = callWithErrorHandling(fn, instance, type, args);
  2012. if (res && isPromise(res)) {
  2013. res.catch((err) => {
  2014. handleError(err, instance, type);
  2015. });
  2016. }
  2017. return res;
  2018. }
  2019. if (isArray$1(fn)) {
  2020. const values = [];
  2021. for (let i = 0; i < fn.length; i++) {
  2022. values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
  2023. }
  2024. return values;
  2025. }
  2026. }
  2027. function handleError(err, instance, type, throwInDev = true) {
  2028. const contextVNode = instance ? instance.vnode : null;
  2029. const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ;
  2030. if (instance) {
  2031. let cur = instance.parent;
  2032. const exposedInstance = instance.proxy;
  2033. const errorInfo = `https://vuejs.org/error-reference/#runtime-${type}`;
  2034. while (cur) {
  2035. const errorCapturedHooks = cur.ec;
  2036. if (errorCapturedHooks) {
  2037. for (let i = 0; i < errorCapturedHooks.length; i++) {
  2038. if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
  2039. return;
  2040. }
  2041. }
  2042. }
  2043. cur = cur.parent;
  2044. }
  2045. if (errorHandler) {
  2046. pauseTracking();
  2047. callWithErrorHandling(errorHandler, null, 10, [
  2048. err,
  2049. exposedInstance,
  2050. errorInfo
  2051. ]);
  2052. resetTracking();
  2053. return;
  2054. }
  2055. }
  2056. logError(err, type, contextVNode, throwInDev, throwUnhandledErrorInProduction);
  2057. }
  2058. function logError(err, type, contextVNode, throwInDev = true, throwInProd = false) {
  2059. if (throwInProd) {
  2060. throw err;
  2061. } else {
  2062. console.error(err);
  2063. }
  2064. }
  2065. const queue = [];
  2066. let flushIndex = -1;
  2067. const pendingPostFlushCbs = [];
  2068. let activePostFlushCbs = null;
  2069. let postFlushIndex = 0;
  2070. const resolvedPromise = /* @__PURE__ */ Promise.resolve();
  2071. let currentFlushPromise = null;
  2072. function nextTick(fn) {
  2073. const p2 = currentFlushPromise || resolvedPromise;
  2074. return fn ? p2.then(this ? fn.bind(this) : fn) : p2;
  2075. }
  2076. function findInsertionIndex$1(id) {
  2077. let start = flushIndex + 1;
  2078. let end = queue.length;
  2079. while (start < end) {
  2080. const middle = start + end >>> 1;
  2081. const middleJob = queue[middle];
  2082. const middleJobId = getId(middleJob);
  2083. if (middleJobId < id || middleJobId === id && middleJob.flags & 2) {
  2084. start = middle + 1;
  2085. } else {
  2086. end = middle;
  2087. }
  2088. }
  2089. return start;
  2090. }
  2091. function queueJob(job) {
  2092. if (!(job.flags & 1)) {
  2093. const jobId = getId(job);
  2094. const lastJob = queue[queue.length - 1];
  2095. if (!lastJob || // fast path when the job id is larger than the tail
  2096. !(job.flags & 2) && jobId >= getId(lastJob)) {
  2097. queue.push(job);
  2098. } else {
  2099. queue.splice(findInsertionIndex$1(jobId), 0, job);
  2100. }
  2101. job.flags |= 1;
  2102. queueFlush();
  2103. }
  2104. }
  2105. function queueFlush() {
  2106. if (!currentFlushPromise) {
  2107. currentFlushPromise = resolvedPromise.then(flushJobs);
  2108. }
  2109. }
  2110. function queuePostFlushCb(cb) {
  2111. if (!isArray$1(cb)) {
  2112. if (activePostFlushCbs && cb.id === -1) {
  2113. activePostFlushCbs.splice(postFlushIndex + 1, 0, cb);
  2114. } else if (!(cb.flags & 1)) {
  2115. pendingPostFlushCbs.push(cb);
  2116. cb.flags |= 1;
  2117. }
  2118. } else {
  2119. pendingPostFlushCbs.push(...cb);
  2120. }
  2121. queueFlush();
  2122. }
  2123. function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
  2124. for (; i < queue.length; i++) {
  2125. const cb = queue[i];
  2126. if (cb && cb.flags & 2) {
  2127. if (instance && cb.id !== instance.uid) {
  2128. continue;
  2129. }
  2130. queue.splice(i, 1);
  2131. i--;
  2132. if (cb.flags & 4) {
  2133. cb.flags &= -2;
  2134. }
  2135. cb();
  2136. if (!(cb.flags & 4)) {
  2137. cb.flags &= -2;
  2138. }
  2139. }
  2140. }
  2141. }
  2142. function flushPostFlushCbs(seen) {
  2143. if (pendingPostFlushCbs.length) {
  2144. const deduped = [...new Set(pendingPostFlushCbs)].sort(
  2145. (a, b) => getId(a) - getId(b)
  2146. );
  2147. pendingPostFlushCbs.length = 0;
  2148. if (activePostFlushCbs) {
  2149. activePostFlushCbs.push(...deduped);
  2150. return;
  2151. }
  2152. activePostFlushCbs = deduped;
  2153. for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
  2154. const cb = activePostFlushCbs[postFlushIndex];
  2155. if (cb.flags & 4) {
  2156. cb.flags &= -2;
  2157. }
  2158. if (!(cb.flags & 8))
  2159. cb();
  2160. cb.flags &= -2;
  2161. }
  2162. activePostFlushCbs = null;
  2163. postFlushIndex = 0;
  2164. }
  2165. }
  2166. const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;
  2167. function flushJobs(seen) {
  2168. const check = NOOP;
  2169. try {
  2170. for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
  2171. const job = queue[flushIndex];
  2172. if (job && !(job.flags & 8)) {
  2173. if (false)
  2174. ;
  2175. if (job.flags & 4) {
  2176. job.flags &= ~1;
  2177. }
  2178. callWithErrorHandling(
  2179. job,
  2180. job.i,
  2181. job.i ? 15 : 14
  2182. );
  2183. if (!(job.flags & 4)) {
  2184. job.flags &= ~1;
  2185. }
  2186. }
  2187. }
  2188. } finally {
  2189. for (; flushIndex < queue.length; flushIndex++) {
  2190. const job = queue[flushIndex];
  2191. if (job) {
  2192. job.flags &= -2;
  2193. }
  2194. }
  2195. flushIndex = -1;
  2196. queue.length = 0;
  2197. flushPostFlushCbs();
  2198. currentFlushPromise = null;
  2199. if (queue.length || pendingPostFlushCbs.length) {
  2200. flushJobs();
  2201. }
  2202. }
  2203. }
  2204. let currentRenderingInstance = null;
  2205. let currentScopeId = null;
  2206. function setCurrentRenderingInstance(instance) {
  2207. const prev = currentRenderingInstance;
  2208. currentRenderingInstance = instance;
  2209. currentScopeId = instance && instance.type.__scopeId || null;
  2210. return prev;
  2211. }
  2212. function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
  2213. if (!ctx)
  2214. return fn;
  2215. if (fn._n) {
  2216. return fn;
  2217. }
  2218. const renderFnWithContext = (...args) => {
  2219. if (renderFnWithContext._d) {
  2220. setBlockTracking(-1);
  2221. }
  2222. const prevInstance = setCurrentRenderingInstance(ctx);
  2223. let res;
  2224. try {
  2225. res = fn(...args);
  2226. } finally {
  2227. setCurrentRenderingInstance(prevInstance);
  2228. if (renderFnWithContext._d) {
  2229. setBlockTracking(1);
  2230. }
  2231. }
  2232. return res;
  2233. };
  2234. renderFnWithContext._n = true;
  2235. renderFnWithContext._c = true;
  2236. renderFnWithContext._d = true;
  2237. return renderFnWithContext;
  2238. }
  2239. function withDirectives(vnode, directives) {
  2240. if (currentRenderingInstance === null) {
  2241. return vnode;
  2242. }
  2243. const instance = getComponentPublicInstance(currentRenderingInstance);
  2244. const bindings = vnode.dirs || (vnode.dirs = []);
  2245. for (let i = 0; i < directives.length; i++) {
  2246. let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];
  2247. if (dir) {
  2248. if (isFunction(dir)) {
  2249. dir = {
  2250. mounted: dir,
  2251. updated: dir
  2252. };
  2253. }
  2254. if (dir.deep) {
  2255. traverse(value);
  2256. }
  2257. bindings.push({
  2258. dir,
  2259. instance,
  2260. value,
  2261. oldValue: void 0,
  2262. arg,
  2263. modifiers
  2264. });
  2265. }
  2266. }
  2267. return vnode;
  2268. }
  2269. function invokeDirectiveHook(vnode, prevVNode, instance, name) {
  2270. const bindings = vnode.dirs;
  2271. const oldBindings = prevVNode && prevVNode.dirs;
  2272. for (let i = 0; i < bindings.length; i++) {
  2273. const binding = bindings[i];
  2274. if (oldBindings) {
  2275. binding.oldValue = oldBindings[i].value;
  2276. }
  2277. let hook = binding.dir[name];
  2278. if (hook) {
  2279. pauseTracking();
  2280. callWithAsyncErrorHandling(hook, instance, 8, [
  2281. vnode.el,
  2282. binding,
  2283. vnode,
  2284. prevVNode
  2285. ]);
  2286. resetTracking();
  2287. }
  2288. }
  2289. }
  2290. function provide(key, value) {
  2291. if (currentInstance) {
  2292. let provides = currentInstance.provides;
  2293. const parentProvides = currentInstance.parent && currentInstance.parent.provides;
  2294. if (parentProvides === provides) {
  2295. provides = currentInstance.provides = Object.create(parentProvides);
  2296. }
  2297. provides[key] = value;
  2298. }
  2299. }
  2300. function inject(key, defaultValue, treatDefaultAsFactory = false) {
  2301. const instance = getCurrentInstance();
  2302. if (instance || currentApp) {
  2303. let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
  2304. if (provides && key in provides) {
  2305. return provides[key];
  2306. } else if (arguments.length > 1) {
  2307. return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
  2308. } else
  2309. ;
  2310. }
  2311. }
  2312. function hasInjectionContext() {
  2313. return !!(getCurrentInstance() || currentApp);
  2314. }
  2315. const ssrContextKey = /* @__PURE__ */ Symbol.for("v-scx");
  2316. const useSSRContext = () => {
  2317. {
  2318. const ctx = inject(ssrContextKey);
  2319. return ctx;
  2320. }
  2321. };
  2322. function watchEffect(effect, options) {
  2323. return doWatch(effect, null, options);
  2324. }
  2325. function watch(source, cb, options) {
  2326. return doWatch(source, cb, options);
  2327. }
  2328. function doWatch(source, cb, options = EMPTY_OBJ) {
  2329. const { immediate, deep, flush, once } = options;
  2330. const baseWatchOptions = extend({}, options);
  2331. const runsImmediately = cb && immediate || !cb && flush !== "post";
  2332. let ssrCleanup;
  2333. if (isInSSRComponentSetup) {
  2334. if (flush === "sync") {
  2335. const ctx = useSSRContext();
  2336. ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
  2337. } else if (!runsImmediately) {
  2338. const watchStopHandle = () => {
  2339. };
  2340. watchStopHandle.stop = NOOP;
  2341. watchStopHandle.resume = NOOP;
  2342. watchStopHandle.pause = NOOP;
  2343. return watchStopHandle;
  2344. }
  2345. }
  2346. const instance = currentInstance;
  2347. baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
  2348. let isPre = false;
  2349. if (flush === "post") {
  2350. baseWatchOptions.scheduler = (job) => {
  2351. queuePostRenderEffect(job, instance && instance.suspense);
  2352. };
  2353. } else if (flush !== "sync") {
  2354. isPre = true;
  2355. baseWatchOptions.scheduler = (job, isFirstRun) => {
  2356. if (isFirstRun) {
  2357. job();
  2358. } else {
  2359. queueJob(job);
  2360. }
  2361. };
  2362. }
  2363. baseWatchOptions.augmentJob = (job) => {
  2364. if (cb) {
  2365. job.flags |= 4;
  2366. }
  2367. if (isPre) {
  2368. job.flags |= 2;
  2369. if (instance) {
  2370. job.id = instance.uid;
  2371. job.i = instance;
  2372. }
  2373. }
  2374. };
  2375. const watchHandle = watch$1(source, cb, baseWatchOptions);
  2376. if (isInSSRComponentSetup) {
  2377. if (ssrCleanup) {
  2378. ssrCleanup.push(watchHandle);
  2379. } else if (runsImmediately) {
  2380. watchHandle();
  2381. }
  2382. }
  2383. return watchHandle;
  2384. }
  2385. function instanceWatch(source, value, options) {
  2386. const publicThis = this.proxy;
  2387. const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
  2388. let cb;
  2389. if (isFunction(value)) {
  2390. cb = value;
  2391. } else {
  2392. cb = value.handler;
  2393. options = value;
  2394. }
  2395. const reset = setCurrentInstance(this);
  2396. const res = doWatch(getter, cb.bind(publicThis), options);
  2397. reset();
  2398. return res;
  2399. }
  2400. function createPathGetter(ctx, path) {
  2401. const segments = path.split(".");
  2402. return () => {
  2403. let cur = ctx;
  2404. for (let i = 0; i < segments.length && cur; i++) {
  2405. cur = cur[segments[i]];
  2406. }
  2407. return cur;
  2408. };
  2409. }
  2410. const TeleportEndKey = /* @__PURE__ */ Symbol("_vte");
  2411. const isTeleport = (type) => type.__isTeleport;
  2412. const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
  2413. const isTeleportDeferred = (props) => props && (props.defer || props.defer === "");
  2414. const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement;
  2415. const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement;
  2416. const resolveTarget = (props, select) => {
  2417. const targetSelector = props && props.to;
  2418. if (isString(targetSelector)) {
  2419. if (!select) {
  2420. return null;
  2421. } else {
  2422. const target = select(targetSelector);
  2423. return target;
  2424. }
  2425. } else {
  2426. return targetSelector;
  2427. }
  2428. };
  2429. const TeleportImpl = {
  2430. name: "Teleport",
  2431. __isTeleport: true,
  2432. process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
  2433. const {
  2434. mc: mountChildren,
  2435. pc: patchChildren,
  2436. pbc: patchBlockChildren,
  2437. o: { insert, querySelector, createText, createComment }
  2438. } = internals;
  2439. const disabled = isTeleportDisabled(n2.props);
  2440. let { shapeFlag, children, dynamicChildren } = n2;
  2441. if (n1 == null) {
  2442. const placeholder = n2.el = createText("");
  2443. const mainAnchor = n2.anchor = createText("");
  2444. insert(placeholder, container, anchor);
  2445. insert(mainAnchor, container, anchor);
  2446. const mount = (container2, anchor2) => {
  2447. if (shapeFlag & 16) {
  2448. mountChildren(
  2449. children,
  2450. container2,
  2451. anchor2,
  2452. parentComponent,
  2453. parentSuspense,
  2454. namespace,
  2455. slotScopeIds,
  2456. optimized
  2457. );
  2458. }
  2459. };
  2460. const mountToTarget = () => {
  2461. const target = n2.target = resolveTarget(n2.props, querySelector);
  2462. const targetAnchor = prepareAnchor(target, n2, createText, insert);
  2463. if (target) {
  2464. if (namespace !== "svg" && isTargetSVG(target)) {
  2465. namespace = "svg";
  2466. } else if (namespace !== "mathml" && isTargetMathML(target)) {
  2467. namespace = "mathml";
  2468. }
  2469. if (parentComponent && parentComponent.isCE) {
  2470. (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
  2471. }
  2472. if (!disabled) {
  2473. mount(target, targetAnchor);
  2474. updateCssVars(n2, false);
  2475. }
  2476. }
  2477. };
  2478. if (disabled) {
  2479. mount(container, mainAnchor);
  2480. updateCssVars(n2, true);
  2481. }
  2482. if (isTeleportDeferred(n2.props)) {
  2483. n2.el.__isMounted = false;
  2484. queuePostRenderEffect(() => {
  2485. mountToTarget();
  2486. delete n2.el.__isMounted;
  2487. }, parentSuspense);
  2488. } else {
  2489. mountToTarget();
  2490. }
  2491. } else {
  2492. if (isTeleportDeferred(n2.props) && n1.el.__isMounted === false) {
  2493. queuePostRenderEffect(() => {
  2494. TeleportImpl.process(
  2495. n1,
  2496. n2,
  2497. container,
  2498. anchor,
  2499. parentComponent,
  2500. parentSuspense,
  2501. namespace,
  2502. slotScopeIds,
  2503. optimized,
  2504. internals
  2505. );
  2506. }, parentSuspense);
  2507. return;
  2508. }
  2509. n2.el = n1.el;
  2510. n2.targetStart = n1.targetStart;
  2511. const mainAnchor = n2.anchor = n1.anchor;
  2512. const target = n2.target = n1.target;
  2513. const targetAnchor = n2.targetAnchor = n1.targetAnchor;
  2514. const wasDisabled = isTeleportDisabled(n1.props);
  2515. const currentContainer = wasDisabled ? container : target;
  2516. const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
  2517. if (namespace === "svg" || isTargetSVG(target)) {
  2518. namespace = "svg";
  2519. } else if (namespace === "mathml" || isTargetMathML(target)) {
  2520. namespace = "mathml";
  2521. }
  2522. if (dynamicChildren) {
  2523. patchBlockChildren(
  2524. n1.dynamicChildren,
  2525. dynamicChildren,
  2526. currentContainer,
  2527. parentComponent,
  2528. parentSuspense,
  2529. namespace,
  2530. slotScopeIds
  2531. );
  2532. traverseStaticChildren(n1, n2, true);
  2533. } else if (!optimized) {
  2534. patchChildren(
  2535. n1,
  2536. n2,
  2537. currentContainer,
  2538. currentAnchor,
  2539. parentComponent,
  2540. parentSuspense,
  2541. namespace,
  2542. slotScopeIds,
  2543. false
  2544. );
  2545. }
  2546. if (disabled) {
  2547. if (!wasDisabled) {
  2548. moveTeleport(
  2549. n2,
  2550. container,
  2551. mainAnchor,
  2552. internals,
  2553. 1
  2554. );
  2555. } else {
  2556. if (n2.props && n1.props && n2.props.to !== n1.props.to) {
  2557. n2.props.to = n1.props.to;
  2558. }
  2559. }
  2560. } else {
  2561. if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
  2562. const nextTarget = n2.target = resolveTarget(
  2563. n2.props,
  2564. querySelector
  2565. );
  2566. if (nextTarget) {
  2567. moveTeleport(
  2568. n2,
  2569. nextTarget,
  2570. null,
  2571. internals,
  2572. 0
  2573. );
  2574. }
  2575. } else if (wasDisabled) {
  2576. moveTeleport(
  2577. n2,
  2578. target,
  2579. targetAnchor,
  2580. internals,
  2581. 1
  2582. );
  2583. }
  2584. }
  2585. updateCssVars(n2, disabled);
  2586. }
  2587. },
  2588. remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
  2589. const {
  2590. shapeFlag,
  2591. children,
  2592. anchor,
  2593. targetStart,
  2594. targetAnchor,
  2595. target,
  2596. props
  2597. } = vnode;
  2598. if (target) {
  2599. hostRemove(targetStart);
  2600. hostRemove(targetAnchor);
  2601. }
  2602. doRemove && hostRemove(anchor);
  2603. if (shapeFlag & 16) {
  2604. const shouldRemove = doRemove || !isTeleportDisabled(props);
  2605. for (let i = 0; i < children.length; i++) {
  2606. const child = children[i];
  2607. unmount(
  2608. child,
  2609. parentComponent,
  2610. parentSuspense,
  2611. shouldRemove,
  2612. !!child.dynamicChildren
  2613. );
  2614. }
  2615. }
  2616. },
  2617. move: moveTeleport,
  2618. hydrate: hydrateTeleport
  2619. };
  2620. function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) {
  2621. if (moveType === 0) {
  2622. insert(vnode.targetAnchor, container, parentAnchor);
  2623. }
  2624. const { el, anchor, shapeFlag, children, props } = vnode;
  2625. const isReorder = moveType === 2;
  2626. if (isReorder) {
  2627. insert(el, container, parentAnchor);
  2628. }
  2629. if (!isReorder || isTeleportDisabled(props)) {
  2630. if (shapeFlag & 16) {
  2631. for (let i = 0; i < children.length; i++) {
  2632. move(
  2633. children[i],
  2634. container,
  2635. parentAnchor,
  2636. 2
  2637. );
  2638. }
  2639. }
  2640. }
  2641. if (isReorder) {
  2642. insert(anchor, container, parentAnchor);
  2643. }
  2644. }
  2645. function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
  2646. o: { nextSibling, parentNode, querySelector, insert, createText }
  2647. }, hydrateChildren) {
  2648. function hydrateDisabledTeleport(node2, vnode2, targetStart, targetAnchor) {
  2649. vnode2.anchor = hydrateChildren(
  2650. nextSibling(node2),
  2651. vnode2,
  2652. parentNode(node2),
  2653. parentComponent,
  2654. parentSuspense,
  2655. slotScopeIds,
  2656. optimized
  2657. );
  2658. vnode2.targetStart = targetStart;
  2659. vnode2.targetAnchor = targetAnchor;
  2660. }
  2661. const target = vnode.target = resolveTarget(
  2662. vnode.props,
  2663. querySelector
  2664. );
  2665. const disabled = isTeleportDisabled(vnode.props);
  2666. if (target) {
  2667. const targetNode = target._lpa || target.firstChild;
  2668. if (vnode.shapeFlag & 16) {
  2669. if (disabled) {
  2670. hydrateDisabledTeleport(
  2671. node,
  2672. vnode,
  2673. targetNode,
  2674. targetNode && nextSibling(targetNode)
  2675. );
  2676. } else {
  2677. vnode.anchor = nextSibling(node);
  2678. let targetAnchor = targetNode;
  2679. while (targetAnchor) {
  2680. if (targetAnchor && targetAnchor.nodeType === 8) {
  2681. if (targetAnchor.data === "teleport start anchor") {
  2682. vnode.targetStart = targetAnchor;
  2683. } else if (targetAnchor.data === "teleport anchor") {
  2684. vnode.targetAnchor = targetAnchor;
  2685. target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
  2686. break;
  2687. }
  2688. }
  2689. targetAnchor = nextSibling(targetAnchor);
  2690. }
  2691. if (!vnode.targetAnchor) {
  2692. prepareAnchor(target, vnode, createText, insert);
  2693. }
  2694. hydrateChildren(
  2695. targetNode && nextSibling(targetNode),
  2696. vnode,
  2697. target,
  2698. parentComponent,
  2699. parentSuspense,
  2700. slotScopeIds,
  2701. optimized
  2702. );
  2703. }
  2704. }
  2705. updateCssVars(vnode, disabled);
  2706. } else if (disabled) {
  2707. if (vnode.shapeFlag & 16) {
  2708. hydrateDisabledTeleport(node, vnode, node, nextSibling(node));
  2709. }
  2710. }
  2711. return vnode.anchor && nextSibling(vnode.anchor);
  2712. }
  2713. const Teleport = TeleportImpl;
  2714. function updateCssVars(vnode, isDisabled) {
  2715. const ctx = vnode.ctx;
  2716. if (ctx && ctx.ut) {
  2717. let node, anchor;
  2718. if (isDisabled) {
  2719. node = vnode.el;
  2720. anchor = vnode.anchor;
  2721. } else {
  2722. node = vnode.targetStart;
  2723. anchor = vnode.targetAnchor;
  2724. }
  2725. while (node && node !== anchor) {
  2726. if (node.nodeType === 1)
  2727. node.setAttribute("data-v-owner", ctx.uid);
  2728. node = node.nextSibling;
  2729. }
  2730. ctx.ut();
  2731. }
  2732. }
  2733. function prepareAnchor(target, vnode, createText, insert) {
  2734. const targetStart = vnode.targetStart = createText("");
  2735. const targetAnchor = vnode.targetAnchor = createText("");
  2736. targetStart[TeleportEndKey] = targetAnchor;
  2737. if (target) {
  2738. insert(targetStart, target);
  2739. insert(targetAnchor, target);
  2740. }
  2741. return targetAnchor;
  2742. }
  2743. const leaveCbKey = /* @__PURE__ */ Symbol("_leaveCb");
  2744. const enterCbKey$1 = /* @__PURE__ */ Symbol("_enterCb");
  2745. function useTransitionState() {
  2746. const state = {
  2747. isMounted: false,
  2748. isLeaving: false,
  2749. isUnmounting: false,
  2750. leavingVNodes: /* @__PURE__ */ new Map()
  2751. };
  2752. onMounted(() => {
  2753. state.isMounted = true;
  2754. });
  2755. onBeforeUnmount(() => {
  2756. state.isUnmounting = true;
  2757. });
  2758. return state;
  2759. }
  2760. const TransitionHookValidator = [Function, Array];
  2761. const BaseTransitionPropsValidators = {
  2762. mode: String,
  2763. appear: Boolean,
  2764. persisted: Boolean,
  2765. // enter
  2766. onBeforeEnter: TransitionHookValidator,
  2767. onEnter: TransitionHookValidator,
  2768. onAfterEnter: TransitionHookValidator,
  2769. onEnterCancelled: TransitionHookValidator,
  2770. // leave
  2771. onBeforeLeave: TransitionHookValidator,
  2772. onLeave: TransitionHookValidator,
  2773. onAfterLeave: TransitionHookValidator,
  2774. onLeaveCancelled: TransitionHookValidator,
  2775. // appear
  2776. onBeforeAppear: TransitionHookValidator,
  2777. onAppear: TransitionHookValidator,
  2778. onAfterAppear: TransitionHookValidator,
  2779. onAppearCancelled: TransitionHookValidator
  2780. };
  2781. const recursiveGetSubtree = (instance) => {
  2782. const subTree = instance.subTree;
  2783. return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
  2784. };
  2785. const BaseTransitionImpl = {
  2786. name: `BaseTransition`,
  2787. props: BaseTransitionPropsValidators,
  2788. setup(props, { slots }) {
  2789. const instance = getCurrentInstance();
  2790. const state = useTransitionState();
  2791. return () => {
  2792. const children = slots.default && getTransitionRawChildren(slots.default(), true);
  2793. if (!children || !children.length) {
  2794. return;
  2795. }
  2796. const child = findNonCommentChild(children);
  2797. const rawProps = toRaw(props);
  2798. const { mode } = rawProps;
  2799. if (state.isLeaving) {
  2800. return emptyPlaceholder(child);
  2801. }
  2802. const innerChild = getInnerChild$1(child);
  2803. if (!innerChild) {
  2804. return emptyPlaceholder(child);
  2805. }
  2806. let enterHooks = resolveTransitionHooks(
  2807. innerChild,
  2808. rawProps,
  2809. state,
  2810. instance,
  2811. // #11061, ensure enterHooks is fresh after clone
  2812. (hooks) => enterHooks = hooks
  2813. );
  2814. if (innerChild.type !== Comment) {
  2815. setTransitionHooks(innerChild, enterHooks);
  2816. }
  2817. let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
  2818. if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
  2819. let leavingHooks = resolveTransitionHooks(
  2820. oldInnerChild,
  2821. rawProps,
  2822. state,
  2823. instance
  2824. );
  2825. setTransitionHooks(oldInnerChild, leavingHooks);
  2826. if (mode === "out-in" && innerChild.type !== Comment) {
  2827. state.isLeaving = true;
  2828. leavingHooks.afterLeave = () => {
  2829. state.isLeaving = false;
  2830. if (!(instance.job.flags & 8)) {
  2831. instance.update();
  2832. }
  2833. delete leavingHooks.afterLeave;
  2834. oldInnerChild = void 0;
  2835. };
  2836. return emptyPlaceholder(child);
  2837. } else if (mode === "in-out" && innerChild.type !== Comment) {
  2838. leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
  2839. const leavingVNodesCache = getLeavingNodesForType(
  2840. state,
  2841. oldInnerChild
  2842. );
  2843. leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
  2844. el[leaveCbKey] = () => {
  2845. earlyRemove();
  2846. el[leaveCbKey] = void 0;
  2847. delete enterHooks.delayedLeave;
  2848. oldInnerChild = void 0;
  2849. };
  2850. enterHooks.delayedLeave = () => {
  2851. delayedLeave();
  2852. delete enterHooks.delayedLeave;
  2853. oldInnerChild = void 0;
  2854. };
  2855. };
  2856. } else {
  2857. oldInnerChild = void 0;
  2858. }
  2859. } else if (oldInnerChild) {
  2860. oldInnerChild = void 0;
  2861. }
  2862. return child;
  2863. };
  2864. }
  2865. };
  2866. function findNonCommentChild(children) {
  2867. let child = children[0];
  2868. if (children.length > 1) {
  2869. for (const c of children) {
  2870. if (c.type !== Comment) {
  2871. child = c;
  2872. break;
  2873. }
  2874. }
  2875. }
  2876. return child;
  2877. }
  2878. const BaseTransition = BaseTransitionImpl;
  2879. function getLeavingNodesForType(state, vnode) {
  2880. const { leavingVNodes } = state;
  2881. let leavingVNodesCache = leavingVNodes.get(vnode.type);
  2882. if (!leavingVNodesCache) {
  2883. leavingVNodesCache = /* @__PURE__ */ Object.create(null);
  2884. leavingVNodes.set(vnode.type, leavingVNodesCache);
  2885. }
  2886. return leavingVNodesCache;
  2887. }
  2888. function resolveTransitionHooks(vnode, props, state, instance, postClone) {
  2889. const {
  2890. appear,
  2891. mode,
  2892. persisted = false,
  2893. onBeforeEnter,
  2894. onEnter,
  2895. onAfterEnter,
  2896. onEnterCancelled,
  2897. onBeforeLeave,
  2898. onLeave,
  2899. onAfterLeave,
  2900. onLeaveCancelled,
  2901. onBeforeAppear,
  2902. onAppear,
  2903. onAfterAppear,
  2904. onAppearCancelled
  2905. } = props;
  2906. const key = String(vnode.key);
  2907. const leavingVNodesCache = getLeavingNodesForType(state, vnode);
  2908. const callHook2 = (hook, args) => {
  2909. hook && callWithAsyncErrorHandling(
  2910. hook,
  2911. instance,
  2912. 9,
  2913. args
  2914. );
  2915. };
  2916. const callAsyncHook = (hook, args) => {
  2917. const done = args[1];
  2918. callHook2(hook, args);
  2919. if (isArray$1(hook)) {
  2920. if (hook.every((hook2) => hook2.length <= 1))
  2921. done();
  2922. } else if (hook.length <= 1) {
  2923. done();
  2924. }
  2925. };
  2926. const hooks = {
  2927. mode,
  2928. persisted,
  2929. beforeEnter(el) {
  2930. let hook = onBeforeEnter;
  2931. if (!state.isMounted) {
  2932. if (appear) {
  2933. hook = onBeforeAppear || onBeforeEnter;
  2934. } else {
  2935. return;
  2936. }
  2937. }
  2938. if (el[leaveCbKey]) {
  2939. el[leaveCbKey](
  2940. true
  2941. /* cancelled */
  2942. );
  2943. }
  2944. const leavingVNode = leavingVNodesCache[key];
  2945. if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
  2946. leavingVNode.el[leaveCbKey]();
  2947. }
  2948. callHook2(hook, [el]);
  2949. },
  2950. enter(el) {
  2951. let hook = onEnter;
  2952. let afterHook = onAfterEnter;
  2953. let cancelHook = onEnterCancelled;
  2954. if (!state.isMounted) {
  2955. if (appear) {
  2956. hook = onAppear || onEnter;
  2957. afterHook = onAfterAppear || onAfterEnter;
  2958. cancelHook = onAppearCancelled || onEnterCancelled;
  2959. } else {
  2960. return;
  2961. }
  2962. }
  2963. let called = false;
  2964. const done = el[enterCbKey$1] = (cancelled) => {
  2965. if (called)
  2966. return;
  2967. called = true;
  2968. if (cancelled) {
  2969. callHook2(cancelHook, [el]);
  2970. } else {
  2971. callHook2(afterHook, [el]);
  2972. }
  2973. if (hooks.delayedLeave) {
  2974. hooks.delayedLeave();
  2975. }
  2976. el[enterCbKey$1] = void 0;
  2977. };
  2978. if (hook) {
  2979. callAsyncHook(hook, [el, done]);
  2980. } else {
  2981. done();
  2982. }
  2983. },
  2984. leave(el, remove2) {
  2985. const key2 = String(vnode.key);
  2986. if (el[enterCbKey$1]) {
  2987. el[enterCbKey$1](
  2988. true
  2989. /* cancelled */
  2990. );
  2991. }
  2992. if (state.isUnmounting) {
  2993. return remove2();
  2994. }
  2995. callHook2(onBeforeLeave, [el]);
  2996. let called = false;
  2997. const done = el[leaveCbKey] = (cancelled) => {
  2998. if (called)
  2999. return;
  3000. called = true;
  3001. remove2();
  3002. if (cancelled) {
  3003. callHook2(onLeaveCancelled, [el]);
  3004. } else {
  3005. callHook2(onAfterLeave, [el]);
  3006. }
  3007. el[leaveCbKey] = void 0;
  3008. if (leavingVNodesCache[key2] === vnode) {
  3009. delete leavingVNodesCache[key2];
  3010. }
  3011. };
  3012. leavingVNodesCache[key2] = vnode;
  3013. if (onLeave) {
  3014. callAsyncHook(onLeave, [el, done]);
  3015. } else {
  3016. done();
  3017. }
  3018. },
  3019. clone(vnode2) {
  3020. const hooks2 = resolveTransitionHooks(
  3021. vnode2,
  3022. props,
  3023. state,
  3024. instance,
  3025. postClone
  3026. );
  3027. if (postClone)
  3028. postClone(hooks2);
  3029. return hooks2;
  3030. }
  3031. };
  3032. return hooks;
  3033. }
  3034. function emptyPlaceholder(vnode) {
  3035. if (isKeepAlive(vnode)) {
  3036. vnode = cloneVNode(vnode);
  3037. vnode.children = null;
  3038. return vnode;
  3039. }
  3040. }
  3041. function getInnerChild$1(vnode) {
  3042. if (!isKeepAlive(vnode)) {
  3043. if (isTeleport(vnode.type) && vnode.children) {
  3044. return findNonCommentChild(vnode.children);
  3045. }
  3046. return vnode;
  3047. }
  3048. if (vnode.component) {
  3049. return vnode.component.subTree;
  3050. }
  3051. const { shapeFlag, children } = vnode;
  3052. if (children) {
  3053. if (shapeFlag & 16) {
  3054. return children[0];
  3055. }
  3056. if (shapeFlag & 32 && isFunction(children.default)) {
  3057. return children.default();
  3058. }
  3059. }
  3060. }
  3061. function setTransitionHooks(vnode, hooks) {
  3062. if (vnode.shapeFlag & 6 && vnode.component) {
  3063. vnode.transition = hooks;
  3064. setTransitionHooks(vnode.component.subTree, hooks);
  3065. } else if (vnode.shapeFlag & 128) {
  3066. vnode.ssContent.transition = hooks.clone(vnode.ssContent);
  3067. vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
  3068. } else {
  3069. vnode.transition = hooks;
  3070. }
  3071. }
  3072. function getTransitionRawChildren(children, keepComment = false, parentKey) {
  3073. let ret = [];
  3074. let keyedFragmentCount = 0;
  3075. for (let i = 0; i < children.length; i++) {
  3076. let child = children[i];
  3077. const key = parentKey == null ? child.key : String(parentKey) + String(child.key != null ? child.key : i);
  3078. if (child.type === Fragment) {
  3079. if (child.patchFlag & 128)
  3080. keyedFragmentCount++;
  3081. ret = ret.concat(
  3082. getTransitionRawChildren(child.children, keepComment, key)
  3083. );
  3084. } else if (keepComment || child.type !== Comment) {
  3085. ret.push(key != null ? cloneVNode(child, { key }) : child);
  3086. }
  3087. }
  3088. if (keyedFragmentCount > 1) {
  3089. for (let i = 0; i < ret.length; i++) {
  3090. ret[i].patchFlag = -2;
  3091. }
  3092. }
  3093. return ret;
  3094. }
  3095. // @__NO_SIDE_EFFECTS__
  3096. function defineComponent(options, extraOptions) {
  3097. return isFunction(options) ? (
  3098. // #8236: extend call and options.name access are considered side-effects
  3099. // by Rollup, so we have to wrap it in a pure-annotated IIFE.
  3100. /* @__PURE__ */ (() => extend({ name: options.name }, extraOptions, { setup: options }))()
  3101. ) : options;
  3102. }
  3103. function markAsyncBoundary(instance) {
  3104. instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0];
  3105. }
  3106. const pendingSetRefMap = /* @__PURE__ */ new WeakMap();
  3107. function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
  3108. if (isArray$1(rawRef)) {
  3109. rawRef.forEach(
  3110. (r, i) => setRef(
  3111. r,
  3112. oldRawRef && (isArray$1(oldRawRef) ? oldRawRef[i] : oldRawRef),
  3113. parentSuspense,
  3114. vnode,
  3115. isUnmount
  3116. )
  3117. );
  3118. return;
  3119. }
  3120. if (isAsyncWrapper(vnode) && !isUnmount) {
  3121. if (vnode.shapeFlag & 512 && vnode.type.__asyncResolved && vnode.component.subTree.component) {
  3122. setRef(rawRef, oldRawRef, parentSuspense, vnode.component.subTree);
  3123. }
  3124. return;
  3125. }
  3126. const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el;
  3127. const value = isUnmount ? null : refValue;
  3128. const { i: owner, r: ref2 } = rawRef;
  3129. const oldRef = oldRawRef && oldRawRef.r;
  3130. const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
  3131. const setupState = owner.setupState;
  3132. const rawSetupState = toRaw(setupState);
  3133. const canSetSetupRef = setupState === EMPTY_OBJ ? NO : (key) => {
  3134. return hasOwn(rawSetupState, key);
  3135. };
  3136. if (oldRef != null && oldRef !== ref2) {
  3137. invalidatePendingSetRef(oldRawRef);
  3138. if (isString(oldRef)) {
  3139. refs[oldRef] = null;
  3140. if (canSetSetupRef(oldRef)) {
  3141. setupState[oldRef] = null;
  3142. }
  3143. } else if (isRef(oldRef)) {
  3144. {
  3145. oldRef.value = null;
  3146. }
  3147. const oldRawRefAtom = oldRawRef;
  3148. if (oldRawRefAtom.k)
  3149. refs[oldRawRefAtom.k] = null;
  3150. }
  3151. }
  3152. if (isFunction(ref2)) {
  3153. callWithErrorHandling(ref2, owner, 12, [value, refs]);
  3154. } else {
  3155. const _isString = isString(ref2);
  3156. const _isRef = isRef(ref2);
  3157. if (_isString || _isRef) {
  3158. const doSet = () => {
  3159. if (rawRef.f) {
  3160. const existing = _isString ? canSetSetupRef(ref2) ? setupState[ref2] : refs[ref2] : ref2.value;
  3161. if (isUnmount) {
  3162. isArray$1(existing) && remove(existing, refValue);
  3163. } else {
  3164. if (!isArray$1(existing)) {
  3165. if (_isString) {
  3166. refs[ref2] = [refValue];
  3167. if (canSetSetupRef(ref2)) {
  3168. setupState[ref2] = refs[ref2];
  3169. }
  3170. } else {
  3171. const newVal = [refValue];
  3172. {
  3173. ref2.value = newVal;
  3174. }
  3175. if (rawRef.k)
  3176. refs[rawRef.k] = newVal;
  3177. }
  3178. } else if (!existing.includes(refValue)) {
  3179. existing.push(refValue);
  3180. }
  3181. }
  3182. } else if (_isString) {
  3183. refs[ref2] = value;
  3184. if (canSetSetupRef(ref2)) {
  3185. setupState[ref2] = value;
  3186. }
  3187. } else if (_isRef) {
  3188. {
  3189. ref2.value = value;
  3190. }
  3191. if (rawRef.k)
  3192. refs[rawRef.k] = value;
  3193. } else
  3194. ;
  3195. };
  3196. if (value) {
  3197. const job = () => {
  3198. doSet();
  3199. pendingSetRefMap.delete(rawRef);
  3200. };
  3201. job.id = -1;
  3202. pendingSetRefMap.set(rawRef, job);
  3203. queuePostRenderEffect(job, parentSuspense);
  3204. } else {
  3205. invalidatePendingSetRef(rawRef);
  3206. doSet();
  3207. }
  3208. }
  3209. }
  3210. }
  3211. function invalidatePendingSetRef(rawRef) {
  3212. const pendingSetRef = pendingSetRefMap.get(rawRef);
  3213. if (pendingSetRef) {
  3214. pendingSetRef.flags |= 8;
  3215. pendingSetRefMap.delete(rawRef);
  3216. }
  3217. }
  3218. getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1));
  3219. getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id));
  3220. const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
  3221. const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
  3222. function onActivated(hook, target) {
  3223. registerKeepAliveHook(hook, "a", target);
  3224. }
  3225. function onDeactivated(hook, target) {
  3226. registerKeepAliveHook(hook, "da", target);
  3227. }
  3228. function registerKeepAliveHook(hook, type, target = currentInstance) {
  3229. const wrappedHook = hook.__wdc || (hook.__wdc = () => {
  3230. let current = target;
  3231. while (current) {
  3232. if (current.isDeactivated) {
  3233. return;
  3234. }
  3235. current = current.parent;
  3236. }
  3237. return hook();
  3238. });
  3239. injectHook(type, wrappedHook, target);
  3240. if (target) {
  3241. let current = target.parent;
  3242. while (current && current.parent) {
  3243. if (isKeepAlive(current.parent.vnode)) {
  3244. injectToKeepAliveRoot(wrappedHook, type, target, current);
  3245. }
  3246. current = current.parent;
  3247. }
  3248. }
  3249. }
  3250. function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
  3251. const injected = injectHook(
  3252. type,
  3253. hook,
  3254. keepAliveRoot,
  3255. true
  3256. /* prepend */
  3257. );
  3258. onUnmounted(() => {
  3259. remove(keepAliveRoot[type], injected);
  3260. }, target);
  3261. }
  3262. function injectHook(type, hook, target = currentInstance, prepend = false) {
  3263. if (target) {
  3264. const hooks = target[type] || (target[type] = []);
  3265. const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
  3266. pauseTracking();
  3267. const reset = setCurrentInstance(target);
  3268. const res = callWithAsyncErrorHandling(hook, target, type, args);
  3269. reset();
  3270. resetTracking();
  3271. return res;
  3272. });
  3273. if (prepend) {
  3274. hooks.unshift(wrappedHook);
  3275. } else {
  3276. hooks.push(wrappedHook);
  3277. }
  3278. return wrappedHook;
  3279. }
  3280. }
  3281. const createHook = (lifecycle) => (hook, target = currentInstance) => {
  3282. if (!isInSSRComponentSetup || lifecycle === "sp") {
  3283. injectHook(lifecycle, (...args) => hook(...args), target);
  3284. }
  3285. };
  3286. const onBeforeMount = createHook("bm");
  3287. const onMounted = createHook("m");
  3288. const onBeforeUpdate = createHook(
  3289. "bu"
  3290. );
  3291. const onUpdated = createHook("u");
  3292. const onBeforeUnmount = createHook(
  3293. "bum"
  3294. );
  3295. const onUnmounted = createHook("um");
  3296. const onServerPrefetch = createHook(
  3297. "sp"
  3298. );
  3299. const onRenderTriggered = createHook("rtg");
  3300. const onRenderTracked = createHook("rtc");
  3301. function onErrorCaptured(hook, target = currentInstance) {
  3302. injectHook("ec", hook, target);
  3303. }
  3304. const COMPONENTS = "components";
  3305. const DIRECTIVES = "directives";
  3306. function resolveComponent(name, maybeSelfReference) {
  3307. return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
  3308. }
  3309. const NULL_DYNAMIC_COMPONENT = /* @__PURE__ */ Symbol.for("v-ndc");
  3310. function resolveDynamicComponent(component) {
  3311. if (isString(component)) {
  3312. return resolveAsset(COMPONENTS, component, false) || component;
  3313. } else {
  3314. return component || NULL_DYNAMIC_COMPONENT;
  3315. }
  3316. }
  3317. function resolveDirective(name) {
  3318. return resolveAsset(DIRECTIVES, name);
  3319. }
  3320. function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
  3321. const instance = currentRenderingInstance || currentInstance;
  3322. if (instance) {
  3323. const Component = instance.type;
  3324. if (type === COMPONENTS) {
  3325. const selfName = getComponentName(
  3326. Component,
  3327. false
  3328. );
  3329. if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) {
  3330. return Component;
  3331. }
  3332. }
  3333. const res = (
  3334. // local registration
  3335. // check instance[type] first which is resolved for options API
  3336. resolve(instance[type] || Component[type], name) || // global registration
  3337. resolve(instance.appContext[type], name)
  3338. );
  3339. if (!res && maybeSelfReference) {
  3340. return Component;
  3341. }
  3342. return res;
  3343. }
  3344. }
  3345. function resolve(registry, name) {
  3346. return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]);
  3347. }
  3348. function renderList(source, renderItem, cache, index) {
  3349. let ret;
  3350. const cached = cache && cache[index];
  3351. const sourceIsArray = isArray$1(source);
  3352. if (sourceIsArray || isString(source)) {
  3353. const sourceIsReactiveArray = sourceIsArray && isReactive(source);
  3354. let needsWrap = false;
  3355. let isReadonlySource = false;
  3356. if (sourceIsReactiveArray) {
  3357. needsWrap = !isShallow(source);
  3358. isReadonlySource = isReadonly(source);
  3359. source = shallowReadArray(source);
  3360. }
  3361. ret = new Array(source.length);
  3362. for (let i = 0, l = source.length; i < l; i++) {
  3363. ret[i] = renderItem(
  3364. needsWrap ? isReadonlySource ? toReadonly(toReactive(source[i])) : toReactive(source[i]) : source[i],
  3365. i,
  3366. void 0,
  3367. cached && cached[i]
  3368. );
  3369. }
  3370. } else if (typeof source === "number") {
  3371. ret = new Array(source);
  3372. for (let i = 0; i < source; i++) {
  3373. ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
  3374. }
  3375. } else if (isObject(source)) {
  3376. if (source[Symbol.iterator]) {
  3377. ret = Array.from(
  3378. source,
  3379. (item, i) => renderItem(item, i, void 0, cached && cached[i])
  3380. );
  3381. } else {
  3382. const keys = Object.keys(source);
  3383. ret = new Array(keys.length);
  3384. for (let i = 0, l = keys.length; i < l; i++) {
  3385. const key = keys[i];
  3386. ret[i] = renderItem(source[key], key, i, cached && cached[i]);
  3387. }
  3388. }
  3389. } else {
  3390. ret = [];
  3391. }
  3392. if (cache) {
  3393. cache[index] = ret;
  3394. }
  3395. return ret;
  3396. }
  3397. function createSlots(slots, dynamicSlots) {
  3398. for (let i = 0; i < dynamicSlots.length; i++) {
  3399. const slot = dynamicSlots[i];
  3400. if (isArray$1(slot)) {
  3401. for (let j = 0; j < slot.length; j++) {
  3402. slots[slot[j].name] = slot[j].fn;
  3403. }
  3404. } else if (slot) {
  3405. slots[slot.name] = slot.key ? (...args) => {
  3406. const res = slot.fn(...args);
  3407. if (res)
  3408. res.key = slot.key;
  3409. return res;
  3410. } : slot.fn;
  3411. }
  3412. }
  3413. return slots;
  3414. }
  3415. function renderSlot(slots, name, props = {}, fallback, noSlotted) {
  3416. if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
  3417. const hasProps = Object.keys(props).length > 0;
  3418. if (name !== "default")
  3419. props.name = name;
  3420. return openBlock(), createBlock(
  3421. Fragment,
  3422. null,
  3423. [createVNode("slot", props, fallback && fallback())],
  3424. hasProps ? -2 : 64
  3425. );
  3426. }
  3427. let slot = slots[name];
  3428. if (slot && slot._c) {
  3429. slot._d = false;
  3430. }
  3431. openBlock();
  3432. const validSlotContent = slot && ensureValidVNode(slot(props));
  3433. const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
  3434. // key attached in the `createSlots` helper, respect that
  3435. validSlotContent && validSlotContent.key;
  3436. const rendered = createBlock(
  3437. Fragment,
  3438. {
  3439. key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
  3440. (!validSlotContent && fallback ? "_fb" : "")
  3441. },
  3442. validSlotContent || (fallback ? fallback() : []),
  3443. validSlotContent && slots._ === 1 ? 64 : -2
  3444. );
  3445. if (!noSlotted && rendered.scopeId) {
  3446. rendered.slotScopeIds = [rendered.scopeId + "-s"];
  3447. }
  3448. if (slot && slot._c) {
  3449. slot._d = true;
  3450. }
  3451. return rendered;
  3452. }
  3453. function ensureValidVNode(vnodes) {
  3454. return vnodes.some((child) => {
  3455. if (!isVNode(child))
  3456. return true;
  3457. if (child.type === Comment)
  3458. return false;
  3459. if (child.type === Fragment && !ensureValidVNode(child.children))
  3460. return false;
  3461. return true;
  3462. }) ? vnodes : null;
  3463. }
  3464. function toHandlers(obj, preserveCaseIfNecessary) {
  3465. const ret = {};
  3466. for (const key in obj) {
  3467. ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : toHandlerKey(key)] = obj[key];
  3468. }
  3469. return ret;
  3470. }
  3471. const getPublicInstance = (i) => {
  3472. if (!i)
  3473. return null;
  3474. if (isStatefulComponent(i))
  3475. return getComponentPublicInstance(i);
  3476. return getPublicInstance(i.parent);
  3477. };
  3478. const publicPropertiesMap = (
  3479. // Move PURE marker to new line to workaround compiler discarding it
  3480. // due to type annotation
  3481. /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), {
  3482. $: (i) => i,
  3483. $el: (i) => i.vnode.el,
  3484. $data: (i) => i.data,
  3485. $props: (i) => i.props,
  3486. $attrs: (i) => i.attrs,
  3487. $slots: (i) => i.slots,
  3488. $refs: (i) => i.refs,
  3489. $parent: (i) => getPublicInstance(i.parent),
  3490. $root: (i) => getPublicInstance(i.root),
  3491. $host: (i) => i.ce,
  3492. $emit: (i) => i.emit,
  3493. $options: (i) => resolveMergedOptions(i),
  3494. $forceUpdate: (i) => i.f || (i.f = () => {
  3495. queueJob(i.update);
  3496. }),
  3497. $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)),
  3498. $watch: (i) => instanceWatch.bind(i)
  3499. })
  3500. );
  3501. const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
  3502. const PublicInstanceProxyHandlers = {
  3503. get({ _: instance }, key) {
  3504. if (key === "__v_skip") {
  3505. return true;
  3506. }
  3507. const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
  3508. if (key[0] !== "$") {
  3509. const n = accessCache[key];
  3510. if (n !== void 0) {
  3511. switch (n) {
  3512. case 1:
  3513. return setupState[key];
  3514. case 2:
  3515. return data[key];
  3516. case 4:
  3517. return ctx[key];
  3518. case 3:
  3519. return props[key];
  3520. }
  3521. } else if (hasSetupBinding(setupState, key)) {
  3522. accessCache[key] = 1;
  3523. return setupState[key];
  3524. } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
  3525. accessCache[key] = 2;
  3526. return data[key];
  3527. } else if (hasOwn(props, key)) {
  3528. accessCache[key] = 3;
  3529. return props[key];
  3530. } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
  3531. accessCache[key] = 4;
  3532. return ctx[key];
  3533. } else if (shouldCacheAccess) {
  3534. accessCache[key] = 0;
  3535. }
  3536. }
  3537. const publicGetter = publicPropertiesMap[key];
  3538. let cssModule, globalProperties;
  3539. if (publicGetter) {
  3540. if (key === "$attrs") {
  3541. track(instance.attrs, "get", "");
  3542. }
  3543. return publicGetter(instance);
  3544. } else if (
  3545. // css module (injected by vue-loader)
  3546. (cssModule = type.__cssModules) && (cssModule = cssModule[key])
  3547. ) {
  3548. return cssModule;
  3549. } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
  3550. accessCache[key] = 4;
  3551. return ctx[key];
  3552. } else if (
  3553. // global properties
  3554. globalProperties = appContext.config.globalProperties, hasOwn(globalProperties, key)
  3555. ) {
  3556. {
  3557. return globalProperties[key];
  3558. }
  3559. } else
  3560. ;
  3561. },
  3562. set({ _: instance }, key, value) {
  3563. const { data, setupState, ctx } = instance;
  3564. if (hasSetupBinding(setupState, key)) {
  3565. setupState[key] = value;
  3566. return true;
  3567. } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
  3568. data[key] = value;
  3569. return true;
  3570. } else if (hasOwn(instance.props, key)) {
  3571. return false;
  3572. }
  3573. if (key[0] === "$" && key.slice(1) in instance) {
  3574. return false;
  3575. } else {
  3576. {
  3577. ctx[key] = value;
  3578. }
  3579. }
  3580. return true;
  3581. },
  3582. has({
  3583. _: { data, setupState, accessCache, ctx, appContext, props, type }
  3584. }, key) {
  3585. let cssModules;
  3586. return !!(accessCache[key] || data !== EMPTY_OBJ && key[0] !== "$" && hasOwn(data, key) || hasSetupBinding(setupState, key) || hasOwn(props, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key) || (cssModules = type.__cssModules) && cssModules[key]);
  3587. },
  3588. defineProperty(target, key, descriptor) {
  3589. if (descriptor.get != null) {
  3590. target._.accessCache[key] = 0;
  3591. } else if (hasOwn(descriptor, "value")) {
  3592. this.set(target, key, descriptor.value, null);
  3593. }
  3594. return Reflect.defineProperty(target, key, descriptor);
  3595. }
  3596. };
  3597. function useSlots() {
  3598. return getContext().slots;
  3599. }
  3600. function useAttrs() {
  3601. return getContext().attrs;
  3602. }
  3603. function getContext(calledFunctionName) {
  3604. const i = getCurrentInstance();
  3605. return i.setupContext || (i.setupContext = createSetupContext(i));
  3606. }
  3607. function normalizePropsOrEmits(props) {
  3608. return isArray$1(props) ? props.reduce(
  3609. (normalized, p2) => (normalized[p2] = null, normalized),
  3610. {}
  3611. ) : props;
  3612. }
  3613. let shouldCacheAccess = true;
  3614. function applyOptions(instance) {
  3615. const options = resolveMergedOptions(instance);
  3616. const publicThis = instance.proxy;
  3617. const ctx = instance.ctx;
  3618. shouldCacheAccess = false;
  3619. if (options.beforeCreate) {
  3620. callHook$1(options.beforeCreate, instance, "bc");
  3621. }
  3622. const {
  3623. // state
  3624. data: dataOptions,
  3625. computed: computedOptions,
  3626. methods,
  3627. watch: watchOptions,
  3628. provide: provideOptions,
  3629. inject: injectOptions,
  3630. // lifecycle
  3631. created,
  3632. beforeMount,
  3633. mounted,
  3634. beforeUpdate,
  3635. updated,
  3636. activated,
  3637. deactivated,
  3638. beforeDestroy,
  3639. beforeUnmount,
  3640. destroyed,
  3641. unmounted,
  3642. render: render2,
  3643. renderTracked,
  3644. renderTriggered,
  3645. errorCaptured,
  3646. serverPrefetch,
  3647. // public API
  3648. expose,
  3649. inheritAttrs,
  3650. // assets
  3651. components,
  3652. directives,
  3653. filters
  3654. } = options;
  3655. const checkDuplicateProperties = null;
  3656. if (injectOptions) {
  3657. resolveInjections(injectOptions, ctx, checkDuplicateProperties);
  3658. }
  3659. if (methods) {
  3660. for (const key in methods) {
  3661. const methodHandler = methods[key];
  3662. if (isFunction(methodHandler)) {
  3663. {
  3664. ctx[key] = methodHandler.bind(publicThis);
  3665. }
  3666. }
  3667. }
  3668. }
  3669. if (dataOptions) {
  3670. const data = dataOptions.call(publicThis, publicThis);
  3671. if (!isObject(data))
  3672. ;
  3673. else {
  3674. instance.data = reactive(data);
  3675. }
  3676. }
  3677. shouldCacheAccess = true;
  3678. if (computedOptions) {
  3679. for (const key in computedOptions) {
  3680. const opt = computedOptions[key];
  3681. const get = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
  3682. const set = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : NOOP;
  3683. const c = computed({
  3684. get,
  3685. set
  3686. });
  3687. Object.defineProperty(ctx, key, {
  3688. enumerable: true,
  3689. configurable: true,
  3690. get: () => c.value,
  3691. set: (v) => c.value = v
  3692. });
  3693. }
  3694. }
  3695. if (watchOptions) {
  3696. for (const key in watchOptions) {
  3697. createWatcher(watchOptions[key], ctx, publicThis, key);
  3698. }
  3699. }
  3700. if (provideOptions) {
  3701. const provides = isFunction(provideOptions) ? provideOptions.call(publicThis) : provideOptions;
  3702. Reflect.ownKeys(provides).forEach((key) => {
  3703. provide(key, provides[key]);
  3704. });
  3705. }
  3706. if (created) {
  3707. callHook$1(created, instance, "c");
  3708. }
  3709. function registerLifecycleHook(register, hook) {
  3710. if (isArray$1(hook)) {
  3711. hook.forEach((_hook) => register(_hook.bind(publicThis)));
  3712. } else if (hook) {
  3713. register(hook.bind(publicThis));
  3714. }
  3715. }
  3716. registerLifecycleHook(onBeforeMount, beforeMount);
  3717. registerLifecycleHook(onMounted, mounted);
  3718. registerLifecycleHook(onBeforeUpdate, beforeUpdate);
  3719. registerLifecycleHook(onUpdated, updated);
  3720. registerLifecycleHook(onActivated, activated);
  3721. registerLifecycleHook(onDeactivated, deactivated);
  3722. registerLifecycleHook(onErrorCaptured, errorCaptured);
  3723. registerLifecycleHook(onRenderTracked, renderTracked);
  3724. registerLifecycleHook(onRenderTriggered, renderTriggered);
  3725. registerLifecycleHook(onBeforeUnmount, beforeUnmount);
  3726. registerLifecycleHook(onUnmounted, unmounted);
  3727. registerLifecycleHook(onServerPrefetch, serverPrefetch);
  3728. if (isArray$1(expose)) {
  3729. if (expose.length) {
  3730. const exposed = instance.exposed || (instance.exposed = {});
  3731. expose.forEach((key) => {
  3732. Object.defineProperty(exposed, key, {
  3733. get: () => publicThis[key],
  3734. set: (val) => publicThis[key] = val,
  3735. enumerable: true
  3736. });
  3737. });
  3738. } else if (!instance.exposed) {
  3739. instance.exposed = {};
  3740. }
  3741. }
  3742. if (render2 && instance.render === NOOP) {
  3743. instance.render = render2;
  3744. }
  3745. if (inheritAttrs != null) {
  3746. instance.inheritAttrs = inheritAttrs;
  3747. }
  3748. if (components)
  3749. instance.components = components;
  3750. if (directives)
  3751. instance.directives = directives;
  3752. if (serverPrefetch) {
  3753. markAsyncBoundary(instance);
  3754. }
  3755. }
  3756. function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP) {
  3757. if (isArray$1(injectOptions)) {
  3758. injectOptions = normalizeInject(injectOptions);
  3759. }
  3760. for (const key in injectOptions) {
  3761. const opt = injectOptions[key];
  3762. let injected;
  3763. if (isObject(opt)) {
  3764. if ("default" in opt) {
  3765. injected = inject(
  3766. opt.from || key,
  3767. opt.default,
  3768. true
  3769. );
  3770. } else {
  3771. injected = inject(opt.from || key);
  3772. }
  3773. } else {
  3774. injected = inject(opt);
  3775. }
  3776. if (isRef(injected)) {
  3777. Object.defineProperty(ctx, key, {
  3778. enumerable: true,
  3779. configurable: true,
  3780. get: () => injected.value,
  3781. set: (v) => injected.value = v
  3782. });
  3783. } else {
  3784. ctx[key] = injected;
  3785. }
  3786. }
  3787. }
  3788. function callHook$1(hook, instance, type) {
  3789. callWithAsyncErrorHandling(
  3790. isArray$1(hook) ? hook.map((h2) => h2.bind(instance.proxy)) : hook.bind(instance.proxy),
  3791. instance,
  3792. type
  3793. );
  3794. }
  3795. function createWatcher(raw, ctx, publicThis, key) {
  3796. let getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key];
  3797. if (isString(raw)) {
  3798. const handler = ctx[raw];
  3799. if (isFunction(handler)) {
  3800. {
  3801. watch(getter, handler);
  3802. }
  3803. }
  3804. } else if (isFunction(raw)) {
  3805. {
  3806. watch(getter, raw.bind(publicThis));
  3807. }
  3808. } else if (isObject(raw)) {
  3809. if (isArray$1(raw)) {
  3810. raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
  3811. } else {
  3812. const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
  3813. if (isFunction(handler)) {
  3814. watch(getter, handler, raw);
  3815. }
  3816. }
  3817. } else
  3818. ;
  3819. }
  3820. function resolveMergedOptions(instance) {
  3821. const base = instance.type;
  3822. const { mixins, extends: extendsOptions } = base;
  3823. const {
  3824. mixins: globalMixins,
  3825. optionsCache: cache,
  3826. config: { optionMergeStrategies }
  3827. } = instance.appContext;
  3828. const cached = cache.get(base);
  3829. let resolved;
  3830. if (cached) {
  3831. resolved = cached;
  3832. } else if (!globalMixins.length && !mixins && !extendsOptions) {
  3833. {
  3834. resolved = base;
  3835. }
  3836. } else {
  3837. resolved = {};
  3838. if (globalMixins.length) {
  3839. globalMixins.forEach(
  3840. (m) => mergeOptions$1(resolved, m, optionMergeStrategies, true)
  3841. );
  3842. }
  3843. mergeOptions$1(resolved, base, optionMergeStrategies);
  3844. }
  3845. if (isObject(base)) {
  3846. cache.set(base, resolved);
  3847. }
  3848. return resolved;
  3849. }
  3850. function mergeOptions$1(to, from, strats, asMixin = false) {
  3851. const { mixins, extends: extendsOptions } = from;
  3852. if (extendsOptions) {
  3853. mergeOptions$1(to, extendsOptions, strats, true);
  3854. }
  3855. if (mixins) {
  3856. mixins.forEach(
  3857. (m) => mergeOptions$1(to, m, strats, true)
  3858. );
  3859. }
  3860. for (const key in from) {
  3861. if (asMixin && key === "expose")
  3862. ;
  3863. else {
  3864. const strat = internalOptionMergeStrats[key] || strats && strats[key];
  3865. to[key] = strat ? strat(to[key], from[key]) : from[key];
  3866. }
  3867. }
  3868. return to;
  3869. }
  3870. const internalOptionMergeStrats = {
  3871. data: mergeDataFn,
  3872. props: mergeEmitsOrPropsOptions,
  3873. emits: mergeEmitsOrPropsOptions,
  3874. // objects
  3875. methods: mergeObjectOptions,
  3876. computed: mergeObjectOptions,
  3877. // lifecycle
  3878. beforeCreate: mergeAsArray,
  3879. created: mergeAsArray,
  3880. beforeMount: mergeAsArray,
  3881. mounted: mergeAsArray,
  3882. beforeUpdate: mergeAsArray,
  3883. updated: mergeAsArray,
  3884. beforeDestroy: mergeAsArray,
  3885. beforeUnmount: mergeAsArray,
  3886. destroyed: mergeAsArray,
  3887. unmounted: mergeAsArray,
  3888. activated: mergeAsArray,
  3889. deactivated: mergeAsArray,
  3890. errorCaptured: mergeAsArray,
  3891. serverPrefetch: mergeAsArray,
  3892. // assets
  3893. components: mergeObjectOptions,
  3894. directives: mergeObjectOptions,
  3895. // watch
  3896. watch: mergeWatchOptions,
  3897. // provide / inject
  3898. provide: mergeDataFn,
  3899. inject: mergeInject
  3900. };
  3901. function mergeDataFn(to, from) {
  3902. if (!from) {
  3903. return to;
  3904. }
  3905. if (!to) {
  3906. return from;
  3907. }
  3908. return function mergedDataFn() {
  3909. return extend(
  3910. isFunction(to) ? to.call(this, this) : to,
  3911. isFunction(from) ? from.call(this, this) : from
  3912. );
  3913. };
  3914. }
  3915. function mergeInject(to, from) {
  3916. return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
  3917. }
  3918. function normalizeInject(raw) {
  3919. if (isArray$1(raw)) {
  3920. const res = {};
  3921. for (let i = 0; i < raw.length; i++) {
  3922. res[raw[i]] = raw[i];
  3923. }
  3924. return res;
  3925. }
  3926. return raw;
  3927. }
  3928. function mergeAsArray(to, from) {
  3929. return to ? [...new Set([].concat(to, from))] : from;
  3930. }
  3931. function mergeObjectOptions(to, from) {
  3932. return to ? extend(/* @__PURE__ */ Object.create(null), to, from) : from;
  3933. }
  3934. function mergeEmitsOrPropsOptions(to, from) {
  3935. if (to) {
  3936. if (isArray$1(to) && isArray$1(from)) {
  3937. return [.../* @__PURE__ */ new Set([...to, ...from])];
  3938. }
  3939. return extend(
  3940. /* @__PURE__ */ Object.create(null),
  3941. normalizePropsOrEmits(to),
  3942. normalizePropsOrEmits(from != null ? from : {})
  3943. );
  3944. } else {
  3945. return from;
  3946. }
  3947. }
  3948. function mergeWatchOptions(to, from) {
  3949. if (!to)
  3950. return from;
  3951. if (!from)
  3952. return to;
  3953. const merged = extend(/* @__PURE__ */ Object.create(null), to);
  3954. for (const key in from) {
  3955. merged[key] = mergeAsArray(to[key], from[key]);
  3956. }
  3957. return merged;
  3958. }
  3959. function createAppContext() {
  3960. return {
  3961. app: null,
  3962. config: {
  3963. isNativeTag: NO,
  3964. performance: false,
  3965. globalProperties: {},
  3966. optionMergeStrategies: {},
  3967. errorHandler: void 0,
  3968. warnHandler: void 0,
  3969. compilerOptions: {}
  3970. },
  3971. mixins: [],
  3972. components: {},
  3973. directives: {},
  3974. provides: /* @__PURE__ */ Object.create(null),
  3975. optionsCache: /* @__PURE__ */ new WeakMap(),
  3976. propsCache: /* @__PURE__ */ new WeakMap(),
  3977. emitsCache: /* @__PURE__ */ new WeakMap()
  3978. };
  3979. }
  3980. let uid$1 = 0;
  3981. function createAppAPI(render2, hydrate) {
  3982. return function createApp2(rootComponent, rootProps = null) {
  3983. if (!isFunction(rootComponent)) {
  3984. rootComponent = extend({}, rootComponent);
  3985. }
  3986. if (rootProps != null && !isObject(rootProps)) {
  3987. rootProps = null;
  3988. }
  3989. const context = createAppContext();
  3990. const installedPlugins = /* @__PURE__ */ new WeakSet();
  3991. const pluginCleanupFns = [];
  3992. let isMounted = false;
  3993. const app = context.app = {
  3994. _uid: uid$1++,
  3995. _component: rootComponent,
  3996. _props: rootProps,
  3997. _container: null,
  3998. _context: context,
  3999. _instance: null,
  4000. version,
  4001. get config() {
  4002. return context.config;
  4003. },
  4004. set config(v) {
  4005. },
  4006. use(plugin, ...options) {
  4007. if (installedPlugins.has(plugin))
  4008. ;
  4009. else if (plugin && isFunction(plugin.install)) {
  4010. installedPlugins.add(plugin);
  4011. plugin.install(app, ...options);
  4012. } else if (isFunction(plugin)) {
  4013. installedPlugins.add(plugin);
  4014. plugin(app, ...options);
  4015. } else
  4016. ;
  4017. return app;
  4018. },
  4019. mixin(mixin) {
  4020. {
  4021. if (!context.mixins.includes(mixin)) {
  4022. context.mixins.push(mixin);
  4023. }
  4024. }
  4025. return app;
  4026. },
  4027. component(name, component) {
  4028. if (!component) {
  4029. return context.components[name];
  4030. }
  4031. context.components[name] = component;
  4032. return app;
  4033. },
  4034. directive(name, directive) {
  4035. if (!directive) {
  4036. return context.directives[name];
  4037. }
  4038. context.directives[name] = directive;
  4039. return app;
  4040. },
  4041. mount(rootContainer, isHydrate, namespace) {
  4042. if (!isMounted) {
  4043. const vnode = app._ceVNode || createVNode(rootComponent, rootProps);
  4044. vnode.appContext = context;
  4045. if (namespace === true) {
  4046. namespace = "svg";
  4047. } else if (namespace === false) {
  4048. namespace = void 0;
  4049. }
  4050. if (isHydrate && hydrate) {
  4051. hydrate(vnode, rootContainer);
  4052. } else {
  4053. render2(vnode, rootContainer, namespace);
  4054. }
  4055. isMounted = true;
  4056. app._container = rootContainer;
  4057. rootContainer.__vue_app__ = app;
  4058. return getComponentPublicInstance(vnode.component);
  4059. }
  4060. },
  4061. onUnmount(cleanupFn) {
  4062. pluginCleanupFns.push(cleanupFn);
  4063. },
  4064. unmount() {
  4065. if (isMounted) {
  4066. callWithAsyncErrorHandling(
  4067. pluginCleanupFns,
  4068. app._instance,
  4069. 16
  4070. );
  4071. render2(null, app._container);
  4072. delete app._container.__vue_app__;
  4073. }
  4074. },
  4075. provide(key, value) {
  4076. context.provides[key] = value;
  4077. return app;
  4078. },
  4079. runWithContext(fn) {
  4080. const lastApp = currentApp;
  4081. currentApp = app;
  4082. try {
  4083. return fn();
  4084. } finally {
  4085. currentApp = lastApp;
  4086. }
  4087. }
  4088. };
  4089. return app;
  4090. };
  4091. }
  4092. let currentApp = null;
  4093. const getModelModifiers = (props, modelName) => {
  4094. return modelName === "modelValue" || modelName === "model-value" ? props.modelModifiers : props[`${modelName}Modifiers`] || props[`${camelize(modelName)}Modifiers`] || props[`${hyphenate(modelName)}Modifiers`];
  4095. };
  4096. function emit(instance, event, ...rawArgs) {
  4097. if (instance.isUnmounted)
  4098. return;
  4099. const props = instance.vnode.props || EMPTY_OBJ;
  4100. let args = rawArgs;
  4101. const isModelListener2 = event.startsWith("update:");
  4102. const modifiers = isModelListener2 && getModelModifiers(props, event.slice(7));
  4103. if (modifiers) {
  4104. if (modifiers.trim) {
  4105. args = rawArgs.map((a) => isString(a) ? a.trim() : a);
  4106. }
  4107. if (modifiers.number) {
  4108. args = rawArgs.map(looseToNumber);
  4109. }
  4110. }
  4111. let handlerName;
  4112. let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249)
  4113. props[handlerName = toHandlerKey(camelize(event))];
  4114. if (!handler && isModelListener2) {
  4115. handler = props[handlerName = toHandlerKey(hyphenate(event))];
  4116. }
  4117. if (handler) {
  4118. callWithAsyncErrorHandling(
  4119. handler,
  4120. instance,
  4121. 6,
  4122. args
  4123. );
  4124. }
  4125. const onceHandler = props[handlerName + `Once`];
  4126. if (onceHandler) {
  4127. if (!instance.emitted) {
  4128. instance.emitted = {};
  4129. } else if (instance.emitted[handlerName]) {
  4130. return;
  4131. }
  4132. instance.emitted[handlerName] = true;
  4133. callWithAsyncErrorHandling(
  4134. onceHandler,
  4135. instance,
  4136. 6,
  4137. args
  4138. );
  4139. }
  4140. }
  4141. const mixinEmitsCache = /* @__PURE__ */ new WeakMap();
  4142. function normalizeEmitsOptions(comp, appContext, asMixin = false) {
  4143. const cache = asMixin ? mixinEmitsCache : appContext.emitsCache;
  4144. const cached = cache.get(comp);
  4145. if (cached !== void 0) {
  4146. return cached;
  4147. }
  4148. const raw = comp.emits;
  4149. let normalized = {};
  4150. let hasExtends = false;
  4151. if (!isFunction(comp)) {
  4152. const extendEmits = (raw2) => {
  4153. const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
  4154. if (normalizedFromExtend) {
  4155. hasExtends = true;
  4156. extend(normalized, normalizedFromExtend);
  4157. }
  4158. };
  4159. if (!asMixin && appContext.mixins.length) {
  4160. appContext.mixins.forEach(extendEmits);
  4161. }
  4162. if (comp.extends) {
  4163. extendEmits(comp.extends);
  4164. }
  4165. if (comp.mixins) {
  4166. comp.mixins.forEach(extendEmits);
  4167. }
  4168. }
  4169. if (!raw && !hasExtends) {
  4170. if (isObject(comp)) {
  4171. cache.set(comp, null);
  4172. }
  4173. return null;
  4174. }
  4175. if (isArray$1(raw)) {
  4176. raw.forEach((key) => normalized[key] = null);
  4177. } else {
  4178. extend(normalized, raw);
  4179. }
  4180. if (isObject(comp)) {
  4181. cache.set(comp, normalized);
  4182. }
  4183. return normalized;
  4184. }
  4185. function isEmitListener(options, key) {
  4186. if (!options || !isOn(key)) {
  4187. return false;
  4188. }
  4189. key = key.slice(2).replace(/Once$/, "");
  4190. return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
  4191. }
  4192. function markAttrsAccessed() {
  4193. }
  4194. function renderComponentRoot(instance) {
  4195. const {
  4196. type: Component,
  4197. vnode,
  4198. proxy,
  4199. withProxy,
  4200. propsOptions: [propsOptions],
  4201. slots,
  4202. attrs,
  4203. emit: emit2,
  4204. render: render2,
  4205. renderCache,
  4206. props,
  4207. data,
  4208. setupState,
  4209. ctx,
  4210. inheritAttrs
  4211. } = instance;
  4212. const prev = setCurrentRenderingInstance(instance);
  4213. let result;
  4214. let fallthroughAttrs;
  4215. try {
  4216. if (vnode.shapeFlag & 4) {
  4217. const proxyToUse = withProxy || proxy;
  4218. const thisProxy = false ? new Proxy(proxyToUse, {
  4219. get(target, key, receiver) {
  4220. warn$1(
  4221. `Property '${String(
  4222. key
  4223. )}' was accessed via 'this'. Avoid using 'this' in templates.`
  4224. );
  4225. return Reflect.get(target, key, receiver);
  4226. }
  4227. }) : proxyToUse;
  4228. result = normalizeVNode(
  4229. render2.call(
  4230. thisProxy,
  4231. proxyToUse,
  4232. renderCache,
  4233. false ? shallowReadonly(props) : props,
  4234. setupState,
  4235. data,
  4236. ctx
  4237. )
  4238. );
  4239. fallthroughAttrs = attrs;
  4240. } else {
  4241. const render22 = Component;
  4242. if (false)
  4243. ;
  4244. result = normalizeVNode(
  4245. render22.length > 1 ? render22(
  4246. false ? shallowReadonly(props) : props,
  4247. false ? {
  4248. get attrs() {
  4249. markAttrsAccessed();
  4250. return shallowReadonly(attrs);
  4251. },
  4252. slots,
  4253. emit: emit2
  4254. } : { attrs, slots, emit: emit2 }
  4255. ) : render22(
  4256. false ? shallowReadonly(props) : props,
  4257. null
  4258. )
  4259. );
  4260. fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs);
  4261. }
  4262. } catch (err) {
  4263. blockStack.length = 0;
  4264. handleError(err, instance, 1);
  4265. result = createVNode(Comment);
  4266. }
  4267. let root = result;
  4268. if (fallthroughAttrs && inheritAttrs !== false) {
  4269. const keys = Object.keys(fallthroughAttrs);
  4270. const { shapeFlag } = root;
  4271. if (keys.length) {
  4272. if (shapeFlag & (1 | 6)) {
  4273. if (propsOptions && keys.some(isModelListener)) {
  4274. fallthroughAttrs = filterModelListeners(
  4275. fallthroughAttrs,
  4276. propsOptions
  4277. );
  4278. }
  4279. root = cloneVNode(root, fallthroughAttrs, false, true);
  4280. }
  4281. }
  4282. }
  4283. if (vnode.dirs) {
  4284. root = cloneVNode(root, null, false, true);
  4285. root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
  4286. }
  4287. if (vnode.transition) {
  4288. setTransitionHooks(root, vnode.transition);
  4289. }
  4290. {
  4291. result = root;
  4292. }
  4293. setCurrentRenderingInstance(prev);
  4294. return result;
  4295. }
  4296. const getFunctionalFallthrough = (attrs) => {
  4297. let res;
  4298. for (const key in attrs) {
  4299. if (key === "class" || key === "style" || isOn(key)) {
  4300. (res || (res = {}))[key] = attrs[key];
  4301. }
  4302. }
  4303. return res;
  4304. };
  4305. const filterModelListeners = (attrs, props) => {
  4306. const res = {};
  4307. for (const key in attrs) {
  4308. if (!isModelListener(key) || !(key.slice(9) in props)) {
  4309. res[key] = attrs[key];
  4310. }
  4311. }
  4312. return res;
  4313. };
  4314. function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
  4315. const { props: prevProps, children: prevChildren, component } = prevVNode;
  4316. const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;
  4317. const emits = component.emitsOptions;
  4318. if (nextVNode.dirs || nextVNode.transition) {
  4319. return true;
  4320. }
  4321. if (optimized && patchFlag >= 0) {
  4322. if (patchFlag & 1024) {
  4323. return true;
  4324. }
  4325. if (patchFlag & 16) {
  4326. if (!prevProps) {
  4327. return !!nextProps;
  4328. }
  4329. return hasPropsChanged(prevProps, nextProps, emits);
  4330. } else if (patchFlag & 8) {
  4331. const dynamicProps = nextVNode.dynamicProps;
  4332. for (let i = 0; i < dynamicProps.length; i++) {
  4333. const key = dynamicProps[i];
  4334. if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) {
  4335. return true;
  4336. }
  4337. }
  4338. }
  4339. } else {
  4340. if (prevChildren || nextChildren) {
  4341. if (!nextChildren || !nextChildren.$stable) {
  4342. return true;
  4343. }
  4344. }
  4345. if (prevProps === nextProps) {
  4346. return false;
  4347. }
  4348. if (!prevProps) {
  4349. return !!nextProps;
  4350. }
  4351. if (!nextProps) {
  4352. return true;
  4353. }
  4354. return hasPropsChanged(prevProps, nextProps, emits);
  4355. }
  4356. return false;
  4357. }
  4358. function hasPropsChanged(prevProps, nextProps, emitsOptions) {
  4359. const nextKeys = Object.keys(nextProps);
  4360. if (nextKeys.length !== Object.keys(prevProps).length) {
  4361. return true;
  4362. }
  4363. for (let i = 0; i < nextKeys.length; i++) {
  4364. const key = nextKeys[i];
  4365. if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) {
  4366. return true;
  4367. }
  4368. }
  4369. return false;
  4370. }
  4371. function updateHOCHostEl({ vnode, parent }, el) {
  4372. while (parent) {
  4373. const root = parent.subTree;
  4374. if (root.suspense && root.suspense.activeBranch === vnode) {
  4375. root.el = vnode.el;
  4376. }
  4377. if (root === vnode) {
  4378. (vnode = parent.vnode).el = el;
  4379. parent = parent.parent;
  4380. } else {
  4381. break;
  4382. }
  4383. }
  4384. }
  4385. const internalObjectProto = {};
  4386. const createInternalObject = () => Object.create(internalObjectProto);
  4387. const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
  4388. function initProps(instance, rawProps, isStateful, isSSR = false) {
  4389. const props = {};
  4390. const attrs = createInternalObject();
  4391. instance.propsDefaults = /* @__PURE__ */ Object.create(null);
  4392. setFullProps(instance, rawProps, props, attrs);
  4393. for (const key in instance.propsOptions[0]) {
  4394. if (!(key in props)) {
  4395. props[key] = void 0;
  4396. }
  4397. }
  4398. if (isStateful) {
  4399. instance.props = isSSR ? props : shallowReactive(props);
  4400. } else {
  4401. if (!instance.type.props) {
  4402. instance.props = attrs;
  4403. } else {
  4404. instance.props = props;
  4405. }
  4406. }
  4407. instance.attrs = attrs;
  4408. }
  4409. function updateProps(instance, rawProps, rawPrevProps, optimized) {
  4410. const {
  4411. props,
  4412. attrs,
  4413. vnode: { patchFlag }
  4414. } = instance;
  4415. const rawCurrentProps = toRaw(props);
  4416. const [options] = instance.propsOptions;
  4417. let hasAttrsChanged = false;
  4418. if (
  4419. // always force full diff in dev
  4420. // - #1942 if hmr is enabled with sfc component
  4421. // - vite#872 non-sfc component used by sfc component
  4422. (optimized || patchFlag > 0) && !(patchFlag & 16)
  4423. ) {
  4424. if (patchFlag & 8) {
  4425. const propsToUpdate = instance.vnode.dynamicProps;
  4426. for (let i = 0; i < propsToUpdate.length; i++) {
  4427. let key = propsToUpdate[i];
  4428. if (isEmitListener(instance.emitsOptions, key)) {
  4429. continue;
  4430. }
  4431. const value = rawProps[key];
  4432. if (options) {
  4433. if (hasOwn(attrs, key)) {
  4434. if (value !== attrs[key]) {
  4435. attrs[key] = value;
  4436. hasAttrsChanged = true;
  4437. }
  4438. } else {
  4439. const camelizedKey = camelize(key);
  4440. props[camelizedKey] = resolvePropValue(
  4441. options,
  4442. rawCurrentProps,
  4443. camelizedKey,
  4444. value,
  4445. instance,
  4446. false
  4447. );
  4448. }
  4449. } else {
  4450. if (value !== attrs[key]) {
  4451. attrs[key] = value;
  4452. hasAttrsChanged = true;
  4453. }
  4454. }
  4455. }
  4456. }
  4457. } else {
  4458. if (setFullProps(instance, rawProps, props, attrs)) {
  4459. hasAttrsChanged = true;
  4460. }
  4461. let kebabKey;
  4462. for (const key in rawCurrentProps) {
  4463. if (!rawProps || // for camelCase
  4464. !hasOwn(rawProps, key) && // it's possible the original props was passed in as kebab-case
  4465. // and converted to camelCase (#955)
  4466. ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) {
  4467. if (options) {
  4468. if (rawPrevProps && // for camelCase
  4469. (rawPrevProps[key] !== void 0 || // for kebab-case
  4470. rawPrevProps[kebabKey] !== void 0)) {
  4471. props[key] = resolvePropValue(
  4472. options,
  4473. rawCurrentProps,
  4474. key,
  4475. void 0,
  4476. instance,
  4477. true
  4478. );
  4479. }
  4480. } else {
  4481. delete props[key];
  4482. }
  4483. }
  4484. }
  4485. if (attrs !== rawCurrentProps) {
  4486. for (const key in attrs) {
  4487. if (!rawProps || !hasOwn(rawProps, key) && true) {
  4488. delete attrs[key];
  4489. hasAttrsChanged = true;
  4490. }
  4491. }
  4492. }
  4493. }
  4494. if (hasAttrsChanged) {
  4495. trigger(instance.attrs, "set", "");
  4496. }
  4497. }
  4498. function setFullProps(instance, rawProps, props, attrs) {
  4499. const [options, needCastKeys] = instance.propsOptions;
  4500. let hasAttrsChanged = false;
  4501. let rawCastValues;
  4502. if (rawProps) {
  4503. for (let key in rawProps) {
  4504. if (isReservedProp(key)) {
  4505. continue;
  4506. }
  4507. const value = rawProps[key];
  4508. let camelKey;
  4509. if (options && hasOwn(options, camelKey = camelize(key))) {
  4510. if (!needCastKeys || !needCastKeys.includes(camelKey)) {
  4511. props[camelKey] = value;
  4512. } else {
  4513. (rawCastValues || (rawCastValues = {}))[camelKey] = value;
  4514. }
  4515. } else if (!isEmitListener(instance.emitsOptions, key)) {
  4516. if (!(key in attrs) || value !== attrs[key]) {
  4517. attrs[key] = value;
  4518. hasAttrsChanged = true;
  4519. }
  4520. }
  4521. }
  4522. }
  4523. if (needCastKeys) {
  4524. const rawCurrentProps = toRaw(props);
  4525. const castValues = rawCastValues || EMPTY_OBJ;
  4526. for (let i = 0; i < needCastKeys.length; i++) {
  4527. const key = needCastKeys[i];
  4528. props[key] = resolvePropValue(
  4529. options,
  4530. rawCurrentProps,
  4531. key,
  4532. castValues[key],
  4533. instance,
  4534. !hasOwn(castValues, key)
  4535. );
  4536. }
  4537. }
  4538. return hasAttrsChanged;
  4539. }
  4540. function resolvePropValue(options, props, key, value, instance, isAbsent) {
  4541. const opt = options[key];
  4542. if (opt != null) {
  4543. const hasDefault = hasOwn(opt, "default");
  4544. if (hasDefault && value === void 0) {
  4545. const defaultValue = opt.default;
  4546. if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) {
  4547. const { propsDefaults } = instance;
  4548. if (key in propsDefaults) {
  4549. value = propsDefaults[key];
  4550. } else {
  4551. const reset = setCurrentInstance(instance);
  4552. value = propsDefaults[key] = defaultValue.call(
  4553. null,
  4554. props
  4555. );
  4556. reset();
  4557. }
  4558. } else {
  4559. value = defaultValue;
  4560. }
  4561. if (instance.ce) {
  4562. instance.ce._setProp(key, value);
  4563. }
  4564. }
  4565. if (opt[
  4566. 0
  4567. /* shouldCast */
  4568. ]) {
  4569. if (isAbsent && !hasDefault) {
  4570. value = false;
  4571. } else if (opt[
  4572. 1
  4573. /* shouldCastTrue */
  4574. ] && (value === "" || value === hyphenate(key))) {
  4575. value = true;
  4576. }
  4577. }
  4578. }
  4579. return value;
  4580. }
  4581. const mixinPropsCache = /* @__PURE__ */ new WeakMap();
  4582. function normalizePropsOptions(comp, appContext, asMixin = false) {
  4583. const cache = asMixin ? mixinPropsCache : appContext.propsCache;
  4584. const cached = cache.get(comp);
  4585. if (cached) {
  4586. return cached;
  4587. }
  4588. const raw = comp.props;
  4589. const normalized = {};
  4590. const needCastKeys = [];
  4591. let hasExtends = false;
  4592. if (!isFunction(comp)) {
  4593. const extendProps = (raw2) => {
  4594. hasExtends = true;
  4595. const [props, keys] = normalizePropsOptions(raw2, appContext, true);
  4596. extend(normalized, props);
  4597. if (keys)
  4598. needCastKeys.push(...keys);
  4599. };
  4600. if (!asMixin && appContext.mixins.length) {
  4601. appContext.mixins.forEach(extendProps);
  4602. }
  4603. if (comp.extends) {
  4604. extendProps(comp.extends);
  4605. }
  4606. if (comp.mixins) {
  4607. comp.mixins.forEach(extendProps);
  4608. }
  4609. }
  4610. if (!raw && !hasExtends) {
  4611. if (isObject(comp)) {
  4612. cache.set(comp, EMPTY_ARR);
  4613. }
  4614. return EMPTY_ARR;
  4615. }
  4616. if (isArray$1(raw)) {
  4617. for (let i = 0; i < raw.length; i++) {
  4618. const normalizedKey = camelize(raw[i]);
  4619. if (validatePropName(normalizedKey)) {
  4620. normalized[normalizedKey] = EMPTY_OBJ;
  4621. }
  4622. }
  4623. } else if (raw) {
  4624. for (const key in raw) {
  4625. const normalizedKey = camelize(key);
  4626. if (validatePropName(normalizedKey)) {
  4627. const opt = raw[key];
  4628. const prop = normalized[normalizedKey] = isArray$1(opt) || isFunction(opt) ? { type: opt } : extend({}, opt);
  4629. const propType = prop.type;
  4630. let shouldCast = false;
  4631. let shouldCastTrue = true;
  4632. if (isArray$1(propType)) {
  4633. for (let index = 0; index < propType.length; ++index) {
  4634. const type = propType[index];
  4635. const typeName = isFunction(type) && type.name;
  4636. if (typeName === "Boolean") {
  4637. shouldCast = true;
  4638. break;
  4639. } else if (typeName === "String") {
  4640. shouldCastTrue = false;
  4641. }
  4642. }
  4643. } else {
  4644. shouldCast = isFunction(propType) && propType.name === "Boolean";
  4645. }
  4646. prop[
  4647. 0
  4648. /* shouldCast */
  4649. ] = shouldCast;
  4650. prop[
  4651. 1
  4652. /* shouldCastTrue */
  4653. ] = shouldCastTrue;
  4654. if (shouldCast || hasOwn(prop, "default")) {
  4655. needCastKeys.push(normalizedKey);
  4656. }
  4657. }
  4658. }
  4659. }
  4660. const res = [normalized, needCastKeys];
  4661. if (isObject(comp)) {
  4662. cache.set(comp, res);
  4663. }
  4664. return res;
  4665. }
  4666. function validatePropName(key) {
  4667. if (key[0] !== "$" && !isReservedProp(key)) {
  4668. return true;
  4669. }
  4670. return false;
  4671. }
  4672. const isInternalKey = (key) => key === "_" || key === "_ctx" || key === "$stable";
  4673. const normalizeSlotValue = (value) => isArray$1(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
  4674. const normalizeSlot$1 = (key, rawSlot, ctx) => {
  4675. if (rawSlot._n) {
  4676. return rawSlot;
  4677. }
  4678. const normalized = withCtx((...args) => {
  4679. if (false)
  4680. ;
  4681. return normalizeSlotValue(rawSlot(...args));
  4682. }, ctx);
  4683. normalized._c = false;
  4684. return normalized;
  4685. };
  4686. const normalizeObjectSlots = (rawSlots, slots, instance) => {
  4687. const ctx = rawSlots._ctx;
  4688. for (const key in rawSlots) {
  4689. if (isInternalKey(key))
  4690. continue;
  4691. const value = rawSlots[key];
  4692. if (isFunction(value)) {
  4693. slots[key] = normalizeSlot$1(key, value, ctx);
  4694. } else if (value != null) {
  4695. const normalized = normalizeSlotValue(value);
  4696. slots[key] = () => normalized;
  4697. }
  4698. }
  4699. };
  4700. const normalizeVNodeSlots = (instance, children) => {
  4701. const normalized = normalizeSlotValue(children);
  4702. instance.slots.default = () => normalized;
  4703. };
  4704. const assignSlots = (slots, children, optimized) => {
  4705. for (const key in children) {
  4706. if (optimized || !isInternalKey(key)) {
  4707. slots[key] = children[key];
  4708. }
  4709. }
  4710. };
  4711. const initSlots = (instance, children, optimized) => {
  4712. const slots = instance.slots = createInternalObject();
  4713. if (instance.vnode.shapeFlag & 32) {
  4714. const type = children._;
  4715. if (type) {
  4716. assignSlots(slots, children, optimized);
  4717. if (optimized) {
  4718. def(slots, "_", type, true);
  4719. }
  4720. } else {
  4721. normalizeObjectSlots(children, slots);
  4722. }
  4723. } else if (children) {
  4724. normalizeVNodeSlots(instance, children);
  4725. }
  4726. };
  4727. const updateSlots = (instance, children, optimized) => {
  4728. const { vnode, slots } = instance;
  4729. let needDeletionCheck = true;
  4730. let deletionComparisonTarget = EMPTY_OBJ;
  4731. if (vnode.shapeFlag & 32) {
  4732. const type = children._;
  4733. if (type) {
  4734. if (optimized && type === 1) {
  4735. needDeletionCheck = false;
  4736. } else {
  4737. assignSlots(slots, children, optimized);
  4738. }
  4739. } else {
  4740. needDeletionCheck = !children.$stable;
  4741. normalizeObjectSlots(children, slots);
  4742. }
  4743. deletionComparisonTarget = children;
  4744. } else if (children) {
  4745. normalizeVNodeSlots(instance, children);
  4746. deletionComparisonTarget = { default: 1 };
  4747. }
  4748. if (needDeletionCheck) {
  4749. for (const key in slots) {
  4750. if (!isInternalKey(key) && deletionComparisonTarget[key] == null) {
  4751. delete slots[key];
  4752. }
  4753. }
  4754. }
  4755. };
  4756. const queuePostRenderEffect = queueEffectWithSuspense;
  4757. function createRenderer(options) {
  4758. return baseCreateRenderer(options);
  4759. }
  4760. function baseCreateRenderer(options, createHydrationFns) {
  4761. const target = getGlobalThis();
  4762. target.__VUE__ = true;
  4763. const {
  4764. insert: hostInsert,
  4765. remove: hostRemove,
  4766. patchProp: hostPatchProp,
  4767. createElement: hostCreateElement,
  4768. createText: hostCreateText,
  4769. createComment: hostCreateComment,
  4770. setText: hostSetText,
  4771. setElementText: hostSetElementText,
  4772. parentNode: hostParentNode,
  4773. nextSibling: hostNextSibling,
  4774. setScopeId: hostSetScopeId = NOOP,
  4775. insertStaticContent: hostInsertStaticContent
  4776. } = options;
  4777. const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = !!n2.dynamicChildren) => {
  4778. if (n1 === n2) {
  4779. return;
  4780. }
  4781. if (n1 && !isSameVNodeType(n1, n2)) {
  4782. anchor = getNextHostNode(n1);
  4783. unmount(n1, parentComponent, parentSuspense, true);
  4784. n1 = null;
  4785. }
  4786. if (n2.patchFlag === -2) {
  4787. optimized = false;
  4788. n2.dynamicChildren = null;
  4789. }
  4790. const { type, ref: ref2, shapeFlag } = n2;
  4791. switch (type) {
  4792. case Text:
  4793. processText(n1, n2, container, anchor);
  4794. break;
  4795. case Comment:
  4796. processCommentNode(n1, n2, container, anchor);
  4797. break;
  4798. case Static:
  4799. if (n1 == null) {
  4800. mountStaticNode(n2, container, anchor, namespace);
  4801. }
  4802. break;
  4803. case Fragment:
  4804. processFragment(
  4805. n1,
  4806. n2,
  4807. container,
  4808. anchor,
  4809. parentComponent,
  4810. parentSuspense,
  4811. namespace,
  4812. slotScopeIds,
  4813. optimized
  4814. );
  4815. break;
  4816. default:
  4817. if (shapeFlag & 1) {
  4818. processElement(
  4819. n1,
  4820. n2,
  4821. container,
  4822. anchor,
  4823. parentComponent,
  4824. parentSuspense,
  4825. namespace,
  4826. slotScopeIds,
  4827. optimized
  4828. );
  4829. } else if (shapeFlag & 6) {
  4830. processComponent(
  4831. n1,
  4832. n2,
  4833. container,
  4834. anchor,
  4835. parentComponent,
  4836. parentSuspense,
  4837. namespace,
  4838. slotScopeIds,
  4839. optimized
  4840. );
  4841. } else if (shapeFlag & 64) {
  4842. type.process(
  4843. n1,
  4844. n2,
  4845. container,
  4846. anchor,
  4847. parentComponent,
  4848. parentSuspense,
  4849. namespace,
  4850. slotScopeIds,
  4851. optimized,
  4852. internals
  4853. );
  4854. } else if (shapeFlag & 128) {
  4855. type.process(
  4856. n1,
  4857. n2,
  4858. container,
  4859. anchor,
  4860. parentComponent,
  4861. parentSuspense,
  4862. namespace,
  4863. slotScopeIds,
  4864. optimized,
  4865. internals
  4866. );
  4867. } else
  4868. ;
  4869. }
  4870. if (ref2 != null && parentComponent) {
  4871. setRef(ref2, n1 && n1.ref, parentSuspense, n2 || n1, !n2);
  4872. } else if (ref2 == null && n1 && n1.ref != null) {
  4873. setRef(n1.ref, null, parentSuspense, n1, true);
  4874. }
  4875. };
  4876. const processText = (n1, n2, container, anchor) => {
  4877. if (n1 == null) {
  4878. hostInsert(
  4879. n2.el = hostCreateText(n2.children),
  4880. container,
  4881. anchor
  4882. );
  4883. } else {
  4884. const el = n2.el = n1.el;
  4885. if (n2.children !== n1.children) {
  4886. {
  4887. hostSetText(el, n2.children);
  4888. }
  4889. }
  4890. }
  4891. };
  4892. const processCommentNode = (n1, n2, container, anchor) => {
  4893. if (n1 == null) {
  4894. hostInsert(
  4895. n2.el = hostCreateComment(n2.children || ""),
  4896. container,
  4897. anchor
  4898. );
  4899. } else {
  4900. n2.el = n1.el;
  4901. }
  4902. };
  4903. const mountStaticNode = (n2, container, anchor, namespace) => {
  4904. [n2.el, n2.anchor] = hostInsertStaticContent(
  4905. n2.children,
  4906. container,
  4907. anchor,
  4908. namespace,
  4909. n2.el,
  4910. n2.anchor
  4911. );
  4912. };
  4913. const moveStaticNode = ({ el, anchor }, container, nextSibling) => {
  4914. let next;
  4915. while (el && el !== anchor) {
  4916. next = hostNextSibling(el);
  4917. hostInsert(el, container, nextSibling);
  4918. el = next;
  4919. }
  4920. hostInsert(anchor, container, nextSibling);
  4921. };
  4922. const removeStaticNode = ({ el, anchor }) => {
  4923. let next;
  4924. while (el && el !== anchor) {
  4925. next = hostNextSibling(el);
  4926. hostRemove(el);
  4927. el = next;
  4928. }
  4929. hostRemove(anchor);
  4930. };
  4931. const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  4932. if (n2.type === "svg") {
  4933. namespace = "svg";
  4934. } else if (n2.type === "math") {
  4935. namespace = "mathml";
  4936. }
  4937. if (n1 == null) {
  4938. mountElement(
  4939. n2,
  4940. container,
  4941. anchor,
  4942. parentComponent,
  4943. parentSuspense,
  4944. namespace,
  4945. slotScopeIds,
  4946. optimized
  4947. );
  4948. } else {
  4949. const customElement = !!(n1.el && n1.el._isVueCE) ? n1.el : null;
  4950. try {
  4951. if (customElement) {
  4952. customElement._beginPatch();
  4953. }
  4954. patchElement(
  4955. n1,
  4956. n2,
  4957. parentComponent,
  4958. parentSuspense,
  4959. namespace,
  4960. slotScopeIds,
  4961. optimized
  4962. );
  4963. } finally {
  4964. if (customElement) {
  4965. customElement._endPatch();
  4966. }
  4967. }
  4968. }
  4969. };
  4970. const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  4971. let el;
  4972. let vnodeHook;
  4973. const { props, shapeFlag, transition, dirs } = vnode;
  4974. el = vnode.el = hostCreateElement(
  4975. vnode.type,
  4976. namespace,
  4977. props && props.is,
  4978. props
  4979. );
  4980. if (shapeFlag & 8) {
  4981. hostSetElementText(el, vnode.children);
  4982. } else if (shapeFlag & 16) {
  4983. mountChildren(
  4984. vnode.children,
  4985. el,
  4986. null,
  4987. parentComponent,
  4988. parentSuspense,
  4989. resolveChildrenNamespace(vnode, namespace),
  4990. slotScopeIds,
  4991. optimized
  4992. );
  4993. }
  4994. if (dirs) {
  4995. invokeDirectiveHook(vnode, null, parentComponent, "created");
  4996. }
  4997. setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
  4998. if (props) {
  4999. for (const key in props) {
  5000. if (key !== "value" && !isReservedProp(key)) {
  5001. hostPatchProp(el, key, null, props[key], namespace, parentComponent);
  5002. }
  5003. }
  5004. if ("value" in props) {
  5005. hostPatchProp(el, "value", null, props.value, namespace);
  5006. }
  5007. if (vnodeHook = props.onVnodeBeforeMount) {
  5008. invokeVNodeHook(vnodeHook, parentComponent, vnode);
  5009. }
  5010. }
  5011. if (dirs) {
  5012. invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
  5013. }
  5014. const needCallTransitionHooks = needTransition(parentSuspense, transition);
  5015. if (needCallTransitionHooks) {
  5016. transition.beforeEnter(el);
  5017. }
  5018. hostInsert(el, container, anchor);
  5019. if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
  5020. queuePostRenderEffect(() => {
  5021. vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
  5022. needCallTransitionHooks && transition.enter(el);
  5023. dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
  5024. }, parentSuspense);
  5025. }
  5026. };
  5027. const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => {
  5028. if (scopeId) {
  5029. hostSetScopeId(el, scopeId);
  5030. }
  5031. if (slotScopeIds) {
  5032. for (let i = 0; i < slotScopeIds.length; i++) {
  5033. hostSetScopeId(el, slotScopeIds[i]);
  5034. }
  5035. }
  5036. if (parentComponent) {
  5037. let subTree = parentComponent.subTree;
  5038. if (vnode === subTree || isSuspense(subTree.type) && (subTree.ssContent === vnode || subTree.ssFallback === vnode)) {
  5039. const parentVNode = parentComponent.vnode;
  5040. setScopeId(
  5041. el,
  5042. parentVNode,
  5043. parentVNode.scopeId,
  5044. parentVNode.slotScopeIds,
  5045. parentComponent.parent
  5046. );
  5047. }
  5048. }
  5049. };
  5050. const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
  5051. for (let i = start; i < children.length; i++) {
  5052. const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
  5053. patch(
  5054. null,
  5055. child,
  5056. container,
  5057. anchor,
  5058. parentComponent,
  5059. parentSuspense,
  5060. namespace,
  5061. slotScopeIds,
  5062. optimized
  5063. );
  5064. }
  5065. };
  5066. const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  5067. const el = n2.el = n1.el;
  5068. let { patchFlag, dynamicChildren, dirs } = n2;
  5069. patchFlag |= n1.patchFlag & 16;
  5070. const oldProps = n1.props || EMPTY_OBJ;
  5071. const newProps = n2.props || EMPTY_OBJ;
  5072. let vnodeHook;
  5073. parentComponent && toggleRecurse(parentComponent, false);
  5074. if (vnodeHook = newProps.onVnodeBeforeUpdate) {
  5075. invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
  5076. }
  5077. if (dirs) {
  5078. invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
  5079. }
  5080. parentComponent && toggleRecurse(parentComponent, true);
  5081. if (oldProps.innerHTML && newProps.innerHTML == null || oldProps.textContent && newProps.textContent == null) {
  5082. hostSetElementText(el, "");
  5083. }
  5084. if (dynamicChildren) {
  5085. patchBlockChildren(
  5086. n1.dynamicChildren,
  5087. dynamicChildren,
  5088. el,
  5089. parentComponent,
  5090. parentSuspense,
  5091. resolveChildrenNamespace(n2, namespace),
  5092. slotScopeIds
  5093. );
  5094. } else if (!optimized) {
  5095. patchChildren(
  5096. n1,
  5097. n2,
  5098. el,
  5099. null,
  5100. parentComponent,
  5101. parentSuspense,
  5102. resolveChildrenNamespace(n2, namespace),
  5103. slotScopeIds,
  5104. false
  5105. );
  5106. }
  5107. if (patchFlag > 0) {
  5108. if (patchFlag & 16) {
  5109. patchProps(el, oldProps, newProps, parentComponent, namespace);
  5110. } else {
  5111. if (patchFlag & 2) {
  5112. if (oldProps.class !== newProps.class) {
  5113. hostPatchProp(el, "class", null, newProps.class, namespace);
  5114. }
  5115. }
  5116. if (patchFlag & 4) {
  5117. hostPatchProp(el, "style", oldProps.style, newProps.style, namespace);
  5118. }
  5119. if (patchFlag & 8) {
  5120. const propsToUpdate = n2.dynamicProps;
  5121. for (let i = 0; i < propsToUpdate.length; i++) {
  5122. const key = propsToUpdate[i];
  5123. const prev = oldProps[key];
  5124. const next = newProps[key];
  5125. if (next !== prev || key === "value") {
  5126. hostPatchProp(el, key, prev, next, namespace, parentComponent);
  5127. }
  5128. }
  5129. }
  5130. }
  5131. if (patchFlag & 1) {
  5132. if (n1.children !== n2.children) {
  5133. hostSetElementText(el, n2.children);
  5134. }
  5135. }
  5136. } else if (!optimized && dynamicChildren == null) {
  5137. patchProps(el, oldProps, newProps, parentComponent, namespace);
  5138. }
  5139. if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
  5140. queuePostRenderEffect(() => {
  5141. vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
  5142. dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
  5143. }, parentSuspense);
  5144. }
  5145. };
  5146. const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => {
  5147. for (let i = 0; i < newChildren.length; i++) {
  5148. const oldVNode = oldChildren[i];
  5149. const newVNode = newChildren[i];
  5150. const container = (
  5151. // oldVNode may be an errored async setup() component inside Suspense
  5152. // which will not have a mounted element
  5153. oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent
  5154. // of the Fragment itself so it can move its children.
  5155. (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement
  5156. // which also requires the correct parent container
  5157. !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.
  5158. oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldVNode.el) : (
  5159. // In other cases, the parent container is not actually used so we
  5160. // just pass the block element here to avoid a DOM parentNode call.
  5161. fallbackContainer
  5162. )
  5163. );
  5164. patch(
  5165. oldVNode,
  5166. newVNode,
  5167. container,
  5168. null,
  5169. parentComponent,
  5170. parentSuspense,
  5171. namespace,
  5172. slotScopeIds,
  5173. true
  5174. );
  5175. }
  5176. };
  5177. const patchProps = (el, oldProps, newProps, parentComponent, namespace) => {
  5178. if (oldProps !== newProps) {
  5179. if (oldProps !== EMPTY_OBJ) {
  5180. for (const key in oldProps) {
  5181. if (!isReservedProp(key) && !(key in newProps)) {
  5182. hostPatchProp(
  5183. el,
  5184. key,
  5185. oldProps[key],
  5186. null,
  5187. namespace,
  5188. parentComponent
  5189. );
  5190. }
  5191. }
  5192. }
  5193. for (const key in newProps) {
  5194. if (isReservedProp(key))
  5195. continue;
  5196. const next = newProps[key];
  5197. const prev = oldProps[key];
  5198. if (next !== prev && key !== "value") {
  5199. hostPatchProp(el, key, prev, next, namespace, parentComponent);
  5200. }
  5201. }
  5202. if ("value" in newProps) {
  5203. hostPatchProp(el, "value", oldProps.value, newProps.value, namespace);
  5204. }
  5205. }
  5206. };
  5207. const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  5208. const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText("");
  5209. const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText("");
  5210. let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
  5211. if (fragmentSlotScopeIds) {
  5212. slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
  5213. }
  5214. if (n1 == null) {
  5215. hostInsert(fragmentStartAnchor, container, anchor);
  5216. hostInsert(fragmentEndAnchor, container, anchor);
  5217. mountChildren(
  5218. // #10007
  5219. // such fragment like `<></>` will be compiled into
  5220. // a fragment which doesn't have a children.
  5221. // In this case fallback to an empty array
  5222. n2.children || [],
  5223. container,
  5224. fragmentEndAnchor,
  5225. parentComponent,
  5226. parentSuspense,
  5227. namespace,
  5228. slotScopeIds,
  5229. optimized
  5230. );
  5231. } else {
  5232. if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result
  5233. // of renderSlot() with no valid children
  5234. n1.dynamicChildren && n1.dynamicChildren.length === dynamicChildren.length) {
  5235. patchBlockChildren(
  5236. n1.dynamicChildren,
  5237. dynamicChildren,
  5238. container,
  5239. parentComponent,
  5240. parentSuspense,
  5241. namespace,
  5242. slotScopeIds
  5243. );
  5244. if (
  5245. // #2080 if the stable fragment has a key, it's a <template v-for> that may
  5246. // get moved around. Make sure all root level vnodes inherit el.
  5247. // #2134 or if it's a component root, it may also get moved around
  5248. // as the component is being moved.
  5249. n2.key != null || parentComponent && n2 === parentComponent.subTree
  5250. ) {
  5251. traverseStaticChildren(
  5252. n1,
  5253. n2,
  5254. true
  5255. /* shallow */
  5256. );
  5257. }
  5258. } else {
  5259. patchChildren(
  5260. n1,
  5261. n2,
  5262. container,
  5263. fragmentEndAnchor,
  5264. parentComponent,
  5265. parentSuspense,
  5266. namespace,
  5267. slotScopeIds,
  5268. optimized
  5269. );
  5270. }
  5271. }
  5272. };
  5273. const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  5274. n2.slotScopeIds = slotScopeIds;
  5275. if (n1 == null) {
  5276. if (n2.shapeFlag & 512) {
  5277. parentComponent.ctx.activate(
  5278. n2,
  5279. container,
  5280. anchor,
  5281. namespace,
  5282. optimized
  5283. );
  5284. } else {
  5285. mountComponent(
  5286. n2,
  5287. container,
  5288. anchor,
  5289. parentComponent,
  5290. parentSuspense,
  5291. namespace,
  5292. optimized
  5293. );
  5294. }
  5295. } else {
  5296. updateComponent(n1, n2, optimized);
  5297. }
  5298. };
  5299. const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
  5300. const instance = initialVNode.component = createComponentInstance(
  5301. initialVNode,
  5302. parentComponent,
  5303. parentSuspense
  5304. );
  5305. if (isKeepAlive(initialVNode)) {
  5306. instance.ctx.renderer = internals;
  5307. }
  5308. {
  5309. setupComponent(instance, false, optimized);
  5310. }
  5311. if (instance.asyncDep) {
  5312. parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
  5313. if (!initialVNode.el) {
  5314. const placeholder = instance.subTree = createVNode(Comment);
  5315. processCommentNode(null, placeholder, container, anchor);
  5316. initialVNode.placeholder = placeholder.el;
  5317. }
  5318. } else {
  5319. setupRenderEffect(
  5320. instance,
  5321. initialVNode,
  5322. container,
  5323. anchor,
  5324. parentSuspense,
  5325. namespace,
  5326. optimized
  5327. );
  5328. }
  5329. };
  5330. const updateComponent = (n1, n2, optimized) => {
  5331. const instance = n2.component = n1.component;
  5332. if (shouldUpdateComponent(n1, n2, optimized)) {
  5333. if (instance.asyncDep && !instance.asyncResolved) {
  5334. updateComponentPreRender(instance, n2, optimized);
  5335. return;
  5336. } else {
  5337. instance.next = n2;
  5338. instance.update();
  5339. }
  5340. } else {
  5341. n2.el = n1.el;
  5342. instance.vnode = n2;
  5343. }
  5344. };
  5345. const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
  5346. const componentUpdateFn = () => {
  5347. if (!instance.isMounted) {
  5348. let vnodeHook;
  5349. const { el, props } = initialVNode;
  5350. const { bm, m, parent, root, type } = instance;
  5351. const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
  5352. toggleRecurse(instance, false);
  5353. if (bm) {
  5354. invokeArrayFns(bm);
  5355. }
  5356. if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeBeforeMount)) {
  5357. invokeVNodeHook(vnodeHook, parent, initialVNode);
  5358. }
  5359. toggleRecurse(instance, true);
  5360. if (el && hydrateNode) {
  5361. const hydrateSubTree = () => {
  5362. instance.subTree = renderComponentRoot(instance);
  5363. hydrateNode(
  5364. el,
  5365. instance.subTree,
  5366. instance,
  5367. parentSuspense,
  5368. null
  5369. );
  5370. };
  5371. if (isAsyncWrapperVNode && type.__asyncHydrate) {
  5372. type.__asyncHydrate(
  5373. el,
  5374. instance,
  5375. hydrateSubTree
  5376. );
  5377. } else {
  5378. hydrateSubTree();
  5379. }
  5380. } else {
  5381. if (root.ce && // @ts-expect-error _def is private
  5382. root.ce._def.shadowRoot !== false) {
  5383. root.ce._injectChildStyle(type);
  5384. }
  5385. const subTree = instance.subTree = renderComponentRoot(instance);
  5386. patch(
  5387. null,
  5388. subTree,
  5389. container,
  5390. anchor,
  5391. instance,
  5392. parentSuspense,
  5393. namespace
  5394. );
  5395. initialVNode.el = subTree.el;
  5396. }
  5397. if (m) {
  5398. queuePostRenderEffect(m, parentSuspense);
  5399. }
  5400. if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) {
  5401. const scopedInitialVNode = initialVNode;
  5402. queuePostRenderEffect(
  5403. () => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode),
  5404. parentSuspense
  5405. );
  5406. }
  5407. if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) {
  5408. instance.a && queuePostRenderEffect(instance.a, parentSuspense);
  5409. }
  5410. instance.isMounted = true;
  5411. initialVNode = container = anchor = null;
  5412. } else {
  5413. let { next, bu, u, parent, vnode } = instance;
  5414. {
  5415. const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
  5416. if (nonHydratedAsyncRoot) {
  5417. if (next) {
  5418. next.el = vnode.el;
  5419. updateComponentPreRender(instance, next, optimized);
  5420. }
  5421. nonHydratedAsyncRoot.asyncDep.then(() => {
  5422. if (!instance.isUnmounted) {
  5423. componentUpdateFn();
  5424. }
  5425. });
  5426. return;
  5427. }
  5428. }
  5429. let originNext = next;
  5430. let vnodeHook;
  5431. toggleRecurse(instance, false);
  5432. if (next) {
  5433. next.el = vnode.el;
  5434. updateComponentPreRender(instance, next, optimized);
  5435. } else {
  5436. next = vnode;
  5437. }
  5438. if (bu) {
  5439. invokeArrayFns(bu);
  5440. }
  5441. if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) {
  5442. invokeVNodeHook(vnodeHook, parent, next, vnode);
  5443. }
  5444. toggleRecurse(instance, true);
  5445. const nextTree = renderComponentRoot(instance);
  5446. const prevTree = instance.subTree;
  5447. instance.subTree = nextTree;
  5448. patch(
  5449. prevTree,
  5450. nextTree,
  5451. // parent may have changed if it's in a teleport
  5452. hostParentNode(prevTree.el),
  5453. // anchor may have changed if it's in a fragment
  5454. getNextHostNode(prevTree),
  5455. instance,
  5456. parentSuspense,
  5457. namespace
  5458. );
  5459. next.el = nextTree.el;
  5460. if (originNext === null) {
  5461. updateHOCHostEl(instance, nextTree.el);
  5462. }
  5463. if (u) {
  5464. queuePostRenderEffect(u, parentSuspense);
  5465. }
  5466. if (vnodeHook = next.props && next.props.onVnodeUpdated) {
  5467. queuePostRenderEffect(
  5468. () => invokeVNodeHook(vnodeHook, parent, next, vnode),
  5469. parentSuspense
  5470. );
  5471. }
  5472. }
  5473. };
  5474. instance.scope.on();
  5475. const effect = instance.effect = new ReactiveEffect(componentUpdateFn);
  5476. instance.scope.off();
  5477. const update = instance.update = effect.run.bind(effect);
  5478. const job = instance.job = effect.runIfDirty.bind(effect);
  5479. job.i = instance;
  5480. job.id = instance.uid;
  5481. effect.scheduler = () => queueJob(job);
  5482. toggleRecurse(instance, true);
  5483. update();
  5484. };
  5485. const updateComponentPreRender = (instance, nextVNode, optimized) => {
  5486. nextVNode.component = instance;
  5487. const prevProps = instance.vnode.props;
  5488. instance.vnode = nextVNode;
  5489. instance.next = null;
  5490. updateProps(instance, nextVNode.props, prevProps, optimized);
  5491. updateSlots(instance, nextVNode.children, optimized);
  5492. pauseTracking();
  5493. flushPreFlushCbs(instance);
  5494. resetTracking();
  5495. };
  5496. const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => {
  5497. const c1 = n1 && n1.children;
  5498. const prevShapeFlag = n1 ? n1.shapeFlag : 0;
  5499. const c2 = n2.children;
  5500. const { patchFlag, shapeFlag } = n2;
  5501. if (patchFlag > 0) {
  5502. if (patchFlag & 128) {
  5503. patchKeyedChildren(
  5504. c1,
  5505. c2,
  5506. container,
  5507. anchor,
  5508. parentComponent,
  5509. parentSuspense,
  5510. namespace,
  5511. slotScopeIds,
  5512. optimized
  5513. );
  5514. return;
  5515. } else if (patchFlag & 256) {
  5516. patchUnkeyedChildren(
  5517. c1,
  5518. c2,
  5519. container,
  5520. anchor,
  5521. parentComponent,
  5522. parentSuspense,
  5523. namespace,
  5524. slotScopeIds,
  5525. optimized
  5526. );
  5527. return;
  5528. }
  5529. }
  5530. if (shapeFlag & 8) {
  5531. if (prevShapeFlag & 16) {
  5532. unmountChildren(c1, parentComponent, parentSuspense);
  5533. }
  5534. if (c2 !== c1) {
  5535. hostSetElementText(container, c2);
  5536. }
  5537. } else {
  5538. if (prevShapeFlag & 16) {
  5539. if (shapeFlag & 16) {
  5540. patchKeyedChildren(
  5541. c1,
  5542. c2,
  5543. container,
  5544. anchor,
  5545. parentComponent,
  5546. parentSuspense,
  5547. namespace,
  5548. slotScopeIds,
  5549. optimized
  5550. );
  5551. } else {
  5552. unmountChildren(c1, parentComponent, parentSuspense, true);
  5553. }
  5554. } else {
  5555. if (prevShapeFlag & 8) {
  5556. hostSetElementText(container, "");
  5557. }
  5558. if (shapeFlag & 16) {
  5559. mountChildren(
  5560. c2,
  5561. container,
  5562. anchor,
  5563. parentComponent,
  5564. parentSuspense,
  5565. namespace,
  5566. slotScopeIds,
  5567. optimized
  5568. );
  5569. }
  5570. }
  5571. }
  5572. };
  5573. const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  5574. c1 = c1 || EMPTY_ARR;
  5575. c2 = c2 || EMPTY_ARR;
  5576. const oldLength = c1.length;
  5577. const newLength = c2.length;
  5578. const commonLength = Math.min(oldLength, newLength);
  5579. let i;
  5580. for (i = 0; i < commonLength; i++) {
  5581. const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
  5582. patch(
  5583. c1[i],
  5584. nextChild,
  5585. container,
  5586. null,
  5587. parentComponent,
  5588. parentSuspense,
  5589. namespace,
  5590. slotScopeIds,
  5591. optimized
  5592. );
  5593. }
  5594. if (oldLength > newLength) {
  5595. unmountChildren(
  5596. c1,
  5597. parentComponent,
  5598. parentSuspense,
  5599. true,
  5600. false,
  5601. commonLength
  5602. );
  5603. } else {
  5604. mountChildren(
  5605. c2,
  5606. container,
  5607. anchor,
  5608. parentComponent,
  5609. parentSuspense,
  5610. namespace,
  5611. slotScopeIds,
  5612. optimized,
  5613. commonLength
  5614. );
  5615. }
  5616. };
  5617. const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  5618. let i = 0;
  5619. const l2 = c2.length;
  5620. let e1 = c1.length - 1;
  5621. let e2 = l2 - 1;
  5622. while (i <= e1 && i <= e2) {
  5623. const n1 = c1[i];
  5624. const n2 = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
  5625. if (isSameVNodeType(n1, n2)) {
  5626. patch(
  5627. n1,
  5628. n2,
  5629. container,
  5630. null,
  5631. parentComponent,
  5632. parentSuspense,
  5633. namespace,
  5634. slotScopeIds,
  5635. optimized
  5636. );
  5637. } else {
  5638. break;
  5639. }
  5640. i++;
  5641. }
  5642. while (i <= e1 && i <= e2) {
  5643. const n1 = c1[e1];
  5644. const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode(c2[e2]);
  5645. if (isSameVNodeType(n1, n2)) {
  5646. patch(
  5647. n1,
  5648. n2,
  5649. container,
  5650. null,
  5651. parentComponent,
  5652. parentSuspense,
  5653. namespace,
  5654. slotScopeIds,
  5655. optimized
  5656. );
  5657. } else {
  5658. break;
  5659. }
  5660. e1--;
  5661. e2--;
  5662. }
  5663. if (i > e1) {
  5664. if (i <= e2) {
  5665. const nextPos = e2 + 1;
  5666. const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor;
  5667. while (i <= e2) {
  5668. patch(
  5669. null,
  5670. c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]),
  5671. container,
  5672. anchor,
  5673. parentComponent,
  5674. parentSuspense,
  5675. namespace,
  5676. slotScopeIds,
  5677. optimized
  5678. );
  5679. i++;
  5680. }
  5681. }
  5682. } else if (i > e2) {
  5683. while (i <= e1) {
  5684. unmount(c1[i], parentComponent, parentSuspense, true);
  5685. i++;
  5686. }
  5687. } else {
  5688. const s1 = i;
  5689. const s2 = i;
  5690. const keyToNewIndexMap = /* @__PURE__ */ new Map();
  5691. for (i = s2; i <= e2; i++) {
  5692. const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
  5693. if (nextChild.key != null) {
  5694. keyToNewIndexMap.set(nextChild.key, i);
  5695. }
  5696. }
  5697. let j;
  5698. let patched = 0;
  5699. const toBePatched = e2 - s2 + 1;
  5700. let moved = false;
  5701. let maxNewIndexSoFar = 0;
  5702. const newIndexToOldIndexMap = new Array(toBePatched);
  5703. for (i = 0; i < toBePatched; i++)
  5704. newIndexToOldIndexMap[i] = 0;
  5705. for (i = s1; i <= e1; i++) {
  5706. const prevChild = c1[i];
  5707. if (patched >= toBePatched) {
  5708. unmount(prevChild, parentComponent, parentSuspense, true);
  5709. continue;
  5710. }
  5711. let newIndex;
  5712. if (prevChild.key != null) {
  5713. newIndex = keyToNewIndexMap.get(prevChild.key);
  5714. } else {
  5715. for (j = s2; j <= e2; j++) {
  5716. if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) {
  5717. newIndex = j;
  5718. break;
  5719. }
  5720. }
  5721. }
  5722. if (newIndex === void 0) {
  5723. unmount(prevChild, parentComponent, parentSuspense, true);
  5724. } else {
  5725. newIndexToOldIndexMap[newIndex - s2] = i + 1;
  5726. if (newIndex >= maxNewIndexSoFar) {
  5727. maxNewIndexSoFar = newIndex;
  5728. } else {
  5729. moved = true;
  5730. }
  5731. patch(
  5732. prevChild,
  5733. c2[newIndex],
  5734. container,
  5735. null,
  5736. parentComponent,
  5737. parentSuspense,
  5738. namespace,
  5739. slotScopeIds,
  5740. optimized
  5741. );
  5742. patched++;
  5743. }
  5744. }
  5745. const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : EMPTY_ARR;
  5746. j = increasingNewIndexSequence.length - 1;
  5747. for (i = toBePatched - 1; i >= 0; i--) {
  5748. const nextIndex = s2 + i;
  5749. const nextChild = c2[nextIndex];
  5750. const anchorVNode = c2[nextIndex + 1];
  5751. const anchor = nextIndex + 1 < l2 ? (
  5752. // #13559, #14173 fallback to el placeholder for unresolved async component
  5753. anchorVNode.el || resolveAsyncComponentPlaceholder(anchorVNode)
  5754. ) : parentAnchor;
  5755. if (newIndexToOldIndexMap[i] === 0) {
  5756. patch(
  5757. null,
  5758. nextChild,
  5759. container,
  5760. anchor,
  5761. parentComponent,
  5762. parentSuspense,
  5763. namespace,
  5764. slotScopeIds,
  5765. optimized
  5766. );
  5767. } else if (moved) {
  5768. if (j < 0 || i !== increasingNewIndexSequence[j]) {
  5769. move(nextChild, container, anchor, 2);
  5770. } else {
  5771. j--;
  5772. }
  5773. }
  5774. }
  5775. }
  5776. };
  5777. const move = (vnode, container, anchor, moveType, parentSuspense = null) => {
  5778. const { el, type, transition, children, shapeFlag } = vnode;
  5779. if (shapeFlag & 6) {
  5780. move(vnode.component.subTree, container, anchor, moveType);
  5781. return;
  5782. }
  5783. if (shapeFlag & 128) {
  5784. vnode.suspense.move(container, anchor, moveType);
  5785. return;
  5786. }
  5787. if (shapeFlag & 64) {
  5788. type.move(vnode, container, anchor, internals);
  5789. return;
  5790. }
  5791. if (type === Fragment) {
  5792. hostInsert(el, container, anchor);
  5793. for (let i = 0; i < children.length; i++) {
  5794. move(children[i], container, anchor, moveType);
  5795. }
  5796. hostInsert(vnode.anchor, container, anchor);
  5797. return;
  5798. }
  5799. if (type === Static) {
  5800. moveStaticNode(vnode, container, anchor);
  5801. return;
  5802. }
  5803. const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
  5804. if (needTransition2) {
  5805. if (moveType === 0) {
  5806. transition.beforeEnter(el);
  5807. hostInsert(el, container, anchor);
  5808. queuePostRenderEffect(() => transition.enter(el), parentSuspense);
  5809. } else {
  5810. const { leave, delayLeave, afterLeave } = transition;
  5811. const remove22 = () => {
  5812. if (vnode.ctx.isUnmounted) {
  5813. hostRemove(el);
  5814. } else {
  5815. hostInsert(el, container, anchor);
  5816. }
  5817. };
  5818. const performLeave = () => {
  5819. if (el._isLeaving) {
  5820. el[leaveCbKey](
  5821. true
  5822. /* cancelled */
  5823. );
  5824. }
  5825. leave(el, () => {
  5826. remove22();
  5827. afterLeave && afterLeave();
  5828. });
  5829. };
  5830. if (delayLeave) {
  5831. delayLeave(el, remove22, performLeave);
  5832. } else {
  5833. performLeave();
  5834. }
  5835. }
  5836. } else {
  5837. hostInsert(el, container, anchor);
  5838. }
  5839. };
  5840. const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
  5841. const {
  5842. type,
  5843. props,
  5844. ref: ref2,
  5845. children,
  5846. dynamicChildren,
  5847. shapeFlag,
  5848. patchFlag,
  5849. dirs,
  5850. cacheIndex
  5851. } = vnode;
  5852. if (patchFlag === -2) {
  5853. optimized = false;
  5854. }
  5855. if (ref2 != null) {
  5856. pauseTracking();
  5857. setRef(ref2, null, parentSuspense, vnode, true);
  5858. resetTracking();
  5859. }
  5860. if (cacheIndex != null) {
  5861. parentComponent.renderCache[cacheIndex] = void 0;
  5862. }
  5863. if (shapeFlag & 256) {
  5864. parentComponent.ctx.deactivate(vnode);
  5865. return;
  5866. }
  5867. const shouldInvokeDirs = shapeFlag & 1 && dirs;
  5868. const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
  5869. let vnodeHook;
  5870. if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) {
  5871. invokeVNodeHook(vnodeHook, parentComponent, vnode);
  5872. }
  5873. if (shapeFlag & 6) {
  5874. unmountComponent(vnode.component, parentSuspense, doRemove);
  5875. } else {
  5876. if (shapeFlag & 128) {
  5877. vnode.suspense.unmount(parentSuspense, doRemove);
  5878. return;
  5879. }
  5880. if (shouldInvokeDirs) {
  5881. invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
  5882. }
  5883. if (shapeFlag & 64) {
  5884. vnode.type.remove(
  5885. vnode,
  5886. parentComponent,
  5887. parentSuspense,
  5888. internals,
  5889. doRemove
  5890. );
  5891. } else if (dynamicChildren && // #5154
  5892. // when v-once is used inside a block, setBlockTracking(-1) marks the
  5893. // parent block with hasOnce: true
  5894. // so that it doesn't take the fast path during unmount - otherwise
  5895. // components nested in v-once are never unmounted.
  5896. !dynamicChildren.hasOnce && // #1153: fast path should not be taken for non-stable (v-for) fragments
  5897. (type !== Fragment || patchFlag > 0 && patchFlag & 64)) {
  5898. unmountChildren(
  5899. dynamicChildren,
  5900. parentComponent,
  5901. parentSuspense,
  5902. false,
  5903. true
  5904. );
  5905. } else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) {
  5906. unmountChildren(children, parentComponent, parentSuspense);
  5907. }
  5908. if (doRemove) {
  5909. remove2(vnode);
  5910. }
  5911. }
  5912. if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) {
  5913. queuePostRenderEffect(() => {
  5914. vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
  5915. shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
  5916. }, parentSuspense);
  5917. }
  5918. };
  5919. const remove2 = (vnode) => {
  5920. const { type, el, anchor, transition } = vnode;
  5921. if (type === Fragment) {
  5922. {
  5923. removeFragment(el, anchor);
  5924. }
  5925. return;
  5926. }
  5927. if (type === Static) {
  5928. removeStaticNode(vnode);
  5929. return;
  5930. }
  5931. const performRemove = () => {
  5932. hostRemove(el);
  5933. if (transition && !transition.persisted && transition.afterLeave) {
  5934. transition.afterLeave();
  5935. }
  5936. };
  5937. if (vnode.shapeFlag & 1 && transition && !transition.persisted) {
  5938. const { leave, delayLeave } = transition;
  5939. const performLeave = () => leave(el, performRemove);
  5940. if (delayLeave) {
  5941. delayLeave(vnode.el, performRemove, performLeave);
  5942. } else {
  5943. performLeave();
  5944. }
  5945. } else {
  5946. performRemove();
  5947. }
  5948. };
  5949. const removeFragment = (cur, end) => {
  5950. let next;
  5951. while (cur !== end) {
  5952. next = hostNextSibling(cur);
  5953. hostRemove(cur);
  5954. cur = next;
  5955. }
  5956. hostRemove(end);
  5957. };
  5958. const unmountComponent = (instance, parentSuspense, doRemove) => {
  5959. const { bum, scope, job, subTree, um, m, a } = instance;
  5960. invalidateMount(m);
  5961. invalidateMount(a);
  5962. if (bum) {
  5963. invokeArrayFns(bum);
  5964. }
  5965. scope.stop();
  5966. if (job) {
  5967. job.flags |= 8;
  5968. unmount(subTree, instance, parentSuspense, doRemove);
  5969. }
  5970. if (um) {
  5971. queuePostRenderEffect(um, parentSuspense);
  5972. }
  5973. queuePostRenderEffect(() => {
  5974. instance.isUnmounted = true;
  5975. }, parentSuspense);
  5976. };
  5977. const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {
  5978. for (let i = start; i < children.length; i++) {
  5979. unmount(children[i], parentComponent, parentSuspense, doRemove, optimized);
  5980. }
  5981. };
  5982. const getNextHostNode = (vnode) => {
  5983. if (vnode.shapeFlag & 6) {
  5984. return getNextHostNode(vnode.component.subTree);
  5985. }
  5986. if (vnode.shapeFlag & 128) {
  5987. return vnode.suspense.next();
  5988. }
  5989. const el = hostNextSibling(vnode.anchor || vnode.el);
  5990. const teleportEnd = el && el[TeleportEndKey];
  5991. return teleportEnd ? hostNextSibling(teleportEnd) : el;
  5992. };
  5993. let isFlushing = false;
  5994. const render2 = (vnode, container, namespace) => {
  5995. let instance;
  5996. if (vnode == null) {
  5997. if (container._vnode) {
  5998. unmount(container._vnode, null, null, true);
  5999. instance = container._vnode.component;
  6000. }
  6001. } else {
  6002. patch(
  6003. container._vnode || null,
  6004. vnode,
  6005. container,
  6006. null,
  6007. null,
  6008. null,
  6009. namespace
  6010. );
  6011. }
  6012. container._vnode = vnode;
  6013. if (!isFlushing) {
  6014. isFlushing = true;
  6015. flushPreFlushCbs(instance);
  6016. flushPostFlushCbs();
  6017. isFlushing = false;
  6018. }
  6019. };
  6020. const internals = {
  6021. p: patch,
  6022. um: unmount,
  6023. m: move,
  6024. r: remove2,
  6025. mt: mountComponent,
  6026. mc: mountChildren,
  6027. pc: patchChildren,
  6028. pbc: patchBlockChildren,
  6029. n: getNextHostNode,
  6030. o: options
  6031. };
  6032. let hydrate;
  6033. let hydrateNode;
  6034. if (createHydrationFns) {
  6035. [hydrate, hydrateNode] = createHydrationFns(
  6036. internals
  6037. );
  6038. }
  6039. return {
  6040. render: render2,
  6041. hydrate,
  6042. createApp: createAppAPI(render2, hydrate)
  6043. };
  6044. }
  6045. function resolveChildrenNamespace({ type, props }, currentNamespace) {
  6046. return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
  6047. }
  6048. function toggleRecurse({ effect, job }, allowed) {
  6049. if (allowed) {
  6050. effect.flags |= 32;
  6051. job.flags |= 4;
  6052. } else {
  6053. effect.flags &= -33;
  6054. job.flags &= -5;
  6055. }
  6056. }
  6057. function needTransition(parentSuspense, transition) {
  6058. return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
  6059. }
  6060. function traverseStaticChildren(n1, n2, shallow = false) {
  6061. const ch1 = n1.children;
  6062. const ch2 = n2.children;
  6063. if (isArray$1(ch1) && isArray$1(ch2)) {
  6064. for (let i = 0; i < ch1.length; i++) {
  6065. const c1 = ch1[i];
  6066. let c2 = ch2[i];
  6067. if (c2.shapeFlag & 1 && !c2.dynamicChildren) {
  6068. if (c2.patchFlag <= 0 || c2.patchFlag === 32) {
  6069. c2 = ch2[i] = cloneIfMounted(ch2[i]);
  6070. c2.el = c1.el;
  6071. }
  6072. if (!shallow && c2.patchFlag !== -2)
  6073. traverseStaticChildren(c1, c2);
  6074. }
  6075. if (c2.type === Text) {
  6076. if (c2.patchFlag !== -1) {
  6077. c2.el = c1.el;
  6078. } else {
  6079. c2.__elIndex = i + // take fragment start anchor into account
  6080. (n1.type === Fragment ? 1 : 0);
  6081. }
  6082. }
  6083. if (c2.type === Comment && !c2.el) {
  6084. c2.el = c1.el;
  6085. }
  6086. }
  6087. }
  6088. }
  6089. function getSequence(arr) {
  6090. const p2 = arr.slice();
  6091. const result = [0];
  6092. let i, j, u, v, c;
  6093. const len = arr.length;
  6094. for (i = 0; i < len; i++) {
  6095. const arrI = arr[i];
  6096. if (arrI !== 0) {
  6097. j = result[result.length - 1];
  6098. if (arr[j] < arrI) {
  6099. p2[i] = j;
  6100. result.push(i);
  6101. continue;
  6102. }
  6103. u = 0;
  6104. v = result.length - 1;
  6105. while (u < v) {
  6106. c = u + v >> 1;
  6107. if (arr[result[c]] < arrI) {
  6108. u = c + 1;
  6109. } else {
  6110. v = c;
  6111. }
  6112. }
  6113. if (arrI < arr[result[u]]) {
  6114. if (u > 0) {
  6115. p2[i] = result[u - 1];
  6116. }
  6117. result[u] = i;
  6118. }
  6119. }
  6120. }
  6121. u = result.length;
  6122. v = result[u - 1];
  6123. while (u-- > 0) {
  6124. result[u] = v;
  6125. v = p2[v];
  6126. }
  6127. return result;
  6128. }
  6129. function locateNonHydratedAsyncRoot(instance) {
  6130. const subComponent = instance.subTree.component;
  6131. if (subComponent) {
  6132. if (subComponent.asyncDep && !subComponent.asyncResolved) {
  6133. return subComponent;
  6134. } else {
  6135. return locateNonHydratedAsyncRoot(subComponent);
  6136. }
  6137. }
  6138. }
  6139. function invalidateMount(hooks) {
  6140. if (hooks) {
  6141. for (let i = 0; i < hooks.length; i++)
  6142. hooks[i].flags |= 8;
  6143. }
  6144. }
  6145. function resolveAsyncComponentPlaceholder(anchorVnode) {
  6146. if (anchorVnode.placeholder) {
  6147. return anchorVnode.placeholder;
  6148. }
  6149. const instance = anchorVnode.component;
  6150. if (instance) {
  6151. return resolveAsyncComponentPlaceholder(instance.subTree);
  6152. }
  6153. return null;
  6154. }
  6155. const isSuspense = (type) => type.__isSuspense;
  6156. function queueEffectWithSuspense(fn, suspense) {
  6157. if (suspense && suspense.pendingBranch) {
  6158. if (isArray$1(fn)) {
  6159. suspense.effects.push(...fn);
  6160. } else {
  6161. suspense.effects.push(fn);
  6162. }
  6163. } else {
  6164. queuePostFlushCb(fn);
  6165. }
  6166. }
  6167. const Fragment = /* @__PURE__ */ Symbol.for("v-fgt");
  6168. const Text = /* @__PURE__ */ Symbol.for("v-txt");
  6169. const Comment = /* @__PURE__ */ Symbol.for("v-cmt");
  6170. const Static = /* @__PURE__ */ Symbol.for("v-stc");
  6171. const blockStack = [];
  6172. let currentBlock = null;
  6173. function openBlock(disableTracking = false) {
  6174. blockStack.push(currentBlock = disableTracking ? null : []);
  6175. }
  6176. function closeBlock() {
  6177. blockStack.pop();
  6178. currentBlock = blockStack[blockStack.length - 1] || null;
  6179. }
  6180. let isBlockTreeEnabled = 1;
  6181. function setBlockTracking(value, inVOnce = false) {
  6182. isBlockTreeEnabled += value;
  6183. if (value < 0 && currentBlock && inVOnce) {
  6184. currentBlock.hasOnce = true;
  6185. }
  6186. }
  6187. function setupBlock(vnode) {
  6188. vnode.dynamicChildren = isBlockTreeEnabled > 0 ? currentBlock || EMPTY_ARR : null;
  6189. closeBlock();
  6190. if (isBlockTreeEnabled > 0 && currentBlock) {
  6191. currentBlock.push(vnode);
  6192. }
  6193. return vnode;
  6194. }
  6195. function createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) {
  6196. return setupBlock(
  6197. createBaseVNode(
  6198. type,
  6199. props,
  6200. children,
  6201. patchFlag,
  6202. dynamicProps,
  6203. shapeFlag,
  6204. true
  6205. )
  6206. );
  6207. }
  6208. function createBlock(type, props, children, patchFlag, dynamicProps) {
  6209. return setupBlock(
  6210. createVNode(
  6211. type,
  6212. props,
  6213. children,
  6214. patchFlag,
  6215. dynamicProps,
  6216. true
  6217. )
  6218. );
  6219. }
  6220. function isVNode(value) {
  6221. return value ? value.__v_isVNode === true : false;
  6222. }
  6223. function isSameVNodeType(n1, n2) {
  6224. return n1.type === n2.type && n1.key === n2.key;
  6225. }
  6226. const normalizeKey = ({ key }) => key != null ? key : null;
  6227. const normalizeRef = ({
  6228. ref: ref2,
  6229. ref_key,
  6230. ref_for
  6231. }) => {
  6232. if (typeof ref2 === "number") {
  6233. ref2 = "" + ref2;
  6234. }
  6235. return ref2 != null ? isString(ref2) || isRef(ref2) || isFunction(ref2) ? { i: currentRenderingInstance, r: ref2, k: ref_key, f: !!ref_for } : ref2 : null;
  6236. };
  6237. function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) {
  6238. const vnode = {
  6239. __v_isVNode: true,
  6240. __v_skip: true,
  6241. type,
  6242. props,
  6243. key: props && normalizeKey(props),
  6244. ref: props && normalizeRef(props),
  6245. scopeId: currentScopeId,
  6246. slotScopeIds: null,
  6247. children,
  6248. component: null,
  6249. suspense: null,
  6250. ssContent: null,
  6251. ssFallback: null,
  6252. dirs: null,
  6253. transition: null,
  6254. el: null,
  6255. anchor: null,
  6256. target: null,
  6257. targetStart: null,
  6258. targetAnchor: null,
  6259. staticCount: 0,
  6260. shapeFlag,
  6261. patchFlag,
  6262. dynamicProps,
  6263. dynamicChildren: null,
  6264. appContext: null,
  6265. ctx: currentRenderingInstance
  6266. };
  6267. if (needFullChildrenNormalization) {
  6268. normalizeChildren(vnode, children);
  6269. if (shapeFlag & 128) {
  6270. type.normalize(vnode);
  6271. }
  6272. } else if (children) {
  6273. vnode.shapeFlag |= isString(children) ? 8 : 16;
  6274. }
  6275. if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself
  6276. !isBlockNode && // has current parent block
  6277. currentBlock && // presence of a patch flag indicates this node needs patching on updates.
  6278. // component nodes also should always be patched, because even if the
  6279. // component doesn't need to update, it needs to persist the instance on to
  6280. // the next vnode so that it can be properly unmounted later.
  6281. (vnode.patchFlag > 0 || shapeFlag & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the
  6282. // vnode should not be considered dynamic due to handler caching.
  6283. vnode.patchFlag !== 32) {
  6284. currentBlock.push(vnode);
  6285. }
  6286. return vnode;
  6287. }
  6288. const createVNode = _createVNode;
  6289. function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
  6290. if (!type || type === NULL_DYNAMIC_COMPONENT) {
  6291. type = Comment;
  6292. }
  6293. if (isVNode(type)) {
  6294. const cloned = cloneVNode(
  6295. type,
  6296. props,
  6297. true
  6298. /* mergeRef: true */
  6299. );
  6300. if (children) {
  6301. normalizeChildren(cloned, children);
  6302. }
  6303. if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
  6304. if (cloned.shapeFlag & 6) {
  6305. currentBlock[currentBlock.indexOf(type)] = cloned;
  6306. } else {
  6307. currentBlock.push(cloned);
  6308. }
  6309. }
  6310. cloned.patchFlag = -2;
  6311. return cloned;
  6312. }
  6313. if (isClassComponent(type)) {
  6314. type = type.__vccOpts;
  6315. }
  6316. if (props) {
  6317. props = guardReactiveProps(props);
  6318. let { class: klass, style } = props;
  6319. if (klass && !isString(klass)) {
  6320. props.class = normalizeClass(klass);
  6321. }
  6322. if (isObject(style)) {
  6323. if (isProxy(style) && !isArray$1(style)) {
  6324. style = extend({}, style);
  6325. }
  6326. props.style = normalizeStyle(style);
  6327. }
  6328. }
  6329. const shapeFlag = isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject(type) ? 4 : isFunction(type) ? 2 : 0;
  6330. return createBaseVNode(
  6331. type,
  6332. props,
  6333. children,
  6334. patchFlag,
  6335. dynamicProps,
  6336. shapeFlag,
  6337. isBlockNode,
  6338. true
  6339. );
  6340. }
  6341. function guardReactiveProps(props) {
  6342. if (!props)
  6343. return null;
  6344. return isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
  6345. }
  6346. function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
  6347. const { props, ref: ref2, patchFlag, children, transition } = vnode;
  6348. const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props;
  6349. const cloned = {
  6350. __v_isVNode: true,
  6351. __v_skip: true,
  6352. type: vnode.type,
  6353. props: mergedProps,
  6354. key: mergedProps && normalizeKey(mergedProps),
  6355. ref: extraProps && extraProps.ref ? (
  6356. // #2078 in the case of <component :is="vnode" ref="extra"/>
  6357. // if the vnode itself already has a ref, cloneVNode will need to merge
  6358. // the refs so the single vnode can be set on multiple refs
  6359. mergeRef && ref2 ? isArray$1(ref2) ? ref2.concat(normalizeRef(extraProps)) : [ref2, normalizeRef(extraProps)] : normalizeRef(extraProps)
  6360. ) : ref2,
  6361. scopeId: vnode.scopeId,
  6362. slotScopeIds: vnode.slotScopeIds,
  6363. children,
  6364. target: vnode.target,
  6365. targetStart: vnode.targetStart,
  6366. targetAnchor: vnode.targetAnchor,
  6367. staticCount: vnode.staticCount,
  6368. shapeFlag: vnode.shapeFlag,
  6369. // if the vnode is cloned with extra props, we can no longer assume its
  6370. // existing patch flag to be reliable and need to add the FULL_PROPS flag.
  6371. // note: preserve flag for fragments since they use the flag for children
  6372. // fast paths only.
  6373. patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag,
  6374. dynamicProps: vnode.dynamicProps,
  6375. dynamicChildren: vnode.dynamicChildren,
  6376. appContext: vnode.appContext,
  6377. dirs: vnode.dirs,
  6378. transition,
  6379. // These should technically only be non-null on mounted VNodes. However,
  6380. // they *should* be copied for kept-alive vnodes. So we just always copy
  6381. // them since them being non-null during a mount doesn't affect the logic as
  6382. // they will simply be overwritten.
  6383. component: vnode.component,
  6384. suspense: vnode.suspense,
  6385. ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
  6386. ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
  6387. placeholder: vnode.placeholder,
  6388. el: vnode.el,
  6389. anchor: vnode.anchor,
  6390. ctx: vnode.ctx,
  6391. ce: vnode.ce
  6392. };
  6393. if (transition && cloneTransition) {
  6394. setTransitionHooks(
  6395. cloned,
  6396. transition.clone(cloned)
  6397. );
  6398. }
  6399. return cloned;
  6400. }
  6401. function createTextVNode(text = " ", flag = 0) {
  6402. return createVNode(Text, null, text, flag);
  6403. }
  6404. function createCommentVNode(text = "", asBlock = false) {
  6405. return asBlock ? (openBlock(), createBlock(Comment, null, text)) : createVNode(Comment, null, text);
  6406. }
  6407. function normalizeVNode(child) {
  6408. if (child == null || typeof child === "boolean") {
  6409. return createVNode(Comment);
  6410. } else if (isArray$1(child)) {
  6411. return createVNode(
  6412. Fragment,
  6413. null,
  6414. // #3666, avoid reference pollution when reusing vnode
  6415. child.slice()
  6416. );
  6417. } else if (isVNode(child)) {
  6418. return cloneIfMounted(child);
  6419. } else {
  6420. return createVNode(Text, null, String(child));
  6421. }
  6422. }
  6423. function cloneIfMounted(child) {
  6424. return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child);
  6425. }
  6426. function normalizeChildren(vnode, children) {
  6427. let type = 0;
  6428. const { shapeFlag } = vnode;
  6429. if (children == null) {
  6430. children = null;
  6431. } else if (isArray$1(children)) {
  6432. type = 16;
  6433. } else if (typeof children === "object") {
  6434. if (shapeFlag & (1 | 64)) {
  6435. const slot = children.default;
  6436. if (slot) {
  6437. slot._c && (slot._d = false);
  6438. normalizeChildren(vnode, slot());
  6439. slot._c && (slot._d = true);
  6440. }
  6441. return;
  6442. } else {
  6443. type = 32;
  6444. const slotFlag = children._;
  6445. if (!slotFlag && !isInternalObject(children)) {
  6446. children._ctx = currentRenderingInstance;
  6447. } else if (slotFlag === 3 && currentRenderingInstance) {
  6448. if (currentRenderingInstance.slots._ === 1) {
  6449. children._ = 1;
  6450. } else {
  6451. children._ = 2;
  6452. vnode.patchFlag |= 1024;
  6453. }
  6454. }
  6455. }
  6456. } else if (isFunction(children)) {
  6457. children = { default: children, _ctx: currentRenderingInstance };
  6458. type = 32;
  6459. } else {
  6460. children = String(children);
  6461. if (shapeFlag & 64) {
  6462. type = 16;
  6463. children = [createTextVNode(children)];
  6464. } else {
  6465. type = 8;
  6466. }
  6467. }
  6468. vnode.children = children;
  6469. vnode.shapeFlag |= type;
  6470. }
  6471. function mergeProps(...args) {
  6472. const ret = {};
  6473. for (let i = 0; i < args.length; i++) {
  6474. const toMerge = args[i];
  6475. for (const key in toMerge) {
  6476. if (key === "class") {
  6477. if (ret.class !== toMerge.class) {
  6478. ret.class = normalizeClass([ret.class, toMerge.class]);
  6479. }
  6480. } else if (key === "style") {
  6481. ret.style = normalizeStyle([ret.style, toMerge.style]);
  6482. } else if (isOn(key)) {
  6483. const existing = ret[key];
  6484. const incoming = toMerge[key];
  6485. if (incoming && existing !== incoming && !(isArray$1(existing) && existing.includes(incoming))) {
  6486. ret[key] = existing ? [].concat(existing, incoming) : incoming;
  6487. }
  6488. } else if (key !== "") {
  6489. ret[key] = toMerge[key];
  6490. }
  6491. }
  6492. }
  6493. return ret;
  6494. }
  6495. function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
  6496. callWithAsyncErrorHandling(hook, instance, 7, [
  6497. vnode,
  6498. prevVNode
  6499. ]);
  6500. }
  6501. const emptyAppContext = createAppContext();
  6502. let uid = 0;
  6503. function createComponentInstance(vnode, parent, suspense) {
  6504. const type = vnode.type;
  6505. const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
  6506. const instance = {
  6507. uid: uid++,
  6508. vnode,
  6509. type,
  6510. parent,
  6511. appContext,
  6512. root: null,
  6513. // to be immediately set
  6514. next: null,
  6515. subTree: null,
  6516. // will be set synchronously right after creation
  6517. effect: null,
  6518. update: null,
  6519. // will be set synchronously right after creation
  6520. job: null,
  6521. scope: new EffectScope(
  6522. true
  6523. /* detached */
  6524. ),
  6525. render: null,
  6526. proxy: null,
  6527. exposed: null,
  6528. exposeProxy: null,
  6529. withProxy: null,
  6530. provides: parent ? parent.provides : Object.create(appContext.provides),
  6531. ids: parent ? parent.ids : ["", 0, 0],
  6532. accessCache: null,
  6533. renderCache: [],
  6534. // local resolved assets
  6535. components: null,
  6536. directives: null,
  6537. // resolved props and emits options
  6538. propsOptions: normalizePropsOptions(type, appContext),
  6539. emitsOptions: normalizeEmitsOptions(type, appContext),
  6540. // emit
  6541. emit: null,
  6542. // to be set immediately
  6543. emitted: null,
  6544. // props default value
  6545. propsDefaults: EMPTY_OBJ,
  6546. // inheritAttrs
  6547. inheritAttrs: type.inheritAttrs,
  6548. // state
  6549. ctx: EMPTY_OBJ,
  6550. data: EMPTY_OBJ,
  6551. props: EMPTY_OBJ,
  6552. attrs: EMPTY_OBJ,
  6553. slots: EMPTY_OBJ,
  6554. refs: EMPTY_OBJ,
  6555. setupState: EMPTY_OBJ,
  6556. setupContext: null,
  6557. // suspense related
  6558. suspense,
  6559. suspenseId: suspense ? suspense.pendingId : 0,
  6560. asyncDep: null,
  6561. asyncResolved: false,
  6562. // lifecycle hooks
  6563. // not using enums here because it results in computed properties
  6564. isMounted: false,
  6565. isUnmounted: false,
  6566. isDeactivated: false,
  6567. bc: null,
  6568. c: null,
  6569. bm: null,
  6570. m: null,
  6571. bu: null,
  6572. u: null,
  6573. um: null,
  6574. bum: null,
  6575. da: null,
  6576. a: null,
  6577. rtg: null,
  6578. rtc: null,
  6579. ec: null,
  6580. sp: null
  6581. };
  6582. {
  6583. instance.ctx = { _: instance };
  6584. }
  6585. instance.root = parent ? parent.root : instance;
  6586. instance.emit = emit.bind(null, instance);
  6587. if (vnode.ce) {
  6588. vnode.ce(instance);
  6589. }
  6590. return instance;
  6591. }
  6592. let currentInstance = null;
  6593. const getCurrentInstance = () => currentInstance || currentRenderingInstance;
  6594. let internalSetCurrentInstance;
  6595. let setInSSRSetupState;
  6596. {
  6597. const g = getGlobalThis();
  6598. const registerGlobalSetter = (key, setter) => {
  6599. let setters;
  6600. if (!(setters = g[key]))
  6601. setters = g[key] = [];
  6602. setters.push(setter);
  6603. return (v) => {
  6604. if (setters.length > 1)
  6605. setters.forEach((set) => set(v));
  6606. else
  6607. setters[0](v);
  6608. };
  6609. };
  6610. internalSetCurrentInstance = registerGlobalSetter(
  6611. `__VUE_INSTANCE_SETTERS__`,
  6612. (v) => currentInstance = v
  6613. );
  6614. setInSSRSetupState = registerGlobalSetter(
  6615. `__VUE_SSR_SETTERS__`,
  6616. (v) => isInSSRComponentSetup = v
  6617. );
  6618. }
  6619. const setCurrentInstance = (instance) => {
  6620. const prev = currentInstance;
  6621. internalSetCurrentInstance(instance);
  6622. instance.scope.on();
  6623. return () => {
  6624. instance.scope.off();
  6625. internalSetCurrentInstance(prev);
  6626. };
  6627. };
  6628. const unsetCurrentInstance = () => {
  6629. currentInstance && currentInstance.scope.off();
  6630. internalSetCurrentInstance(null);
  6631. };
  6632. function isStatefulComponent(instance) {
  6633. return instance.vnode.shapeFlag & 4;
  6634. }
  6635. let isInSSRComponentSetup = false;
  6636. function setupComponent(instance, isSSR = false, optimized = false) {
  6637. isSSR && setInSSRSetupState(isSSR);
  6638. const { props, children } = instance.vnode;
  6639. const isStateful = isStatefulComponent(instance);
  6640. initProps(instance, props, isStateful, isSSR);
  6641. initSlots(instance, children, optimized || isSSR);
  6642. const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
  6643. isSSR && setInSSRSetupState(false);
  6644. return setupResult;
  6645. }
  6646. function setupStatefulComponent(instance, isSSR) {
  6647. const Component = instance.type;
  6648. instance.accessCache = /* @__PURE__ */ Object.create(null);
  6649. instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers);
  6650. const { setup } = Component;
  6651. if (setup) {
  6652. pauseTracking();
  6653. const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
  6654. const reset = setCurrentInstance(instance);
  6655. const setupResult = callWithErrorHandling(
  6656. setup,
  6657. instance,
  6658. 0,
  6659. [
  6660. instance.props,
  6661. setupContext
  6662. ]
  6663. );
  6664. const isAsyncSetup = isPromise(setupResult);
  6665. resetTracking();
  6666. reset();
  6667. if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) {
  6668. markAsyncBoundary(instance);
  6669. }
  6670. if (isAsyncSetup) {
  6671. setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
  6672. if (isSSR) {
  6673. return setupResult.then((resolvedResult) => {
  6674. handleSetupResult(instance, resolvedResult, isSSR);
  6675. }).catch((e) => {
  6676. handleError(e, instance, 0);
  6677. });
  6678. } else {
  6679. instance.asyncDep = setupResult;
  6680. }
  6681. } else {
  6682. handleSetupResult(instance, setupResult, isSSR);
  6683. }
  6684. } else {
  6685. finishComponentSetup(instance, isSSR);
  6686. }
  6687. }
  6688. function handleSetupResult(instance, setupResult, isSSR) {
  6689. if (isFunction(setupResult)) {
  6690. if (instance.type.__ssrInlineRender) {
  6691. instance.ssrRender = setupResult;
  6692. } else {
  6693. instance.render = setupResult;
  6694. }
  6695. } else if (isObject(setupResult)) {
  6696. instance.setupState = proxyRefs(setupResult);
  6697. } else
  6698. ;
  6699. finishComponentSetup(instance, isSSR);
  6700. }
  6701. let compile;
  6702. function finishComponentSetup(instance, isSSR, skipOptions) {
  6703. const Component = instance.type;
  6704. if (!instance.render) {
  6705. if (!isSSR && compile && !Component.render) {
  6706. const template = Component.template || resolveMergedOptions(instance).template;
  6707. if (template) {
  6708. const { isCustomElement, compilerOptions } = instance.appContext.config;
  6709. const { delimiters, compilerOptions: componentCompilerOptions } = Component;
  6710. const finalCompilerOptions = extend(
  6711. extend(
  6712. {
  6713. isCustomElement,
  6714. delimiters
  6715. },
  6716. compilerOptions
  6717. ),
  6718. componentCompilerOptions
  6719. );
  6720. Component.render = compile(template, finalCompilerOptions);
  6721. }
  6722. }
  6723. instance.render = Component.render || NOOP;
  6724. }
  6725. {
  6726. const reset = setCurrentInstance(instance);
  6727. pauseTracking();
  6728. try {
  6729. applyOptions(instance);
  6730. } finally {
  6731. resetTracking();
  6732. reset();
  6733. }
  6734. }
  6735. }
  6736. const attrsProxyHandlers = {
  6737. get(target, key) {
  6738. track(target, "get", "");
  6739. return target[key];
  6740. }
  6741. };
  6742. function createSetupContext(instance) {
  6743. const expose = (exposed) => {
  6744. instance.exposed = exposed || {};
  6745. };
  6746. {
  6747. return {
  6748. attrs: new Proxy(instance.attrs, attrsProxyHandlers),
  6749. slots: instance.slots,
  6750. emit: instance.emit,
  6751. expose
  6752. };
  6753. }
  6754. }
  6755. function getComponentPublicInstance(instance) {
  6756. if (instance.exposed) {
  6757. return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
  6758. get(target, key) {
  6759. if (key in target) {
  6760. return target[key];
  6761. } else if (key in publicPropertiesMap) {
  6762. return publicPropertiesMap[key](instance);
  6763. }
  6764. },
  6765. has(target, key) {
  6766. return key in target || key in publicPropertiesMap;
  6767. }
  6768. }));
  6769. } else {
  6770. return instance.proxy;
  6771. }
  6772. }
  6773. const classifyRE = /(?:^|[-_])\w/g;
  6774. const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, "");
  6775. function getComponentName(Component, includeInferred = true) {
  6776. return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
  6777. }
  6778. function formatComponentName(instance, Component, isRoot = false) {
  6779. let name = getComponentName(Component);
  6780. if (!name && Component.__file) {
  6781. const match = Component.__file.match(/([^/\\]+)\.\w+$/);
  6782. if (match) {
  6783. name = match[1];
  6784. }
  6785. }
  6786. if (!name && instance) {
  6787. const inferFromRegistry = (registry) => {
  6788. for (const key in registry) {
  6789. if (registry[key] === Component) {
  6790. return key;
  6791. }
  6792. }
  6793. };
  6794. name = inferFromRegistry(instance.components) || instance.parent && inferFromRegistry(
  6795. instance.parent.type.components
  6796. ) || inferFromRegistry(instance.appContext.components);
  6797. }
  6798. return name ? classify(name) : isRoot ? `App` : `Anonymous`;
  6799. }
  6800. function isClassComponent(value) {
  6801. return isFunction(value) && "__vccOpts" in value;
  6802. }
  6803. const computed = (getterOrOptions, debugOptions) => {
  6804. const c = computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
  6805. return c;
  6806. };
  6807. function h(type, propsOrChildren, children) {
  6808. try {
  6809. setBlockTracking(-1);
  6810. const l = arguments.length;
  6811. if (l === 2) {
  6812. if (isObject(propsOrChildren) && !isArray$1(propsOrChildren)) {
  6813. if (isVNode(propsOrChildren)) {
  6814. return createVNode(type, null, [propsOrChildren]);
  6815. }
  6816. return createVNode(type, propsOrChildren);
  6817. } else {
  6818. return createVNode(type, null, propsOrChildren);
  6819. }
  6820. } else {
  6821. if (l > 3) {
  6822. children = Array.prototype.slice.call(arguments, 2);
  6823. } else if (l === 3 && isVNode(children)) {
  6824. children = [children];
  6825. }
  6826. return createVNode(type, propsOrChildren, children);
  6827. }
  6828. } finally {
  6829. setBlockTracking(1);
  6830. }
  6831. }
  6832. const version = "3.5.26";
  6833. const warn = NOOP;
  6834. /**
  6835. * @vue/runtime-dom v3.5.26
  6836. * (c) 2018-present Yuxi (Evan) You and Vue contributors
  6837. * @license MIT
  6838. **/
  6839. let policy = void 0;
  6840. const tt = typeof window !== "undefined" && window.trustedTypes;
  6841. if (tt) {
  6842. try {
  6843. policy = /* @__PURE__ */ tt.createPolicy("vue", {
  6844. createHTML: (val) => val
  6845. });
  6846. } catch (e) {
  6847. }
  6848. }
  6849. const unsafeToTrustedHTML = policy ? (val) => policy.createHTML(val) : (val) => val;
  6850. const svgNS = "http://www.w3.org/2000/svg";
  6851. const mathmlNS = "http://www.w3.org/1998/Math/MathML";
  6852. const doc = typeof document !== "undefined" ? document : null;
  6853. const templateContainer = doc && /* @__PURE__ */ doc.createElement("template");
  6854. const nodeOps = {
  6855. insert: (child, parent, anchor) => {
  6856. parent.insertBefore(child, anchor || null);
  6857. },
  6858. remove: (child) => {
  6859. const parent = child.parentNode;
  6860. if (parent) {
  6861. parent.removeChild(child);
  6862. }
  6863. },
  6864. createElement: (tag, namespace, is, props) => {
  6865. const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : is ? doc.createElement(tag, { is }) : doc.createElement(tag);
  6866. if (tag === "select" && props && props.multiple != null) {
  6867. el.setAttribute("multiple", props.multiple);
  6868. }
  6869. return el;
  6870. },
  6871. createText: (text) => doc.createTextNode(text),
  6872. createComment: (text) => doc.createComment(text),
  6873. setText: (node, text) => {
  6874. node.nodeValue = text;
  6875. },
  6876. setElementText: (el, text) => {
  6877. el.textContent = text;
  6878. },
  6879. parentNode: (node) => node.parentNode,
  6880. nextSibling: (node) => node.nextSibling,
  6881. querySelector: (selector) => doc.querySelector(selector),
  6882. setScopeId(el, id) {
  6883. el.setAttribute(id, "");
  6884. },
  6885. // __UNSAFE__
  6886. // Reason: innerHTML.
  6887. // Static content here can only come from compiled templates.
  6888. // As long as the user only uses trusted templates, this is safe.
  6889. insertStaticContent(content, parent, anchor, namespace, start, end) {
  6890. const before = anchor ? anchor.previousSibling : parent.lastChild;
  6891. if (start && (start === end || start.nextSibling)) {
  6892. while (true) {
  6893. parent.insertBefore(start.cloneNode(true), anchor);
  6894. if (start === end || !(start = start.nextSibling))
  6895. break;
  6896. }
  6897. } else {
  6898. templateContainer.innerHTML = unsafeToTrustedHTML(
  6899. namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content
  6900. );
  6901. const template = templateContainer.content;
  6902. if (namespace === "svg" || namespace === "mathml") {
  6903. const wrapper = template.firstChild;
  6904. while (wrapper.firstChild) {
  6905. template.appendChild(wrapper.firstChild);
  6906. }
  6907. template.removeChild(wrapper);
  6908. }
  6909. parent.insertBefore(template, anchor);
  6910. }
  6911. return [
  6912. // first
  6913. before ? before.nextSibling : parent.firstChild,
  6914. // last
  6915. anchor ? anchor.previousSibling : parent.lastChild
  6916. ];
  6917. }
  6918. };
  6919. const TRANSITION = "transition";
  6920. const ANIMATION = "animation";
  6921. const vtcKey = /* @__PURE__ */ Symbol("_vtc");
  6922. const DOMTransitionPropsValidators = {
  6923. name: String,
  6924. type: String,
  6925. css: {
  6926. type: Boolean,
  6927. default: true
  6928. },
  6929. duration: [String, Number, Object],
  6930. enterFromClass: String,
  6931. enterActiveClass: String,
  6932. enterToClass: String,
  6933. appearFromClass: String,
  6934. appearActiveClass: String,
  6935. appearToClass: String,
  6936. leaveFromClass: String,
  6937. leaveActiveClass: String,
  6938. leaveToClass: String
  6939. };
  6940. const TransitionPropsValidators = /* @__PURE__ */ extend(
  6941. {},
  6942. BaseTransitionPropsValidators,
  6943. DOMTransitionPropsValidators
  6944. );
  6945. const decorate$1 = (t) => {
  6946. t.displayName = "Transition";
  6947. t.props = TransitionPropsValidators;
  6948. return t;
  6949. };
  6950. const Transition = /* @__PURE__ */ decorate$1(
  6951. (props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots)
  6952. );
  6953. const callHook = (hook, args = []) => {
  6954. if (isArray$1(hook)) {
  6955. hook.forEach((h2) => h2(...args));
  6956. } else if (hook) {
  6957. hook(...args);
  6958. }
  6959. };
  6960. const hasExplicitCallback = (hook) => {
  6961. return hook ? isArray$1(hook) ? hook.some((h2) => h2.length > 1) : hook.length > 1 : false;
  6962. };
  6963. function resolveTransitionProps(rawProps) {
  6964. const baseProps = {};
  6965. for (const key in rawProps) {
  6966. if (!(key in DOMTransitionPropsValidators)) {
  6967. baseProps[key] = rawProps[key];
  6968. }
  6969. }
  6970. if (rawProps.css === false) {
  6971. return baseProps;
  6972. }
  6973. const {
  6974. name = "v",
  6975. type,
  6976. duration,
  6977. enterFromClass = `${name}-enter-from`,
  6978. enterActiveClass = `${name}-enter-active`,
  6979. enterToClass = `${name}-enter-to`,
  6980. appearFromClass = enterFromClass,
  6981. appearActiveClass = enterActiveClass,
  6982. appearToClass = enterToClass,
  6983. leaveFromClass = `${name}-leave-from`,
  6984. leaveActiveClass = `${name}-leave-active`,
  6985. leaveToClass = `${name}-leave-to`
  6986. } = rawProps;
  6987. const durations = normalizeDuration(duration);
  6988. const enterDuration = durations && durations[0];
  6989. const leaveDuration = durations && durations[1];
  6990. const {
  6991. onBeforeEnter,
  6992. onEnter,
  6993. onEnterCancelled,
  6994. onLeave,
  6995. onLeaveCancelled,
  6996. onBeforeAppear = onBeforeEnter,
  6997. onAppear = onEnter,
  6998. onAppearCancelled = onEnterCancelled
  6999. } = baseProps;
  7000. const finishEnter = (el, isAppear, done, isCancelled) => {
  7001. el._enterCancelled = isCancelled;
  7002. removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
  7003. removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
  7004. done && done();
  7005. };
  7006. const finishLeave = (el, done) => {
  7007. el._isLeaving = false;
  7008. removeTransitionClass(el, leaveFromClass);
  7009. removeTransitionClass(el, leaveToClass);
  7010. removeTransitionClass(el, leaveActiveClass);
  7011. done && done();
  7012. };
  7013. const makeEnterHook = (isAppear) => {
  7014. return (el, done) => {
  7015. const hook = isAppear ? onAppear : onEnter;
  7016. const resolve2 = () => finishEnter(el, isAppear, done);
  7017. callHook(hook, [el, resolve2]);
  7018. nextFrame(() => {
  7019. removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
  7020. addTransitionClass(el, isAppear ? appearToClass : enterToClass);
  7021. if (!hasExplicitCallback(hook)) {
  7022. whenTransitionEnds(el, type, enterDuration, resolve2);
  7023. }
  7024. });
  7025. };
  7026. };
  7027. return extend(baseProps, {
  7028. onBeforeEnter(el) {
  7029. callHook(onBeforeEnter, [el]);
  7030. addTransitionClass(el, enterFromClass);
  7031. addTransitionClass(el, enterActiveClass);
  7032. },
  7033. onBeforeAppear(el) {
  7034. callHook(onBeforeAppear, [el]);
  7035. addTransitionClass(el, appearFromClass);
  7036. addTransitionClass(el, appearActiveClass);
  7037. },
  7038. onEnter: makeEnterHook(false),
  7039. onAppear: makeEnterHook(true),
  7040. onLeave(el, done) {
  7041. el._isLeaving = true;
  7042. const resolve2 = () => finishLeave(el, done);
  7043. addTransitionClass(el, leaveFromClass);
  7044. if (!el._enterCancelled) {
  7045. forceReflow(el);
  7046. addTransitionClass(el, leaveActiveClass);
  7047. } else {
  7048. addTransitionClass(el, leaveActiveClass);
  7049. forceReflow(el);
  7050. }
  7051. nextFrame(() => {
  7052. if (!el._isLeaving) {
  7053. return;
  7054. }
  7055. removeTransitionClass(el, leaveFromClass);
  7056. addTransitionClass(el, leaveToClass);
  7057. if (!hasExplicitCallback(onLeave)) {
  7058. whenTransitionEnds(el, type, leaveDuration, resolve2);
  7059. }
  7060. });
  7061. callHook(onLeave, [el, resolve2]);
  7062. },
  7063. onEnterCancelled(el) {
  7064. finishEnter(el, false, void 0, true);
  7065. callHook(onEnterCancelled, [el]);
  7066. },
  7067. onAppearCancelled(el) {
  7068. finishEnter(el, true, void 0, true);
  7069. callHook(onAppearCancelled, [el]);
  7070. },
  7071. onLeaveCancelled(el) {
  7072. finishLeave(el);
  7073. callHook(onLeaveCancelled, [el]);
  7074. }
  7075. });
  7076. }
  7077. function normalizeDuration(duration) {
  7078. if (duration == null) {
  7079. return null;
  7080. } else if (isObject(duration)) {
  7081. return [NumberOf(duration.enter), NumberOf(duration.leave)];
  7082. } else {
  7083. const n = NumberOf(duration);
  7084. return [n, n];
  7085. }
  7086. }
  7087. function NumberOf(val) {
  7088. const res = toNumber(val);
  7089. return res;
  7090. }
  7091. function addTransitionClass(el, cls) {
  7092. cls.split(/\s+/).forEach((c) => c && el.classList.add(c));
  7093. (el[vtcKey] || (el[vtcKey] = /* @__PURE__ */ new Set())).add(cls);
  7094. }
  7095. function removeTransitionClass(el, cls) {
  7096. cls.split(/\s+/).forEach((c) => c && el.classList.remove(c));
  7097. const _vtc = el[vtcKey];
  7098. if (_vtc) {
  7099. _vtc.delete(cls);
  7100. if (!_vtc.size) {
  7101. el[vtcKey] = void 0;
  7102. }
  7103. }
  7104. }
  7105. function nextFrame(cb) {
  7106. requestAnimationFrame(() => {
  7107. requestAnimationFrame(cb);
  7108. });
  7109. }
  7110. let endId = 0;
  7111. function whenTransitionEnds(el, expectedType, explicitTimeout, resolve2) {
  7112. const id = el._endId = ++endId;
  7113. const resolveIfNotStale = () => {
  7114. if (id === el._endId) {
  7115. resolve2();
  7116. }
  7117. };
  7118. if (explicitTimeout != null) {
  7119. return setTimeout(resolveIfNotStale, explicitTimeout);
  7120. }
  7121. const { type, timeout, propCount } = getTransitionInfo(el, expectedType);
  7122. if (!type) {
  7123. return resolve2();
  7124. }
  7125. const endEvent = type + "end";
  7126. let ended = 0;
  7127. const end = () => {
  7128. el.removeEventListener(endEvent, onEnd);
  7129. resolveIfNotStale();
  7130. };
  7131. const onEnd = (e) => {
  7132. if (e.target === el && ++ended >= propCount) {
  7133. end();
  7134. }
  7135. };
  7136. setTimeout(() => {
  7137. if (ended < propCount) {
  7138. end();
  7139. }
  7140. }, timeout + 1);
  7141. el.addEventListener(endEvent, onEnd);
  7142. }
  7143. function getTransitionInfo(el, expectedType) {
  7144. const styles = window.getComputedStyle(el);
  7145. const getStyleProperties = (key) => (styles[key] || "").split(", ");
  7146. const transitionDelays = getStyleProperties(`${TRANSITION}Delay`);
  7147. const transitionDurations = getStyleProperties(`${TRANSITION}Duration`);
  7148. const transitionTimeout = getTimeout(transitionDelays, transitionDurations);
  7149. const animationDelays = getStyleProperties(`${ANIMATION}Delay`);
  7150. const animationDurations = getStyleProperties(`${ANIMATION}Duration`);
  7151. const animationTimeout = getTimeout(animationDelays, animationDurations);
  7152. let type = null;
  7153. let timeout = 0;
  7154. let propCount = 0;
  7155. if (expectedType === TRANSITION) {
  7156. if (transitionTimeout > 0) {
  7157. type = TRANSITION;
  7158. timeout = transitionTimeout;
  7159. propCount = transitionDurations.length;
  7160. }
  7161. } else if (expectedType === ANIMATION) {
  7162. if (animationTimeout > 0) {
  7163. type = ANIMATION;
  7164. timeout = animationTimeout;
  7165. propCount = animationDurations.length;
  7166. }
  7167. } else {
  7168. timeout = Math.max(transitionTimeout, animationTimeout);
  7169. type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null;
  7170. propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0;
  7171. }
  7172. const hasTransform = type === TRANSITION && /\b(?:transform|all)(?:,|$)/.test(
  7173. getStyleProperties(`${TRANSITION}Property`).toString()
  7174. );
  7175. return {
  7176. type,
  7177. timeout,
  7178. propCount,
  7179. hasTransform
  7180. };
  7181. }
  7182. function getTimeout(delays, durations) {
  7183. while (delays.length < durations.length) {
  7184. delays = delays.concat(delays);
  7185. }
  7186. return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i])));
  7187. }
  7188. function toMs(s) {
  7189. if (s === "auto")
  7190. return 0;
  7191. return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
  7192. }
  7193. function forceReflow(el) {
  7194. const targetDocument = el ? el.ownerDocument : document;
  7195. return targetDocument.body.offsetHeight;
  7196. }
  7197. function patchClass(el, value, isSVG) {
  7198. const transitionClasses = el[vtcKey];
  7199. if (transitionClasses) {
  7200. value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" ");
  7201. }
  7202. if (value == null) {
  7203. el.removeAttribute("class");
  7204. } else if (isSVG) {
  7205. el.setAttribute("class", value);
  7206. } else {
  7207. el.className = value;
  7208. }
  7209. }
  7210. const vShowOriginalDisplay = /* @__PURE__ */ Symbol("_vod");
  7211. const vShowHidden = /* @__PURE__ */ Symbol("_vsh");
  7212. const vShow = {
  7213. // used for prop mismatch check during hydration
  7214. name: "show",
  7215. beforeMount(el, { value }, { transition }) {
  7216. el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display;
  7217. if (transition && value) {
  7218. transition.beforeEnter(el);
  7219. } else {
  7220. setDisplay(el, value);
  7221. }
  7222. },
  7223. mounted(el, { value }, { transition }) {
  7224. if (transition && value) {
  7225. transition.enter(el);
  7226. }
  7227. },
  7228. updated(el, { value, oldValue }, { transition }) {
  7229. if (!value === !oldValue)
  7230. return;
  7231. if (transition) {
  7232. if (value) {
  7233. transition.beforeEnter(el);
  7234. setDisplay(el, true);
  7235. transition.enter(el);
  7236. } else {
  7237. transition.leave(el, () => {
  7238. setDisplay(el, false);
  7239. });
  7240. }
  7241. } else {
  7242. setDisplay(el, value);
  7243. }
  7244. },
  7245. beforeUnmount(el, { value }) {
  7246. setDisplay(el, value);
  7247. }
  7248. };
  7249. function setDisplay(el, value) {
  7250. el.style.display = value ? el[vShowOriginalDisplay] : "none";
  7251. el[vShowHidden] = !value;
  7252. }
  7253. const CSS_VAR_TEXT = /* @__PURE__ */ Symbol("");
  7254. const displayRE = /(?:^|;)\s*display\s*:/;
  7255. function patchStyle(el, prev, next) {
  7256. const style = el.style;
  7257. const isCssString = isString(next);
  7258. let hasControlledDisplay = false;
  7259. if (next && !isCssString) {
  7260. if (prev) {
  7261. if (!isString(prev)) {
  7262. for (const key in prev) {
  7263. if (next[key] == null) {
  7264. setStyle(style, key, "");
  7265. }
  7266. }
  7267. } else {
  7268. for (const prevStyle of prev.split(";")) {
  7269. const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
  7270. if (next[key] == null) {
  7271. setStyle(style, key, "");
  7272. }
  7273. }
  7274. }
  7275. }
  7276. for (const key in next) {
  7277. if (key === "display") {
  7278. hasControlledDisplay = true;
  7279. }
  7280. setStyle(style, key, next[key]);
  7281. }
  7282. } else {
  7283. if (isCssString) {
  7284. if (prev !== next) {
  7285. const cssVarText = style[CSS_VAR_TEXT];
  7286. if (cssVarText) {
  7287. next += ";" + cssVarText;
  7288. }
  7289. style.cssText = next;
  7290. hasControlledDisplay = displayRE.test(next);
  7291. }
  7292. } else if (prev) {
  7293. el.removeAttribute("style");
  7294. }
  7295. }
  7296. if (vShowOriginalDisplay in el) {
  7297. el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
  7298. if (el[vShowHidden]) {
  7299. style.display = "none";
  7300. }
  7301. }
  7302. }
  7303. const importantRE = /\s*!important$/;
  7304. function setStyle(style, name, val) {
  7305. if (isArray$1(val)) {
  7306. val.forEach((v) => setStyle(style, name, v));
  7307. } else {
  7308. if (val == null)
  7309. val = "";
  7310. if (name.startsWith("--")) {
  7311. style.setProperty(name, val);
  7312. } else {
  7313. const prefixed = autoPrefix(style, name);
  7314. if (importantRE.test(val)) {
  7315. style.setProperty(
  7316. hyphenate(prefixed),
  7317. val.replace(importantRE, ""),
  7318. "important"
  7319. );
  7320. } else {
  7321. style[prefixed] = val;
  7322. }
  7323. }
  7324. }
  7325. }
  7326. const prefixes = ["Webkit", "Moz", "ms"];
  7327. const prefixCache = {};
  7328. function autoPrefix(style, rawName) {
  7329. const cached = prefixCache[rawName];
  7330. if (cached) {
  7331. return cached;
  7332. }
  7333. let name = camelize(rawName);
  7334. if (name !== "filter" && name in style) {
  7335. return prefixCache[rawName] = name;
  7336. }
  7337. name = capitalize(name);
  7338. for (let i = 0; i < prefixes.length; i++) {
  7339. const prefixed = prefixes[i] + name;
  7340. if (prefixed in style) {
  7341. return prefixCache[rawName] = prefixed;
  7342. }
  7343. }
  7344. return rawName;
  7345. }
  7346. const xlinkNS = "http://www.w3.org/1999/xlink";
  7347. function patchAttr(el, key, value, isSVG, instance, isBoolean = isSpecialBooleanAttr(key)) {
  7348. if (isSVG && key.startsWith("xlink:")) {
  7349. if (value == null) {
  7350. el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
  7351. } else {
  7352. el.setAttributeNS(xlinkNS, key, value);
  7353. }
  7354. } else {
  7355. if (value == null || isBoolean && !includeBooleanAttr(value)) {
  7356. el.removeAttribute(key);
  7357. } else {
  7358. el.setAttribute(
  7359. key,
  7360. isBoolean ? "" : isSymbol(value) ? String(value) : value
  7361. );
  7362. }
  7363. }
  7364. }
  7365. function patchDOMProp(el, key, value, parentComponent, attrName) {
  7366. if (key === "innerHTML" || key === "textContent") {
  7367. if (value != null) {
  7368. el[key] = key === "innerHTML" ? unsafeToTrustedHTML(value) : value;
  7369. }
  7370. return;
  7371. }
  7372. const tag = el.tagName;
  7373. if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
  7374. !tag.includes("-")) {
  7375. const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
  7376. const newValue = value == null ? (
  7377. // #11647: value should be set as empty string for null and undefined,
  7378. // but <input type="checkbox"> should be set as 'on'.
  7379. el.type === "checkbox" ? "on" : ""
  7380. ) : String(value);
  7381. if (oldValue !== newValue || !("_value" in el)) {
  7382. el.value = newValue;
  7383. }
  7384. if (value == null) {
  7385. el.removeAttribute(key);
  7386. }
  7387. el._value = value;
  7388. return;
  7389. }
  7390. let needRemove = false;
  7391. if (value === "" || value == null) {
  7392. const type = typeof el[key];
  7393. if (type === "boolean") {
  7394. value = includeBooleanAttr(value);
  7395. } else if (value == null && type === "string") {
  7396. value = "";
  7397. needRemove = true;
  7398. } else if (type === "number") {
  7399. value = 0;
  7400. needRemove = true;
  7401. }
  7402. }
  7403. try {
  7404. el[key] = value;
  7405. } catch (e) {
  7406. }
  7407. needRemove && el.removeAttribute(attrName || key);
  7408. }
  7409. function addEventListener(el, event, handler, options) {
  7410. el.addEventListener(event, handler, options);
  7411. }
  7412. function removeEventListener(el, event, handler, options) {
  7413. el.removeEventListener(event, handler, options);
  7414. }
  7415. const veiKey = /* @__PURE__ */ Symbol("_vei");
  7416. function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
  7417. const invokers = el[veiKey] || (el[veiKey] = {});
  7418. const existingInvoker = invokers[rawName];
  7419. if (nextValue && existingInvoker) {
  7420. existingInvoker.value = nextValue;
  7421. } else {
  7422. const [name, options] = parseName(rawName);
  7423. if (nextValue) {
  7424. const invoker = invokers[rawName] = createInvoker(
  7425. nextValue,
  7426. instance
  7427. );
  7428. addEventListener(el, name, invoker, options);
  7429. } else if (existingInvoker) {
  7430. removeEventListener(el, name, existingInvoker, options);
  7431. invokers[rawName] = void 0;
  7432. }
  7433. }
  7434. }
  7435. const optionsModifierRE = /(?:Once|Passive|Capture)$/;
  7436. function parseName(name) {
  7437. let options;
  7438. if (optionsModifierRE.test(name)) {
  7439. options = {};
  7440. let m;
  7441. while (m = name.match(optionsModifierRE)) {
  7442. name = name.slice(0, name.length - m[0].length);
  7443. options[m[0].toLowerCase()] = true;
  7444. }
  7445. }
  7446. const event = name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2));
  7447. return [event, options];
  7448. }
  7449. let cachedNow = 0;
  7450. const p = /* @__PURE__ */ Promise.resolve();
  7451. const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now());
  7452. function createInvoker(initialValue, instance) {
  7453. const invoker = (e) => {
  7454. if (!e._vts) {
  7455. e._vts = Date.now();
  7456. } else if (e._vts <= invoker.attached) {
  7457. return;
  7458. }
  7459. callWithAsyncErrorHandling(
  7460. patchStopImmediatePropagation(e, invoker.value),
  7461. instance,
  7462. 5,
  7463. [e]
  7464. );
  7465. };
  7466. invoker.value = initialValue;
  7467. invoker.attached = getNow();
  7468. return invoker;
  7469. }
  7470. function patchStopImmediatePropagation(e, value) {
  7471. if (isArray$1(value)) {
  7472. const originalStop = e.stopImmediatePropagation;
  7473. e.stopImmediatePropagation = () => {
  7474. originalStop.call(e);
  7475. e._stopped = true;
  7476. };
  7477. return value.map(
  7478. (fn) => (e2) => !e2._stopped && fn && fn(e2)
  7479. );
  7480. } else {
  7481. return value;
  7482. }
  7483. }
  7484. const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
  7485. key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
  7486. const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => {
  7487. const isSVG = namespace === "svg";
  7488. if (key === "class") {
  7489. patchClass(el, nextValue, isSVG);
  7490. } else if (key === "style") {
  7491. patchStyle(el, prevValue, nextValue);
  7492. } else if (isOn(key)) {
  7493. if (!isModelListener(key)) {
  7494. patchEvent(el, key, prevValue, nextValue, parentComponent);
  7495. }
  7496. } else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) {
  7497. patchDOMProp(el, key, nextValue);
  7498. if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) {
  7499. patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value");
  7500. }
  7501. } else if (
  7502. // #11081 force set props for possible async custom element
  7503. el._isVueCE && (/[A-Z]/.test(key) || !isString(nextValue))
  7504. ) {
  7505. patchDOMProp(el, camelize(key), nextValue, parentComponent, key);
  7506. } else {
  7507. if (key === "true-value") {
  7508. el._trueValue = nextValue;
  7509. } else if (key === "false-value") {
  7510. el._falseValue = nextValue;
  7511. }
  7512. patchAttr(el, key, nextValue, isSVG);
  7513. }
  7514. };
  7515. function shouldSetAsProp(el, key, value, isSVG) {
  7516. if (isSVG) {
  7517. if (key === "innerHTML" || key === "textContent") {
  7518. return true;
  7519. }
  7520. if (key in el && isNativeOn(key) && isFunction(value)) {
  7521. return true;
  7522. }
  7523. return false;
  7524. }
  7525. if (key === "spellcheck" || key === "draggable" || key === "translate" || key === "autocorrect") {
  7526. return false;
  7527. }
  7528. if (key === "sandbox" && el.tagName === "IFRAME") {
  7529. return false;
  7530. }
  7531. if (key === "form") {
  7532. return false;
  7533. }
  7534. if (key === "list" && el.tagName === "INPUT") {
  7535. return false;
  7536. }
  7537. if (key === "type" && el.tagName === "TEXTAREA") {
  7538. return false;
  7539. }
  7540. if (key === "width" || key === "height") {
  7541. const tag = el.tagName;
  7542. if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") {
  7543. return false;
  7544. }
  7545. }
  7546. if (isNativeOn(key) && isString(value)) {
  7547. return false;
  7548. }
  7549. return key in el;
  7550. }
  7551. const positionMap = /* @__PURE__ */ new WeakMap();
  7552. const newPositionMap = /* @__PURE__ */ new WeakMap();
  7553. const moveCbKey = /* @__PURE__ */ Symbol("_moveCb");
  7554. const enterCbKey = /* @__PURE__ */ Symbol("_enterCb");
  7555. const decorate = (t) => {
  7556. delete t.props.mode;
  7557. return t;
  7558. };
  7559. const TransitionGroupImpl = /* @__PURE__ */ decorate({
  7560. name: "TransitionGroup",
  7561. props: /* @__PURE__ */ extend({}, TransitionPropsValidators, {
  7562. tag: String,
  7563. moveClass: String
  7564. }),
  7565. setup(props, { slots }) {
  7566. const instance = getCurrentInstance();
  7567. const state = useTransitionState();
  7568. let prevChildren;
  7569. let children;
  7570. onUpdated(() => {
  7571. if (!prevChildren.length) {
  7572. return;
  7573. }
  7574. const moveClass = props.moveClass || `${props.name || "v"}-move`;
  7575. if (!hasCSSTransform(
  7576. prevChildren[0].el,
  7577. instance.vnode.el,
  7578. moveClass
  7579. )) {
  7580. prevChildren = [];
  7581. return;
  7582. }
  7583. prevChildren.forEach(callPendingCbs);
  7584. prevChildren.forEach(recordPosition);
  7585. const movedChildren = prevChildren.filter(applyTranslation);
  7586. forceReflow(instance.vnode.el);
  7587. movedChildren.forEach((c) => {
  7588. const el = c.el;
  7589. const style = el.style;
  7590. addTransitionClass(el, moveClass);
  7591. style.transform = style.webkitTransform = style.transitionDuration = "";
  7592. const cb = el[moveCbKey] = (e) => {
  7593. if (e && e.target !== el) {
  7594. return;
  7595. }
  7596. if (!e || e.propertyName.endsWith("transform")) {
  7597. el.removeEventListener("transitionend", cb);
  7598. el[moveCbKey] = null;
  7599. removeTransitionClass(el, moveClass);
  7600. }
  7601. };
  7602. el.addEventListener("transitionend", cb);
  7603. });
  7604. prevChildren = [];
  7605. });
  7606. return () => {
  7607. const rawProps = toRaw(props);
  7608. const cssTransitionProps = resolveTransitionProps(rawProps);
  7609. let tag = rawProps.tag || Fragment;
  7610. prevChildren = [];
  7611. if (children) {
  7612. for (let i = 0; i < children.length; i++) {
  7613. const child = children[i];
  7614. if (child.el && child.el instanceof Element) {
  7615. prevChildren.push(child);
  7616. setTransitionHooks(
  7617. child,
  7618. resolveTransitionHooks(
  7619. child,
  7620. cssTransitionProps,
  7621. state,
  7622. instance
  7623. )
  7624. );
  7625. positionMap.set(child, {
  7626. left: child.el.offsetLeft,
  7627. top: child.el.offsetTop
  7628. });
  7629. }
  7630. }
  7631. }
  7632. children = slots.default ? getTransitionRawChildren(slots.default()) : [];
  7633. for (let i = 0; i < children.length; i++) {
  7634. const child = children[i];
  7635. if (child.key != null) {
  7636. setTransitionHooks(
  7637. child,
  7638. resolveTransitionHooks(child, cssTransitionProps, state, instance)
  7639. );
  7640. }
  7641. }
  7642. return createVNode(tag, null, children);
  7643. };
  7644. }
  7645. });
  7646. const TransitionGroup = TransitionGroupImpl;
  7647. function callPendingCbs(c) {
  7648. const el = c.el;
  7649. if (el[moveCbKey]) {
  7650. el[moveCbKey]();
  7651. }
  7652. if (el[enterCbKey]) {
  7653. el[enterCbKey]();
  7654. }
  7655. }
  7656. function recordPosition(c) {
  7657. newPositionMap.set(c, {
  7658. left: c.el.offsetLeft,
  7659. top: c.el.offsetTop
  7660. });
  7661. }
  7662. function applyTranslation(c) {
  7663. const oldPos = positionMap.get(c);
  7664. const newPos = newPositionMap.get(c);
  7665. const dx = oldPos.left - newPos.left;
  7666. const dy = oldPos.top - newPos.top;
  7667. if (dx || dy) {
  7668. const s = c.el.style;
  7669. s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`;
  7670. s.transitionDuration = "0s";
  7671. return c;
  7672. }
  7673. }
  7674. function hasCSSTransform(el, root, moveClass) {
  7675. const clone = el.cloneNode();
  7676. const _vtc = el[vtcKey];
  7677. if (_vtc) {
  7678. _vtc.forEach((cls) => {
  7679. cls.split(/\s+/).forEach((c) => c && clone.classList.remove(c));
  7680. });
  7681. }
  7682. moveClass.split(/\s+/).forEach((c) => c && clone.classList.add(c));
  7683. clone.style.display = "none";
  7684. const container = root.nodeType === 1 ? root : root.parentNode;
  7685. container.appendChild(clone);
  7686. const { hasTransform } = getTransitionInfo(clone);
  7687. container.removeChild(clone);
  7688. return hasTransform;
  7689. }
  7690. const getModelAssigner = (vnode) => {
  7691. const fn = vnode.props["onUpdate:modelValue"] || false;
  7692. return isArray$1(fn) ? (value) => invokeArrayFns(fn, value) : fn;
  7693. };
  7694. function onCompositionStart(e) {
  7695. e.target.composing = true;
  7696. }
  7697. function onCompositionEnd(e) {
  7698. const target = e.target;
  7699. if (target.composing) {
  7700. target.composing = false;
  7701. target.dispatchEvent(new Event("input"));
  7702. }
  7703. }
  7704. const assignKey = /* @__PURE__ */ Symbol("_assign");
  7705. function castValue(value, trim, number) {
  7706. if (trim)
  7707. value = value.trim();
  7708. if (number)
  7709. value = looseToNumber(value);
  7710. return value;
  7711. }
  7712. const vModelText = {
  7713. created(el, { modifiers: { lazy, trim, number } }, vnode) {
  7714. el[assignKey] = getModelAssigner(vnode);
  7715. const castToNumber = number || vnode.props && vnode.props.type === "number";
  7716. addEventListener(el, lazy ? "change" : "input", (e) => {
  7717. if (e.target.composing)
  7718. return;
  7719. el[assignKey](castValue(el.value, trim, castToNumber));
  7720. });
  7721. if (trim || castToNumber) {
  7722. addEventListener(el, "change", () => {
  7723. el.value = castValue(el.value, trim, castToNumber);
  7724. });
  7725. }
  7726. if (!lazy) {
  7727. addEventListener(el, "compositionstart", onCompositionStart);
  7728. addEventListener(el, "compositionend", onCompositionEnd);
  7729. addEventListener(el, "change", onCompositionEnd);
  7730. }
  7731. },
  7732. // set value on mounted so it's after min/max for type="range"
  7733. mounted(el, { value }) {
  7734. el.value = value == null ? "" : value;
  7735. },
  7736. beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
  7737. el[assignKey] = getModelAssigner(vnode);
  7738. if (el.composing)
  7739. return;
  7740. const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? looseToNumber(el.value) : el.value;
  7741. const newValue = value == null ? "" : value;
  7742. if (elValue === newValue) {
  7743. return;
  7744. }
  7745. if (document.activeElement === el && el.type !== "range") {
  7746. if (lazy && value === oldValue) {
  7747. return;
  7748. }
  7749. if (trim && el.value.trim() === newValue) {
  7750. return;
  7751. }
  7752. }
  7753. el.value = newValue;
  7754. }
  7755. };
  7756. const vModelCheckbox = {
  7757. // #4096 array checkboxes need to be deep traversed
  7758. deep: true,
  7759. created(el, _, vnode) {
  7760. el[assignKey] = getModelAssigner(vnode);
  7761. addEventListener(el, "change", () => {
  7762. const modelValue = el._modelValue;
  7763. const elementValue = getValue(el);
  7764. const checked = el.checked;
  7765. const assign2 = el[assignKey];
  7766. if (isArray$1(modelValue)) {
  7767. const index = looseIndexOf(modelValue, elementValue);
  7768. const found = index !== -1;
  7769. if (checked && !found) {
  7770. assign2(modelValue.concat(elementValue));
  7771. } else if (!checked && found) {
  7772. const filtered = [...modelValue];
  7773. filtered.splice(index, 1);
  7774. assign2(filtered);
  7775. }
  7776. } else if (isSet(modelValue)) {
  7777. const cloned = new Set(modelValue);
  7778. if (checked) {
  7779. cloned.add(elementValue);
  7780. } else {
  7781. cloned.delete(elementValue);
  7782. }
  7783. assign2(cloned);
  7784. } else {
  7785. assign2(getCheckboxValue(el, checked));
  7786. }
  7787. });
  7788. },
  7789. // set initial checked on mount to wait for true-value/false-value
  7790. mounted: setChecked,
  7791. beforeUpdate(el, binding, vnode) {
  7792. el[assignKey] = getModelAssigner(vnode);
  7793. setChecked(el, binding, vnode);
  7794. }
  7795. };
  7796. function setChecked(el, { value, oldValue }, vnode) {
  7797. el._modelValue = value;
  7798. let checked;
  7799. if (isArray$1(value)) {
  7800. checked = looseIndexOf(value, vnode.props.value) > -1;
  7801. } else if (isSet(value)) {
  7802. checked = value.has(vnode.props.value);
  7803. } else {
  7804. if (value === oldValue)
  7805. return;
  7806. checked = looseEqual(value, getCheckboxValue(el, true));
  7807. }
  7808. if (el.checked !== checked) {
  7809. el.checked = checked;
  7810. }
  7811. }
  7812. const vModelRadio = {
  7813. created(el, { value }, vnode) {
  7814. el.checked = looseEqual(value, vnode.props.value);
  7815. el[assignKey] = getModelAssigner(vnode);
  7816. addEventListener(el, "change", () => {
  7817. el[assignKey](getValue(el));
  7818. });
  7819. },
  7820. beforeUpdate(el, { value, oldValue }, vnode) {
  7821. el[assignKey] = getModelAssigner(vnode);
  7822. if (value !== oldValue) {
  7823. el.checked = looseEqual(value, vnode.props.value);
  7824. }
  7825. }
  7826. };
  7827. function getValue(el) {
  7828. return "_value" in el ? el._value : el.value;
  7829. }
  7830. function getCheckboxValue(el, checked) {
  7831. const key = checked ? "_trueValue" : "_falseValue";
  7832. return key in el ? el[key] : checked;
  7833. }
  7834. const systemModifiers = ["ctrl", "shift", "alt", "meta"];
  7835. const modifierGuards = {
  7836. stop: (e) => e.stopPropagation(),
  7837. prevent: (e) => e.preventDefault(),
  7838. self: (e) => e.target !== e.currentTarget,
  7839. ctrl: (e) => !e.ctrlKey,
  7840. shift: (e) => !e.shiftKey,
  7841. alt: (e) => !e.altKey,
  7842. meta: (e) => !e.metaKey,
  7843. left: (e) => "button" in e && e.button !== 0,
  7844. middle: (e) => "button" in e && e.button !== 1,
  7845. right: (e) => "button" in e && e.button !== 2,
  7846. exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
  7847. };
  7848. const withModifiers = (fn, modifiers) => {
  7849. const cache = fn._withMods || (fn._withMods = {});
  7850. const cacheKey = modifiers.join(".");
  7851. return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => {
  7852. for (let i = 0; i < modifiers.length; i++) {
  7853. const guard = modifierGuards[modifiers[i]];
  7854. if (guard && guard(event, modifiers))
  7855. return;
  7856. }
  7857. return fn(event, ...args);
  7858. });
  7859. };
  7860. const keyNames = {
  7861. esc: "escape",
  7862. space: " ",
  7863. up: "arrow-up",
  7864. left: "arrow-left",
  7865. right: "arrow-right",
  7866. down: "arrow-down",
  7867. delete: "backspace"
  7868. };
  7869. const withKeys = (fn, modifiers) => {
  7870. const cache = fn._withKeys || (fn._withKeys = {});
  7871. const cacheKey = modifiers.join(".");
  7872. return cache[cacheKey] || (cache[cacheKey] = (event) => {
  7873. if (!("key" in event)) {
  7874. return;
  7875. }
  7876. const eventKey = hyphenate(event.key);
  7877. if (modifiers.some(
  7878. (k) => k === eventKey || keyNames[k] === eventKey
  7879. )) {
  7880. return fn(event);
  7881. }
  7882. });
  7883. };
  7884. const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
  7885. let renderer;
  7886. function ensureRenderer() {
  7887. return renderer || (renderer = createRenderer(rendererOptions));
  7888. }
  7889. const render = (...args) => {
  7890. ensureRenderer().render(...args);
  7891. };
  7892. const createApp = (...args) => {
  7893. const app = ensureRenderer().createApp(...args);
  7894. const { mount } = app;
  7895. app.mount = (containerOrSelector) => {
  7896. const container = normalizeContainer(containerOrSelector);
  7897. if (!container)
  7898. return;
  7899. const component = app._component;
  7900. if (!isFunction(component) && !component.render && !component.template) {
  7901. component.template = container.innerHTML;
  7902. }
  7903. if (container.nodeType === 1) {
  7904. container.textContent = "";
  7905. }
  7906. const proxy = mount(container, false, resolveRootNamespace(container));
  7907. if (container instanceof Element) {
  7908. container.removeAttribute("v-cloak");
  7909. container.setAttribute("data-v-app", "");
  7910. }
  7911. return proxy;
  7912. };
  7913. return app;
  7914. };
  7915. function resolveRootNamespace(container) {
  7916. if (container instanceof SVGElement) {
  7917. return "svg";
  7918. }
  7919. if (typeof MathMLElement === "function" && container instanceof MathMLElement) {
  7920. return "mathml";
  7921. }
  7922. }
  7923. function normalizeContainer(container) {
  7924. if (isString(container)) {
  7925. const res = document.querySelector(container);
  7926. return res;
  7927. }
  7928. return container;
  7929. }
  7930. var isVue2 = false;
  7931. /*!
  7932. * pinia v2.3.1
  7933. * (c) 2025 Eduardo San Martin Morote
  7934. * @license MIT
  7935. */
  7936. let activePinia;
  7937. const setActivePinia = (pinia) => activePinia = pinia;
  7938. const piniaSymbol = (
  7939. /* istanbul ignore next */
  7940. Symbol()
  7941. );
  7942. function isPlainObject(o) {
  7943. return o && typeof o === "object" && Object.prototype.toString.call(o) === "[object Object]" && typeof o.toJSON !== "function";
  7944. }
  7945. var MutationType;
  7946. (function(MutationType2) {
  7947. MutationType2["direct"] = "direct";
  7948. MutationType2["patchObject"] = "patch object";
  7949. MutationType2["patchFunction"] = "patch function";
  7950. })(MutationType || (MutationType = {}));
  7951. function createPinia() {
  7952. const scope = effectScope(true);
  7953. const state = scope.run(() => ref({}));
  7954. let _p = [];
  7955. let toBeInstalled = [];
  7956. const pinia = markRaw({
  7957. install(app) {
  7958. setActivePinia(pinia);
  7959. {
  7960. pinia._a = app;
  7961. app.provide(piniaSymbol, pinia);
  7962. app.config.globalProperties.$pinia = pinia;
  7963. toBeInstalled.forEach((plugin) => _p.push(plugin));
  7964. toBeInstalled = [];
  7965. }
  7966. },
  7967. use(plugin) {
  7968. if (!this._a && !isVue2) {
  7969. toBeInstalled.push(plugin);
  7970. } else {
  7971. _p.push(plugin);
  7972. }
  7973. return this;
  7974. },
  7975. _p,
  7976. // it's actually undefined here
  7977. // @ts-expect-error
  7978. _a: null,
  7979. _e: scope,
  7980. _s: /* @__PURE__ */ new Map(),
  7981. state
  7982. });
  7983. return pinia;
  7984. }
  7985. const noop$1 = () => {
  7986. };
  7987. function addSubscription(subscriptions, callback, detached, onCleanup = noop$1) {
  7988. subscriptions.push(callback);
  7989. const removeSubscription = () => {
  7990. const idx = subscriptions.indexOf(callback);
  7991. if (idx > -1) {
  7992. subscriptions.splice(idx, 1);
  7993. onCleanup();
  7994. }
  7995. };
  7996. if (!detached && getCurrentScope()) {
  7997. onScopeDispose(removeSubscription);
  7998. }
  7999. return removeSubscription;
  8000. }
  8001. function triggerSubscriptions(subscriptions, ...args) {
  8002. subscriptions.slice().forEach((callback) => {
  8003. callback(...args);
  8004. });
  8005. }
  8006. const fallbackRunWithContext = (fn) => fn();
  8007. const ACTION_MARKER = Symbol();
  8008. const ACTION_NAME = Symbol();
  8009. function mergeReactiveObjects(target, patchToApply) {
  8010. if (target instanceof Map && patchToApply instanceof Map) {
  8011. patchToApply.forEach((value, key) => target.set(key, value));
  8012. } else if (target instanceof Set && patchToApply instanceof Set) {
  8013. patchToApply.forEach(target.add, target);
  8014. }
  8015. for (const key in patchToApply) {
  8016. if (!patchToApply.hasOwnProperty(key))
  8017. continue;
  8018. const subPatch = patchToApply[key];
  8019. const targetValue = target[key];
  8020. if (isPlainObject(targetValue) && isPlainObject(subPatch) && target.hasOwnProperty(key) && !isRef(subPatch) && !isReactive(subPatch)) {
  8021. target[key] = mergeReactiveObjects(targetValue, subPatch);
  8022. } else {
  8023. target[key] = subPatch;
  8024. }
  8025. }
  8026. return target;
  8027. }
  8028. const skipHydrateSymbol = (
  8029. /* istanbul ignore next */
  8030. Symbol()
  8031. );
  8032. function shouldHydrate(obj) {
  8033. return !isPlainObject(obj) || !obj.hasOwnProperty(skipHydrateSymbol);
  8034. }
  8035. const { assign: assign$1 } = Object;
  8036. function isComputed(o) {
  8037. return !!(isRef(o) && o.effect);
  8038. }
  8039. function createOptionsStore(id, options, pinia, hot) {
  8040. const { state, actions, getters } = options;
  8041. const initialState = pinia.state.value[id];
  8042. let store;
  8043. function setup() {
  8044. if (!initialState && true) {
  8045. {
  8046. pinia.state.value[id] = state ? state() : {};
  8047. }
  8048. }
  8049. const localState = toRefs(pinia.state.value[id]);
  8050. return assign$1(localState, actions, Object.keys(getters || {}).reduce((computedGetters, name) => {
  8051. computedGetters[name] = markRaw(computed(() => {
  8052. setActivePinia(pinia);
  8053. const store2 = pinia._s.get(id);
  8054. return getters[name].call(store2, store2);
  8055. }));
  8056. return computedGetters;
  8057. }, {}));
  8058. }
  8059. store = createSetupStore(id, setup, options, pinia, hot, true);
  8060. return store;
  8061. }
  8062. function createSetupStore($id, setup, options = {}, pinia, hot, isOptionsStore) {
  8063. let scope;
  8064. const optionsForPlugin = assign$1({ actions: {} }, options);
  8065. const $subscribeOptions = { deep: true };
  8066. let isListening;
  8067. let isSyncListening;
  8068. let subscriptions = [];
  8069. let actionSubscriptions = [];
  8070. let debuggerEvents;
  8071. const initialState = pinia.state.value[$id];
  8072. if (!isOptionsStore && !initialState && true) {
  8073. {
  8074. pinia.state.value[$id] = {};
  8075. }
  8076. }
  8077. ref({});
  8078. let activeListener;
  8079. function $patch(partialStateOrMutator) {
  8080. let subscriptionMutation;
  8081. isListening = isSyncListening = false;
  8082. if (typeof partialStateOrMutator === "function") {
  8083. partialStateOrMutator(pinia.state.value[$id]);
  8084. subscriptionMutation = {
  8085. type: MutationType.patchFunction,
  8086. storeId: $id,
  8087. events: debuggerEvents
  8088. };
  8089. } else {
  8090. mergeReactiveObjects(pinia.state.value[$id], partialStateOrMutator);
  8091. subscriptionMutation = {
  8092. type: MutationType.patchObject,
  8093. payload: partialStateOrMutator,
  8094. storeId: $id,
  8095. events: debuggerEvents
  8096. };
  8097. }
  8098. const myListenerId = activeListener = Symbol();
  8099. nextTick().then(() => {
  8100. if (activeListener === myListenerId) {
  8101. isListening = true;
  8102. }
  8103. });
  8104. isSyncListening = true;
  8105. triggerSubscriptions(subscriptions, subscriptionMutation, pinia.state.value[$id]);
  8106. }
  8107. const $reset = isOptionsStore ? function $reset2() {
  8108. const { state } = options;
  8109. const newState = state ? state() : {};
  8110. this.$patch(($state) => {
  8111. assign$1($state, newState);
  8112. });
  8113. } : (
  8114. /* istanbul ignore next */
  8115. noop$1
  8116. );
  8117. function $dispose() {
  8118. scope.stop();
  8119. subscriptions = [];
  8120. actionSubscriptions = [];
  8121. pinia._s.delete($id);
  8122. }
  8123. const action = (fn, name = "") => {
  8124. if (ACTION_MARKER in fn) {
  8125. fn[ACTION_NAME] = name;
  8126. return fn;
  8127. }
  8128. const wrappedAction = function() {
  8129. setActivePinia(pinia);
  8130. const args = Array.from(arguments);
  8131. const afterCallbackList = [];
  8132. const onErrorCallbackList = [];
  8133. function after(callback) {
  8134. afterCallbackList.push(callback);
  8135. }
  8136. function onError(callback) {
  8137. onErrorCallbackList.push(callback);
  8138. }
  8139. triggerSubscriptions(actionSubscriptions, {
  8140. args,
  8141. name: wrappedAction[ACTION_NAME],
  8142. store,
  8143. after,
  8144. onError
  8145. });
  8146. let ret;
  8147. try {
  8148. ret = fn.apply(this && this.$id === $id ? this : store, args);
  8149. } catch (error) {
  8150. triggerSubscriptions(onErrorCallbackList, error);
  8151. throw error;
  8152. }
  8153. if (ret instanceof Promise) {
  8154. return ret.then((value) => {
  8155. triggerSubscriptions(afterCallbackList, value);
  8156. return value;
  8157. }).catch((error) => {
  8158. triggerSubscriptions(onErrorCallbackList, error);
  8159. return Promise.reject(error);
  8160. });
  8161. }
  8162. triggerSubscriptions(afterCallbackList, ret);
  8163. return ret;
  8164. };
  8165. wrappedAction[ACTION_MARKER] = true;
  8166. wrappedAction[ACTION_NAME] = name;
  8167. return wrappedAction;
  8168. };
  8169. const partialStore = {
  8170. _p: pinia,
  8171. // _s: scope,
  8172. $id,
  8173. $onAction: addSubscription.bind(null, actionSubscriptions),
  8174. $patch,
  8175. $reset,
  8176. $subscribe(callback, options2 = {}) {
  8177. const removeSubscription = addSubscription(subscriptions, callback, options2.detached, () => stopWatcher());
  8178. const stopWatcher = scope.run(() => watch(() => pinia.state.value[$id], (state) => {
  8179. if (options2.flush === "sync" ? isSyncListening : isListening) {
  8180. callback({
  8181. storeId: $id,
  8182. type: MutationType.direct,
  8183. events: debuggerEvents
  8184. }, state);
  8185. }
  8186. }, assign$1({}, $subscribeOptions, options2)));
  8187. return removeSubscription;
  8188. },
  8189. $dispose
  8190. };
  8191. const store = reactive(partialStore);
  8192. pinia._s.set($id, store);
  8193. const runWithContext = pinia._a && pinia._a.runWithContext || fallbackRunWithContext;
  8194. const setupStore = runWithContext(() => pinia._e.run(() => (scope = effectScope()).run(() => setup({ action }))));
  8195. for (const key in setupStore) {
  8196. const prop = setupStore[key];
  8197. if (isRef(prop) && !isComputed(prop) || isReactive(prop)) {
  8198. if (!isOptionsStore) {
  8199. if (initialState && shouldHydrate(prop)) {
  8200. if (isRef(prop)) {
  8201. prop.value = initialState[key];
  8202. } else {
  8203. mergeReactiveObjects(prop, initialState[key]);
  8204. }
  8205. }
  8206. {
  8207. pinia.state.value[$id][key] = prop;
  8208. }
  8209. }
  8210. } else if (typeof prop === "function") {
  8211. const actionValue = action(prop, key);
  8212. {
  8213. setupStore[key] = actionValue;
  8214. }
  8215. optionsForPlugin.actions[key] = prop;
  8216. } else
  8217. ;
  8218. }
  8219. {
  8220. assign$1(store, setupStore);
  8221. assign$1(toRaw(store), setupStore);
  8222. }
  8223. Object.defineProperty(store, "$state", {
  8224. get: () => pinia.state.value[$id],
  8225. set: (state) => {
  8226. $patch(($state) => {
  8227. assign$1($state, state);
  8228. });
  8229. }
  8230. });
  8231. pinia._p.forEach((extender) => {
  8232. {
  8233. assign$1(store, scope.run(() => extender({
  8234. store,
  8235. app: pinia._a,
  8236. pinia,
  8237. options: optionsForPlugin
  8238. })));
  8239. }
  8240. });
  8241. if (initialState && isOptionsStore && options.hydrate) {
  8242. options.hydrate(store.$state, initialState);
  8243. }
  8244. isListening = true;
  8245. isSyncListening = true;
  8246. return store;
  8247. }
  8248. /*! #__NO_SIDE_EFFECTS__ */
  8249. // @__NO_SIDE_EFFECTS__
  8250. function defineStore(idOrOptions, setup, setupOptions) {
  8251. let id;
  8252. let options;
  8253. const isSetupStore = typeof setup === "function";
  8254. if (typeof idOrOptions === "string") {
  8255. id = idOrOptions;
  8256. options = isSetupStore ? setupOptions : setup;
  8257. } else {
  8258. options = idOrOptions;
  8259. id = idOrOptions.id;
  8260. }
  8261. function useStore(pinia, hot) {
  8262. const hasContext = hasInjectionContext();
  8263. pinia = // in test mode, ignore the argument provided as we can always retrieve a
  8264. // pinia instance with getActivePinia()
  8265. pinia || (hasContext ? inject(piniaSymbol, null) : null);
  8266. if (pinia)
  8267. setActivePinia(pinia);
  8268. pinia = activePinia;
  8269. if (!pinia._s.has(id)) {
  8270. if (isSetupStore) {
  8271. createSetupStore(id, setup, options, pinia);
  8272. } else {
  8273. createOptionsStore(id, options, pinia);
  8274. }
  8275. }
  8276. const store = pinia._s.get(id);
  8277. return store;
  8278. }
  8279. useStore.$id = id;
  8280. return useStore;
  8281. }
  8282. /*!
  8283. * vue-router v4.6.4
  8284. * (c) 2025 Eduardo San Martin Morote
  8285. * @license MIT
  8286. */
  8287. const isBrowser = typeof document !== "undefined";
  8288. function isRouteComponent(component) {
  8289. return typeof component === "object" || "displayName" in component || "props" in component || "__vccOpts" in component;
  8290. }
  8291. function isESModule(obj) {
  8292. return obj.__esModule || obj[Symbol.toStringTag] === "Module" || obj.default && isRouteComponent(obj.default);
  8293. }
  8294. const assign = Object.assign;
  8295. function applyToParams(fn, params) {
  8296. const newParams = {};
  8297. for (const key in params) {
  8298. const value = params[key];
  8299. newParams[key] = isArray(value) ? value.map(fn) : fn(value);
  8300. }
  8301. return newParams;
  8302. }
  8303. const noop = () => {
  8304. };
  8305. const isArray = Array.isArray;
  8306. function mergeOptions(defaults, partialOptions) {
  8307. const options = {};
  8308. for (const key in defaults)
  8309. options[key] = key in partialOptions ? partialOptions[key] : defaults[key];
  8310. return options;
  8311. }
  8312. const HASH_RE = /#/g;
  8313. const AMPERSAND_RE = /&/g;
  8314. const SLASH_RE = /\//g;
  8315. const EQUAL_RE = /=/g;
  8316. const IM_RE = /\?/g;
  8317. const PLUS_RE = /\+/g;
  8318. const ENC_BRACKET_OPEN_RE = /%5B/g;
  8319. const ENC_BRACKET_CLOSE_RE = /%5D/g;
  8320. const ENC_CARET_RE = /%5E/g;
  8321. const ENC_BACKTICK_RE = /%60/g;
  8322. const ENC_CURLY_OPEN_RE = /%7B/g;
  8323. const ENC_PIPE_RE = /%7C/g;
  8324. const ENC_CURLY_CLOSE_RE = /%7D/g;
  8325. const ENC_SPACE_RE = /%20/g;
  8326. function commonEncode(text) {
  8327. return text == null ? "" : encodeURI("" + text).replace(ENC_PIPE_RE, "|").replace(ENC_BRACKET_OPEN_RE, "[").replace(ENC_BRACKET_CLOSE_RE, "]");
  8328. }
  8329. function encodeHash(text) {
  8330. return commonEncode(text).replace(ENC_CURLY_OPEN_RE, "{").replace(ENC_CURLY_CLOSE_RE, "}").replace(ENC_CARET_RE, "^");
  8331. }
  8332. function encodeQueryValue(text) {
  8333. return commonEncode(text).replace(PLUS_RE, "%2B").replace(ENC_SPACE_RE, "+").replace(HASH_RE, "%23").replace(AMPERSAND_RE, "%26").replace(ENC_BACKTICK_RE, "`").replace(ENC_CURLY_OPEN_RE, "{").replace(ENC_CURLY_CLOSE_RE, "}").replace(ENC_CARET_RE, "^");
  8334. }
  8335. function encodeQueryKey(text) {
  8336. return encodeQueryValue(text).replace(EQUAL_RE, "%3D");
  8337. }
  8338. function encodePath(text) {
  8339. return commonEncode(text).replace(HASH_RE, "%23").replace(IM_RE, "%3F");
  8340. }
  8341. function encodeParam(text) {
  8342. return encodePath(text).replace(SLASH_RE, "%2F");
  8343. }
  8344. function decode(text) {
  8345. if (text == null)
  8346. return null;
  8347. try {
  8348. return decodeURIComponent("" + text);
  8349. } catch (err) {
  8350. }
  8351. return "" + text;
  8352. }
  8353. const TRAILING_SLASH_RE = /\/$/;
  8354. const removeTrailingSlash = (path) => path.replace(TRAILING_SLASH_RE, "");
  8355. function parseURL(parseQuery$1, location2, currentLocation = "/") {
  8356. let path, query = {}, searchString = "", hash = "";
  8357. const hashPos = location2.indexOf("#");
  8358. let searchPos = location2.indexOf("?");
  8359. searchPos = hashPos >= 0 && searchPos > hashPos ? -1 : searchPos;
  8360. if (searchPos >= 0) {
  8361. path = location2.slice(0, searchPos);
  8362. searchString = location2.slice(searchPos, hashPos > 0 ? hashPos : location2.length);
  8363. query = parseQuery$1(searchString.slice(1));
  8364. }
  8365. if (hashPos >= 0) {
  8366. path = path || location2.slice(0, hashPos);
  8367. hash = location2.slice(hashPos, location2.length);
  8368. }
  8369. path = resolveRelativePath(path != null ? path : location2, currentLocation);
  8370. return {
  8371. fullPath: path + searchString + hash,
  8372. path,
  8373. query,
  8374. hash: decode(hash)
  8375. };
  8376. }
  8377. function stringifyURL(stringifyQuery$1, location2) {
  8378. const query = location2.query ? stringifyQuery$1(location2.query) : "";
  8379. return location2.path + (query && "?") + query + (location2.hash || "");
  8380. }
  8381. function stripBase(pathname, base) {
  8382. if (!base || !pathname.toLowerCase().startsWith(base.toLowerCase()))
  8383. return pathname;
  8384. return pathname.slice(base.length) || "/";
  8385. }
  8386. function isSameRouteLocation(stringifyQuery$1, a, b) {
  8387. const aLastIndex = a.matched.length - 1;
  8388. const bLastIndex = b.matched.length - 1;
  8389. return aLastIndex > -1 && aLastIndex === bLastIndex && isSameRouteRecord(a.matched[aLastIndex], b.matched[bLastIndex]) && isSameRouteLocationParams(a.params, b.params) && stringifyQuery$1(a.query) === stringifyQuery$1(b.query) && a.hash === b.hash;
  8390. }
  8391. function isSameRouteRecord(a, b) {
  8392. return (a.aliasOf || a) === (b.aliasOf || b);
  8393. }
  8394. function isSameRouteLocationParams(a, b) {
  8395. if (Object.keys(a).length !== Object.keys(b).length)
  8396. return false;
  8397. for (var key in a)
  8398. if (!isSameRouteLocationParamsValue(a[key], b[key]))
  8399. return false;
  8400. return true;
  8401. }
  8402. function isSameRouteLocationParamsValue(a, b) {
  8403. return isArray(a) ? isEquivalentArray(a, b) : isArray(b) ? isEquivalentArray(b, a) : (a == null ? void 0 : a.valueOf()) === (b == null ? void 0 : b.valueOf());
  8404. }
  8405. function isEquivalentArray(a, b) {
  8406. return isArray(b) ? a.length === b.length && a.every((value, i) => value === b[i]) : a.length === 1 && a[0] === b;
  8407. }
  8408. function resolveRelativePath(to, from) {
  8409. if (to.startsWith("/"))
  8410. return to;
  8411. if (!to)
  8412. return from;
  8413. const fromSegments = from.split("/");
  8414. const toSegments = to.split("/");
  8415. const lastToSegment = toSegments[toSegments.length - 1];
  8416. if (lastToSegment === ".." || lastToSegment === ".")
  8417. toSegments.push("");
  8418. let position = fromSegments.length - 1;
  8419. let toPosition;
  8420. let segment;
  8421. for (toPosition = 0; toPosition < toSegments.length; toPosition++) {
  8422. segment = toSegments[toPosition];
  8423. if (segment === ".")
  8424. continue;
  8425. if (segment === "..") {
  8426. if (position > 1)
  8427. position--;
  8428. } else
  8429. break;
  8430. }
  8431. return fromSegments.slice(0, position).join("/") + "/" + toSegments.slice(toPosition).join("/");
  8432. }
  8433. const START_LOCATION_NORMALIZED = {
  8434. path: "/",
  8435. name: void 0,
  8436. params: {},
  8437. query: {},
  8438. hash: "",
  8439. fullPath: "/",
  8440. matched: [],
  8441. meta: {},
  8442. redirectedFrom: void 0
  8443. };
  8444. let NavigationType = /* @__PURE__ */ function(NavigationType$1) {
  8445. NavigationType$1["pop"] = "pop";
  8446. NavigationType$1["push"] = "push";
  8447. return NavigationType$1;
  8448. }({});
  8449. let NavigationDirection = /* @__PURE__ */ function(NavigationDirection$1) {
  8450. NavigationDirection$1["back"] = "back";
  8451. NavigationDirection$1["forward"] = "forward";
  8452. NavigationDirection$1["unknown"] = "";
  8453. return NavigationDirection$1;
  8454. }({});
  8455. function normalizeBase(base) {
  8456. if (!base)
  8457. if (isBrowser) {
  8458. const baseEl = document.querySelector("base");
  8459. base = baseEl && baseEl.getAttribute("href") || "/";
  8460. base = base.replace(/^\w+:\/\/[^\/]+/, "");
  8461. } else
  8462. base = "/";
  8463. if (base[0] !== "/" && base[0] !== "#")
  8464. base = "/" + base;
  8465. return removeTrailingSlash(base);
  8466. }
  8467. const BEFORE_HASH_RE = /^[^#]+#/;
  8468. function createHref(base, location2) {
  8469. return base.replace(BEFORE_HASH_RE, "#") + location2;
  8470. }
  8471. function getElementPosition(el, offset) {
  8472. const docRect = document.documentElement.getBoundingClientRect();
  8473. const elRect = el.getBoundingClientRect();
  8474. return {
  8475. behavior: offset.behavior,
  8476. left: elRect.left - docRect.left - (offset.left || 0),
  8477. top: elRect.top - docRect.top - (offset.top || 0)
  8478. };
  8479. }
  8480. const computeScrollPosition = () => ({
  8481. left: window.scrollX,
  8482. top: window.scrollY
  8483. });
  8484. function scrollToPosition(position) {
  8485. let scrollToOptions;
  8486. if ("el" in position) {
  8487. const positionEl = position.el;
  8488. const isIdSelector = typeof positionEl === "string" && positionEl.startsWith("#");
  8489. const el = typeof positionEl === "string" ? isIdSelector ? document.getElementById(positionEl.slice(1)) : document.querySelector(positionEl) : positionEl;
  8490. if (!el) {
  8491. return;
  8492. }
  8493. scrollToOptions = getElementPosition(el, position);
  8494. } else
  8495. scrollToOptions = position;
  8496. if ("scrollBehavior" in document.documentElement.style)
  8497. window.scrollTo(scrollToOptions);
  8498. else
  8499. window.scrollTo(scrollToOptions.left != null ? scrollToOptions.left : window.scrollX, scrollToOptions.top != null ? scrollToOptions.top : window.scrollY);
  8500. }
  8501. function getScrollKey(path, delta) {
  8502. return (history.state ? history.state.position - delta : -1) + path;
  8503. }
  8504. const scrollPositions = /* @__PURE__ */ new Map();
  8505. function saveScrollPosition(key, scrollPosition) {
  8506. scrollPositions.set(key, scrollPosition);
  8507. }
  8508. function getSavedScrollPosition(key) {
  8509. const scroll = scrollPositions.get(key);
  8510. scrollPositions.delete(key);
  8511. return scroll;
  8512. }
  8513. function isRouteLocation(route) {
  8514. return typeof route === "string" || route && typeof route === "object";
  8515. }
  8516. function isRouteName(name) {
  8517. return typeof name === "string" || typeof name === "symbol";
  8518. }
  8519. let ErrorTypes = /* @__PURE__ */ function(ErrorTypes$1) {
  8520. ErrorTypes$1[ErrorTypes$1["MATCHER_NOT_FOUND"] = 1] = "MATCHER_NOT_FOUND";
  8521. ErrorTypes$1[ErrorTypes$1["NAVIGATION_GUARD_REDIRECT"] = 2] = "NAVIGATION_GUARD_REDIRECT";
  8522. ErrorTypes$1[ErrorTypes$1["NAVIGATION_ABORTED"] = 4] = "NAVIGATION_ABORTED";
  8523. ErrorTypes$1[ErrorTypes$1["NAVIGATION_CANCELLED"] = 8] = "NAVIGATION_CANCELLED";
  8524. ErrorTypes$1[ErrorTypes$1["NAVIGATION_DUPLICATED"] = 16] = "NAVIGATION_DUPLICATED";
  8525. return ErrorTypes$1;
  8526. }({});
  8527. const NavigationFailureSymbol = Symbol("");
  8528. ({
  8529. [ErrorTypes.MATCHER_NOT_FOUND]({ location: location2, currentLocation }) {
  8530. return `No match for
  8531. ${JSON.stringify(location2)}${currentLocation ? "\nwhile being at\n" + JSON.stringify(currentLocation) : ""}`;
  8532. },
  8533. [ErrorTypes.NAVIGATION_GUARD_REDIRECT]({ from, to }) {
  8534. return `Redirected from "${from.fullPath}" to "${stringifyRoute(to)}" via a navigation guard.`;
  8535. },
  8536. [ErrorTypes.NAVIGATION_ABORTED]({ from, to }) {
  8537. return `Navigation aborted from "${from.fullPath}" to "${to.fullPath}" via a navigation guard.`;
  8538. },
  8539. [ErrorTypes.NAVIGATION_CANCELLED]({ from, to }) {
  8540. return `Navigation cancelled from "${from.fullPath}" to "${to.fullPath}" with a new navigation.`;
  8541. },
  8542. [ErrorTypes.NAVIGATION_DUPLICATED]({ from, to }) {
  8543. return `Avoided redundant navigation to current location: "${from.fullPath}".`;
  8544. }
  8545. });
  8546. function createRouterError(type, params) {
  8547. return assign(/* @__PURE__ */ new Error(), {
  8548. type,
  8549. [NavigationFailureSymbol]: true
  8550. }, params);
  8551. }
  8552. function isNavigationFailure(error, type) {
  8553. return error instanceof Error && NavigationFailureSymbol in error && (type == null || !!(error.type & type));
  8554. }
  8555. const propertiesToLog = [
  8556. "params",
  8557. "query",
  8558. "hash"
  8559. ];
  8560. function stringifyRoute(to) {
  8561. if (typeof to === "string")
  8562. return to;
  8563. if (to.path != null)
  8564. return to.path;
  8565. const location2 = {};
  8566. for (const key of propertiesToLog)
  8567. if (key in to)
  8568. location2[key] = to[key];
  8569. return JSON.stringify(location2, null, 2);
  8570. }
  8571. function parseQuery(search) {
  8572. const query = {};
  8573. if (search === "" || search === "?")
  8574. return query;
  8575. const searchParams = (search[0] === "?" ? search.slice(1) : search).split("&");
  8576. for (let i = 0; i < searchParams.length; ++i) {
  8577. const searchParam = searchParams[i].replace(PLUS_RE, " ");
  8578. const eqPos = searchParam.indexOf("=");
  8579. const key = decode(eqPos < 0 ? searchParam : searchParam.slice(0, eqPos));
  8580. const value = eqPos < 0 ? null : decode(searchParam.slice(eqPos + 1));
  8581. if (key in query) {
  8582. let currentValue = query[key];
  8583. if (!isArray(currentValue))
  8584. currentValue = query[key] = [currentValue];
  8585. currentValue.push(value);
  8586. } else
  8587. query[key] = value;
  8588. }
  8589. return query;
  8590. }
  8591. function stringifyQuery(query) {
  8592. let search = "";
  8593. for (let key in query) {
  8594. const value = query[key];
  8595. key = encodeQueryKey(key);
  8596. if (value == null) {
  8597. if (value !== void 0)
  8598. search += (search.length ? "&" : "") + key;
  8599. continue;
  8600. }
  8601. (isArray(value) ? value.map((v) => v && encodeQueryValue(v)) : [value && encodeQueryValue(value)]).forEach((value$1) => {
  8602. if (value$1 !== void 0) {
  8603. search += (search.length ? "&" : "") + key;
  8604. if (value$1 != null)
  8605. search += "=" + value$1;
  8606. }
  8607. });
  8608. }
  8609. return search;
  8610. }
  8611. function normalizeQuery(query) {
  8612. const normalizedQuery = {};
  8613. for (const key in query) {
  8614. const value = query[key];
  8615. if (value !== void 0)
  8616. normalizedQuery[key] = isArray(value) ? value.map((v) => v == null ? null : "" + v) : value == null ? value : "" + value;
  8617. }
  8618. return normalizedQuery;
  8619. }
  8620. const matchedRouteKey = Symbol("");
  8621. const viewDepthKey = Symbol("");
  8622. const routerKey = Symbol("");
  8623. const routeLocationKey = Symbol("");
  8624. const routerViewLocationKey = Symbol("");
  8625. function useCallbacks() {
  8626. let handlers = [];
  8627. function add(handler) {
  8628. handlers.push(handler);
  8629. return () => {
  8630. const i = handlers.indexOf(handler);
  8631. if (i > -1)
  8632. handlers.splice(i, 1);
  8633. };
  8634. }
  8635. function reset() {
  8636. handlers = [];
  8637. }
  8638. return {
  8639. add,
  8640. list: () => handlers.slice(),
  8641. reset
  8642. };
  8643. }
  8644. function guardToPromiseFn(guard, to, from, record, name, runWithContext = (fn) => fn()) {
  8645. const enterCallbackArray = record && (record.enterCallbacks[name] = record.enterCallbacks[name] || []);
  8646. return () => new Promise((resolve2, reject) => {
  8647. const next = (valid) => {
  8648. if (valid === false)
  8649. reject(createRouterError(ErrorTypes.NAVIGATION_ABORTED, {
  8650. from,
  8651. to
  8652. }));
  8653. else if (valid instanceof Error)
  8654. reject(valid);
  8655. else if (isRouteLocation(valid))
  8656. reject(createRouterError(ErrorTypes.NAVIGATION_GUARD_REDIRECT, {
  8657. from: to,
  8658. to: valid
  8659. }));
  8660. else {
  8661. if (enterCallbackArray && record.enterCallbacks[name] === enterCallbackArray && typeof valid === "function")
  8662. enterCallbackArray.push(valid);
  8663. resolve2();
  8664. }
  8665. };
  8666. const guardReturn = runWithContext(() => guard.call(record && record.instances[name], to, from, next));
  8667. let guardCall = Promise.resolve(guardReturn);
  8668. if (guard.length < 3)
  8669. guardCall = guardCall.then(next);
  8670. guardCall.catch((err) => reject(err));
  8671. });
  8672. }
  8673. function extractComponentsGuards(matched, guardType, to, from, runWithContext = (fn) => fn()) {
  8674. const guards = [];
  8675. for (const record of matched) {
  8676. for (const name in record.components) {
  8677. let rawComponent = record.components[name];
  8678. if (guardType !== "beforeRouteEnter" && !record.instances[name])
  8679. continue;
  8680. if (isRouteComponent(rawComponent)) {
  8681. const guard = (rawComponent.__vccOpts || rawComponent)[guardType];
  8682. guard && guards.push(guardToPromiseFn(guard, to, from, record, name, runWithContext));
  8683. } else {
  8684. let componentPromise = rawComponent();
  8685. guards.push(() => componentPromise.then((resolved) => {
  8686. if (!resolved)
  8687. throw new Error(`Couldn't resolve component "${name}" at "${record.path}"`);
  8688. const resolvedComponent = isESModule(resolved) ? resolved.default : resolved;
  8689. record.mods[name] = resolved;
  8690. record.components[name] = resolvedComponent;
  8691. const guard = (resolvedComponent.__vccOpts || resolvedComponent)[guardType];
  8692. return guard && guardToPromiseFn(guard, to, from, record, name, runWithContext)();
  8693. }));
  8694. }
  8695. }
  8696. }
  8697. return guards;
  8698. }
  8699. function extractChangingRecords(to, from) {
  8700. const leavingRecords = [];
  8701. const updatingRecords = [];
  8702. const enteringRecords = [];
  8703. const len = Math.max(from.matched.length, to.matched.length);
  8704. for (let i = 0; i < len; i++) {
  8705. const recordFrom = from.matched[i];
  8706. if (recordFrom)
  8707. if (to.matched.find((record) => isSameRouteRecord(record, recordFrom)))
  8708. updatingRecords.push(recordFrom);
  8709. else
  8710. leavingRecords.push(recordFrom);
  8711. const recordTo = to.matched[i];
  8712. if (recordTo) {
  8713. if (!from.matched.find((record) => isSameRouteRecord(record, recordTo)))
  8714. enteringRecords.push(recordTo);
  8715. }
  8716. }
  8717. return [
  8718. leavingRecords,
  8719. updatingRecords,
  8720. enteringRecords
  8721. ];
  8722. }
  8723. /*!
  8724. * vue-router v4.6.4
  8725. * (c) 2025 Eduardo San Martin Morote
  8726. * @license MIT
  8727. */
  8728. let createBaseLocation = () => location.protocol + "//" + location.host;
  8729. function createCurrentLocation(base, location$1) {
  8730. const { pathname, search, hash } = location$1;
  8731. const hashPos = base.indexOf("#");
  8732. if (hashPos > -1) {
  8733. let slicePos = hash.includes(base.slice(hashPos)) ? base.slice(hashPos).length : 1;
  8734. let pathFromHash = hash.slice(slicePos);
  8735. if (pathFromHash[0] !== "/")
  8736. pathFromHash = "/" + pathFromHash;
  8737. return stripBase(pathFromHash, "");
  8738. }
  8739. return stripBase(pathname, base) + search + hash;
  8740. }
  8741. function useHistoryListeners(base, historyState, currentLocation, replace) {
  8742. let listeners = [];
  8743. let teardowns = [];
  8744. let pauseState = null;
  8745. const popStateHandler = ({ state }) => {
  8746. const to = createCurrentLocation(base, location);
  8747. const from = currentLocation.value;
  8748. const fromState = historyState.value;
  8749. let delta = 0;
  8750. if (state) {
  8751. currentLocation.value = to;
  8752. historyState.value = state;
  8753. if (pauseState && pauseState === from) {
  8754. pauseState = null;
  8755. return;
  8756. }
  8757. delta = fromState ? state.position - fromState.position : 0;
  8758. } else
  8759. replace(to);
  8760. listeners.forEach((listener) => {
  8761. listener(currentLocation.value, from, {
  8762. delta,
  8763. type: NavigationType.pop,
  8764. direction: delta ? delta > 0 ? NavigationDirection.forward : NavigationDirection.back : NavigationDirection.unknown
  8765. });
  8766. });
  8767. };
  8768. function pauseListeners() {
  8769. pauseState = currentLocation.value;
  8770. }
  8771. function listen(callback) {
  8772. listeners.push(callback);
  8773. const teardown = () => {
  8774. const index = listeners.indexOf(callback);
  8775. if (index > -1)
  8776. listeners.splice(index, 1);
  8777. };
  8778. teardowns.push(teardown);
  8779. return teardown;
  8780. }
  8781. function beforeUnloadListener() {
  8782. if (document.visibilityState === "hidden") {
  8783. const { history: history$1 } = window;
  8784. if (!history$1.state)
  8785. return;
  8786. history$1.replaceState(assign({}, history$1.state, { scroll: computeScrollPosition() }), "");
  8787. }
  8788. }
  8789. function destroy() {
  8790. for (const teardown of teardowns)
  8791. teardown();
  8792. teardowns = [];
  8793. window.removeEventListener("popstate", popStateHandler);
  8794. window.removeEventListener("pagehide", beforeUnloadListener);
  8795. document.removeEventListener("visibilitychange", beforeUnloadListener);
  8796. }
  8797. window.addEventListener("popstate", popStateHandler);
  8798. window.addEventListener("pagehide", beforeUnloadListener);
  8799. document.addEventListener("visibilitychange", beforeUnloadListener);
  8800. return {
  8801. pauseListeners,
  8802. listen,
  8803. destroy
  8804. };
  8805. }
  8806. function buildState(back, current, forward, replaced = false, computeScroll = false) {
  8807. return {
  8808. back,
  8809. current,
  8810. forward,
  8811. replaced,
  8812. position: window.history.length,
  8813. scroll: computeScroll ? computeScrollPosition() : null
  8814. };
  8815. }
  8816. function useHistoryStateNavigation(base) {
  8817. const { history: history$1, location: location$1 } = window;
  8818. const currentLocation = { value: createCurrentLocation(base, location$1) };
  8819. const historyState = { value: history$1.state };
  8820. if (!historyState.value)
  8821. changeLocation(currentLocation.value, {
  8822. back: null,
  8823. current: currentLocation.value,
  8824. forward: null,
  8825. position: history$1.length - 1,
  8826. replaced: true,
  8827. scroll: null
  8828. }, true);
  8829. function changeLocation(to, state, replace$1) {
  8830. const hashIndex = base.indexOf("#");
  8831. const url = hashIndex > -1 ? (location$1.host && document.querySelector("base") ? base : base.slice(hashIndex)) + to : createBaseLocation() + base + to;
  8832. try {
  8833. history$1[replace$1 ? "replaceState" : "pushState"](state, "", url);
  8834. historyState.value = state;
  8835. } catch (err) {
  8836. console.error(err);
  8837. location$1[replace$1 ? "replace" : "assign"](url);
  8838. }
  8839. }
  8840. function replace(to, data) {
  8841. changeLocation(to, assign({}, history$1.state, buildState(historyState.value.back, to, historyState.value.forward, true), data, { position: historyState.value.position }), true);
  8842. currentLocation.value = to;
  8843. }
  8844. function push(to, data) {
  8845. const currentState = assign({}, historyState.value, history$1.state, {
  8846. forward: to,
  8847. scroll: computeScrollPosition()
  8848. });
  8849. changeLocation(currentState.current, currentState, true);
  8850. changeLocation(to, assign({}, buildState(currentLocation.value, to, null), { position: currentState.position + 1 }, data), false);
  8851. currentLocation.value = to;
  8852. }
  8853. return {
  8854. location: currentLocation,
  8855. state: historyState,
  8856. push,
  8857. replace
  8858. };
  8859. }
  8860. function createWebHistory(base) {
  8861. base = normalizeBase(base);
  8862. const historyNavigation = useHistoryStateNavigation(base);
  8863. const historyListeners = useHistoryListeners(base, historyNavigation.state, historyNavigation.location, historyNavigation.replace);
  8864. function go(delta, triggerListeners = true) {
  8865. if (!triggerListeners)
  8866. historyListeners.pauseListeners();
  8867. history.go(delta);
  8868. }
  8869. const routerHistory = assign({
  8870. location: "",
  8871. base,
  8872. go,
  8873. createHref: createHref.bind(null, base)
  8874. }, historyNavigation, historyListeners);
  8875. Object.defineProperty(routerHistory, "location", {
  8876. enumerable: true,
  8877. get: () => historyNavigation.location.value
  8878. });
  8879. Object.defineProperty(routerHistory, "state", {
  8880. enumerable: true,
  8881. get: () => historyNavigation.state.value
  8882. });
  8883. return routerHistory;
  8884. }
  8885. let TokenType = /* @__PURE__ */ function(TokenType$1) {
  8886. TokenType$1[TokenType$1["Static"] = 0] = "Static";
  8887. TokenType$1[TokenType$1["Param"] = 1] = "Param";
  8888. TokenType$1[TokenType$1["Group"] = 2] = "Group";
  8889. return TokenType$1;
  8890. }({});
  8891. var TokenizerState = /* @__PURE__ */ function(TokenizerState$1) {
  8892. TokenizerState$1[TokenizerState$1["Static"] = 0] = "Static";
  8893. TokenizerState$1[TokenizerState$1["Param"] = 1] = "Param";
  8894. TokenizerState$1[TokenizerState$1["ParamRegExp"] = 2] = "ParamRegExp";
  8895. TokenizerState$1[TokenizerState$1["ParamRegExpEnd"] = 3] = "ParamRegExpEnd";
  8896. TokenizerState$1[TokenizerState$1["EscapeNext"] = 4] = "EscapeNext";
  8897. return TokenizerState$1;
  8898. }(TokenizerState || {});
  8899. const ROOT_TOKEN = {
  8900. type: TokenType.Static,
  8901. value: ""
  8902. };
  8903. const VALID_PARAM_RE = /[a-zA-Z0-9_]/;
  8904. function tokenizePath(path) {
  8905. if (!path)
  8906. return [[]];
  8907. if (path === "/")
  8908. return [[ROOT_TOKEN]];
  8909. if (!path.startsWith("/"))
  8910. throw new Error(`Invalid path "${path}"`);
  8911. function crash(message) {
  8912. throw new Error(`ERR (${state})/"${buffer}": ${message}`);
  8913. }
  8914. let state = TokenizerState.Static;
  8915. let previousState = state;
  8916. const tokens = [];
  8917. let segment;
  8918. function finalizeSegment() {
  8919. if (segment)
  8920. tokens.push(segment);
  8921. segment = [];
  8922. }
  8923. let i = 0;
  8924. let char;
  8925. let buffer = "";
  8926. let customRe = "";
  8927. function consumeBuffer() {
  8928. if (!buffer)
  8929. return;
  8930. if (state === TokenizerState.Static)
  8931. segment.push({
  8932. type: TokenType.Static,
  8933. value: buffer
  8934. });
  8935. else if (state === TokenizerState.Param || state === TokenizerState.ParamRegExp || state === TokenizerState.ParamRegExpEnd) {
  8936. if (segment.length > 1 && (char === "*" || char === "+"))
  8937. crash(`A repeatable param (${buffer}) must be alone in its segment. eg: '/:ids+.`);
  8938. segment.push({
  8939. type: TokenType.Param,
  8940. value: buffer,
  8941. regexp: customRe,
  8942. repeatable: char === "*" || char === "+",
  8943. optional: char === "*" || char === "?"
  8944. });
  8945. } else
  8946. crash("Invalid state to consume buffer");
  8947. buffer = "";
  8948. }
  8949. function addCharToBuffer() {
  8950. buffer += char;
  8951. }
  8952. while (i < path.length) {
  8953. char = path[i++];
  8954. if (char === "\\" && state !== TokenizerState.ParamRegExp) {
  8955. previousState = state;
  8956. state = TokenizerState.EscapeNext;
  8957. continue;
  8958. }
  8959. switch (state) {
  8960. case TokenizerState.Static:
  8961. if (char === "/") {
  8962. if (buffer)
  8963. consumeBuffer();
  8964. finalizeSegment();
  8965. } else if (char === ":") {
  8966. consumeBuffer();
  8967. state = TokenizerState.Param;
  8968. } else
  8969. addCharToBuffer();
  8970. break;
  8971. case TokenizerState.EscapeNext:
  8972. addCharToBuffer();
  8973. state = previousState;
  8974. break;
  8975. case TokenizerState.Param:
  8976. if (char === "(")
  8977. state = TokenizerState.ParamRegExp;
  8978. else if (VALID_PARAM_RE.test(char))
  8979. addCharToBuffer();
  8980. else {
  8981. consumeBuffer();
  8982. state = TokenizerState.Static;
  8983. if (char !== "*" && char !== "?" && char !== "+")
  8984. i--;
  8985. }
  8986. break;
  8987. case TokenizerState.ParamRegExp:
  8988. if (char === ")")
  8989. if (customRe[customRe.length - 1] == "\\")
  8990. customRe = customRe.slice(0, -1) + char;
  8991. else
  8992. state = TokenizerState.ParamRegExpEnd;
  8993. else
  8994. customRe += char;
  8995. break;
  8996. case TokenizerState.ParamRegExpEnd:
  8997. consumeBuffer();
  8998. state = TokenizerState.Static;
  8999. if (char !== "*" && char !== "?" && char !== "+")
  9000. i--;
  9001. customRe = "";
  9002. break;
  9003. default:
  9004. crash("Unknown state");
  9005. break;
  9006. }
  9007. }
  9008. if (state === TokenizerState.ParamRegExp)
  9009. crash(`Unfinished custom RegExp for param "${buffer}"`);
  9010. consumeBuffer();
  9011. finalizeSegment();
  9012. return tokens;
  9013. }
  9014. const BASE_PARAM_PATTERN = "[^/]+?";
  9015. const BASE_PATH_PARSER_OPTIONS = {
  9016. sensitive: false,
  9017. strict: false,
  9018. start: true,
  9019. end: true
  9020. };
  9021. var PathScore = /* @__PURE__ */ function(PathScore$1) {
  9022. PathScore$1[PathScore$1["_multiplier"] = 10] = "_multiplier";
  9023. PathScore$1[PathScore$1["Root"] = 90] = "Root";
  9024. PathScore$1[PathScore$1["Segment"] = 40] = "Segment";
  9025. PathScore$1[PathScore$1["SubSegment"] = 30] = "SubSegment";
  9026. PathScore$1[PathScore$1["Static"] = 40] = "Static";
  9027. PathScore$1[PathScore$1["Dynamic"] = 20] = "Dynamic";
  9028. PathScore$1[PathScore$1["BonusCustomRegExp"] = 10] = "BonusCustomRegExp";
  9029. PathScore$1[PathScore$1["BonusWildcard"] = -50] = "BonusWildcard";
  9030. PathScore$1[PathScore$1["BonusRepeatable"] = -20] = "BonusRepeatable";
  9031. PathScore$1[PathScore$1["BonusOptional"] = -8] = "BonusOptional";
  9032. PathScore$1[PathScore$1["BonusStrict"] = 0.7000000000000001] = "BonusStrict";
  9033. PathScore$1[PathScore$1["BonusCaseSensitive"] = 0.25] = "BonusCaseSensitive";
  9034. return PathScore$1;
  9035. }(PathScore || {});
  9036. const REGEX_CHARS_RE = /[.+*?^${}()[\]/\\]/g;
  9037. function tokensToParser(segments, extraOptions) {
  9038. const options = assign({}, BASE_PATH_PARSER_OPTIONS, extraOptions);
  9039. const score = [];
  9040. let pattern = options.start ? "^" : "";
  9041. const keys = [];
  9042. for (const segment of segments) {
  9043. const segmentScores = segment.length ? [] : [PathScore.Root];
  9044. if (options.strict && !segment.length)
  9045. pattern += "/";
  9046. for (let tokenIndex = 0; tokenIndex < segment.length; tokenIndex++) {
  9047. const token = segment[tokenIndex];
  9048. let subSegmentScore = PathScore.Segment + (options.sensitive ? PathScore.BonusCaseSensitive : 0);
  9049. if (token.type === TokenType.Static) {
  9050. if (!tokenIndex)
  9051. pattern += "/";
  9052. pattern += token.value.replace(REGEX_CHARS_RE, "\\$&");
  9053. subSegmentScore += PathScore.Static;
  9054. } else if (token.type === TokenType.Param) {
  9055. const { value, repeatable, optional, regexp } = token;
  9056. keys.push({
  9057. name: value,
  9058. repeatable,
  9059. optional
  9060. });
  9061. const re$1 = regexp ? regexp : BASE_PARAM_PATTERN;
  9062. if (re$1 !== BASE_PARAM_PATTERN) {
  9063. subSegmentScore += PathScore.BonusCustomRegExp;
  9064. try {
  9065. `${re$1}`;
  9066. } catch (err) {
  9067. throw new Error(`Invalid custom RegExp for param "${value}" (${re$1}): ` + err.message);
  9068. }
  9069. }
  9070. let subPattern = repeatable ? `((?:${re$1})(?:/(?:${re$1}))*)` : `(${re$1})`;
  9071. if (!tokenIndex)
  9072. subPattern = optional && segment.length < 2 ? `(?:/${subPattern})` : "/" + subPattern;
  9073. if (optional)
  9074. subPattern += "?";
  9075. pattern += subPattern;
  9076. subSegmentScore += PathScore.Dynamic;
  9077. if (optional)
  9078. subSegmentScore += PathScore.BonusOptional;
  9079. if (repeatable)
  9080. subSegmentScore += PathScore.BonusRepeatable;
  9081. if (re$1 === ".*")
  9082. subSegmentScore += PathScore.BonusWildcard;
  9083. }
  9084. segmentScores.push(subSegmentScore);
  9085. }
  9086. score.push(segmentScores);
  9087. }
  9088. if (options.strict && options.end) {
  9089. const i = score.length - 1;
  9090. score[i][score[i].length - 1] += PathScore.BonusStrict;
  9091. }
  9092. if (!options.strict)
  9093. pattern += "/?";
  9094. if (options.end)
  9095. pattern += "$";
  9096. else if (options.strict && !pattern.endsWith("/"))
  9097. pattern += "(?:/|$)";
  9098. const re = new RegExp(pattern, options.sensitive ? "" : "i");
  9099. function parse(path) {
  9100. const match = path.match(re);
  9101. const params = {};
  9102. if (!match)
  9103. return null;
  9104. for (let i = 1; i < match.length; i++) {
  9105. const value = match[i] || "";
  9106. const key = keys[i - 1];
  9107. params[key.name] = value && key.repeatable ? value.split("/") : value;
  9108. }
  9109. return params;
  9110. }
  9111. function stringify(params) {
  9112. let path = "";
  9113. let avoidDuplicatedSlash = false;
  9114. for (const segment of segments) {
  9115. if (!avoidDuplicatedSlash || !path.endsWith("/"))
  9116. path += "/";
  9117. avoidDuplicatedSlash = false;
  9118. for (const token of segment)
  9119. if (token.type === TokenType.Static)
  9120. path += token.value;
  9121. else if (token.type === TokenType.Param) {
  9122. const { value, repeatable, optional } = token;
  9123. const param = value in params ? params[value] : "";
  9124. if (isArray(param) && !repeatable)
  9125. throw new Error(`Provided param "${value}" is an array but it is not repeatable (* or + modifiers)`);
  9126. const text = isArray(param) ? param.join("/") : param;
  9127. if (!text)
  9128. if (optional) {
  9129. if (segment.length < 2)
  9130. if (path.endsWith("/"))
  9131. path = path.slice(0, -1);
  9132. else
  9133. avoidDuplicatedSlash = true;
  9134. } else
  9135. throw new Error(`Missing required param "${value}"`);
  9136. path += text;
  9137. }
  9138. }
  9139. return path || "/";
  9140. }
  9141. return {
  9142. re,
  9143. score,
  9144. keys,
  9145. parse,
  9146. stringify
  9147. };
  9148. }
  9149. function compareScoreArray(a, b) {
  9150. let i = 0;
  9151. while (i < a.length && i < b.length) {
  9152. const diff = b[i] - a[i];
  9153. if (diff)
  9154. return diff;
  9155. i++;
  9156. }
  9157. if (a.length < b.length)
  9158. return a.length === 1 && a[0] === PathScore.Static + PathScore.Segment ? -1 : 1;
  9159. else if (a.length > b.length)
  9160. return b.length === 1 && b[0] === PathScore.Static + PathScore.Segment ? 1 : -1;
  9161. return 0;
  9162. }
  9163. function comparePathParserScore(a, b) {
  9164. let i = 0;
  9165. const aScore = a.score;
  9166. const bScore = b.score;
  9167. while (i < aScore.length && i < bScore.length) {
  9168. const comp = compareScoreArray(aScore[i], bScore[i]);
  9169. if (comp)
  9170. return comp;
  9171. i++;
  9172. }
  9173. if (Math.abs(bScore.length - aScore.length) === 1) {
  9174. if (isLastScoreNegative(aScore))
  9175. return 1;
  9176. if (isLastScoreNegative(bScore))
  9177. return -1;
  9178. }
  9179. return bScore.length - aScore.length;
  9180. }
  9181. function isLastScoreNegative(score) {
  9182. const last = score[score.length - 1];
  9183. return score.length > 0 && last[last.length - 1] < 0;
  9184. }
  9185. const PATH_PARSER_OPTIONS_DEFAULTS = {
  9186. strict: false,
  9187. end: true,
  9188. sensitive: false
  9189. };
  9190. function createRouteRecordMatcher(record, parent, options) {
  9191. const parser = tokensToParser(tokenizePath(record.path), options);
  9192. const matcher = assign(parser, {
  9193. record,
  9194. parent,
  9195. children: [],
  9196. alias: []
  9197. });
  9198. if (parent) {
  9199. if (!matcher.record.aliasOf === !parent.record.aliasOf)
  9200. parent.children.push(matcher);
  9201. }
  9202. return matcher;
  9203. }
  9204. function createRouterMatcher(routes, globalOptions) {
  9205. const matchers = [];
  9206. const matcherMap = /* @__PURE__ */ new Map();
  9207. globalOptions = mergeOptions(PATH_PARSER_OPTIONS_DEFAULTS, globalOptions);
  9208. function getRecordMatcher(name) {
  9209. return matcherMap.get(name);
  9210. }
  9211. function addRoute(record, parent, originalRecord) {
  9212. const isRootAdd = !originalRecord;
  9213. const mainNormalizedRecord = normalizeRouteRecord(record);
  9214. mainNormalizedRecord.aliasOf = originalRecord && originalRecord.record;
  9215. const options = mergeOptions(globalOptions, record);
  9216. const normalizedRecords = [mainNormalizedRecord];
  9217. if ("alias" in record) {
  9218. const aliases = typeof record.alias === "string" ? [record.alias] : record.alias;
  9219. for (const alias of aliases)
  9220. normalizedRecords.push(normalizeRouteRecord(assign({}, mainNormalizedRecord, {
  9221. components: originalRecord ? originalRecord.record.components : mainNormalizedRecord.components,
  9222. path: alias,
  9223. aliasOf: originalRecord ? originalRecord.record : mainNormalizedRecord
  9224. })));
  9225. }
  9226. let matcher;
  9227. let originalMatcher;
  9228. for (const normalizedRecord of normalizedRecords) {
  9229. const { path } = normalizedRecord;
  9230. if (parent && path[0] !== "/") {
  9231. const parentPath = parent.record.path;
  9232. const connectingSlash = parentPath[parentPath.length - 1] === "/" ? "" : "/";
  9233. normalizedRecord.path = parent.record.path + (path && connectingSlash + path);
  9234. }
  9235. matcher = createRouteRecordMatcher(normalizedRecord, parent, options);
  9236. if (originalRecord) {
  9237. originalRecord.alias.push(matcher);
  9238. } else {
  9239. originalMatcher = originalMatcher || matcher;
  9240. if (originalMatcher !== matcher)
  9241. originalMatcher.alias.push(matcher);
  9242. if (isRootAdd && record.name && !isAliasRecord(matcher)) {
  9243. removeRoute(record.name);
  9244. }
  9245. }
  9246. if (isMatchable(matcher))
  9247. insertMatcher(matcher);
  9248. if (mainNormalizedRecord.children) {
  9249. const children = mainNormalizedRecord.children;
  9250. for (let i = 0; i < children.length; i++)
  9251. addRoute(children[i], matcher, originalRecord && originalRecord.children[i]);
  9252. }
  9253. originalRecord = originalRecord || matcher;
  9254. }
  9255. return originalMatcher ? () => {
  9256. removeRoute(originalMatcher);
  9257. } : noop;
  9258. }
  9259. function removeRoute(matcherRef) {
  9260. if (isRouteName(matcherRef)) {
  9261. const matcher = matcherMap.get(matcherRef);
  9262. if (matcher) {
  9263. matcherMap.delete(matcherRef);
  9264. matchers.splice(matchers.indexOf(matcher), 1);
  9265. matcher.children.forEach(removeRoute);
  9266. matcher.alias.forEach(removeRoute);
  9267. }
  9268. } else {
  9269. const index = matchers.indexOf(matcherRef);
  9270. if (index > -1) {
  9271. matchers.splice(index, 1);
  9272. if (matcherRef.record.name)
  9273. matcherMap.delete(matcherRef.record.name);
  9274. matcherRef.children.forEach(removeRoute);
  9275. matcherRef.alias.forEach(removeRoute);
  9276. }
  9277. }
  9278. }
  9279. function getRoutes() {
  9280. return matchers;
  9281. }
  9282. function insertMatcher(matcher) {
  9283. const index = findInsertionIndex(matcher, matchers);
  9284. matchers.splice(index, 0, matcher);
  9285. if (matcher.record.name && !isAliasRecord(matcher))
  9286. matcherMap.set(matcher.record.name, matcher);
  9287. }
  9288. function resolve2(location$1, currentLocation) {
  9289. let matcher;
  9290. let params = {};
  9291. let path;
  9292. let name;
  9293. if ("name" in location$1 && location$1.name) {
  9294. matcher = matcherMap.get(location$1.name);
  9295. if (!matcher)
  9296. throw createRouterError(ErrorTypes.MATCHER_NOT_FOUND, { location: location$1 });
  9297. name = matcher.record.name;
  9298. params = assign(pickParams(currentLocation.params, matcher.keys.filter((k) => !k.optional).concat(matcher.parent ? matcher.parent.keys.filter((k) => k.optional) : []).map((k) => k.name)), location$1.params && pickParams(location$1.params, matcher.keys.map((k) => k.name)));
  9299. path = matcher.stringify(params);
  9300. } else if (location$1.path != null) {
  9301. path = location$1.path;
  9302. matcher = matchers.find((m) => m.re.test(path));
  9303. if (matcher) {
  9304. params = matcher.parse(path);
  9305. name = matcher.record.name;
  9306. }
  9307. } else {
  9308. matcher = currentLocation.name ? matcherMap.get(currentLocation.name) : matchers.find((m) => m.re.test(currentLocation.path));
  9309. if (!matcher)
  9310. throw createRouterError(ErrorTypes.MATCHER_NOT_FOUND, {
  9311. location: location$1,
  9312. currentLocation
  9313. });
  9314. name = matcher.record.name;
  9315. params = assign({}, currentLocation.params, location$1.params);
  9316. path = matcher.stringify(params);
  9317. }
  9318. const matched = [];
  9319. let parentMatcher = matcher;
  9320. while (parentMatcher) {
  9321. matched.unshift(parentMatcher.record);
  9322. parentMatcher = parentMatcher.parent;
  9323. }
  9324. return {
  9325. name,
  9326. path,
  9327. params,
  9328. matched,
  9329. meta: mergeMetaFields(matched)
  9330. };
  9331. }
  9332. routes.forEach((route) => addRoute(route));
  9333. function clearRoutes() {
  9334. matchers.length = 0;
  9335. matcherMap.clear();
  9336. }
  9337. return {
  9338. addRoute,
  9339. resolve: resolve2,
  9340. removeRoute,
  9341. clearRoutes,
  9342. getRoutes,
  9343. getRecordMatcher
  9344. };
  9345. }
  9346. function pickParams(params, keys) {
  9347. const newParams = {};
  9348. for (const key of keys)
  9349. if (key in params)
  9350. newParams[key] = params[key];
  9351. return newParams;
  9352. }
  9353. function normalizeRouteRecord(record) {
  9354. const normalized = {
  9355. path: record.path,
  9356. redirect: record.redirect,
  9357. name: record.name,
  9358. meta: record.meta || {},
  9359. aliasOf: record.aliasOf,
  9360. beforeEnter: record.beforeEnter,
  9361. props: normalizeRecordProps(record),
  9362. children: record.children || [],
  9363. instances: {},
  9364. leaveGuards: /* @__PURE__ */ new Set(),
  9365. updateGuards: /* @__PURE__ */ new Set(),
  9366. enterCallbacks: {},
  9367. components: "components" in record ? record.components || null : record.component && { default: record.component }
  9368. };
  9369. Object.defineProperty(normalized, "mods", { value: {} });
  9370. return normalized;
  9371. }
  9372. function normalizeRecordProps(record) {
  9373. const propsObject = {};
  9374. const props = record.props || false;
  9375. if ("component" in record)
  9376. propsObject.default = props;
  9377. else
  9378. for (const name in record.components)
  9379. propsObject[name] = typeof props === "object" ? props[name] : props;
  9380. return propsObject;
  9381. }
  9382. function isAliasRecord(record) {
  9383. while (record) {
  9384. if (record.record.aliasOf)
  9385. return true;
  9386. record = record.parent;
  9387. }
  9388. return false;
  9389. }
  9390. function mergeMetaFields(matched) {
  9391. return matched.reduce((meta, record) => assign(meta, record.meta), {});
  9392. }
  9393. function findInsertionIndex(matcher, matchers) {
  9394. let lower = 0;
  9395. let upper = matchers.length;
  9396. while (lower !== upper) {
  9397. const mid = lower + upper >> 1;
  9398. if (comparePathParserScore(matcher, matchers[mid]) < 0)
  9399. upper = mid;
  9400. else
  9401. lower = mid + 1;
  9402. }
  9403. const insertionAncestor = getInsertionAncestor(matcher);
  9404. if (insertionAncestor) {
  9405. upper = matchers.lastIndexOf(insertionAncestor, upper - 1);
  9406. }
  9407. return upper;
  9408. }
  9409. function getInsertionAncestor(matcher) {
  9410. let ancestor = matcher;
  9411. while (ancestor = ancestor.parent)
  9412. if (isMatchable(ancestor) && comparePathParserScore(matcher, ancestor) === 0)
  9413. return ancestor;
  9414. }
  9415. function isMatchable({ record }) {
  9416. return !!(record.name || record.components && Object.keys(record.components).length || record.redirect);
  9417. }
  9418. function useLink(props) {
  9419. const router = inject(routerKey);
  9420. const currentRoute = inject(routeLocationKey);
  9421. const route = computed(() => {
  9422. const to = unref(props.to);
  9423. return router.resolve(to);
  9424. });
  9425. const activeRecordIndex = computed(() => {
  9426. const { matched } = route.value;
  9427. const { length } = matched;
  9428. const routeMatched = matched[length - 1];
  9429. const currentMatched = currentRoute.matched;
  9430. if (!routeMatched || !currentMatched.length)
  9431. return -1;
  9432. const index = currentMatched.findIndex(isSameRouteRecord.bind(null, routeMatched));
  9433. if (index > -1)
  9434. return index;
  9435. const parentRecordPath = getOriginalPath(matched[length - 2]);
  9436. return length > 1 && getOriginalPath(routeMatched) === parentRecordPath && currentMatched[currentMatched.length - 1].path !== parentRecordPath ? currentMatched.findIndex(isSameRouteRecord.bind(null, matched[length - 2])) : index;
  9437. });
  9438. const isActive = computed(() => activeRecordIndex.value > -1 && includesParams(currentRoute.params, route.value.params));
  9439. const isExactActive = computed(() => activeRecordIndex.value > -1 && activeRecordIndex.value === currentRoute.matched.length - 1 && isSameRouteLocationParams(currentRoute.params, route.value.params));
  9440. function navigate(e = {}) {
  9441. if (guardEvent(e)) {
  9442. const p2 = router[unref(props.replace) ? "replace" : "push"](unref(props.to)).catch(noop);
  9443. if (props.viewTransition && typeof document !== "undefined" && "startViewTransition" in document)
  9444. document.startViewTransition(() => p2);
  9445. return p2;
  9446. }
  9447. return Promise.resolve();
  9448. }
  9449. return {
  9450. route,
  9451. href: computed(() => route.value.href),
  9452. isActive,
  9453. isExactActive,
  9454. navigate
  9455. };
  9456. }
  9457. function preferSingleVNode(vnodes) {
  9458. return vnodes.length === 1 ? vnodes[0] : vnodes;
  9459. }
  9460. const RouterLinkImpl = /* @__PURE__ */ defineComponent({
  9461. name: "RouterLink",
  9462. compatConfig: { MODE: 3 },
  9463. props: {
  9464. to: {
  9465. type: [String, Object],
  9466. required: true
  9467. },
  9468. replace: Boolean,
  9469. activeClass: String,
  9470. exactActiveClass: String,
  9471. custom: Boolean,
  9472. ariaCurrentValue: {
  9473. type: String,
  9474. default: "page"
  9475. },
  9476. viewTransition: Boolean
  9477. },
  9478. useLink,
  9479. setup(props, { slots }) {
  9480. const link = reactive(useLink(props));
  9481. const { options } = inject(routerKey);
  9482. const elClass = computed(() => ({
  9483. [getLinkClass(props.activeClass, options.linkActiveClass, "router-link-active")]: link.isActive,
  9484. [getLinkClass(props.exactActiveClass, options.linkExactActiveClass, "router-link-exact-active")]: link.isExactActive
  9485. }));
  9486. return () => {
  9487. const children = slots.default && preferSingleVNode(slots.default(link));
  9488. return props.custom ? children : h("a", {
  9489. "aria-current": link.isExactActive ? props.ariaCurrentValue : null,
  9490. href: link.href,
  9491. onClick: link.navigate,
  9492. class: elClass.value
  9493. }, children);
  9494. };
  9495. }
  9496. });
  9497. const RouterLink = RouterLinkImpl;
  9498. function guardEvent(e) {
  9499. if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey)
  9500. return;
  9501. if (e.defaultPrevented)
  9502. return;
  9503. if (e.button !== void 0 && e.button !== 0)
  9504. return;
  9505. if (e.currentTarget && e.currentTarget.getAttribute) {
  9506. const target = e.currentTarget.getAttribute("target");
  9507. if (/\b_blank\b/i.test(target))
  9508. return;
  9509. }
  9510. if (e.preventDefault)
  9511. e.preventDefault();
  9512. return true;
  9513. }
  9514. function includesParams(outer, inner) {
  9515. for (const key in inner) {
  9516. const innerValue = inner[key];
  9517. const outerValue = outer[key];
  9518. if (typeof innerValue === "string") {
  9519. if (innerValue !== outerValue)
  9520. return false;
  9521. } else if (!isArray(outerValue) || outerValue.length !== innerValue.length || innerValue.some((value, i) => value.valueOf() !== outerValue[i].valueOf()))
  9522. return false;
  9523. }
  9524. return true;
  9525. }
  9526. function getOriginalPath(record) {
  9527. return record ? record.aliasOf ? record.aliasOf.path : record.path : "";
  9528. }
  9529. const getLinkClass = (propClass, globalClass, defaultClass) => propClass != null ? propClass : globalClass != null ? globalClass : defaultClass;
  9530. const RouterViewImpl = /* @__PURE__ */ defineComponent({
  9531. name: "RouterView",
  9532. inheritAttrs: false,
  9533. props: {
  9534. name: {
  9535. type: String,
  9536. default: "default"
  9537. },
  9538. route: Object
  9539. },
  9540. compatConfig: { MODE: 3 },
  9541. setup(props, { attrs, slots }) {
  9542. const injectedRoute = inject(routerViewLocationKey);
  9543. const routeToDisplay = computed(() => props.route || injectedRoute.value);
  9544. const injectedDepth = inject(viewDepthKey, 0);
  9545. const depth = computed(() => {
  9546. let initialDepth = unref(injectedDepth);
  9547. const { matched } = routeToDisplay.value;
  9548. let matchedRoute;
  9549. while ((matchedRoute = matched[initialDepth]) && !matchedRoute.components)
  9550. initialDepth++;
  9551. return initialDepth;
  9552. });
  9553. const matchedRouteRef = computed(() => routeToDisplay.value.matched[depth.value]);
  9554. provide(viewDepthKey, computed(() => depth.value + 1));
  9555. provide(matchedRouteKey, matchedRouteRef);
  9556. provide(routerViewLocationKey, routeToDisplay);
  9557. const viewRef = ref();
  9558. watch(() => [
  9559. viewRef.value,
  9560. matchedRouteRef.value,
  9561. props.name
  9562. ], ([instance, to, name], [oldInstance, from, oldName]) => {
  9563. if (to) {
  9564. to.instances[name] = instance;
  9565. if (from && from !== to && instance && instance === oldInstance) {
  9566. if (!to.leaveGuards.size)
  9567. to.leaveGuards = from.leaveGuards;
  9568. if (!to.updateGuards.size)
  9569. to.updateGuards = from.updateGuards;
  9570. }
  9571. }
  9572. if (instance && to && (!from || !isSameRouteRecord(to, from) || !oldInstance))
  9573. (to.enterCallbacks[name] || []).forEach((callback) => callback(instance));
  9574. }, { flush: "post" });
  9575. return () => {
  9576. const route = routeToDisplay.value;
  9577. const currentName = props.name;
  9578. const matchedRoute = matchedRouteRef.value;
  9579. const ViewComponent = matchedRoute && matchedRoute.components[currentName];
  9580. if (!ViewComponent)
  9581. return normalizeSlot(slots.default, {
  9582. Component: ViewComponent,
  9583. route
  9584. });
  9585. const routePropsOption = matchedRoute.props[currentName];
  9586. const routeProps = routePropsOption ? routePropsOption === true ? route.params : typeof routePropsOption === "function" ? routePropsOption(route) : routePropsOption : null;
  9587. const onVnodeUnmounted = (vnode) => {
  9588. if (vnode.component.isUnmounted)
  9589. matchedRoute.instances[currentName] = null;
  9590. };
  9591. const component = h(ViewComponent, assign({}, routeProps, attrs, {
  9592. onVnodeUnmounted,
  9593. ref: viewRef
  9594. }));
  9595. return normalizeSlot(slots.default, {
  9596. Component: component,
  9597. route
  9598. }) || component;
  9599. };
  9600. }
  9601. });
  9602. function normalizeSlot(slot, data) {
  9603. if (!slot)
  9604. return null;
  9605. const slotContent = slot(data);
  9606. return slotContent.length === 1 ? slotContent[0] : slotContent;
  9607. }
  9608. const RouterView = RouterViewImpl;
  9609. function createRouter(options) {
  9610. const matcher = createRouterMatcher(options.routes, options);
  9611. const parseQuery$1 = options.parseQuery || parseQuery;
  9612. const stringifyQuery$1 = options.stringifyQuery || stringifyQuery;
  9613. const routerHistory = options.history;
  9614. const beforeGuards = useCallbacks();
  9615. const beforeResolveGuards = useCallbacks();
  9616. const afterGuards = useCallbacks();
  9617. const currentRoute = shallowRef(START_LOCATION_NORMALIZED);
  9618. let pendingLocation = START_LOCATION_NORMALIZED;
  9619. if (isBrowser && options.scrollBehavior && "scrollRestoration" in history)
  9620. history.scrollRestoration = "manual";
  9621. const normalizeParams = applyToParams.bind(null, (paramValue) => "" + paramValue);
  9622. const encodeParams = applyToParams.bind(null, encodeParam);
  9623. const decodeParams = applyToParams.bind(null, decode);
  9624. function addRoute(parentOrRoute, route) {
  9625. let parent;
  9626. let record;
  9627. if (isRouteName(parentOrRoute)) {
  9628. parent = matcher.getRecordMatcher(parentOrRoute);
  9629. record = route;
  9630. } else
  9631. record = parentOrRoute;
  9632. return matcher.addRoute(record, parent);
  9633. }
  9634. function removeRoute(name) {
  9635. const recordMatcher = matcher.getRecordMatcher(name);
  9636. if (recordMatcher)
  9637. matcher.removeRoute(recordMatcher);
  9638. }
  9639. function getRoutes() {
  9640. return matcher.getRoutes().map((routeMatcher) => routeMatcher.record);
  9641. }
  9642. function hasRoute(name) {
  9643. return !!matcher.getRecordMatcher(name);
  9644. }
  9645. function resolve2(rawLocation, currentLocation) {
  9646. currentLocation = assign({}, currentLocation || currentRoute.value);
  9647. if (typeof rawLocation === "string") {
  9648. const locationNormalized = parseURL(parseQuery$1, rawLocation, currentLocation.path);
  9649. const matchedRoute$1 = matcher.resolve({ path: locationNormalized.path }, currentLocation);
  9650. const href$1 = routerHistory.createHref(locationNormalized.fullPath);
  9651. return assign(locationNormalized, matchedRoute$1, {
  9652. params: decodeParams(matchedRoute$1.params),
  9653. hash: decode(locationNormalized.hash),
  9654. redirectedFrom: void 0,
  9655. href: href$1
  9656. });
  9657. }
  9658. let matcherLocation;
  9659. if (rawLocation.path != null) {
  9660. matcherLocation = assign({}, rawLocation, { path: parseURL(parseQuery$1, rawLocation.path, currentLocation.path).path });
  9661. } else {
  9662. const targetParams = assign({}, rawLocation.params);
  9663. for (const key in targetParams)
  9664. if (targetParams[key] == null)
  9665. delete targetParams[key];
  9666. matcherLocation = assign({}, rawLocation, { params: encodeParams(targetParams) });
  9667. currentLocation.params = encodeParams(currentLocation.params);
  9668. }
  9669. const matchedRoute = matcher.resolve(matcherLocation, currentLocation);
  9670. const hash = rawLocation.hash || "";
  9671. matchedRoute.params = normalizeParams(decodeParams(matchedRoute.params));
  9672. const fullPath = stringifyURL(stringifyQuery$1, assign({}, rawLocation, {
  9673. hash: encodeHash(hash),
  9674. path: matchedRoute.path
  9675. }));
  9676. const href = routerHistory.createHref(fullPath);
  9677. return assign({
  9678. fullPath,
  9679. hash,
  9680. query: stringifyQuery$1 === stringifyQuery ? normalizeQuery(rawLocation.query) : rawLocation.query || {}
  9681. }, matchedRoute, {
  9682. redirectedFrom: void 0,
  9683. href
  9684. });
  9685. }
  9686. function locationAsObject(to) {
  9687. return typeof to === "string" ? parseURL(parseQuery$1, to, currentRoute.value.path) : assign({}, to);
  9688. }
  9689. function checkCanceledNavigation(to, from) {
  9690. if (pendingLocation !== to)
  9691. return createRouterError(ErrorTypes.NAVIGATION_CANCELLED, {
  9692. from,
  9693. to
  9694. });
  9695. }
  9696. function push(to) {
  9697. return pushWithRedirect(to);
  9698. }
  9699. function replace(to) {
  9700. return push(assign(locationAsObject(to), { replace: true }));
  9701. }
  9702. function handleRedirectRecord(to, from) {
  9703. const lastMatched = to.matched[to.matched.length - 1];
  9704. if (lastMatched && lastMatched.redirect) {
  9705. const { redirect } = lastMatched;
  9706. let newTargetLocation = typeof redirect === "function" ? redirect(to, from) : redirect;
  9707. if (typeof newTargetLocation === "string") {
  9708. newTargetLocation = newTargetLocation.includes("?") || newTargetLocation.includes("#") ? newTargetLocation = locationAsObject(newTargetLocation) : { path: newTargetLocation };
  9709. newTargetLocation.params = {};
  9710. }
  9711. return assign({
  9712. query: to.query,
  9713. hash: to.hash,
  9714. params: newTargetLocation.path != null ? {} : to.params
  9715. }, newTargetLocation);
  9716. }
  9717. }
  9718. function pushWithRedirect(to, redirectedFrom) {
  9719. const targetLocation = pendingLocation = resolve2(to);
  9720. const from = currentRoute.value;
  9721. const data = to.state;
  9722. const force = to.force;
  9723. const replace$1 = to.replace === true;
  9724. const shouldRedirect = handleRedirectRecord(targetLocation, from);
  9725. if (shouldRedirect)
  9726. return pushWithRedirect(assign(locationAsObject(shouldRedirect), {
  9727. state: typeof shouldRedirect === "object" ? assign({}, data, shouldRedirect.state) : data,
  9728. force,
  9729. replace: replace$1
  9730. }), redirectedFrom || targetLocation);
  9731. const toLocation = targetLocation;
  9732. toLocation.redirectedFrom = redirectedFrom;
  9733. let failure;
  9734. if (!force && isSameRouteLocation(stringifyQuery$1, from, targetLocation)) {
  9735. failure = createRouterError(ErrorTypes.NAVIGATION_DUPLICATED, {
  9736. to: toLocation,
  9737. from
  9738. });
  9739. handleScroll(from, from, true, false);
  9740. }
  9741. return (failure ? Promise.resolve(failure) : navigate(toLocation, from)).catch((error) => isNavigationFailure(error) ? isNavigationFailure(error, ErrorTypes.NAVIGATION_GUARD_REDIRECT) ? error : markAsReady(error) : triggerError(error, toLocation, from)).then((failure$1) => {
  9742. if (failure$1) {
  9743. if (isNavigationFailure(failure$1, ErrorTypes.NAVIGATION_GUARD_REDIRECT)) {
  9744. return pushWithRedirect(assign({ replace: replace$1 }, locationAsObject(failure$1.to), {
  9745. state: typeof failure$1.to === "object" ? assign({}, data, failure$1.to.state) : data,
  9746. force
  9747. }), redirectedFrom || toLocation);
  9748. }
  9749. } else
  9750. failure$1 = finalizeNavigation(toLocation, from, true, replace$1, data);
  9751. triggerAfterEach(toLocation, from, failure$1);
  9752. return failure$1;
  9753. });
  9754. }
  9755. function checkCanceledNavigationAndReject(to, from) {
  9756. const error = checkCanceledNavigation(to, from);
  9757. return error ? Promise.reject(error) : Promise.resolve();
  9758. }
  9759. function runWithContext(fn) {
  9760. const app = installedApps.values().next().value;
  9761. return app && typeof app.runWithContext === "function" ? app.runWithContext(fn) : fn();
  9762. }
  9763. function navigate(to, from) {
  9764. let guards;
  9765. const [leavingRecords, updatingRecords, enteringRecords] = extractChangingRecords(to, from);
  9766. guards = extractComponentsGuards(leavingRecords.reverse(), "beforeRouteLeave", to, from);
  9767. for (const record of leavingRecords)
  9768. record.leaveGuards.forEach((guard) => {
  9769. guards.push(guardToPromiseFn(guard, to, from));
  9770. });
  9771. const canceledNavigationCheck = checkCanceledNavigationAndReject.bind(null, to, from);
  9772. guards.push(canceledNavigationCheck);
  9773. return runGuardQueue(guards).then(() => {
  9774. guards = [];
  9775. for (const guard of beforeGuards.list())
  9776. guards.push(guardToPromiseFn(guard, to, from));
  9777. guards.push(canceledNavigationCheck);
  9778. return runGuardQueue(guards);
  9779. }).then(() => {
  9780. guards = extractComponentsGuards(updatingRecords, "beforeRouteUpdate", to, from);
  9781. for (const record of updatingRecords)
  9782. record.updateGuards.forEach((guard) => {
  9783. guards.push(guardToPromiseFn(guard, to, from));
  9784. });
  9785. guards.push(canceledNavigationCheck);
  9786. return runGuardQueue(guards);
  9787. }).then(() => {
  9788. guards = [];
  9789. for (const record of enteringRecords)
  9790. if (record.beforeEnter)
  9791. if (isArray(record.beforeEnter))
  9792. for (const beforeEnter of record.beforeEnter)
  9793. guards.push(guardToPromiseFn(beforeEnter, to, from));
  9794. else
  9795. guards.push(guardToPromiseFn(record.beforeEnter, to, from));
  9796. guards.push(canceledNavigationCheck);
  9797. return runGuardQueue(guards);
  9798. }).then(() => {
  9799. to.matched.forEach((record) => record.enterCallbacks = {});
  9800. guards = extractComponentsGuards(enteringRecords, "beforeRouteEnter", to, from, runWithContext);
  9801. guards.push(canceledNavigationCheck);
  9802. return runGuardQueue(guards);
  9803. }).then(() => {
  9804. guards = [];
  9805. for (const guard of beforeResolveGuards.list())
  9806. guards.push(guardToPromiseFn(guard, to, from));
  9807. guards.push(canceledNavigationCheck);
  9808. return runGuardQueue(guards);
  9809. }).catch((err) => isNavigationFailure(err, ErrorTypes.NAVIGATION_CANCELLED) ? err : Promise.reject(err));
  9810. }
  9811. function triggerAfterEach(to, from, failure) {
  9812. afterGuards.list().forEach((guard) => runWithContext(() => guard(to, from, failure)));
  9813. }
  9814. function finalizeNavigation(toLocation, from, isPush, replace$1, data) {
  9815. const error = checkCanceledNavigation(toLocation, from);
  9816. if (error)
  9817. return error;
  9818. const isFirstNavigation = from === START_LOCATION_NORMALIZED;
  9819. const state = !isBrowser ? {} : history.state;
  9820. if (isPush)
  9821. if (replace$1 || isFirstNavigation)
  9822. routerHistory.replace(toLocation.fullPath, assign({ scroll: isFirstNavigation && state && state.scroll }, data));
  9823. else
  9824. routerHistory.push(toLocation.fullPath, data);
  9825. currentRoute.value = toLocation;
  9826. handleScroll(toLocation, from, isPush, isFirstNavigation);
  9827. markAsReady();
  9828. }
  9829. let removeHistoryListener;
  9830. function setupListeners() {
  9831. if (removeHistoryListener)
  9832. return;
  9833. removeHistoryListener = routerHistory.listen((to, _from, info) => {
  9834. if (!router.listening)
  9835. return;
  9836. const toLocation = resolve2(to);
  9837. const shouldRedirect = handleRedirectRecord(toLocation, router.currentRoute.value);
  9838. if (shouldRedirect) {
  9839. pushWithRedirect(assign(shouldRedirect, {
  9840. replace: true,
  9841. force: true
  9842. }), toLocation).catch(noop);
  9843. return;
  9844. }
  9845. pendingLocation = toLocation;
  9846. const from = currentRoute.value;
  9847. if (isBrowser)
  9848. saveScrollPosition(getScrollKey(from.fullPath, info.delta), computeScrollPosition());
  9849. navigate(toLocation, from).catch((error) => {
  9850. if (isNavigationFailure(error, ErrorTypes.NAVIGATION_ABORTED | ErrorTypes.NAVIGATION_CANCELLED))
  9851. return error;
  9852. if (isNavigationFailure(error, ErrorTypes.NAVIGATION_GUARD_REDIRECT)) {
  9853. pushWithRedirect(assign(locationAsObject(error.to), { force: true }), toLocation).then((failure) => {
  9854. if (isNavigationFailure(failure, ErrorTypes.NAVIGATION_ABORTED | ErrorTypes.NAVIGATION_DUPLICATED) && !info.delta && info.type === NavigationType.pop)
  9855. routerHistory.go(-1, false);
  9856. }).catch(noop);
  9857. return Promise.reject();
  9858. }
  9859. if (info.delta)
  9860. routerHistory.go(-info.delta, false);
  9861. return triggerError(error, toLocation, from);
  9862. }).then((failure) => {
  9863. failure = failure || finalizeNavigation(toLocation, from, false);
  9864. if (failure) {
  9865. if (info.delta && !isNavigationFailure(failure, ErrorTypes.NAVIGATION_CANCELLED))
  9866. routerHistory.go(-info.delta, false);
  9867. else if (info.type === NavigationType.pop && isNavigationFailure(failure, ErrorTypes.NAVIGATION_ABORTED | ErrorTypes.NAVIGATION_DUPLICATED))
  9868. routerHistory.go(-1, false);
  9869. }
  9870. triggerAfterEach(toLocation, from, failure);
  9871. }).catch(noop);
  9872. });
  9873. }
  9874. let readyHandlers = useCallbacks();
  9875. let errorListeners = useCallbacks();
  9876. let ready;
  9877. function triggerError(error, to, from) {
  9878. markAsReady(error);
  9879. const list = errorListeners.list();
  9880. if (list.length)
  9881. list.forEach((handler) => handler(error, to, from));
  9882. else {
  9883. console.error(error);
  9884. }
  9885. return Promise.reject(error);
  9886. }
  9887. function isReady() {
  9888. if (ready && currentRoute.value !== START_LOCATION_NORMALIZED)
  9889. return Promise.resolve();
  9890. return new Promise((resolve$1, reject) => {
  9891. readyHandlers.add([resolve$1, reject]);
  9892. });
  9893. }
  9894. function markAsReady(err) {
  9895. if (!ready) {
  9896. ready = !err;
  9897. setupListeners();
  9898. readyHandlers.list().forEach(([resolve$1, reject]) => err ? reject(err) : resolve$1());
  9899. readyHandlers.reset();
  9900. }
  9901. return err;
  9902. }
  9903. function handleScroll(to, from, isPush, isFirstNavigation) {
  9904. const { scrollBehavior } = options;
  9905. if (!isBrowser || !scrollBehavior)
  9906. return Promise.resolve();
  9907. const scrollPosition = !isPush && getSavedScrollPosition(getScrollKey(to.fullPath, 0)) || (isFirstNavigation || !isPush) && history.state && history.state.scroll || null;
  9908. return nextTick().then(() => scrollBehavior(to, from, scrollPosition)).then((position) => position && scrollToPosition(position)).catch((err) => triggerError(err, to, from));
  9909. }
  9910. const go = (delta) => routerHistory.go(delta);
  9911. let started;
  9912. const installedApps = /* @__PURE__ */ new Set();
  9913. const router = {
  9914. currentRoute,
  9915. listening: true,
  9916. addRoute,
  9917. removeRoute,
  9918. clearRoutes: matcher.clearRoutes,
  9919. hasRoute,
  9920. getRoutes,
  9921. resolve: resolve2,
  9922. options,
  9923. push,
  9924. replace,
  9925. go,
  9926. back: () => go(-1),
  9927. forward: () => go(1),
  9928. beforeEach: beforeGuards.add,
  9929. beforeResolve: beforeResolveGuards.add,
  9930. afterEach: afterGuards.add,
  9931. onError: errorListeners.add,
  9932. isReady,
  9933. install(app) {
  9934. app.component("RouterLink", RouterLink);
  9935. app.component("RouterView", RouterView);
  9936. app.config.globalProperties.$router = router;
  9937. Object.defineProperty(app.config.globalProperties, "$route", {
  9938. enumerable: true,
  9939. get: () => unref(currentRoute)
  9940. });
  9941. if (isBrowser && !started && currentRoute.value === START_LOCATION_NORMALIZED) {
  9942. started = true;
  9943. push(routerHistory.location).catch((err) => {
  9944. });
  9945. }
  9946. const reactiveRoute = {};
  9947. for (const key in START_LOCATION_NORMALIZED)
  9948. Object.defineProperty(reactiveRoute, key, {
  9949. get: () => currentRoute.value[key],
  9950. enumerable: true
  9951. });
  9952. app.provide(routerKey, router);
  9953. app.provide(routeLocationKey, shallowReactive(reactiveRoute));
  9954. app.provide(routerViewLocationKey, currentRoute);
  9955. const unmountApp = app.unmount;
  9956. installedApps.add(app);
  9957. app.unmount = function() {
  9958. installedApps.delete(app);
  9959. if (installedApps.size < 1) {
  9960. pendingLocation = START_LOCATION_NORMALIZED;
  9961. removeHistoryListener && removeHistoryListener();
  9962. removeHistoryListener = null;
  9963. currentRoute.value = START_LOCATION_NORMALIZED;
  9964. started = false;
  9965. ready = false;
  9966. }
  9967. unmountApp();
  9968. };
  9969. }
  9970. };
  9971. function runGuardQueue(guards) {
  9972. return guards.reduce((promise, guard) => promise.then(() => runWithContext(guard)), Promise.resolve());
  9973. }
  9974. return router;
  9975. }
  9976. function useRouter() {
  9977. return inject(routerKey);
  9978. }
  9979. function useRoute(_name) {
  9980. return inject(routeLocationKey);
  9981. }
  9982. export {
  9983. Comment as $,
  9984. camelize as A,
  9985. createElementBlock as B,
  9986. createVNode as C,
  9987. withCtx as D,
  9988. createBaseVNode as E,
  9989. normalizeClass as F,
  9990. normalizeStyle as G,
  9991. mergeProps as H,
  9992. useSlots as I,
  9993. withDirectives as J,
  9994. resolveDynamicComponent as K,
  9995. createCommentVNode as L,
  9996. createTextVNode as M,
  9997. NOOP as N,
  9998. toDisplayString as O,
  9999. Fragment as P,
  10000. vShow as Q,
  10001. Transition as R,
  10002. toRef as S,
  10003. Teleport as T,
  10004. onUnmounted as U,
  10005. useAttrs as V,
  10006. withModifiers as W,
  10007. onBeforeUnmount as X,
  10008. onActivated as Y,
  10009. onUpdated as Z,
  10010. cloneVNode as _,
  10011. isArray$1 as a,
  10012. Text as a0,
  10013. onBeforeMount as a1,
  10014. onDeactivated as a2,
  10015. renderList as a3,
  10016. createSlots as a4,
  10017. isDate as a5,
  10018. normalizeProps as a6,
  10019. guardReactiveProps as a7,
  10020. isVNode as a8,
  10021. triggerRef as a9,
  10022. useRouter as aA,
  10023. useRoute as aB,
  10024. h as aa,
  10025. toRaw as ab,
  10026. vModelCheckbox as ac,
  10027. toRefs as ad,
  10028. vModelRadio as ae,
  10029. onBeforeUpdate as af,
  10030. withKeys as ag,
  10031. vModelText as ah,
  10032. isPromise as ai,
  10033. toHandlers as aj,
  10034. resolveComponent as ak,
  10035. TransitionGroup as al,
  10036. markRaw as am,
  10037. effectScope as an,
  10038. capitalize as ao,
  10039. isPlainObject$1 as ap,
  10040. resolveDirective as aq,
  10041. toHandlerKey as ar,
  10042. render as as,
  10043. createApp as at,
  10044. hyphenate as au,
  10045. shallowReactive as av,
  10046. defineStore as aw,
  10047. createRouter as ax,
  10048. createWebHistory as ay,
  10049. createPinia as az,
  10050. isObject as b,
  10051. computed as c,
  10052. isString as d,
  10053. readonly as e,
  10054. getCurrentScope as f,
  10055. getCurrentInstance as g,
  10056. watchEffect as h,
  10057. inject as i,
  10058. isRef as j,
  10059. reactive as k,
  10060. onMounted as l,
  10061. hasOwn as m,
  10062. nextTick as n,
  10063. onScopeDispose as o,
  10064. warn as p,
  10065. isFunction as q,
  10066. ref as r,
  10067. shallowRef as s,
  10068. provide as t,
  10069. unref as u,
  10070. defineComponent as v,
  10071. watch as w,
  10072. renderSlot as x,
  10073. openBlock as y,
  10074. createBlock as z
  10075. };
  10076. //# sourceMappingURL=vue-dev.7a51ac2d.js.map