runtime-core.esm-bundler.js 246 KB

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