runtime-core.cjs.js 238 KB

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