runtime-core.cjs.prod.js 199 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875
  1. /**
  2. * @vue/runtime-core v3.5.35
  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. function pushWarningContext(vnode) {
  11. }
  12. function popWarningContext() {
  13. }
  14. function assertNumber(val, type) {
  15. return;
  16. }
  17. const ErrorCodes = {
  18. "SETUP_FUNCTION": 0,
  19. "0": "SETUP_FUNCTION",
  20. "RENDER_FUNCTION": 1,
  21. "1": "RENDER_FUNCTION",
  22. "NATIVE_EVENT_HANDLER": 5,
  23. "5": "NATIVE_EVENT_HANDLER",
  24. "COMPONENT_EVENT_HANDLER": 6,
  25. "6": "COMPONENT_EVENT_HANDLER",
  26. "VNODE_HOOK": 7,
  27. "7": "VNODE_HOOK",
  28. "DIRECTIVE_HOOK": 8,
  29. "8": "DIRECTIVE_HOOK",
  30. "TRANSITION_HOOK": 9,
  31. "9": "TRANSITION_HOOK",
  32. "APP_ERROR_HANDLER": 10,
  33. "10": "APP_ERROR_HANDLER",
  34. "APP_WARN_HANDLER": 11,
  35. "11": "APP_WARN_HANDLER",
  36. "FUNCTION_REF": 12,
  37. "12": "FUNCTION_REF",
  38. "ASYNC_COMPONENT_LOADER": 13,
  39. "13": "ASYNC_COMPONENT_LOADER",
  40. "SCHEDULER": 14,
  41. "14": "SCHEDULER",
  42. "COMPONENT_UPDATE": 15,
  43. "15": "COMPONENT_UPDATE",
  44. "APP_UNMOUNT_CLEANUP": 16,
  45. "16": "APP_UNMOUNT_CLEANUP"
  46. };
  47. const ErrorTypeStrings$1 = {
  48. ["sp"]: "serverPrefetch hook",
  49. ["bc"]: "beforeCreate hook",
  50. ["c"]: "created hook",
  51. ["bm"]: "beforeMount hook",
  52. ["m"]: "mounted hook",
  53. ["bu"]: "beforeUpdate hook",
  54. ["u"]: "updated",
  55. ["bum"]: "beforeUnmount hook",
  56. ["um"]: "unmounted hook",
  57. ["a"]: "activated hook",
  58. ["da"]: "deactivated hook",
  59. ["ec"]: "errorCaptured hook",
  60. ["rtc"]: "renderTracked hook",
  61. ["rtg"]: "renderTriggered hook",
  62. [0]: "setup function",
  63. [1]: "render function",
  64. [2]: "watcher getter",
  65. [3]: "watcher callback",
  66. [4]: "watcher cleanup function",
  67. [5]: "native event handler",
  68. [6]: "component event handler",
  69. [7]: "vnode hook",
  70. [8]: "directive hook",
  71. [9]: "transition hook",
  72. [10]: "app errorHandler",
  73. [11]: "app warnHandler",
  74. [12]: "ref function",
  75. [13]: "async component loader",
  76. [14]: "scheduler flush",
  77. [15]: "component update",
  78. [16]: "app unmount cleanup function"
  79. };
  80. function callWithErrorHandling(fn, instance, type, args) {
  81. try {
  82. return args ? fn(...args) : fn();
  83. } catch (err) {
  84. handleError(err, instance, type);
  85. }
  86. }
  87. function callWithAsyncErrorHandling(fn, instance, type, args) {
  88. if (shared.isFunction(fn)) {
  89. const res = callWithErrorHandling(fn, instance, type, args);
  90. if (res && shared.isPromise(res)) {
  91. res.catch((err) => {
  92. handleError(err, instance, type);
  93. });
  94. }
  95. return res;
  96. }
  97. if (shared.isArray(fn)) {
  98. const values = [];
  99. for (let i = 0; i < fn.length; i++) {
  100. values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
  101. }
  102. return values;
  103. }
  104. }
  105. function handleError(err, instance, type, throwInDev = true) {
  106. const contextVNode = instance ? instance.vnode : null;
  107. const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || shared.EMPTY_OBJ;
  108. if (instance) {
  109. let cur = instance.parent;
  110. const exposedInstance = instance.proxy;
  111. const errorInfo = `https://vuejs.org/error-reference/#runtime-${type}`;
  112. while (cur) {
  113. const errorCapturedHooks = cur.ec;
  114. if (errorCapturedHooks) {
  115. for (let i = 0; i < errorCapturedHooks.length; i++) {
  116. if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
  117. return;
  118. }
  119. }
  120. }
  121. cur = cur.parent;
  122. }
  123. if (errorHandler) {
  124. reactivity.pauseTracking();
  125. callWithErrorHandling(errorHandler, null, 10, [
  126. err,
  127. exposedInstance,
  128. errorInfo
  129. ]);
  130. reactivity.resetTracking();
  131. return;
  132. }
  133. }
  134. logError(err, type, contextVNode, throwInDev, throwUnhandledErrorInProduction);
  135. }
  136. function logError(err, type, contextVNode, throwInDev = true, throwInProd = false) {
  137. if (throwInProd) {
  138. throw err;
  139. } else {
  140. console.error(err);
  141. }
  142. }
  143. const queue = [];
  144. let flushIndex = -1;
  145. const pendingPostFlushCbs = [];
  146. let activePostFlushCbs = null;
  147. let postFlushIndex = 0;
  148. const resolvedPromise = /* @__PURE__ */ Promise.resolve();
  149. let currentFlushPromise = null;
  150. function nextTick(fn) {
  151. const p = currentFlushPromise || resolvedPromise;
  152. return fn ? p.then(this ? fn.bind(this) : fn) : p;
  153. }
  154. function findInsertionIndex(id) {
  155. let start = flushIndex + 1;
  156. let end = queue.length;
  157. while (start < end) {
  158. const middle = start + end >>> 1;
  159. const middleJob = queue[middle];
  160. const middleJobId = getId(middleJob);
  161. if (middleJobId < id || middleJobId === id && middleJob.flags & 2) {
  162. start = middle + 1;
  163. } else {
  164. end = middle;
  165. }
  166. }
  167. return start;
  168. }
  169. function queueJob(job) {
  170. if (!(job.flags & 1)) {
  171. const jobId = getId(job);
  172. const lastJob = queue[queue.length - 1];
  173. if (!lastJob || // fast path when the job id is larger than the tail
  174. !(job.flags & 2) && jobId >= getId(lastJob)) {
  175. queue.push(job);
  176. } else {
  177. queue.splice(findInsertionIndex(jobId), 0, job);
  178. }
  179. job.flags |= 1;
  180. queueFlush();
  181. }
  182. }
  183. function queueFlush() {
  184. if (!currentFlushPromise) {
  185. currentFlushPromise = resolvedPromise.then(flushJobs);
  186. }
  187. }
  188. function queuePostFlushCb(cb) {
  189. if (!shared.isArray(cb)) {
  190. if (activePostFlushCbs && cb.id === -1) {
  191. activePostFlushCbs.splice(postFlushIndex + 1, 0, cb);
  192. } else if (!(cb.flags & 1)) {
  193. pendingPostFlushCbs.push(cb);
  194. cb.flags |= 1;
  195. }
  196. } else {
  197. pendingPostFlushCbs.push(...cb);
  198. }
  199. queueFlush();
  200. }
  201. function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
  202. for (; i < queue.length; i++) {
  203. const cb = queue[i];
  204. if (cb && cb.flags & 2) {
  205. if (instance && cb.id !== instance.uid) {
  206. continue;
  207. }
  208. queue.splice(i, 1);
  209. i--;
  210. if (cb.flags & 4) {
  211. cb.flags &= -2;
  212. }
  213. cb();
  214. if (!(cb.flags & 4)) {
  215. cb.flags &= -2;
  216. }
  217. }
  218. }
  219. }
  220. function flushPostFlushCbs(seen) {
  221. if (pendingPostFlushCbs.length) {
  222. const deduped = [...new Set(pendingPostFlushCbs)].sort(
  223. (a, b) => getId(a) - getId(b)
  224. );
  225. pendingPostFlushCbs.length = 0;
  226. if (activePostFlushCbs) {
  227. activePostFlushCbs.push(...deduped);
  228. return;
  229. }
  230. activePostFlushCbs = deduped;
  231. for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
  232. const cb = activePostFlushCbs[postFlushIndex];
  233. if (cb.flags & 4) {
  234. cb.flags &= -2;
  235. }
  236. if (!(cb.flags & 8)) cb();
  237. cb.flags &= -2;
  238. }
  239. activePostFlushCbs = null;
  240. postFlushIndex = 0;
  241. }
  242. }
  243. const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;
  244. function flushJobs(seen) {
  245. try {
  246. for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
  247. const job = queue[flushIndex];
  248. if (job && !(job.flags & 8)) {
  249. if (false) ;
  250. if (job.flags & 4) {
  251. job.flags &= ~1;
  252. }
  253. callWithErrorHandling(
  254. job,
  255. job.i,
  256. job.i ? 15 : 14
  257. );
  258. if (!(job.flags & 4)) {
  259. job.flags &= ~1;
  260. }
  261. }
  262. }
  263. } finally {
  264. for (; flushIndex < queue.length; flushIndex++) {
  265. const job = queue[flushIndex];
  266. if (job) {
  267. job.flags &= -2;
  268. }
  269. }
  270. flushIndex = -1;
  271. queue.length = 0;
  272. flushPostFlushCbs();
  273. currentFlushPromise = null;
  274. if (queue.length || pendingPostFlushCbs.length) {
  275. flushJobs();
  276. }
  277. }
  278. }
  279. let currentRenderingInstance = null;
  280. let currentScopeId = null;
  281. function setCurrentRenderingInstance(instance) {
  282. const prev = currentRenderingInstance;
  283. currentRenderingInstance = instance;
  284. currentScopeId = instance && instance.type.__scopeId || null;
  285. return prev;
  286. }
  287. function pushScopeId(id) {
  288. currentScopeId = id;
  289. }
  290. function popScopeId() {
  291. currentScopeId = null;
  292. }
  293. const withScopeId = (_id) => withCtx;
  294. function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
  295. if (!ctx) return fn;
  296. if (fn._n) {
  297. return fn;
  298. }
  299. const renderFnWithContext = (...args) => {
  300. if (renderFnWithContext._d) {
  301. setBlockTracking(-1);
  302. }
  303. const prevInstance = setCurrentRenderingInstance(ctx);
  304. let res;
  305. try {
  306. res = fn(...args);
  307. } finally {
  308. setCurrentRenderingInstance(prevInstance);
  309. if (renderFnWithContext._d) {
  310. setBlockTracking(1);
  311. }
  312. }
  313. return res;
  314. };
  315. renderFnWithContext._n = true;
  316. renderFnWithContext._c = true;
  317. renderFnWithContext._d = true;
  318. return renderFnWithContext;
  319. }
  320. function withDirectives(vnode, directives) {
  321. if (currentRenderingInstance === null) {
  322. return vnode;
  323. }
  324. const instance = getComponentPublicInstance(currentRenderingInstance);
  325. const bindings = vnode.dirs || (vnode.dirs = []);
  326. for (let i = 0; i < directives.length; i++) {
  327. let [dir, value, arg, modifiers = shared.EMPTY_OBJ] = directives[i];
  328. if (dir) {
  329. if (shared.isFunction(dir)) {
  330. dir = {
  331. mounted: dir,
  332. updated: dir
  333. };
  334. }
  335. if (dir.deep) {
  336. reactivity.traverse(value);
  337. }
  338. bindings.push({
  339. dir,
  340. instance,
  341. value,
  342. oldValue: void 0,
  343. arg,
  344. modifiers
  345. });
  346. }
  347. }
  348. return vnode;
  349. }
  350. function invokeDirectiveHook(vnode, prevVNode, instance, name) {
  351. const bindings = vnode.dirs;
  352. const oldBindings = prevVNode && prevVNode.dirs;
  353. for (let i = 0; i < bindings.length; i++) {
  354. const binding = bindings[i];
  355. if (oldBindings) {
  356. binding.oldValue = oldBindings[i].value;
  357. }
  358. let hook = binding.dir[name];
  359. if (hook) {
  360. reactivity.pauseTracking();
  361. callWithAsyncErrorHandling(hook, instance, 8, [
  362. vnode.el,
  363. binding,
  364. vnode,
  365. prevVNode
  366. ]);
  367. reactivity.resetTracking();
  368. }
  369. }
  370. }
  371. function provide(key, value) {
  372. if (currentInstance) {
  373. let provides = currentInstance.provides;
  374. const parentProvides = currentInstance.parent && currentInstance.parent.provides;
  375. if (parentProvides === provides) {
  376. provides = currentInstance.provides = Object.create(parentProvides);
  377. }
  378. provides[key] = value;
  379. }
  380. }
  381. function inject(key, defaultValue, treatDefaultAsFactory = false) {
  382. const instance = getCurrentInstance();
  383. if (instance || currentApp) {
  384. let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
  385. if (provides && key in provides) {
  386. return provides[key];
  387. } else if (arguments.length > 1) {
  388. return treatDefaultAsFactory && shared.isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
  389. } else ;
  390. }
  391. }
  392. function hasInjectionContext() {
  393. return !!(getCurrentInstance() || currentApp);
  394. }
  395. const ssrContextKey = /* @__PURE__ */ Symbol.for("v-scx");
  396. const useSSRContext = () => {
  397. {
  398. const ctx = inject(ssrContextKey);
  399. return ctx;
  400. }
  401. };
  402. function watchEffect(effect, options) {
  403. return doWatch(effect, null, options);
  404. }
  405. function watchPostEffect(effect, options) {
  406. return doWatch(
  407. effect,
  408. null,
  409. { flush: "post" }
  410. );
  411. }
  412. function watchSyncEffect(effect, options) {
  413. return doWatch(
  414. effect,
  415. null,
  416. { flush: "sync" }
  417. );
  418. }
  419. function watch(source, cb, options) {
  420. return doWatch(source, cb, options);
  421. }
  422. function doWatch(source, cb, options = shared.EMPTY_OBJ) {
  423. const { immediate, deep, flush, once } = options;
  424. const baseWatchOptions = shared.extend({}, options);
  425. const runsImmediately = cb && immediate || !cb && flush !== "post";
  426. let ssrCleanup;
  427. if (isInSSRComponentSetup) {
  428. if (flush === "sync") {
  429. const ctx = useSSRContext();
  430. ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
  431. } else if (!runsImmediately) {
  432. const watchStopHandle = () => {
  433. };
  434. watchStopHandle.stop = shared.NOOP;
  435. watchStopHandle.resume = shared.NOOP;
  436. watchStopHandle.pause = shared.NOOP;
  437. return watchStopHandle;
  438. }
  439. }
  440. const instance = currentInstance;
  441. baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
  442. let isPre = false;
  443. if (flush === "post") {
  444. baseWatchOptions.scheduler = (job) => {
  445. queuePostRenderEffect(job, instance && instance.suspense);
  446. };
  447. } else if (flush !== "sync") {
  448. isPre = true;
  449. baseWatchOptions.scheduler = (job, isFirstRun) => {
  450. if (isFirstRun) {
  451. job();
  452. } else {
  453. queueJob(job);
  454. }
  455. };
  456. }
  457. baseWatchOptions.augmentJob = (job) => {
  458. if (cb) {
  459. job.flags |= 4;
  460. }
  461. if (isPre) {
  462. job.flags |= 2;
  463. if (instance) {
  464. job.id = instance.uid;
  465. job.i = instance;
  466. }
  467. }
  468. };
  469. const watchHandle = reactivity.watch(source, cb, baseWatchOptions);
  470. if (isInSSRComponentSetup) {
  471. if (ssrCleanup) {
  472. ssrCleanup.push(watchHandle);
  473. } else if (runsImmediately) {
  474. watchHandle();
  475. }
  476. }
  477. return watchHandle;
  478. }
  479. function instanceWatch(source, value, options) {
  480. const publicThis = this.proxy;
  481. const getter = shared.isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
  482. let cb;
  483. if (shared.isFunction(value)) {
  484. cb = value;
  485. } else {
  486. cb = value.handler;
  487. options = value;
  488. }
  489. const reset = setCurrentInstance(this);
  490. const res = doWatch(getter, cb.bind(publicThis), options);
  491. reset();
  492. return res;
  493. }
  494. function createPathGetter(ctx, path) {
  495. const segments = path.split(".");
  496. return () => {
  497. let cur = ctx;
  498. for (let i = 0; i < segments.length && cur; i++) {
  499. cur = cur[segments[i]];
  500. }
  501. return cur;
  502. };
  503. }
  504. const pendingMounts = /* @__PURE__ */ new WeakMap();
  505. const TeleportEndKey = /* @__PURE__ */ Symbol("_vte");
  506. const isTeleport = (type) => type.__isTeleport;
  507. const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
  508. const isTeleportDeferred = (props) => props && (props.defer || props.defer === "");
  509. const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement;
  510. const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement;
  511. const resolveTarget = (props, select) => {
  512. const targetSelector = props && props.to;
  513. if (shared.isString(targetSelector)) {
  514. if (!select) {
  515. return null;
  516. } else {
  517. const target = select(targetSelector);
  518. return target;
  519. }
  520. } else {
  521. return targetSelector;
  522. }
  523. };
  524. const TeleportImpl = {
  525. name: "Teleport",
  526. __isTeleport: true,
  527. process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
  528. const {
  529. mc: mountChildren,
  530. pc: patchChildren,
  531. pbc: patchBlockChildren,
  532. o: { insert, querySelector, createText, createComment, parentNode }
  533. } = internals;
  534. const disabled = isTeleportDisabled(n2.props);
  535. let { dynamicChildren } = n2;
  536. const mount = (vnode, container2, anchor2) => {
  537. if (vnode.shapeFlag & 16) {
  538. mountChildren(
  539. vnode.children,
  540. container2,
  541. anchor2,
  542. parentComponent,
  543. parentSuspense,
  544. namespace,
  545. slotScopeIds,
  546. optimized
  547. );
  548. }
  549. };
  550. const mountToTarget = (vnode = n2) => {
  551. const disabled2 = isTeleportDisabled(vnode.props);
  552. const target = vnode.target = resolveTarget(vnode.props, querySelector);
  553. const targetAnchor = prepareAnchor(target, vnode, createText, insert);
  554. if (target) {
  555. if (namespace !== "svg" && isTargetSVG(target)) {
  556. namespace = "svg";
  557. } else if (namespace !== "mathml" && isTargetMathML(target)) {
  558. namespace = "mathml";
  559. }
  560. if (parentComponent && parentComponent.isCE) {
  561. (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target);
  562. }
  563. if (!disabled2) {
  564. mount(vnode, target, targetAnchor);
  565. updateCssVars(vnode, false);
  566. }
  567. }
  568. };
  569. const queuePendingMount = (vnode) => {
  570. const mountJob = () => {
  571. if (pendingMounts.get(vnode) !== mountJob) return;
  572. pendingMounts.delete(vnode);
  573. if (isTeleportDisabled(vnode.props)) {
  574. const mountContainer = parentNode(vnode.el) || container;
  575. mount(vnode, mountContainer, vnode.anchor);
  576. updateCssVars(vnode, true);
  577. }
  578. mountToTarget(vnode);
  579. };
  580. pendingMounts.set(vnode, mountJob);
  581. queuePostRenderEffect(mountJob, parentSuspense);
  582. };
  583. if (n1 == null) {
  584. const placeholder = n2.el = createText("");
  585. const mainAnchor = n2.anchor = createText("");
  586. insert(placeholder, container, anchor);
  587. insert(mainAnchor, container, anchor);
  588. if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
  589. queuePendingMount(n2);
  590. return;
  591. }
  592. if (disabled) {
  593. mount(n2, container, mainAnchor);
  594. updateCssVars(n2, true);
  595. }
  596. mountToTarget();
  597. } else {
  598. n2.el = n1.el;
  599. const mainAnchor = n2.anchor = n1.anchor;
  600. const pendingMount = pendingMounts.get(n1);
  601. if (pendingMount) {
  602. pendingMount.flags |= 8;
  603. pendingMounts.delete(n1);
  604. queuePendingMount(n2);
  605. return;
  606. }
  607. n2.targetStart = n1.targetStart;
  608. const target = n2.target = n1.target;
  609. const targetAnchor = n2.targetAnchor = n1.targetAnchor;
  610. const wasDisabled = isTeleportDisabled(n1.props);
  611. const currentContainer = wasDisabled ? container : target;
  612. const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
  613. if (namespace === "svg" || isTargetSVG(target)) {
  614. namespace = "svg";
  615. } else if (namespace === "mathml" || isTargetMathML(target)) {
  616. namespace = "mathml";
  617. }
  618. if (dynamicChildren) {
  619. patchBlockChildren(
  620. n1.dynamicChildren,
  621. dynamicChildren,
  622. currentContainer,
  623. parentComponent,
  624. parentSuspense,
  625. namespace,
  626. slotScopeIds
  627. );
  628. traverseStaticChildren(n1, n2, true);
  629. } else if (!optimized) {
  630. patchChildren(
  631. n1,
  632. n2,
  633. currentContainer,
  634. currentAnchor,
  635. parentComponent,
  636. parentSuspense,
  637. namespace,
  638. slotScopeIds,
  639. false
  640. );
  641. }
  642. if (disabled) {
  643. if (!wasDisabled) {
  644. moveTeleport(
  645. n2,
  646. container,
  647. mainAnchor,
  648. internals,
  649. 1
  650. );
  651. } else {
  652. if (n2.props && n1.props && n2.props.to !== n1.props.to) {
  653. n2.props.to = n1.props.to;
  654. }
  655. }
  656. } else {
  657. if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
  658. const nextTarget = n2.target = resolveTarget(
  659. n2.props,
  660. querySelector
  661. );
  662. if (nextTarget) {
  663. moveTeleport(
  664. n2,
  665. nextTarget,
  666. null,
  667. internals,
  668. 0
  669. );
  670. }
  671. } else if (wasDisabled) {
  672. moveTeleport(
  673. n2,
  674. target,
  675. targetAnchor,
  676. internals,
  677. 1
  678. );
  679. }
  680. }
  681. updateCssVars(n2, disabled);
  682. }
  683. },
  684. remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
  685. const {
  686. shapeFlag,
  687. children,
  688. anchor,
  689. targetStart,
  690. targetAnchor,
  691. target,
  692. props
  693. } = vnode;
  694. const shouldRemove = doRemove || !isTeleportDisabled(props);
  695. const pendingMount = pendingMounts.get(vnode);
  696. if (pendingMount) {
  697. pendingMount.flags |= 8;
  698. pendingMounts.delete(vnode);
  699. }
  700. if (target) {
  701. hostRemove(targetStart);
  702. hostRemove(targetAnchor);
  703. }
  704. doRemove && hostRemove(anchor);
  705. if (!pendingMount && shapeFlag & 16) {
  706. for (let i = 0; i < children.length; i++) {
  707. const child = children[i];
  708. unmount(
  709. child,
  710. parentComponent,
  711. parentSuspense,
  712. shouldRemove,
  713. !!child.dynamicChildren
  714. );
  715. }
  716. }
  717. },
  718. move: moveTeleport,
  719. hydrate: hydrateTeleport
  720. };
  721. function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) {
  722. if (moveType === 0) {
  723. insert(vnode.targetAnchor, container, parentAnchor);
  724. }
  725. const { el, anchor, shapeFlag, children, props } = vnode;
  726. const isReorder = moveType === 2;
  727. if (isReorder) {
  728. insert(el, container, parentAnchor);
  729. }
  730. if (!pendingMounts.has(vnode) && (!isReorder || isTeleportDisabled(props))) {
  731. if (shapeFlag & 16) {
  732. for (let i = 0; i < children.length; i++) {
  733. move(
  734. children[i],
  735. container,
  736. parentAnchor,
  737. 2
  738. );
  739. }
  740. }
  741. }
  742. if (isReorder) {
  743. insert(anchor, container, parentAnchor);
  744. }
  745. }
  746. function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
  747. o: { nextSibling, parentNode, querySelector, insert, createText }
  748. }, hydrateChildren) {
  749. function hydrateAnchor(target2, targetNode) {
  750. let targetAnchor = targetNode;
  751. while (targetAnchor) {
  752. if (targetAnchor && targetAnchor.nodeType === 8) {
  753. if (targetAnchor.data === "teleport start anchor") {
  754. vnode.targetStart = targetAnchor;
  755. } else if (targetAnchor.data === "teleport anchor") {
  756. vnode.targetAnchor = targetAnchor;
  757. target2._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
  758. break;
  759. }
  760. }
  761. targetAnchor = nextSibling(targetAnchor);
  762. }
  763. }
  764. function hydrateDisabledTeleport(node2, vnode2) {
  765. vnode2.anchor = hydrateChildren(
  766. nextSibling(node2),
  767. vnode2,
  768. parentNode(node2),
  769. parentComponent,
  770. parentSuspense,
  771. slotScopeIds,
  772. optimized
  773. );
  774. }
  775. const target = vnode.target = resolveTarget(
  776. vnode.props,
  777. querySelector
  778. );
  779. const disabled = isTeleportDisabled(vnode.props);
  780. if (target) {
  781. const targetNode = target._lpa || target.firstChild;
  782. if (vnode.shapeFlag & 16) {
  783. if (disabled) {
  784. hydrateDisabledTeleport(node, vnode);
  785. hydrateAnchor(target, targetNode);
  786. if (!vnode.targetAnchor) {
  787. prepareAnchor(
  788. target,
  789. vnode,
  790. createText,
  791. insert,
  792. // if target is the same as the main view, insert anchors before current node
  793. // to avoid hydrating mismatch
  794. parentNode(node) === target ? node : null
  795. );
  796. }
  797. } else {
  798. vnode.anchor = nextSibling(node);
  799. hydrateAnchor(target, targetNode);
  800. if (!vnode.targetAnchor) {
  801. prepareAnchor(target, vnode, createText, insert);
  802. }
  803. hydrateChildren(
  804. targetNode && nextSibling(targetNode),
  805. vnode,
  806. target,
  807. parentComponent,
  808. parentSuspense,
  809. slotScopeIds,
  810. optimized
  811. );
  812. }
  813. }
  814. updateCssVars(vnode, disabled);
  815. } else if (disabled) {
  816. if (vnode.shapeFlag & 16) {
  817. hydrateDisabledTeleport(node, vnode);
  818. vnode.targetStart = node;
  819. vnode.targetAnchor = nextSibling(node);
  820. }
  821. }
  822. return vnode.anchor && nextSibling(vnode.anchor);
  823. }
  824. const Teleport = TeleportImpl;
  825. function updateCssVars(vnode, isDisabled) {
  826. const ctx = vnode.ctx;
  827. if (ctx && ctx.ut) {
  828. let node, anchor;
  829. if (isDisabled) {
  830. node = vnode.el;
  831. anchor = vnode.anchor;
  832. } else {
  833. node = vnode.targetStart;
  834. anchor = vnode.targetAnchor;
  835. }
  836. while (node && node !== anchor) {
  837. if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx.uid);
  838. node = node.nextSibling;
  839. }
  840. ctx.ut();
  841. }
  842. }
  843. function prepareAnchor(target, vnode, createText, insert, anchor = null) {
  844. const targetStart = vnode.targetStart = createText("");
  845. const targetAnchor = vnode.targetAnchor = createText("");
  846. targetStart[TeleportEndKey] = targetAnchor;
  847. if (target) {
  848. insert(targetStart, target, anchor);
  849. insert(targetAnchor, target, anchor);
  850. }
  851. return targetAnchor;
  852. }
  853. const leaveCbKey = /* @__PURE__ */ Symbol("_leaveCb");
  854. const enterCbKey = /* @__PURE__ */ Symbol("_enterCb");
  855. function useTransitionState() {
  856. const state = {
  857. isMounted: false,
  858. isLeaving: false,
  859. isUnmounting: false,
  860. leavingVNodes: /* @__PURE__ */ new Map()
  861. };
  862. onMounted(() => {
  863. state.isMounted = true;
  864. });
  865. onBeforeUnmount(() => {
  866. state.isUnmounting = true;
  867. });
  868. return state;
  869. }
  870. const TransitionHookValidator = [Function, Array];
  871. const BaseTransitionPropsValidators = {
  872. mode: String,
  873. appear: Boolean,
  874. persisted: Boolean,
  875. // enter
  876. onBeforeEnter: TransitionHookValidator,
  877. onEnter: TransitionHookValidator,
  878. onAfterEnter: TransitionHookValidator,
  879. onEnterCancelled: TransitionHookValidator,
  880. // leave
  881. onBeforeLeave: TransitionHookValidator,
  882. onLeave: TransitionHookValidator,
  883. onAfterLeave: TransitionHookValidator,
  884. onLeaveCancelled: TransitionHookValidator,
  885. // appear
  886. onBeforeAppear: TransitionHookValidator,
  887. onAppear: TransitionHookValidator,
  888. onAfterAppear: TransitionHookValidator,
  889. onAppearCancelled: TransitionHookValidator
  890. };
  891. const recursiveGetSubtree = (instance) => {
  892. const subTree = instance.subTree;
  893. return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
  894. };
  895. const BaseTransitionImpl = {
  896. name: `BaseTransition`,
  897. props: BaseTransitionPropsValidators,
  898. setup(props, { slots }) {
  899. const instance = getCurrentInstance();
  900. const state = useTransitionState();
  901. return () => {
  902. const children = slots.default && getTransitionRawChildren(slots.default(), true);
  903. const child = children && children.length ? findNonCommentChild(children) : (
  904. // Keep explicit default-slot conditionals on the same transition path
  905. // as regular v-if branches, which render a comment placeholder.
  906. instance.subTree ? createCommentVNode() : void 0
  907. );
  908. if (!child) {
  909. return;
  910. }
  911. const rawProps = reactivity.toRaw(props);
  912. const { mode } = rawProps;
  913. if (state.isLeaving) {
  914. return emptyPlaceholder(child);
  915. }
  916. const innerChild = getInnerChild$1(child);
  917. if (!innerChild) {
  918. return emptyPlaceholder(child);
  919. }
  920. let enterHooks = resolveTransitionHooks(
  921. innerChild,
  922. rawProps,
  923. state,
  924. instance,
  925. // #11061, ensure enterHooks is fresh after clone
  926. (hooks) => enterHooks = hooks
  927. );
  928. if (innerChild.type !== Comment) {
  929. setTransitionHooks(innerChild, enterHooks);
  930. }
  931. let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
  932. if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) {
  933. let leavingHooks = resolveTransitionHooks(
  934. oldInnerChild,
  935. rawProps,
  936. state,
  937. instance
  938. );
  939. setTransitionHooks(oldInnerChild, leavingHooks);
  940. if (mode === "out-in" && innerChild.type !== Comment) {
  941. state.isLeaving = true;
  942. leavingHooks.afterLeave = () => {
  943. state.isLeaving = false;
  944. if (!(instance.job.flags & 8)) {
  945. instance.update();
  946. }
  947. delete leavingHooks.afterLeave;
  948. oldInnerChild = void 0;
  949. };
  950. return emptyPlaceholder(child);
  951. } else if (mode === "in-out" && innerChild.type !== Comment) {
  952. leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
  953. const leavingVNodesCache = getLeavingNodesForType(
  954. state,
  955. oldInnerChild
  956. );
  957. leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
  958. el[leaveCbKey] = () => {
  959. earlyRemove();
  960. el[leaveCbKey] = void 0;
  961. delete enterHooks.delayedLeave;
  962. oldInnerChild = void 0;
  963. };
  964. enterHooks.delayedLeave = () => {
  965. delayedLeave();
  966. delete enterHooks.delayedLeave;
  967. oldInnerChild = void 0;
  968. };
  969. };
  970. } else {
  971. oldInnerChild = void 0;
  972. }
  973. } else if (oldInnerChild) {
  974. oldInnerChild = void 0;
  975. }
  976. return child;
  977. };
  978. }
  979. };
  980. function findNonCommentChild(children) {
  981. let child = children[0];
  982. if (children.length > 1) {
  983. for (const c of children) {
  984. if (c.type !== Comment) {
  985. child = c;
  986. break;
  987. }
  988. }
  989. }
  990. return child;
  991. }
  992. const BaseTransition = BaseTransitionImpl;
  993. function getLeavingNodesForType(state, vnode) {
  994. const { leavingVNodes } = state;
  995. let leavingVNodesCache = leavingVNodes.get(vnode.type);
  996. if (!leavingVNodesCache) {
  997. leavingVNodesCache = /* @__PURE__ */ Object.create(null);
  998. leavingVNodes.set(vnode.type, leavingVNodesCache);
  999. }
  1000. return leavingVNodesCache;
  1001. }
  1002. function resolveTransitionHooks(vnode, props, state, instance, postClone) {
  1003. const {
  1004. appear,
  1005. mode,
  1006. persisted = false,
  1007. onBeforeEnter,
  1008. onEnter,
  1009. onAfterEnter,
  1010. onEnterCancelled,
  1011. onBeforeLeave,
  1012. onLeave,
  1013. onAfterLeave,
  1014. onLeaveCancelled,
  1015. onBeforeAppear,
  1016. onAppear,
  1017. onAfterAppear,
  1018. onAppearCancelled
  1019. } = props;
  1020. const key = String(vnode.key);
  1021. const leavingVNodesCache = getLeavingNodesForType(state, vnode);
  1022. const callHook = (hook, args) => {
  1023. hook && callWithAsyncErrorHandling(
  1024. hook,
  1025. instance,
  1026. 9,
  1027. args
  1028. );
  1029. };
  1030. const callAsyncHook = (hook, args) => {
  1031. const done = args[1];
  1032. callHook(hook, args);
  1033. if (shared.isArray(hook)) {
  1034. if (hook.every((hook2) => hook2.length <= 1)) done();
  1035. } else if (hook.length <= 1) {
  1036. done();
  1037. }
  1038. };
  1039. const hooks = {
  1040. mode,
  1041. persisted,
  1042. beforeEnter(el) {
  1043. let hook = onBeforeEnter;
  1044. if (!state.isMounted) {
  1045. if (appear) {
  1046. hook = onBeforeAppear || onBeforeEnter;
  1047. } else {
  1048. return;
  1049. }
  1050. }
  1051. if (el[leaveCbKey]) {
  1052. el[leaveCbKey](
  1053. true
  1054. /* cancelled */
  1055. );
  1056. }
  1057. const leavingVNode = leavingVNodesCache[key];
  1058. if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
  1059. leavingVNode.el[leaveCbKey]();
  1060. }
  1061. callHook(hook, [el]);
  1062. },
  1063. enter(el) {
  1064. if (leavingVNodesCache[key] === vnode) return;
  1065. let hook = onEnter;
  1066. let afterHook = onAfterEnter;
  1067. let cancelHook = onEnterCancelled;
  1068. if (!state.isMounted) {
  1069. if (appear) {
  1070. hook = onAppear || onEnter;
  1071. afterHook = onAfterAppear || onAfterEnter;
  1072. cancelHook = onAppearCancelled || onEnterCancelled;
  1073. } else {
  1074. return;
  1075. }
  1076. }
  1077. let called = false;
  1078. el[enterCbKey] = (cancelled) => {
  1079. if (called) return;
  1080. called = true;
  1081. if (cancelled) {
  1082. callHook(cancelHook, [el]);
  1083. } else {
  1084. callHook(afterHook, [el]);
  1085. }
  1086. if (hooks.delayedLeave) {
  1087. hooks.delayedLeave();
  1088. }
  1089. el[enterCbKey] = void 0;
  1090. };
  1091. const done = el[enterCbKey].bind(null, false);
  1092. if (hook) {
  1093. callAsyncHook(hook, [el, done]);
  1094. } else {
  1095. done();
  1096. }
  1097. },
  1098. leave(el, remove) {
  1099. const key2 = String(vnode.key);
  1100. if (el[enterCbKey]) {
  1101. el[enterCbKey](
  1102. true
  1103. /* cancelled */
  1104. );
  1105. }
  1106. if (state.isUnmounting) {
  1107. return remove();
  1108. }
  1109. callHook(onBeforeLeave, [el]);
  1110. let called = false;
  1111. el[leaveCbKey] = (cancelled) => {
  1112. if (called) return;
  1113. called = true;
  1114. remove();
  1115. if (cancelled) {
  1116. callHook(onLeaveCancelled, [el]);
  1117. } else {
  1118. callHook(onAfterLeave, [el]);
  1119. }
  1120. el[leaveCbKey] = void 0;
  1121. if (leavingVNodesCache[key2] === vnode) {
  1122. delete leavingVNodesCache[key2];
  1123. }
  1124. };
  1125. const done = el[leaveCbKey].bind(null, false);
  1126. leavingVNodesCache[key2] = vnode;
  1127. if (onLeave) {
  1128. callAsyncHook(onLeave, [el, done]);
  1129. } else {
  1130. done();
  1131. }
  1132. },
  1133. clone(vnode2) {
  1134. const hooks2 = resolveTransitionHooks(
  1135. vnode2,
  1136. props,
  1137. state,
  1138. instance,
  1139. postClone
  1140. );
  1141. if (postClone) postClone(hooks2);
  1142. return hooks2;
  1143. }
  1144. };
  1145. return hooks;
  1146. }
  1147. function emptyPlaceholder(vnode) {
  1148. if (isKeepAlive(vnode)) {
  1149. vnode = cloneVNode(vnode);
  1150. vnode.children = null;
  1151. return vnode;
  1152. }
  1153. }
  1154. function getInnerChild$1(vnode) {
  1155. if (!isKeepAlive(vnode)) {
  1156. if (isTeleport(vnode.type) && vnode.children) {
  1157. return findNonCommentChild(vnode.children);
  1158. }
  1159. return vnode;
  1160. }
  1161. if (vnode.component) {
  1162. return vnode.component.subTree;
  1163. }
  1164. const { shapeFlag, children } = vnode;
  1165. if (children) {
  1166. if (shapeFlag & 16) {
  1167. return children[0];
  1168. }
  1169. if (shapeFlag & 32 && shared.isFunction(children.default)) {
  1170. return children.default();
  1171. }
  1172. }
  1173. }
  1174. function setTransitionHooks(vnode, hooks) {
  1175. if (vnode.shapeFlag & 6 && vnode.component) {
  1176. vnode.transition = hooks;
  1177. setTransitionHooks(vnode.component.subTree, hooks);
  1178. } else if (vnode.shapeFlag & 128) {
  1179. vnode.ssContent.transition = hooks.clone(vnode.ssContent);
  1180. vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
  1181. } else {
  1182. vnode.transition = hooks;
  1183. }
  1184. }
  1185. function getTransitionRawChildren(children, keepComment = false, parentKey) {
  1186. let ret = [];
  1187. let keyedFragmentCount = 0;
  1188. for (let i = 0; i < children.length; i++) {
  1189. let child = children[i];
  1190. const key = parentKey == null ? child.key : String(parentKey) + String(child.key != null ? child.key : i);
  1191. if (child.type === Fragment) {
  1192. if (child.patchFlag & 128) keyedFragmentCount++;
  1193. ret = ret.concat(
  1194. getTransitionRawChildren(child.children, keepComment, key)
  1195. );
  1196. } else if (keepComment || child.type !== Comment) {
  1197. ret.push(key != null ? cloneVNode(child, { key }) : child);
  1198. }
  1199. }
  1200. if (keyedFragmentCount > 1) {
  1201. for (let i = 0; i < ret.length; i++) {
  1202. ret[i].patchFlag = -2;
  1203. }
  1204. }
  1205. return ret;
  1206. }
  1207. // @__NO_SIDE_EFFECTS__
  1208. function defineComponent(options, extraOptions) {
  1209. return shared.isFunction(options) ? (
  1210. // #8236: extend call and options.name access are considered side-effects
  1211. // by Rollup, so we have to wrap it in a pure-annotated IIFE.
  1212. /* @__PURE__ */ (() => shared.extend({ name: options.name }, extraOptions, { setup: options }))()
  1213. ) : options;
  1214. }
  1215. function useId() {
  1216. const i = getCurrentInstance();
  1217. if (i) {
  1218. return (i.appContext.config.idPrefix || "v") + "-" + i.ids[0] + i.ids[1]++;
  1219. }
  1220. return "";
  1221. }
  1222. function markAsyncBoundary(instance) {
  1223. instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0];
  1224. }
  1225. function useTemplateRef(key) {
  1226. const i = getCurrentInstance();
  1227. const r = reactivity.shallowRef(null);
  1228. if (i) {
  1229. const refs = i.refs === shared.EMPTY_OBJ ? i.refs = {} : i.refs;
  1230. {
  1231. Object.defineProperty(refs, key, {
  1232. enumerable: true,
  1233. get: () => r.value,
  1234. set: (val) => r.value = val
  1235. });
  1236. }
  1237. }
  1238. const ret = r;
  1239. return ret;
  1240. }
  1241. function isTemplateRefKey(refs, key) {
  1242. let desc;
  1243. return !!((desc = Object.getOwnPropertyDescriptor(refs, key)) && !desc.configurable);
  1244. }
  1245. const pendingSetRefMap = /* @__PURE__ */ new WeakMap();
  1246. function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
  1247. if (shared.isArray(rawRef)) {
  1248. rawRef.forEach(
  1249. (r, i) => setRef(
  1250. r,
  1251. oldRawRef && (shared.isArray(oldRawRef) ? oldRawRef[i] : oldRawRef),
  1252. parentSuspense,
  1253. vnode,
  1254. isUnmount
  1255. )
  1256. );
  1257. return;
  1258. }
  1259. if (isAsyncWrapper(vnode) && !isUnmount) {
  1260. if (vnode.shapeFlag & 512 && vnode.type.__asyncResolved && vnode.component.subTree.component) {
  1261. setRef(rawRef, oldRawRef, parentSuspense, vnode.component.subTree);
  1262. }
  1263. return;
  1264. }
  1265. const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el;
  1266. const value = isUnmount ? null : refValue;
  1267. const { i: owner, r: ref } = rawRef;
  1268. const oldRef = oldRawRef && oldRawRef.r;
  1269. const refs = owner.refs === shared.EMPTY_OBJ ? owner.refs = {} : owner.refs;
  1270. const setupState = owner.setupState;
  1271. const rawSetupState = reactivity.toRaw(setupState);
  1272. const canSetSetupRef = setupState === shared.EMPTY_OBJ ? shared.NO : (key) => {
  1273. if (isTemplateRefKey(refs, key)) {
  1274. return false;
  1275. }
  1276. return shared.hasOwn(rawSetupState, key);
  1277. };
  1278. const canSetRef = (ref2, key) => {
  1279. if (key && isTemplateRefKey(refs, key)) {
  1280. return false;
  1281. }
  1282. return true;
  1283. };
  1284. if (oldRef != null && oldRef !== ref) {
  1285. invalidatePendingSetRef(oldRawRef);
  1286. if (shared.isString(oldRef)) {
  1287. refs[oldRef] = null;
  1288. if (canSetSetupRef(oldRef)) {
  1289. setupState[oldRef] = null;
  1290. }
  1291. } else if (reactivity.isRef(oldRef)) {
  1292. const oldRawRefAtom = oldRawRef;
  1293. if (canSetRef(oldRef, oldRawRefAtom.k)) {
  1294. oldRef.value = null;
  1295. }
  1296. if (oldRawRefAtom.k) refs[oldRawRefAtom.k] = null;
  1297. }
  1298. }
  1299. if (shared.isFunction(ref)) {
  1300. callWithErrorHandling(ref, owner, 12, [value, refs]);
  1301. } else {
  1302. const _isString = shared.isString(ref);
  1303. const _isRef = reactivity.isRef(ref);
  1304. if (_isString || _isRef) {
  1305. const doSet = () => {
  1306. if (rawRef.f) {
  1307. const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : canSetRef() || !rawRef.k ? ref.value : refs[rawRef.k];
  1308. if (isUnmount) {
  1309. shared.isArray(existing) && shared.remove(existing, refValue);
  1310. } else {
  1311. if (!shared.isArray(existing)) {
  1312. if (_isString) {
  1313. refs[ref] = [refValue];
  1314. if (canSetSetupRef(ref)) {
  1315. setupState[ref] = refs[ref];
  1316. }
  1317. } else {
  1318. const newVal = [refValue];
  1319. if (canSetRef(ref, rawRef.k)) {
  1320. ref.value = newVal;
  1321. }
  1322. if (rawRef.k) refs[rawRef.k] = newVal;
  1323. }
  1324. } else if (!existing.includes(refValue)) {
  1325. existing.push(refValue);
  1326. }
  1327. }
  1328. } else if (_isString) {
  1329. refs[ref] = value;
  1330. if (canSetSetupRef(ref)) {
  1331. setupState[ref] = value;
  1332. }
  1333. } else if (_isRef) {
  1334. if (canSetRef(ref, rawRef.k)) {
  1335. ref.value = value;
  1336. }
  1337. if (rawRef.k) refs[rawRef.k] = value;
  1338. } else ;
  1339. };
  1340. if (value) {
  1341. const job = () => {
  1342. doSet();
  1343. pendingSetRefMap.delete(rawRef);
  1344. };
  1345. job.id = -1;
  1346. pendingSetRefMap.set(rawRef, job);
  1347. queuePostRenderEffect(job, parentSuspense);
  1348. } else {
  1349. invalidatePendingSetRef(rawRef);
  1350. doSet();
  1351. }
  1352. }
  1353. }
  1354. }
  1355. function invalidatePendingSetRef(rawRef) {
  1356. const pendingSetRef = pendingSetRefMap.get(rawRef);
  1357. if (pendingSetRef) {
  1358. pendingSetRef.flags |= 8;
  1359. pendingSetRefMap.delete(rawRef);
  1360. }
  1361. }
  1362. let hasLoggedMismatchError = false;
  1363. const logMismatchError = () => {
  1364. if (hasLoggedMismatchError) {
  1365. return;
  1366. }
  1367. console.error("Hydration completed but contains mismatches.");
  1368. hasLoggedMismatchError = true;
  1369. };
  1370. const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
  1371. const isMathMLContainer = (container) => container.namespaceURI.includes("MathML");
  1372. const getContainerType = (container) => {
  1373. if (container.nodeType !== 1) return void 0;
  1374. if (isSVGContainer(container)) return "svg";
  1375. if (isMathMLContainer(container)) return "mathml";
  1376. return void 0;
  1377. };
  1378. const isComment = (node) => node.nodeType === 8;
  1379. function createHydrationFunctions(rendererInternals) {
  1380. const {
  1381. mt: mountComponent,
  1382. p: patch,
  1383. o: {
  1384. patchProp,
  1385. createText,
  1386. nextSibling,
  1387. parentNode,
  1388. remove,
  1389. insert,
  1390. createComment
  1391. }
  1392. } = rendererInternals;
  1393. const hydrate = (vnode, container) => {
  1394. if (!container.hasChildNodes()) {
  1395. patch(null, vnode, container);
  1396. flushPostFlushCbs();
  1397. container._vnode = vnode;
  1398. return;
  1399. }
  1400. hydrateNode(container.firstChild, vnode, null, null, null);
  1401. flushPostFlushCbs();
  1402. container._vnode = vnode;
  1403. };
  1404. const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
  1405. optimized = optimized || !!vnode.dynamicChildren;
  1406. const isFragmentStart = isComment(node) && node.data === "[";
  1407. const onMismatch = () => handleMismatch(
  1408. node,
  1409. vnode,
  1410. parentComponent,
  1411. parentSuspense,
  1412. slotScopeIds,
  1413. isFragmentStart
  1414. );
  1415. const { type, ref, shapeFlag, patchFlag } = vnode;
  1416. let domType = node.nodeType;
  1417. vnode.el = node;
  1418. if (patchFlag === -2) {
  1419. optimized = false;
  1420. vnode.dynamicChildren = null;
  1421. }
  1422. let nextNode = null;
  1423. switch (type) {
  1424. case Text:
  1425. if (domType !== 3) {
  1426. if (vnode.children === "") {
  1427. insert(vnode.el = createText(""), parentNode(node), node);
  1428. nextNode = node;
  1429. } else {
  1430. nextNode = onMismatch();
  1431. }
  1432. } else {
  1433. if (node.data !== vnode.children) {
  1434. logMismatchError();
  1435. node.data = vnode.children;
  1436. }
  1437. nextNode = nextSibling(node);
  1438. }
  1439. break;
  1440. case Comment:
  1441. if (isTemplateNode(node)) {
  1442. nextNode = nextSibling(node);
  1443. replaceNode(
  1444. vnode.el = node.content.firstChild,
  1445. node,
  1446. parentComponent
  1447. );
  1448. } else if (domType !== 8 || isFragmentStart) {
  1449. nextNode = onMismatch();
  1450. } else {
  1451. nextNode = nextSibling(node);
  1452. }
  1453. break;
  1454. case Static:
  1455. if (isFragmentStart) {
  1456. node = nextSibling(node);
  1457. domType = node.nodeType;
  1458. }
  1459. if (domType === 1 || domType === 3) {
  1460. nextNode = node;
  1461. const needToAdoptContent = !vnode.children.length;
  1462. for (let i = 0; i < vnode.staticCount; i++) {
  1463. if (needToAdoptContent)
  1464. vnode.children += nextNode.nodeType === 1 ? nextNode.outerHTML : nextNode.data;
  1465. if (i === vnode.staticCount - 1) {
  1466. vnode.anchor = nextNode;
  1467. }
  1468. nextNode = nextSibling(nextNode);
  1469. }
  1470. return isFragmentStart ? nextSibling(nextNode) : nextNode;
  1471. } else {
  1472. onMismatch();
  1473. }
  1474. break;
  1475. case Fragment:
  1476. if (!isFragmentStart) {
  1477. nextNode = onMismatch();
  1478. } else {
  1479. nextNode = hydrateFragment(
  1480. node,
  1481. vnode,
  1482. parentComponent,
  1483. parentSuspense,
  1484. slotScopeIds,
  1485. optimized
  1486. );
  1487. }
  1488. break;
  1489. default:
  1490. if (shapeFlag & 1) {
  1491. if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) {
  1492. nextNode = onMismatch();
  1493. } else {
  1494. nextNode = hydrateElement(
  1495. node,
  1496. vnode,
  1497. parentComponent,
  1498. parentSuspense,
  1499. slotScopeIds,
  1500. optimized
  1501. );
  1502. }
  1503. } else if (shapeFlag & 6) {
  1504. vnode.slotScopeIds = slotScopeIds;
  1505. const container = parentNode(node);
  1506. if (isFragmentStart) {
  1507. nextNode = locateClosingAnchor(node);
  1508. } else if (isComment(node) && node.data === "teleport start") {
  1509. nextNode = locateClosingAnchor(node, node.data, "teleport end");
  1510. } else {
  1511. nextNode = nextSibling(node);
  1512. }
  1513. mountComponent(
  1514. vnode,
  1515. container,
  1516. null,
  1517. parentComponent,
  1518. parentSuspense,
  1519. getContainerType(container),
  1520. optimized
  1521. );
  1522. if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) {
  1523. let subTree;
  1524. if (isFragmentStart) {
  1525. subTree = createVNode(Fragment);
  1526. subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
  1527. } else {
  1528. subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
  1529. }
  1530. subTree.el = node;
  1531. vnode.component.subTree = subTree;
  1532. }
  1533. } else if (shapeFlag & 64) {
  1534. if (domType !== 8) {
  1535. nextNode = onMismatch();
  1536. } else {
  1537. nextNode = vnode.type.hydrate(
  1538. node,
  1539. vnode,
  1540. parentComponent,
  1541. parentSuspense,
  1542. slotScopeIds,
  1543. optimized,
  1544. rendererInternals,
  1545. hydrateChildren
  1546. );
  1547. }
  1548. } else if (shapeFlag & 128) {
  1549. nextNode = vnode.type.hydrate(
  1550. node,
  1551. vnode,
  1552. parentComponent,
  1553. parentSuspense,
  1554. getContainerType(parentNode(node)),
  1555. slotScopeIds,
  1556. optimized,
  1557. rendererInternals,
  1558. hydrateNode
  1559. );
  1560. } else ;
  1561. }
  1562. if (ref != null) {
  1563. setRef(ref, null, parentSuspense, vnode);
  1564. }
  1565. return nextNode;
  1566. };
  1567. const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
  1568. optimized = optimized || !!vnode.dynamicChildren;
  1569. const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
  1570. const forcePatch = type === "input" || type === "option";
  1571. if (forcePatch || patchFlag !== -1) {
  1572. if (dirs) {
  1573. invokeDirectiveHook(vnode, null, parentComponent, "created");
  1574. }
  1575. let needCallTransitionHooks = false;
  1576. if (isTemplateNode(el)) {
  1577. needCallTransitionHooks = needTransition(
  1578. null,
  1579. // no need check parentSuspense in hydration
  1580. transition
  1581. ) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
  1582. const content = el.content.firstChild;
  1583. if (needCallTransitionHooks) {
  1584. const cls = content.getAttribute("class");
  1585. if (cls) content.$cls = cls;
  1586. transition.beforeEnter(content);
  1587. }
  1588. replaceNode(content, el, parentComponent);
  1589. vnode.el = el = content;
  1590. }
  1591. if (shapeFlag & 16 && // skip if element has innerHTML / textContent
  1592. !(props && (props.innerHTML || props.textContent))) {
  1593. let next = hydrateChildren(
  1594. el.firstChild,
  1595. vnode,
  1596. el,
  1597. parentComponent,
  1598. parentSuspense,
  1599. slotScopeIds,
  1600. optimized
  1601. );
  1602. if (next && !isMismatchAllowed(el, 1 /* CHILDREN */)) {
  1603. logMismatchError();
  1604. }
  1605. while (next) {
  1606. const cur = next;
  1607. next = next.nextSibling;
  1608. remove(cur);
  1609. }
  1610. } else if (shapeFlag & 8) {
  1611. let clientText = vnode.children;
  1612. if (clientText[0] === "\n" && (el.tagName === "PRE" || el.tagName === "TEXTAREA")) {
  1613. clientText = clientText.slice(1);
  1614. }
  1615. const { textContent } = el;
  1616. if (textContent !== clientText && // innerHTML normalize \r\n or \r into a single \n in the DOM
  1617. textContent !== clientText.replace(/\r\n|\r/g, "\n")) {
  1618. if (!isMismatchAllowed(el, 0 /* TEXT */)) {
  1619. logMismatchError();
  1620. }
  1621. el.textContent = vnode.children;
  1622. }
  1623. }
  1624. if (props) {
  1625. if (forcePatch || !optimized || patchFlag & (16 | 32)) {
  1626. const isCustomElement = el.tagName.includes("-");
  1627. for (const key in props) {
  1628. if (forcePatch && (key.endsWith("value") || key === "indeterminate") || shared.isOn(key) && !shared.isReservedProp(key) || // force hydrate v-bind with .prop modifiers
  1629. key[0] === "." || isCustomElement && !shared.isReservedProp(key)) {
  1630. patchProp(el, key, null, props[key], void 0, parentComponent);
  1631. }
  1632. }
  1633. } else if (props.onClick) {
  1634. patchProp(
  1635. el,
  1636. "onClick",
  1637. null,
  1638. props.onClick,
  1639. void 0,
  1640. parentComponent
  1641. );
  1642. } else if (patchFlag & 4 && reactivity.isReactive(props.style)) {
  1643. for (const key in props.style) props.style[key];
  1644. }
  1645. }
  1646. let vnodeHooks;
  1647. if (vnodeHooks = props && props.onVnodeBeforeMount) {
  1648. invokeVNodeHook(vnodeHooks, parentComponent, vnode);
  1649. }
  1650. if (dirs) {
  1651. invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
  1652. }
  1653. if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
  1654. queueEffectWithSuspense(() => {
  1655. vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
  1656. needCallTransitionHooks && transition.enter(el);
  1657. dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
  1658. }, parentSuspense);
  1659. }
  1660. }
  1661. return el.nextSibling;
  1662. };
  1663. const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized) => {
  1664. optimized = optimized || !!parentVNode.dynamicChildren;
  1665. const children = parentVNode.children;
  1666. const l = children.length;
  1667. let hasCheckedMismatch = false;
  1668. for (let i = 0; i < l; i++) {
  1669. const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
  1670. const isText = vnode.type === Text;
  1671. if (node) {
  1672. if (isText && !optimized) {
  1673. if (i + 1 < l && normalizeVNode(children[i + 1]).type === Text) {
  1674. insert(
  1675. createText(
  1676. node.data.slice(vnode.children.length)
  1677. ),
  1678. container,
  1679. nextSibling(node)
  1680. );
  1681. node.data = vnode.children;
  1682. }
  1683. }
  1684. node = hydrateNode(
  1685. node,
  1686. vnode,
  1687. parentComponent,
  1688. parentSuspense,
  1689. slotScopeIds,
  1690. optimized
  1691. );
  1692. } else if (isText && !vnode.children) {
  1693. insert(vnode.el = createText(""), container);
  1694. } else {
  1695. if (!hasCheckedMismatch) {
  1696. hasCheckedMismatch = true;
  1697. if (!isMismatchAllowed(container, 1 /* CHILDREN */)) {
  1698. logMismatchError();
  1699. }
  1700. }
  1701. patch(
  1702. null,
  1703. vnode,
  1704. container,
  1705. null,
  1706. parentComponent,
  1707. parentSuspense,
  1708. getContainerType(container),
  1709. slotScopeIds
  1710. );
  1711. }
  1712. }
  1713. return node;
  1714. };
  1715. const hydrateFragment = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
  1716. const { slotScopeIds: fragmentSlotScopeIds } = vnode;
  1717. if (fragmentSlotScopeIds) {
  1718. slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
  1719. }
  1720. const container = parentNode(node);
  1721. const next = hydrateChildren(
  1722. nextSibling(node),
  1723. vnode,
  1724. container,
  1725. parentComponent,
  1726. parentSuspense,
  1727. slotScopeIds,
  1728. optimized
  1729. );
  1730. if (next && isComment(next) && next.data === "]") {
  1731. return nextSibling(vnode.anchor = next);
  1732. } else {
  1733. logMismatchError();
  1734. insert(vnode.anchor = createComment(`]`), container, next);
  1735. return next;
  1736. }
  1737. };
  1738. const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
  1739. if (!isMismatchAllowed(node.parentElement, 1 /* CHILDREN */)) {
  1740. logMismatchError();
  1741. }
  1742. vnode.el = null;
  1743. if (isFragment) {
  1744. const end = locateClosingAnchor(node);
  1745. while (true) {
  1746. const next2 = nextSibling(node);
  1747. if (next2 && next2 !== end) {
  1748. remove(next2);
  1749. } else {
  1750. break;
  1751. }
  1752. }
  1753. }
  1754. const next = nextSibling(node);
  1755. const container = parentNode(node);
  1756. remove(node);
  1757. patch(
  1758. null,
  1759. vnode,
  1760. container,
  1761. next,
  1762. parentComponent,
  1763. parentSuspense,
  1764. getContainerType(container),
  1765. slotScopeIds
  1766. );
  1767. if (parentComponent) {
  1768. parentComponent.vnode.el = vnode.el;
  1769. updateHOCHostEl(parentComponent, vnode.el);
  1770. }
  1771. return next;
  1772. };
  1773. const locateClosingAnchor = (node, open = "[", close = "]") => {
  1774. let match = 0;
  1775. while (node) {
  1776. node = nextSibling(node);
  1777. if (node && isComment(node)) {
  1778. if (node.data === open) match++;
  1779. if (node.data === close) {
  1780. if (match === 0) {
  1781. return nextSibling(node);
  1782. } else {
  1783. match--;
  1784. }
  1785. }
  1786. }
  1787. }
  1788. return node;
  1789. };
  1790. const replaceNode = (newNode, oldNode, parentComponent) => {
  1791. const parentNode2 = oldNode.parentNode;
  1792. if (parentNode2) {
  1793. parentNode2.replaceChild(newNode, oldNode);
  1794. }
  1795. let parent = parentComponent;
  1796. while (parent) {
  1797. if (parent.vnode.el === oldNode) {
  1798. parent.vnode.el = parent.subTree.el = newNode;
  1799. }
  1800. parent = parent.parent;
  1801. }
  1802. };
  1803. const isTemplateNode = (node) => {
  1804. return node.nodeType === 1 && node.tagName === "TEMPLATE";
  1805. };
  1806. return [hydrate, hydrateNode];
  1807. }
  1808. const allowMismatchAttr = "data-allow-mismatch";
  1809. const MismatchTypeString = {
  1810. [0 /* TEXT */]: "text",
  1811. [1 /* CHILDREN */]: "children",
  1812. [2 /* CLASS */]: "class",
  1813. [3 /* STYLE */]: "style",
  1814. [4 /* ATTRIBUTE */]: "attribute"
  1815. };
  1816. function isMismatchAllowed(el, allowedType) {
  1817. if (allowedType === 0 /* TEXT */ || allowedType === 1 /* CHILDREN */) {
  1818. while (el && !el.hasAttribute(allowMismatchAttr)) {
  1819. el = el.parentElement;
  1820. }
  1821. }
  1822. const allowedAttr = el && el.getAttribute(allowMismatchAttr);
  1823. if (allowedAttr == null) {
  1824. return false;
  1825. } else if (allowedAttr === "") {
  1826. return true;
  1827. } else {
  1828. const list = allowedAttr.split(",");
  1829. if (allowedType === 0 /* TEXT */ && list.includes("children")) {
  1830. return true;
  1831. }
  1832. return list.includes(MismatchTypeString[allowedType]);
  1833. }
  1834. }
  1835. const requestIdleCallback = shared.getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1));
  1836. const cancelIdleCallback = shared.getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id));
  1837. const hydrateOnIdle = (timeout = 1e4) => (hydrate) => {
  1838. const id = requestIdleCallback(hydrate, { timeout });
  1839. return () => cancelIdleCallback(id);
  1840. };
  1841. function elementIsVisibleInViewport(el) {
  1842. const { top, left, bottom, right } = el.getBoundingClientRect();
  1843. const { innerHeight, innerWidth } = window;
  1844. return (top > 0 && top < innerHeight || bottom > 0 && bottom < innerHeight) && (left > 0 && left < innerWidth || right > 0 && right < innerWidth);
  1845. }
  1846. const hydrateOnVisible = (opts) => (hydrate, forEach) => {
  1847. const ob = new IntersectionObserver((entries) => {
  1848. for (const e of entries) {
  1849. if (!e.isIntersecting) continue;
  1850. ob.disconnect();
  1851. hydrate();
  1852. break;
  1853. }
  1854. }, opts);
  1855. forEach((el) => {
  1856. if (!(el instanceof Element)) return;
  1857. if (elementIsVisibleInViewport(el)) {
  1858. hydrate();
  1859. ob.disconnect();
  1860. return false;
  1861. }
  1862. ob.observe(el);
  1863. });
  1864. return () => ob.disconnect();
  1865. };
  1866. const hydrateOnMediaQuery = (query) => (hydrate) => {
  1867. if (query) {
  1868. const mql = matchMedia(query);
  1869. if (mql.matches) {
  1870. hydrate();
  1871. } else {
  1872. mql.addEventListener("change", hydrate, { once: true });
  1873. return () => mql.removeEventListener("change", hydrate);
  1874. }
  1875. }
  1876. };
  1877. const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => {
  1878. if (shared.isString(interactions)) interactions = [interactions];
  1879. let hasHydrated = false;
  1880. const doHydrate = (e) => {
  1881. if (!hasHydrated) {
  1882. hasHydrated = true;
  1883. teardown();
  1884. hydrate();
  1885. e.target.dispatchEvent(new e.constructor(e.type, e));
  1886. }
  1887. };
  1888. const teardown = () => {
  1889. forEach((el) => {
  1890. for (const i of interactions) {
  1891. el.removeEventListener(i, doHydrate);
  1892. }
  1893. });
  1894. };
  1895. forEach((el) => {
  1896. for (const i of interactions) {
  1897. el.addEventListener(i, doHydrate, { once: true });
  1898. }
  1899. });
  1900. return teardown;
  1901. };
  1902. function forEachElement(node, cb) {
  1903. if (isComment(node) && node.data === "[") {
  1904. let depth = 1;
  1905. let next = node.nextSibling;
  1906. while (next) {
  1907. if (next.nodeType === 1) {
  1908. const result = cb(next);
  1909. if (result === false) {
  1910. break;
  1911. }
  1912. } else if (isComment(next)) {
  1913. if (next.data === "]") {
  1914. if (--depth === 0) break;
  1915. } else if (next.data === "[") {
  1916. depth++;
  1917. }
  1918. }
  1919. next = next.nextSibling;
  1920. }
  1921. } else {
  1922. cb(node);
  1923. }
  1924. }
  1925. const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
  1926. // @__NO_SIDE_EFFECTS__
  1927. function defineAsyncComponent(source) {
  1928. if (shared.isFunction(source)) {
  1929. source = { loader: source };
  1930. }
  1931. const {
  1932. loader,
  1933. loadingComponent,
  1934. errorComponent,
  1935. delay = 200,
  1936. hydrate: hydrateStrategy,
  1937. timeout,
  1938. // undefined = never times out
  1939. suspensible = true,
  1940. onError: userOnError
  1941. } = source;
  1942. let pendingRequest = null;
  1943. let resolvedComp;
  1944. let retries = 0;
  1945. const retry = () => {
  1946. retries++;
  1947. pendingRequest = null;
  1948. return load();
  1949. };
  1950. const load = () => {
  1951. let thisRequest;
  1952. return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
  1953. err = err instanceof Error ? err : new Error(String(err));
  1954. if (userOnError) {
  1955. return new Promise((resolve, reject) => {
  1956. const userRetry = () => resolve(retry());
  1957. const userFail = () => reject(err);
  1958. userOnError(err, userRetry, userFail, retries + 1);
  1959. });
  1960. } else {
  1961. throw err;
  1962. }
  1963. }).then((comp) => {
  1964. if (thisRequest !== pendingRequest && pendingRequest) {
  1965. return pendingRequest;
  1966. }
  1967. if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
  1968. comp = comp.default;
  1969. }
  1970. resolvedComp = comp;
  1971. return comp;
  1972. }));
  1973. };
  1974. return defineComponent({
  1975. name: "AsyncComponentWrapper",
  1976. __asyncLoader: load,
  1977. __asyncHydrate(el, instance, hydrate) {
  1978. let patched = false;
  1979. (instance.bu || (instance.bu = [])).push(() => patched = true);
  1980. const performHydrate = () => {
  1981. if (patched) {
  1982. return;
  1983. }
  1984. hydrate();
  1985. };
  1986. const doHydrate = hydrateStrategy ? () => {
  1987. const teardown = hydrateStrategy(
  1988. performHydrate,
  1989. (cb) => forEachElement(el, cb)
  1990. );
  1991. if (teardown) {
  1992. (instance.bum || (instance.bum = [])).push(teardown);
  1993. }
  1994. } : performHydrate;
  1995. if (resolvedComp) {
  1996. doHydrate();
  1997. } else {
  1998. load().then(() => !instance.isUnmounted && doHydrate());
  1999. }
  2000. },
  2001. get __asyncResolved() {
  2002. return resolvedComp;
  2003. },
  2004. setup() {
  2005. const instance = currentInstance;
  2006. markAsyncBoundary(instance);
  2007. if (resolvedComp) {
  2008. return () => createInnerComp(resolvedComp, instance);
  2009. }
  2010. const onError = (err) => {
  2011. pendingRequest = null;
  2012. handleError(
  2013. err,
  2014. instance,
  2015. 13,
  2016. !errorComponent
  2017. );
  2018. };
  2019. if (suspensible && instance.suspense || isInSSRComponentSetup) {
  2020. return load().then((comp) => {
  2021. return () => createInnerComp(comp, instance);
  2022. }).catch((err) => {
  2023. onError(err);
  2024. return () => errorComponent ? createVNode(errorComponent, {
  2025. error: err
  2026. }) : null;
  2027. });
  2028. }
  2029. const loaded = reactivity.ref(false);
  2030. const error = reactivity.ref();
  2031. const delayed = reactivity.ref(!!delay);
  2032. if (delay) {
  2033. setTimeout(() => {
  2034. delayed.value = false;
  2035. }, delay);
  2036. }
  2037. if (timeout != null) {
  2038. setTimeout(() => {
  2039. if (!loaded.value && !error.value) {
  2040. const err = new Error(
  2041. `Async component timed out after ${timeout}ms.`
  2042. );
  2043. onError(err);
  2044. error.value = err;
  2045. }
  2046. }, timeout);
  2047. }
  2048. load().then(() => {
  2049. loaded.value = true;
  2050. if (instance.parent && isKeepAlive(instance.parent.vnode)) {
  2051. instance.parent.update();
  2052. }
  2053. }).catch((err) => {
  2054. onError(err);
  2055. error.value = err;
  2056. });
  2057. return () => {
  2058. if (loaded.value && resolvedComp) {
  2059. return createInnerComp(resolvedComp, instance);
  2060. } else if (error.value && errorComponent) {
  2061. return createVNode(errorComponent, {
  2062. error: error.value
  2063. });
  2064. } else if (loadingComponent && !delayed.value) {
  2065. return createInnerComp(
  2066. loadingComponent,
  2067. instance
  2068. );
  2069. }
  2070. };
  2071. }
  2072. });
  2073. }
  2074. function createInnerComp(comp, parent) {
  2075. const { ref: ref2, props, children, ce } = parent.vnode;
  2076. const vnode = createVNode(comp, props, children);
  2077. vnode.ref = ref2;
  2078. vnode.ce = ce;
  2079. delete parent.vnode.ce;
  2080. return vnode;
  2081. }
  2082. const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
  2083. const KeepAliveImpl = {
  2084. name: `KeepAlive`,
  2085. // Marker for special handling inside the renderer. We are not using a ===
  2086. // check directly on KeepAlive in the renderer, because importing it directly
  2087. // would prevent it from being tree-shaken.
  2088. __isKeepAlive: true,
  2089. props: {
  2090. include: [String, RegExp, Array],
  2091. exclude: [String, RegExp, Array],
  2092. max: [String, Number]
  2093. },
  2094. setup(props, { slots }) {
  2095. const instance = getCurrentInstance();
  2096. const sharedContext = instance.ctx;
  2097. if (!sharedContext.renderer) {
  2098. return () => {
  2099. const children = slots.default && slots.default();
  2100. return children && children.length === 1 ? children[0] : children;
  2101. };
  2102. }
  2103. const cache = /* @__PURE__ */ new Map();
  2104. const keys = /* @__PURE__ */ new Set();
  2105. let current = null;
  2106. const parentSuspense = instance.suspense;
  2107. const {
  2108. renderer: {
  2109. p: patch,
  2110. m: move,
  2111. um: _unmount,
  2112. o: { createElement }
  2113. }
  2114. } = sharedContext;
  2115. const storageContainer = createElement("div");
  2116. sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
  2117. const instance2 = vnode.component;
  2118. move(vnode, container, anchor, 0, parentSuspense);
  2119. patch(
  2120. instance2.vnode,
  2121. vnode,
  2122. container,
  2123. anchor,
  2124. instance2,
  2125. parentSuspense,
  2126. namespace,
  2127. vnode.slotScopeIds,
  2128. optimized
  2129. );
  2130. queuePostRenderEffect(() => {
  2131. instance2.isDeactivated = false;
  2132. if (instance2.a) {
  2133. shared.invokeArrayFns(instance2.a);
  2134. }
  2135. const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
  2136. if (vnodeHook) {
  2137. invokeVNodeHook(vnodeHook, instance2.parent, vnode);
  2138. }
  2139. }, parentSuspense);
  2140. };
  2141. sharedContext.deactivate = (vnode) => {
  2142. const instance2 = vnode.component;
  2143. invalidateMount(instance2.m);
  2144. invalidateMount(instance2.a);
  2145. move(vnode, storageContainer, null, 1, parentSuspense);
  2146. queuePostRenderEffect(() => {
  2147. if (instance2.da) {
  2148. shared.invokeArrayFns(instance2.da);
  2149. }
  2150. const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
  2151. if (vnodeHook) {
  2152. invokeVNodeHook(vnodeHook, instance2.parent, vnode);
  2153. }
  2154. instance2.isDeactivated = true;
  2155. }, parentSuspense);
  2156. };
  2157. function unmount(vnode) {
  2158. resetShapeFlag(vnode);
  2159. _unmount(vnode, instance, parentSuspense, true);
  2160. }
  2161. function pruneCache(filter) {
  2162. cache.forEach((vnode, key) => {
  2163. const name = getComponentName(
  2164. isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : vnode.type
  2165. );
  2166. if (name && !filter(name)) {
  2167. pruneCacheEntry(key);
  2168. }
  2169. });
  2170. }
  2171. function pruneCacheEntry(key) {
  2172. const cached = cache.get(key);
  2173. if (cached && (!current || !isSameVNodeType(cached, current))) {
  2174. unmount(cached);
  2175. } else if (current) {
  2176. resetShapeFlag(current);
  2177. }
  2178. cache.delete(key);
  2179. keys.delete(key);
  2180. }
  2181. watch(
  2182. () => [props.include, props.exclude],
  2183. ([include, exclude]) => {
  2184. include && pruneCache((name) => matches(include, name));
  2185. exclude && pruneCache((name) => !matches(exclude, name));
  2186. },
  2187. // prune post-render after `current` has been updated
  2188. { flush: "post", deep: true }
  2189. );
  2190. let pendingCacheKey = null;
  2191. const cacheSubtree = () => {
  2192. if (pendingCacheKey != null) {
  2193. if (isSuspense(instance.subTree.type)) {
  2194. queuePostRenderEffect(() => {
  2195. cache.set(pendingCacheKey, getInnerChild(instance.subTree));
  2196. }, instance.subTree.suspense);
  2197. } else {
  2198. cache.set(pendingCacheKey, getInnerChild(instance.subTree));
  2199. }
  2200. }
  2201. };
  2202. onMounted(cacheSubtree);
  2203. onUpdated(cacheSubtree);
  2204. onBeforeUnmount(() => {
  2205. cache.forEach((cached) => {
  2206. const { subTree, suspense } = instance;
  2207. const vnode = getInnerChild(subTree);
  2208. if (cached.type === vnode.type && cached.key === vnode.key) {
  2209. resetShapeFlag(vnode);
  2210. const da = vnode.component.da;
  2211. da && queuePostRenderEffect(da, suspense);
  2212. return;
  2213. }
  2214. unmount(cached);
  2215. });
  2216. });
  2217. return () => {
  2218. pendingCacheKey = null;
  2219. if (!slots.default) {
  2220. return current = null;
  2221. }
  2222. const children = slots.default();
  2223. const rawVNode = children[0];
  2224. if (children.length > 1) {
  2225. current = null;
  2226. return children;
  2227. } else if (!isVNode(rawVNode) || !(rawVNode.shapeFlag & 4) && !(rawVNode.shapeFlag & 128)) {
  2228. current = null;
  2229. return rawVNode;
  2230. }
  2231. let vnode = getInnerChild(rawVNode);
  2232. if (vnode.type === Comment) {
  2233. current = null;
  2234. return vnode;
  2235. }
  2236. const comp = vnode.type;
  2237. const name = getComponentName(
  2238. isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp
  2239. );
  2240. const { include, exclude, max } = props;
  2241. if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) {
  2242. vnode.shapeFlag &= -257;
  2243. current = vnode;
  2244. return rawVNode;
  2245. }
  2246. const key = vnode.key == null ? comp : vnode.key;
  2247. const cachedVNode = cache.get(key);
  2248. if (vnode.el) {
  2249. vnode = cloneVNode(vnode);
  2250. if (rawVNode.shapeFlag & 128) {
  2251. rawVNode.ssContent = vnode;
  2252. }
  2253. }
  2254. pendingCacheKey = key;
  2255. if (cachedVNode) {
  2256. vnode.el = cachedVNode.el;
  2257. vnode.component = cachedVNode.component;
  2258. if (vnode.transition) {
  2259. setTransitionHooks(vnode, vnode.transition);
  2260. }
  2261. vnode.shapeFlag |= 512;
  2262. keys.delete(key);
  2263. keys.add(key);
  2264. } else {
  2265. keys.add(key);
  2266. if (max && keys.size > parseInt(max, 10)) {
  2267. pruneCacheEntry(keys.values().next().value);
  2268. }
  2269. }
  2270. vnode.shapeFlag |= 256;
  2271. current = vnode;
  2272. return isSuspense(rawVNode.type) ? rawVNode : vnode;
  2273. };
  2274. }
  2275. };
  2276. const KeepAlive = KeepAliveImpl;
  2277. function matches(pattern, name) {
  2278. if (shared.isArray(pattern)) {
  2279. return pattern.some((p) => matches(p, name));
  2280. } else if (shared.isString(pattern)) {
  2281. return pattern.split(",").includes(name);
  2282. } else if (shared.isRegExp(pattern)) {
  2283. pattern.lastIndex = 0;
  2284. return pattern.test(name);
  2285. }
  2286. return false;
  2287. }
  2288. function onActivated(hook, target) {
  2289. registerKeepAliveHook(hook, "a", target);
  2290. }
  2291. function onDeactivated(hook, target) {
  2292. registerKeepAliveHook(hook, "da", target);
  2293. }
  2294. function registerKeepAliveHook(hook, type, target = currentInstance) {
  2295. const wrappedHook = hook.__wdc || (hook.__wdc = () => {
  2296. let current = target;
  2297. while (current) {
  2298. if (current.isDeactivated) {
  2299. return;
  2300. }
  2301. current = current.parent;
  2302. }
  2303. return hook();
  2304. });
  2305. injectHook(type, wrappedHook, target);
  2306. if (target) {
  2307. let current = target.parent;
  2308. while (current && current.parent) {
  2309. if (isKeepAlive(current.parent.vnode)) {
  2310. injectToKeepAliveRoot(wrappedHook, type, target, current);
  2311. }
  2312. current = current.parent;
  2313. }
  2314. }
  2315. }
  2316. function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
  2317. const injected = injectHook(
  2318. type,
  2319. hook,
  2320. keepAliveRoot,
  2321. true
  2322. /* prepend */
  2323. );
  2324. onUnmounted(() => {
  2325. shared.remove(keepAliveRoot[type], injected);
  2326. }, target);
  2327. }
  2328. function resetShapeFlag(vnode) {
  2329. vnode.shapeFlag &= -257;
  2330. vnode.shapeFlag &= -513;
  2331. }
  2332. function getInnerChild(vnode) {
  2333. return vnode.shapeFlag & 128 ? vnode.ssContent : vnode;
  2334. }
  2335. function injectHook(type, hook, target = currentInstance, prepend = false) {
  2336. if (target) {
  2337. const hooks = target[type] || (target[type] = []);
  2338. const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
  2339. reactivity.pauseTracking();
  2340. const reset = setCurrentInstance(target);
  2341. const res = callWithAsyncErrorHandling(hook, target, type, args);
  2342. reset();
  2343. reactivity.resetTracking();
  2344. return res;
  2345. });
  2346. if (prepend) {
  2347. hooks.unshift(wrappedHook);
  2348. } else {
  2349. hooks.push(wrappedHook);
  2350. }
  2351. return wrappedHook;
  2352. }
  2353. }
  2354. const createHook = (lifecycle) => (hook, target = currentInstance) => {
  2355. if (!isInSSRComponentSetup || lifecycle === "sp") {
  2356. injectHook(lifecycle, (...args) => hook(...args), target);
  2357. }
  2358. };
  2359. const onBeforeMount = createHook("bm");
  2360. const onMounted = createHook("m");
  2361. const onBeforeUpdate = createHook(
  2362. "bu"
  2363. );
  2364. const onUpdated = createHook("u");
  2365. const onBeforeUnmount = createHook(
  2366. "bum"
  2367. );
  2368. const onUnmounted = createHook("um");
  2369. const onServerPrefetch = createHook(
  2370. "sp"
  2371. );
  2372. const onRenderTriggered = createHook("rtg");
  2373. const onRenderTracked = createHook("rtc");
  2374. function onErrorCaptured(hook, target = currentInstance) {
  2375. injectHook("ec", hook, target);
  2376. }
  2377. const COMPONENTS = "components";
  2378. const DIRECTIVES = "directives";
  2379. function resolveComponent(name, maybeSelfReference) {
  2380. return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
  2381. }
  2382. const NULL_DYNAMIC_COMPONENT = /* @__PURE__ */ Symbol.for("v-ndc");
  2383. function resolveDynamicComponent(component) {
  2384. if (shared.isString(component)) {
  2385. return resolveAsset(COMPONENTS, component, false) || component;
  2386. } else {
  2387. return component || NULL_DYNAMIC_COMPONENT;
  2388. }
  2389. }
  2390. function resolveDirective(name) {
  2391. return resolveAsset(DIRECTIVES, name);
  2392. }
  2393. function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
  2394. const instance = currentRenderingInstance || currentInstance;
  2395. if (instance) {
  2396. const Component = instance.type;
  2397. if (type === COMPONENTS) {
  2398. const selfName = getComponentName(
  2399. Component,
  2400. false
  2401. );
  2402. if (selfName && (selfName === name || selfName === shared.camelize(name) || selfName === shared.capitalize(shared.camelize(name)))) {
  2403. return Component;
  2404. }
  2405. }
  2406. const res = (
  2407. // local registration
  2408. // check instance[type] first which is resolved for options API
  2409. resolve(instance[type] || Component[type], name) || // global registration
  2410. resolve(instance.appContext[type], name)
  2411. );
  2412. if (!res && maybeSelfReference) {
  2413. return Component;
  2414. }
  2415. return res;
  2416. }
  2417. }
  2418. function resolve(registry, name) {
  2419. return registry && (registry[name] || registry[shared.camelize(name)] || registry[shared.capitalize(shared.camelize(name))]);
  2420. }
  2421. function renderList(source, renderItem, cache, index) {
  2422. let ret;
  2423. const cached = cache && cache[index];
  2424. const sourceIsArray = shared.isArray(source);
  2425. if (sourceIsArray || shared.isString(source)) {
  2426. const sourceIsReactiveArray = sourceIsArray && reactivity.isReactive(source);
  2427. let needsWrap = false;
  2428. let isReadonlySource = false;
  2429. if (sourceIsReactiveArray) {
  2430. needsWrap = !reactivity.isShallow(source);
  2431. isReadonlySource = reactivity.isReadonly(source);
  2432. source = reactivity.shallowReadArray(source);
  2433. }
  2434. ret = new Array(source.length);
  2435. for (let i = 0, l = source.length; i < l; i++) {
  2436. ret[i] = renderItem(
  2437. needsWrap ? isReadonlySource ? reactivity.toReadonly(reactivity.toReactive(source[i])) : reactivity.toReactive(source[i]) : source[i],
  2438. i,
  2439. void 0,
  2440. cached && cached[i]
  2441. );
  2442. }
  2443. } else if (typeof source === "number") {
  2444. {
  2445. ret = new Array(source);
  2446. for (let i = 0; i < source; i++) {
  2447. ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
  2448. }
  2449. }
  2450. } else if (shared.isObject(source)) {
  2451. if (source[Symbol.iterator]) {
  2452. ret = Array.from(
  2453. source,
  2454. (item, i) => renderItem(item, i, void 0, cached && cached[i])
  2455. );
  2456. } else {
  2457. const keys = Object.keys(source);
  2458. ret = new Array(keys.length);
  2459. for (let i = 0, l = keys.length; i < l; i++) {
  2460. const key = keys[i];
  2461. ret[i] = renderItem(source[key], key, i, cached && cached[i]);
  2462. }
  2463. }
  2464. } else {
  2465. ret = [];
  2466. }
  2467. if (cache) {
  2468. cache[index] = ret;
  2469. }
  2470. return ret;
  2471. }
  2472. function createSlots(slots, dynamicSlots) {
  2473. for (let i = 0; i < dynamicSlots.length; i++) {
  2474. const slot = dynamicSlots[i];
  2475. if (shared.isArray(slot)) {
  2476. for (let j = 0; j < slot.length; j++) {
  2477. slots[slot[j].name] = slot[j].fn;
  2478. }
  2479. } else if (slot) {
  2480. slots[slot.name] = slot.key ? (...args) => {
  2481. const res = slot.fn(...args);
  2482. if (res) res.key = slot.key;
  2483. return res;
  2484. } : slot.fn;
  2485. }
  2486. }
  2487. return slots;
  2488. }
  2489. function renderSlot(slots, name, props = {}, fallback, noSlotted) {
  2490. if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
  2491. const hasProps = Object.keys(props).length > 0;
  2492. if (name !== "default") props.name = name;
  2493. return openBlock(), createBlock(
  2494. Fragment,
  2495. null,
  2496. [createVNode("slot", props, fallback && fallback())],
  2497. hasProps ? -2 : 64
  2498. );
  2499. }
  2500. let slot = slots[name];
  2501. if (slot && slot._c) {
  2502. slot._d = false;
  2503. }
  2504. openBlock();
  2505. const validSlotContent = slot && ensureValidVNode(slot(props));
  2506. const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
  2507. // key attached in the `createSlots` helper, respect that
  2508. validSlotContent && validSlotContent.key;
  2509. const rendered = createBlock(
  2510. Fragment,
  2511. {
  2512. key: (slotKey && !shared.isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
  2513. (!validSlotContent && fallback ? "_fb" : "")
  2514. },
  2515. validSlotContent || (fallback ? fallback() : []),
  2516. validSlotContent && slots._ === 1 ? 64 : -2
  2517. );
  2518. if (!noSlotted && rendered.scopeId) {
  2519. rendered.slotScopeIds = [rendered.scopeId + "-s"];
  2520. }
  2521. if (slot && slot._c) {
  2522. slot._d = true;
  2523. }
  2524. return rendered;
  2525. }
  2526. function ensureValidVNode(vnodes) {
  2527. return vnodes.some((child) => {
  2528. if (!isVNode(child)) return true;
  2529. if (child.type === Comment) return false;
  2530. if (child.type === Fragment && !ensureValidVNode(child.children))
  2531. return false;
  2532. return true;
  2533. }) ? vnodes : null;
  2534. }
  2535. function toHandlers(obj, preserveCaseIfNecessary) {
  2536. const ret = {};
  2537. for (const key in obj) {
  2538. ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : shared.toHandlerKey(key)] = obj[key];
  2539. }
  2540. return ret;
  2541. }
  2542. const getPublicInstance = (i) => {
  2543. if (!i) return null;
  2544. if (isStatefulComponent(i)) return getComponentPublicInstance(i);
  2545. return getPublicInstance(i.parent);
  2546. };
  2547. const publicPropertiesMap = (
  2548. // Move PURE marker to new line to workaround compiler discarding it
  2549. // due to type annotation
  2550. /* @__PURE__ */ shared.extend(/* @__PURE__ */ Object.create(null), {
  2551. $: (i) => i,
  2552. $el: (i) => i.vnode.el,
  2553. $data: (i) => i.data,
  2554. $props: (i) => i.props,
  2555. $attrs: (i) => i.attrs,
  2556. $slots: (i) => i.slots,
  2557. $refs: (i) => i.refs,
  2558. $parent: (i) => getPublicInstance(i.parent),
  2559. $root: (i) => getPublicInstance(i.root),
  2560. $host: (i) => i.ce,
  2561. $emit: (i) => i.emit,
  2562. $options: (i) => resolveMergedOptions(i) ,
  2563. $forceUpdate: (i) => i.f || (i.f = () => {
  2564. queueJob(i.update);
  2565. }),
  2566. $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)),
  2567. $watch: (i) => instanceWatch.bind(i)
  2568. })
  2569. );
  2570. const hasSetupBinding = (state, key) => state !== shared.EMPTY_OBJ && !state.__isScriptSetup && shared.hasOwn(state, key);
  2571. const PublicInstanceProxyHandlers = {
  2572. get({ _: instance }, key) {
  2573. if (key === "__v_skip") {
  2574. return true;
  2575. }
  2576. const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
  2577. if (key[0] !== "$") {
  2578. const n = accessCache[key];
  2579. if (n !== void 0) {
  2580. switch (n) {
  2581. case 1 /* SETUP */:
  2582. return setupState[key];
  2583. case 2 /* DATA */:
  2584. return data[key];
  2585. case 4 /* CONTEXT */:
  2586. return ctx[key];
  2587. case 3 /* PROPS */:
  2588. return props[key];
  2589. }
  2590. } else if (hasSetupBinding(setupState, key)) {
  2591. accessCache[key] = 1 /* SETUP */;
  2592. return setupState[key];
  2593. } else if (data !== shared.EMPTY_OBJ && shared.hasOwn(data, key)) {
  2594. accessCache[key] = 2 /* DATA */;
  2595. return data[key];
  2596. } else if (shared.hasOwn(props, key)) {
  2597. accessCache[key] = 3 /* PROPS */;
  2598. return props[key];
  2599. } else if (ctx !== shared.EMPTY_OBJ && shared.hasOwn(ctx, key)) {
  2600. accessCache[key] = 4 /* CONTEXT */;
  2601. return ctx[key];
  2602. } else if (shouldCacheAccess) {
  2603. accessCache[key] = 0 /* OTHER */;
  2604. }
  2605. }
  2606. const publicGetter = publicPropertiesMap[key];
  2607. let cssModule, globalProperties;
  2608. if (publicGetter) {
  2609. if (key === "$attrs") {
  2610. reactivity.track(instance.attrs, "get", "");
  2611. }
  2612. return publicGetter(instance);
  2613. } else if (
  2614. // css module (injected by vue-loader)
  2615. (cssModule = type.__cssModules) && (cssModule = cssModule[key])
  2616. ) {
  2617. return cssModule;
  2618. } else if (ctx !== shared.EMPTY_OBJ && shared.hasOwn(ctx, key)) {
  2619. accessCache[key] = 4 /* CONTEXT */;
  2620. return ctx[key];
  2621. } else if (
  2622. // global properties
  2623. globalProperties = appContext.config.globalProperties, shared.hasOwn(globalProperties, key)
  2624. ) {
  2625. {
  2626. return globalProperties[key];
  2627. }
  2628. } else ;
  2629. },
  2630. set({ _: instance }, key, value) {
  2631. const { data, setupState, ctx } = instance;
  2632. if (hasSetupBinding(setupState, key)) {
  2633. setupState[key] = value;
  2634. return true;
  2635. } else if (data !== shared.EMPTY_OBJ && shared.hasOwn(data, key)) {
  2636. data[key] = value;
  2637. return true;
  2638. } else if (shared.hasOwn(instance.props, key)) {
  2639. return false;
  2640. }
  2641. if (key[0] === "$" && key.slice(1) in instance) {
  2642. return false;
  2643. } else {
  2644. {
  2645. ctx[key] = value;
  2646. }
  2647. }
  2648. return true;
  2649. },
  2650. has({
  2651. _: { data, setupState, accessCache, ctx, appContext, props, type }
  2652. }, key) {
  2653. let cssModules;
  2654. return !!(accessCache[key] || data !== shared.EMPTY_OBJ && key[0] !== "$" && shared.hasOwn(data, key) || hasSetupBinding(setupState, key) || shared.hasOwn(props, key) || shared.hasOwn(ctx, key) || shared.hasOwn(publicPropertiesMap, key) || shared.hasOwn(appContext.config.globalProperties, key) || (cssModules = type.__cssModules) && cssModules[key]);
  2655. },
  2656. defineProperty(target, key, descriptor) {
  2657. if (descriptor.get != null) {
  2658. target._.accessCache[key] = 0;
  2659. } else if (shared.hasOwn(descriptor, "value")) {
  2660. this.set(target, key, descriptor.value, null);
  2661. }
  2662. return Reflect.defineProperty(target, key, descriptor);
  2663. }
  2664. };
  2665. const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ shared.extend({}, PublicInstanceProxyHandlers, {
  2666. get(target, key) {
  2667. if (key === Symbol.unscopables) {
  2668. return;
  2669. }
  2670. return PublicInstanceProxyHandlers.get(target, key, target);
  2671. },
  2672. has(_, key) {
  2673. const has = key[0] !== "_" && !shared.isGloballyAllowed(key);
  2674. return has;
  2675. }
  2676. });
  2677. function defineProps() {
  2678. return null;
  2679. }
  2680. function defineEmits() {
  2681. return null;
  2682. }
  2683. function defineExpose(exposed) {
  2684. }
  2685. function defineOptions(options) {
  2686. }
  2687. function defineSlots() {
  2688. return null;
  2689. }
  2690. function defineModel() {
  2691. }
  2692. function withDefaults(props, defaults) {
  2693. return null;
  2694. }
  2695. function useSlots() {
  2696. return getContext().slots;
  2697. }
  2698. function useAttrs() {
  2699. return getContext().attrs;
  2700. }
  2701. function getContext(calledFunctionName) {
  2702. const i = getCurrentInstance();
  2703. return i.setupContext || (i.setupContext = createSetupContext(i));
  2704. }
  2705. function normalizePropsOrEmits(props) {
  2706. return shared.isArray(props) ? props.reduce(
  2707. (normalized, p) => (normalized[p] = null, normalized),
  2708. {}
  2709. ) : props;
  2710. }
  2711. function mergeDefaults(raw, defaults) {
  2712. const props = normalizePropsOrEmits(raw);
  2713. for (const key in defaults) {
  2714. if (key.startsWith("__skip")) continue;
  2715. let opt = props[key];
  2716. if (opt) {
  2717. if (shared.isArray(opt) || shared.isFunction(opt)) {
  2718. opt = props[key] = { type: opt, default: defaults[key] };
  2719. } else {
  2720. opt.default = defaults[key];
  2721. }
  2722. } else if (opt === null) {
  2723. opt = props[key] = { default: defaults[key] };
  2724. } else ;
  2725. if (opt && defaults[`__skip_${key}`]) {
  2726. opt.skipFactory = true;
  2727. }
  2728. }
  2729. return props;
  2730. }
  2731. function mergeModels(a, b) {
  2732. if (!a || !b) return a || b;
  2733. if (shared.isArray(a) && shared.isArray(b)) return a.concat(b);
  2734. return shared.extend({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b));
  2735. }
  2736. function createPropsRestProxy(props, excludedKeys) {
  2737. const ret = {};
  2738. for (const key in props) {
  2739. if (!excludedKeys.includes(key)) {
  2740. Object.defineProperty(ret, key, {
  2741. enumerable: true,
  2742. get: () => props[key]
  2743. });
  2744. }
  2745. }
  2746. return ret;
  2747. }
  2748. function withAsyncContext(getAwaitable) {
  2749. const ctx = getCurrentInstance();
  2750. const inSSRSetup = isInSSRComponentSetup;
  2751. let awaitable = getAwaitable();
  2752. unsetCurrentInstance();
  2753. if (inSSRSetup) {
  2754. setInSSRSetupState(false);
  2755. }
  2756. const restore = () => {
  2757. setCurrentInstance(ctx);
  2758. if (inSSRSetup) {
  2759. setInSSRSetupState(true);
  2760. }
  2761. };
  2762. const cleanup = () => {
  2763. if (getCurrentInstance() !== ctx) ctx.scope.off();
  2764. unsetCurrentInstance();
  2765. if (inSSRSetup) {
  2766. setInSSRSetupState(false);
  2767. }
  2768. };
  2769. if (shared.isPromise(awaitable)) {
  2770. awaitable = awaitable.catch((e) => {
  2771. restore();
  2772. Promise.resolve().then(() => Promise.resolve().then(cleanup));
  2773. throw e;
  2774. });
  2775. }
  2776. return [
  2777. awaitable,
  2778. () => {
  2779. restore();
  2780. Promise.resolve().then(cleanup);
  2781. }
  2782. ];
  2783. }
  2784. let shouldCacheAccess = true;
  2785. function applyOptions(instance) {
  2786. const options = resolveMergedOptions(instance);
  2787. const publicThis = instance.proxy;
  2788. const ctx = instance.ctx;
  2789. shouldCacheAccess = false;
  2790. if (options.beforeCreate) {
  2791. callHook(options.beforeCreate, instance, "bc");
  2792. }
  2793. const {
  2794. // state
  2795. data: dataOptions,
  2796. computed: computedOptions,
  2797. methods,
  2798. watch: watchOptions,
  2799. provide: provideOptions,
  2800. inject: injectOptions,
  2801. // lifecycle
  2802. created,
  2803. beforeMount,
  2804. mounted,
  2805. beforeUpdate,
  2806. updated,
  2807. activated,
  2808. deactivated,
  2809. beforeDestroy,
  2810. beforeUnmount,
  2811. destroyed,
  2812. unmounted,
  2813. render,
  2814. renderTracked,
  2815. renderTriggered,
  2816. errorCaptured,
  2817. serverPrefetch,
  2818. // public API
  2819. expose,
  2820. inheritAttrs,
  2821. // assets
  2822. components,
  2823. directives,
  2824. filters
  2825. } = options;
  2826. const checkDuplicateProperties = null;
  2827. if (injectOptions) {
  2828. resolveInjections(injectOptions, ctx, checkDuplicateProperties);
  2829. }
  2830. if (methods) {
  2831. for (const key in methods) {
  2832. const methodHandler = methods[key];
  2833. if (shared.isFunction(methodHandler)) {
  2834. {
  2835. ctx[key] = methodHandler.bind(publicThis);
  2836. }
  2837. }
  2838. }
  2839. }
  2840. if (dataOptions) {
  2841. const data = dataOptions.call(publicThis, publicThis);
  2842. if (!shared.isObject(data)) ; else {
  2843. instance.data = reactivity.reactive(data);
  2844. }
  2845. }
  2846. shouldCacheAccess = true;
  2847. if (computedOptions) {
  2848. for (const key in computedOptions) {
  2849. const opt = computedOptions[key];
  2850. const get = shared.isFunction(opt) ? opt.bind(publicThis, publicThis) : shared.isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : shared.NOOP;
  2851. const set = !shared.isFunction(opt) && shared.isFunction(opt.set) ? opt.set.bind(publicThis) : shared.NOOP;
  2852. const c = computed({
  2853. get,
  2854. set
  2855. });
  2856. Object.defineProperty(ctx, key, {
  2857. enumerable: true,
  2858. configurable: true,
  2859. get: () => c.value,
  2860. set: (v) => c.value = v
  2861. });
  2862. }
  2863. }
  2864. if (watchOptions) {
  2865. for (const key in watchOptions) {
  2866. createWatcher(watchOptions[key], ctx, publicThis, key);
  2867. }
  2868. }
  2869. if (provideOptions) {
  2870. const provides = shared.isFunction(provideOptions) ? provideOptions.call(publicThis) : provideOptions;
  2871. Reflect.ownKeys(provides).forEach((key) => {
  2872. provide(key, provides[key]);
  2873. });
  2874. }
  2875. if (created) {
  2876. callHook(created, instance, "c");
  2877. }
  2878. function registerLifecycleHook(register, hook) {
  2879. if (shared.isArray(hook)) {
  2880. hook.forEach((_hook) => register(_hook.bind(publicThis)));
  2881. } else if (hook) {
  2882. register(hook.bind(publicThis));
  2883. }
  2884. }
  2885. registerLifecycleHook(onBeforeMount, beforeMount);
  2886. registerLifecycleHook(onMounted, mounted);
  2887. registerLifecycleHook(onBeforeUpdate, beforeUpdate);
  2888. registerLifecycleHook(onUpdated, updated);
  2889. registerLifecycleHook(onActivated, activated);
  2890. registerLifecycleHook(onDeactivated, deactivated);
  2891. registerLifecycleHook(onErrorCaptured, errorCaptured);
  2892. registerLifecycleHook(onRenderTracked, renderTracked);
  2893. registerLifecycleHook(onRenderTriggered, renderTriggered);
  2894. registerLifecycleHook(onBeforeUnmount, beforeUnmount);
  2895. registerLifecycleHook(onUnmounted, unmounted);
  2896. registerLifecycleHook(onServerPrefetch, serverPrefetch);
  2897. if (shared.isArray(expose)) {
  2898. if (expose.length) {
  2899. const exposed = instance.exposed || (instance.exposed = {});
  2900. expose.forEach((key) => {
  2901. Object.defineProperty(exposed, key, {
  2902. get: () => publicThis[key],
  2903. set: (val) => publicThis[key] = val,
  2904. enumerable: true
  2905. });
  2906. });
  2907. } else if (!instance.exposed) {
  2908. instance.exposed = {};
  2909. }
  2910. }
  2911. if (render && instance.render === shared.NOOP) {
  2912. instance.render = render;
  2913. }
  2914. if (inheritAttrs != null) {
  2915. instance.inheritAttrs = inheritAttrs;
  2916. }
  2917. if (components) instance.components = components;
  2918. if (directives) instance.directives = directives;
  2919. if (serverPrefetch) {
  2920. markAsyncBoundary(instance);
  2921. }
  2922. }
  2923. function resolveInjections(injectOptions, ctx, checkDuplicateProperties = shared.NOOP) {
  2924. if (shared.isArray(injectOptions)) {
  2925. injectOptions = normalizeInject(injectOptions);
  2926. }
  2927. for (const key in injectOptions) {
  2928. const opt = injectOptions[key];
  2929. let injected;
  2930. if (shared.isObject(opt)) {
  2931. if ("default" in opt) {
  2932. injected = inject(
  2933. opt.from || key,
  2934. opt.default,
  2935. true
  2936. );
  2937. } else {
  2938. injected = inject(opt.from || key);
  2939. }
  2940. } else {
  2941. injected = inject(opt);
  2942. }
  2943. if (reactivity.isRef(injected)) {
  2944. Object.defineProperty(ctx, key, {
  2945. enumerable: true,
  2946. configurable: true,
  2947. get: () => injected.value,
  2948. set: (v) => injected.value = v
  2949. });
  2950. } else {
  2951. ctx[key] = injected;
  2952. }
  2953. }
  2954. }
  2955. function callHook(hook, instance, type) {
  2956. callWithAsyncErrorHandling(
  2957. shared.isArray(hook) ? hook.map((h) => h.bind(instance.proxy)) : hook.bind(instance.proxy),
  2958. instance,
  2959. type
  2960. );
  2961. }
  2962. function createWatcher(raw, ctx, publicThis, key) {
  2963. let getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key];
  2964. if (shared.isString(raw)) {
  2965. const handler = ctx[raw];
  2966. if (shared.isFunction(handler)) {
  2967. {
  2968. watch(getter, handler);
  2969. }
  2970. }
  2971. } else if (shared.isFunction(raw)) {
  2972. {
  2973. watch(getter, raw.bind(publicThis));
  2974. }
  2975. } else if (shared.isObject(raw)) {
  2976. if (shared.isArray(raw)) {
  2977. raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
  2978. } else {
  2979. const handler = shared.isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
  2980. if (shared.isFunction(handler)) {
  2981. watch(getter, handler, raw);
  2982. }
  2983. }
  2984. } else ;
  2985. }
  2986. function resolveMergedOptions(instance) {
  2987. const base = instance.type;
  2988. const { mixins, extends: extendsOptions } = base;
  2989. const {
  2990. mixins: globalMixins,
  2991. optionsCache: cache,
  2992. config: { optionMergeStrategies }
  2993. } = instance.appContext;
  2994. const cached = cache.get(base);
  2995. let resolved;
  2996. if (cached) {
  2997. resolved = cached;
  2998. } else if (!globalMixins.length && !mixins && !extendsOptions) {
  2999. {
  3000. resolved = base;
  3001. }
  3002. } else {
  3003. resolved = {};
  3004. if (globalMixins.length) {
  3005. globalMixins.forEach(
  3006. (m) => mergeOptions(resolved, m, optionMergeStrategies, true)
  3007. );
  3008. }
  3009. mergeOptions(resolved, base, optionMergeStrategies);
  3010. }
  3011. if (shared.isObject(base)) {
  3012. cache.set(base, resolved);
  3013. }
  3014. return resolved;
  3015. }
  3016. function mergeOptions(to, from, strats, asMixin = false) {
  3017. const { mixins, extends: extendsOptions } = from;
  3018. if (extendsOptions) {
  3019. mergeOptions(to, extendsOptions, strats, true);
  3020. }
  3021. if (mixins) {
  3022. mixins.forEach(
  3023. (m) => mergeOptions(to, m, strats, true)
  3024. );
  3025. }
  3026. for (const key in from) {
  3027. if (asMixin && key === "expose") ; else {
  3028. const strat = internalOptionMergeStrats[key] || strats && strats[key];
  3029. to[key] = strat ? strat(to[key], from[key]) : from[key];
  3030. }
  3031. }
  3032. return to;
  3033. }
  3034. const internalOptionMergeStrats = {
  3035. data: mergeDataFn,
  3036. props: mergeEmitsOrPropsOptions,
  3037. emits: mergeEmitsOrPropsOptions,
  3038. // objects
  3039. methods: mergeObjectOptions,
  3040. computed: mergeObjectOptions,
  3041. // lifecycle
  3042. beforeCreate: mergeAsArray,
  3043. created: mergeAsArray,
  3044. beforeMount: mergeAsArray,
  3045. mounted: mergeAsArray,
  3046. beforeUpdate: mergeAsArray,
  3047. updated: mergeAsArray,
  3048. beforeDestroy: mergeAsArray,
  3049. beforeUnmount: mergeAsArray,
  3050. destroyed: mergeAsArray,
  3051. unmounted: mergeAsArray,
  3052. activated: mergeAsArray,
  3053. deactivated: mergeAsArray,
  3054. errorCaptured: mergeAsArray,
  3055. serverPrefetch: mergeAsArray,
  3056. // assets
  3057. components: mergeObjectOptions,
  3058. directives: mergeObjectOptions,
  3059. // watch
  3060. watch: mergeWatchOptions,
  3061. // provide / inject
  3062. provide: mergeDataFn,
  3063. inject: mergeInject
  3064. };
  3065. function mergeDataFn(to, from) {
  3066. if (!from) {
  3067. return to;
  3068. }
  3069. if (!to) {
  3070. return from;
  3071. }
  3072. return function mergedDataFn() {
  3073. return (shared.extend)(
  3074. shared.isFunction(to) ? to.call(this, this) : to,
  3075. shared.isFunction(from) ? from.call(this, this) : from
  3076. );
  3077. };
  3078. }
  3079. function mergeInject(to, from) {
  3080. return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
  3081. }
  3082. function normalizeInject(raw) {
  3083. if (shared.isArray(raw)) {
  3084. const res = {};
  3085. for (let i = 0; i < raw.length; i++) {
  3086. res[raw[i]] = raw[i];
  3087. }
  3088. return res;
  3089. }
  3090. return raw;
  3091. }
  3092. function mergeAsArray(to, from) {
  3093. return to ? [...new Set([].concat(to, from))] : from;
  3094. }
  3095. function mergeObjectOptions(to, from) {
  3096. return to ? shared.extend(/* @__PURE__ */ Object.create(null), to, from) : from;
  3097. }
  3098. function mergeEmitsOrPropsOptions(to, from) {
  3099. if (to) {
  3100. if (shared.isArray(to) && shared.isArray(from)) {
  3101. return [.../* @__PURE__ */ new Set([...to, ...from])];
  3102. }
  3103. return shared.extend(
  3104. /* @__PURE__ */ Object.create(null),
  3105. normalizePropsOrEmits(to),
  3106. normalizePropsOrEmits(from != null ? from : {})
  3107. );
  3108. } else {
  3109. return from;
  3110. }
  3111. }
  3112. function mergeWatchOptions(to, from) {
  3113. if (!to) return from;
  3114. if (!from) return to;
  3115. const merged = shared.extend(/* @__PURE__ */ Object.create(null), to);
  3116. for (const key in from) {
  3117. merged[key] = mergeAsArray(to[key], from[key]);
  3118. }
  3119. return merged;
  3120. }
  3121. function createAppContext() {
  3122. return {
  3123. app: null,
  3124. config: {
  3125. isNativeTag: shared.NO,
  3126. performance: false,
  3127. globalProperties: {},
  3128. optionMergeStrategies: {},
  3129. errorHandler: void 0,
  3130. warnHandler: void 0,
  3131. compilerOptions: {}
  3132. },
  3133. mixins: [],
  3134. components: {},
  3135. directives: {},
  3136. provides: /* @__PURE__ */ Object.create(null),
  3137. optionsCache: /* @__PURE__ */ new WeakMap(),
  3138. propsCache: /* @__PURE__ */ new WeakMap(),
  3139. emitsCache: /* @__PURE__ */ new WeakMap()
  3140. };
  3141. }
  3142. let uid$1 = 0;
  3143. function createAppAPI(render, hydrate) {
  3144. return function createApp(rootComponent, rootProps = null) {
  3145. if (!shared.isFunction(rootComponent)) {
  3146. rootComponent = shared.extend({}, rootComponent);
  3147. }
  3148. if (rootProps != null && !shared.isObject(rootProps)) {
  3149. rootProps = null;
  3150. }
  3151. const context = createAppContext();
  3152. const installedPlugins = /* @__PURE__ */ new WeakSet();
  3153. const pluginCleanupFns = [];
  3154. let isMounted = false;
  3155. const app = context.app = {
  3156. _uid: uid$1++,
  3157. _component: rootComponent,
  3158. _props: rootProps,
  3159. _container: null,
  3160. _context: context,
  3161. _instance: null,
  3162. version,
  3163. get config() {
  3164. return context.config;
  3165. },
  3166. set config(v) {
  3167. },
  3168. use(plugin, ...options) {
  3169. if (installedPlugins.has(plugin)) ; else if (plugin && shared.isFunction(plugin.install)) {
  3170. installedPlugins.add(plugin);
  3171. plugin.install(app, ...options);
  3172. } else if (shared.isFunction(plugin)) {
  3173. installedPlugins.add(plugin);
  3174. plugin(app, ...options);
  3175. } else ;
  3176. return app;
  3177. },
  3178. mixin(mixin) {
  3179. {
  3180. if (!context.mixins.includes(mixin)) {
  3181. context.mixins.push(mixin);
  3182. }
  3183. }
  3184. return app;
  3185. },
  3186. component(name, component) {
  3187. if (!component) {
  3188. return context.components[name];
  3189. }
  3190. context.components[name] = component;
  3191. return app;
  3192. },
  3193. directive(name, directive) {
  3194. if (!directive) {
  3195. return context.directives[name];
  3196. }
  3197. context.directives[name] = directive;
  3198. return app;
  3199. },
  3200. mount(rootContainer, isHydrate, namespace) {
  3201. if (!isMounted) {
  3202. const vnode = app._ceVNode || createVNode(rootComponent, rootProps);
  3203. vnode.appContext = context;
  3204. if (namespace === true) {
  3205. namespace = "svg";
  3206. } else if (namespace === false) {
  3207. namespace = void 0;
  3208. }
  3209. if (isHydrate && hydrate) {
  3210. hydrate(vnode, rootContainer);
  3211. } else {
  3212. render(vnode, rootContainer, namespace);
  3213. }
  3214. isMounted = true;
  3215. app._container = rootContainer;
  3216. rootContainer.__vue_app__ = app;
  3217. return getComponentPublicInstance(vnode.component);
  3218. }
  3219. },
  3220. onUnmount(cleanupFn) {
  3221. pluginCleanupFns.push(cleanupFn);
  3222. },
  3223. unmount() {
  3224. if (isMounted) {
  3225. callWithAsyncErrorHandling(
  3226. pluginCleanupFns,
  3227. app._instance,
  3228. 16
  3229. );
  3230. render(null, app._container);
  3231. delete app._container.__vue_app__;
  3232. }
  3233. },
  3234. provide(key, value) {
  3235. context.provides[key] = value;
  3236. return app;
  3237. },
  3238. runWithContext(fn) {
  3239. const lastApp = currentApp;
  3240. currentApp = app;
  3241. try {
  3242. return fn();
  3243. } finally {
  3244. currentApp = lastApp;
  3245. }
  3246. }
  3247. };
  3248. return app;
  3249. };
  3250. }
  3251. let currentApp = null;
  3252. function useModel(props, name, options = shared.EMPTY_OBJ) {
  3253. const i = getCurrentInstance();
  3254. const camelizedName = shared.camelize(name);
  3255. const hyphenatedName = shared.hyphenate(name);
  3256. const modifiers = getModelModifiers(props, camelizedName);
  3257. const res = reactivity.customRef((track, trigger) => {
  3258. let localValue;
  3259. let prevSetValue = shared.EMPTY_OBJ;
  3260. let prevEmittedValue;
  3261. watchSyncEffect(() => {
  3262. const propValue = props[camelizedName];
  3263. if (shared.hasChanged(localValue, propValue)) {
  3264. localValue = propValue;
  3265. trigger();
  3266. }
  3267. });
  3268. return {
  3269. get() {
  3270. track();
  3271. return options.get ? options.get(localValue) : localValue;
  3272. },
  3273. set(value) {
  3274. const emittedValue = options.set ? options.set(value) : value;
  3275. if (!shared.hasChanged(emittedValue, localValue) && !(prevSetValue !== shared.EMPTY_OBJ && shared.hasChanged(value, prevSetValue))) {
  3276. return;
  3277. }
  3278. const rawProps = i.vnode.props;
  3279. if (!(rawProps && // check if parent has passed v-model
  3280. (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps))) {
  3281. localValue = value;
  3282. trigger();
  3283. }
  3284. i.emit(`update:${name}`, emittedValue);
  3285. if (shared.hasChanged(value, emittedValue) && shared.hasChanged(value, prevSetValue) && !shared.hasChanged(emittedValue, prevEmittedValue)) {
  3286. trigger();
  3287. }
  3288. prevSetValue = value;
  3289. prevEmittedValue = emittedValue;
  3290. }
  3291. };
  3292. });
  3293. res[Symbol.iterator] = () => {
  3294. let i2 = 0;
  3295. return {
  3296. next() {
  3297. if (i2 < 2) {
  3298. return { value: i2++ ? modifiers || shared.EMPTY_OBJ : res, done: false };
  3299. } else {
  3300. return { done: true };
  3301. }
  3302. }
  3303. };
  3304. };
  3305. return res;
  3306. }
  3307. const getModelModifiers = (props, modelName) => {
  3308. return modelName === "modelValue" || modelName === "model-value" ? props.modelModifiers : props[`${modelName}Modifiers`] || props[`${shared.camelize(modelName)}Modifiers`] || props[`${shared.hyphenate(modelName)}Modifiers`];
  3309. };
  3310. function emit(instance, event, ...rawArgs) {
  3311. if (instance.isUnmounted) return;
  3312. const props = instance.vnode.props || shared.EMPTY_OBJ;
  3313. let args = rawArgs;
  3314. const isModelListener = event.startsWith("update:");
  3315. const modifiers = isModelListener && getModelModifiers(props, event.slice(7));
  3316. if (modifiers) {
  3317. if (modifiers.trim) {
  3318. args = rawArgs.map((a) => shared.isString(a) ? a.trim() : a);
  3319. }
  3320. if (modifiers.number) {
  3321. args = rawArgs.map(shared.looseToNumber);
  3322. }
  3323. }
  3324. let handlerName;
  3325. let handler = props[handlerName = shared.toHandlerKey(event)] || // also try camelCase event handler (#2249)
  3326. props[handlerName = shared.toHandlerKey(shared.camelize(event))];
  3327. if (!handler && isModelListener) {
  3328. handler = props[handlerName = shared.toHandlerKey(shared.hyphenate(event))];
  3329. }
  3330. if (handler) {
  3331. callWithAsyncErrorHandling(
  3332. handler,
  3333. instance,
  3334. 6,
  3335. args
  3336. );
  3337. }
  3338. const onceHandler = props[handlerName + `Once`];
  3339. if (onceHandler) {
  3340. if (!instance.emitted) {
  3341. instance.emitted = {};
  3342. } else if (instance.emitted[handlerName]) {
  3343. return;
  3344. }
  3345. instance.emitted[handlerName] = true;
  3346. callWithAsyncErrorHandling(
  3347. onceHandler,
  3348. instance,
  3349. 6,
  3350. args
  3351. );
  3352. }
  3353. }
  3354. const mixinEmitsCache = /* @__PURE__ */ new WeakMap();
  3355. function normalizeEmitsOptions(comp, appContext, asMixin = false) {
  3356. const cache = asMixin ? mixinEmitsCache : appContext.emitsCache;
  3357. const cached = cache.get(comp);
  3358. if (cached !== void 0) {
  3359. return cached;
  3360. }
  3361. const raw = comp.emits;
  3362. let normalized = {};
  3363. let hasExtends = false;
  3364. if (!shared.isFunction(comp)) {
  3365. const extendEmits = (raw2) => {
  3366. const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
  3367. if (normalizedFromExtend) {
  3368. hasExtends = true;
  3369. shared.extend(normalized, normalizedFromExtend);
  3370. }
  3371. };
  3372. if (!asMixin && appContext.mixins.length) {
  3373. appContext.mixins.forEach(extendEmits);
  3374. }
  3375. if (comp.extends) {
  3376. extendEmits(comp.extends);
  3377. }
  3378. if (comp.mixins) {
  3379. comp.mixins.forEach(extendEmits);
  3380. }
  3381. }
  3382. if (!raw && !hasExtends) {
  3383. if (shared.isObject(comp)) {
  3384. cache.set(comp, null);
  3385. }
  3386. return null;
  3387. }
  3388. if (shared.isArray(raw)) {
  3389. raw.forEach((key) => normalized[key] = null);
  3390. } else {
  3391. shared.extend(normalized, raw);
  3392. }
  3393. if (shared.isObject(comp)) {
  3394. cache.set(comp, normalized);
  3395. }
  3396. return normalized;
  3397. }
  3398. function isEmitListener(options, key) {
  3399. if (!options || !shared.isOn(key)) {
  3400. return false;
  3401. }
  3402. key = key.slice(2).replace(/Once$/, "");
  3403. return shared.hasOwn(options, key[0].toLowerCase() + key.slice(1)) || shared.hasOwn(options, shared.hyphenate(key)) || shared.hasOwn(options, key);
  3404. }
  3405. function markAttrsAccessed() {
  3406. }
  3407. function renderComponentRoot(instance) {
  3408. const {
  3409. type: Component,
  3410. vnode,
  3411. proxy,
  3412. withProxy,
  3413. propsOptions: [propsOptions],
  3414. slots,
  3415. attrs,
  3416. emit,
  3417. render,
  3418. renderCache,
  3419. props,
  3420. data,
  3421. setupState,
  3422. ctx,
  3423. inheritAttrs
  3424. } = instance;
  3425. const prev = setCurrentRenderingInstance(instance);
  3426. let result;
  3427. let fallthroughAttrs;
  3428. try {
  3429. if (vnode.shapeFlag & 4) {
  3430. const proxyToUse = withProxy || proxy;
  3431. const thisProxy = false ? new Proxy(proxyToUse, {
  3432. get(target, key, receiver) {
  3433. warn(
  3434. `Property '${String(
  3435. key
  3436. )}' was accessed via 'this'. Avoid using 'this' in templates.`
  3437. );
  3438. return Reflect.get(target, key, receiver);
  3439. }
  3440. }) : proxyToUse;
  3441. result = normalizeVNode(
  3442. render.call(
  3443. thisProxy,
  3444. proxyToUse,
  3445. renderCache,
  3446. false ? shallowReadonly(props) : props,
  3447. setupState,
  3448. data,
  3449. ctx
  3450. )
  3451. );
  3452. fallthroughAttrs = attrs;
  3453. } else {
  3454. const render2 = Component;
  3455. if (false) ;
  3456. result = normalizeVNode(
  3457. render2.length > 1 ? render2(
  3458. false ? shallowReadonly(props) : props,
  3459. false ? {
  3460. get attrs() {
  3461. markAttrsAccessed();
  3462. return shallowReadonly(attrs);
  3463. },
  3464. slots,
  3465. emit
  3466. } : { attrs, slots, emit }
  3467. ) : render2(
  3468. false ? shallowReadonly(props) : props,
  3469. null
  3470. )
  3471. );
  3472. fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs);
  3473. }
  3474. } catch (err) {
  3475. blockStack.length = 0;
  3476. handleError(err, instance, 1);
  3477. result = createVNode(Comment);
  3478. }
  3479. let root = result;
  3480. if (fallthroughAttrs && inheritAttrs !== false) {
  3481. const keys = Object.keys(fallthroughAttrs);
  3482. const { shapeFlag } = root;
  3483. if (keys.length) {
  3484. if (shapeFlag & (1 | 6)) {
  3485. if (propsOptions && keys.some(shared.isModelListener)) {
  3486. fallthroughAttrs = filterModelListeners(
  3487. fallthroughAttrs,
  3488. propsOptions
  3489. );
  3490. }
  3491. root = cloneVNode(root, fallthroughAttrs, false, true);
  3492. }
  3493. }
  3494. }
  3495. if (vnode.dirs) {
  3496. root = cloneVNode(root, null, false, true);
  3497. root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
  3498. }
  3499. if (vnode.transition) {
  3500. setTransitionHooks(root, vnode.transition);
  3501. }
  3502. {
  3503. result = root;
  3504. }
  3505. setCurrentRenderingInstance(prev);
  3506. return result;
  3507. }
  3508. function filterSingleRoot(children, recurse = true) {
  3509. let singleRoot;
  3510. for (let i = 0; i < children.length; i++) {
  3511. const child = children[i];
  3512. if (isVNode(child)) {
  3513. if (child.type !== Comment || child.children === "v-if") {
  3514. if (singleRoot) {
  3515. return;
  3516. } else {
  3517. singleRoot = child;
  3518. }
  3519. }
  3520. } else {
  3521. return;
  3522. }
  3523. }
  3524. return singleRoot;
  3525. }
  3526. const getFunctionalFallthrough = (attrs) => {
  3527. let res;
  3528. for (const key in attrs) {
  3529. if (key === "class" || key === "style" || shared.isOn(key)) {
  3530. (res || (res = {}))[key] = attrs[key];
  3531. }
  3532. }
  3533. return res;
  3534. };
  3535. const filterModelListeners = (attrs, props) => {
  3536. const res = {};
  3537. for (const key in attrs) {
  3538. if (!shared.isModelListener(key) || !(key.slice(9) in props)) {
  3539. res[key] = attrs[key];
  3540. }
  3541. }
  3542. return res;
  3543. };
  3544. function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
  3545. const { props: prevProps, children: prevChildren, component } = prevVNode;
  3546. const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;
  3547. const emits = component.emitsOptions;
  3548. if (nextVNode.dirs || nextVNode.transition) {
  3549. return true;
  3550. }
  3551. if (optimized && patchFlag >= 0) {
  3552. if (patchFlag & 1024) {
  3553. return true;
  3554. }
  3555. if (patchFlag & 16) {
  3556. if (!prevProps) {
  3557. return !!nextProps;
  3558. }
  3559. return hasPropsChanged(prevProps, nextProps, emits);
  3560. } else if (patchFlag & 8) {
  3561. const dynamicProps = nextVNode.dynamicProps;
  3562. for (let i = 0; i < dynamicProps.length; i++) {
  3563. const key = dynamicProps[i];
  3564. if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emits, key)) {
  3565. return true;
  3566. }
  3567. }
  3568. }
  3569. } else {
  3570. if (prevChildren || nextChildren) {
  3571. if (!nextChildren || !nextChildren.$stable) {
  3572. return true;
  3573. }
  3574. }
  3575. if (prevProps === nextProps) {
  3576. return false;
  3577. }
  3578. if (!prevProps) {
  3579. return !!nextProps;
  3580. }
  3581. if (!nextProps) {
  3582. return true;
  3583. }
  3584. return hasPropsChanged(prevProps, nextProps, emits);
  3585. }
  3586. return false;
  3587. }
  3588. function hasPropsChanged(prevProps, nextProps, emitsOptions) {
  3589. const nextKeys = Object.keys(nextProps);
  3590. if (nextKeys.length !== Object.keys(prevProps).length) {
  3591. return true;
  3592. }
  3593. for (let i = 0; i < nextKeys.length; i++) {
  3594. const key = nextKeys[i];
  3595. if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) {
  3596. return true;
  3597. }
  3598. }
  3599. return false;
  3600. }
  3601. function hasPropValueChanged(nextProps, prevProps, key) {
  3602. const nextProp = nextProps[key];
  3603. const prevProp = prevProps[key];
  3604. if (key === "style" && shared.isObject(nextProp) && shared.isObject(prevProp)) {
  3605. return !shared.looseEqual(nextProp, prevProp);
  3606. }
  3607. return nextProp !== prevProp;
  3608. }
  3609. function updateHOCHostEl({ vnode, parent, suspense }, el) {
  3610. while (parent) {
  3611. const root = parent.subTree;
  3612. if (root.suspense && root.suspense.activeBranch === vnode) {
  3613. root.suspense.vnode.el = root.el = el;
  3614. vnode = root;
  3615. }
  3616. if (root === vnode) {
  3617. (vnode = parent.vnode).el = el;
  3618. parent = parent.parent;
  3619. } else {
  3620. break;
  3621. }
  3622. }
  3623. if (suspense && suspense.activeBranch === vnode) {
  3624. suspense.vnode.el = el;
  3625. }
  3626. }
  3627. const internalObjectProto = {};
  3628. const createInternalObject = () => Object.create(internalObjectProto);
  3629. const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
  3630. function initProps(instance, rawProps, isStateful, isSSR = false) {
  3631. const props = {};
  3632. const attrs = createInternalObject();
  3633. instance.propsDefaults = /* @__PURE__ */ Object.create(null);
  3634. setFullProps(instance, rawProps, props, attrs);
  3635. for (const key in instance.propsOptions[0]) {
  3636. if (!(key in props)) {
  3637. props[key] = void 0;
  3638. }
  3639. }
  3640. if (isStateful) {
  3641. instance.props = isSSR ? props : reactivity.shallowReactive(props);
  3642. } else {
  3643. if (!instance.type.props) {
  3644. instance.props = attrs;
  3645. } else {
  3646. instance.props = props;
  3647. }
  3648. }
  3649. instance.attrs = attrs;
  3650. }
  3651. function updateProps(instance, rawProps, rawPrevProps, optimized) {
  3652. const {
  3653. props,
  3654. attrs,
  3655. vnode: { patchFlag }
  3656. } = instance;
  3657. const rawCurrentProps = reactivity.toRaw(props);
  3658. const [options] = instance.propsOptions;
  3659. let hasAttrsChanged = false;
  3660. if (
  3661. // always force full diff in dev
  3662. // - #1942 if hmr is enabled with sfc component
  3663. // - vite#872 non-sfc component used by sfc component
  3664. (optimized || patchFlag > 0) && !(patchFlag & 16)
  3665. ) {
  3666. if (patchFlag & 8) {
  3667. const propsToUpdate = instance.vnode.dynamicProps;
  3668. for (let i = 0; i < propsToUpdate.length; i++) {
  3669. let key = propsToUpdate[i];
  3670. if (isEmitListener(instance.emitsOptions, key)) {
  3671. continue;
  3672. }
  3673. const value = rawProps[key];
  3674. if (options) {
  3675. if (shared.hasOwn(attrs, key)) {
  3676. if (value !== attrs[key]) {
  3677. attrs[key] = value;
  3678. hasAttrsChanged = true;
  3679. }
  3680. } else {
  3681. const camelizedKey = shared.camelize(key);
  3682. props[camelizedKey] = resolvePropValue(
  3683. options,
  3684. rawCurrentProps,
  3685. camelizedKey,
  3686. value,
  3687. instance,
  3688. false
  3689. );
  3690. }
  3691. } else {
  3692. if (value !== attrs[key]) {
  3693. attrs[key] = value;
  3694. hasAttrsChanged = true;
  3695. }
  3696. }
  3697. }
  3698. }
  3699. } else {
  3700. if (setFullProps(instance, rawProps, props, attrs)) {
  3701. hasAttrsChanged = true;
  3702. }
  3703. let kebabKey;
  3704. for (const key in rawCurrentProps) {
  3705. if (!rawProps || // for camelCase
  3706. !shared.hasOwn(rawProps, key) && // it's possible the original props was passed in as kebab-case
  3707. // and converted to camelCase (#955)
  3708. ((kebabKey = shared.hyphenate(key)) === key || !shared.hasOwn(rawProps, kebabKey))) {
  3709. if (options) {
  3710. if (rawPrevProps && // for camelCase
  3711. (rawPrevProps[key] !== void 0 || // for kebab-case
  3712. rawPrevProps[kebabKey] !== void 0)) {
  3713. props[key] = resolvePropValue(
  3714. options,
  3715. rawCurrentProps,
  3716. key,
  3717. void 0,
  3718. instance,
  3719. true
  3720. );
  3721. }
  3722. } else {
  3723. delete props[key];
  3724. }
  3725. }
  3726. }
  3727. if (attrs !== rawCurrentProps) {
  3728. for (const key in attrs) {
  3729. if (!rawProps || !shared.hasOwn(rawProps, key) && true) {
  3730. delete attrs[key];
  3731. hasAttrsChanged = true;
  3732. }
  3733. }
  3734. }
  3735. }
  3736. if (hasAttrsChanged) {
  3737. reactivity.trigger(instance.attrs, "set", "");
  3738. }
  3739. }
  3740. function setFullProps(instance, rawProps, props, attrs) {
  3741. const [options, needCastKeys] = instance.propsOptions;
  3742. let hasAttrsChanged = false;
  3743. let rawCastValues;
  3744. if (rawProps) {
  3745. for (let key in rawProps) {
  3746. if (shared.isReservedProp(key)) {
  3747. continue;
  3748. }
  3749. const value = rawProps[key];
  3750. let camelKey;
  3751. if (options && shared.hasOwn(options, camelKey = shared.camelize(key))) {
  3752. if (!needCastKeys || !needCastKeys.includes(camelKey)) {
  3753. props[camelKey] = value;
  3754. } else {
  3755. (rawCastValues || (rawCastValues = {}))[camelKey] = value;
  3756. }
  3757. } else if (!isEmitListener(instance.emitsOptions, key)) {
  3758. if (!(key in attrs) || value !== attrs[key]) {
  3759. attrs[key] = value;
  3760. hasAttrsChanged = true;
  3761. }
  3762. }
  3763. }
  3764. }
  3765. if (needCastKeys) {
  3766. const rawCurrentProps = reactivity.toRaw(props);
  3767. const castValues = rawCastValues || shared.EMPTY_OBJ;
  3768. for (let i = 0; i < needCastKeys.length; i++) {
  3769. const key = needCastKeys[i];
  3770. props[key] = resolvePropValue(
  3771. options,
  3772. rawCurrentProps,
  3773. key,
  3774. castValues[key],
  3775. instance,
  3776. !shared.hasOwn(castValues, key)
  3777. );
  3778. }
  3779. }
  3780. return hasAttrsChanged;
  3781. }
  3782. function resolvePropValue(options, props, key, value, instance, isAbsent) {
  3783. const opt = options[key];
  3784. if (opt != null) {
  3785. const hasDefault = shared.hasOwn(opt, "default");
  3786. if (hasDefault && value === void 0) {
  3787. const defaultValue = opt.default;
  3788. if (opt.type !== Function && !opt.skipFactory && shared.isFunction(defaultValue)) {
  3789. const { propsDefaults } = instance;
  3790. if (key in propsDefaults) {
  3791. value = propsDefaults[key];
  3792. } else {
  3793. const reset = setCurrentInstance(instance);
  3794. value = propsDefaults[key] = defaultValue.call(
  3795. null,
  3796. props
  3797. );
  3798. reset();
  3799. }
  3800. } else {
  3801. value = defaultValue;
  3802. }
  3803. if (instance.ce) {
  3804. instance.ce._setProp(key, value);
  3805. }
  3806. }
  3807. if (opt[0 /* shouldCast */]) {
  3808. if (isAbsent && !hasDefault) {
  3809. value = false;
  3810. } else if (opt[1 /* shouldCastTrue */] && (value === "" || value === shared.hyphenate(key))) {
  3811. value = true;
  3812. }
  3813. }
  3814. }
  3815. return value;
  3816. }
  3817. const mixinPropsCache = /* @__PURE__ */ new WeakMap();
  3818. function normalizePropsOptions(comp, appContext, asMixin = false) {
  3819. const cache = asMixin ? mixinPropsCache : appContext.propsCache;
  3820. const cached = cache.get(comp);
  3821. if (cached) {
  3822. return cached;
  3823. }
  3824. const raw = comp.props;
  3825. const normalized = {};
  3826. const needCastKeys = [];
  3827. let hasExtends = false;
  3828. if (!shared.isFunction(comp)) {
  3829. const extendProps = (raw2) => {
  3830. hasExtends = true;
  3831. const [props, keys] = normalizePropsOptions(raw2, appContext, true);
  3832. shared.extend(normalized, props);
  3833. if (keys) needCastKeys.push(...keys);
  3834. };
  3835. if (!asMixin && appContext.mixins.length) {
  3836. appContext.mixins.forEach(extendProps);
  3837. }
  3838. if (comp.extends) {
  3839. extendProps(comp.extends);
  3840. }
  3841. if (comp.mixins) {
  3842. comp.mixins.forEach(extendProps);
  3843. }
  3844. }
  3845. if (!raw && !hasExtends) {
  3846. if (shared.isObject(comp)) {
  3847. cache.set(comp, shared.EMPTY_ARR);
  3848. }
  3849. return shared.EMPTY_ARR;
  3850. }
  3851. if (shared.isArray(raw)) {
  3852. for (let i = 0; i < raw.length; i++) {
  3853. const normalizedKey = shared.camelize(raw[i]);
  3854. if (validatePropName(normalizedKey)) {
  3855. normalized[normalizedKey] = shared.EMPTY_OBJ;
  3856. }
  3857. }
  3858. } else if (raw) {
  3859. for (const key in raw) {
  3860. const normalizedKey = shared.camelize(key);
  3861. if (validatePropName(normalizedKey)) {
  3862. const opt = raw[key];
  3863. const prop = normalized[normalizedKey] = shared.isArray(opt) || shared.isFunction(opt) ? { type: opt } : shared.extend({}, opt);
  3864. const propType = prop.type;
  3865. let shouldCast = false;
  3866. let shouldCastTrue = true;
  3867. if (shared.isArray(propType)) {
  3868. for (let index = 0; index < propType.length; ++index) {
  3869. const type = propType[index];
  3870. const typeName = shared.isFunction(type) && type.name;
  3871. if (typeName === "Boolean") {
  3872. shouldCast = true;
  3873. break;
  3874. } else if (typeName === "String") {
  3875. shouldCastTrue = false;
  3876. }
  3877. }
  3878. } else {
  3879. shouldCast = shared.isFunction(propType) && propType.name === "Boolean";
  3880. }
  3881. prop[0 /* shouldCast */] = shouldCast;
  3882. prop[1 /* shouldCastTrue */] = shouldCastTrue;
  3883. if (shouldCast || shared.hasOwn(prop, "default")) {
  3884. needCastKeys.push(normalizedKey);
  3885. }
  3886. }
  3887. }
  3888. }
  3889. const res = [normalized, needCastKeys];
  3890. if (shared.isObject(comp)) {
  3891. cache.set(comp, res);
  3892. }
  3893. return res;
  3894. }
  3895. function validatePropName(key) {
  3896. if (key[0] !== "$" && !shared.isReservedProp(key)) {
  3897. return true;
  3898. }
  3899. return false;
  3900. }
  3901. const isInternalKey = (key) => key === "_" || key === "_ctx" || key === "$stable";
  3902. const normalizeSlotValue = (value) => shared.isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
  3903. const normalizeSlot = (key, rawSlot, ctx) => {
  3904. if (rawSlot._n) {
  3905. return rawSlot;
  3906. }
  3907. const normalized = withCtx((...args) => {
  3908. if (false) ;
  3909. return normalizeSlotValue(rawSlot(...args));
  3910. }, ctx);
  3911. normalized._c = false;
  3912. return normalized;
  3913. };
  3914. const normalizeObjectSlots = (rawSlots, slots, instance) => {
  3915. const ctx = rawSlots._ctx;
  3916. for (const key in rawSlots) {
  3917. if (isInternalKey(key)) continue;
  3918. const value = rawSlots[key];
  3919. if (shared.isFunction(value)) {
  3920. slots[key] = normalizeSlot(key, value, ctx);
  3921. } else if (value != null) {
  3922. const normalized = normalizeSlotValue(value);
  3923. slots[key] = () => normalized;
  3924. }
  3925. }
  3926. };
  3927. const normalizeVNodeSlots = (instance, children) => {
  3928. const normalized = normalizeSlotValue(children);
  3929. instance.slots.default = () => normalized;
  3930. };
  3931. const assignSlots = (slots, children, optimized) => {
  3932. for (const key in children) {
  3933. if (optimized || !isInternalKey(key)) {
  3934. slots[key] = children[key];
  3935. }
  3936. }
  3937. };
  3938. const initSlots = (instance, children, optimized) => {
  3939. const slots = instance.slots = createInternalObject();
  3940. if (instance.vnode.shapeFlag & 32) {
  3941. const type = children._;
  3942. if (type) {
  3943. assignSlots(slots, children, optimized);
  3944. if (optimized) {
  3945. shared.def(slots, "_", type, true);
  3946. }
  3947. } else {
  3948. normalizeObjectSlots(children, slots);
  3949. }
  3950. } else if (children) {
  3951. normalizeVNodeSlots(instance, children);
  3952. }
  3953. };
  3954. const updateSlots = (instance, children, optimized) => {
  3955. const { vnode, slots } = instance;
  3956. let needDeletionCheck = true;
  3957. let deletionComparisonTarget = shared.EMPTY_OBJ;
  3958. if (vnode.shapeFlag & 32) {
  3959. const type = children._;
  3960. if (type) {
  3961. if (optimized && type === 1) {
  3962. needDeletionCheck = false;
  3963. } else {
  3964. assignSlots(slots, children, optimized);
  3965. }
  3966. } else {
  3967. needDeletionCheck = !children.$stable;
  3968. normalizeObjectSlots(children, slots);
  3969. }
  3970. deletionComparisonTarget = children;
  3971. } else if (children) {
  3972. normalizeVNodeSlots(instance, children);
  3973. deletionComparisonTarget = { default: 1 };
  3974. }
  3975. if (needDeletionCheck) {
  3976. for (const key in slots) {
  3977. if (!isInternalKey(key) && deletionComparisonTarget[key] == null) {
  3978. delete slots[key];
  3979. }
  3980. }
  3981. }
  3982. };
  3983. const queuePostRenderEffect = queueEffectWithSuspense ;
  3984. function createRenderer(options) {
  3985. return baseCreateRenderer(options);
  3986. }
  3987. function createHydrationRenderer(options) {
  3988. return baseCreateRenderer(options, createHydrationFunctions);
  3989. }
  3990. function baseCreateRenderer(options, createHydrationFns) {
  3991. const target = shared.getGlobalThis();
  3992. target.__VUE__ = true;
  3993. const {
  3994. insert: hostInsert,
  3995. remove: hostRemove,
  3996. patchProp: hostPatchProp,
  3997. createElement: hostCreateElement,
  3998. createText: hostCreateText,
  3999. createComment: hostCreateComment,
  4000. setText: hostSetText,
  4001. setElementText: hostSetElementText,
  4002. parentNode: hostParentNode,
  4003. nextSibling: hostNextSibling,
  4004. setScopeId: hostSetScopeId = shared.NOOP,
  4005. insertStaticContent: hostInsertStaticContent
  4006. } = options;
  4007. const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = !!n2.dynamicChildren) => {
  4008. if (n1 === n2) {
  4009. return;
  4010. }
  4011. if (n1 && !isSameVNodeType(n1, n2)) {
  4012. anchor = getNextHostNode(n1);
  4013. unmount(n1, parentComponent, parentSuspense, true);
  4014. n1 = null;
  4015. }
  4016. if (n2.patchFlag === -2) {
  4017. optimized = false;
  4018. n2.dynamicChildren = null;
  4019. }
  4020. const { type, ref, shapeFlag } = n2;
  4021. switch (type) {
  4022. case Text:
  4023. processText(n1, n2, container, anchor);
  4024. break;
  4025. case Comment:
  4026. processCommentNode(n1, n2, container, anchor);
  4027. break;
  4028. case Static:
  4029. if (n1 == null) {
  4030. mountStaticNode(n2, container, anchor, namespace);
  4031. }
  4032. break;
  4033. case Fragment:
  4034. processFragment(
  4035. n1,
  4036. n2,
  4037. container,
  4038. anchor,
  4039. parentComponent,
  4040. parentSuspense,
  4041. namespace,
  4042. slotScopeIds,
  4043. optimized
  4044. );
  4045. break;
  4046. default:
  4047. if (shapeFlag & 1) {
  4048. processElement(
  4049. n1,
  4050. n2,
  4051. container,
  4052. anchor,
  4053. parentComponent,
  4054. parentSuspense,
  4055. namespace,
  4056. slotScopeIds,
  4057. optimized
  4058. );
  4059. } else if (shapeFlag & 6) {
  4060. processComponent(
  4061. n1,
  4062. n2,
  4063. container,
  4064. anchor,
  4065. parentComponent,
  4066. parentSuspense,
  4067. namespace,
  4068. slotScopeIds,
  4069. optimized
  4070. );
  4071. } else if (shapeFlag & 64) {
  4072. type.process(
  4073. n1,
  4074. n2,
  4075. container,
  4076. anchor,
  4077. parentComponent,
  4078. parentSuspense,
  4079. namespace,
  4080. slotScopeIds,
  4081. optimized,
  4082. internals
  4083. );
  4084. } else if (shapeFlag & 128) {
  4085. type.process(
  4086. n1,
  4087. n2,
  4088. container,
  4089. anchor,
  4090. parentComponent,
  4091. parentSuspense,
  4092. namespace,
  4093. slotScopeIds,
  4094. optimized,
  4095. internals
  4096. );
  4097. } else ;
  4098. }
  4099. if (ref != null && parentComponent) {
  4100. setRef(ref, n1 && n1.ref, parentSuspense, n2 || n1, !n2);
  4101. } else if (ref == null && n1 && n1.ref != null) {
  4102. setRef(n1.ref, null, parentSuspense, n1, true);
  4103. }
  4104. };
  4105. const processText = (n1, n2, container, anchor) => {
  4106. if (n1 == null) {
  4107. hostInsert(
  4108. n2.el = hostCreateText(n2.children),
  4109. container,
  4110. anchor
  4111. );
  4112. } else {
  4113. const el = n2.el = n1.el;
  4114. if (n2.children !== n1.children) {
  4115. hostSetText(el, n2.children);
  4116. }
  4117. }
  4118. };
  4119. const processCommentNode = (n1, n2, container, anchor) => {
  4120. if (n1 == null) {
  4121. hostInsert(
  4122. n2.el = hostCreateComment(n2.children || ""),
  4123. container,
  4124. anchor
  4125. );
  4126. } else {
  4127. n2.el = n1.el;
  4128. }
  4129. };
  4130. const mountStaticNode = (n2, container, anchor, namespace) => {
  4131. [n2.el, n2.anchor] = hostInsertStaticContent(
  4132. n2.children,
  4133. container,
  4134. anchor,
  4135. namespace,
  4136. n2.el,
  4137. n2.anchor
  4138. );
  4139. };
  4140. const moveStaticNode = ({ el, anchor }, container, nextSibling) => {
  4141. let next;
  4142. while (el && el !== anchor) {
  4143. next = hostNextSibling(el);
  4144. hostInsert(el, container, nextSibling);
  4145. el = next;
  4146. }
  4147. hostInsert(anchor, container, nextSibling);
  4148. };
  4149. const removeStaticNode = ({ el, anchor }) => {
  4150. let next;
  4151. while (el && el !== anchor) {
  4152. next = hostNextSibling(el);
  4153. hostRemove(el);
  4154. el = next;
  4155. }
  4156. hostRemove(anchor);
  4157. };
  4158. const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  4159. if (n2.type === "svg") {
  4160. namespace = "svg";
  4161. } else if (n2.type === "math") {
  4162. namespace = "mathml";
  4163. }
  4164. if (n1 == null) {
  4165. mountElement(
  4166. n2,
  4167. container,
  4168. anchor,
  4169. parentComponent,
  4170. parentSuspense,
  4171. namespace,
  4172. slotScopeIds,
  4173. optimized
  4174. );
  4175. } else {
  4176. const customElement = n1.el && n1.el._isVueCE ? n1.el : null;
  4177. try {
  4178. if (customElement) {
  4179. customElement._beginPatch();
  4180. }
  4181. patchElement(
  4182. n1,
  4183. n2,
  4184. parentComponent,
  4185. parentSuspense,
  4186. namespace,
  4187. slotScopeIds,
  4188. optimized
  4189. );
  4190. } finally {
  4191. if (customElement) {
  4192. customElement._endPatch();
  4193. }
  4194. }
  4195. }
  4196. };
  4197. const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  4198. let el;
  4199. let vnodeHook;
  4200. const { props, shapeFlag, transition, dirs } = vnode;
  4201. el = vnode.el = hostCreateElement(
  4202. vnode.type,
  4203. namespace,
  4204. props && props.is,
  4205. props
  4206. );
  4207. if (shapeFlag & 8) {
  4208. hostSetElementText(el, vnode.children);
  4209. } else if (shapeFlag & 16) {
  4210. mountChildren(
  4211. vnode.children,
  4212. el,
  4213. null,
  4214. parentComponent,
  4215. parentSuspense,
  4216. resolveChildrenNamespace(vnode, namespace),
  4217. slotScopeIds,
  4218. optimized
  4219. );
  4220. }
  4221. if (dirs) {
  4222. invokeDirectiveHook(vnode, null, parentComponent, "created");
  4223. }
  4224. setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
  4225. if (props) {
  4226. for (const key in props) {
  4227. if (key !== "value" && !shared.isReservedProp(key)) {
  4228. hostPatchProp(el, key, null, props[key], namespace, parentComponent);
  4229. }
  4230. }
  4231. if ("value" in props) {
  4232. hostPatchProp(el, "value", null, props.value, namespace);
  4233. }
  4234. if (vnodeHook = props.onVnodeBeforeMount) {
  4235. invokeVNodeHook(vnodeHook, parentComponent, vnode);
  4236. }
  4237. }
  4238. if (dirs) {
  4239. invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
  4240. }
  4241. const needCallTransitionHooks = needTransition(parentSuspense, transition);
  4242. if (needCallTransitionHooks) {
  4243. transition.beforeEnter(el);
  4244. }
  4245. hostInsert(el, container, anchor);
  4246. if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
  4247. queuePostRenderEffect(() => {
  4248. try {
  4249. vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
  4250. needCallTransitionHooks && transition.enter(el);
  4251. dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
  4252. } finally {
  4253. }
  4254. }, parentSuspense);
  4255. }
  4256. };
  4257. const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => {
  4258. if (scopeId) {
  4259. hostSetScopeId(el, scopeId);
  4260. }
  4261. if (slotScopeIds) {
  4262. for (let i = 0; i < slotScopeIds.length; i++) {
  4263. hostSetScopeId(el, slotScopeIds[i]);
  4264. }
  4265. }
  4266. if (parentComponent) {
  4267. let subTree = parentComponent.subTree;
  4268. if (vnode === subTree || isSuspense(subTree.type) && (subTree.ssContent === vnode || subTree.ssFallback === vnode)) {
  4269. const parentVNode = parentComponent.vnode;
  4270. setScopeId(
  4271. el,
  4272. parentVNode,
  4273. parentVNode.scopeId,
  4274. parentVNode.slotScopeIds,
  4275. parentComponent.parent
  4276. );
  4277. }
  4278. }
  4279. };
  4280. const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
  4281. for (let i = start; i < children.length; i++) {
  4282. const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
  4283. patch(
  4284. null,
  4285. child,
  4286. container,
  4287. anchor,
  4288. parentComponent,
  4289. parentSuspense,
  4290. namespace,
  4291. slotScopeIds,
  4292. optimized
  4293. );
  4294. }
  4295. };
  4296. const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  4297. const el = n2.el = n1.el;
  4298. let { patchFlag, dynamicChildren, dirs } = n2;
  4299. patchFlag |= n1.patchFlag & 16;
  4300. const oldProps = n1.props || shared.EMPTY_OBJ;
  4301. const newProps = n2.props || shared.EMPTY_OBJ;
  4302. let vnodeHook;
  4303. parentComponent && toggleRecurse(parentComponent, false);
  4304. if (vnodeHook = newProps.onVnodeBeforeUpdate) {
  4305. invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
  4306. }
  4307. if (dirs) {
  4308. invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
  4309. }
  4310. parentComponent && toggleRecurse(parentComponent, true);
  4311. if (oldProps.innerHTML && newProps.innerHTML == null || oldProps.textContent && newProps.textContent == null) {
  4312. hostSetElementText(el, "");
  4313. }
  4314. if (dynamicChildren) {
  4315. patchBlockChildren(
  4316. n1.dynamicChildren,
  4317. dynamicChildren,
  4318. el,
  4319. parentComponent,
  4320. parentSuspense,
  4321. resolveChildrenNamespace(n2, namespace),
  4322. slotScopeIds
  4323. );
  4324. } else if (!optimized) {
  4325. patchChildren(
  4326. n1,
  4327. n2,
  4328. el,
  4329. null,
  4330. parentComponent,
  4331. parentSuspense,
  4332. resolveChildrenNamespace(n2, namespace),
  4333. slotScopeIds,
  4334. false
  4335. );
  4336. }
  4337. if (patchFlag > 0) {
  4338. if (patchFlag & 16) {
  4339. patchProps(el, oldProps, newProps, parentComponent, namespace);
  4340. } else {
  4341. if (patchFlag & 2) {
  4342. if (oldProps.class !== newProps.class) {
  4343. hostPatchProp(el, "class", null, newProps.class, namespace);
  4344. }
  4345. }
  4346. if (patchFlag & 4) {
  4347. hostPatchProp(el, "style", oldProps.style, newProps.style, namespace);
  4348. }
  4349. if (patchFlag & 8) {
  4350. const propsToUpdate = n2.dynamicProps;
  4351. for (let i = 0; i < propsToUpdate.length; i++) {
  4352. const key = propsToUpdate[i];
  4353. const prev = oldProps[key];
  4354. const next = newProps[key];
  4355. if (next !== prev || key === "value") {
  4356. hostPatchProp(el, key, prev, next, namespace, parentComponent);
  4357. }
  4358. }
  4359. }
  4360. }
  4361. if (patchFlag & 1) {
  4362. if (n1.children !== n2.children) {
  4363. hostSetElementText(el, n2.children);
  4364. }
  4365. }
  4366. } else if (!optimized && dynamicChildren == null) {
  4367. patchProps(el, oldProps, newProps, parentComponent, namespace);
  4368. }
  4369. if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
  4370. queuePostRenderEffect(() => {
  4371. vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
  4372. dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
  4373. }, parentSuspense);
  4374. }
  4375. };
  4376. const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => {
  4377. for (let i = 0; i < newChildren.length; i++) {
  4378. const oldVNode = oldChildren[i];
  4379. const newVNode = newChildren[i];
  4380. const container = (
  4381. // oldVNode may be an errored async setup() component inside Suspense
  4382. // which will not have a mounted element
  4383. oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent
  4384. // of the Fragment itself so it can move its children.
  4385. (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement
  4386. // which also requires the correct parent container
  4387. !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.
  4388. oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldVNode.el) : (
  4389. // In other cases, the parent container is not actually used so we
  4390. // just pass the block element here to avoid a DOM parentNode call.
  4391. fallbackContainer
  4392. )
  4393. );
  4394. patch(
  4395. oldVNode,
  4396. newVNode,
  4397. container,
  4398. null,
  4399. parentComponent,
  4400. parentSuspense,
  4401. namespace,
  4402. slotScopeIds,
  4403. true
  4404. );
  4405. }
  4406. };
  4407. const patchProps = (el, oldProps, newProps, parentComponent, namespace) => {
  4408. if (oldProps !== newProps) {
  4409. if (oldProps !== shared.EMPTY_OBJ) {
  4410. for (const key in oldProps) {
  4411. if (!shared.isReservedProp(key) && !(key in newProps)) {
  4412. hostPatchProp(
  4413. el,
  4414. key,
  4415. oldProps[key],
  4416. null,
  4417. namespace,
  4418. parentComponent
  4419. );
  4420. }
  4421. }
  4422. }
  4423. for (const key in newProps) {
  4424. if (shared.isReservedProp(key)) continue;
  4425. const next = newProps[key];
  4426. const prev = oldProps[key];
  4427. if (next !== prev && key !== "value") {
  4428. hostPatchProp(el, key, prev, next, namespace, parentComponent);
  4429. }
  4430. }
  4431. if ("value" in newProps) {
  4432. hostPatchProp(el, "value", oldProps.value, newProps.value, namespace);
  4433. }
  4434. }
  4435. };
  4436. const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  4437. const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText("");
  4438. const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText("");
  4439. let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
  4440. if (fragmentSlotScopeIds) {
  4441. slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
  4442. }
  4443. if (n1 == null) {
  4444. hostInsert(fragmentStartAnchor, container, anchor);
  4445. hostInsert(fragmentEndAnchor, container, anchor);
  4446. mountChildren(
  4447. // #10007
  4448. // such fragment like `<></>` will be compiled into
  4449. // a fragment which doesn't have a children.
  4450. // In this case fallback to an empty array
  4451. n2.children || [],
  4452. container,
  4453. fragmentEndAnchor,
  4454. parentComponent,
  4455. parentSuspense,
  4456. namespace,
  4457. slotScopeIds,
  4458. optimized
  4459. );
  4460. } else {
  4461. if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result
  4462. // of renderSlot() with no valid children
  4463. n1.dynamicChildren && n1.dynamicChildren.length === dynamicChildren.length) {
  4464. patchBlockChildren(
  4465. n1.dynamicChildren,
  4466. dynamicChildren,
  4467. container,
  4468. parentComponent,
  4469. parentSuspense,
  4470. namespace,
  4471. slotScopeIds
  4472. );
  4473. if (
  4474. // #2080 if the stable fragment has a key, it's a <template v-for> that may
  4475. // get moved around. Make sure all root level vnodes inherit el.
  4476. // #2134 or if it's a component root, it may also get moved around
  4477. // as the component is being moved.
  4478. n2.key != null || parentComponent && n2 === parentComponent.subTree
  4479. ) {
  4480. traverseStaticChildren(
  4481. n1,
  4482. n2,
  4483. true
  4484. /* shallow */
  4485. );
  4486. }
  4487. } else {
  4488. patchChildren(
  4489. n1,
  4490. n2,
  4491. container,
  4492. fragmentEndAnchor,
  4493. parentComponent,
  4494. parentSuspense,
  4495. namespace,
  4496. slotScopeIds,
  4497. optimized
  4498. );
  4499. }
  4500. }
  4501. };
  4502. const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  4503. n2.slotScopeIds = slotScopeIds;
  4504. if (n1 == null) {
  4505. if (n2.shapeFlag & 512) {
  4506. parentComponent.ctx.activate(
  4507. n2,
  4508. container,
  4509. anchor,
  4510. namespace,
  4511. optimized
  4512. );
  4513. } else {
  4514. mountComponent(
  4515. n2,
  4516. container,
  4517. anchor,
  4518. parentComponent,
  4519. parentSuspense,
  4520. namespace,
  4521. optimized
  4522. );
  4523. }
  4524. } else {
  4525. updateComponent(n1, n2, optimized);
  4526. }
  4527. };
  4528. const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
  4529. const instance = (initialVNode.component = createComponentInstance(
  4530. initialVNode,
  4531. parentComponent,
  4532. parentSuspense
  4533. ));
  4534. if (isKeepAlive(initialVNode)) {
  4535. instance.ctx.renderer = internals;
  4536. }
  4537. {
  4538. setupComponent(instance, false, optimized);
  4539. }
  4540. if (instance.asyncDep) {
  4541. parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
  4542. if (!initialVNode.el) {
  4543. const placeholder = instance.subTree = createVNode(Comment);
  4544. processCommentNode(null, placeholder, container, anchor);
  4545. initialVNode.placeholder = placeholder.el;
  4546. }
  4547. } else {
  4548. setupRenderEffect(
  4549. instance,
  4550. initialVNode,
  4551. container,
  4552. anchor,
  4553. parentSuspense,
  4554. namespace,
  4555. optimized
  4556. );
  4557. }
  4558. };
  4559. const updateComponent = (n1, n2, optimized) => {
  4560. const instance = n2.component = n1.component;
  4561. if (shouldUpdateComponent(n1, n2, optimized)) {
  4562. if (instance.asyncDep && !instance.asyncResolved) {
  4563. updateComponentPreRender(instance, n2, optimized);
  4564. return;
  4565. } else {
  4566. instance.next = n2;
  4567. instance.update();
  4568. }
  4569. } else {
  4570. n2.el = n1.el;
  4571. instance.vnode = n2;
  4572. }
  4573. };
  4574. const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
  4575. const componentUpdateFn = () => {
  4576. if (!instance.isMounted) {
  4577. let vnodeHook;
  4578. const { el, props } = initialVNode;
  4579. const { bm, m, parent, root, type } = instance;
  4580. const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
  4581. toggleRecurse(instance, false);
  4582. if (bm) {
  4583. shared.invokeArrayFns(bm);
  4584. }
  4585. if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeBeforeMount)) {
  4586. invokeVNodeHook(vnodeHook, parent, initialVNode);
  4587. }
  4588. toggleRecurse(instance, true);
  4589. if (el && hydrateNode) {
  4590. const hydrateSubTree = () => {
  4591. instance.subTree = renderComponentRoot(instance);
  4592. hydrateNode(
  4593. el,
  4594. instance.subTree,
  4595. instance,
  4596. parentSuspense,
  4597. null
  4598. );
  4599. };
  4600. if (isAsyncWrapperVNode && type.__asyncHydrate) {
  4601. type.__asyncHydrate(
  4602. el,
  4603. instance,
  4604. hydrateSubTree
  4605. );
  4606. } else {
  4607. hydrateSubTree();
  4608. }
  4609. } else {
  4610. if (root.ce && root.ce._hasShadowRoot()) {
  4611. root.ce._injectChildStyle(
  4612. type,
  4613. instance.parent ? instance.parent.type : void 0
  4614. );
  4615. }
  4616. const subTree = instance.subTree = renderComponentRoot(instance);
  4617. patch(
  4618. null,
  4619. subTree,
  4620. container,
  4621. anchor,
  4622. instance,
  4623. parentSuspense,
  4624. namespace
  4625. );
  4626. initialVNode.el = subTree.el;
  4627. }
  4628. if (m) {
  4629. queuePostRenderEffect(m, parentSuspense);
  4630. }
  4631. if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) {
  4632. const scopedInitialVNode = initialVNode;
  4633. queuePostRenderEffect(
  4634. () => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode),
  4635. parentSuspense
  4636. );
  4637. }
  4638. if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) {
  4639. instance.a && queuePostRenderEffect(instance.a, parentSuspense);
  4640. }
  4641. instance.isMounted = true;
  4642. initialVNode = container = anchor = null;
  4643. } else {
  4644. let { next, bu, u, parent, vnode } = instance;
  4645. {
  4646. const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
  4647. if (nonHydratedAsyncRoot) {
  4648. if (next) {
  4649. next.el = vnode.el;
  4650. updateComponentPreRender(instance, next, optimized);
  4651. }
  4652. nonHydratedAsyncRoot.asyncDep.then(() => {
  4653. queuePostRenderEffect(() => {
  4654. if (!instance.isUnmounted) update();
  4655. }, parentSuspense);
  4656. });
  4657. return;
  4658. }
  4659. }
  4660. let originNext = next;
  4661. let vnodeHook;
  4662. toggleRecurse(instance, false);
  4663. if (next) {
  4664. next.el = vnode.el;
  4665. updateComponentPreRender(instance, next, optimized);
  4666. } else {
  4667. next = vnode;
  4668. }
  4669. if (bu) {
  4670. shared.invokeArrayFns(bu);
  4671. }
  4672. if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) {
  4673. invokeVNodeHook(vnodeHook, parent, next, vnode);
  4674. }
  4675. toggleRecurse(instance, true);
  4676. const nextTree = renderComponentRoot(instance);
  4677. const prevTree = instance.subTree;
  4678. instance.subTree = nextTree;
  4679. patch(
  4680. prevTree,
  4681. nextTree,
  4682. // parent may have changed if it's in a teleport
  4683. hostParentNode(prevTree.el),
  4684. // anchor may have changed if it's in a fragment
  4685. getNextHostNode(prevTree),
  4686. instance,
  4687. parentSuspense,
  4688. namespace
  4689. );
  4690. next.el = nextTree.el;
  4691. if (originNext === null) {
  4692. updateHOCHostEl(instance, nextTree.el);
  4693. }
  4694. if (u) {
  4695. queuePostRenderEffect(u, parentSuspense);
  4696. }
  4697. if (vnodeHook = next.props && next.props.onVnodeUpdated) {
  4698. queuePostRenderEffect(
  4699. () => invokeVNodeHook(vnodeHook, parent, next, vnode),
  4700. parentSuspense
  4701. );
  4702. }
  4703. }
  4704. };
  4705. instance.scope.on();
  4706. const effect = instance.effect = new reactivity.ReactiveEffect(componentUpdateFn);
  4707. instance.scope.off();
  4708. const update = instance.update = effect.run.bind(effect);
  4709. const job = instance.job = effect.runIfDirty.bind(effect);
  4710. job.i = instance;
  4711. job.id = instance.uid;
  4712. effect.scheduler = () => queueJob(job);
  4713. toggleRecurse(instance, true);
  4714. update();
  4715. };
  4716. const updateComponentPreRender = (instance, nextVNode, optimized) => {
  4717. nextVNode.component = instance;
  4718. const prevProps = instance.vnode.props;
  4719. instance.vnode = nextVNode;
  4720. instance.next = null;
  4721. updateProps(instance, nextVNode.props, prevProps, optimized);
  4722. updateSlots(instance, nextVNode.children, optimized);
  4723. reactivity.pauseTracking();
  4724. flushPreFlushCbs(instance);
  4725. reactivity.resetTracking();
  4726. };
  4727. const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => {
  4728. const c1 = n1 && n1.children;
  4729. const prevShapeFlag = n1 ? n1.shapeFlag : 0;
  4730. const c2 = n2.children;
  4731. const { patchFlag, shapeFlag } = n2;
  4732. if (patchFlag > 0) {
  4733. if (patchFlag & 128) {
  4734. patchKeyedChildren(
  4735. c1,
  4736. c2,
  4737. container,
  4738. anchor,
  4739. parentComponent,
  4740. parentSuspense,
  4741. namespace,
  4742. slotScopeIds,
  4743. optimized
  4744. );
  4745. return;
  4746. } else if (patchFlag & 256) {
  4747. patchUnkeyedChildren(
  4748. c1,
  4749. c2,
  4750. container,
  4751. anchor,
  4752. parentComponent,
  4753. parentSuspense,
  4754. namespace,
  4755. slotScopeIds,
  4756. optimized
  4757. );
  4758. return;
  4759. }
  4760. }
  4761. if (shapeFlag & 8) {
  4762. if (prevShapeFlag & 16) {
  4763. unmountChildren(c1, parentComponent, parentSuspense);
  4764. }
  4765. if (c2 !== c1) {
  4766. hostSetElementText(container, c2);
  4767. }
  4768. } else {
  4769. if (prevShapeFlag & 16) {
  4770. if (shapeFlag & 16) {
  4771. patchKeyedChildren(
  4772. c1,
  4773. c2,
  4774. container,
  4775. anchor,
  4776. parentComponent,
  4777. parentSuspense,
  4778. namespace,
  4779. slotScopeIds,
  4780. optimized
  4781. );
  4782. } else {
  4783. unmountChildren(c1, parentComponent, parentSuspense, true);
  4784. }
  4785. } else {
  4786. if (prevShapeFlag & 8) {
  4787. hostSetElementText(container, "");
  4788. }
  4789. if (shapeFlag & 16) {
  4790. mountChildren(
  4791. c2,
  4792. container,
  4793. anchor,
  4794. parentComponent,
  4795. parentSuspense,
  4796. namespace,
  4797. slotScopeIds,
  4798. optimized
  4799. );
  4800. }
  4801. }
  4802. }
  4803. };
  4804. const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  4805. c1 = c1 || shared.EMPTY_ARR;
  4806. c2 = c2 || shared.EMPTY_ARR;
  4807. const oldLength = c1.length;
  4808. const newLength = c2.length;
  4809. const commonLength = Math.min(oldLength, newLength);
  4810. let i;
  4811. for (i = 0; i < commonLength; i++) {
  4812. const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
  4813. patch(
  4814. c1[i],
  4815. nextChild,
  4816. container,
  4817. null,
  4818. parentComponent,
  4819. parentSuspense,
  4820. namespace,
  4821. slotScopeIds,
  4822. optimized
  4823. );
  4824. }
  4825. if (oldLength > newLength) {
  4826. unmountChildren(
  4827. c1,
  4828. parentComponent,
  4829. parentSuspense,
  4830. true,
  4831. false,
  4832. commonLength
  4833. );
  4834. } else {
  4835. mountChildren(
  4836. c2,
  4837. container,
  4838. anchor,
  4839. parentComponent,
  4840. parentSuspense,
  4841. namespace,
  4842. slotScopeIds,
  4843. optimized,
  4844. commonLength
  4845. );
  4846. }
  4847. };
  4848. const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  4849. let i = 0;
  4850. const l2 = c2.length;
  4851. let e1 = c1.length - 1;
  4852. let e2 = l2 - 1;
  4853. while (i <= e1 && i <= e2) {
  4854. const n1 = c1[i];
  4855. const n2 = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
  4856. if (isSameVNodeType(n1, n2)) {
  4857. patch(
  4858. n1,
  4859. n2,
  4860. container,
  4861. null,
  4862. parentComponent,
  4863. parentSuspense,
  4864. namespace,
  4865. slotScopeIds,
  4866. optimized
  4867. );
  4868. } else {
  4869. break;
  4870. }
  4871. i++;
  4872. }
  4873. while (i <= e1 && i <= e2) {
  4874. const n1 = c1[e1];
  4875. const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode(c2[e2]);
  4876. if (isSameVNodeType(n1, n2)) {
  4877. patch(
  4878. n1,
  4879. n2,
  4880. container,
  4881. null,
  4882. parentComponent,
  4883. parentSuspense,
  4884. namespace,
  4885. slotScopeIds,
  4886. optimized
  4887. );
  4888. } else {
  4889. break;
  4890. }
  4891. e1--;
  4892. e2--;
  4893. }
  4894. if (i > e1) {
  4895. if (i <= e2) {
  4896. const nextPos = e2 + 1;
  4897. const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor;
  4898. while (i <= e2) {
  4899. patch(
  4900. null,
  4901. c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]),
  4902. container,
  4903. anchor,
  4904. parentComponent,
  4905. parentSuspense,
  4906. namespace,
  4907. slotScopeIds,
  4908. optimized
  4909. );
  4910. i++;
  4911. }
  4912. }
  4913. } else if (i > e2) {
  4914. while (i <= e1) {
  4915. unmount(c1[i], parentComponent, parentSuspense, true);
  4916. i++;
  4917. }
  4918. } else {
  4919. const s1 = i;
  4920. const s2 = i;
  4921. const keyToNewIndexMap = /* @__PURE__ */ new Map();
  4922. for (i = s2; i <= e2; i++) {
  4923. const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
  4924. if (nextChild.key != null) {
  4925. keyToNewIndexMap.set(nextChild.key, i);
  4926. }
  4927. }
  4928. let j;
  4929. let patched = 0;
  4930. const toBePatched = e2 - s2 + 1;
  4931. let moved = false;
  4932. let maxNewIndexSoFar = 0;
  4933. const newIndexToOldIndexMap = new Array(toBePatched);
  4934. for (i = 0; i < toBePatched; i++) newIndexToOldIndexMap[i] = 0;
  4935. for (i = s1; i <= e1; i++) {
  4936. const prevChild = c1[i];
  4937. if (patched >= toBePatched) {
  4938. unmount(prevChild, parentComponent, parentSuspense, true);
  4939. continue;
  4940. }
  4941. let newIndex;
  4942. if (prevChild.key != null) {
  4943. newIndex = keyToNewIndexMap.get(prevChild.key);
  4944. } else {
  4945. for (j = s2; j <= e2; j++) {
  4946. if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) {
  4947. newIndex = j;
  4948. break;
  4949. }
  4950. }
  4951. }
  4952. if (newIndex === void 0) {
  4953. unmount(prevChild, parentComponent, parentSuspense, true);
  4954. } else {
  4955. newIndexToOldIndexMap[newIndex - s2] = i + 1;
  4956. if (newIndex >= maxNewIndexSoFar) {
  4957. maxNewIndexSoFar = newIndex;
  4958. } else {
  4959. moved = true;
  4960. }
  4961. patch(
  4962. prevChild,
  4963. c2[newIndex],
  4964. container,
  4965. null,
  4966. parentComponent,
  4967. parentSuspense,
  4968. namespace,
  4969. slotScopeIds,
  4970. optimized
  4971. );
  4972. patched++;
  4973. }
  4974. }
  4975. const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : shared.EMPTY_ARR;
  4976. j = increasingNewIndexSequence.length - 1;
  4977. for (i = toBePatched - 1; i >= 0; i--) {
  4978. const nextIndex = s2 + i;
  4979. const nextChild = c2[nextIndex];
  4980. const anchorVNode = c2[nextIndex + 1];
  4981. const anchor = nextIndex + 1 < l2 ? (
  4982. // #13559, #14173 fallback to el placeholder for unresolved async component
  4983. anchorVNode.el || resolveAsyncComponentPlaceholder(anchorVNode)
  4984. ) : parentAnchor;
  4985. if (newIndexToOldIndexMap[i] === 0) {
  4986. patch(
  4987. null,
  4988. nextChild,
  4989. container,
  4990. anchor,
  4991. parentComponent,
  4992. parentSuspense,
  4993. namespace,
  4994. slotScopeIds,
  4995. optimized
  4996. );
  4997. } else if (moved) {
  4998. if (j < 0 || i !== increasingNewIndexSequence[j]) {
  4999. move(nextChild, container, anchor, 2);
  5000. } else {
  5001. j--;
  5002. }
  5003. }
  5004. }
  5005. }
  5006. };
  5007. const move = (vnode, container, anchor, moveType, parentSuspense = null) => {
  5008. const { el, type, transition, children, shapeFlag } = vnode;
  5009. if (shapeFlag & 6) {
  5010. move(vnode.component.subTree, container, anchor, moveType);
  5011. return;
  5012. }
  5013. if (shapeFlag & 128) {
  5014. vnode.suspense.move(container, anchor, moveType);
  5015. return;
  5016. }
  5017. if (shapeFlag & 64) {
  5018. type.move(vnode, container, anchor, internals);
  5019. return;
  5020. }
  5021. if (type === Fragment) {
  5022. hostInsert(el, container, anchor);
  5023. for (let i = 0; i < children.length; i++) {
  5024. move(children[i], container, anchor, moveType);
  5025. }
  5026. hostInsert(vnode.anchor, container, anchor);
  5027. return;
  5028. }
  5029. if (type === Static) {
  5030. moveStaticNode(vnode, container, anchor);
  5031. return;
  5032. }
  5033. const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
  5034. if (needTransition2) {
  5035. if (moveType === 0) {
  5036. if (transition.persisted && !el[leaveCbKey]) {
  5037. hostInsert(el, container, anchor);
  5038. } else {
  5039. transition.beforeEnter(el);
  5040. hostInsert(el, container, anchor);
  5041. queuePostRenderEffect(() => transition.enter(el), parentSuspense);
  5042. }
  5043. } else {
  5044. const { leave, delayLeave, afterLeave } = transition;
  5045. const remove2 = () => {
  5046. if (vnode.ctx.isUnmounted) {
  5047. hostRemove(el);
  5048. } else {
  5049. hostInsert(el, container, anchor);
  5050. }
  5051. };
  5052. const performLeave = () => {
  5053. const wasLeaving = el._isLeaving || !!el[leaveCbKey];
  5054. if (el._isLeaving) {
  5055. el[leaveCbKey](
  5056. true
  5057. /* cancelled */
  5058. );
  5059. }
  5060. if (transition.persisted && !wasLeaving) {
  5061. remove2();
  5062. } else {
  5063. leave(el, () => {
  5064. remove2();
  5065. afterLeave && afterLeave();
  5066. });
  5067. }
  5068. };
  5069. if (delayLeave) {
  5070. delayLeave(el, remove2, performLeave);
  5071. } else {
  5072. performLeave();
  5073. }
  5074. }
  5075. } else {
  5076. hostInsert(el, container, anchor);
  5077. }
  5078. };
  5079. const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
  5080. const {
  5081. type,
  5082. props,
  5083. ref,
  5084. children,
  5085. dynamicChildren,
  5086. shapeFlag,
  5087. patchFlag,
  5088. dirs,
  5089. cacheIndex,
  5090. memo
  5091. } = vnode;
  5092. if (patchFlag === -2) {
  5093. optimized = false;
  5094. }
  5095. if (ref != null) {
  5096. reactivity.pauseTracking();
  5097. setRef(ref, null, parentSuspense, vnode, true);
  5098. reactivity.resetTracking();
  5099. }
  5100. if (cacheIndex != null) {
  5101. parentComponent.renderCache[cacheIndex] = void 0;
  5102. }
  5103. if (shapeFlag & 256) {
  5104. parentComponent.ctx.deactivate(vnode);
  5105. return;
  5106. }
  5107. const shouldInvokeDirs = shapeFlag & 1 && dirs;
  5108. const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
  5109. let vnodeHook;
  5110. if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) {
  5111. invokeVNodeHook(vnodeHook, parentComponent, vnode);
  5112. }
  5113. if (shapeFlag & 6) {
  5114. unmountComponent(vnode.component, parentSuspense, doRemove);
  5115. } else {
  5116. if (shapeFlag & 128) {
  5117. vnode.suspense.unmount(parentSuspense, doRemove);
  5118. return;
  5119. }
  5120. if (shouldInvokeDirs) {
  5121. invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
  5122. }
  5123. if (shapeFlag & 64) {
  5124. vnode.type.remove(
  5125. vnode,
  5126. parentComponent,
  5127. parentSuspense,
  5128. internals,
  5129. doRemove
  5130. );
  5131. } else if (dynamicChildren && // #5154
  5132. // when v-once is used inside a block, setBlockTracking(-1) marks the
  5133. // parent block with hasOnce: true
  5134. // so that it doesn't take the fast path during unmount - otherwise
  5135. // components nested in v-once are never unmounted.
  5136. !dynamicChildren.hasOnce && // #1153: fast path should not be taken for non-stable (v-for) fragments
  5137. (type !== Fragment || patchFlag > 0 && patchFlag & 64)) {
  5138. unmountChildren(
  5139. dynamicChildren,
  5140. parentComponent,
  5141. parentSuspense,
  5142. false,
  5143. true
  5144. );
  5145. } else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) {
  5146. unmountChildren(children, parentComponent, parentSuspense);
  5147. }
  5148. if (doRemove) {
  5149. remove(vnode);
  5150. }
  5151. }
  5152. const shouldInvalidateMemo = memo != null && cacheIndex == null;
  5153. if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs || shouldInvalidateMemo) {
  5154. queuePostRenderEffect(() => {
  5155. vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
  5156. shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
  5157. if (shouldInvalidateMemo) {
  5158. vnode.el = null;
  5159. }
  5160. }, parentSuspense);
  5161. }
  5162. };
  5163. const remove = (vnode) => {
  5164. const { type, el, anchor, transition } = vnode;
  5165. if (type === Fragment) {
  5166. {
  5167. removeFragment(el, anchor);
  5168. }
  5169. return;
  5170. }
  5171. if (type === Static) {
  5172. removeStaticNode(vnode);
  5173. return;
  5174. }
  5175. const performRemove = () => {
  5176. hostRemove(el);
  5177. if (transition && !transition.persisted && transition.afterLeave) {
  5178. transition.afterLeave();
  5179. }
  5180. };
  5181. if (vnode.shapeFlag & 1 && transition && !transition.persisted) {
  5182. const { leave, delayLeave } = transition;
  5183. const performLeave = () => leave(el, performRemove);
  5184. if (delayLeave) {
  5185. delayLeave(vnode.el, performRemove, performLeave);
  5186. } else {
  5187. performLeave();
  5188. }
  5189. } else {
  5190. performRemove();
  5191. }
  5192. };
  5193. const removeFragment = (cur, end) => {
  5194. let next;
  5195. while (cur !== end) {
  5196. next = hostNextSibling(cur);
  5197. hostRemove(cur);
  5198. cur = next;
  5199. }
  5200. hostRemove(end);
  5201. };
  5202. const unmountComponent = (instance, parentSuspense, doRemove) => {
  5203. const { bum, scope, job, subTree, um, m, a } = instance;
  5204. invalidateMount(m);
  5205. invalidateMount(a);
  5206. if (bum) {
  5207. shared.invokeArrayFns(bum);
  5208. }
  5209. scope.stop();
  5210. if (job) {
  5211. job.flags |= 8;
  5212. unmount(subTree, instance, parentSuspense, doRemove);
  5213. }
  5214. if (um) {
  5215. queuePostRenderEffect(um, parentSuspense);
  5216. }
  5217. queuePostRenderEffect(() => {
  5218. instance.isUnmounted = true;
  5219. }, parentSuspense);
  5220. };
  5221. const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {
  5222. for (let i = start; i < children.length; i++) {
  5223. unmount(children[i], parentComponent, parentSuspense, doRemove, optimized);
  5224. }
  5225. };
  5226. const getNextHostNode = (vnode) => {
  5227. if (vnode.shapeFlag & 6) {
  5228. return getNextHostNode(vnode.component.subTree);
  5229. }
  5230. if (vnode.shapeFlag & 128) {
  5231. return vnode.suspense.next();
  5232. }
  5233. const el = hostNextSibling(vnode.anchor || vnode.el);
  5234. const teleportEnd = el && el[TeleportEndKey];
  5235. return teleportEnd ? hostNextSibling(teleportEnd) : el;
  5236. };
  5237. let isFlushing = false;
  5238. const render = (vnode, container, namespace) => {
  5239. let instance;
  5240. if (vnode == null) {
  5241. if (container._vnode) {
  5242. unmount(container._vnode, null, null, true);
  5243. instance = container._vnode.component;
  5244. }
  5245. } else {
  5246. patch(
  5247. container._vnode || null,
  5248. vnode,
  5249. container,
  5250. null,
  5251. null,
  5252. null,
  5253. namespace
  5254. );
  5255. }
  5256. container._vnode = vnode;
  5257. if (!isFlushing) {
  5258. isFlushing = true;
  5259. flushPreFlushCbs(instance);
  5260. flushPostFlushCbs();
  5261. isFlushing = false;
  5262. }
  5263. };
  5264. const internals = {
  5265. p: patch,
  5266. um: unmount,
  5267. m: move,
  5268. r: remove,
  5269. mt: mountComponent,
  5270. mc: mountChildren,
  5271. pc: patchChildren,
  5272. pbc: patchBlockChildren,
  5273. n: getNextHostNode,
  5274. o: options
  5275. };
  5276. let hydrate;
  5277. let hydrateNode;
  5278. if (createHydrationFns) {
  5279. [hydrate, hydrateNode] = createHydrationFns(
  5280. internals
  5281. );
  5282. }
  5283. return {
  5284. render,
  5285. hydrate,
  5286. createApp: createAppAPI(render, hydrate)
  5287. };
  5288. }
  5289. function resolveChildrenNamespace({ type, props }, currentNamespace) {
  5290. return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
  5291. }
  5292. function toggleRecurse({ effect, job }, allowed) {
  5293. if (allowed) {
  5294. effect.flags |= 32;
  5295. job.flags |= 4;
  5296. } else {
  5297. effect.flags &= -33;
  5298. job.flags &= -5;
  5299. }
  5300. }
  5301. function needTransition(parentSuspense, transition) {
  5302. return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
  5303. }
  5304. function traverseStaticChildren(n1, n2, shallow = false) {
  5305. const ch1 = n1.children;
  5306. const ch2 = n2.children;
  5307. if (shared.isArray(ch1) && shared.isArray(ch2)) {
  5308. for (let i = 0; i < ch1.length; i++) {
  5309. const c1 = ch1[i];
  5310. let c2 = ch2[i];
  5311. if (c2.shapeFlag & 1 && !c2.dynamicChildren) {
  5312. if (c2.patchFlag <= 0 || c2.patchFlag === 32) {
  5313. c2 = ch2[i] = cloneIfMounted(ch2[i]);
  5314. c2.el = c1.el;
  5315. }
  5316. if (!shallow && c2.patchFlag !== -2)
  5317. traverseStaticChildren(c1, c2);
  5318. }
  5319. if (c2.type === Text) {
  5320. if (c2.patchFlag === -1) {
  5321. c2 = ch2[i] = cloneIfMounted(c2);
  5322. }
  5323. c2.el = c1.el;
  5324. }
  5325. if (c2.type === Comment && !c2.el) {
  5326. c2.el = c1.el;
  5327. }
  5328. }
  5329. }
  5330. }
  5331. function getSequence(arr) {
  5332. const p = arr.slice();
  5333. const result = [0];
  5334. let i, j, u, v, c;
  5335. const len = arr.length;
  5336. for (i = 0; i < len; i++) {
  5337. const arrI = arr[i];
  5338. if (arrI !== 0) {
  5339. j = result[result.length - 1];
  5340. if (arr[j] < arrI) {
  5341. p[i] = j;
  5342. result.push(i);
  5343. continue;
  5344. }
  5345. u = 0;
  5346. v = result.length - 1;
  5347. while (u < v) {
  5348. c = u + v >> 1;
  5349. if (arr[result[c]] < arrI) {
  5350. u = c + 1;
  5351. } else {
  5352. v = c;
  5353. }
  5354. }
  5355. if (arrI < arr[result[u]]) {
  5356. if (u > 0) {
  5357. p[i] = result[u - 1];
  5358. }
  5359. result[u] = i;
  5360. }
  5361. }
  5362. }
  5363. u = result.length;
  5364. v = result[u - 1];
  5365. while (u-- > 0) {
  5366. result[u] = v;
  5367. v = p[v];
  5368. }
  5369. return result;
  5370. }
  5371. function locateNonHydratedAsyncRoot(instance) {
  5372. const subComponent = instance.subTree.component;
  5373. if (subComponent) {
  5374. if (subComponent.asyncDep && !subComponent.asyncResolved) {
  5375. return subComponent;
  5376. } else {
  5377. return locateNonHydratedAsyncRoot(subComponent);
  5378. }
  5379. }
  5380. }
  5381. function invalidateMount(hooks) {
  5382. if (hooks) {
  5383. for (let i = 0; i < hooks.length; i++)
  5384. hooks[i].flags |= 8;
  5385. }
  5386. }
  5387. function resolveAsyncComponentPlaceholder(anchorVnode) {
  5388. if (anchorVnode.placeholder) {
  5389. return anchorVnode.placeholder;
  5390. }
  5391. const instance = anchorVnode.component;
  5392. if (instance) {
  5393. return resolveAsyncComponentPlaceholder(instance.subTree);
  5394. }
  5395. return null;
  5396. }
  5397. const isSuspense = (type) => type.__isSuspense;
  5398. let suspenseId = 0;
  5399. const SuspenseImpl = {
  5400. name: "Suspense",
  5401. // In order to make Suspense tree-shakable, we need to avoid importing it
  5402. // directly in the renderer. The renderer checks for the __isSuspense flag
  5403. // on a vnode's type and calls the `process` method, passing in renderer
  5404. // internals.
  5405. __isSuspense: true,
  5406. process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
  5407. if (n1 == null) {
  5408. mountSuspense(
  5409. n2,
  5410. container,
  5411. anchor,
  5412. parentComponent,
  5413. parentSuspense,
  5414. namespace,
  5415. slotScopeIds,
  5416. optimized,
  5417. rendererInternals
  5418. );
  5419. } else {
  5420. if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {
  5421. n2.suspense = n1.suspense;
  5422. n2.suspense.vnode = n2;
  5423. n2.el = n1.el;
  5424. return;
  5425. }
  5426. patchSuspense(
  5427. n1,
  5428. n2,
  5429. container,
  5430. anchor,
  5431. parentComponent,
  5432. namespace,
  5433. slotScopeIds,
  5434. optimized,
  5435. rendererInternals
  5436. );
  5437. }
  5438. },
  5439. hydrate: hydrateSuspense,
  5440. normalize: normalizeSuspenseChildren
  5441. };
  5442. const Suspense = SuspenseImpl ;
  5443. function triggerEvent(vnode, name) {
  5444. const eventListener = vnode.props && vnode.props[name];
  5445. if (shared.isFunction(eventListener)) {
  5446. eventListener();
  5447. }
  5448. }
  5449. function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
  5450. const {
  5451. p: patch,
  5452. o: { createElement }
  5453. } = rendererInternals;
  5454. const hiddenContainer = createElement("div");
  5455. const suspense = vnode.suspense = createSuspenseBoundary(
  5456. vnode,
  5457. parentSuspense,
  5458. parentComponent,
  5459. container,
  5460. hiddenContainer,
  5461. anchor,
  5462. namespace,
  5463. slotScopeIds,
  5464. optimized,
  5465. rendererInternals
  5466. );
  5467. patch(
  5468. null,
  5469. suspense.pendingBranch = vnode.ssContent,
  5470. hiddenContainer,
  5471. null,
  5472. parentComponent,
  5473. suspense,
  5474. namespace,
  5475. slotScopeIds
  5476. );
  5477. if (suspense.deps > 0) {
  5478. triggerEvent(vnode, "onPending");
  5479. triggerEvent(vnode, "onFallback");
  5480. patch(
  5481. null,
  5482. vnode.ssFallback,
  5483. container,
  5484. anchor,
  5485. parentComponent,
  5486. null,
  5487. // fallback tree will not have suspense context
  5488. namespace,
  5489. slotScopeIds
  5490. );
  5491. setActiveBranch(suspense, vnode.ssFallback);
  5492. } else {
  5493. suspense.resolve(false, true);
  5494. }
  5495. }
  5496. function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {
  5497. const suspense = n2.suspense = n1.suspense;
  5498. suspense.vnode = n2;
  5499. n2.el = n1.el;
  5500. const newBranch = n2.ssContent;
  5501. const newFallback = n2.ssFallback;
  5502. const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense;
  5503. if (pendingBranch) {
  5504. suspense.pendingBranch = newBranch;
  5505. if (isSameVNodeType(pendingBranch, newBranch)) {
  5506. patch(
  5507. pendingBranch,
  5508. newBranch,
  5509. suspense.hiddenContainer,
  5510. null,
  5511. parentComponent,
  5512. suspense,
  5513. namespace,
  5514. slotScopeIds,
  5515. optimized
  5516. );
  5517. if (suspense.deps <= 0) {
  5518. suspense.resolve();
  5519. } else if (isInFallback) {
  5520. if (!isHydrating) {
  5521. patch(
  5522. activeBranch,
  5523. newFallback,
  5524. container,
  5525. anchor,
  5526. parentComponent,
  5527. null,
  5528. // fallback tree will not have suspense context
  5529. namespace,
  5530. slotScopeIds,
  5531. optimized
  5532. );
  5533. setActiveBranch(suspense, newFallback);
  5534. }
  5535. }
  5536. } else {
  5537. suspense.pendingId = suspenseId++;
  5538. if (isHydrating) {
  5539. suspense.isHydrating = false;
  5540. suspense.activeBranch = pendingBranch;
  5541. } else {
  5542. unmount(pendingBranch, parentComponent, suspense);
  5543. }
  5544. suspense.deps = 0;
  5545. suspense.effects.length = 0;
  5546. suspense.hiddenContainer = createElement("div");
  5547. if (isInFallback) {
  5548. patch(
  5549. null,
  5550. newBranch,
  5551. suspense.hiddenContainer,
  5552. null,
  5553. parentComponent,
  5554. suspense,
  5555. namespace,
  5556. slotScopeIds,
  5557. optimized
  5558. );
  5559. if (suspense.deps <= 0) {
  5560. suspense.resolve();
  5561. } else {
  5562. patch(
  5563. activeBranch,
  5564. newFallback,
  5565. container,
  5566. anchor,
  5567. parentComponent,
  5568. null,
  5569. // fallback tree will not have suspense context
  5570. namespace,
  5571. slotScopeIds,
  5572. optimized
  5573. );
  5574. setActiveBranch(suspense, newFallback);
  5575. }
  5576. } else if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
  5577. patch(
  5578. activeBranch,
  5579. newBranch,
  5580. container,
  5581. anchor,
  5582. parentComponent,
  5583. suspense,
  5584. namespace,
  5585. slotScopeIds,
  5586. optimized
  5587. );
  5588. suspense.resolve(true);
  5589. } else {
  5590. patch(
  5591. null,
  5592. newBranch,
  5593. suspense.hiddenContainer,
  5594. null,
  5595. parentComponent,
  5596. suspense,
  5597. namespace,
  5598. slotScopeIds,
  5599. optimized
  5600. );
  5601. if (suspense.deps <= 0) {
  5602. suspense.resolve();
  5603. }
  5604. }
  5605. }
  5606. } else {
  5607. if (activeBranch && isSameVNodeType(activeBranch, newBranch)) {
  5608. patch(
  5609. activeBranch,
  5610. newBranch,
  5611. container,
  5612. anchor,
  5613. parentComponent,
  5614. suspense,
  5615. namespace,
  5616. slotScopeIds,
  5617. optimized
  5618. );
  5619. setActiveBranch(suspense, newBranch);
  5620. } else {
  5621. triggerEvent(n2, "onPending");
  5622. suspense.pendingBranch = newBranch;
  5623. if (newBranch.shapeFlag & 512) {
  5624. suspense.pendingId = newBranch.component.suspenseId;
  5625. } else {
  5626. suspense.pendingId = suspenseId++;
  5627. }
  5628. patch(
  5629. null,
  5630. newBranch,
  5631. suspense.hiddenContainer,
  5632. null,
  5633. parentComponent,
  5634. suspense,
  5635. namespace,
  5636. slotScopeIds,
  5637. optimized
  5638. );
  5639. if (suspense.deps <= 0) {
  5640. suspense.resolve();
  5641. } else {
  5642. const { timeout, pendingId } = suspense;
  5643. if (timeout > 0) {
  5644. setTimeout(() => {
  5645. if (suspense.pendingId === pendingId) {
  5646. suspense.fallback(newFallback);
  5647. }
  5648. }, timeout);
  5649. } else if (timeout === 0) {
  5650. suspense.fallback(newFallback);
  5651. }
  5652. }
  5653. }
  5654. }
  5655. }
  5656. function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, namespace, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
  5657. const {
  5658. p: patch,
  5659. m: move,
  5660. um: unmount,
  5661. n: next,
  5662. o: { parentNode, remove }
  5663. } = rendererInternals;
  5664. let parentSuspenseId;
  5665. const isSuspensible = isVNodeSuspensible(vnode);
  5666. if (isSuspensible) {
  5667. if (parentSuspense && parentSuspense.pendingBranch) {
  5668. parentSuspenseId = parentSuspense.pendingId;
  5669. parentSuspense.deps++;
  5670. }
  5671. }
  5672. const timeout = vnode.props ? shared.toNumber(vnode.props.timeout) : void 0;
  5673. const initialAnchor = anchor;
  5674. const suspense = {
  5675. vnode,
  5676. parent: parentSuspense,
  5677. parentComponent,
  5678. namespace,
  5679. container,
  5680. hiddenContainer,
  5681. deps: 0,
  5682. pendingId: suspenseId++,
  5683. timeout: typeof timeout === "number" ? timeout : -1,
  5684. activeBranch: null,
  5685. isFallbackMountPending: false,
  5686. pendingBranch: null,
  5687. isInFallback: !isHydrating,
  5688. isHydrating,
  5689. isUnmounted: false,
  5690. effects: [],
  5691. resolve(resume = false, sync = false) {
  5692. const {
  5693. vnode: vnode2,
  5694. activeBranch,
  5695. pendingBranch,
  5696. pendingId,
  5697. effects,
  5698. parentComponent: parentComponent2,
  5699. container: container2,
  5700. isInFallback
  5701. } = suspense;
  5702. let delayEnter = false;
  5703. if (suspense.isHydrating) {
  5704. suspense.isHydrating = false;
  5705. } else if (!resume) {
  5706. delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
  5707. let hasUpdatedAnchor = false;
  5708. if (delayEnter) {
  5709. activeBranch.transition.afterLeave = () => {
  5710. if (pendingId === suspense.pendingId) {
  5711. move(
  5712. pendingBranch,
  5713. container2,
  5714. anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor,
  5715. 0
  5716. );
  5717. queuePostFlushCb(effects);
  5718. if (isInFallback && vnode2.ssFallback) {
  5719. vnode2.ssFallback.el = null;
  5720. }
  5721. }
  5722. };
  5723. }
  5724. if (activeBranch && !suspense.isFallbackMountPending) {
  5725. if (parentNode(activeBranch.el) === container2) {
  5726. anchor = next(activeBranch);
  5727. hasUpdatedAnchor = true;
  5728. }
  5729. unmount(activeBranch, parentComponent2, suspense, true);
  5730. if (!delayEnter && isInFallback && vnode2.ssFallback) {
  5731. queuePostRenderEffect(() => vnode2.ssFallback.el = null, suspense);
  5732. }
  5733. }
  5734. if (!delayEnter) {
  5735. move(pendingBranch, container2, anchor, 0);
  5736. }
  5737. }
  5738. suspense.isFallbackMountPending = false;
  5739. setActiveBranch(suspense, pendingBranch);
  5740. suspense.pendingBranch = null;
  5741. suspense.isInFallback = false;
  5742. let parent = suspense.parent;
  5743. let hasUnresolvedAncestor = false;
  5744. while (parent) {
  5745. if (parent.pendingBranch) {
  5746. parent.effects.push(...effects);
  5747. hasUnresolvedAncestor = true;
  5748. break;
  5749. }
  5750. parent = parent.parent;
  5751. }
  5752. if (!hasUnresolvedAncestor && !delayEnter) {
  5753. queuePostFlushCb(effects);
  5754. }
  5755. suspense.effects = [];
  5756. if (isSuspensible) {
  5757. if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
  5758. parentSuspense.deps--;
  5759. if (parentSuspense.deps === 0 && !sync) {
  5760. parentSuspense.resolve();
  5761. }
  5762. }
  5763. }
  5764. triggerEvent(vnode2, "onResolve");
  5765. },
  5766. fallback(fallbackVNode) {
  5767. if (!suspense.pendingBranch) {
  5768. return;
  5769. }
  5770. const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;
  5771. triggerEvent(vnode2, "onFallback");
  5772. const anchor2 = next(activeBranch);
  5773. const mountFallback = () => {
  5774. suspense.isFallbackMountPending = false;
  5775. if (!suspense.isInFallback) {
  5776. return;
  5777. }
  5778. patch(
  5779. null,
  5780. fallbackVNode,
  5781. container2,
  5782. anchor2,
  5783. parentComponent2,
  5784. null,
  5785. // fallback tree will not have suspense context
  5786. namespace2,
  5787. slotScopeIds,
  5788. optimized
  5789. );
  5790. setActiveBranch(suspense, fallbackVNode);
  5791. };
  5792. const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
  5793. if (delayEnter) {
  5794. suspense.isFallbackMountPending = true;
  5795. activeBranch.transition.afterLeave = mountFallback;
  5796. }
  5797. suspense.isInFallback = true;
  5798. unmount(
  5799. activeBranch,
  5800. parentComponent2,
  5801. null,
  5802. // no suspense so unmount hooks fire now
  5803. true
  5804. // shouldRemove
  5805. );
  5806. if (!delayEnter) {
  5807. mountFallback();
  5808. }
  5809. },
  5810. move(container2, anchor2, type) {
  5811. suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type);
  5812. suspense.container = container2;
  5813. },
  5814. next() {
  5815. return suspense.activeBranch && next(suspense.activeBranch);
  5816. },
  5817. registerDep(instance, setupRenderEffect, optimized2) {
  5818. const isInPendingSuspense = !!suspense.pendingBranch;
  5819. if (isInPendingSuspense) {
  5820. suspense.deps++;
  5821. }
  5822. const hydratedEl = instance.vnode.el;
  5823. instance.asyncDep.catch((err) => {
  5824. handleError(err, instance, 0);
  5825. }).then((asyncSetupResult) => {
  5826. if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
  5827. return;
  5828. }
  5829. unsetCurrentInstance();
  5830. instance.asyncResolved = true;
  5831. const { vnode: vnode2 } = instance;
  5832. handleSetupResult(instance, asyncSetupResult, false);
  5833. if (hydratedEl) {
  5834. vnode2.el = hydratedEl;
  5835. }
  5836. const placeholder = !hydratedEl && instance.subTree.el;
  5837. setupRenderEffect(
  5838. instance,
  5839. vnode2,
  5840. // component may have been moved before resolve.
  5841. // if this is not a hydration, instance.subTree will be the comment
  5842. // placeholder.
  5843. parentNode(hydratedEl || instance.subTree.el),
  5844. // anchor will not be used if this is hydration, so only need to
  5845. // consider the comment placeholder case.
  5846. hydratedEl ? null : next(instance.subTree),
  5847. suspense,
  5848. namespace,
  5849. optimized2
  5850. );
  5851. if (placeholder) {
  5852. vnode2.placeholder = null;
  5853. remove(placeholder);
  5854. }
  5855. updateHOCHostEl(instance, vnode2.el);
  5856. if (isInPendingSuspense && --suspense.deps === 0) {
  5857. suspense.resolve();
  5858. }
  5859. });
  5860. },
  5861. unmount(parentSuspense2, doRemove) {
  5862. suspense.isUnmounted = true;
  5863. if (suspense.activeBranch) {
  5864. unmount(
  5865. suspense.activeBranch,
  5866. parentComponent,
  5867. parentSuspense2,
  5868. doRemove
  5869. );
  5870. }
  5871. if (suspense.pendingBranch) {
  5872. unmount(
  5873. suspense.pendingBranch,
  5874. parentComponent,
  5875. parentSuspense2,
  5876. doRemove
  5877. );
  5878. }
  5879. }
  5880. };
  5881. return suspense;
  5882. }
  5883. function hydrateSuspense(node, vnode, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals, hydrateNode) {
  5884. const suspense = vnode.suspense = createSuspenseBoundary(
  5885. vnode,
  5886. parentSuspense,
  5887. parentComponent,
  5888. node.parentNode,
  5889. // eslint-disable-next-line no-restricted-globals
  5890. document.createElement("div"),
  5891. null,
  5892. namespace,
  5893. slotScopeIds,
  5894. optimized,
  5895. rendererInternals,
  5896. true
  5897. );
  5898. const result = hydrateNode(
  5899. node,
  5900. suspense.pendingBranch = vnode.ssContent,
  5901. parentComponent,
  5902. suspense,
  5903. slotScopeIds,
  5904. optimized
  5905. );
  5906. if (suspense.deps === 0) {
  5907. suspense.resolve(false, true);
  5908. }
  5909. return result;
  5910. }
  5911. function normalizeSuspenseChildren(vnode) {
  5912. const { shapeFlag, children } = vnode;
  5913. const isSlotChildren = shapeFlag & 32;
  5914. vnode.ssContent = normalizeSuspenseSlot(
  5915. isSlotChildren ? children.default : children
  5916. );
  5917. vnode.ssFallback = isSlotChildren ? normalizeSuspenseSlot(children.fallback) : createVNode(Comment);
  5918. }
  5919. function normalizeSuspenseSlot(s) {
  5920. let block;
  5921. if (shared.isFunction(s)) {
  5922. const trackBlock = isBlockTreeEnabled && s._c;
  5923. if (trackBlock) {
  5924. s._d = false;
  5925. openBlock();
  5926. }
  5927. s = s();
  5928. if (trackBlock) {
  5929. s._d = true;
  5930. block = currentBlock;
  5931. closeBlock();
  5932. }
  5933. }
  5934. if (shared.isArray(s)) {
  5935. const singleChild = filterSingleRoot(s);
  5936. s = singleChild;
  5937. }
  5938. s = normalizeVNode(s);
  5939. if (block && !s.dynamicChildren) {
  5940. s.dynamicChildren = block.filter((c) => c !== s);
  5941. }
  5942. return s;
  5943. }
  5944. function queueEffectWithSuspense(fn, suspense) {
  5945. if (suspense && suspense.pendingBranch) {
  5946. if (shared.isArray(fn)) {
  5947. suspense.effects.push(...fn);
  5948. } else {
  5949. suspense.effects.push(fn);
  5950. }
  5951. } else {
  5952. queuePostFlushCb(fn);
  5953. }
  5954. }
  5955. function setActiveBranch(suspense, branch) {
  5956. suspense.activeBranch = branch;
  5957. const { vnode, parentComponent } = suspense;
  5958. let el = branch.el;
  5959. while (!el && branch.component) {
  5960. branch = branch.component.subTree;
  5961. el = branch.el;
  5962. }
  5963. vnode.el = el;
  5964. if (parentComponent && parentComponent.subTree === vnode) {
  5965. parentComponent.vnode.el = el;
  5966. updateHOCHostEl(parentComponent, el);
  5967. }
  5968. }
  5969. function isVNodeSuspensible(vnode) {
  5970. const suspensible = vnode.props && vnode.props.suspensible;
  5971. return suspensible != null && suspensible !== false;
  5972. }
  5973. const Fragment = /* @__PURE__ */ Symbol.for("v-fgt");
  5974. const Text = /* @__PURE__ */ Symbol.for("v-txt");
  5975. const Comment = /* @__PURE__ */ Symbol.for("v-cmt");
  5976. const Static = /* @__PURE__ */ Symbol.for("v-stc");
  5977. const blockStack = [];
  5978. let currentBlock = null;
  5979. function openBlock(disableTracking = false) {
  5980. blockStack.push(currentBlock = disableTracking ? null : []);
  5981. }
  5982. function closeBlock() {
  5983. blockStack.pop();
  5984. currentBlock = blockStack[blockStack.length - 1] || null;
  5985. }
  5986. let isBlockTreeEnabled = 1;
  5987. function setBlockTracking(value, inVOnce = false) {
  5988. isBlockTreeEnabled += value;
  5989. if (value < 0 && currentBlock && inVOnce) {
  5990. currentBlock.hasOnce = true;
  5991. }
  5992. }
  5993. function setupBlock(vnode) {
  5994. vnode.dynamicChildren = isBlockTreeEnabled > 0 ? currentBlock || shared.EMPTY_ARR : null;
  5995. closeBlock();
  5996. if (isBlockTreeEnabled > 0 && currentBlock) {
  5997. currentBlock.push(vnode);
  5998. }
  5999. return vnode;
  6000. }
  6001. function createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) {
  6002. return setupBlock(
  6003. createBaseVNode(
  6004. type,
  6005. props,
  6006. children,
  6007. patchFlag,
  6008. dynamicProps,
  6009. shapeFlag,
  6010. true
  6011. )
  6012. );
  6013. }
  6014. function createBlock(type, props, children, patchFlag, dynamicProps) {
  6015. return setupBlock(
  6016. createVNode(
  6017. type,
  6018. props,
  6019. children,
  6020. patchFlag,
  6021. dynamicProps,
  6022. true
  6023. )
  6024. );
  6025. }
  6026. function isVNode(value) {
  6027. return value ? value.__v_isVNode === true : false;
  6028. }
  6029. function isSameVNodeType(n1, n2) {
  6030. return n1.type === n2.type && n1.key === n2.key;
  6031. }
  6032. function transformVNodeArgs(transformer) {
  6033. }
  6034. const normalizeKey = ({ key }) => key != null ? key : null;
  6035. const normalizeRef = ({
  6036. ref,
  6037. ref_key,
  6038. ref_for
  6039. }) => {
  6040. if (typeof ref === "number") {
  6041. ref = "" + ref;
  6042. }
  6043. return ref != null ? shared.isString(ref) || reactivity.isRef(ref) || shared.isFunction(ref) ? { i: currentRenderingInstance, r: ref, k: ref_key, f: !!ref_for } : ref : null;
  6044. };
  6045. function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) {
  6046. const vnode = {
  6047. __v_isVNode: true,
  6048. __v_skip: true,
  6049. type,
  6050. props,
  6051. key: props && normalizeKey(props),
  6052. ref: props && normalizeRef(props),
  6053. scopeId: currentScopeId,
  6054. slotScopeIds: null,
  6055. children,
  6056. component: null,
  6057. suspense: null,
  6058. ssContent: null,
  6059. ssFallback: null,
  6060. dirs: null,
  6061. transition: null,
  6062. el: null,
  6063. anchor: null,
  6064. target: null,
  6065. targetStart: null,
  6066. targetAnchor: null,
  6067. staticCount: 0,
  6068. shapeFlag,
  6069. patchFlag,
  6070. dynamicProps,
  6071. dynamicChildren: null,
  6072. appContext: null,
  6073. ctx: currentRenderingInstance
  6074. };
  6075. if (needFullChildrenNormalization) {
  6076. normalizeChildren(vnode, children);
  6077. if (shapeFlag & 128) {
  6078. type.normalize(vnode);
  6079. }
  6080. } else if (children) {
  6081. vnode.shapeFlag |= shared.isString(children) ? 8 : 16;
  6082. }
  6083. if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself
  6084. !isBlockNode && // has current parent block
  6085. currentBlock && // presence of a patch flag indicates this node needs patching on updates.
  6086. // component nodes also should always be patched, because even if the
  6087. // component doesn't need to update, it needs to persist the instance on to
  6088. // the next vnode so that it can be properly unmounted later.
  6089. (vnode.patchFlag > 0 || shapeFlag & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the
  6090. // vnode should not be considered dynamic due to handler caching.
  6091. vnode.patchFlag !== 32) {
  6092. currentBlock.push(vnode);
  6093. }
  6094. return vnode;
  6095. }
  6096. const createVNode = _createVNode;
  6097. function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
  6098. if (!type || type === NULL_DYNAMIC_COMPONENT) {
  6099. type = Comment;
  6100. }
  6101. if (isVNode(type)) {
  6102. const cloned = cloneVNode(
  6103. type,
  6104. props,
  6105. true
  6106. /* mergeRef: true */
  6107. );
  6108. if (children) {
  6109. normalizeChildren(cloned, children);
  6110. }
  6111. if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
  6112. if (cloned.shapeFlag & 6) {
  6113. currentBlock[currentBlock.indexOf(type)] = cloned;
  6114. } else {
  6115. currentBlock.push(cloned);
  6116. }
  6117. }
  6118. cloned.patchFlag = -2;
  6119. return cloned;
  6120. }
  6121. if (isClassComponent(type)) {
  6122. type = type.__vccOpts;
  6123. }
  6124. if (props) {
  6125. props = guardReactiveProps(props);
  6126. let { class: klass, style } = props;
  6127. if (klass && !shared.isString(klass)) {
  6128. props.class = shared.normalizeClass(klass);
  6129. }
  6130. if (shared.isObject(style)) {
  6131. if (reactivity.isProxy(style) && !shared.isArray(style)) {
  6132. style = shared.extend({}, style);
  6133. }
  6134. props.style = shared.normalizeStyle(style);
  6135. }
  6136. }
  6137. const shapeFlag = shared.isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : shared.isObject(type) ? 4 : shared.isFunction(type) ? 2 : 0;
  6138. return createBaseVNode(
  6139. type,
  6140. props,
  6141. children,
  6142. patchFlag,
  6143. dynamicProps,
  6144. shapeFlag,
  6145. isBlockNode,
  6146. true
  6147. );
  6148. }
  6149. function guardReactiveProps(props) {
  6150. if (!props) return null;
  6151. return reactivity.isProxy(props) || isInternalObject(props) ? shared.extend({}, props) : props;
  6152. }
  6153. function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
  6154. const { props, ref, patchFlag, children, transition } = vnode;
  6155. const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props;
  6156. const cloned = {
  6157. __v_isVNode: true,
  6158. __v_skip: true,
  6159. type: vnode.type,
  6160. props: mergedProps,
  6161. key: mergedProps && normalizeKey(mergedProps),
  6162. ref: extraProps && extraProps.ref ? (
  6163. // #2078 in the case of <component :is="vnode" ref="extra"/>
  6164. // if the vnode itself already has a ref, cloneVNode will need to merge
  6165. // the refs so the single vnode can be set on multiple refs
  6166. mergeRef && ref ? shared.isArray(ref) ? ref.concat(normalizeRef(extraProps)) : [ref, normalizeRef(extraProps)] : normalizeRef(extraProps)
  6167. ) : ref,
  6168. scopeId: vnode.scopeId,
  6169. slotScopeIds: vnode.slotScopeIds,
  6170. children: children,
  6171. target: vnode.target,
  6172. targetStart: vnode.targetStart,
  6173. targetAnchor: vnode.targetAnchor,
  6174. staticCount: vnode.staticCount,
  6175. shapeFlag: vnode.shapeFlag,
  6176. // if the vnode is cloned with extra props, we can no longer assume its
  6177. // existing patch flag to be reliable and need to add the FULL_PROPS flag.
  6178. // note: preserve flag for fragments since they use the flag for children
  6179. // fast paths only.
  6180. patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag,
  6181. dynamicProps: vnode.dynamicProps,
  6182. dynamicChildren: vnode.dynamicChildren,
  6183. appContext: vnode.appContext,
  6184. dirs: vnode.dirs,
  6185. transition,
  6186. // These should technically only be non-null on mounted VNodes. However,
  6187. // they *should* be copied for kept-alive vnodes. So we just always copy
  6188. // them since them being non-null during a mount doesn't affect the logic as
  6189. // they will simply be overwritten.
  6190. component: vnode.component,
  6191. suspense: vnode.suspense,
  6192. ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
  6193. ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
  6194. placeholder: vnode.placeholder,
  6195. el: vnode.el,
  6196. anchor: vnode.anchor,
  6197. ctx: vnode.ctx,
  6198. ce: vnode.ce
  6199. };
  6200. if (transition && cloneTransition) {
  6201. setTransitionHooks(
  6202. cloned,
  6203. transition.clone(cloned)
  6204. );
  6205. }
  6206. return cloned;
  6207. }
  6208. function createTextVNode(text = " ", flag = 0) {
  6209. return createVNode(Text, null, text, flag);
  6210. }
  6211. function createStaticVNode(content, numberOfNodes) {
  6212. const vnode = createVNode(Static, null, content);
  6213. vnode.staticCount = numberOfNodes;
  6214. return vnode;
  6215. }
  6216. function createCommentVNode(text = "", asBlock = false) {
  6217. return asBlock ? (openBlock(), createBlock(Comment, null, text)) : createVNode(Comment, null, text);
  6218. }
  6219. function normalizeVNode(child) {
  6220. if (child == null || typeof child === "boolean") {
  6221. return createVNode(Comment);
  6222. } else if (shared.isArray(child)) {
  6223. return createVNode(
  6224. Fragment,
  6225. null,
  6226. // #3666, avoid reference pollution when reusing vnode
  6227. child.slice()
  6228. );
  6229. } else if (isVNode(child)) {
  6230. return cloneIfMounted(child);
  6231. } else {
  6232. return createVNode(Text, null, String(child));
  6233. }
  6234. }
  6235. function cloneIfMounted(child) {
  6236. return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child);
  6237. }
  6238. function normalizeChildren(vnode, children) {
  6239. let type = 0;
  6240. const { shapeFlag } = vnode;
  6241. if (children == null) {
  6242. children = null;
  6243. } else if (shared.isArray(children)) {
  6244. type = 16;
  6245. } else if (typeof children === "object") {
  6246. if (shapeFlag & (1 | 64)) {
  6247. const slot = children.default;
  6248. if (slot) {
  6249. slot._c && (slot._d = false);
  6250. normalizeChildren(vnode, slot());
  6251. slot._c && (slot._d = true);
  6252. }
  6253. return;
  6254. } else {
  6255. type = 32;
  6256. const slotFlag = children._;
  6257. if (!slotFlag && !isInternalObject(children)) {
  6258. children._ctx = currentRenderingInstance;
  6259. } else if (slotFlag === 3 && currentRenderingInstance) {
  6260. if (currentRenderingInstance.slots._ === 1) {
  6261. children._ = 1;
  6262. } else {
  6263. children._ = 2;
  6264. vnode.patchFlag |= 1024;
  6265. }
  6266. }
  6267. }
  6268. } else if (shared.isFunction(children)) {
  6269. children = { default: children, _ctx: currentRenderingInstance };
  6270. type = 32;
  6271. } else {
  6272. children = String(children);
  6273. if (shapeFlag & 64) {
  6274. type = 16;
  6275. children = [createTextVNode(children)];
  6276. } else {
  6277. type = 8;
  6278. }
  6279. }
  6280. vnode.children = children;
  6281. vnode.shapeFlag |= type;
  6282. }
  6283. function mergeProps(...args) {
  6284. const ret = {};
  6285. for (let i = 0; i < args.length; i++) {
  6286. const toMerge = args[i];
  6287. for (const key in toMerge) {
  6288. if (key === "class") {
  6289. if (ret.class !== toMerge.class) {
  6290. ret.class = shared.normalizeClass([ret.class, toMerge.class]);
  6291. }
  6292. } else if (key === "style") {
  6293. ret.style = shared.normalizeStyle([ret.style, toMerge.style]);
  6294. } else if (shared.isOn(key)) {
  6295. const existing = ret[key];
  6296. const incoming = toMerge[key];
  6297. if (incoming && existing !== incoming && !(shared.isArray(existing) && existing.includes(incoming))) {
  6298. ret[key] = existing ? [].concat(existing, incoming) : incoming;
  6299. } else if (incoming == null && existing == null && // mergeProps({ 'onUpdate:modelValue': undefined }) should not retain
  6300. // the model listener.
  6301. !shared.isModelListener(key)) {
  6302. ret[key] = incoming;
  6303. }
  6304. } else if (key !== "") {
  6305. ret[key] = toMerge[key];
  6306. }
  6307. }
  6308. }
  6309. return ret;
  6310. }
  6311. function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
  6312. callWithAsyncErrorHandling(hook, instance, 7, [
  6313. vnode,
  6314. prevVNode
  6315. ]);
  6316. }
  6317. const emptyAppContext = createAppContext();
  6318. let uid = 0;
  6319. function createComponentInstance(vnode, parent, suspense) {
  6320. const type = vnode.type;
  6321. const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
  6322. const instance = {
  6323. uid: uid++,
  6324. vnode,
  6325. type,
  6326. parent,
  6327. appContext,
  6328. root: null,
  6329. // to be immediately set
  6330. next: null,
  6331. subTree: null,
  6332. // will be set synchronously right after creation
  6333. effect: null,
  6334. update: null,
  6335. // will be set synchronously right after creation
  6336. job: null,
  6337. scope: new reactivity.EffectScope(
  6338. true
  6339. /* detached */
  6340. ),
  6341. render: null,
  6342. proxy: null,
  6343. exposed: null,
  6344. exposeProxy: null,
  6345. withProxy: null,
  6346. provides: parent ? parent.provides : Object.create(appContext.provides),
  6347. ids: parent ? parent.ids : ["", 0, 0],
  6348. accessCache: null,
  6349. renderCache: [],
  6350. // local resolved assets
  6351. components: null,
  6352. directives: null,
  6353. // resolved props and emits options
  6354. propsOptions: normalizePropsOptions(type, appContext),
  6355. emitsOptions: normalizeEmitsOptions(type, appContext),
  6356. // emit
  6357. emit: null,
  6358. // to be set immediately
  6359. emitted: null,
  6360. // props default value
  6361. propsDefaults: shared.EMPTY_OBJ,
  6362. // inheritAttrs
  6363. inheritAttrs: type.inheritAttrs,
  6364. // state
  6365. ctx: shared.EMPTY_OBJ,
  6366. data: shared.EMPTY_OBJ,
  6367. props: shared.EMPTY_OBJ,
  6368. attrs: shared.EMPTY_OBJ,
  6369. slots: shared.EMPTY_OBJ,
  6370. refs: shared.EMPTY_OBJ,
  6371. setupState: shared.EMPTY_OBJ,
  6372. setupContext: null,
  6373. // suspense related
  6374. suspense,
  6375. suspenseId: suspense ? suspense.pendingId : 0,
  6376. asyncDep: null,
  6377. asyncResolved: false,
  6378. // lifecycle hooks
  6379. // not using enums here because it results in computed properties
  6380. isMounted: false,
  6381. isUnmounted: false,
  6382. isDeactivated: false,
  6383. bc: null,
  6384. c: null,
  6385. bm: null,
  6386. m: null,
  6387. bu: null,
  6388. u: null,
  6389. um: null,
  6390. bum: null,
  6391. da: null,
  6392. a: null,
  6393. rtg: null,
  6394. rtc: null,
  6395. ec: null,
  6396. sp: null
  6397. };
  6398. {
  6399. instance.ctx = { _: instance };
  6400. }
  6401. instance.root = parent ? parent.root : instance;
  6402. instance.emit = emit.bind(null, instance);
  6403. if (vnode.ce) {
  6404. vnode.ce(instance);
  6405. }
  6406. return instance;
  6407. }
  6408. let currentInstance = null;
  6409. const getCurrentInstance = () => currentInstance || currentRenderingInstance;
  6410. let internalSetCurrentInstance;
  6411. let setInSSRSetupState;
  6412. {
  6413. const g = shared.getGlobalThis();
  6414. const registerGlobalSetter = (key, setter) => {
  6415. let setters;
  6416. if (!(setters = g[key])) setters = g[key] = [];
  6417. setters.push(setter);
  6418. return (v) => {
  6419. if (setters.length > 1) setters.forEach((set) => set(v));
  6420. else setters[0](v);
  6421. };
  6422. };
  6423. internalSetCurrentInstance = registerGlobalSetter(
  6424. `__VUE_INSTANCE_SETTERS__`,
  6425. (v) => currentInstance = v
  6426. );
  6427. setInSSRSetupState = registerGlobalSetter(
  6428. `__VUE_SSR_SETTERS__`,
  6429. (v) => isInSSRComponentSetup = v
  6430. );
  6431. }
  6432. const setCurrentInstance = (instance) => {
  6433. const prev = currentInstance;
  6434. internalSetCurrentInstance(instance);
  6435. instance.scope.on();
  6436. return () => {
  6437. instance.scope.off();
  6438. internalSetCurrentInstance(prev);
  6439. };
  6440. };
  6441. const unsetCurrentInstance = () => {
  6442. currentInstance && currentInstance.scope.off();
  6443. internalSetCurrentInstance(null);
  6444. };
  6445. function isStatefulComponent(instance) {
  6446. return instance.vnode.shapeFlag & 4;
  6447. }
  6448. let isInSSRComponentSetup = false;
  6449. function setupComponent(instance, isSSR = false, optimized = false) {
  6450. isSSR && setInSSRSetupState(isSSR);
  6451. const { props, children } = instance.vnode;
  6452. const isStateful = isStatefulComponent(instance);
  6453. initProps(instance, props, isStateful, isSSR);
  6454. initSlots(instance, children, optimized || isSSR);
  6455. const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
  6456. isSSR && setInSSRSetupState(false);
  6457. return setupResult;
  6458. }
  6459. function setupStatefulComponent(instance, isSSR) {
  6460. const Component = instance.type;
  6461. instance.accessCache = /* @__PURE__ */ Object.create(null);
  6462. instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers);
  6463. const { setup } = Component;
  6464. if (setup) {
  6465. reactivity.pauseTracking();
  6466. const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
  6467. const reset = setCurrentInstance(instance);
  6468. const setupResult = callWithErrorHandling(
  6469. setup,
  6470. instance,
  6471. 0,
  6472. [
  6473. instance.props,
  6474. setupContext
  6475. ]
  6476. );
  6477. const isAsyncSetup = shared.isPromise(setupResult);
  6478. reactivity.resetTracking();
  6479. reset();
  6480. if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) {
  6481. markAsyncBoundary(instance);
  6482. }
  6483. if (isAsyncSetup) {
  6484. setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
  6485. if (isSSR) {
  6486. return setupResult.then((resolvedResult) => {
  6487. handleSetupResult(instance, resolvedResult, isSSR);
  6488. }).catch((e) => {
  6489. handleError(e, instance, 0);
  6490. });
  6491. } else {
  6492. instance.asyncDep = setupResult;
  6493. }
  6494. } else {
  6495. handleSetupResult(instance, setupResult, isSSR);
  6496. }
  6497. } else {
  6498. finishComponentSetup(instance, isSSR);
  6499. }
  6500. }
  6501. function handleSetupResult(instance, setupResult, isSSR) {
  6502. if (shared.isFunction(setupResult)) {
  6503. if (instance.type.__ssrInlineRender) {
  6504. instance.ssrRender = setupResult;
  6505. } else {
  6506. instance.render = setupResult;
  6507. }
  6508. } else if (shared.isObject(setupResult)) {
  6509. instance.setupState = reactivity.proxyRefs(setupResult);
  6510. } else ;
  6511. finishComponentSetup(instance, isSSR);
  6512. }
  6513. let compile;
  6514. let installWithProxy;
  6515. function registerRuntimeCompiler(_compile) {
  6516. compile = _compile;
  6517. installWithProxy = (i) => {
  6518. if (i.render._rc) {
  6519. i.withProxy = new Proxy(i.ctx, RuntimeCompiledPublicInstanceProxyHandlers);
  6520. }
  6521. };
  6522. }
  6523. const isRuntimeOnly = () => !compile;
  6524. function finishComponentSetup(instance, isSSR, skipOptions) {
  6525. const Component = instance.type;
  6526. if (!instance.render) {
  6527. if (!isSSR && compile && !Component.render) {
  6528. const template = Component.template || resolveMergedOptions(instance).template;
  6529. if (template) {
  6530. const { isCustomElement, compilerOptions } = instance.appContext.config;
  6531. const { delimiters, compilerOptions: componentCompilerOptions } = Component;
  6532. const finalCompilerOptions = shared.extend(
  6533. shared.extend(
  6534. {
  6535. isCustomElement,
  6536. delimiters
  6537. },
  6538. compilerOptions
  6539. ),
  6540. componentCompilerOptions
  6541. );
  6542. Component.render = compile(template, finalCompilerOptions);
  6543. }
  6544. }
  6545. instance.render = Component.render || shared.NOOP;
  6546. if (installWithProxy) {
  6547. installWithProxy(instance);
  6548. }
  6549. }
  6550. {
  6551. const reset = setCurrentInstance(instance);
  6552. reactivity.pauseTracking();
  6553. try {
  6554. applyOptions(instance);
  6555. } finally {
  6556. reactivity.resetTracking();
  6557. reset();
  6558. }
  6559. }
  6560. }
  6561. const attrsProxyHandlers = {
  6562. get(target, key) {
  6563. reactivity.track(target, "get", "");
  6564. return target[key];
  6565. }
  6566. };
  6567. function createSetupContext(instance) {
  6568. const expose = (exposed) => {
  6569. instance.exposed = exposed || {};
  6570. };
  6571. {
  6572. return {
  6573. attrs: new Proxy(instance.attrs, attrsProxyHandlers),
  6574. slots: instance.slots,
  6575. emit: instance.emit,
  6576. expose
  6577. };
  6578. }
  6579. }
  6580. function getComponentPublicInstance(instance) {
  6581. if (instance.exposed) {
  6582. return instance.exposeProxy || (instance.exposeProxy = new Proxy(reactivity.proxyRefs(reactivity.markRaw(instance.exposed)), {
  6583. get(target, key) {
  6584. if (key in target) {
  6585. return target[key];
  6586. } else if (key in publicPropertiesMap) {
  6587. return publicPropertiesMap[key](instance);
  6588. }
  6589. },
  6590. has(target, key) {
  6591. return key in target || key in publicPropertiesMap;
  6592. }
  6593. }));
  6594. } else {
  6595. return instance.proxy;
  6596. }
  6597. }
  6598. function getComponentName(Component, includeInferred = true) {
  6599. return shared.isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
  6600. }
  6601. function isClassComponent(value) {
  6602. return shared.isFunction(value) && "__vccOpts" in value;
  6603. }
  6604. const computed = (getterOrOptions, debugOptions) => {
  6605. const c = reactivity.computed(getterOrOptions, debugOptions, isInSSRComponentSetup);
  6606. return c;
  6607. };
  6608. function h(type, propsOrChildren, children) {
  6609. try {
  6610. setBlockTracking(-1);
  6611. const l = arguments.length;
  6612. if (l === 2) {
  6613. if (shared.isObject(propsOrChildren) && !shared.isArray(propsOrChildren)) {
  6614. if (isVNode(propsOrChildren)) {
  6615. return createVNode(type, null, [propsOrChildren]);
  6616. }
  6617. return createVNode(type, propsOrChildren);
  6618. } else {
  6619. return createVNode(type, null, propsOrChildren);
  6620. }
  6621. } else {
  6622. if (l > 3) {
  6623. children = Array.prototype.slice.call(arguments, 2);
  6624. } else if (l === 3 && isVNode(children)) {
  6625. children = [children];
  6626. }
  6627. return createVNode(type, propsOrChildren, children);
  6628. }
  6629. } finally {
  6630. setBlockTracking(1);
  6631. }
  6632. }
  6633. function initCustomFormatter() {
  6634. {
  6635. return;
  6636. }
  6637. }
  6638. function withMemo(memo, render, cache, index) {
  6639. const cached = cache[index];
  6640. if (cached && isMemoSame(cached, memo)) {
  6641. return cached;
  6642. }
  6643. const ret = render();
  6644. ret.memo = memo.slice();
  6645. ret.cacheIndex = index;
  6646. return cache[index] = ret;
  6647. }
  6648. function isMemoSame(cached, memo) {
  6649. const prev = cached.memo;
  6650. if (prev.length != memo.length) {
  6651. return false;
  6652. }
  6653. for (let i = 0; i < prev.length; i++) {
  6654. if (shared.hasChanged(prev[i], memo[i])) {
  6655. return false;
  6656. }
  6657. }
  6658. if (isBlockTreeEnabled > 0 && currentBlock) {
  6659. currentBlock.push(cached);
  6660. }
  6661. return true;
  6662. }
  6663. const version = "3.5.35";
  6664. const warn$1 = shared.NOOP;
  6665. const ErrorTypeStrings = ErrorTypeStrings$1 ;
  6666. const devtools = void 0;
  6667. const setDevtoolsHook = shared.NOOP;
  6668. const _ssrUtils = {
  6669. createComponentInstance,
  6670. setupComponent,
  6671. renderComponentRoot,
  6672. setCurrentRenderingInstance,
  6673. isVNode: isVNode,
  6674. normalizeVNode,
  6675. getComponentPublicInstance,
  6676. ensureValidVNode,
  6677. pushWarningContext,
  6678. popWarningContext
  6679. };
  6680. const ssrUtils = _ssrUtils ;
  6681. const resolveFilter = null;
  6682. const compatUtils = null;
  6683. const DeprecationTypes = null;
  6684. exports.EffectScope = reactivity.EffectScope;
  6685. exports.ReactiveEffect = reactivity.ReactiveEffect;
  6686. exports.TrackOpTypes = reactivity.TrackOpTypes;
  6687. exports.TriggerOpTypes = reactivity.TriggerOpTypes;
  6688. exports.customRef = reactivity.customRef;
  6689. exports.effect = reactivity.effect;
  6690. exports.effectScope = reactivity.effectScope;
  6691. exports.getCurrentScope = reactivity.getCurrentScope;
  6692. exports.getCurrentWatcher = reactivity.getCurrentWatcher;
  6693. exports.isProxy = reactivity.isProxy;
  6694. exports.isReactive = reactivity.isReactive;
  6695. exports.isReadonly = reactivity.isReadonly;
  6696. exports.isRef = reactivity.isRef;
  6697. exports.isShallow = reactivity.isShallow;
  6698. exports.markRaw = reactivity.markRaw;
  6699. exports.onScopeDispose = reactivity.onScopeDispose;
  6700. exports.onWatcherCleanup = reactivity.onWatcherCleanup;
  6701. exports.proxyRefs = reactivity.proxyRefs;
  6702. exports.reactive = reactivity.reactive;
  6703. exports.readonly = reactivity.readonly;
  6704. exports.ref = reactivity.ref;
  6705. exports.shallowReactive = reactivity.shallowReactive;
  6706. exports.shallowReadonly = reactivity.shallowReadonly;
  6707. exports.shallowRef = reactivity.shallowRef;
  6708. exports.stop = reactivity.stop;
  6709. exports.toRaw = reactivity.toRaw;
  6710. exports.toRef = reactivity.toRef;
  6711. exports.toRefs = reactivity.toRefs;
  6712. exports.toValue = reactivity.toValue;
  6713. exports.triggerRef = reactivity.triggerRef;
  6714. exports.unref = reactivity.unref;
  6715. exports.camelize = shared.camelize;
  6716. exports.capitalize = shared.capitalize;
  6717. exports.normalizeClass = shared.normalizeClass;
  6718. exports.normalizeProps = shared.normalizeProps;
  6719. exports.normalizeStyle = shared.normalizeStyle;
  6720. exports.toDisplayString = shared.toDisplayString;
  6721. exports.toHandlerKey = shared.toHandlerKey;
  6722. exports.BaseTransition = BaseTransition;
  6723. exports.BaseTransitionPropsValidators = BaseTransitionPropsValidators;
  6724. exports.Comment = Comment;
  6725. exports.DeprecationTypes = DeprecationTypes;
  6726. exports.ErrorCodes = ErrorCodes;
  6727. exports.ErrorTypeStrings = ErrorTypeStrings;
  6728. exports.Fragment = Fragment;
  6729. exports.KeepAlive = KeepAlive;
  6730. exports.Static = Static;
  6731. exports.Suspense = Suspense;
  6732. exports.Teleport = Teleport;
  6733. exports.Text = Text;
  6734. exports.assertNumber = assertNumber;
  6735. exports.callWithAsyncErrorHandling = callWithAsyncErrorHandling;
  6736. exports.callWithErrorHandling = callWithErrorHandling;
  6737. exports.cloneVNode = cloneVNode;
  6738. exports.compatUtils = compatUtils;
  6739. exports.computed = computed;
  6740. exports.createBlock = createBlock;
  6741. exports.createCommentVNode = createCommentVNode;
  6742. exports.createElementBlock = createElementBlock;
  6743. exports.createElementVNode = createBaseVNode;
  6744. exports.createHydrationRenderer = createHydrationRenderer;
  6745. exports.createPropsRestProxy = createPropsRestProxy;
  6746. exports.createRenderer = createRenderer;
  6747. exports.createSlots = createSlots;
  6748. exports.createStaticVNode = createStaticVNode;
  6749. exports.createTextVNode = createTextVNode;
  6750. exports.createVNode = createVNode;
  6751. exports.defineAsyncComponent = defineAsyncComponent;
  6752. exports.defineComponent = defineComponent;
  6753. exports.defineEmits = defineEmits;
  6754. exports.defineExpose = defineExpose;
  6755. exports.defineModel = defineModel;
  6756. exports.defineOptions = defineOptions;
  6757. exports.defineProps = defineProps;
  6758. exports.defineSlots = defineSlots;
  6759. exports.devtools = devtools;
  6760. exports.getCurrentInstance = getCurrentInstance;
  6761. exports.getTransitionRawChildren = getTransitionRawChildren;
  6762. exports.guardReactiveProps = guardReactiveProps;
  6763. exports.h = h;
  6764. exports.handleError = handleError;
  6765. exports.hasInjectionContext = hasInjectionContext;
  6766. exports.hydrateOnIdle = hydrateOnIdle;
  6767. exports.hydrateOnInteraction = hydrateOnInteraction;
  6768. exports.hydrateOnMediaQuery = hydrateOnMediaQuery;
  6769. exports.hydrateOnVisible = hydrateOnVisible;
  6770. exports.initCustomFormatter = initCustomFormatter;
  6771. exports.inject = inject;
  6772. exports.isMemoSame = isMemoSame;
  6773. exports.isRuntimeOnly = isRuntimeOnly;
  6774. exports.isVNode = isVNode;
  6775. exports.mergeDefaults = mergeDefaults;
  6776. exports.mergeModels = mergeModels;
  6777. exports.mergeProps = mergeProps;
  6778. exports.nextTick = nextTick;
  6779. exports.onActivated = onActivated;
  6780. exports.onBeforeMount = onBeforeMount;
  6781. exports.onBeforeUnmount = onBeforeUnmount;
  6782. exports.onBeforeUpdate = onBeforeUpdate;
  6783. exports.onDeactivated = onDeactivated;
  6784. exports.onErrorCaptured = onErrorCaptured;
  6785. exports.onMounted = onMounted;
  6786. exports.onRenderTracked = onRenderTracked;
  6787. exports.onRenderTriggered = onRenderTriggered;
  6788. exports.onServerPrefetch = onServerPrefetch;
  6789. exports.onUnmounted = onUnmounted;
  6790. exports.onUpdated = onUpdated;
  6791. exports.openBlock = openBlock;
  6792. exports.popScopeId = popScopeId;
  6793. exports.provide = provide;
  6794. exports.pushScopeId = pushScopeId;
  6795. exports.queuePostFlushCb = queuePostFlushCb;
  6796. exports.registerRuntimeCompiler = registerRuntimeCompiler;
  6797. exports.renderList = renderList;
  6798. exports.renderSlot = renderSlot;
  6799. exports.resolveComponent = resolveComponent;
  6800. exports.resolveDirective = resolveDirective;
  6801. exports.resolveDynamicComponent = resolveDynamicComponent;
  6802. exports.resolveFilter = resolveFilter;
  6803. exports.resolveTransitionHooks = resolveTransitionHooks;
  6804. exports.setBlockTracking = setBlockTracking;
  6805. exports.setDevtoolsHook = setDevtoolsHook;
  6806. exports.setTransitionHooks = setTransitionHooks;
  6807. exports.ssrContextKey = ssrContextKey;
  6808. exports.ssrUtils = ssrUtils;
  6809. exports.toHandlers = toHandlers;
  6810. exports.transformVNodeArgs = transformVNodeArgs;
  6811. exports.useAttrs = useAttrs;
  6812. exports.useId = useId;
  6813. exports.useModel = useModel;
  6814. exports.useSSRContext = useSSRContext;
  6815. exports.useSlots = useSlots;
  6816. exports.useTemplateRef = useTemplateRef;
  6817. exports.useTransitionState = useTransitionState;
  6818. exports.version = version;
  6819. exports.warn = warn$1;
  6820. exports.watch = watch;
  6821. exports.watchEffect = watchEffect;
  6822. exports.watchPostEffect = watchPostEffect;
  6823. exports.watchSyncEffect = watchSyncEffect;
  6824. exports.withAsyncContext = withAsyncContext;
  6825. exports.withCtx = withCtx;
  6826. exports.withDefaults = withDefaults;
  6827. exports.withDirectives = withDirectives;
  6828. exports.withMemo = withMemo;
  6829. exports.withScopeId = withScopeId;