Node-Red configuration
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

vue.runtime.esm-browser.js 327KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209
  1. /**
  2. * vue v3.4.38
  3. * (c) 2018-present Yuxi (Evan) You and Vue contributors
  4. * @license MIT
  5. **/
  6. /*! #__NO_SIDE_EFFECTS__ */
  7. // @__NO_SIDE_EFFECTS__
  8. function makeMap(str, expectsLowerCase) {
  9. const set = new Set(str.split(","));
  10. return (val) => set.has(val);
  11. }
  12. const EMPTY_OBJ = Object.freeze({}) ;
  13. const EMPTY_ARR = Object.freeze([]) ;
  14. const NOOP = () => {
  15. };
  16. const NO = () => false;
  17. const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
  18. (key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
  19. const isModelListener = (key) => key.startsWith("onUpdate:");
  20. const extend = Object.assign;
  21. const remove = (arr, el) => {
  22. const i = arr.indexOf(el);
  23. if (i > -1) {
  24. arr.splice(i, 1);
  25. }
  26. };
  27. const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
  28. const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
  29. const isArray = Array.isArray;
  30. const isMap = (val) => toTypeString(val) === "[object Map]";
  31. const isSet = (val) => toTypeString(val) === "[object Set]";
  32. const isDate = (val) => toTypeString(val) === "[object Date]";
  33. const isRegExp = (val) => toTypeString(val) === "[object RegExp]";
  34. const isFunction = (val) => typeof val === "function";
  35. const isString = (val) => typeof val === "string";
  36. const isSymbol = (val) => typeof val === "symbol";
  37. const isObject = (val) => val !== null && typeof val === "object";
  38. const isPromise = (val) => {
  39. return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch);
  40. };
  41. const objectToString = Object.prototype.toString;
  42. const toTypeString = (value) => objectToString.call(value);
  43. const toRawType = (value) => {
  44. return toTypeString(value).slice(8, -1);
  45. };
  46. const isPlainObject = (val) => toTypeString(val) === "[object Object]";
  47. const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
  48. const isReservedProp = /* @__PURE__ */ makeMap(
  49. // the leading comma is intentional so empty string "" is also included
  50. ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
  51. );
  52. const isBuiltInDirective = /* @__PURE__ */ makeMap(
  53. "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"
  54. );
  55. const cacheStringFunction = (fn) => {
  56. const cache = /* @__PURE__ */ Object.create(null);
  57. return (str) => {
  58. const hit = cache[str];
  59. return hit || (cache[str] = fn(str));
  60. };
  61. };
  62. const camelizeRE = /-(\w)/g;
  63. const camelize = cacheStringFunction((str) => {
  64. return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
  65. });
  66. const hyphenateRE = /\B([A-Z])/g;
  67. const hyphenate = cacheStringFunction(
  68. (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
  69. );
  70. const capitalize = cacheStringFunction((str) => {
  71. return str.charAt(0).toUpperCase() + str.slice(1);
  72. });
  73. const toHandlerKey = cacheStringFunction((str) => {
  74. const s = str ? `on${capitalize(str)}` : ``;
  75. return s;
  76. });
  77. const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
  78. const invokeArrayFns = (fns, ...arg) => {
  79. for (let i = 0; i < fns.length; i++) {
  80. fns[i](...arg);
  81. }
  82. };
  83. const def = (obj, key, value, writable = false) => {
  84. Object.defineProperty(obj, key, {
  85. configurable: true,
  86. enumerable: false,
  87. writable,
  88. value
  89. });
  90. };
  91. const looseToNumber = (val) => {
  92. const n = parseFloat(val);
  93. return isNaN(n) ? val : n;
  94. };
  95. const toNumber = (val) => {
  96. const n = isString(val) ? Number(val) : NaN;
  97. return isNaN(n) ? val : n;
  98. };
  99. let _globalThis;
  100. const getGlobalThis = () => {
  101. return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
  102. };
  103. const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error";
  104. const isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED);
  105. function normalizeStyle(value) {
  106. if (isArray(value)) {
  107. const res = {};
  108. for (let i = 0; i < value.length; i++) {
  109. const item = value[i];
  110. const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item);
  111. if (normalized) {
  112. for (const key in normalized) {
  113. res[key] = normalized[key];
  114. }
  115. }
  116. }
  117. return res;
  118. } else if (isString(value) || isObject(value)) {
  119. return value;
  120. }
  121. }
  122. const listDelimiterRE = /;(?![^(]*\))/g;
  123. const propertyDelimiterRE = /:([^]+)/;
  124. const styleCommentRE = /\/\*[^]*?\*\//g;
  125. function parseStringStyle(cssText) {
  126. const ret = {};
  127. cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
  128. if (item) {
  129. const tmp = item.split(propertyDelimiterRE);
  130. tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
  131. }
  132. });
  133. return ret;
  134. }
  135. function stringifyStyle(styles) {
  136. let ret = "";
  137. if (!styles || isString(styles)) {
  138. return ret;
  139. }
  140. for (const key in styles) {
  141. const value = styles[key];
  142. if (isString(value) || typeof value === "number") {
  143. const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
  144. ret += `${normalizedKey}:${value};`;
  145. }
  146. }
  147. return ret;
  148. }
  149. function normalizeClass(value) {
  150. let res = "";
  151. if (isString(value)) {
  152. res = value;
  153. } else if (isArray(value)) {
  154. for (let i = 0; i < value.length; i++) {
  155. const normalized = normalizeClass(value[i]);
  156. if (normalized) {
  157. res += normalized + " ";
  158. }
  159. }
  160. } else if (isObject(value)) {
  161. for (const name in value) {
  162. if (value[name]) {
  163. res += name + " ";
  164. }
  165. }
  166. }
  167. return res.trim();
  168. }
  169. function normalizeProps(props) {
  170. if (!props) return null;
  171. let { class: klass, style } = props;
  172. if (klass && !isString(klass)) {
  173. props.class = normalizeClass(klass);
  174. }
  175. if (style) {
  176. props.style = normalizeStyle(style);
  177. }
  178. return props;
  179. }
  180. const HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot";
  181. const SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view";
  182. const MATH_TAGS = "annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics";
  183. const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
  184. const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
  185. const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
  186. const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
  187. const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
  188. const isBooleanAttr = /* @__PURE__ */ makeMap(
  189. specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
  190. );
  191. function includeBooleanAttr(value) {
  192. return !!value || value === "";
  193. }
  194. const isKnownHtmlAttr = /* @__PURE__ */ makeMap(
  195. `accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap`
  196. );
  197. const isKnownSvgAttr = /* @__PURE__ */ makeMap(
  198. `xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan`
  199. );
  200. function isRenderableAttrValue(value) {
  201. if (value == null) {
  202. return false;
  203. }
  204. const type = typeof value;
  205. return type === "string" || type === "number" || type === "boolean";
  206. }
  207. function looseCompareArrays(a, b) {
  208. if (a.length !== b.length) return false;
  209. let equal = true;
  210. for (let i = 0; equal && i < a.length; i++) {
  211. equal = looseEqual(a[i], b[i]);
  212. }
  213. return equal;
  214. }
  215. function looseEqual(a, b) {
  216. if (a === b) return true;
  217. let aValidType = isDate(a);
  218. let bValidType = isDate(b);
  219. if (aValidType || bValidType) {
  220. return aValidType && bValidType ? a.getTime() === b.getTime() : false;
  221. }
  222. aValidType = isSymbol(a);
  223. bValidType = isSymbol(b);
  224. if (aValidType || bValidType) {
  225. return a === b;
  226. }
  227. aValidType = isArray(a);
  228. bValidType = isArray(b);
  229. if (aValidType || bValidType) {
  230. return aValidType && bValidType ? looseCompareArrays(a, b) : false;
  231. }
  232. aValidType = isObject(a);
  233. bValidType = isObject(b);
  234. if (aValidType || bValidType) {
  235. if (!aValidType || !bValidType) {
  236. return false;
  237. }
  238. const aKeysCount = Object.keys(a).length;
  239. const bKeysCount = Object.keys(b).length;
  240. if (aKeysCount !== bKeysCount) {
  241. return false;
  242. }
  243. for (const key in a) {
  244. const aHasKey = a.hasOwnProperty(key);
  245. const bHasKey = b.hasOwnProperty(key);
  246. if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) {
  247. return false;
  248. }
  249. }
  250. }
  251. return String(a) === String(b);
  252. }
  253. function looseIndexOf(arr, val) {
  254. return arr.findIndex((item) => looseEqual(item, val));
  255. }
  256. const isRef$1 = (val) => {
  257. return !!(val && val.__v_isRef === true);
  258. };
  259. const toDisplayString = (val) => {
  260. return isString(val) ? val : val == null ? "" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? isRef$1(val) ? toDisplayString(val.value) : JSON.stringify(val, replacer, 2) : String(val);
  261. };
  262. const replacer = (_key, val) => {
  263. if (isRef$1(val)) {
  264. return replacer(_key, val.value);
  265. } else if (isMap(val)) {
  266. return {
  267. [`Map(${val.size})`]: [...val.entries()].reduce(
  268. (entries, [key, val2], i) => {
  269. entries[stringifySymbol(key, i) + " =>"] = val2;
  270. return entries;
  271. },
  272. {}
  273. )
  274. };
  275. } else if (isSet(val)) {
  276. return {
  277. [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))
  278. };
  279. } else if (isSymbol(val)) {
  280. return stringifySymbol(val);
  281. } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
  282. return String(val);
  283. }
  284. return val;
  285. };
  286. const stringifySymbol = (v, i = "") => {
  287. var _a;
  288. return (
  289. // Symbol.description in es2019+ so we need to cast here to pass
  290. // the lib: es2016 check
  291. isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v
  292. );
  293. };
  294. function warn$2(msg, ...args) {
  295. console.warn(`[Vue warn] ${msg}`, ...args);
  296. }
  297. let activeEffectScope;
  298. class EffectScope {
  299. constructor(detached = false) {
  300. this.detached = detached;
  301. /**
  302. * @internal
  303. */
  304. this._active = true;
  305. /**
  306. * @internal
  307. */
  308. this.effects = [];
  309. /**
  310. * @internal
  311. */
  312. this.cleanups = [];
  313. this.parent = activeEffectScope;
  314. if (!detached && activeEffectScope) {
  315. this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(
  316. this
  317. ) - 1;
  318. }
  319. }
  320. get active() {
  321. return this._active;
  322. }
  323. run(fn) {
  324. if (this._active) {
  325. const currentEffectScope = activeEffectScope;
  326. try {
  327. activeEffectScope = this;
  328. return fn();
  329. } finally {
  330. activeEffectScope = currentEffectScope;
  331. }
  332. } else {
  333. warn$2(`cannot run an inactive effect scope.`);
  334. }
  335. }
  336. /**
  337. * This should only be called on non-detached scopes
  338. * @internal
  339. */
  340. on() {
  341. activeEffectScope = this;
  342. }
  343. /**
  344. * This should only be called on non-detached scopes
  345. * @internal
  346. */
  347. off() {
  348. activeEffectScope = this.parent;
  349. }
  350. stop(fromParent) {
  351. if (this._active) {
  352. let i, l;
  353. for (i = 0, l = this.effects.length; i < l; i++) {
  354. this.effects[i].stop();
  355. }
  356. for (i = 0, l = this.cleanups.length; i < l; i++) {
  357. this.cleanups[i]();
  358. }
  359. if (this.scopes) {
  360. for (i = 0, l = this.scopes.length; i < l; i++) {
  361. this.scopes[i].stop(true);
  362. }
  363. }
  364. if (!this.detached && this.parent && !fromParent) {
  365. const last = this.parent.scopes.pop();
  366. if (last && last !== this) {
  367. this.parent.scopes[this.index] = last;
  368. last.index = this.index;
  369. }
  370. }
  371. this.parent = void 0;
  372. this._active = false;
  373. }
  374. }
  375. }
  376. function effectScope(detached) {
  377. return new EffectScope(detached);
  378. }
  379. function recordEffectScope(effect, scope = activeEffectScope) {
  380. if (scope && scope.active) {
  381. scope.effects.push(effect);
  382. }
  383. }
  384. function getCurrentScope() {
  385. return activeEffectScope;
  386. }
  387. function onScopeDispose(fn) {
  388. if (activeEffectScope) {
  389. activeEffectScope.cleanups.push(fn);
  390. } else {
  391. warn$2(
  392. `onScopeDispose() is called when there is no active effect scope to be associated with.`
  393. );
  394. }
  395. }
  396. let activeEffect;
  397. class ReactiveEffect {
  398. constructor(fn, trigger, scheduler, scope) {
  399. this.fn = fn;
  400. this.trigger = trigger;
  401. this.scheduler = scheduler;
  402. this.active = true;
  403. this.deps = [];
  404. /**
  405. * @internal
  406. */
  407. this._dirtyLevel = 4;
  408. /**
  409. * @internal
  410. */
  411. this._trackId = 0;
  412. /**
  413. * @internal
  414. */
  415. this._runnings = 0;
  416. /**
  417. * @internal
  418. */
  419. this._shouldSchedule = false;
  420. /**
  421. * @internal
  422. */
  423. this._depsLength = 0;
  424. recordEffectScope(this, scope);
  425. }
  426. get dirty() {
  427. if (this._dirtyLevel === 2 || this._dirtyLevel === 3) {
  428. this._dirtyLevel = 1;
  429. pauseTracking();
  430. for (let i = 0; i < this._depsLength; i++) {
  431. const dep = this.deps[i];
  432. if (dep.computed) {
  433. triggerComputed(dep.computed);
  434. if (this._dirtyLevel >= 4) {
  435. break;
  436. }
  437. }
  438. }
  439. if (this._dirtyLevel === 1) {
  440. this._dirtyLevel = 0;
  441. }
  442. resetTracking();
  443. }
  444. return this._dirtyLevel >= 4;
  445. }
  446. set dirty(v) {
  447. this._dirtyLevel = v ? 4 : 0;
  448. }
  449. run() {
  450. this._dirtyLevel = 0;
  451. if (!this.active) {
  452. return this.fn();
  453. }
  454. let lastShouldTrack = shouldTrack;
  455. let lastEffect = activeEffect;
  456. try {
  457. shouldTrack = true;
  458. activeEffect = this;
  459. this._runnings++;
  460. preCleanupEffect(this);
  461. return this.fn();
  462. } finally {
  463. postCleanupEffect(this);
  464. this._runnings--;
  465. activeEffect = lastEffect;
  466. shouldTrack = lastShouldTrack;
  467. }
  468. }
  469. stop() {
  470. if (this.active) {
  471. preCleanupEffect(this);
  472. postCleanupEffect(this);
  473. this.onStop && this.onStop();
  474. this.active = false;
  475. }
  476. }
  477. }
  478. function triggerComputed(computed) {
  479. return computed.value;
  480. }
  481. function preCleanupEffect(effect2) {
  482. effect2._trackId++;
  483. effect2._depsLength = 0;
  484. }
  485. function postCleanupEffect(effect2) {
  486. if (effect2.deps.length > effect2._depsLength) {
  487. for (let i = effect2._depsLength; i < effect2.deps.length; i++) {
  488. cleanupDepEffect(effect2.deps[i], effect2);
  489. }
  490. effect2.deps.length = effect2._depsLength;
  491. }
  492. }
  493. function cleanupDepEffect(dep, effect2) {
  494. const trackId = dep.get(effect2);
  495. if (trackId !== void 0 && effect2._trackId !== trackId) {
  496. dep.delete(effect2);
  497. if (dep.size === 0) {
  498. dep.cleanup();
  499. }
  500. }
  501. }
  502. function effect(fn, options) {
  503. if (fn.effect instanceof ReactiveEffect) {
  504. fn = fn.effect.fn;
  505. }
  506. const _effect = new ReactiveEffect(fn, NOOP, () => {
  507. if (_effect.dirty) {
  508. _effect.run();
  509. }
  510. });
  511. if (options) {
  512. extend(_effect, options);
  513. if (options.scope) recordEffectScope(_effect, options.scope);
  514. }
  515. if (!options || !options.lazy) {
  516. _effect.run();
  517. }
  518. const runner = _effect.run.bind(_effect);
  519. runner.effect = _effect;
  520. return runner;
  521. }
  522. function stop(runner) {
  523. runner.effect.stop();
  524. }
  525. let shouldTrack = true;
  526. let pauseScheduleStack = 0;
  527. const trackStack = [];
  528. function pauseTracking() {
  529. trackStack.push(shouldTrack);
  530. shouldTrack = false;
  531. }
  532. function resetTracking() {
  533. const last = trackStack.pop();
  534. shouldTrack = last === void 0 ? true : last;
  535. }
  536. function pauseScheduling() {
  537. pauseScheduleStack++;
  538. }
  539. function resetScheduling() {
  540. pauseScheduleStack--;
  541. while (!pauseScheduleStack && queueEffectSchedulers.length) {
  542. queueEffectSchedulers.shift()();
  543. }
  544. }
  545. function trackEffect(effect2, dep, debuggerEventExtraInfo) {
  546. var _a;
  547. if (dep.get(effect2) !== effect2._trackId) {
  548. dep.set(effect2, effect2._trackId);
  549. const oldDep = effect2.deps[effect2._depsLength];
  550. if (oldDep !== dep) {
  551. if (oldDep) {
  552. cleanupDepEffect(oldDep, effect2);
  553. }
  554. effect2.deps[effect2._depsLength++] = dep;
  555. } else {
  556. effect2._depsLength++;
  557. }
  558. {
  559. (_a = effect2.onTrack) == null ? void 0 : _a.call(effect2, extend({ effect: effect2 }, debuggerEventExtraInfo));
  560. }
  561. }
  562. }
  563. const queueEffectSchedulers = [];
  564. function triggerEffects(dep, dirtyLevel, debuggerEventExtraInfo) {
  565. var _a;
  566. pauseScheduling();
  567. for (const effect2 of dep.keys()) {
  568. let tracking;
  569. if (effect2._dirtyLevel < dirtyLevel && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
  570. effect2._shouldSchedule || (effect2._shouldSchedule = effect2._dirtyLevel === 0);
  571. effect2._dirtyLevel = dirtyLevel;
  572. }
  573. if (effect2._shouldSchedule && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
  574. {
  575. (_a = effect2.onTrigger) == null ? void 0 : _a.call(effect2, extend({ effect: effect2 }, debuggerEventExtraInfo));
  576. }
  577. effect2.trigger();
  578. if ((!effect2._runnings || effect2.allowRecurse) && effect2._dirtyLevel !== 2) {
  579. effect2._shouldSchedule = false;
  580. if (effect2.scheduler) {
  581. queueEffectSchedulers.push(effect2.scheduler);
  582. }
  583. }
  584. }
  585. }
  586. resetScheduling();
  587. }
  588. const createDep = (cleanup, computed) => {
  589. const dep = /* @__PURE__ */ new Map();
  590. dep.cleanup = cleanup;
  591. dep.computed = computed;
  592. return dep;
  593. };
  594. const targetMap = /* @__PURE__ */ new WeakMap();
  595. const ITERATE_KEY = Symbol("iterate" );
  596. const MAP_KEY_ITERATE_KEY = Symbol("Map key iterate" );
  597. function track(target, type, key) {
  598. if (shouldTrack && activeEffect) {
  599. let depsMap = targetMap.get(target);
  600. if (!depsMap) {
  601. targetMap.set(target, depsMap = /* @__PURE__ */ new Map());
  602. }
  603. let dep = depsMap.get(key);
  604. if (!dep) {
  605. depsMap.set(key, dep = createDep(() => depsMap.delete(key)));
  606. }
  607. trackEffect(
  608. activeEffect,
  609. dep,
  610. {
  611. target,
  612. type,
  613. key
  614. }
  615. );
  616. }
  617. }
  618. function trigger(target, type, key, newValue, oldValue, oldTarget) {
  619. const depsMap = targetMap.get(target);
  620. if (!depsMap) {
  621. return;
  622. }
  623. let deps = [];
  624. if (type === "clear") {
  625. deps = [...depsMap.values()];
  626. } else if (key === "length" && isArray(target)) {
  627. const newLength = Number(newValue);
  628. depsMap.forEach((dep, key2) => {
  629. if (key2 === "length" || !isSymbol(key2) && key2 >= newLength) {
  630. deps.push(dep);
  631. }
  632. });
  633. } else {
  634. if (key !== void 0) {
  635. deps.push(depsMap.get(key));
  636. }
  637. switch (type) {
  638. case "add":
  639. if (!isArray(target)) {
  640. deps.push(depsMap.get(ITERATE_KEY));
  641. if (isMap(target)) {
  642. deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
  643. }
  644. } else if (isIntegerKey(key)) {
  645. deps.push(depsMap.get("length"));
  646. }
  647. break;
  648. case "delete":
  649. if (!isArray(target)) {
  650. deps.push(depsMap.get(ITERATE_KEY));
  651. if (isMap(target)) {
  652. deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
  653. }
  654. }
  655. break;
  656. case "set":
  657. if (isMap(target)) {
  658. deps.push(depsMap.get(ITERATE_KEY));
  659. }
  660. break;
  661. }
  662. }
  663. pauseScheduling();
  664. for (const dep of deps) {
  665. if (dep) {
  666. triggerEffects(
  667. dep,
  668. 4,
  669. {
  670. target,
  671. type,
  672. key,
  673. newValue,
  674. oldValue,
  675. oldTarget
  676. }
  677. );
  678. }
  679. }
  680. resetScheduling();
  681. }
  682. function getDepFromReactive(object, key) {
  683. const depsMap = targetMap.get(object);
  684. return depsMap && depsMap.get(key);
  685. }
  686. const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
  687. const builtInSymbols = new Set(
  688. /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
  689. );
  690. const arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations();
  691. function createArrayInstrumentations() {
  692. const instrumentations = {};
  693. ["includes", "indexOf", "lastIndexOf"].forEach((key) => {
  694. instrumentations[key] = function(...args) {
  695. const arr = toRaw(this);
  696. for (let i = 0, l = this.length; i < l; i++) {
  697. track(arr, "get", i + "");
  698. }
  699. const res = arr[key](...args);
  700. if (res === -1 || res === false) {
  701. return arr[key](...args.map(toRaw));
  702. } else {
  703. return res;
  704. }
  705. };
  706. });
  707. ["push", "pop", "shift", "unshift", "splice"].forEach((key) => {
  708. instrumentations[key] = function(...args) {
  709. pauseTracking();
  710. pauseScheduling();
  711. const res = toRaw(this)[key].apply(this, args);
  712. resetScheduling();
  713. resetTracking();
  714. return res;
  715. };
  716. });
  717. return instrumentations;
  718. }
  719. function hasOwnProperty(key) {
  720. if (!isSymbol(key)) key = String(key);
  721. const obj = toRaw(this);
  722. track(obj, "has", key);
  723. return obj.hasOwnProperty(key);
  724. }
  725. class BaseReactiveHandler {
  726. constructor(_isReadonly = false, _isShallow = false) {
  727. this._isReadonly = _isReadonly;
  728. this._isShallow = _isShallow;
  729. }
  730. get(target, key, receiver) {
  731. const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow;
  732. if (key === "__v_isReactive") {
  733. return !isReadonly2;
  734. } else if (key === "__v_isReadonly") {
  735. return isReadonly2;
  736. } else if (key === "__v_isShallow") {
  737. return isShallow2;
  738. } else if (key === "__v_raw") {
  739. if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
  740. // this means the receiver is a user proxy of the reactive proxy
  741. Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
  742. return target;
  743. }
  744. return;
  745. }
  746. const targetIsArray = isArray(target);
  747. if (!isReadonly2) {
  748. if (targetIsArray && hasOwn(arrayInstrumentations, key)) {
  749. return Reflect.get(arrayInstrumentations, key, receiver);
  750. }
  751. if (key === "hasOwnProperty") {
  752. return hasOwnProperty;
  753. }
  754. }
  755. const res = Reflect.get(target, key, receiver);
  756. if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
  757. return res;
  758. }
  759. if (!isReadonly2) {
  760. track(target, "get", key);
  761. }
  762. if (isShallow2) {
  763. return res;
  764. }
  765. if (isRef(res)) {
  766. return targetIsArray && isIntegerKey(key) ? res : res.value;
  767. }
  768. if (isObject(res)) {
  769. return isReadonly2 ? readonly(res) : reactive(res);
  770. }
  771. return res;
  772. }
  773. }
  774. class MutableReactiveHandler extends BaseReactiveHandler {
  775. constructor(isShallow2 = false) {
  776. super(false, isShallow2);
  777. }
  778. set(target, key, value, receiver) {
  779. let oldValue = target[key];
  780. if (!this._isShallow) {
  781. const isOldValueReadonly = isReadonly(oldValue);
  782. if (!isShallow(value) && !isReadonly(value)) {
  783. oldValue = toRaw(oldValue);
  784. value = toRaw(value);
  785. }
  786. if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
  787. if (isOldValueReadonly) {
  788. return false;
  789. } else {
  790. oldValue.value = value;
  791. return true;
  792. }
  793. }
  794. }
  795. const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key);
  796. const result = Reflect.set(target, key, value, receiver);
  797. if (target === toRaw(receiver)) {
  798. if (!hadKey) {
  799. trigger(target, "add", key, value);
  800. } else if (hasChanged(value, oldValue)) {
  801. trigger(target, "set", key, value, oldValue);
  802. }
  803. }
  804. return result;
  805. }
  806. deleteProperty(target, key) {
  807. const hadKey = hasOwn(target, key);
  808. const oldValue = target[key];
  809. const result = Reflect.deleteProperty(target, key);
  810. if (result && hadKey) {
  811. trigger(target, "delete", key, void 0, oldValue);
  812. }
  813. return result;
  814. }
  815. has(target, key) {
  816. const result = Reflect.has(target, key);
  817. if (!isSymbol(key) || !builtInSymbols.has(key)) {
  818. track(target, "has", key);
  819. }
  820. return result;
  821. }
  822. ownKeys(target) {
  823. track(
  824. target,
  825. "iterate",
  826. isArray(target) ? "length" : ITERATE_KEY
  827. );
  828. return Reflect.ownKeys(target);
  829. }
  830. }
  831. class ReadonlyReactiveHandler extends BaseReactiveHandler {
  832. constructor(isShallow2 = false) {
  833. super(true, isShallow2);
  834. }
  835. set(target, key) {
  836. {
  837. warn$2(
  838. `Set operation on key "${String(key)}" failed: target is readonly.`,
  839. target
  840. );
  841. }
  842. return true;
  843. }
  844. deleteProperty(target, key) {
  845. {
  846. warn$2(
  847. `Delete operation on key "${String(key)}" failed: target is readonly.`,
  848. target
  849. );
  850. }
  851. return true;
  852. }
  853. }
  854. const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();
  855. const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();
  856. const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(
  857. true
  858. );
  859. const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true);
  860. const toShallow = (value) => value;
  861. const getProto = (v) => Reflect.getPrototypeOf(v);
  862. function get(target, key, isReadonly2 = false, isShallow2 = false) {
  863. target = target["__v_raw"];
  864. const rawTarget = toRaw(target);
  865. const rawKey = toRaw(key);
  866. if (!isReadonly2) {
  867. if (hasChanged(key, rawKey)) {
  868. track(rawTarget, "get", key);
  869. }
  870. track(rawTarget, "get", rawKey);
  871. }
  872. const { has: has2 } = getProto(rawTarget);
  873. const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
  874. if (has2.call(rawTarget, key)) {
  875. return wrap(target.get(key));
  876. } else if (has2.call(rawTarget, rawKey)) {
  877. return wrap(target.get(rawKey));
  878. } else if (target !== rawTarget) {
  879. target.get(key);
  880. }
  881. }
  882. function has(key, isReadonly2 = false) {
  883. const target = this["__v_raw"];
  884. const rawTarget = toRaw(target);
  885. const rawKey = toRaw(key);
  886. if (!isReadonly2) {
  887. if (hasChanged(key, rawKey)) {
  888. track(rawTarget, "has", key);
  889. }
  890. track(rawTarget, "has", rawKey);
  891. }
  892. return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
  893. }
  894. function size(target, isReadonly2 = false) {
  895. target = target["__v_raw"];
  896. !isReadonly2 && track(toRaw(target), "iterate", ITERATE_KEY);
  897. return Reflect.get(target, "size", target);
  898. }
  899. function add(value, _isShallow = false) {
  900. if (!_isShallow && !isShallow(value) && !isReadonly(value)) {
  901. value = toRaw(value);
  902. }
  903. const target = toRaw(this);
  904. const proto = getProto(target);
  905. const hadKey = proto.has.call(target, value);
  906. if (!hadKey) {
  907. target.add(value);
  908. trigger(target, "add", value, value);
  909. }
  910. return this;
  911. }
  912. function set(key, value, _isShallow = false) {
  913. if (!_isShallow && !isShallow(value) && !isReadonly(value)) {
  914. value = toRaw(value);
  915. }
  916. const target = toRaw(this);
  917. const { has: has2, get: get2 } = getProto(target);
  918. let hadKey = has2.call(target, key);
  919. if (!hadKey) {
  920. key = toRaw(key);
  921. hadKey = has2.call(target, key);
  922. } else {
  923. checkIdentityKeys(target, has2, key);
  924. }
  925. const oldValue = get2.call(target, key);
  926. target.set(key, value);
  927. if (!hadKey) {
  928. trigger(target, "add", key, value);
  929. } else if (hasChanged(value, oldValue)) {
  930. trigger(target, "set", key, value, oldValue);
  931. }
  932. return this;
  933. }
  934. function deleteEntry(key) {
  935. const target = toRaw(this);
  936. const { has: has2, get: get2 } = getProto(target);
  937. let hadKey = has2.call(target, key);
  938. if (!hadKey) {
  939. key = toRaw(key);
  940. hadKey = has2.call(target, key);
  941. } else {
  942. checkIdentityKeys(target, has2, key);
  943. }
  944. const oldValue = get2 ? get2.call(target, key) : void 0;
  945. const result = target.delete(key);
  946. if (hadKey) {
  947. trigger(target, "delete", key, void 0, oldValue);
  948. }
  949. return result;
  950. }
  951. function clear() {
  952. const target = toRaw(this);
  953. const hadItems = target.size !== 0;
  954. const oldTarget = isMap(target) ? new Map(target) : new Set(target) ;
  955. const result = target.clear();
  956. if (hadItems) {
  957. trigger(target, "clear", void 0, void 0, oldTarget);
  958. }
  959. return result;
  960. }
  961. function createForEach(isReadonly2, isShallow2) {
  962. return function forEach(callback, thisArg) {
  963. const observed = this;
  964. const target = observed["__v_raw"];
  965. const rawTarget = toRaw(target);
  966. const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
  967. !isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY);
  968. return target.forEach((value, key) => {
  969. return callback.call(thisArg, wrap(value), wrap(key), observed);
  970. });
  971. };
  972. }
  973. function createIterableMethod(method, isReadonly2, isShallow2) {
  974. return function(...args) {
  975. const target = this["__v_raw"];
  976. const rawTarget = toRaw(target);
  977. const targetIsMap = isMap(rawTarget);
  978. const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
  979. const isKeyOnly = method === "keys" && targetIsMap;
  980. const innerIterator = target[method](...args);
  981. const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
  982. !isReadonly2 && track(
  983. rawTarget,
  984. "iterate",
  985. isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY
  986. );
  987. return {
  988. // iterator protocol
  989. next() {
  990. const { value, done } = innerIterator.next();
  991. return done ? { value, done } : {
  992. value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
  993. done
  994. };
  995. },
  996. // iterable protocol
  997. [Symbol.iterator]() {
  998. return this;
  999. }
  1000. };
  1001. };
  1002. }
  1003. function createReadonlyMethod(type) {
  1004. return function(...args) {
  1005. {
  1006. const key = args[0] ? `on key "${args[0]}" ` : ``;
  1007. warn$2(
  1008. `${capitalize(type)} operation ${key}failed: target is readonly.`,
  1009. toRaw(this)
  1010. );
  1011. }
  1012. return type === "delete" ? false : type === "clear" ? void 0 : this;
  1013. };
  1014. }
  1015. function createInstrumentations() {
  1016. const mutableInstrumentations2 = {
  1017. get(key) {
  1018. return get(this, key);
  1019. },
  1020. get size() {
  1021. return size(this);
  1022. },
  1023. has,
  1024. add,
  1025. set,
  1026. delete: deleteEntry,
  1027. clear,
  1028. forEach: createForEach(false, false)
  1029. };
  1030. const shallowInstrumentations2 = {
  1031. get(key) {
  1032. return get(this, key, false, true);
  1033. },
  1034. get size() {
  1035. return size(this);
  1036. },
  1037. has,
  1038. add(value) {
  1039. return add.call(this, value, true);
  1040. },
  1041. set(key, value) {
  1042. return set.call(this, key, value, true);
  1043. },
  1044. delete: deleteEntry,
  1045. clear,
  1046. forEach: createForEach(false, true)
  1047. };
  1048. const readonlyInstrumentations2 = {
  1049. get(key) {
  1050. return get(this, key, true);
  1051. },
  1052. get size() {
  1053. return size(this, true);
  1054. },
  1055. has(key) {
  1056. return has.call(this, key, true);
  1057. },
  1058. add: createReadonlyMethod("add"),
  1059. set: createReadonlyMethod("set"),
  1060. delete: createReadonlyMethod("delete"),
  1061. clear: createReadonlyMethod("clear"),
  1062. forEach: createForEach(true, false)
  1063. };
  1064. const shallowReadonlyInstrumentations2 = {
  1065. get(key) {
  1066. return get(this, key, true, true);
  1067. },
  1068. get size() {
  1069. return size(this, true);
  1070. },
  1071. has(key) {
  1072. return has.call(this, key, true);
  1073. },
  1074. add: createReadonlyMethod("add"),
  1075. set: createReadonlyMethod("set"),
  1076. delete: createReadonlyMethod("delete"),
  1077. clear: createReadonlyMethod("clear"),
  1078. forEach: createForEach(true, true)
  1079. };
  1080. const iteratorMethods = [
  1081. "keys",
  1082. "values",
  1083. "entries",
  1084. Symbol.iterator
  1085. ];
  1086. iteratorMethods.forEach((method) => {
  1087. mutableInstrumentations2[method] = createIterableMethod(method, false, false);
  1088. readonlyInstrumentations2[method] = createIterableMethod(method, true, false);
  1089. shallowInstrumentations2[method] = createIterableMethod(method, false, true);
  1090. shallowReadonlyInstrumentations2[method] = createIterableMethod(
  1091. method,
  1092. true,
  1093. true
  1094. );
  1095. });
  1096. return [
  1097. mutableInstrumentations2,
  1098. readonlyInstrumentations2,
  1099. shallowInstrumentations2,
  1100. shallowReadonlyInstrumentations2
  1101. ];
  1102. }
  1103. const [
  1104. mutableInstrumentations,
  1105. readonlyInstrumentations,
  1106. shallowInstrumentations,
  1107. shallowReadonlyInstrumentations
  1108. ] = /* @__PURE__ */ createInstrumentations();
  1109. function createInstrumentationGetter(isReadonly2, shallow) {
  1110. const instrumentations = shallow ? isReadonly2 ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly2 ? readonlyInstrumentations : mutableInstrumentations;
  1111. return (target, key, receiver) => {
  1112. if (key === "__v_isReactive") {
  1113. return !isReadonly2;
  1114. } else if (key === "__v_isReadonly") {
  1115. return isReadonly2;
  1116. } else if (key === "__v_raw") {
  1117. return target;
  1118. }
  1119. return Reflect.get(
  1120. hasOwn(instrumentations, key) && key in target ? instrumentations : target,
  1121. key,
  1122. receiver
  1123. );
  1124. };
  1125. }
  1126. const mutableCollectionHandlers = {
  1127. get: /* @__PURE__ */ createInstrumentationGetter(false, false)
  1128. };
  1129. const shallowCollectionHandlers = {
  1130. get: /* @__PURE__ */ createInstrumentationGetter(false, true)
  1131. };
  1132. const readonlyCollectionHandlers = {
  1133. get: /* @__PURE__ */ createInstrumentationGetter(true, false)
  1134. };
  1135. const shallowReadonlyCollectionHandlers = {
  1136. get: /* @__PURE__ */ createInstrumentationGetter(true, true)
  1137. };
  1138. function checkIdentityKeys(target, has2, key) {
  1139. const rawKey = toRaw(key);
  1140. if (rawKey !== key && has2.call(target, rawKey)) {
  1141. const type = toRawType(target);
  1142. warn$2(
  1143. `Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`
  1144. );
  1145. }
  1146. }
  1147. const reactiveMap = /* @__PURE__ */ new WeakMap();
  1148. const shallowReactiveMap = /* @__PURE__ */ new WeakMap();
  1149. const readonlyMap = /* @__PURE__ */ new WeakMap();
  1150. const shallowReadonlyMap = /* @__PURE__ */ new WeakMap();
  1151. function targetTypeMap(rawType) {
  1152. switch (rawType) {
  1153. case "Object":
  1154. case "Array":
  1155. return 1 /* COMMON */;
  1156. case "Map":
  1157. case "Set":
  1158. case "WeakMap":
  1159. case "WeakSet":
  1160. return 2 /* COLLECTION */;
  1161. default:
  1162. return 0 /* INVALID */;
  1163. }
  1164. }
  1165. function getTargetType(value) {
  1166. return value["__v_skip"] || !Object.isExtensible(value) ? 0 /* INVALID */ : targetTypeMap(toRawType(value));
  1167. }
  1168. function reactive(target) {
  1169. if (isReadonly(target)) {
  1170. return target;
  1171. }
  1172. return createReactiveObject(
  1173. target,
  1174. false,
  1175. mutableHandlers,
  1176. mutableCollectionHandlers,
  1177. reactiveMap
  1178. );
  1179. }
  1180. function shallowReactive(target) {
  1181. return createReactiveObject(
  1182. target,
  1183. false,
  1184. shallowReactiveHandlers,
  1185. shallowCollectionHandlers,
  1186. shallowReactiveMap
  1187. );
  1188. }
  1189. function readonly(target) {
  1190. return createReactiveObject(
  1191. target,
  1192. true,
  1193. readonlyHandlers,
  1194. readonlyCollectionHandlers,
  1195. readonlyMap
  1196. );
  1197. }
  1198. function shallowReadonly(target) {
  1199. return createReactiveObject(
  1200. target,
  1201. true,
  1202. shallowReadonlyHandlers,
  1203. shallowReadonlyCollectionHandlers,
  1204. shallowReadonlyMap
  1205. );
  1206. }
  1207. function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
  1208. if (!isObject(target)) {
  1209. {
  1210. warn$2(
  1211. `value cannot be made ${isReadonly2 ? "readonly" : "reactive"}: ${String(
  1212. target
  1213. )}`
  1214. );
  1215. }
  1216. return target;
  1217. }
  1218. if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
  1219. return target;
  1220. }
  1221. const existingProxy = proxyMap.get(target);
  1222. if (existingProxy) {
  1223. return existingProxy;
  1224. }
  1225. const targetType = getTargetType(target);
  1226. if (targetType === 0 /* INVALID */) {
  1227. return target;
  1228. }
  1229. const proxy = new Proxy(
  1230. target,
  1231. targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers
  1232. );
  1233. proxyMap.set(target, proxy);
  1234. return proxy;
  1235. }
  1236. function isReactive(value) {
  1237. if (isReadonly(value)) {
  1238. return isReactive(value["__v_raw"]);
  1239. }
  1240. return !!(value && value["__v_isReactive"]);
  1241. }
  1242. function isReadonly(value) {
  1243. return !!(value && value["__v_isReadonly"]);
  1244. }
  1245. function isShallow(value) {
  1246. return !!(value && value["__v_isShallow"]);
  1247. }
  1248. function isProxy(value) {
  1249. return value ? !!value["__v_raw"] : false;
  1250. }
  1251. function toRaw(observed) {
  1252. const raw = observed && observed["__v_raw"];
  1253. return raw ? toRaw(raw) : observed;
  1254. }
  1255. function markRaw(value) {
  1256. if (Object.isExtensible(value)) {
  1257. def(value, "__v_skip", true);
  1258. }
  1259. return value;
  1260. }
  1261. const toReactive = (value) => isObject(value) ? reactive(value) : value;
  1262. const toReadonly = (value) => isObject(value) ? readonly(value) : value;
  1263. const COMPUTED_SIDE_EFFECT_WARN = `Computed is still dirty after getter evaluation, likely because a computed is mutating its own dependency in its getter. State mutations in computed getters should be avoided. Check the docs for more details: https://vuejs.org/guide/essentials/computed.html#getters-should-be-side-effect-free`;
  1264. class ComputedRefImpl {
  1265. constructor(getter, _setter, isReadonly, isSSR) {
  1266. this.getter = getter;
  1267. this._setter = _setter;
  1268. this.dep = void 0;
  1269. this.__v_isRef = true;
  1270. this["__v_isReadonly"] = false;
  1271. this.effect = new ReactiveEffect(
  1272. () => getter(this._value),
  1273. () => triggerRefValue(
  1274. this,
  1275. this.effect._dirtyLevel === 2 ? 2 : 3
  1276. )
  1277. );
  1278. this.effect.computed = this;
  1279. this.effect.active = this._cacheable = !isSSR;
  1280. this["__v_isReadonly"] = isReadonly;
  1281. }
  1282. get value() {
  1283. const self = toRaw(this);
  1284. if ((!self._cacheable || self.effect.dirty) && hasChanged(self._value, self._value = self.effect.run())) {
  1285. triggerRefValue(self, 4);
  1286. }
  1287. trackRefValue(self);
  1288. if (self.effect._dirtyLevel >= 2) {
  1289. if (this._warnRecursive) {
  1290. warn$2(COMPUTED_SIDE_EFFECT_WARN, `
  1291. getter: `, this.getter);
  1292. }
  1293. triggerRefValue(self, 2);
  1294. }
  1295. return self._value;
  1296. }
  1297. set value(newValue) {
  1298. this._setter(newValue);
  1299. }
  1300. // #region polyfill _dirty for backward compatibility third party code for Vue <= 3.3.x
  1301. get _dirty() {
  1302. return this.effect.dirty;
  1303. }
  1304. set _dirty(v) {
  1305. this.effect.dirty = v;
  1306. }
  1307. // #endregion
  1308. }
  1309. function computed$1(getterOrOptions, debugOptions, isSSR = false) {
  1310. let getter;
  1311. let setter;
  1312. const onlyGetter = isFunction(getterOrOptions);
  1313. if (onlyGetter) {
  1314. getter = getterOrOptions;
  1315. setter = () => {
  1316. warn$2("Write operation failed: computed value is readonly");
  1317. } ;
  1318. } else {
  1319. getter = getterOrOptions.get;
  1320. setter = getterOrOptions.set;
  1321. }
  1322. const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR);
  1323. if (debugOptions && !isSSR) {
  1324. cRef.effect.onTrack = debugOptions.onTrack;
  1325. cRef.effect.onTrigger = debugOptions.onTrigger;
  1326. }
  1327. return cRef;
  1328. }
  1329. function trackRefValue(ref2) {
  1330. var _a;
  1331. if (shouldTrack && activeEffect) {
  1332. ref2 = toRaw(ref2);
  1333. trackEffect(
  1334. activeEffect,
  1335. (_a = ref2.dep) != null ? _a : ref2.dep = createDep(
  1336. () => ref2.dep = void 0,
  1337. ref2 instanceof ComputedRefImpl ? ref2 : void 0
  1338. ),
  1339. {
  1340. target: ref2,
  1341. type: "get",
  1342. key: "value"
  1343. }
  1344. );
  1345. }
  1346. }
  1347. function triggerRefValue(ref2, dirtyLevel = 4, newVal, oldVal) {
  1348. ref2 = toRaw(ref2);
  1349. const dep = ref2.dep;
  1350. if (dep) {
  1351. triggerEffects(
  1352. dep,
  1353. dirtyLevel,
  1354. {
  1355. target: ref2,
  1356. type: "set",
  1357. key: "value",
  1358. newValue: newVal,
  1359. oldValue: oldVal
  1360. }
  1361. );
  1362. }
  1363. }
  1364. function isRef(r) {
  1365. return !!(r && r.__v_isRef === true);
  1366. }
  1367. function ref(value) {
  1368. return createRef(value, false);
  1369. }
  1370. function shallowRef(value) {
  1371. return createRef(value, true);
  1372. }
  1373. function createRef(rawValue, shallow) {
  1374. if (isRef(rawValue)) {
  1375. return rawValue;
  1376. }
  1377. return new RefImpl(rawValue, shallow);
  1378. }
  1379. class RefImpl {
  1380. constructor(value, __v_isShallow) {
  1381. this.__v_isShallow = __v_isShallow;
  1382. this.dep = void 0;
  1383. this.__v_isRef = true;
  1384. this._rawValue = __v_isShallow ? value : toRaw(value);
  1385. this._value = __v_isShallow ? value : toReactive(value);
  1386. }
  1387. get value() {
  1388. trackRefValue(this);
  1389. return this._value;
  1390. }
  1391. set value(newVal) {
  1392. const useDirectValue = this.__v_isShallow || isShallow(newVal) || isReadonly(newVal);
  1393. newVal = useDirectValue ? newVal : toRaw(newVal);
  1394. if (hasChanged(newVal, this._rawValue)) {
  1395. const oldVal = this._rawValue;
  1396. this._rawValue = newVal;
  1397. this._value = useDirectValue ? newVal : toReactive(newVal);
  1398. triggerRefValue(this, 4, newVal, oldVal);
  1399. }
  1400. }
  1401. }
  1402. function triggerRef(ref2) {
  1403. triggerRefValue(ref2, 4, ref2.value );
  1404. }
  1405. function unref(ref2) {
  1406. return isRef(ref2) ? ref2.value : ref2;
  1407. }
  1408. function toValue(source) {
  1409. return isFunction(source) ? source() : unref(source);
  1410. }
  1411. const shallowUnwrapHandlers = {
  1412. get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)),
  1413. set: (target, key, value, receiver) => {
  1414. const oldValue = target[key];
  1415. if (isRef(oldValue) && !isRef(value)) {
  1416. oldValue.value = value;
  1417. return true;
  1418. } else {
  1419. return Reflect.set(target, key, value, receiver);
  1420. }
  1421. }
  1422. };
  1423. function proxyRefs(objectWithRefs) {
  1424. return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
  1425. }
  1426. class CustomRefImpl {
  1427. constructor(factory) {
  1428. this.dep = void 0;
  1429. this.__v_isRef = true;
  1430. const { get, set } = factory(
  1431. () => trackRefValue(this),
  1432. () => triggerRefValue(this)
  1433. );
  1434. this._get = get;
  1435. this._set = set;
  1436. }
  1437. get value() {
  1438. return this._get();
  1439. }
  1440. set value(newVal) {
  1441. this._set(newVal);
  1442. }
  1443. }
  1444. function customRef(factory) {
  1445. return new CustomRefImpl(factory);
  1446. }
  1447. function toRefs(object) {
  1448. if (!isProxy(object)) {
  1449. warn$2(`toRefs() expects a reactive object but received a plain one.`);
  1450. }
  1451. const ret = isArray(object) ? new Array(object.length) : {};
  1452. for (const key in object) {
  1453. ret[key] = propertyToRef(object, key);
  1454. }
  1455. return ret;
  1456. }
  1457. class ObjectRefImpl {
  1458. constructor(_object, _key, _defaultValue) {
  1459. this._object = _object;
  1460. this._key = _key;
  1461. this._defaultValue = _defaultValue;
  1462. this.__v_isRef = true;
  1463. }
  1464. get value() {
  1465. const val = this._object[this._key];
  1466. return val === void 0 ? this._defaultValue : val;
  1467. }
  1468. set value(newVal) {
  1469. this._object[this._key] = newVal;
  1470. }
  1471. get dep() {
  1472. return getDepFromReactive(toRaw(this._object), this._key);
  1473. }
  1474. }
  1475. class GetterRefImpl {
  1476. constructor(_getter) {
  1477. this._getter = _getter;
  1478. this.__v_isRef = true;
  1479. this.__v_isReadonly = true;
  1480. }
  1481. get value() {
  1482. return this._getter();
  1483. }
  1484. }
  1485. function toRef(source, key, defaultValue) {
  1486. if (isRef(source)) {
  1487. return source;
  1488. } else if (isFunction(source)) {
  1489. return new GetterRefImpl(source);
  1490. } else if (isObject(source) && arguments.length > 1) {
  1491. return propertyToRef(source, key, defaultValue);
  1492. } else {
  1493. return ref(source);
  1494. }
  1495. }
  1496. function propertyToRef(source, key, defaultValue) {
  1497. const val = source[key];
  1498. return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);
  1499. }
  1500. const TrackOpTypes = {
  1501. "GET": "get",
  1502. "HAS": "has",
  1503. "ITERATE": "iterate"
  1504. };
  1505. const TriggerOpTypes = {
  1506. "SET": "set",
  1507. "ADD": "add",
  1508. "DELETE": "delete",
  1509. "CLEAR": "clear"
  1510. };
  1511. const stack = [];
  1512. function pushWarningContext(vnode) {
  1513. stack.push(vnode);
  1514. }
  1515. function popWarningContext() {
  1516. stack.pop();
  1517. }
  1518. let isWarning = false;
  1519. function warn$1(msg, ...args) {
  1520. if (isWarning) return;
  1521. isWarning = true;
  1522. pauseTracking();
  1523. const instance = stack.length ? stack[stack.length - 1].component : null;
  1524. const appWarnHandler = instance && instance.appContext.config.warnHandler;
  1525. const trace = getComponentTrace();
  1526. if (appWarnHandler) {
  1527. callWithErrorHandling(
  1528. appWarnHandler,
  1529. instance,
  1530. 11,
  1531. [
  1532. // eslint-disable-next-line no-restricted-syntax
  1533. msg + args.map((a) => {
  1534. var _a, _b;
  1535. return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a);
  1536. }).join(""),
  1537. instance && instance.proxy,
  1538. trace.map(
  1539. ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`
  1540. ).join("\n"),
  1541. trace
  1542. ]
  1543. );
  1544. } else {
  1545. const warnArgs = [`[Vue warn]: ${msg}`, ...args];
  1546. if (trace.length && // avoid spamming console during tests
  1547. true) {
  1548. warnArgs.push(`
  1549. `, ...formatTrace(trace));
  1550. }
  1551. console.warn(...warnArgs);
  1552. }
  1553. resetTracking();
  1554. isWarning = false;
  1555. }
  1556. function getComponentTrace() {
  1557. let currentVNode = stack[stack.length - 1];
  1558. if (!currentVNode) {
  1559. return [];
  1560. }
  1561. const normalizedStack = [];
  1562. while (currentVNode) {
  1563. const last = normalizedStack[0];
  1564. if (last && last.vnode === currentVNode) {
  1565. last.recurseCount++;
  1566. } else {
  1567. normalizedStack.push({
  1568. vnode: currentVNode,
  1569. recurseCount: 0
  1570. });
  1571. }
  1572. const parentInstance = currentVNode.component && currentVNode.component.parent;
  1573. currentVNode = parentInstance && parentInstance.vnode;
  1574. }
  1575. return normalizedStack;
  1576. }
  1577. function formatTrace(trace) {
  1578. const logs = [];
  1579. trace.forEach((entry, i) => {
  1580. logs.push(...i === 0 ? [] : [`
  1581. `], ...formatTraceEntry(entry));
  1582. });
  1583. return logs;
  1584. }
  1585. function formatTraceEntry({ vnode, recurseCount }) {
  1586. const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
  1587. const isRoot = vnode.component ? vnode.component.parent == null : false;
  1588. const open = ` at <${formatComponentName(
  1589. vnode.component,
  1590. vnode.type,
  1591. isRoot
  1592. )}`;
  1593. const close = `>` + postfix;
  1594. return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close];
  1595. }
  1596. function formatProps(props) {
  1597. const res = [];
  1598. const keys = Object.keys(props);
  1599. keys.slice(0, 3).forEach((key) => {
  1600. res.push(...formatProp(key, props[key]));
  1601. });
  1602. if (keys.length > 3) {
  1603. res.push(` ...`);
  1604. }
  1605. return res;
  1606. }
  1607. function formatProp(key, value, raw) {
  1608. if (isString(value)) {
  1609. value = JSON.stringify(value);
  1610. return raw ? value : [`${key}=${value}`];
  1611. } else if (typeof value === "number" || typeof value === "boolean" || value == null) {
  1612. return raw ? value : [`${key}=${value}`];
  1613. } else if (isRef(value)) {
  1614. value = formatProp(key, toRaw(value.value), true);
  1615. return raw ? value : [`${key}=Ref<`, value, `>`];
  1616. } else if (isFunction(value)) {
  1617. return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];
  1618. } else {
  1619. value = toRaw(value);
  1620. return raw ? value : [`${key}=`, value];
  1621. }
  1622. }
  1623. function assertNumber(val, type) {
  1624. if (val === void 0) {
  1625. return;
  1626. } else if (typeof val !== "number") {
  1627. warn$1(`${type} is not a valid number - got ${JSON.stringify(val)}.`);
  1628. } else if (isNaN(val)) {
  1629. warn$1(`${type} is NaN - the duration expression might be incorrect.`);
  1630. }
  1631. }
  1632. const ErrorCodes = {
  1633. "SETUP_FUNCTION": 0,
  1634. "0": "SETUP_FUNCTION",
  1635. "RENDER_FUNCTION": 1,
  1636. "1": "RENDER_FUNCTION",
  1637. "WATCH_GETTER": 2,
  1638. "2": "WATCH_GETTER",
  1639. "WATCH_CALLBACK": 3,
  1640. "3": "WATCH_CALLBACK",
  1641. "WATCH_CLEANUP": 4,
  1642. "4": "WATCH_CLEANUP",
  1643. "NATIVE_EVENT_HANDLER": 5,
  1644. "5": "NATIVE_EVENT_HANDLER",
  1645. "COMPONENT_EVENT_HANDLER": 6,
  1646. "6": "COMPONENT_EVENT_HANDLER",
  1647. "VNODE_HOOK": 7,
  1648. "7": "VNODE_HOOK",
  1649. "DIRECTIVE_HOOK": 8,
  1650. "8": "DIRECTIVE_HOOK",
  1651. "TRANSITION_HOOK": 9,
  1652. "9": "TRANSITION_HOOK",
  1653. "APP_ERROR_HANDLER": 10,
  1654. "10": "APP_ERROR_HANDLER",
  1655. "APP_WARN_HANDLER": 11,
  1656. "11": "APP_WARN_HANDLER",
  1657. "FUNCTION_REF": 12,
  1658. "12": "FUNCTION_REF",
  1659. "ASYNC_COMPONENT_LOADER": 13,
  1660. "13": "ASYNC_COMPONENT_LOADER",
  1661. "SCHEDULER": 14,
  1662. "14": "SCHEDULER",
  1663. "COMPONENT_UPDATE": 15,
  1664. "15": "COMPONENT_UPDATE"
  1665. };
  1666. const ErrorTypeStrings$1 = {
  1667. ["sp"]: "serverPrefetch hook",
  1668. ["bc"]: "beforeCreate hook",
  1669. ["c"]: "created hook",
  1670. ["bm"]: "beforeMount hook",
  1671. ["m"]: "mounted hook",
  1672. ["bu"]: "beforeUpdate hook",
  1673. ["u"]: "updated",
  1674. ["bum"]: "beforeUnmount hook",
  1675. ["um"]: "unmounted hook",
  1676. ["a"]: "activated hook",
  1677. ["da"]: "deactivated hook",
  1678. ["ec"]: "errorCaptured hook",
  1679. ["rtc"]: "renderTracked hook",
  1680. ["rtg"]: "renderTriggered hook",
  1681. [0]: "setup function",
  1682. [1]: "render function",
  1683. [2]: "watcher getter",
  1684. [3]: "watcher callback",
  1685. [4]: "watcher cleanup function",
  1686. [5]: "native event handler",
  1687. [6]: "component event handler",
  1688. [7]: "vnode hook",
  1689. [8]: "directive hook",
  1690. [9]: "transition hook",
  1691. [10]: "app errorHandler",
  1692. [11]: "app warnHandler",
  1693. [12]: "ref function",
  1694. [13]: "async component loader",
  1695. [14]: "scheduler flush",
  1696. [15]: "component update"
  1697. };
  1698. function callWithErrorHandling(fn, instance, type, args) {
  1699. try {
  1700. return args ? fn(...args) : fn();
  1701. } catch (err) {
  1702. handleError(err, instance, type);
  1703. }
  1704. }
  1705. function callWithAsyncErrorHandling(fn, instance, type, args) {
  1706. if (isFunction(fn)) {
  1707. const res = callWithErrorHandling(fn, instance, type, args);
  1708. if (res && isPromise(res)) {
  1709. res.catch((err) => {
  1710. handleError(err, instance, type);
  1711. });
  1712. }
  1713. return res;
  1714. }
  1715. if (isArray(fn)) {
  1716. const values = [];
  1717. for (let i = 0; i < fn.length; i++) {
  1718. values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
  1719. }
  1720. return values;
  1721. } else {
  1722. warn$1(
  1723. `Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}`
  1724. );
  1725. }
  1726. }
  1727. function handleError(err, instance, type, throwInDev = true) {
  1728. const contextVNode = instance ? instance.vnode : null;
  1729. if (instance) {
  1730. let cur = instance.parent;
  1731. const exposedInstance = instance.proxy;
  1732. const errorInfo = ErrorTypeStrings$1[type] ;
  1733. while (cur) {
  1734. const errorCapturedHooks = cur.ec;
  1735. if (errorCapturedHooks) {
  1736. for (let i = 0; i < errorCapturedHooks.length; i++) {
  1737. if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
  1738. return;
  1739. }
  1740. }
  1741. }
  1742. cur = cur.parent;
  1743. }
  1744. const appErrorHandler = instance.appContext.config.errorHandler;
  1745. if (appErrorHandler) {
  1746. pauseTracking();
  1747. callWithErrorHandling(
  1748. appErrorHandler,
  1749. null,
  1750. 10,
  1751. [err, exposedInstance, errorInfo]
  1752. );
  1753. resetTracking();
  1754. return;
  1755. }
  1756. }
  1757. logError(err, type, contextVNode, throwInDev);
  1758. }
  1759. function logError(err, type, contextVNode, throwInDev = true) {
  1760. {
  1761. const info = ErrorTypeStrings$1[type];
  1762. if (contextVNode) {
  1763. pushWarningContext(contextVNode);
  1764. }
  1765. warn$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
  1766. if (contextVNode) {
  1767. popWarningContext();
  1768. }
  1769. if (throwInDev) {
  1770. throw err;
  1771. } else {
  1772. console.error(err);
  1773. }
  1774. }
  1775. }
  1776. let isFlushing = false;
  1777. let isFlushPending = false;
  1778. const queue = [];
  1779. let flushIndex = 0;
  1780. const pendingPostFlushCbs = [];
  1781. let activePostFlushCbs = null;
  1782. let postFlushIndex = 0;
  1783. const resolvedPromise = /* @__PURE__ */ Promise.resolve();
  1784. let currentFlushPromise = null;
  1785. const RECURSION_LIMIT = 100;
  1786. function nextTick(fn) {
  1787. const p = currentFlushPromise || resolvedPromise;
  1788. return fn ? p.then(this ? fn.bind(this) : fn) : p;
  1789. }
  1790. function findInsertionIndex(id) {
  1791. let start = flushIndex + 1;
  1792. let end = queue.length;
  1793. while (start < end) {
  1794. const middle = start + end >>> 1;
  1795. const middleJob = queue[middle];
  1796. const middleJobId = getId(middleJob);
  1797. if (middleJobId < id || middleJobId === id && middleJob.pre) {
  1798. start = middle + 1;
  1799. } else {
  1800. end = middle;
  1801. }
  1802. }
  1803. return start;
  1804. }
  1805. function queueJob(job) {
  1806. if (!queue.length || !queue.includes(
  1807. job,
  1808. isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex
  1809. )) {
  1810. if (job.id == null) {
  1811. queue.push(job);
  1812. } else {
  1813. queue.splice(findInsertionIndex(job.id), 0, job);
  1814. }
  1815. queueFlush();
  1816. }
  1817. }
  1818. function queueFlush() {
  1819. if (!isFlushing && !isFlushPending) {
  1820. isFlushPending = true;
  1821. currentFlushPromise = resolvedPromise.then(flushJobs);
  1822. }
  1823. }
  1824. function invalidateJob(job) {
  1825. const i = queue.indexOf(job);
  1826. if (i > flushIndex) {
  1827. queue.splice(i, 1);
  1828. }
  1829. }
  1830. function queuePostFlushCb(cb) {
  1831. if (!isArray(cb)) {
  1832. if (!activePostFlushCbs || !activePostFlushCbs.includes(
  1833. cb,
  1834. cb.allowRecurse ? postFlushIndex + 1 : postFlushIndex
  1835. )) {
  1836. pendingPostFlushCbs.push(cb);
  1837. }
  1838. } else {
  1839. pendingPostFlushCbs.push(...cb);
  1840. }
  1841. queueFlush();
  1842. }
  1843. function flushPreFlushCbs(instance, seen, i = isFlushing ? flushIndex + 1 : 0) {
  1844. {
  1845. seen = seen || /* @__PURE__ */ new Map();
  1846. }
  1847. for (; i < queue.length; i++) {
  1848. const cb = queue[i];
  1849. if (cb && cb.pre) {
  1850. if (instance && cb.id !== instance.uid) {
  1851. continue;
  1852. }
  1853. if (checkRecursiveUpdates(seen, cb)) {
  1854. continue;
  1855. }
  1856. queue.splice(i, 1);
  1857. i--;
  1858. cb();
  1859. }
  1860. }
  1861. }
  1862. function flushPostFlushCbs(seen) {
  1863. if (pendingPostFlushCbs.length) {
  1864. const deduped = [...new Set(pendingPostFlushCbs)].sort(
  1865. (a, b) => getId(a) - getId(b)
  1866. );
  1867. pendingPostFlushCbs.length = 0;
  1868. if (activePostFlushCbs) {
  1869. activePostFlushCbs.push(...deduped);
  1870. return;
  1871. }
  1872. activePostFlushCbs = deduped;
  1873. {
  1874. seen = seen || /* @__PURE__ */ new Map();
  1875. }
  1876. for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
  1877. const cb = activePostFlushCbs[postFlushIndex];
  1878. if (checkRecursiveUpdates(seen, cb)) {
  1879. continue;
  1880. }
  1881. if (cb.active !== false) cb();
  1882. }
  1883. activePostFlushCbs = null;
  1884. postFlushIndex = 0;
  1885. }
  1886. }
  1887. const getId = (job) => job.id == null ? Infinity : job.id;
  1888. const comparator = (a, b) => {
  1889. const diff = getId(a) - getId(b);
  1890. if (diff === 0) {
  1891. if (a.pre && !b.pre) return -1;
  1892. if (b.pre && !a.pre) return 1;
  1893. }
  1894. return diff;
  1895. };
  1896. function flushJobs(seen) {
  1897. isFlushPending = false;
  1898. isFlushing = true;
  1899. {
  1900. seen = seen || /* @__PURE__ */ new Map();
  1901. }
  1902. queue.sort(comparator);
  1903. const check = (job) => checkRecursiveUpdates(seen, job) ;
  1904. try {
  1905. for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
  1906. const job = queue[flushIndex];
  1907. if (job && job.active !== false) {
  1908. if (check(job)) {
  1909. continue;
  1910. }
  1911. callWithErrorHandling(
  1912. job,
  1913. job.i,
  1914. job.i ? 15 : 14
  1915. );
  1916. }
  1917. }
  1918. } finally {
  1919. flushIndex = 0;
  1920. queue.length = 0;
  1921. flushPostFlushCbs(seen);
  1922. isFlushing = false;
  1923. currentFlushPromise = null;
  1924. if (queue.length || pendingPostFlushCbs.length) {
  1925. flushJobs(seen);
  1926. }
  1927. }
  1928. }
  1929. function checkRecursiveUpdates(seen, fn) {
  1930. if (!seen.has(fn)) {
  1931. seen.set(fn, 1);
  1932. } else {
  1933. const count = seen.get(fn);
  1934. if (count > RECURSION_LIMIT) {
  1935. const instance = fn.i;
  1936. const componentName = instance && getComponentName(instance.type);
  1937. handleError(
  1938. `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.`,
  1939. null,
  1940. 10
  1941. );
  1942. return true;
  1943. } else {
  1944. seen.set(fn, count + 1);
  1945. }
  1946. }
  1947. }
  1948. let isHmrUpdating = false;
  1949. const hmrDirtyComponents = /* @__PURE__ */ new Map();
  1950. {
  1951. getGlobalThis().__VUE_HMR_RUNTIME__ = {
  1952. createRecord: tryWrap(createRecord),
  1953. rerender: tryWrap(rerender),
  1954. reload: tryWrap(reload)
  1955. };
  1956. }
  1957. const map = /* @__PURE__ */ new Map();
  1958. function registerHMR(instance) {
  1959. const id = instance.type.__hmrId;
  1960. let record = map.get(id);
  1961. if (!record) {
  1962. createRecord(id, instance.type);
  1963. record = map.get(id);
  1964. }
  1965. record.instances.add(instance);
  1966. }
  1967. function unregisterHMR(instance) {
  1968. map.get(instance.type.__hmrId).instances.delete(instance);
  1969. }
  1970. function createRecord(id, initialDef) {
  1971. if (map.has(id)) {
  1972. return false;
  1973. }
  1974. map.set(id, {
  1975. initialDef: normalizeClassComponent(initialDef),
  1976. instances: /* @__PURE__ */ new Set()
  1977. });
  1978. return true;
  1979. }
  1980. function normalizeClassComponent(component) {
  1981. return isClassComponent(component) ? component.__vccOpts : component;
  1982. }
  1983. function rerender(id, newRender) {
  1984. const record = map.get(id);
  1985. if (!record) {
  1986. return;
  1987. }
  1988. record.initialDef.render = newRender;
  1989. [...record.instances].forEach((instance) => {
  1990. if (newRender) {
  1991. instance.render = newRender;
  1992. normalizeClassComponent(instance.type).render = newRender;
  1993. }
  1994. instance.renderCache = [];
  1995. isHmrUpdating = true;
  1996. instance.effect.dirty = true;
  1997. instance.update();
  1998. isHmrUpdating = false;
  1999. });
  2000. }
  2001. function reload(id, newComp) {
  2002. const record = map.get(id);
  2003. if (!record) return;
  2004. newComp = normalizeClassComponent(newComp);
  2005. updateComponentDef(record.initialDef, newComp);
  2006. const instances = [...record.instances];
  2007. for (let i = 0; i < instances.length; i++) {
  2008. const instance = instances[i];
  2009. const oldComp = normalizeClassComponent(instance.type);
  2010. let dirtyInstances = hmrDirtyComponents.get(oldComp);
  2011. if (!dirtyInstances) {
  2012. if (oldComp !== record.initialDef) {
  2013. updateComponentDef(oldComp, newComp);
  2014. }
  2015. hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
  2016. }
  2017. dirtyInstances.add(instance);
  2018. instance.appContext.propsCache.delete(instance.type);
  2019. instance.appContext.emitsCache.delete(instance.type);
  2020. instance.appContext.optionsCache.delete(instance.type);
  2021. if (instance.ceReload) {
  2022. dirtyInstances.add(instance);
  2023. instance.ceReload(newComp.styles);
  2024. dirtyInstances.delete(instance);
  2025. } else if (instance.parent) {
  2026. instance.parent.effect.dirty = true;
  2027. queueJob(() => {
  2028. instance.parent.update();
  2029. dirtyInstances.delete(instance);
  2030. });
  2031. } else if (instance.appContext.reload) {
  2032. instance.appContext.reload();
  2033. } else if (typeof window !== "undefined") {
  2034. window.location.reload();
  2035. } else {
  2036. console.warn(
  2037. "[HMR] Root or manually mounted instance modified. Full reload required."
  2038. );
  2039. }
  2040. }
  2041. queuePostFlushCb(() => {
  2042. hmrDirtyComponents.clear();
  2043. });
  2044. }
  2045. function updateComponentDef(oldComp, newComp) {
  2046. extend(oldComp, newComp);
  2047. for (const key in oldComp) {
  2048. if (key !== "__file" && !(key in newComp)) {
  2049. delete oldComp[key];
  2050. }
  2051. }
  2052. }
  2053. function tryWrap(fn) {
  2054. return (id, arg) => {
  2055. try {
  2056. return fn(id, arg);
  2057. } catch (e) {
  2058. console.error(e);
  2059. console.warn(
  2060. `[HMR] Something went wrong during Vue component hot-reload. Full reload required.`
  2061. );
  2062. }
  2063. };
  2064. }
  2065. let devtools$1;
  2066. let buffer = [];
  2067. let devtoolsNotInstalled = false;
  2068. function emit$1(event, ...args) {
  2069. if (devtools$1) {
  2070. devtools$1.emit(event, ...args);
  2071. } else if (!devtoolsNotInstalled) {
  2072. buffer.push({ event, args });
  2073. }
  2074. }
  2075. function setDevtoolsHook$1(hook, target) {
  2076. var _a, _b;
  2077. devtools$1 = hook;
  2078. if (devtools$1) {
  2079. devtools$1.enabled = true;
  2080. buffer.forEach(({ event, args }) => devtools$1.emit(event, ...args));
  2081. buffer = [];
  2082. } else if (
  2083. // handle late devtools injection - only do this if we are in an actual
  2084. // browser environment to avoid the timer handle stalling test runner exit
  2085. // (#4815)
  2086. typeof window !== "undefined" && // some envs mock window but not fully
  2087. window.HTMLElement && // also exclude jsdom
  2088. // eslint-disable-next-line no-restricted-syntax
  2089. !((_b = (_a = window.navigator) == null ? void 0 : _a.userAgent) == null ? void 0 : _b.includes("jsdom"))
  2090. ) {
  2091. const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || [];
  2092. replay.push((newHook) => {
  2093. setDevtoolsHook$1(newHook, target);
  2094. });
  2095. setTimeout(() => {
  2096. if (!devtools$1) {
  2097. target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null;
  2098. devtoolsNotInstalled = true;
  2099. buffer = [];
  2100. }
  2101. }, 3e3);
  2102. } else {
  2103. devtoolsNotInstalled = true;
  2104. buffer = [];
  2105. }
  2106. }
  2107. function devtoolsInitApp(app, version) {
  2108. emit$1("app:init" /* APP_INIT */, app, version, {
  2109. Fragment,
  2110. Text,
  2111. Comment,
  2112. Static
  2113. });
  2114. }
  2115. function devtoolsUnmountApp(app) {
  2116. emit$1("app:unmount" /* APP_UNMOUNT */, app);
  2117. }
  2118. const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook(
  2119. "component:added" /* COMPONENT_ADDED */
  2120. );
  2121. const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook("component:updated" /* COMPONENT_UPDATED */);
  2122. const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook(
  2123. "component:removed" /* COMPONENT_REMOVED */
  2124. );
  2125. const devtoolsComponentRemoved = (component) => {
  2126. if (devtools$1 && typeof devtools$1.cleanupBuffer === "function" && // remove the component if it wasn't buffered
  2127. !devtools$1.cleanupBuffer(component)) {
  2128. _devtoolsComponentRemoved(component);
  2129. }
  2130. };
  2131. /*! #__NO_SIDE_EFFECTS__ */
  2132. // @__NO_SIDE_EFFECTS__
  2133. function createDevtoolsComponentHook(hook) {
  2134. return (component) => {
  2135. emit$1(
  2136. hook,
  2137. component.appContext.app,
  2138. component.uid,
  2139. component.parent ? component.parent.uid : void 0,
  2140. component
  2141. );
  2142. };
  2143. }
  2144. const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook(
  2145. "perf:start" /* PERFORMANCE_START */
  2146. );
  2147. const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook(
  2148. "perf:end" /* PERFORMANCE_END */
  2149. );
  2150. function createDevtoolsPerformanceHook(hook) {
  2151. return (component, type, time) => {
  2152. emit$1(hook, component.appContext.app, component.uid, component, type, time);
  2153. };
  2154. }
  2155. function devtoolsComponentEmit(component, event, params) {
  2156. emit$1(
  2157. "component:emit" /* COMPONENT_EMIT */,
  2158. component.appContext.app,
  2159. component,
  2160. event,
  2161. params
  2162. );
  2163. }
  2164. let currentRenderingInstance = null;
  2165. let currentScopeId = null;
  2166. function setCurrentRenderingInstance(instance) {
  2167. const prev = currentRenderingInstance;
  2168. currentRenderingInstance = instance;
  2169. currentScopeId = instance && instance.type.__scopeId || null;
  2170. return prev;
  2171. }
  2172. function pushScopeId(id) {
  2173. currentScopeId = id;
  2174. }
  2175. function popScopeId() {
  2176. currentScopeId = null;
  2177. }
  2178. const withScopeId = (_id) => withCtx;
  2179. function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
  2180. if (!ctx) return fn;
  2181. if (fn._n) {
  2182. return fn;
  2183. }
  2184. const renderFnWithContext = (...args) => {
  2185. if (renderFnWithContext._d) {
  2186. setBlockTracking(-1);
  2187. }
  2188. const prevInstance = setCurrentRenderingInstance(ctx);
  2189. let res;
  2190. try {
  2191. res = fn(...args);
  2192. } finally {
  2193. setCurrentRenderingInstance(prevInstance);
  2194. if (renderFnWithContext._d) {
  2195. setBlockTracking(1);
  2196. }
  2197. }
  2198. {
  2199. devtoolsComponentUpdated(ctx);
  2200. }
  2201. return res;
  2202. };
  2203. renderFnWithContext._n = true;
  2204. renderFnWithContext._c = true;
  2205. renderFnWithContext._d = true;
  2206. return renderFnWithContext;
  2207. }
  2208. function validateDirectiveName(name) {
  2209. if (isBuiltInDirective(name)) {
  2210. warn$1("Do not use built-in directive ids as custom directive id: " + name);
  2211. }
  2212. }
  2213. function withDirectives(vnode, directives) {
  2214. if (currentRenderingInstance === null) {
  2215. warn$1(`withDirectives can only be used inside render functions.`);
  2216. return vnode;
  2217. }
  2218. const instance = getComponentPublicInstance(currentRenderingInstance);
  2219. const bindings = vnode.dirs || (vnode.dirs = []);
  2220. for (let i = 0; i < directives.length; i++) {
  2221. let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];
  2222. if (dir) {
  2223. if (isFunction(dir)) {
  2224. dir = {
  2225. mounted: dir,
  2226. updated: dir
  2227. };
  2228. }
  2229. if (dir.deep) {
  2230. traverse(value);
  2231. }
  2232. bindings.push({
  2233. dir,
  2234. instance,
  2235. value,
  2236. oldValue: void 0,
  2237. arg,
  2238. modifiers
  2239. });
  2240. }
  2241. }
  2242. return vnode;
  2243. }
  2244. function invokeDirectiveHook(vnode, prevVNode, instance, name) {
  2245. const bindings = vnode.dirs;
  2246. const oldBindings = prevVNode && prevVNode.dirs;
  2247. for (let i = 0; i < bindings.length; i++) {
  2248. const binding = bindings[i];
  2249. if (oldBindings) {
  2250. binding.oldValue = oldBindings[i].value;
  2251. }
  2252. let hook = binding.dir[name];
  2253. if (hook) {
  2254. pauseTracking();
  2255. callWithAsyncErrorHandling(hook, instance, 8, [
  2256. vnode.el,
  2257. binding,
  2258. vnode,
  2259. prevVNode
  2260. ]);
  2261. resetTracking();
  2262. }
  2263. }
  2264. }
  2265. const leaveCbKey = Symbol("_leaveCb");
  2266. const enterCbKey$1 = Symbol("_enterCb");
  2267. function useTransitionState() {
  2268. const state = {
  2269. isMounted: false,
  2270. isLeaving: false,
  2271. isUnmounting: false,
  2272. leavingVNodes: /* @__PURE__ */ new Map()
  2273. };
  2274. onMounted(() => {
  2275. state.isMounted = true;
  2276. });
  2277. onBeforeUnmount(() => {
  2278. state.isUnmounting = true;
  2279. });
  2280. return state;
  2281. }
  2282. const TransitionHookValidator = [Function, Array];
  2283. const BaseTransitionPropsValidators = {
  2284. mode: String,
  2285. appear: Boolean,
  2286. persisted: Boolean,
  2287. // enter
  2288. onBeforeEnter: TransitionHookValidator,
  2289. onEnter: TransitionHookValidator,
  2290. onAfterEnter: TransitionHookValidator,
  2291. onEnterCancelled: TransitionHookValidator,
  2292. // leave
  2293. onBeforeLeave: TransitionHookValidator,
  2294. onLeave: TransitionHookValidator,
  2295. onAfterLeave: TransitionHookValidator,
  2296. onLeaveCancelled: TransitionHookValidator,
  2297. // appear
  2298. onBeforeAppear: TransitionHookValidator,
  2299. onAppear: TransitionHookValidator,
  2300. onAfterAppear: TransitionHookValidator,
  2301. onAppearCancelled: TransitionHookValidator
  2302. };
  2303. const recursiveGetSubtree = (instance) => {
  2304. const subTree = instance.subTree;
  2305. return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
  2306. };
  2307. const BaseTransitionImpl = {
  2308. name: `BaseTransition`,
  2309. props: BaseTransitionPropsValidators,
  2310. setup(props, { slots }) {
  2311. const instance = getCurrentInstance();
  2312. const state = useTransitionState();
  2313. return () => {
  2314. const children = slots.default && getTransitionRawChildren(slots.default(), true);
  2315. if (!children || !children.length) {
  2316. return;
  2317. }
  2318. let child = children[0];
  2319. if (children.length > 1) {
  2320. let hasFound = false;
  2321. for (const c of children) {
  2322. if (c.type !== Comment) {
  2323. if (hasFound) {
  2324. warn$1(
  2325. "<transition> can only be used on a single element or component. Use <transition-group> for lists."
  2326. );
  2327. break;
  2328. }
  2329. child = c;
  2330. hasFound = true;
  2331. }
  2332. }
  2333. }
  2334. const rawProps = toRaw(props);
  2335. const { mode } = rawProps;
  2336. if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") {
  2337. warn$1(`invalid <transition> mode: ${mode}`);
  2338. }
  2339. if (state.isLeaving) {
  2340. return emptyPlaceholder(child);
  2341. }
  2342. const innerChild = getKeepAliveChild(child);
  2343. if (!innerChild) {
  2344. return emptyPlaceholder(child);
  2345. }
  2346. let enterHooks = resolveTransitionHooks(
  2347. innerChild,
  2348. rawProps,
  2349. state,
  2350. instance,
  2351. // #11061, ensure enterHooks is fresh after clone
  2352. (hooks) => enterHooks = hooks
  2353. );
  2354. setTransitionHooks(innerChild, enterHooks);
  2355. const oldChild = instance.subTree;
  2356. const oldInnerChild = oldChild && getKeepAliveChild(oldChild);
  2357. if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) {
  2358. const leavingHooks = resolveTransitionHooks(
  2359. oldInnerChild,
  2360. rawProps,
  2361. state,
  2362. instance
  2363. );
  2364. setTransitionHooks(oldInnerChild, leavingHooks);
  2365. if (mode === "out-in" && innerChild.type !== Comment) {
  2366. state.isLeaving = true;
  2367. leavingHooks.afterLeave = () => {
  2368. state.isLeaving = false;
  2369. if (instance.update.active !== false) {
  2370. instance.effect.dirty = true;
  2371. instance.update();
  2372. }
  2373. };
  2374. return emptyPlaceholder(child);
  2375. } else if (mode === "in-out" && innerChild.type !== Comment) {
  2376. leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
  2377. const leavingVNodesCache = getLeavingNodesForType(
  2378. state,
  2379. oldInnerChild
  2380. );
  2381. leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
  2382. el[leaveCbKey] = () => {
  2383. earlyRemove();
  2384. el[leaveCbKey] = void 0;
  2385. delete enterHooks.delayedLeave;
  2386. };
  2387. enterHooks.delayedLeave = delayedLeave;
  2388. };
  2389. }
  2390. }
  2391. return child;
  2392. };
  2393. }
  2394. };
  2395. const BaseTransition = BaseTransitionImpl;
  2396. function getLeavingNodesForType(state, vnode) {
  2397. const { leavingVNodes } = state;
  2398. let leavingVNodesCache = leavingVNodes.get(vnode.type);
  2399. if (!leavingVNodesCache) {
  2400. leavingVNodesCache = /* @__PURE__ */ Object.create(null);
  2401. leavingVNodes.set(vnode.type, leavingVNodesCache);
  2402. }
  2403. return leavingVNodesCache;
  2404. }
  2405. function resolveTransitionHooks(vnode, props, state, instance, postClone) {
  2406. const {
  2407. appear,
  2408. mode,
  2409. persisted = false,
  2410. onBeforeEnter,
  2411. onEnter,
  2412. onAfterEnter,
  2413. onEnterCancelled,
  2414. onBeforeLeave,
  2415. onLeave,
  2416. onAfterLeave,
  2417. onLeaveCancelled,
  2418. onBeforeAppear,
  2419. onAppear,
  2420. onAfterAppear,
  2421. onAppearCancelled
  2422. } = props;
  2423. const key = String(vnode.key);
  2424. const leavingVNodesCache = getLeavingNodesForType(state, vnode);
  2425. const callHook = (hook, args) => {
  2426. hook && callWithAsyncErrorHandling(
  2427. hook,
  2428. instance,
  2429. 9,
  2430. args
  2431. );
  2432. };
  2433. const callAsyncHook = (hook, args) => {
  2434. const done = args[1];
  2435. callHook(hook, args);
  2436. if (isArray(hook)) {
  2437. if (hook.every((hook2) => hook2.length <= 1)) done();
  2438. } else if (hook.length <= 1) {
  2439. done();
  2440. }
  2441. };
  2442. const hooks = {
  2443. mode,
  2444. persisted,
  2445. beforeEnter(el) {
  2446. let hook = onBeforeEnter;
  2447. if (!state.isMounted) {
  2448. if (appear) {
  2449. hook = onBeforeAppear || onBeforeEnter;
  2450. } else {
  2451. return;
  2452. }
  2453. }
  2454. if (el[leaveCbKey]) {
  2455. el[leaveCbKey](
  2456. true
  2457. /* cancelled */
  2458. );
  2459. }
  2460. const leavingVNode = leavingVNodesCache[key];
  2461. if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
  2462. leavingVNode.el[leaveCbKey]();
  2463. }
  2464. callHook(hook, [el]);
  2465. },
  2466. enter(el) {
  2467. let hook = onEnter;
  2468. let afterHook = onAfterEnter;
  2469. let cancelHook = onEnterCancelled;
  2470. if (!state.isMounted) {
  2471. if (appear) {
  2472. hook = onAppear || onEnter;
  2473. afterHook = onAfterAppear || onAfterEnter;
  2474. cancelHook = onAppearCancelled || onEnterCancelled;
  2475. } else {
  2476. return;
  2477. }
  2478. }
  2479. let called = false;
  2480. const done = el[enterCbKey$1] = (cancelled) => {
  2481. if (called) return;
  2482. called = true;
  2483. if (cancelled) {
  2484. callHook(cancelHook, [el]);
  2485. } else {
  2486. callHook(afterHook, [el]);
  2487. }
  2488. if (hooks.delayedLeave) {
  2489. hooks.delayedLeave();
  2490. }
  2491. el[enterCbKey$1] = void 0;
  2492. };
  2493. if (hook) {
  2494. callAsyncHook(hook, [el, done]);
  2495. } else {
  2496. done();
  2497. }
  2498. },
  2499. leave(el, remove) {
  2500. const key2 = String(vnode.key);
  2501. if (el[enterCbKey$1]) {
  2502. el[enterCbKey$1](
  2503. true
  2504. /* cancelled */
  2505. );
  2506. }
  2507. if (state.isUnmounting) {
  2508. return remove();
  2509. }
  2510. callHook(onBeforeLeave, [el]);
  2511. let called = false;
  2512. const done = el[leaveCbKey] = (cancelled) => {
  2513. if (called) return;
  2514. called = true;
  2515. remove();
  2516. if (cancelled) {
  2517. callHook(onLeaveCancelled, [el]);
  2518. } else {
  2519. callHook(onAfterLeave, [el]);
  2520. }
  2521. el[leaveCbKey] = void 0;
  2522. if (leavingVNodesCache[key2] === vnode) {
  2523. delete leavingVNodesCache[key2];
  2524. }
  2525. };
  2526. leavingVNodesCache[key2] = vnode;
  2527. if (onLeave) {
  2528. callAsyncHook(onLeave, [el, done]);
  2529. } else {
  2530. done();
  2531. }
  2532. },
  2533. clone(vnode2) {
  2534. const hooks2 = resolveTransitionHooks(
  2535. vnode2,
  2536. props,
  2537. state,
  2538. instance,
  2539. postClone
  2540. );
  2541. if (postClone) postClone(hooks2);
  2542. return hooks2;
  2543. }
  2544. };
  2545. return hooks;
  2546. }
  2547. function emptyPlaceholder(vnode) {
  2548. if (isKeepAlive(vnode)) {
  2549. vnode = cloneVNode(vnode);
  2550. vnode.children = null;
  2551. return vnode;
  2552. }
  2553. }
  2554. function getKeepAliveChild(vnode) {
  2555. if (!isKeepAlive(vnode)) {
  2556. return vnode;
  2557. }
  2558. if (vnode.component) {
  2559. return vnode.component.subTree;
  2560. }
  2561. const { shapeFlag, children } = vnode;
  2562. if (children) {
  2563. if (shapeFlag & 16) {
  2564. return children[0];
  2565. }
  2566. if (shapeFlag & 32 && isFunction(children.default)) {
  2567. return children.default();
  2568. }
  2569. }
  2570. }
  2571. function setTransitionHooks(vnode, hooks) {
  2572. if (vnode.shapeFlag & 6 && vnode.component) {
  2573. setTransitionHooks(vnode.component.subTree, hooks);
  2574. } else if (vnode.shapeFlag & 128) {
  2575. vnode.ssContent.transition = hooks.clone(vnode.ssContent);
  2576. vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
  2577. } else {
  2578. vnode.transition = hooks;
  2579. }
  2580. }
  2581. function getTransitionRawChildren(children, keepComment = false, parentKey) {
  2582. let ret = [];
  2583. let keyedFragmentCount = 0;
  2584. for (let i = 0; i < children.length; i++) {
  2585. let child = children[i];
  2586. const key = parentKey == null ? child.key : String(parentKey) + String(child.key != null ? child.key : i);
  2587. if (child.type === Fragment) {
  2588. if (child.patchFlag & 128) keyedFragmentCount++;
  2589. ret = ret.concat(
  2590. getTransitionRawChildren(child.children, keepComment, key)
  2591. );
  2592. } else if (keepComment || child.type !== Comment) {
  2593. ret.push(key != null ? cloneVNode(child, { key }) : child);
  2594. }
  2595. }
  2596. if (keyedFragmentCount > 1) {
  2597. for (let i = 0; i < ret.length; i++) {
  2598. ret[i].patchFlag = -2;
  2599. }
  2600. }
  2601. return ret;
  2602. }
  2603. /*! #__NO_SIDE_EFFECTS__ */
  2604. // @__NO_SIDE_EFFECTS__
  2605. function defineComponent(options, extraOptions) {
  2606. return isFunction(options) ? (
  2607. // #8326: extend call and options.name access are considered side-effects
  2608. // by Rollup, so we have to wrap it in a pure-annotated IIFE.
  2609. /* @__PURE__ */ (() => extend({ name: options.name }, extraOptions, { setup: options }))()
  2610. ) : options;
  2611. }
  2612. const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
  2613. /*! #__NO_SIDE_EFFECTS__ */
  2614. // @__NO_SIDE_EFFECTS__
  2615. function defineAsyncComponent(source) {
  2616. if (isFunction(source)) {
  2617. source = { loader: source };
  2618. }
  2619. const {
  2620. loader,
  2621. loadingComponent,
  2622. errorComponent,
  2623. delay = 200,
  2624. timeout,
  2625. // undefined = never times out
  2626. suspensible = true,
  2627. onError: userOnError
  2628. } = source;
  2629. let pendingRequest = null;
  2630. let resolvedComp;
  2631. let retries = 0;
  2632. const retry = () => {
  2633. retries++;
  2634. pendingRequest = null;
  2635. return load();
  2636. };
  2637. const load = () => {
  2638. let thisRequest;
  2639. return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
  2640. err = err instanceof Error ? err : new Error(String(err));
  2641. if (userOnError) {
  2642. return new Promise((resolve, reject) => {
  2643. const userRetry = () => resolve(retry());
  2644. const userFail = () => reject(err);
  2645. userOnError(err, userRetry, userFail, retries + 1);
  2646. });
  2647. } else {
  2648. throw err;
  2649. }
  2650. }).then((comp) => {
  2651. if (thisRequest !== pendingRequest && pendingRequest) {
  2652. return pendingRequest;
  2653. }
  2654. if (!comp) {
  2655. warn$1(
  2656. `Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.`
  2657. );
  2658. }
  2659. if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
  2660. comp = comp.default;
  2661. }
  2662. if (comp && !isObject(comp) && !isFunction(comp)) {
  2663. throw new Error(`Invalid async component load result: ${comp}`);
  2664. }
  2665. resolvedComp = comp;
  2666. return comp;
  2667. }));
  2668. };
  2669. return defineComponent({
  2670. name: "AsyncComponentWrapper",
  2671. __asyncLoader: load,
  2672. get __asyncResolved() {
  2673. return resolvedComp;
  2674. },
  2675. setup() {
  2676. const instance = currentInstance;
  2677. if (resolvedComp) {
  2678. return () => createInnerComp(resolvedComp, instance);
  2679. }
  2680. const onError = (err) => {
  2681. pendingRequest = null;
  2682. handleError(
  2683. err,
  2684. instance,
  2685. 13,
  2686. !errorComponent
  2687. );
  2688. };
  2689. if (suspensible && instance.suspense || false) {
  2690. return load().then((comp) => {
  2691. return () => createInnerComp(comp, instance);
  2692. }).catch((err) => {
  2693. onError(err);
  2694. return () => errorComponent ? createVNode(errorComponent, {
  2695. error: err
  2696. }) : null;
  2697. });
  2698. }
  2699. const loaded = ref(false);
  2700. const error = ref();
  2701. const delayed = ref(!!delay);
  2702. if (delay) {
  2703. setTimeout(() => {
  2704. delayed.value = false;
  2705. }, delay);
  2706. }
  2707. if (timeout != null) {
  2708. setTimeout(() => {
  2709. if (!loaded.value && !error.value) {
  2710. const err = new Error(
  2711. `Async component timed out after ${timeout}ms.`
  2712. );
  2713. onError(err);
  2714. error.value = err;
  2715. }
  2716. }, timeout);
  2717. }
  2718. load().then(() => {
  2719. loaded.value = true;
  2720. if (instance.parent && isKeepAlive(instance.parent.vnode)) {
  2721. instance.parent.effect.dirty = true;
  2722. queueJob(instance.parent.update);
  2723. }
  2724. }).catch((err) => {
  2725. onError(err);
  2726. error.value = err;
  2727. });
  2728. return () => {
  2729. if (loaded.value && resolvedComp) {
  2730. return createInnerComp(resolvedComp, instance);
  2731. } else if (error.value && errorComponent) {
  2732. return createVNode(errorComponent, {
  2733. error: error.value
  2734. });
  2735. } else if (loadingComponent && !delayed.value) {
  2736. return createVNode(loadingComponent);
  2737. }
  2738. };
  2739. }
  2740. });
  2741. }
  2742. function createInnerComp(comp, parent) {
  2743. const { ref: ref2, props, children, ce } = parent.vnode;
  2744. const vnode = createVNode(comp, props, children);
  2745. vnode.ref = ref2;
  2746. vnode.ce = ce;
  2747. delete parent.vnode.ce;
  2748. return vnode;
  2749. }
  2750. const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
  2751. const KeepAliveImpl = {
  2752. name: `KeepAlive`,
  2753. // Marker for special handling inside the renderer. We are not using a ===
  2754. // check directly on KeepAlive in the renderer, because importing it directly
  2755. // would prevent it from being tree-shaken.
  2756. __isKeepAlive: true,
  2757. props: {
  2758. include: [String, RegExp, Array],
  2759. exclude: [String, RegExp, Array],
  2760. max: [String, Number]
  2761. },
  2762. setup(props, { slots }) {
  2763. const instance = getCurrentInstance();
  2764. const sharedContext = instance.ctx;
  2765. const cache = /* @__PURE__ */ new Map();
  2766. const keys = /* @__PURE__ */ new Set();
  2767. let current = null;
  2768. {
  2769. instance.__v_cache = cache;
  2770. }
  2771. const parentSuspense = instance.suspense;
  2772. const {
  2773. renderer: {
  2774. p: patch,
  2775. m: move,
  2776. um: _unmount,
  2777. o: { createElement }
  2778. }
  2779. } = sharedContext;
  2780. const storageContainer = createElement("div");
  2781. sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
  2782. const instance2 = vnode.component;
  2783. move(vnode, container, anchor, 0, parentSuspense);
  2784. patch(
  2785. instance2.vnode,
  2786. vnode,
  2787. container,
  2788. anchor,
  2789. instance2,
  2790. parentSuspense,
  2791. namespace,
  2792. vnode.slotScopeIds,
  2793. optimized
  2794. );
  2795. queuePostRenderEffect(() => {
  2796. instance2.isDeactivated = false;
  2797. if (instance2.a) {
  2798. invokeArrayFns(instance2.a);
  2799. }
  2800. const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
  2801. if (vnodeHook) {
  2802. invokeVNodeHook(vnodeHook, instance2.parent, vnode);
  2803. }
  2804. }, parentSuspense);
  2805. {
  2806. devtoolsComponentAdded(instance2);
  2807. }
  2808. };
  2809. sharedContext.deactivate = (vnode) => {
  2810. const instance2 = vnode.component;
  2811. invalidateMount(instance2.m);
  2812. invalidateMount(instance2.a);
  2813. move(vnode, storageContainer, null, 1, parentSuspense);
  2814. queuePostRenderEffect(() => {
  2815. if (instance2.da) {
  2816. invokeArrayFns(instance2.da);
  2817. }
  2818. const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
  2819. if (vnodeHook) {
  2820. invokeVNodeHook(vnodeHook, instance2.parent, vnode);
  2821. }
  2822. instance2.isDeactivated = true;
  2823. }, parentSuspense);
  2824. {
  2825. devtoolsComponentAdded(instance2);
  2826. }
  2827. };
  2828. function unmount(vnode) {
  2829. resetShapeFlag(vnode);
  2830. _unmount(vnode, instance, parentSuspense, true);
  2831. }
  2832. function pruneCache(filter) {
  2833. cache.forEach((vnode, key) => {
  2834. const name = getComponentName(vnode.type);
  2835. if (name && (!filter || !filter(name))) {
  2836. pruneCacheEntry(key);
  2837. }
  2838. });
  2839. }
  2840. function pruneCacheEntry(key) {
  2841. const cached = cache.get(key);
  2842. if (cached && (!current || !isSameVNodeType(cached, current))) {
  2843. unmount(cached);
  2844. } else if (current) {
  2845. resetShapeFlag(current);
  2846. }
  2847. cache.delete(key);
  2848. keys.delete(key);
  2849. }
  2850. watch(
  2851. () => [props.include, props.exclude],
  2852. ([include, exclude]) => {
  2853. include && pruneCache((name) => matches(include, name));
  2854. exclude && pruneCache((name) => !matches(exclude, name));
  2855. },
  2856. // prune post-render after `current` has been updated
  2857. { flush: "post", deep: true }
  2858. );
  2859. let pendingCacheKey = null;
  2860. const cacheSubtree = () => {
  2861. if (pendingCacheKey != null) {
  2862. if (isSuspense(instance.subTree.type)) {
  2863. queuePostRenderEffect(() => {
  2864. cache.set(pendingCacheKey, getInnerChild(instance.subTree));
  2865. }, instance.subTree.suspense);
  2866. } else {
  2867. cache.set(pendingCacheKey, getInnerChild(instance.subTree));
  2868. }
  2869. }
  2870. };
  2871. onMounted(cacheSubtree);
  2872. onUpdated(cacheSubtree);
  2873. onBeforeUnmount(() => {
  2874. cache.forEach((cached) => {
  2875. const { subTree, suspense } = instance;
  2876. const vnode = getInnerChild(subTree);
  2877. if (cached.type === vnode.type && cached.key === vnode.key) {
  2878. resetShapeFlag(vnode);
  2879. const da = vnode.component.da;
  2880. da && queuePostRenderEffect(da, suspense);
  2881. return;
  2882. }
  2883. unmount(cached);
  2884. });
  2885. });
  2886. return () => {
  2887. pendingCacheKey = null;
  2888. if (!slots.default) {
  2889. return null;
  2890. }
  2891. const children = slots.default();
  2892. const rawVNode = children[0];
  2893. if (children.length > 1) {
  2894. {
  2895. warn$1(`KeepAlive should contain exactly one component child.`);
  2896. }
  2897. current = null;
  2898. return children;
  2899. } else if (!isVNode(rawVNode) || !(rawVNode.shapeFlag & 4) && !(rawVNode.shapeFlag & 128)) {
  2900. current = null;
  2901. return rawVNode;
  2902. }
  2903. let vnode = getInnerChild(rawVNode);
  2904. if (vnode.type === Comment) {
  2905. current = null;
  2906. return vnode;
  2907. }
  2908. const comp = vnode.type;
  2909. const name = getComponentName(
  2910. isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp
  2911. );
  2912. const { include, exclude, max } = props;
  2913. if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) {
  2914. current = vnode;
  2915. return rawVNode;
  2916. }
  2917. const key = vnode.key == null ? comp : vnode.key;
  2918. const cachedVNode = cache.get(key);
  2919. if (vnode.el) {
  2920. vnode = cloneVNode(vnode);
  2921. if (rawVNode.shapeFlag & 128) {
  2922. rawVNode.ssContent = vnode;
  2923. }
  2924. }
  2925. pendingCacheKey = key;
  2926. if (cachedVNode) {
  2927. vnode.el = cachedVNode.el;
  2928. vnode.component = cachedVNode.component;
  2929. if (vnode.transition) {
  2930. setTransitionHooks(vnode, vnode.transition);
  2931. }
  2932. vnode.shapeFlag |= 512;
  2933. keys.delete(key);
  2934. keys.add(key);
  2935. } else {
  2936. keys.add(key);
  2937. if (max && keys.size > parseInt(max, 10)) {
  2938. pruneCacheEntry(keys.values().next().value);
  2939. }
  2940. }
  2941. vnode.shapeFlag |= 256;
  2942. current = vnode;
  2943. return isSuspense(rawVNode.type) ? rawVNode : vnode;
  2944. };
  2945. }
  2946. };
  2947. const KeepAlive = KeepAliveImpl;
  2948. function matches(pattern, name) {
  2949. if (isArray(pattern)) {
  2950. return pattern.some((p) => matches(p, name));
  2951. } else if (isString(pattern)) {
  2952. return pattern.split(",").includes(name);
  2953. } else if (isRegExp(pattern)) {
  2954. return pattern.test(name);
  2955. }
  2956. return false;
  2957. }
  2958. function onActivated(hook, target) {
  2959. registerKeepAliveHook(hook, "a", target);
  2960. }
  2961. function onDeactivated(hook, target) {
  2962. registerKeepAliveHook(hook, "da", target);
  2963. }
  2964. function registerKeepAliveHook(hook, type, target = currentInstance) {
  2965. const wrappedHook = hook.__wdc || (hook.__wdc = () => {
  2966. let current = target;
  2967. while (current) {
  2968. if (current.isDeactivated) {
  2969. return;
  2970. }
  2971. current = current.parent;
  2972. }
  2973. return hook();
  2974. });
  2975. injectHook(type, wrappedHook, target);
  2976. if (target) {
  2977. let current = target.parent;
  2978. while (current && current.parent) {
  2979. if (isKeepAlive(current.parent.vnode)) {
  2980. injectToKeepAliveRoot(wrappedHook, type, target, current);
  2981. }
  2982. current = current.parent;
  2983. }
  2984. }
  2985. }
  2986. function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
  2987. const injected = injectHook(
  2988. type,
  2989. hook,
  2990. keepAliveRoot,
  2991. true
  2992. /* prepend */
  2993. );
  2994. onUnmounted(() => {
  2995. remove(keepAliveRoot[type], injected);
  2996. }, target);
  2997. }
  2998. function resetShapeFlag(vnode) {
  2999. vnode.shapeFlag &= ~256;
  3000. vnode.shapeFlag &= ~512;
  3001. }
  3002. function getInnerChild(vnode) {
  3003. return vnode.shapeFlag & 128 ? vnode.ssContent : vnode;
  3004. }
  3005. function injectHook(type, hook, target = currentInstance, prepend = false) {
  3006. if (target) {
  3007. const hooks = target[type] || (target[type] = []);
  3008. const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
  3009. pauseTracking();
  3010. const reset = setCurrentInstance(target);
  3011. const res = callWithAsyncErrorHandling(hook, target, type, args);
  3012. reset();
  3013. resetTracking();
  3014. return res;
  3015. });
  3016. if (prepend) {
  3017. hooks.unshift(wrappedHook);
  3018. } else {
  3019. hooks.push(wrappedHook);
  3020. }
  3021. return wrappedHook;
  3022. } else {
  3023. const apiName = toHandlerKey(ErrorTypeStrings$1[type].replace(/ hook$/, ""));
  3024. warn$1(
  3025. `${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.` )
  3026. );
  3027. }
  3028. }
  3029. const createHook = (lifecycle) => (hook, target = currentInstance) => {
  3030. if (!isInSSRComponentSetup || lifecycle === "sp") {
  3031. injectHook(lifecycle, (...args) => hook(...args), target);
  3032. }
  3033. };
  3034. const onBeforeMount = createHook("bm");
  3035. const onMounted = createHook("m");
  3036. const onBeforeUpdate = createHook("bu");
  3037. const onUpdated = createHook("u");
  3038. const onBeforeUnmount = createHook("bum");
  3039. const onUnmounted = createHook("um");
  3040. const onServerPrefetch = createHook("sp");
  3041. const onRenderTriggered = createHook(
  3042. "rtg"
  3043. );
  3044. const onRenderTracked = createHook(
  3045. "rtc"
  3046. );
  3047. function onErrorCaptured(hook, target = currentInstance) {
  3048. injectHook("ec", hook, target);
  3049. }
  3050. const COMPONENTS = "components";
  3051. const DIRECTIVES = "directives";
  3052. function resolveComponent(name, maybeSelfReference) {
  3053. return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
  3054. }
  3055. const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
  3056. function resolveDynamicComponent(component) {
  3057. if (isString(component)) {
  3058. return resolveAsset(COMPONENTS, component, false) || component;
  3059. } else {
  3060. return component || NULL_DYNAMIC_COMPONENT;
  3061. }
  3062. }
  3063. function resolveDirective(name) {
  3064. return resolveAsset(DIRECTIVES, name);
  3065. }
  3066. function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
  3067. const instance = currentRenderingInstance || currentInstance;
  3068. if (instance) {
  3069. const Component = instance.type;
  3070. if (type === COMPONENTS) {
  3071. const selfName = getComponentName(
  3072. Component,
  3073. false
  3074. );
  3075. if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) {
  3076. return Component;
  3077. }
  3078. }
  3079. const res = (
  3080. // local registration
  3081. // check instance[type] first which is resolved for options API
  3082. resolve(instance[type] || Component[type], name) || // global registration
  3083. resolve(instance.appContext[type], name)
  3084. );
  3085. if (!res && maybeSelfReference) {
  3086. return Component;
  3087. }
  3088. if (warnMissing && !res) {
  3089. const extra = type === COMPONENTS ? `
  3090. If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``;
  3091. warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
  3092. }
  3093. return res;
  3094. } else {
  3095. warn$1(
  3096. `resolve${capitalize(type.slice(0, -1))} can only be used in render() or setup().`
  3097. );
  3098. }
  3099. }
  3100. function resolve(registry, name) {
  3101. return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]);
  3102. }
  3103. function renderList(source, renderItem, cache, index) {
  3104. let ret;
  3105. const cached = cache && cache[index];
  3106. if (isArray(source) || isString(source)) {
  3107. ret = new Array(source.length);
  3108. for (let i = 0, l = source.length; i < l; i++) {
  3109. ret[i] = renderItem(source[i], i, void 0, cached && cached[i]);
  3110. }
  3111. } else if (typeof source === "number") {
  3112. if (!Number.isInteger(source)) {
  3113. warn$1(`The v-for range expect an integer value but got ${source}.`);
  3114. }
  3115. ret = new Array(source);
  3116. for (let i = 0; i < source; i++) {
  3117. ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
  3118. }
  3119. } else if (isObject(source)) {
  3120. if (source[Symbol.iterator]) {
  3121. ret = Array.from(
  3122. source,
  3123. (item, i) => renderItem(item, i, void 0, cached && cached[i])
  3124. );
  3125. } else {
  3126. const keys = Object.keys(source);
  3127. ret = new Array(keys.length);
  3128. for (let i = 0, l = keys.length; i < l; i++) {
  3129. const key = keys[i];
  3130. ret[i] = renderItem(source[key], key, i, cached && cached[i]);
  3131. }
  3132. }
  3133. } else {
  3134. ret = [];
  3135. }
  3136. if (cache) {
  3137. cache[index] = ret;
  3138. }
  3139. return ret;
  3140. }
  3141. function createSlots(slots, dynamicSlots) {
  3142. for (let i = 0; i < dynamicSlots.length; i++) {
  3143. const slot = dynamicSlots[i];
  3144. if (isArray(slot)) {
  3145. for (let j = 0; j < slot.length; j++) {
  3146. slots[slot[j].name] = slot[j].fn;
  3147. }
  3148. } else if (slot) {
  3149. slots[slot.name] = slot.key ? (...args) => {
  3150. const res = slot.fn(...args);
  3151. if (res) res.key = slot.key;
  3152. return res;
  3153. } : slot.fn;
  3154. }
  3155. }
  3156. return slots;
  3157. }
  3158. function renderSlot(slots, name, props = {}, fallback, noSlotted) {
  3159. if (currentRenderingInstance.isCE || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.isCE) {
  3160. if (name !== "default") props.name = name;
  3161. return createVNode("slot", props, fallback && fallback());
  3162. }
  3163. let slot = slots[name];
  3164. if (slot && slot.length > 1) {
  3165. warn$1(
  3166. `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.`
  3167. );
  3168. slot = () => [];
  3169. }
  3170. if (slot && slot._c) {
  3171. slot._d = false;
  3172. }
  3173. openBlock();
  3174. const validSlotContent = slot && ensureValidVNode(slot(props));
  3175. const rendered = createBlock(
  3176. Fragment,
  3177. {
  3178. key: (props.key || // slot content array of a dynamic conditional slot may have a branch
  3179. // key attached in the `createSlots` helper, respect that
  3180. validSlotContent && validSlotContent.key || `_${name}`) + // #7256 force differentiate fallback content from actual content
  3181. (!validSlotContent && fallback ? "_fb" : "")
  3182. },
  3183. validSlotContent || (fallback ? fallback() : []),
  3184. validSlotContent && slots._ === 1 ? 64 : -2
  3185. );
  3186. if (!noSlotted && rendered.scopeId) {
  3187. rendered.slotScopeIds = [rendered.scopeId + "-s"];
  3188. }
  3189. if (slot && slot._c) {
  3190. slot._d = true;
  3191. }
  3192. return rendered;
  3193. }
  3194. function ensureValidVNode(vnodes) {
  3195. return vnodes.some((child) => {
  3196. if (!isVNode(child)) return true;
  3197. if (child.type === Comment) return false;
  3198. if (child.type === Fragment && !ensureValidVNode(child.children))
  3199. return false;
  3200. return true;
  3201. }) ? vnodes : null;
  3202. }
  3203. function toHandlers(obj, preserveCaseIfNecessary) {
  3204. const ret = {};
  3205. if (!isObject(obj)) {
  3206. warn$1(`v-on with no argument expects an object value.`);
  3207. return ret;
  3208. }
  3209. for (const key in obj) {
  3210. ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : toHandlerKey(key)] = obj[key];
  3211. }
  3212. return ret;
  3213. }
  3214. const getPublicInstance = (i) => {
  3215. if (!i) return null;
  3216. if (isStatefulComponent(i)) return getComponentPublicInstance(i);
  3217. return getPublicInstance(i.parent);
  3218. };
  3219. const publicPropertiesMap = (
  3220. // Move PURE marker to new line to workaround compiler discarding it
  3221. // due to type annotation
  3222. /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), {
  3223. $: (i) => i,
  3224. $el: (i) => i.vnode.el,
  3225. $data: (i) => i.data,
  3226. $props: (i) => shallowReadonly(i.props) ,
  3227. $attrs: (i) => shallowReadonly(i.attrs) ,
  3228. $slots: (i) => shallowReadonly(i.slots) ,
  3229. $refs: (i) => shallowReadonly(i.refs) ,
  3230. $parent: (i) => getPublicInstance(i.parent),
  3231. $root: (i) => getPublicInstance(i.root),
  3232. $emit: (i) => i.emit,
  3233. $options: (i) => resolveMergedOptions(i) ,
  3234. $forceUpdate: (i) => i.f || (i.f = () => {
  3235. i.effect.dirty = true;
  3236. queueJob(i.update);
  3237. }),
  3238. $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)),
  3239. $watch: (i) => instanceWatch.bind(i)
  3240. })
  3241. );
  3242. const isReservedPrefix = (key) => key === "_" || key === "$";
  3243. const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
  3244. const PublicInstanceProxyHandlers = {
  3245. get({ _: instance }, key) {
  3246. if (key === "__v_skip") {
  3247. return true;
  3248. }
  3249. const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
  3250. if (key === "__isVue") {
  3251. return true;
  3252. }
  3253. let normalizedProps;
  3254. if (key[0] !== "$") {
  3255. const n = accessCache[key];
  3256. if (n !== void 0) {
  3257. switch (n) {
  3258. case 1 /* SETUP */:
  3259. return setupState[key];
  3260. case 2 /* DATA */:
  3261. return data[key];
  3262. case 4 /* CONTEXT */:
  3263. return ctx[key];
  3264. case 3 /* PROPS */:
  3265. return props[key];
  3266. }
  3267. } else if (hasSetupBinding(setupState, key)) {
  3268. accessCache[key] = 1 /* SETUP */;
  3269. return setupState[key];
  3270. } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
  3271. accessCache[key] = 2 /* DATA */;
  3272. return data[key];
  3273. } else if (
  3274. // only cache other properties when instance has declared (thus stable)
  3275. // props
  3276. (normalizedProps = instance.propsOptions[0]) && hasOwn(normalizedProps, key)
  3277. ) {
  3278. accessCache[key] = 3 /* PROPS */;
  3279. return props[key];
  3280. } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
  3281. accessCache[key] = 4 /* CONTEXT */;
  3282. return ctx[key];
  3283. } else if (shouldCacheAccess) {
  3284. accessCache[key] = 0 /* OTHER */;
  3285. }
  3286. }
  3287. const publicGetter = publicPropertiesMap[key];
  3288. let cssModule, globalProperties;
  3289. if (publicGetter) {
  3290. if (key === "$attrs") {
  3291. track(instance.attrs, "get", "");
  3292. markAttrsAccessed();
  3293. } else if (key === "$slots") {
  3294. track(instance, "get", key);
  3295. }
  3296. return publicGetter(instance);
  3297. } else if (
  3298. // css module (injected by vue-loader)
  3299. (cssModule = type.__cssModules) && (cssModule = cssModule[key])
  3300. ) {
  3301. return cssModule;
  3302. } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
  3303. accessCache[key] = 4 /* CONTEXT */;
  3304. return ctx[key];
  3305. } else if (
  3306. // global properties
  3307. globalProperties = appContext.config.globalProperties, hasOwn(globalProperties, key)
  3308. ) {
  3309. {
  3310. return globalProperties[key];
  3311. }
  3312. } else if (currentRenderingInstance && (!isString(key) || // #1091 avoid internal isRef/isVNode checks on component instance leading
  3313. // to infinite warning loop
  3314. key.indexOf("__v") !== 0)) {
  3315. if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn(data, key)) {
  3316. warn$1(
  3317. `Property ${JSON.stringify(
  3318. key
  3319. )} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`
  3320. );
  3321. } else if (instance === currentRenderingInstance) {
  3322. warn$1(
  3323. `Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.`
  3324. );
  3325. }
  3326. }
  3327. },
  3328. set({ _: instance }, key, value) {
  3329. const { data, setupState, ctx } = instance;
  3330. if (hasSetupBinding(setupState, key)) {
  3331. setupState[key] = value;
  3332. return true;
  3333. } else if (setupState.__isScriptSetup && hasOwn(setupState, key)) {
  3334. warn$1(`Cannot mutate <script setup> binding "${key}" from Options API.`);
  3335. return false;
  3336. } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
  3337. data[key] = value;
  3338. return true;
  3339. } else if (hasOwn(instance.props, key)) {
  3340. warn$1(`Attempting to mutate prop "${key}". Props are readonly.`);
  3341. return false;
  3342. }
  3343. if (key[0] === "$" && key.slice(1) in instance) {
  3344. warn$1(
  3345. `Attempting to mutate public property "${key}". Properties starting with $ are reserved and readonly.`
  3346. );
  3347. return false;
  3348. } else {
  3349. if (key in instance.appContext.config.globalProperties) {
  3350. Object.defineProperty(ctx, key, {
  3351. enumerable: true,
  3352. configurable: true,
  3353. value
  3354. });
  3355. } else {
  3356. ctx[key] = value;
  3357. }
  3358. }
  3359. return true;
  3360. },
  3361. has({
  3362. _: { data, setupState, accessCache, ctx, appContext, propsOptions }
  3363. }, key) {
  3364. let normalizedProps;
  3365. 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);
  3366. },
  3367. defineProperty(target, key, descriptor) {
  3368. if (descriptor.get != null) {
  3369. target._.accessCache[key] = 0;
  3370. } else if (hasOwn(descriptor, "value")) {
  3371. this.set(target, key, descriptor.value, null);
  3372. }
  3373. return Reflect.defineProperty(target, key, descriptor);
  3374. }
  3375. };
  3376. {
  3377. PublicInstanceProxyHandlers.ownKeys = (target) => {
  3378. warn$1(
  3379. `Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.`
  3380. );
  3381. return Reflect.ownKeys(target);
  3382. };
  3383. }
  3384. const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ extend(
  3385. {},
  3386. PublicInstanceProxyHandlers,
  3387. {
  3388. get(target, key) {
  3389. if (key === Symbol.unscopables) {
  3390. return;
  3391. }
  3392. return PublicInstanceProxyHandlers.get(target, key, target);
  3393. },
  3394. has(_, key) {
  3395. const has = key[0] !== "_" && !isGloballyAllowed(key);
  3396. if (!has && PublicInstanceProxyHandlers.has(_, key)) {
  3397. warn$1(
  3398. `Property ${JSON.stringify(
  3399. key
  3400. )} should not start with _ which is a reserved prefix for Vue internals.`
  3401. );
  3402. }
  3403. return has;
  3404. }
  3405. }
  3406. );
  3407. function createDevRenderContext(instance) {
  3408. const target = {};
  3409. Object.defineProperty(target, `_`, {
  3410. configurable: true,
  3411. enumerable: false,
  3412. get: () => instance
  3413. });
  3414. Object.keys(publicPropertiesMap).forEach((key) => {
  3415. Object.defineProperty(target, key, {
  3416. configurable: true,
  3417. enumerable: false,
  3418. get: () => publicPropertiesMap[key](instance),
  3419. // intercepted by the proxy so no need for implementation,
  3420. // but needed to prevent set errors
  3421. set: NOOP
  3422. });
  3423. });
  3424. return target;
  3425. }
  3426. function exposePropsOnRenderContext(instance) {
  3427. const {
  3428. ctx,
  3429. propsOptions: [propsOptions]
  3430. } = instance;
  3431. if (propsOptions) {
  3432. Object.keys(propsOptions).forEach((key) => {
  3433. Object.defineProperty(ctx, key, {
  3434. enumerable: true,
  3435. configurable: true,
  3436. get: () => instance.props[key],
  3437. set: NOOP
  3438. });
  3439. });
  3440. }
  3441. }
  3442. function exposeSetupStateOnRenderContext(instance) {
  3443. const { ctx, setupState } = instance;
  3444. Object.keys(toRaw(setupState)).forEach((key) => {
  3445. if (!setupState.__isScriptSetup) {
  3446. if (isReservedPrefix(key[0])) {
  3447. warn$1(
  3448. `setup() return property ${JSON.stringify(
  3449. key
  3450. )} should not start with "$" or "_" which are reserved prefixes for Vue internals.`
  3451. );
  3452. return;
  3453. }
  3454. Object.defineProperty(ctx, key, {
  3455. enumerable: true,
  3456. configurable: true,
  3457. get: () => setupState[key],
  3458. set: NOOP
  3459. });
  3460. }
  3461. });
  3462. }
  3463. const warnRuntimeUsage = (method) => warn$1(
  3464. `${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.`
  3465. );
  3466. function defineProps() {
  3467. {
  3468. warnRuntimeUsage(`defineProps`);
  3469. }
  3470. return null;
  3471. }
  3472. function defineEmits() {
  3473. {
  3474. warnRuntimeUsage(`defineEmits`);
  3475. }
  3476. return null;
  3477. }
  3478. function defineExpose(exposed) {
  3479. {
  3480. warnRuntimeUsage(`defineExpose`);
  3481. }
  3482. }
  3483. function defineOptions(options) {
  3484. {
  3485. warnRuntimeUsage(`defineOptions`);
  3486. }
  3487. }
  3488. function defineSlots() {
  3489. {
  3490. warnRuntimeUsage(`defineSlots`);
  3491. }
  3492. return null;
  3493. }
  3494. function defineModel() {
  3495. {
  3496. warnRuntimeUsage("defineModel");
  3497. }
  3498. }
  3499. function withDefaults(props, defaults) {
  3500. {
  3501. warnRuntimeUsage(`withDefaults`);
  3502. }
  3503. return null;
  3504. }
  3505. function useSlots() {
  3506. return getContext().slots;
  3507. }
  3508. function useAttrs() {
  3509. return getContext().attrs;
  3510. }
  3511. function getContext() {
  3512. const i = getCurrentInstance();
  3513. if (!i) {
  3514. warn$1(`useContext() called without active instance.`);
  3515. }
  3516. return i.setupContext || (i.setupContext = createSetupContext(i));
  3517. }
  3518. function normalizePropsOrEmits(props) {
  3519. return isArray(props) ? props.reduce(
  3520. (normalized, p) => (normalized[p] = null, normalized),
  3521. {}
  3522. ) : props;
  3523. }
  3524. function mergeDefaults(raw, defaults) {
  3525. const props = normalizePropsOrEmits(raw);
  3526. for (const key in defaults) {
  3527. if (key.startsWith("__skip")) continue;
  3528. let opt = props[key];
  3529. if (opt) {
  3530. if (isArray(opt) || isFunction(opt)) {
  3531. opt = props[key] = { type: opt, default: defaults[key] };
  3532. } else {
  3533. opt.default = defaults[key];
  3534. }
  3535. } else if (opt === null) {
  3536. opt = props[key] = { default: defaults[key] };
  3537. } else {
  3538. warn$1(`props default key "${key}" has no corresponding declaration.`);
  3539. }
  3540. if (opt && defaults[`__skip_${key}`]) {
  3541. opt.skipFactory = true;
  3542. }
  3543. }
  3544. return props;
  3545. }
  3546. function mergeModels(a, b) {
  3547. if (!a || !b) return a || b;
  3548. if (isArray(a) && isArray(b)) return a.concat(b);
  3549. return extend({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b));
  3550. }
  3551. function createPropsRestProxy(props, excludedKeys) {
  3552. const ret = {};
  3553. for (const key in props) {
  3554. if (!excludedKeys.includes(key)) {
  3555. Object.defineProperty(ret, key, {
  3556. enumerable: true,
  3557. get: () => props[key]
  3558. });
  3559. }
  3560. }
  3561. return ret;
  3562. }
  3563. function withAsyncContext(getAwaitable) {
  3564. const ctx = getCurrentInstance();
  3565. if (!ctx) {
  3566. warn$1(
  3567. `withAsyncContext called without active current instance. This is likely a bug.`
  3568. );
  3569. }
  3570. let awaitable = getAwaitable();
  3571. unsetCurrentInstance();
  3572. if (isPromise(awaitable)) {
  3573. awaitable = awaitable.catch((e) => {
  3574. setCurrentInstance(ctx);
  3575. throw e;
  3576. });
  3577. }
  3578. return [awaitable, () => setCurrentInstance(ctx)];
  3579. }
  3580. function createDuplicateChecker() {
  3581. const cache = /* @__PURE__ */ Object.create(null);
  3582. return (type, key) => {
  3583. if (cache[key]) {
  3584. warn$1(`${type} property "${key}" is already defined in ${cache[key]}.`);
  3585. } else {
  3586. cache[key] = type;
  3587. }
  3588. };
  3589. }
  3590. let shouldCacheAccess = true;
  3591. function applyOptions(instance) {
  3592. const options = resolveMergedOptions(instance);
  3593. const publicThis = instance.proxy;
  3594. const ctx = instance.ctx;
  3595. shouldCacheAccess = false;
  3596. if (options.beforeCreate) {
  3597. callHook$1(options.beforeCreate, instance, "bc");
  3598. }
  3599. const {
  3600. // state
  3601. data: dataOptions,
  3602. computed: computedOptions,
  3603. methods,
  3604. watch: watchOptions,
  3605. provide: provideOptions,
  3606. inject: injectOptions,
  3607. // lifecycle
  3608. created,
  3609. beforeMount,
  3610. mounted,
  3611. beforeUpdate,
  3612. updated,
  3613. activated,
  3614. deactivated,
  3615. beforeDestroy,
  3616. beforeUnmount,
  3617. destroyed,
  3618. unmounted,
  3619. render,
  3620. renderTracked,
  3621. renderTriggered,
  3622. errorCaptured,
  3623. serverPrefetch,
  3624. // public API
  3625. expose,
  3626. inheritAttrs,
  3627. // assets
  3628. components,
  3629. directives,
  3630. filters
  3631. } = options;
  3632. const checkDuplicateProperties = createDuplicateChecker() ;
  3633. {
  3634. const [propsOptions] = instance.propsOptions;
  3635. if (propsOptions) {
  3636. for (const key in propsOptions) {
  3637. checkDuplicateProperties("Props" /* PROPS */, key);
  3638. }
  3639. }
  3640. }
  3641. if (injectOptions) {
  3642. resolveInjections(injectOptions, ctx, checkDuplicateProperties);
  3643. }
  3644. if (methods) {
  3645. for (const key in methods) {
  3646. const methodHandler = methods[key];
  3647. if (isFunction(methodHandler)) {
  3648. {
  3649. Object.defineProperty(ctx, key, {
  3650. value: methodHandler.bind(publicThis),
  3651. configurable: true,
  3652. enumerable: true,
  3653. writable: true
  3654. });
  3655. }
  3656. {
  3657. checkDuplicateProperties("Methods" /* METHODS */, key);
  3658. }
  3659. } else {
  3660. warn$1(
  3661. `Method "${key}" has type "${typeof methodHandler}" in the component definition. Did you reference the function correctly?`
  3662. );
  3663. }
  3664. }
  3665. }
  3666. if (dataOptions) {
  3667. if (!isFunction(dataOptions)) {
  3668. warn$1(
  3669. `The data option must be a function. Plain object usage is no longer supported.`
  3670. );
  3671. }
  3672. const data = dataOptions.call(publicThis, publicThis);
  3673. if (isPromise(data)) {
  3674. warn$1(
  3675. `data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>.`
  3676. );
  3677. }
  3678. if (!isObject(data)) {
  3679. warn$1(`data() should return an object.`);
  3680. } else {
  3681. instance.data = reactive(data);
  3682. {
  3683. for (const key in data) {
  3684. checkDuplicateProperties("Data" /* DATA */, key);
  3685. if (!isReservedPrefix(key[0])) {
  3686. Object.defineProperty(ctx, key, {
  3687. configurable: true,
  3688. enumerable: true,
  3689. get: () => data[key],
  3690. set: NOOP
  3691. });
  3692. }
  3693. }
  3694. }
  3695. }
  3696. }
  3697. shouldCacheAccess = true;
  3698. if (computedOptions) {
  3699. for (const key in computedOptions) {
  3700. const opt = computedOptions[key];
  3701. const get = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
  3702. if (get === NOOP) {
  3703. warn$1(`Computed property "${key}" has no getter.`);
  3704. }
  3705. const set = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : () => {
  3706. warn$1(
  3707. `Write operation failed: computed property "${key}" is readonly.`
  3708. );
  3709. } ;
  3710. const c = computed({
  3711. get,
  3712. set
  3713. });
  3714. Object.defineProperty(ctx, key, {
  3715. enumerable: true,
  3716. configurable: true,
  3717. get: () => c.value,
  3718. set: (v) => c.value = v
  3719. });
  3720. {
  3721. checkDuplicateProperties("Computed" /* COMPUTED */, key);
  3722. }
  3723. }
  3724. }
  3725. if (watchOptions) {
  3726. for (const key in watchOptions) {
  3727. createWatcher(watchOptions[key], ctx, publicThis, key);
  3728. }
  3729. }
  3730. if (provideOptions) {
  3731. const provides = isFunction(provideOptions) ? provideOptions.call(publicThis) : provideOptions;
  3732. Reflect.ownKeys(provides).forEach((key) => {
  3733. provide(key, provides[key]);
  3734. });
  3735. }
  3736. if (created) {
  3737. callHook$1(created, instance, "c");
  3738. }
  3739. function registerLifecycleHook(register, hook) {
  3740. if (isArray(hook)) {
  3741. hook.forEach((_hook) => register(_hook.bind(publicThis)));
  3742. } else if (hook) {
  3743. register(hook.bind(publicThis));
  3744. }
  3745. }
  3746. registerLifecycleHook(onBeforeMount, beforeMount);
  3747. registerLifecycleHook(onMounted, mounted);
  3748. registerLifecycleHook(onBeforeUpdate, beforeUpdate);
  3749. registerLifecycleHook(onUpdated, updated);
  3750. registerLifecycleHook(onActivated, activated);
  3751. registerLifecycleHook(onDeactivated, deactivated);
  3752. registerLifecycleHook(onErrorCaptured, errorCaptured);
  3753. registerLifecycleHook(onRenderTracked, renderTracked);
  3754. registerLifecycleHook(onRenderTriggered, renderTriggered);
  3755. registerLifecycleHook(onBeforeUnmount, beforeUnmount);
  3756. registerLifecycleHook(onUnmounted, unmounted);
  3757. registerLifecycleHook(onServerPrefetch, serverPrefetch);
  3758. if (isArray(expose)) {
  3759. if (expose.length) {
  3760. const exposed = instance.exposed || (instance.exposed = {});
  3761. expose.forEach((key) => {
  3762. Object.defineProperty(exposed, key, {
  3763. get: () => publicThis[key],
  3764. set: (val) => publicThis[key] = val
  3765. });
  3766. });
  3767. } else if (!instance.exposed) {
  3768. instance.exposed = {};
  3769. }
  3770. }
  3771. if (render && instance.render === NOOP) {
  3772. instance.render = render;
  3773. }
  3774. if (inheritAttrs != null) {
  3775. instance.inheritAttrs = inheritAttrs;
  3776. }
  3777. if (components) instance.components = components;
  3778. if (directives) instance.directives = directives;
  3779. }
  3780. function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP) {
  3781. if (isArray(injectOptions)) {
  3782. injectOptions = normalizeInject(injectOptions);
  3783. }
  3784. for (const key in injectOptions) {
  3785. const opt = injectOptions[key];
  3786. let injected;
  3787. if (isObject(opt)) {
  3788. if ("default" in opt) {
  3789. injected = inject(
  3790. opt.from || key,
  3791. opt.default,
  3792. true
  3793. );
  3794. } else {
  3795. injected = inject(opt.from || key);
  3796. }
  3797. } else {
  3798. injected = inject(opt);
  3799. }
  3800. if (isRef(injected)) {
  3801. Object.defineProperty(ctx, key, {
  3802. enumerable: true,
  3803. configurable: true,
  3804. get: () => injected.value,
  3805. set: (v) => injected.value = v
  3806. });
  3807. } else {
  3808. ctx[key] = injected;
  3809. }
  3810. {
  3811. checkDuplicateProperties("Inject" /* INJECT */, key);
  3812. }
  3813. }
  3814. }
  3815. function callHook$1(hook, instance, type) {
  3816. callWithAsyncErrorHandling(
  3817. isArray(hook) ? hook.map((h) => h.bind(instance.proxy)) : hook.bind(instance.proxy),
  3818. instance,
  3819. type
  3820. );
  3821. }
  3822. function createWatcher(raw, ctx, publicThis, key) {
  3823. const getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key];
  3824. if (isString(raw)) {
  3825. const handler = ctx[raw];
  3826. if (isFunction(handler)) {
  3827. watch(getter, handler);
  3828. } else {
  3829. warn$1(`Invalid watch handler specified by key "${raw}"`, handler);
  3830. }
  3831. } else if (isFunction(raw)) {
  3832. watch(getter, raw.bind(publicThis));
  3833. } else if (isObject(raw)) {
  3834. if (isArray(raw)) {
  3835. raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
  3836. } else {
  3837. const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
  3838. if (isFunction(handler)) {
  3839. watch(getter, handler, raw);
  3840. } else {
  3841. warn$1(`Invalid watch handler specified by key "${raw.handler}"`, handler);
  3842. }
  3843. }
  3844. } else {
  3845. warn$1(`Invalid watch option: "${key}"`, raw);
  3846. }
  3847. }
  3848. function resolveMergedOptions(instance) {
  3849. const base = instance.type;
  3850. const { mixins, extends: extendsOptions } = base;
  3851. const {
  3852. mixins: globalMixins,
  3853. optionsCache: cache,
  3854. config: { optionMergeStrategies }
  3855. } = instance.appContext;
  3856. const cached = cache.get(base);
  3857. let resolved;
  3858. if (cached) {
  3859. resolved = cached;
  3860. } else if (!globalMixins.length && !mixins && !extendsOptions) {
  3861. {
  3862. resolved = base;
  3863. }
  3864. } else {
  3865. resolved = {};
  3866. if (globalMixins.length) {
  3867. globalMixins.forEach(
  3868. (m) => mergeOptions(resolved, m, optionMergeStrategies, true)
  3869. );
  3870. }
  3871. mergeOptions(resolved, base, optionMergeStrategies);
  3872. }
  3873. if (isObject(base)) {
  3874. cache.set(base, resolved);
  3875. }
  3876. return resolved;
  3877. }
  3878. function mergeOptions(to, from, strats, asMixin = false) {
  3879. const { mixins, extends: extendsOptions } = from;
  3880. if (extendsOptions) {
  3881. mergeOptions(to, extendsOptions, strats, true);
  3882. }
  3883. if (mixins) {
  3884. mixins.forEach(
  3885. (m) => mergeOptions(to, m, strats, true)
  3886. );
  3887. }
  3888. for (const key in from) {
  3889. if (asMixin && key === "expose") {
  3890. warn$1(
  3891. `"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.`
  3892. );
  3893. } else {
  3894. const strat = internalOptionMergeStrats[key] || strats && strats[key];
  3895. to[key] = strat ? strat(to[key], from[key]) : from[key];
  3896. }
  3897. }
  3898. return to;
  3899. }
  3900. const internalOptionMergeStrats = {
  3901. data: mergeDataFn,
  3902. props: mergeEmitsOrPropsOptions,
  3903. emits: mergeEmitsOrPropsOptions,
  3904. // objects
  3905. methods: mergeObjectOptions,
  3906. computed: mergeObjectOptions,
  3907. // lifecycle
  3908. beforeCreate: mergeAsArray,
  3909. created: mergeAsArray,
  3910. beforeMount: mergeAsArray,
  3911. mounted: mergeAsArray,
  3912. beforeUpdate: mergeAsArray,
  3913. updated: mergeAsArray,
  3914. beforeDestroy: mergeAsArray,
  3915. beforeUnmount: mergeAsArray,
  3916. destroyed: mergeAsArray,
  3917. unmounted: mergeAsArray,
  3918. activated: mergeAsArray,
  3919. deactivated: mergeAsArray,
  3920. errorCaptured: mergeAsArray,
  3921. serverPrefetch: mergeAsArray,
  3922. // assets
  3923. components: mergeObjectOptions,
  3924. directives: mergeObjectOptions,
  3925. // watch
  3926. watch: mergeWatchOptions,
  3927. // provide / inject
  3928. provide: mergeDataFn,
  3929. inject: mergeInject
  3930. };
  3931. function mergeDataFn(to, from) {
  3932. if (!from) {
  3933. return to;
  3934. }
  3935. if (!to) {
  3936. return from;
  3937. }
  3938. return function mergedDataFn() {
  3939. return (extend)(
  3940. isFunction(to) ? to.call(this, this) : to,
  3941. isFunction(from) ? from.call(this, this) : from
  3942. );
  3943. };
  3944. }
  3945. function mergeInject(to, from) {
  3946. return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
  3947. }
  3948. function normalizeInject(raw) {
  3949. if (isArray(raw)) {
  3950. const res = {};
  3951. for (let i = 0; i < raw.length; i++) {
  3952. res[raw[i]] = raw[i];
  3953. }
  3954. return res;
  3955. }
  3956. return raw;
  3957. }
  3958. function mergeAsArray(to, from) {
  3959. return to ? [...new Set([].concat(to, from))] : from;
  3960. }
  3961. function mergeObjectOptions(to, from) {
  3962. return to ? extend(/* @__PURE__ */ Object.create(null), to, from) : from;
  3963. }
  3964. function mergeEmitsOrPropsOptions(to, from) {
  3965. if (to) {
  3966. if (isArray(to) && isArray(from)) {
  3967. return [.../* @__PURE__ */ new Set([...to, ...from])];
  3968. }
  3969. return extend(
  3970. /* @__PURE__ */ Object.create(null),
  3971. normalizePropsOrEmits(to),
  3972. normalizePropsOrEmits(from != null ? from : {})
  3973. );
  3974. } else {
  3975. return from;
  3976. }
  3977. }
  3978. function mergeWatchOptions(to, from) {
  3979. if (!to) return from;
  3980. if (!from) return to;
  3981. const merged = extend(/* @__PURE__ */ Object.create(null), to);
  3982. for (const key in from) {
  3983. merged[key] = mergeAsArray(to[key], from[key]);
  3984. }
  3985. return merged;
  3986. }
  3987. function createAppContext() {
  3988. return {
  3989. app: null,
  3990. config: {
  3991. isNativeTag: NO,
  3992. performance: false,
  3993. globalProperties: {},
  3994. optionMergeStrategies: {},
  3995. errorHandler: void 0,
  3996. warnHandler: void 0,
  3997. compilerOptions: {}
  3998. },
  3999. mixins: [],
  4000. components: {},
  4001. directives: {},
  4002. provides: /* @__PURE__ */ Object.create(null),
  4003. optionsCache: /* @__PURE__ */ new WeakMap(),
  4004. propsCache: /* @__PURE__ */ new WeakMap(),
  4005. emitsCache: /* @__PURE__ */ new WeakMap()
  4006. };
  4007. }
  4008. let uid$1 = 0;
  4009. function createAppAPI(render, hydrate) {
  4010. return function createApp(rootComponent, rootProps = null) {
  4011. if (!isFunction(rootComponent)) {
  4012. rootComponent = extend({}, rootComponent);
  4013. }
  4014. if (rootProps != null && !isObject(rootProps)) {
  4015. warn$1(`root props passed to app.mount() must be an object.`);
  4016. rootProps = null;
  4017. }
  4018. const context = createAppContext();
  4019. const installedPlugins = /* @__PURE__ */ new WeakSet();
  4020. let isMounted = false;
  4021. const app = context.app = {
  4022. _uid: uid$1++,
  4023. _component: rootComponent,
  4024. _props: rootProps,
  4025. _container: null,
  4026. _context: context,
  4027. _instance: null,
  4028. version,
  4029. get config() {
  4030. return context.config;
  4031. },
  4032. set config(v) {
  4033. {
  4034. warn$1(
  4035. `app.config cannot be replaced. Modify individual options instead.`
  4036. );
  4037. }
  4038. },
  4039. use(plugin, ...options) {
  4040. if (installedPlugins.has(plugin)) {
  4041. warn$1(`Plugin has already been applied to target app.`);
  4042. } else if (plugin && isFunction(plugin.install)) {
  4043. installedPlugins.add(plugin);
  4044. plugin.install(app, ...options);
  4045. } else if (isFunction(plugin)) {
  4046. installedPlugins.add(plugin);
  4047. plugin(app, ...options);
  4048. } else {
  4049. warn$1(
  4050. `A plugin must either be a function or an object with an "install" function.`
  4051. );
  4052. }
  4053. return app;
  4054. },
  4055. mixin(mixin) {
  4056. {
  4057. if (!context.mixins.includes(mixin)) {
  4058. context.mixins.push(mixin);
  4059. } else {
  4060. warn$1(
  4061. "Mixin has already been applied to target app" + (mixin.name ? `: ${mixin.name}` : "")
  4062. );
  4063. }
  4064. }
  4065. return app;
  4066. },
  4067. component(name, component) {
  4068. {
  4069. validateComponentName(name, context.config);
  4070. }
  4071. if (!component) {
  4072. return context.components[name];
  4073. }
  4074. if (context.components[name]) {
  4075. warn$1(`Component "${name}" has already been registered in target app.`);
  4076. }
  4077. context.components[name] = component;
  4078. return app;
  4079. },
  4080. directive(name, directive) {
  4081. {
  4082. validateDirectiveName(name);
  4083. }
  4084. if (!directive) {
  4085. return context.directives[name];
  4086. }
  4087. if (context.directives[name]) {
  4088. warn$1(`Directive "${name}" has already been registered in target app.`);
  4089. }
  4090. context.directives[name] = directive;
  4091. return app;
  4092. },
  4093. mount(rootContainer, isHydrate, namespace) {
  4094. if (!isMounted) {
  4095. if (rootContainer.__vue_app__) {
  4096. warn$1(
  4097. `There is already an app instance mounted on the host container.
  4098. If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.`
  4099. );
  4100. }
  4101. const vnode = createVNode(rootComponent, rootProps);
  4102. vnode.appContext = context;
  4103. if (namespace === true) {
  4104. namespace = "svg";
  4105. } else if (namespace === false) {
  4106. namespace = void 0;
  4107. }
  4108. {
  4109. context.reload = () => {
  4110. render(
  4111. cloneVNode(vnode),
  4112. rootContainer,
  4113. namespace
  4114. );
  4115. };
  4116. }
  4117. if (isHydrate && hydrate) {
  4118. hydrate(vnode, rootContainer);
  4119. } else {
  4120. render(vnode, rootContainer, namespace);
  4121. }
  4122. isMounted = true;
  4123. app._container = rootContainer;
  4124. rootContainer.__vue_app__ = app;
  4125. {
  4126. app._instance = vnode.component;
  4127. devtoolsInitApp(app, version);
  4128. }
  4129. return getComponentPublicInstance(vnode.component);
  4130. } else {
  4131. warn$1(
  4132. `App has already been mounted.
  4133. 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)\``
  4134. );
  4135. }
  4136. },
  4137. unmount() {
  4138. if (isMounted) {
  4139. render(null, app._container);
  4140. {
  4141. app._instance = null;
  4142. devtoolsUnmountApp(app);
  4143. }
  4144. delete app._container.__vue_app__;
  4145. } else {
  4146. warn$1(`Cannot unmount an app that is not mounted.`);
  4147. }
  4148. },
  4149. provide(key, value) {
  4150. if (key in context.provides) {
  4151. warn$1(
  4152. `App already provides property with key "${String(key)}". It will be overwritten with the new value.`
  4153. );
  4154. }
  4155. context.provides[key] = value;
  4156. return app;
  4157. },
  4158. runWithContext(fn) {
  4159. const lastApp = currentApp;
  4160. currentApp = app;
  4161. try {
  4162. return fn();
  4163. } finally {
  4164. currentApp = lastApp;
  4165. }
  4166. }
  4167. };
  4168. return app;
  4169. };
  4170. }
  4171. let currentApp = null;
  4172. function provide(key, value) {
  4173. if (!currentInstance) {
  4174. {
  4175. warn$1(`provide() can only be used inside setup().`);
  4176. }
  4177. } else {
  4178. let provides = currentInstance.provides;
  4179. const parentProvides = currentInstance.parent && currentInstance.parent.provides;
  4180. if (parentProvides === provides) {
  4181. provides = currentInstance.provides = Object.create(parentProvides);
  4182. }
  4183. provides[key] = value;
  4184. }
  4185. }
  4186. function inject(key, defaultValue, treatDefaultAsFactory = false) {
  4187. const instance = currentInstance || currentRenderingInstance;
  4188. if (instance || currentApp) {
  4189. const provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
  4190. if (provides && key in provides) {
  4191. return provides[key];
  4192. } else if (arguments.length > 1) {
  4193. return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
  4194. } else {
  4195. warn$1(`injection "${String(key)}" not found.`);
  4196. }
  4197. } else {
  4198. warn$1(`inject() can only be used inside setup() or functional components.`);
  4199. }
  4200. }
  4201. function hasInjectionContext() {
  4202. return !!(currentInstance || currentRenderingInstance || currentApp);
  4203. }
  4204. const internalObjectProto = {};
  4205. const createInternalObject = () => Object.create(internalObjectProto);
  4206. const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
  4207. function initProps(instance, rawProps, isStateful, isSSR = false) {
  4208. const props = {};
  4209. const attrs = createInternalObject();
  4210. instance.propsDefaults = /* @__PURE__ */ Object.create(null);
  4211. setFullProps(instance, rawProps, props, attrs);
  4212. for (const key in instance.propsOptions[0]) {
  4213. if (!(key in props)) {
  4214. props[key] = void 0;
  4215. }
  4216. }
  4217. {
  4218. validateProps(rawProps || {}, props, instance);
  4219. }
  4220. if (isStateful) {
  4221. instance.props = isSSR ? props : shallowReactive(props);
  4222. } else {
  4223. if (!instance.type.props) {
  4224. instance.props = attrs;
  4225. } else {
  4226. instance.props = props;
  4227. }
  4228. }
  4229. instance.attrs = attrs;
  4230. }
  4231. function isInHmrContext(instance) {
  4232. while (instance) {
  4233. if (instance.type.__hmrId) return true;
  4234. instance = instance.parent;
  4235. }
  4236. }
  4237. function updateProps(instance, rawProps, rawPrevProps, optimized) {
  4238. const {
  4239. props,
  4240. attrs,
  4241. vnode: { patchFlag }
  4242. } = instance;
  4243. const rawCurrentProps = toRaw(props);
  4244. const [options] = instance.propsOptions;
  4245. let hasAttrsChanged = false;
  4246. if (
  4247. // always force full diff in dev
  4248. // - #1942 if hmr is enabled with sfc component
  4249. // - vite#872 non-sfc component used by sfc component
  4250. !isInHmrContext(instance) && (optimized || patchFlag > 0) && !(patchFlag & 16)
  4251. ) {
  4252. if (patchFlag & 8) {
  4253. const propsToUpdate = instance.vnode.dynamicProps;
  4254. for (let i = 0; i < propsToUpdate.length; i++) {
  4255. let key = propsToUpdate[i];
  4256. if (isEmitListener(instance.emitsOptions, key)) {
  4257. continue;
  4258. }
  4259. const value = rawProps[key];
  4260. if (options) {
  4261. if (hasOwn(attrs, key)) {
  4262. if (value !== attrs[key]) {
  4263. attrs[key] = value;
  4264. hasAttrsChanged = true;
  4265. }
  4266. } else {
  4267. const camelizedKey = camelize(key);
  4268. props[camelizedKey] = resolvePropValue(
  4269. options,
  4270. rawCurrentProps,
  4271. camelizedKey,
  4272. value,
  4273. instance,
  4274. false
  4275. );
  4276. }
  4277. } else {
  4278. if (value !== attrs[key]) {
  4279. attrs[key] = value;
  4280. hasAttrsChanged = true;
  4281. }
  4282. }
  4283. }
  4284. }
  4285. } else {
  4286. if (setFullProps(instance, rawProps, props, attrs)) {
  4287. hasAttrsChanged = true;
  4288. }
  4289. let kebabKey;
  4290. for (const key in rawCurrentProps) {
  4291. if (!rawProps || // for camelCase
  4292. !hasOwn(rawProps, key) && // it's possible the original props was passed in as kebab-case
  4293. // and converted to camelCase (#955)
  4294. ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) {
  4295. if (options) {
  4296. if (rawPrevProps && // for camelCase
  4297. (rawPrevProps[key] !== void 0 || // for kebab-case
  4298. rawPrevProps[kebabKey] !== void 0)) {
  4299. props[key] = resolvePropValue(
  4300. options,
  4301. rawCurrentProps,
  4302. key,
  4303. void 0,
  4304. instance,
  4305. true
  4306. );
  4307. }
  4308. } else {
  4309. delete props[key];
  4310. }
  4311. }
  4312. }
  4313. if (attrs !== rawCurrentProps) {
  4314. for (const key in attrs) {
  4315. if (!rawProps || !hasOwn(rawProps, key) && true) {
  4316. delete attrs[key];
  4317. hasAttrsChanged = true;
  4318. }
  4319. }
  4320. }
  4321. }
  4322. if (hasAttrsChanged) {
  4323. trigger(instance.attrs, "set", "");
  4324. }
  4325. {
  4326. validateProps(rawProps || {}, props, instance);
  4327. }
  4328. }
  4329. function setFullProps(instance, rawProps, props, attrs) {
  4330. const [options, needCastKeys] = instance.propsOptions;
  4331. let hasAttrsChanged = false;
  4332. let rawCastValues;
  4333. if (rawProps) {
  4334. for (let key in rawProps) {
  4335. if (isReservedProp(key)) {
  4336. continue;
  4337. }
  4338. const value = rawProps[key];
  4339. let camelKey;
  4340. if (options && hasOwn(options, camelKey = camelize(key))) {
  4341. if (!needCastKeys || !needCastKeys.includes(camelKey)) {
  4342. props[camelKey] = value;
  4343. } else {
  4344. (rawCastValues || (rawCastValues = {}))[camelKey] = value;
  4345. }
  4346. } else if (!isEmitListener(instance.emitsOptions, key)) {
  4347. if (!(key in attrs) || value !== attrs[key]) {
  4348. attrs[key] = value;
  4349. hasAttrsChanged = true;
  4350. }
  4351. }
  4352. }
  4353. }
  4354. if (needCastKeys) {
  4355. const rawCurrentProps = toRaw(props);
  4356. const castValues = rawCastValues || EMPTY_OBJ;
  4357. for (let i = 0; i < needCastKeys.length; i++) {
  4358. const key = needCastKeys[i];
  4359. props[key] = resolvePropValue(
  4360. options,
  4361. rawCurrentProps,
  4362. key,
  4363. castValues[key],
  4364. instance,
  4365. !hasOwn(castValues, key)
  4366. );
  4367. }
  4368. }
  4369. return hasAttrsChanged;
  4370. }
  4371. function resolvePropValue(options, props, key, value, instance, isAbsent) {
  4372. const opt = options[key];
  4373. if (opt != null) {
  4374. const hasDefault = hasOwn(opt, "default");
  4375. if (hasDefault && value === void 0) {
  4376. const defaultValue = opt.default;
  4377. if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) {
  4378. const { propsDefaults } = instance;
  4379. if (key in propsDefaults) {
  4380. value = propsDefaults[key];
  4381. } else {
  4382. const reset = setCurrentInstance(instance);
  4383. value = propsDefaults[key] = defaultValue.call(
  4384. null,
  4385. props
  4386. );
  4387. reset();
  4388. }
  4389. } else {
  4390. value = defaultValue;
  4391. }
  4392. }
  4393. if (opt[0 /* shouldCast */]) {
  4394. if (isAbsent && !hasDefault) {
  4395. value = false;
  4396. } else if (opt[1 /* shouldCastTrue */] && (value === "" || value === hyphenate(key))) {
  4397. value = true;
  4398. }
  4399. }
  4400. }
  4401. return value;
  4402. }
  4403. const mixinPropsCache = /* @__PURE__ */ new WeakMap();
  4404. function normalizePropsOptions(comp, appContext, asMixin = false) {
  4405. const cache = asMixin ? mixinPropsCache : appContext.propsCache;
  4406. const cached = cache.get(comp);
  4407. if (cached) {
  4408. return cached;
  4409. }
  4410. const raw = comp.props;
  4411. const normalized = {};
  4412. const needCastKeys = [];
  4413. let hasExtends = false;
  4414. if (!isFunction(comp)) {
  4415. const extendProps = (raw2) => {
  4416. hasExtends = true;
  4417. const [props, keys] = normalizePropsOptions(raw2, appContext, true);
  4418. extend(normalized, props);
  4419. if (keys) needCastKeys.push(...keys);
  4420. };
  4421. if (!asMixin && appContext.mixins.length) {
  4422. appContext.mixins.forEach(extendProps);
  4423. }
  4424. if (comp.extends) {
  4425. extendProps(comp.extends);
  4426. }
  4427. if (comp.mixins) {
  4428. comp.mixins.forEach(extendProps);
  4429. }
  4430. }
  4431. if (!raw && !hasExtends) {
  4432. if (isObject(comp)) {
  4433. cache.set(comp, EMPTY_ARR);
  4434. }
  4435. return EMPTY_ARR;
  4436. }
  4437. if (isArray(raw)) {
  4438. for (let i = 0; i < raw.length; i++) {
  4439. if (!isString(raw[i])) {
  4440. warn$1(`props must be strings when using array syntax.`, raw[i]);
  4441. }
  4442. const normalizedKey = camelize(raw[i]);
  4443. if (validatePropName(normalizedKey)) {
  4444. normalized[normalizedKey] = EMPTY_OBJ;
  4445. }
  4446. }
  4447. } else if (raw) {
  4448. if (!isObject(raw)) {
  4449. warn$1(`invalid props options`, raw);
  4450. }
  4451. for (const key in raw) {
  4452. const normalizedKey = camelize(key);
  4453. if (validatePropName(normalizedKey)) {
  4454. const opt = raw[key];
  4455. const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt);
  4456. const propType = prop.type;
  4457. let shouldCast = false;
  4458. let shouldCastTrue = true;
  4459. if (isArray(propType)) {
  4460. for (let index = 0; index < propType.length; ++index) {
  4461. const type = propType[index];
  4462. const typeName = isFunction(type) && type.name;
  4463. if (typeName === "Boolean") {
  4464. shouldCast = true;
  4465. break;
  4466. } else if (typeName === "String") {
  4467. shouldCastTrue = false;
  4468. }
  4469. }
  4470. } else {
  4471. shouldCast = isFunction(propType) && propType.name === "Boolean";
  4472. }
  4473. prop[0 /* shouldCast */] = shouldCast;
  4474. prop[1 /* shouldCastTrue */] = shouldCastTrue;
  4475. if (shouldCast || hasOwn(prop, "default")) {
  4476. needCastKeys.push(normalizedKey);
  4477. }
  4478. }
  4479. }
  4480. }
  4481. const res = [normalized, needCastKeys];
  4482. if (isObject(comp)) {
  4483. cache.set(comp, res);
  4484. }
  4485. return res;
  4486. }
  4487. function validatePropName(key) {
  4488. if (key[0] !== "$" && !isReservedProp(key)) {
  4489. return true;
  4490. } else {
  4491. warn$1(`Invalid prop name: "${key}" is a reserved property.`);
  4492. }
  4493. return false;
  4494. }
  4495. function getType(ctor) {
  4496. if (ctor === null) {
  4497. return "null";
  4498. }
  4499. if (typeof ctor === "function") {
  4500. return ctor.name || "";
  4501. } else if (typeof ctor === "object") {
  4502. const name = ctor.constructor && ctor.constructor.name;
  4503. return name || "";
  4504. }
  4505. return "";
  4506. }
  4507. function validateProps(rawProps, props, instance) {
  4508. const resolvedValues = toRaw(props);
  4509. const options = instance.propsOptions[0];
  4510. for (const key in options) {
  4511. let opt = options[key];
  4512. if (opt == null) continue;
  4513. validateProp(
  4514. key,
  4515. resolvedValues[key],
  4516. opt,
  4517. shallowReadonly(resolvedValues) ,
  4518. !hasOwn(rawProps, key) && !hasOwn(rawProps, hyphenate(key))
  4519. );
  4520. }
  4521. }
  4522. function validateProp(name, value, prop, props, isAbsent) {
  4523. const { type, required, validator, skipCheck } = prop;
  4524. if (required && isAbsent) {
  4525. warn$1('Missing required prop: "' + name + '"');
  4526. return;
  4527. }
  4528. if (value == null && !required) {
  4529. return;
  4530. }
  4531. if (type != null && type !== true && !skipCheck) {
  4532. let isValid = false;
  4533. const types = isArray(type) ? type : [type];
  4534. const expectedTypes = [];
  4535. for (let i = 0; i < types.length && !isValid; i++) {
  4536. const { valid, expectedType } = assertType(value, types[i]);
  4537. expectedTypes.push(expectedType || "");
  4538. isValid = valid;
  4539. }
  4540. if (!isValid) {
  4541. warn$1(getInvalidTypeMessage(name, value, expectedTypes));
  4542. return;
  4543. }
  4544. }
  4545. if (validator && !validator(value, props)) {
  4546. warn$1('Invalid prop: custom validator check failed for prop "' + name + '".');
  4547. }
  4548. }
  4549. const isSimpleType = /* @__PURE__ */ makeMap(
  4550. "String,Number,Boolean,Function,Symbol,BigInt"
  4551. );
  4552. function assertType(value, type) {
  4553. let valid;
  4554. const expectedType = getType(type);
  4555. if (isSimpleType(expectedType)) {
  4556. const t = typeof value;
  4557. valid = t === expectedType.toLowerCase();
  4558. if (!valid && t === "object") {
  4559. valid = value instanceof type;
  4560. }
  4561. } else if (expectedType === "Object") {
  4562. valid = isObject(value);
  4563. } else if (expectedType === "Array") {
  4564. valid = isArray(value);
  4565. } else if (expectedType === "null") {
  4566. valid = value === null;
  4567. } else {
  4568. valid = value instanceof type;
  4569. }
  4570. return {
  4571. valid,
  4572. expectedType
  4573. };
  4574. }
  4575. function getInvalidTypeMessage(name, value, expectedTypes) {
  4576. if (expectedTypes.length === 0) {
  4577. return `Prop type [] for prop "${name}" won't match anything. Did you mean to use type Array instead?`;
  4578. }
  4579. let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(capitalize).join(" | ")}`;
  4580. const expectedType = expectedTypes[0];
  4581. const receivedType = toRawType(value);
  4582. const expectedValue = styleValue(value, expectedType);
  4583. const receivedValue = styleValue(value, receivedType);
  4584. if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) {
  4585. message += ` with value ${expectedValue}`;
  4586. }
  4587. message += `, got ${receivedType} `;
  4588. if (isExplicable(receivedType)) {
  4589. message += `with value ${receivedValue}.`;
  4590. }
  4591. return message;
  4592. }
  4593. function styleValue(value, type) {
  4594. if (type === "String") {
  4595. return `"${value}"`;
  4596. } else if (type === "Number") {
  4597. return `${Number(value)}`;
  4598. } else {
  4599. return `${value}`;
  4600. }
  4601. }
  4602. function isExplicable(type) {
  4603. const explicitTypes = ["string", "number", "boolean"];
  4604. return explicitTypes.some((elem) => type.toLowerCase() === elem);
  4605. }
  4606. function isBoolean(...args) {
  4607. return args.some((elem) => elem.toLowerCase() === "boolean");
  4608. }
  4609. const isInternalKey = (key) => key[0] === "_" || key === "$stable";
  4610. const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
  4611. const normalizeSlot = (key, rawSlot, ctx) => {
  4612. if (rawSlot._n) {
  4613. return rawSlot;
  4614. }
  4615. const normalized = withCtx((...args) => {
  4616. if (currentInstance && (!ctx || ctx.root === currentInstance.root)) {
  4617. warn$1(
  4618. `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.`
  4619. );
  4620. }
  4621. return normalizeSlotValue(rawSlot(...args));
  4622. }, ctx);
  4623. normalized._c = false;
  4624. return normalized;
  4625. };
  4626. const normalizeObjectSlots = (rawSlots, slots, instance) => {
  4627. const ctx = rawSlots._ctx;
  4628. for (const key in rawSlots) {
  4629. if (isInternalKey(key)) continue;
  4630. const value = rawSlots[key];
  4631. if (isFunction(value)) {
  4632. slots[key] = normalizeSlot(key, value, ctx);
  4633. } else if (value != null) {
  4634. {
  4635. warn$1(
  4636. `Non-function value encountered for slot "${key}". Prefer function slots for better performance.`
  4637. );
  4638. }
  4639. const normalized = normalizeSlotValue(value);
  4640. slots[key] = () => normalized;
  4641. }
  4642. }
  4643. };
  4644. const normalizeVNodeSlots = (instance, children) => {
  4645. if (!isKeepAlive(instance.vnode) && true) {
  4646. warn$1(
  4647. `Non-function value encountered for default slot. Prefer function slots for better performance.`
  4648. );
  4649. }
  4650. const normalized = normalizeSlotValue(children);
  4651. instance.slots.default = () => normalized;
  4652. };
  4653. const assignSlots = (slots, children, optimized) => {
  4654. for (const key in children) {
  4655. if (optimized || key !== "_") {
  4656. slots[key] = children[key];
  4657. }
  4658. }
  4659. };
  4660. const initSlots = (instance, children, optimized) => {
  4661. const slots = instance.slots = createInternalObject();
  4662. if (instance.vnode.shapeFlag & 32) {
  4663. const type = children._;
  4664. if (type) {
  4665. assignSlots(slots, children, optimized);
  4666. if (optimized) {
  4667. def(slots, "_", type, true);
  4668. }
  4669. } else {
  4670. normalizeObjectSlots(children, slots);
  4671. }
  4672. } else if (children) {
  4673. normalizeVNodeSlots(instance, children);
  4674. }
  4675. };
  4676. const updateSlots = (instance, children, optimized) => {
  4677. const { vnode, slots } = instance;
  4678. let needDeletionCheck = true;
  4679. let deletionComparisonTarget = EMPTY_OBJ;
  4680. if (vnode.shapeFlag & 32) {
  4681. const type = children._;
  4682. if (type) {
  4683. if (isHmrUpdating) {
  4684. assignSlots(slots, children, optimized);
  4685. trigger(instance, "set", "$slots");
  4686. } else if (optimized && type === 1) {
  4687. needDeletionCheck = false;
  4688. } else {
  4689. assignSlots(slots, children, optimized);
  4690. }
  4691. } else {
  4692. needDeletionCheck = !children.$stable;
  4693. normalizeObjectSlots(children, slots);
  4694. }
  4695. deletionComparisonTarget = children;
  4696. } else if (children) {
  4697. normalizeVNodeSlots(instance, children);
  4698. deletionComparisonTarget = { default: 1 };
  4699. }
  4700. if (needDeletionCheck) {
  4701. for (const key in slots) {
  4702. if (!isInternalKey(key) && deletionComparisonTarget[key] == null) {
  4703. delete slots[key];
  4704. }
  4705. }
  4706. }
  4707. };
  4708. function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
  4709. if (isArray(rawRef)) {
  4710. rawRef.forEach(
  4711. (r, i) => setRef(
  4712. r,
  4713. oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef),
  4714. parentSuspense,
  4715. vnode,
  4716. isUnmount
  4717. )
  4718. );
  4719. return;
  4720. }
  4721. if (isAsyncWrapper(vnode) && !isUnmount) {
  4722. return;
  4723. }
  4724. const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el;
  4725. const value = isUnmount ? null : refValue;
  4726. const { i: owner, r: ref } = rawRef;
  4727. if (!owner) {
  4728. warn$1(
  4729. `Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.`
  4730. );
  4731. return;
  4732. }
  4733. const oldRef = oldRawRef && oldRawRef.r;
  4734. const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
  4735. const setupState = owner.setupState;
  4736. if (oldRef != null && oldRef !== ref) {
  4737. if (isString(oldRef)) {
  4738. refs[oldRef] = null;
  4739. if (hasOwn(setupState, oldRef)) {
  4740. setupState[oldRef] = null;
  4741. }
  4742. } else if (isRef(oldRef)) {
  4743. oldRef.value = null;
  4744. }
  4745. }
  4746. if (isFunction(ref)) {
  4747. callWithErrorHandling(ref, owner, 12, [value, refs]);
  4748. } else {
  4749. const _isString = isString(ref);
  4750. const _isRef = isRef(ref);
  4751. if (_isString || _isRef) {
  4752. const doSet = () => {
  4753. if (rawRef.f) {
  4754. const existing = _isString ? hasOwn(setupState, ref) ? setupState[ref] : refs[ref] : ref.value;
  4755. if (isUnmount) {
  4756. isArray(existing) && remove(existing, refValue);
  4757. } else {
  4758. if (!isArray(existing)) {
  4759. if (_isString) {
  4760. refs[ref] = [refValue];
  4761. if (hasOwn(setupState, ref)) {
  4762. setupState[ref] = refs[ref];
  4763. }
  4764. } else {
  4765. ref.value = [refValue];
  4766. if (rawRef.k) refs[rawRef.k] = ref.value;
  4767. }
  4768. } else if (!existing.includes(refValue)) {
  4769. existing.push(refValue);
  4770. }
  4771. }
  4772. } else if (_isString) {
  4773. refs[ref] = value;
  4774. if (hasOwn(setupState, ref)) {
  4775. setupState[ref] = value;
  4776. }
  4777. } else if (_isRef) {
  4778. ref.value = value;
  4779. if (rawRef.k) refs[rawRef.k] = value;
  4780. } else {
  4781. warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
  4782. }
  4783. };
  4784. if (value) {
  4785. doSet.id = -1;
  4786. queuePostRenderEffect(doSet, parentSuspense);
  4787. } else {
  4788. doSet();
  4789. }
  4790. } else {
  4791. warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
  4792. }
  4793. }
  4794. }
  4795. const TeleportEndKey = Symbol("_vte");
  4796. const isTeleport = (type) => type.__isTeleport;
  4797. const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
  4798. const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement;
  4799. const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement;
  4800. const resolveTarget = (props, select) => {
  4801. const targetSelector = props && props.to;
  4802. if (isString(targetSelector)) {
  4803. if (!select) {
  4804. warn$1(
  4805. `Current renderer does not support string target for Teleports. (missing querySelector renderer option)`
  4806. );
  4807. return null;
  4808. } else {
  4809. const target = select(targetSelector);
  4810. if (!target && !isTeleportDisabled(props)) {
  4811. warn$1(
  4812. `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.`
  4813. );
  4814. }
  4815. return target;
  4816. }
  4817. } else {
  4818. if (!targetSelector && !isTeleportDisabled(props)) {
  4819. warn$1(`Invalid Teleport target: ${targetSelector}`);
  4820. }
  4821. return targetSelector;
  4822. }
  4823. };
  4824. const TeleportImpl = {
  4825. name: "Teleport",
  4826. __isTeleport: true,
  4827. process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
  4828. const {
  4829. mc: mountChildren,
  4830. pc: patchChildren,
  4831. pbc: patchBlockChildren,
  4832. o: { insert, querySelector, createText, createComment }
  4833. } = internals;
  4834. const disabled = isTeleportDisabled(n2.props);
  4835. let { shapeFlag, children, dynamicChildren } = n2;
  4836. if (isHmrUpdating) {
  4837. optimized = false;
  4838. dynamicChildren = null;
  4839. }
  4840. if (n1 == null) {
  4841. const placeholder = n2.el = createComment("teleport start") ;
  4842. const mainAnchor = n2.anchor = createComment("teleport end") ;
  4843. insert(placeholder, container, anchor);
  4844. insert(mainAnchor, container, anchor);
  4845. const target = n2.target = resolveTarget(n2.props, querySelector);
  4846. const targetAnchor = prepareAnchor(target, n2, createText, insert);
  4847. if (target) {
  4848. if (namespace === "svg" || isTargetSVG(target)) {
  4849. namespace = "svg";
  4850. } else if (namespace === "mathml" || isTargetMathML(target)) {
  4851. namespace = "mathml";
  4852. }
  4853. } else if (!disabled) {
  4854. warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`);
  4855. }
  4856. const mount = (container2, anchor2) => {
  4857. if (shapeFlag & 16) {
  4858. mountChildren(
  4859. children,
  4860. container2,
  4861. anchor2,
  4862. parentComponent,
  4863. parentSuspense,
  4864. namespace,
  4865. slotScopeIds,
  4866. optimized
  4867. );
  4868. }
  4869. };
  4870. if (disabled) {
  4871. mount(container, mainAnchor);
  4872. } else if (target) {
  4873. mount(target, targetAnchor);
  4874. }
  4875. } else {
  4876. n2.el = n1.el;
  4877. n2.targetStart = n1.targetStart;
  4878. const mainAnchor = n2.anchor = n1.anchor;
  4879. const target = n2.target = n1.target;
  4880. const targetAnchor = n2.targetAnchor = n1.targetAnchor;
  4881. const wasDisabled = isTeleportDisabled(n1.props);
  4882. const currentContainer = wasDisabled ? container : target;
  4883. const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
  4884. if (namespace === "svg" || isTargetSVG(target)) {
  4885. namespace = "svg";
  4886. } else if (namespace === "mathml" || isTargetMathML(target)) {
  4887. namespace = "mathml";
  4888. }
  4889. if (dynamicChildren) {
  4890. patchBlockChildren(
  4891. n1.dynamicChildren,
  4892. dynamicChildren,
  4893. currentContainer,
  4894. parentComponent,
  4895. parentSuspense,
  4896. namespace,
  4897. slotScopeIds
  4898. );
  4899. traverseStaticChildren(n1, n2, true);
  4900. } else if (!optimized) {
  4901. patchChildren(
  4902. n1,
  4903. n2,
  4904. currentContainer,
  4905. currentAnchor,
  4906. parentComponent,
  4907. parentSuspense,
  4908. namespace,
  4909. slotScopeIds,
  4910. false
  4911. );
  4912. }
  4913. if (disabled) {
  4914. if (!wasDisabled) {
  4915. moveTeleport(
  4916. n2,
  4917. container,
  4918. mainAnchor,
  4919. internals,
  4920. 1
  4921. );
  4922. } else {
  4923. if (n2.props && n1.props && n2.props.to !== n1.props.to) {
  4924. n2.props.to = n1.props.to;
  4925. }
  4926. }
  4927. } else {
  4928. if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
  4929. const nextTarget = n2.target = resolveTarget(
  4930. n2.props,
  4931. querySelector
  4932. );
  4933. if (nextTarget) {
  4934. moveTeleport(
  4935. n2,
  4936. nextTarget,
  4937. null,
  4938. internals,
  4939. 0
  4940. );
  4941. } else {
  4942. warn$1(
  4943. "Invalid Teleport target on update:",
  4944. target,
  4945. `(${typeof target})`
  4946. );
  4947. }
  4948. } else if (wasDisabled) {
  4949. moveTeleport(
  4950. n2,
  4951. target,
  4952. targetAnchor,
  4953. internals,
  4954. 1
  4955. );
  4956. }
  4957. }
  4958. }
  4959. updateCssVars(n2);
  4960. },
  4961. remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
  4962. const {
  4963. shapeFlag,
  4964. children,
  4965. anchor,
  4966. targetStart,
  4967. targetAnchor,
  4968. target,
  4969. props
  4970. } = vnode;
  4971. if (target) {
  4972. hostRemove(targetStart);
  4973. hostRemove(targetAnchor);
  4974. }
  4975. doRemove && hostRemove(anchor);
  4976. if (shapeFlag & 16) {
  4977. const shouldRemove = doRemove || !isTeleportDisabled(props);
  4978. for (let i = 0; i < children.length; i++) {
  4979. const child = children[i];
  4980. unmount(
  4981. child,
  4982. parentComponent,
  4983. parentSuspense,
  4984. shouldRemove,
  4985. !!child.dynamicChildren
  4986. );
  4987. }
  4988. }
  4989. },
  4990. move: moveTeleport,
  4991. hydrate: hydrateTeleport
  4992. };
  4993. function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) {
  4994. if (moveType === 0) {
  4995. insert(vnode.targetAnchor, container, parentAnchor);
  4996. }
  4997. const { el, anchor, shapeFlag, children, props } = vnode;
  4998. const isReorder = moveType === 2;
  4999. if (isReorder) {
  5000. insert(el, container, parentAnchor);
  5001. }
  5002. if (!isReorder || isTeleportDisabled(props)) {
  5003. if (shapeFlag & 16) {
  5004. for (let i = 0; i < children.length; i++) {
  5005. move(
  5006. children[i],
  5007. container,
  5008. parentAnchor,
  5009. 2
  5010. );
  5011. }
  5012. }
  5013. }
  5014. if (isReorder) {
  5015. insert(anchor, container, parentAnchor);
  5016. }
  5017. }
  5018. function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
  5019. o: { nextSibling, parentNode, querySelector, insert, createText }
  5020. }, hydrateChildren) {
  5021. const target = vnode.target = resolveTarget(
  5022. vnode.props,
  5023. querySelector
  5024. );
  5025. if (target) {
  5026. const targetNode = target._lpa || target.firstChild;
  5027. if (vnode.shapeFlag & 16) {
  5028. if (isTeleportDisabled(vnode.props)) {
  5029. vnode.anchor = hydrateChildren(
  5030. nextSibling(node),
  5031. vnode,
  5032. parentNode(node),
  5033. parentComponent,
  5034. parentSuspense,
  5035. slotScopeIds,
  5036. optimized
  5037. );
  5038. vnode.targetStart = targetNode;
  5039. vnode.targetAnchor = targetNode && nextSibling(targetNode);
  5040. } else {
  5041. vnode.anchor = nextSibling(node);
  5042. let targetAnchor = targetNode;
  5043. while (targetAnchor) {
  5044. if (targetAnchor && targetAnchor.nodeType === 8) {
  5045. if (targetAnchor.data === "teleport start anchor") {
  5046. vnode.targetStart = targetAnchor;
  5047. } else if (targetAnchor.data === "teleport anchor") {
  5048. vnode.targetAnchor = targetAnchor;
  5049. target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
  5050. break;
  5051. }
  5052. }
  5053. targetAnchor = nextSibling(targetAnchor);
  5054. }
  5055. if (!vnode.targetAnchor) {
  5056. prepareAnchor(target, vnode, createText, insert);
  5057. }
  5058. hydrateChildren(
  5059. targetNode && nextSibling(targetNode),
  5060. vnode,
  5061. target,
  5062. parentComponent,
  5063. parentSuspense,
  5064. slotScopeIds,
  5065. optimized
  5066. );
  5067. }
  5068. }
  5069. updateCssVars(vnode);
  5070. }
  5071. return vnode.anchor && nextSibling(vnode.anchor);
  5072. }
  5073. const Teleport = TeleportImpl;
  5074. function updateCssVars(vnode) {
  5075. const ctx = vnode.ctx;
  5076. if (ctx && ctx.ut) {
  5077. let node = vnode.children[0].el;
  5078. while (node && node !== vnode.targetAnchor) {
  5079. if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx.uid);
  5080. node = node.nextSibling;
  5081. }
  5082. ctx.ut();
  5083. }
  5084. }
  5085. function prepareAnchor(target, vnode, createText, insert) {
  5086. const targetStart = vnode.targetStart = createText("");
  5087. const targetAnchor = vnode.targetAnchor = createText("");
  5088. targetStart[TeleportEndKey] = targetAnchor;
  5089. if (target) {
  5090. insert(targetStart, target);
  5091. insert(targetAnchor, target);
  5092. }
  5093. return targetAnchor;
  5094. }
  5095. let hasLoggedMismatchError = false;
  5096. const logMismatchError = () => {
  5097. if (hasLoggedMismatchError) {
  5098. return;
  5099. }
  5100. console.error("Hydration completed but contains mismatches.");
  5101. hasLoggedMismatchError = true;
  5102. };
  5103. const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
  5104. const isMathMLContainer = (container) => container.namespaceURI.includes("MathML");
  5105. const getContainerType = (container) => {
  5106. if (isSVGContainer(container)) return "svg";
  5107. if (isMathMLContainer(container)) return "mathml";
  5108. return void 0;
  5109. };
  5110. const isComment = (node) => node.nodeType === 8 /* COMMENT */;
  5111. function createHydrationFunctions(rendererInternals) {
  5112. const {
  5113. mt: mountComponent,
  5114. p: patch,
  5115. o: {
  5116. patchProp,
  5117. createText,
  5118. nextSibling,
  5119. parentNode,
  5120. remove,
  5121. insert,
  5122. createComment
  5123. }
  5124. } = rendererInternals;
  5125. const hydrate = (vnode, container) => {
  5126. if (!container.hasChildNodes()) {
  5127. warn$1(
  5128. `Attempting to hydrate existing markup but container is empty. Performing full mount instead.`
  5129. );
  5130. patch(null, vnode, container);
  5131. flushPostFlushCbs();
  5132. container._vnode = vnode;
  5133. return;
  5134. }
  5135. hydrateNode(container.firstChild, vnode, null, null, null);
  5136. flushPostFlushCbs();
  5137. container._vnode = vnode;
  5138. };
  5139. const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
  5140. optimized = optimized || !!vnode.dynamicChildren;
  5141. const isFragmentStart = isComment(node) && node.data === "[";
  5142. const onMismatch = () => handleMismatch(
  5143. node,
  5144. vnode,
  5145. parentComponent,
  5146. parentSuspense,
  5147. slotScopeIds,
  5148. isFragmentStart
  5149. );
  5150. const { type, ref, shapeFlag, patchFlag } = vnode;
  5151. let domType = node.nodeType;
  5152. vnode.el = node;
  5153. {
  5154. def(node, "__vnode", vnode, true);
  5155. def(node, "__vueParentComponent", parentComponent, true);
  5156. }
  5157. if (patchFlag === -2) {
  5158. optimized = false;
  5159. vnode.dynamicChildren = null;
  5160. }
  5161. let nextNode = null;
  5162. switch (type) {
  5163. case Text:
  5164. if (domType !== 3 /* TEXT */) {
  5165. if (vnode.children === "") {
  5166. insert(vnode.el = createText(""), parentNode(node), node);
  5167. nextNode = node;
  5168. } else {
  5169. nextNode = onMismatch();
  5170. }
  5171. } else {
  5172. if (node.data !== vnode.children) {
  5173. warn$1(
  5174. `Hydration text mismatch in`,
  5175. node.parentNode,
  5176. `
  5177. - rendered on server: ${JSON.stringify(
  5178. node.data
  5179. )}
  5180. - expected on client: ${JSON.stringify(vnode.children)}`
  5181. );
  5182. logMismatchError();
  5183. node.data = vnode.children;
  5184. }
  5185. nextNode = nextSibling(node);
  5186. }
  5187. break;
  5188. case Comment:
  5189. if (isTemplateNode(node)) {
  5190. nextNode = nextSibling(node);
  5191. replaceNode(
  5192. vnode.el = node.content.firstChild,
  5193. node,
  5194. parentComponent
  5195. );
  5196. } else if (domType !== 8 /* COMMENT */ || isFragmentStart) {
  5197. nextNode = onMismatch();
  5198. } else {
  5199. nextNode = nextSibling(node);
  5200. }
  5201. break;
  5202. case Static:
  5203. if (isFragmentStart) {
  5204. node = nextSibling(node);
  5205. domType = node.nodeType;
  5206. }
  5207. if (domType === 1 /* ELEMENT */ || domType === 3 /* TEXT */) {
  5208. nextNode = node;
  5209. const needToAdoptContent = !vnode.children.length;
  5210. for (let i = 0; i < vnode.staticCount; i++) {
  5211. if (needToAdoptContent)
  5212. vnode.children += nextNode.nodeType === 1 /* ELEMENT */ ? nextNode.outerHTML : nextNode.data;
  5213. if (i === vnode.staticCount - 1) {
  5214. vnode.anchor = nextNode;
  5215. }
  5216. nextNode = nextSibling(nextNode);
  5217. }
  5218. return isFragmentStart ? nextSibling(nextNode) : nextNode;
  5219. } else {
  5220. onMismatch();
  5221. }
  5222. break;
  5223. case Fragment:
  5224. if (!isFragmentStart) {
  5225. nextNode = onMismatch();
  5226. } else {
  5227. nextNode = hydrateFragment(
  5228. node,
  5229. vnode,
  5230. parentComponent,
  5231. parentSuspense,
  5232. slotScopeIds,
  5233. optimized
  5234. );
  5235. }
  5236. break;
  5237. default:
  5238. if (shapeFlag & 1) {
  5239. if ((domType !== 1 /* ELEMENT */ || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) {
  5240. nextNode = onMismatch();
  5241. } else {
  5242. nextNode = hydrateElement(
  5243. node,
  5244. vnode,
  5245. parentComponent,
  5246. parentSuspense,
  5247. slotScopeIds,
  5248. optimized
  5249. );
  5250. }
  5251. } else if (shapeFlag & 6) {
  5252. vnode.slotScopeIds = slotScopeIds;
  5253. const container = parentNode(node);
  5254. if (isFragmentStart) {
  5255. nextNode = locateClosingAnchor(node);
  5256. } else if (isComment(node) && node.data === "teleport start") {
  5257. nextNode = locateClosingAnchor(node, node.data, "teleport end");
  5258. } else {
  5259. nextNode = nextSibling(node);
  5260. }
  5261. mountComponent(
  5262. vnode,
  5263. container,
  5264. null,
  5265. parentComponent,
  5266. parentSuspense,
  5267. getContainerType(container),
  5268. optimized
  5269. );
  5270. if (isAsyncWrapper(vnode)) {
  5271. let subTree;
  5272. if (isFragmentStart) {
  5273. subTree = createVNode(Fragment);
  5274. subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
  5275. } else {
  5276. subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
  5277. }
  5278. subTree.el = node;
  5279. vnode.component.subTree = subTree;
  5280. }
  5281. } else if (shapeFlag & 64) {
  5282. if (domType !== 8 /* COMMENT */) {
  5283. nextNode = onMismatch();
  5284. } else {
  5285. nextNode = vnode.type.hydrate(
  5286. node,
  5287. vnode,
  5288. parentComponent,
  5289. parentSuspense,
  5290. slotScopeIds,
  5291. optimized,
  5292. rendererInternals,
  5293. hydrateChildren
  5294. );
  5295. }
  5296. } else if (shapeFlag & 128) {
  5297. nextNode = vnode.type.hydrate(
  5298. node,
  5299. vnode,
  5300. parentComponent,
  5301. parentSuspense,
  5302. getContainerType(parentNode(node)),
  5303. slotScopeIds,
  5304. optimized,
  5305. rendererInternals,
  5306. hydrateNode
  5307. );
  5308. } else {
  5309. warn$1("Invalid HostVNode type:", type, `(${typeof type})`);
  5310. }
  5311. }
  5312. if (ref != null) {
  5313. setRef(ref, null, parentSuspense, vnode);
  5314. }
  5315. return nextNode;
  5316. };
  5317. const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
  5318. optimized = optimized || !!vnode.dynamicChildren;
  5319. const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
  5320. const forcePatch = type === "input" || type === "option";
  5321. {
  5322. if (dirs) {
  5323. invokeDirectiveHook(vnode, null, parentComponent, "created");
  5324. }
  5325. let needCallTransitionHooks = false;
  5326. if (isTemplateNode(el)) {
  5327. needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
  5328. const content = el.content.firstChild;
  5329. if (needCallTransitionHooks) {
  5330. transition.beforeEnter(content);
  5331. }
  5332. replaceNode(content, el, parentComponent);
  5333. vnode.el = el = content;
  5334. }
  5335. if (shapeFlag & 16 && // skip if element has innerHTML / textContent
  5336. !(props && (props.innerHTML || props.textContent))) {
  5337. let next = hydrateChildren(
  5338. el.firstChild,
  5339. vnode,
  5340. el,
  5341. parentComponent,
  5342. parentSuspense,
  5343. slotScopeIds,
  5344. optimized
  5345. );
  5346. let hasWarned = false;
  5347. while (next) {
  5348. if (!hasWarned) {
  5349. warn$1(
  5350. `Hydration children mismatch on`,
  5351. el,
  5352. `
  5353. Server rendered element contains more child nodes than client vdom.`
  5354. );
  5355. hasWarned = true;
  5356. }
  5357. logMismatchError();
  5358. const cur = next;
  5359. next = next.nextSibling;
  5360. remove(cur);
  5361. }
  5362. } else if (shapeFlag & 8) {
  5363. if (el.textContent !== vnode.children) {
  5364. warn$1(
  5365. `Hydration text content mismatch on`,
  5366. el,
  5367. `
  5368. - rendered on server: ${el.textContent}
  5369. - expected on client: ${vnode.children}`
  5370. );
  5371. logMismatchError();
  5372. el.textContent = vnode.children;
  5373. }
  5374. }
  5375. if (props) {
  5376. {
  5377. const isCustomElement = el.tagName.includes("-");
  5378. for (const key in props) {
  5379. if (// #11189 skip if this node has directives that have created hooks
  5380. // as it could have mutated the DOM in any possible way
  5381. !(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) {
  5382. logMismatchError();
  5383. }
  5384. if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
  5385. key[0] === "." || isCustomElement) {
  5386. patchProp(el, key, null, props[key], void 0, parentComponent);
  5387. }
  5388. }
  5389. }
  5390. }
  5391. let vnodeHooks;
  5392. if (vnodeHooks = props && props.onVnodeBeforeMount) {
  5393. invokeVNodeHook(vnodeHooks, parentComponent, vnode);
  5394. }
  5395. if (dirs) {
  5396. invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
  5397. }
  5398. if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
  5399. queueEffectWithSuspense(() => {
  5400. vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
  5401. needCallTransitionHooks && transition.enter(el);
  5402. dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
  5403. }, parentSuspense);
  5404. }
  5405. }
  5406. return el.nextSibling;
  5407. };
  5408. const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized) => {
  5409. optimized = optimized || !!parentVNode.dynamicChildren;
  5410. const children = parentVNode.children;
  5411. const l = children.length;
  5412. let hasWarned = false;
  5413. for (let i = 0; i < l; i++) {
  5414. const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
  5415. const isText = vnode.type === Text;
  5416. if (node) {
  5417. if (isText && !optimized) {
  5418. let next = children[i + 1];
  5419. if (next && (next = normalizeVNode(next)).type === Text) {
  5420. insert(
  5421. createText(
  5422. node.data.slice(vnode.children.length)
  5423. ),
  5424. container,
  5425. nextSibling(node)
  5426. );
  5427. node.data = vnode.children;
  5428. }
  5429. }
  5430. node = hydrateNode(
  5431. node,
  5432. vnode,
  5433. parentComponent,
  5434. parentSuspense,
  5435. slotScopeIds,
  5436. optimized
  5437. );
  5438. } else if (isText && !vnode.children) {
  5439. insert(vnode.el = createText(""), container);
  5440. } else {
  5441. if (!hasWarned) {
  5442. warn$1(
  5443. `Hydration children mismatch on`,
  5444. container,
  5445. `
  5446. Server rendered element contains fewer child nodes than client vdom.`
  5447. );
  5448. hasWarned = true;
  5449. }
  5450. logMismatchError();
  5451. patch(
  5452. null,
  5453. vnode,
  5454. container,
  5455. null,
  5456. parentComponent,
  5457. parentSuspense,
  5458. getContainerType(container),
  5459. slotScopeIds
  5460. );
  5461. }
  5462. }
  5463. return node;
  5464. };
  5465. const hydrateFragment = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
  5466. const { slotScopeIds: fragmentSlotScopeIds } = vnode;
  5467. if (fragmentSlotScopeIds) {
  5468. slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
  5469. }
  5470. const container = parentNode(node);
  5471. const next = hydrateChildren(
  5472. nextSibling(node),
  5473. vnode,
  5474. container,
  5475. parentComponent,
  5476. parentSuspense,
  5477. slotScopeIds,
  5478. optimized
  5479. );
  5480. if (next && isComment(next) && next.data === "]") {
  5481. return nextSibling(vnode.anchor = next);
  5482. } else {
  5483. logMismatchError();
  5484. insert(vnode.anchor = createComment(`]`), container, next);
  5485. return next;
  5486. }
  5487. };
  5488. const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
  5489. warn$1(
  5490. `Hydration node mismatch:
  5491. - rendered on server:`,
  5492. node,
  5493. node.nodeType === 3 /* TEXT */ ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``,
  5494. `
  5495. - expected on client:`,
  5496. vnode.type
  5497. );
  5498. logMismatchError();
  5499. vnode.el = null;
  5500. if (isFragment) {
  5501. const end = locateClosingAnchor(node);
  5502. while (true) {
  5503. const next2 = nextSibling(node);
  5504. if (next2 && next2 !== end) {
  5505. remove(next2);
  5506. } else {
  5507. break;
  5508. }
  5509. }
  5510. }
  5511. const next = nextSibling(node);
  5512. const container = parentNode(node);
  5513. remove(node);
  5514. patch(
  5515. null,
  5516. vnode,
  5517. container,
  5518. next,
  5519. parentComponent,
  5520. parentSuspense,
  5521. getContainerType(container),
  5522. slotScopeIds
  5523. );
  5524. return next;
  5525. };
  5526. const locateClosingAnchor = (node, open = "[", close = "]") => {
  5527. let match = 0;
  5528. while (node) {
  5529. node = nextSibling(node);
  5530. if (node && isComment(node)) {
  5531. if (node.data === open) match++;
  5532. if (node.data === close) {
  5533. if (match === 0) {
  5534. return nextSibling(node);
  5535. } else {
  5536. match--;
  5537. }
  5538. }
  5539. }
  5540. }
  5541. return node;
  5542. };
  5543. const replaceNode = (newNode, oldNode, parentComponent) => {
  5544. const parentNode2 = oldNode.parentNode;
  5545. if (parentNode2) {
  5546. parentNode2.replaceChild(newNode, oldNode);
  5547. }
  5548. let parent = parentComponent;
  5549. while (parent) {
  5550. if (parent.vnode.el === oldNode) {
  5551. parent.vnode.el = parent.subTree.el = newNode;
  5552. }
  5553. parent = parent.parent;
  5554. }
  5555. };
  5556. const isTemplateNode = (node) => {
  5557. return node.nodeType === 1 /* ELEMENT */ && node.tagName.toLowerCase() === "template";
  5558. };
  5559. return [hydrate, hydrateNode];
  5560. }
  5561. function propHasMismatch(el, key, clientValue, vnode, instance) {
  5562. let mismatchType;
  5563. let mismatchKey;
  5564. let actual;
  5565. let expected;
  5566. if (key === "class") {
  5567. actual = el.getAttribute("class");
  5568. expected = normalizeClass(clientValue);
  5569. if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) {
  5570. mismatchType = mismatchKey = `class`;
  5571. }
  5572. } else if (key === "style") {
  5573. actual = el.getAttribute("style") || "";
  5574. expected = isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue));
  5575. const actualMap = toStyleMap(actual);
  5576. const expectedMap = toStyleMap(expected);
  5577. if (vnode.dirs) {
  5578. for (const { dir, value } of vnode.dirs) {
  5579. if (dir.name === "show" && !value) {
  5580. expectedMap.set("display", "none");
  5581. }
  5582. }
  5583. }
  5584. if (instance) {
  5585. resolveCssVars(instance, vnode, expectedMap);
  5586. }
  5587. if (!isMapEqual(actualMap, expectedMap)) {
  5588. mismatchType = mismatchKey = "style";
  5589. }
  5590. } else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
  5591. if (isBooleanAttr(key)) {
  5592. actual = el.hasAttribute(key);
  5593. expected = includeBooleanAttr(clientValue);
  5594. } else if (clientValue == null) {
  5595. actual = el.hasAttribute(key);
  5596. expected = false;
  5597. } else {
  5598. if (el.hasAttribute(key)) {
  5599. actual = el.getAttribute(key);
  5600. } else if (key === "value" && el.tagName === "TEXTAREA") {
  5601. actual = el.value;
  5602. } else {
  5603. actual = false;
  5604. }
  5605. expected = isRenderableAttrValue(clientValue) ? String(clientValue) : false;
  5606. }
  5607. if (actual !== expected) {
  5608. mismatchType = `attribute`;
  5609. mismatchKey = key;
  5610. }
  5611. }
  5612. if (mismatchType) {
  5613. const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
  5614. const preSegment = `Hydration ${mismatchType} mismatch on`;
  5615. const postSegment = `
  5616. - rendered on server: ${format(actual)}
  5617. - expected on client: ${format(expected)}
  5618. Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.
  5619. You should fix the source of the mismatch.`;
  5620. {
  5621. warn$1(preSegment, el, postSegment);
  5622. }
  5623. return true;
  5624. }
  5625. return false;
  5626. }
  5627. function toClassSet(str) {
  5628. return new Set(str.trim().split(/\s+/));
  5629. }
  5630. function isSetEqual(a, b) {
  5631. if (a.size !== b.size) {
  5632. return false;
  5633. }
  5634. for (const s of a) {
  5635. if (!b.has(s)) {
  5636. return false;
  5637. }
  5638. }
  5639. return true;
  5640. }
  5641. function toStyleMap(str) {
  5642. const styleMap = /* @__PURE__ */ new Map();
  5643. for (const item of str.split(";")) {
  5644. let [key, value] = item.split(":");
  5645. key = key.trim();
  5646. value = value && value.trim();
  5647. if (key && value) {
  5648. styleMap.set(key, value);
  5649. }
  5650. }
  5651. return styleMap;
  5652. }
  5653. function isMapEqual(a, b) {
  5654. if (a.size !== b.size) {
  5655. return false;
  5656. }
  5657. for (const [key, value] of a) {
  5658. if (value !== b.get(key)) {
  5659. return false;
  5660. }
  5661. }
  5662. return true;
  5663. }
  5664. function resolveCssVars(instance, vnode, expectedMap) {
  5665. const root = instance.subTree;
  5666. if (instance.getCssVars && (vnode === root || root && root.type === Fragment && root.children.includes(vnode))) {
  5667. const cssVars = instance.getCssVars();
  5668. for (const key in cssVars) {
  5669. expectedMap.set(`--${key}`, String(cssVars[key]));
  5670. }
  5671. }
  5672. if (vnode === root && instance.parent) {
  5673. resolveCssVars(instance.parent, instance.vnode, expectedMap);
  5674. }
  5675. }
  5676. let supported;
  5677. let perf;
  5678. function startMeasure(instance, type) {
  5679. if (instance.appContext.config.performance && isSupported()) {
  5680. perf.mark(`vue-${type}-${instance.uid}`);
  5681. }
  5682. {
  5683. devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now());
  5684. }
  5685. }
  5686. function endMeasure(instance, type) {
  5687. if (instance.appContext.config.performance && isSupported()) {
  5688. const startTag = `vue-${type}-${instance.uid}`;
  5689. const endTag = startTag + `:end`;
  5690. perf.mark(endTag);
  5691. perf.measure(
  5692. `<${formatComponentName(instance, instance.type)}> ${type}`,
  5693. startTag,
  5694. endTag
  5695. );
  5696. perf.clearMarks(startTag);
  5697. perf.clearMarks(endTag);
  5698. }
  5699. {
  5700. devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now());
  5701. }
  5702. }
  5703. function isSupported() {
  5704. if (supported !== void 0) {
  5705. return supported;
  5706. }
  5707. if (typeof window !== "undefined" && window.performance) {
  5708. supported = true;
  5709. perf = window.performance;
  5710. } else {
  5711. supported = false;
  5712. }
  5713. return supported;
  5714. }
  5715. const queuePostRenderEffect = queueEffectWithSuspense ;
  5716. function createRenderer(options) {
  5717. return baseCreateRenderer(options);
  5718. }
  5719. function createHydrationRenderer(options) {
  5720. return baseCreateRenderer(options, createHydrationFunctions);
  5721. }
  5722. function baseCreateRenderer(options, createHydrationFns) {
  5723. const target = getGlobalThis();
  5724. target.__VUE__ = true;
  5725. {
  5726. setDevtoolsHook$1(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target);
  5727. }
  5728. const {
  5729. insert: hostInsert,
  5730. remove: hostRemove,
  5731. patchProp: hostPatchProp,
  5732. createElement: hostCreateElement,
  5733. createText: hostCreateText,
  5734. createComment: hostCreateComment,
  5735. setText: hostSetText,
  5736. setElementText: hostSetElementText,
  5737. parentNode: hostParentNode,
  5738. nextSibling: hostNextSibling,
  5739. setScopeId: hostSetScopeId = NOOP,
  5740. insertStaticContent: hostInsertStaticContent
  5741. } = options;
  5742. const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = isHmrUpdating ? false : !!n2.dynamicChildren) => {
  5743. if (n1 === n2) {
  5744. return;
  5745. }
  5746. if (n1 && !isSameVNodeType(n1, n2)) {
  5747. anchor = getNextHostNode(n1);
  5748. unmount(n1, parentComponent, parentSuspense, true);
  5749. n1 = null;
  5750. }
  5751. if (n2.patchFlag === -2) {
  5752. optimized = false;
  5753. n2.dynamicChildren = null;
  5754. }
  5755. const { type, ref, shapeFlag } = n2;
  5756. switch (type) {
  5757. case Text:
  5758. processText(n1, n2, container, anchor);
  5759. break;
  5760. case Comment:
  5761. processCommentNode(n1, n2, container, anchor);
  5762. break;
  5763. case Static:
  5764. if (n1 == null) {
  5765. mountStaticNode(n2, container, anchor, namespace);
  5766. } else {
  5767. patchStaticNode(n1, n2, container, namespace);
  5768. }
  5769. break;
  5770. case Fragment:
  5771. processFragment(
  5772. n1,
  5773. n2,
  5774. container,
  5775. anchor,
  5776. parentComponent,
  5777. parentSuspense,
  5778. namespace,
  5779. slotScopeIds,
  5780. optimized
  5781. );
  5782. break;
  5783. default:
  5784. if (shapeFlag & 1) {
  5785. processElement(
  5786. n1,
  5787. n2,
  5788. container,
  5789. anchor,
  5790. parentComponent,
  5791. parentSuspense,
  5792. namespace,
  5793. slotScopeIds,
  5794. optimized
  5795. );
  5796. } else if (shapeFlag & 6) {
  5797. processComponent(
  5798. n1,
  5799. n2,
  5800. container,
  5801. anchor,
  5802. parentComponent,
  5803. parentSuspense,
  5804. namespace,
  5805. slotScopeIds,
  5806. optimized
  5807. );
  5808. } else if (shapeFlag & 64) {
  5809. type.process(
  5810. n1,
  5811. n2,
  5812. container,
  5813. anchor,
  5814. parentComponent,
  5815. parentSuspense,
  5816. namespace,
  5817. slotScopeIds,
  5818. optimized,
  5819. internals
  5820. );
  5821. } else if (shapeFlag & 128) {
  5822. type.process(
  5823. n1,
  5824. n2,
  5825. container,
  5826. anchor,
  5827. parentComponent,
  5828. parentSuspense,
  5829. namespace,
  5830. slotScopeIds,
  5831. optimized,
  5832. internals
  5833. );
  5834. } else {
  5835. warn$1("Invalid VNode type:", type, `(${typeof type})`);
  5836. }
  5837. }
  5838. if (ref != null && parentComponent) {
  5839. setRef(ref, n1 && n1.ref, parentSuspense, n2 || n1, !n2);
  5840. }
  5841. };
  5842. const processText = (n1, n2, container, anchor) => {
  5843. if (n1 == null) {
  5844. hostInsert(
  5845. n2.el = hostCreateText(n2.children),
  5846. container,
  5847. anchor
  5848. );
  5849. } else {
  5850. const el = n2.el = n1.el;
  5851. if (n2.children !== n1.children) {
  5852. hostSetText(el, n2.children);
  5853. }
  5854. }
  5855. };
  5856. const processCommentNode = (n1, n2, container, anchor) => {
  5857. if (n1 == null) {
  5858. hostInsert(
  5859. n2.el = hostCreateComment(n2.children || ""),
  5860. container,
  5861. anchor
  5862. );
  5863. } else {
  5864. n2.el = n1.el;
  5865. }
  5866. };
  5867. const mountStaticNode = (n2, container, anchor, namespace) => {
  5868. [n2.el, n2.anchor] = hostInsertStaticContent(
  5869. n2.children,
  5870. container,
  5871. anchor,
  5872. namespace,
  5873. n2.el,
  5874. n2.anchor
  5875. );
  5876. };
  5877. const patchStaticNode = (n1, n2, container, namespace) => {
  5878. if (n2.children !== n1.children) {
  5879. const anchor = hostNextSibling(n1.anchor);
  5880. removeStaticNode(n1);
  5881. [n2.el, n2.anchor] = hostInsertStaticContent(
  5882. n2.children,
  5883. container,
  5884. anchor,
  5885. namespace
  5886. );
  5887. } else {
  5888. n2.el = n1.el;
  5889. n2.anchor = n1.anchor;
  5890. }
  5891. };
  5892. const moveStaticNode = ({ el, anchor }, container, nextSibling) => {
  5893. let next;
  5894. while (el && el !== anchor) {
  5895. next = hostNextSibling(el);
  5896. hostInsert(el, container, nextSibling);
  5897. el = next;
  5898. }
  5899. hostInsert(anchor, container, nextSibling);
  5900. };
  5901. const removeStaticNode = ({ el, anchor }) => {
  5902. let next;
  5903. while (el && el !== anchor) {
  5904. next = hostNextSibling(el);
  5905. hostRemove(el);
  5906. el = next;
  5907. }
  5908. hostRemove(anchor);
  5909. };
  5910. const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  5911. if (n2.type === "svg") {
  5912. namespace = "svg";
  5913. } else if (n2.type === "math") {
  5914. namespace = "mathml";
  5915. }
  5916. if (n1 == null) {
  5917. mountElement(
  5918. n2,
  5919. container,
  5920. anchor,
  5921. parentComponent,
  5922. parentSuspense,
  5923. namespace,
  5924. slotScopeIds,
  5925. optimized
  5926. );
  5927. } else {
  5928. patchElement(
  5929. n1,
  5930. n2,
  5931. parentComponent,
  5932. parentSuspense,
  5933. namespace,
  5934. slotScopeIds,
  5935. optimized
  5936. );
  5937. }
  5938. };
  5939. const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  5940. let el;
  5941. let vnodeHook;
  5942. const { props, shapeFlag, transition, dirs } = vnode;
  5943. el = vnode.el = hostCreateElement(
  5944. vnode.type,
  5945. namespace,
  5946. props && props.is,
  5947. props
  5948. );
  5949. if (shapeFlag & 8) {
  5950. hostSetElementText(el, vnode.children);
  5951. } else if (shapeFlag & 16) {
  5952. mountChildren(
  5953. vnode.children,
  5954. el,
  5955. null,
  5956. parentComponent,
  5957. parentSuspense,
  5958. resolveChildrenNamespace(vnode, namespace),
  5959. slotScopeIds,
  5960. optimized
  5961. );
  5962. }
  5963. if (dirs) {
  5964. invokeDirectiveHook(vnode, null, parentComponent, "created");
  5965. }
  5966. setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
  5967. if (props) {
  5968. for (const key in props) {
  5969. if (key !== "value" && !isReservedProp(key)) {
  5970. hostPatchProp(el, key, null, props[key], namespace, parentComponent);
  5971. }
  5972. }
  5973. if ("value" in props) {
  5974. hostPatchProp(el, "value", null, props.value, namespace);
  5975. }
  5976. if (vnodeHook = props.onVnodeBeforeMount) {
  5977. invokeVNodeHook(vnodeHook, parentComponent, vnode);
  5978. }
  5979. }
  5980. {
  5981. def(el, "__vnode", vnode, true);
  5982. def(el, "__vueParentComponent", parentComponent, true);
  5983. }
  5984. if (dirs) {
  5985. invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
  5986. }
  5987. const needCallTransitionHooks = needTransition(parentSuspense, transition);
  5988. if (needCallTransitionHooks) {
  5989. transition.beforeEnter(el);
  5990. }
  5991. hostInsert(el, container, anchor);
  5992. if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
  5993. queuePostRenderEffect(() => {
  5994. vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
  5995. needCallTransitionHooks && transition.enter(el);
  5996. dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
  5997. }, parentSuspense);
  5998. }
  5999. };
  6000. const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => {
  6001. if (scopeId) {
  6002. hostSetScopeId(el, scopeId);
  6003. }
  6004. if (slotScopeIds) {
  6005. for (let i = 0; i < slotScopeIds.length; i++) {
  6006. hostSetScopeId(el, slotScopeIds[i]);
  6007. }
  6008. }
  6009. if (parentComponent) {
  6010. let subTree = parentComponent.subTree;
  6011. if (subTree.patchFlag > 0 && subTree.patchFlag & 2048) {
  6012. subTree = filterSingleRoot(subTree.children) || subTree;
  6013. }
  6014. if (vnode === subTree) {
  6015. const parentVNode = parentComponent.vnode;
  6016. setScopeId(
  6017. el,
  6018. parentVNode,
  6019. parentVNode.scopeId,
  6020. parentVNode.slotScopeIds,
  6021. parentComponent.parent
  6022. );
  6023. }
  6024. }
  6025. };
  6026. const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
  6027. for (let i = start; i < children.length; i++) {
  6028. const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
  6029. patch(
  6030. null,
  6031. child,
  6032. container,
  6033. anchor,
  6034. parentComponent,
  6035. parentSuspense,
  6036. namespace,
  6037. slotScopeIds,
  6038. optimized
  6039. );
  6040. }
  6041. };
  6042. const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  6043. const el = n2.el = n1.el;
  6044. {
  6045. el.__vnode = n2;
  6046. }
  6047. let { patchFlag, dynamicChildren, dirs } = n2;
  6048. patchFlag |= n1.patchFlag & 16;
  6049. const oldProps = n1.props || EMPTY_OBJ;
  6050. const newProps = n2.props || EMPTY_OBJ;
  6051. let vnodeHook;
  6052. parentComponent && toggleRecurse(parentComponent, false);
  6053. if (vnodeHook = newProps.onVnodeBeforeUpdate) {
  6054. invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
  6055. }
  6056. if (dirs) {
  6057. invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
  6058. }
  6059. parentComponent && toggleRecurse(parentComponent, true);
  6060. if (isHmrUpdating) {
  6061. patchFlag = 0;
  6062. optimized = false;
  6063. dynamicChildren = null;
  6064. }
  6065. if (oldProps.innerHTML && newProps.innerHTML == null || oldProps.textContent && newProps.textContent == null) {
  6066. hostSetElementText(el, "");
  6067. }
  6068. if (dynamicChildren) {
  6069. patchBlockChildren(
  6070. n1.dynamicChildren,
  6071. dynamicChildren,
  6072. el,
  6073. parentComponent,
  6074. parentSuspense,
  6075. resolveChildrenNamespace(n2, namespace),
  6076. slotScopeIds
  6077. );
  6078. {
  6079. traverseStaticChildren(n1, n2);
  6080. }
  6081. } else if (!optimized) {
  6082. patchChildren(
  6083. n1,
  6084. n2,
  6085. el,
  6086. null,
  6087. parentComponent,
  6088. parentSuspense,
  6089. resolveChildrenNamespace(n2, namespace),
  6090. slotScopeIds,
  6091. false
  6092. );
  6093. }
  6094. if (patchFlag > 0) {
  6095. if (patchFlag & 16) {
  6096. patchProps(el, oldProps, newProps, parentComponent, namespace);
  6097. } else {
  6098. if (patchFlag & 2) {
  6099. if (oldProps.class !== newProps.class) {
  6100. hostPatchProp(el, "class", null, newProps.class, namespace);
  6101. }
  6102. }
  6103. if (patchFlag & 4) {
  6104. hostPatchProp(el, "style", oldProps.style, newProps.style, namespace);
  6105. }
  6106. if (patchFlag & 8) {
  6107. const propsToUpdate = n2.dynamicProps;
  6108. for (let i = 0; i < propsToUpdate.length; i++) {
  6109. const key = propsToUpdate[i];
  6110. const prev = oldProps[key];
  6111. const next = newProps[key];
  6112. if (next !== prev || key === "value") {
  6113. hostPatchProp(el, key, prev, next, namespace, parentComponent);
  6114. }
  6115. }
  6116. }
  6117. }
  6118. if (patchFlag & 1) {
  6119. if (n1.children !== n2.children) {
  6120. hostSetElementText(el, n2.children);
  6121. }
  6122. }
  6123. } else if (!optimized && dynamicChildren == null) {
  6124. patchProps(el, oldProps, newProps, parentComponent, namespace);
  6125. }
  6126. if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
  6127. queuePostRenderEffect(() => {
  6128. vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
  6129. dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
  6130. }, parentSuspense);
  6131. }
  6132. };
  6133. const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => {
  6134. for (let i = 0; i < newChildren.length; i++) {
  6135. const oldVNode = oldChildren[i];
  6136. const newVNode = newChildren[i];
  6137. const container = (
  6138. // oldVNode may be an errored async setup() component inside Suspense
  6139. // which will not have a mounted element
  6140. oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent
  6141. // of the Fragment itself so it can move its children.
  6142. (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement
  6143. // which also requires the correct parent container
  6144. !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.
  6145. oldVNode.shapeFlag & (6 | 64)) ? hostParentNode(oldVNode.el) : (
  6146. // In other cases, the parent container is not actually used so we
  6147. // just pass the block element here to avoid a DOM parentNode call.
  6148. fallbackContainer
  6149. )
  6150. );
  6151. patch(
  6152. oldVNode,
  6153. newVNode,
  6154. container,
  6155. null,
  6156. parentComponent,
  6157. parentSuspense,
  6158. namespace,
  6159. slotScopeIds,
  6160. true
  6161. );
  6162. }
  6163. };
  6164. const patchProps = (el, oldProps, newProps, parentComponent, namespace) => {
  6165. if (oldProps !== newProps) {
  6166. if (oldProps !== EMPTY_OBJ) {
  6167. for (const key in oldProps) {
  6168. if (!isReservedProp(key) && !(key in newProps)) {
  6169. hostPatchProp(
  6170. el,
  6171. key,
  6172. oldProps[key],
  6173. null,
  6174. namespace,
  6175. parentComponent
  6176. );
  6177. }
  6178. }
  6179. }
  6180. for (const key in newProps) {
  6181. if (isReservedProp(key)) continue;
  6182. const next = newProps[key];
  6183. const prev = oldProps[key];
  6184. if (next !== prev && key !== "value") {
  6185. hostPatchProp(el, key, prev, next, namespace, parentComponent);
  6186. }
  6187. }
  6188. if ("value" in newProps) {
  6189. hostPatchProp(el, "value", oldProps.value, newProps.value, namespace);
  6190. }
  6191. }
  6192. };
  6193. const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  6194. const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText("");
  6195. const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText("");
  6196. let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
  6197. if (
  6198. // #5523 dev root fragment may inherit directives
  6199. isHmrUpdating || patchFlag & 2048
  6200. ) {
  6201. patchFlag = 0;
  6202. optimized = false;
  6203. dynamicChildren = null;
  6204. }
  6205. if (fragmentSlotScopeIds) {
  6206. slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
  6207. }
  6208. if (n1 == null) {
  6209. hostInsert(fragmentStartAnchor, container, anchor);
  6210. hostInsert(fragmentEndAnchor, container, anchor);
  6211. mountChildren(
  6212. // #10007
  6213. // such fragment like `<></>` will be compiled into
  6214. // a fragment which doesn't have a children.
  6215. // In this case fallback to an empty array
  6216. n2.children || [],
  6217. container,
  6218. fragmentEndAnchor,
  6219. parentComponent,
  6220. parentSuspense,
  6221. namespace,
  6222. slotScopeIds,
  6223. optimized
  6224. );
  6225. } else {
  6226. if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result
  6227. // of renderSlot() with no valid children
  6228. n1.dynamicChildren) {
  6229. patchBlockChildren(
  6230. n1.dynamicChildren,
  6231. dynamicChildren,
  6232. container,
  6233. parentComponent,
  6234. parentSuspense,
  6235. namespace,
  6236. slotScopeIds
  6237. );
  6238. {
  6239. traverseStaticChildren(n1, n2);
  6240. }
  6241. } else {
  6242. patchChildren(
  6243. n1,
  6244. n2,
  6245. container,
  6246. fragmentEndAnchor,
  6247. parentComponent,
  6248. parentSuspense,
  6249. namespace,
  6250. slotScopeIds,
  6251. optimized
  6252. );
  6253. }
  6254. }
  6255. };
  6256. const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  6257. n2.slotScopeIds = slotScopeIds;
  6258. if (n1 == null) {
  6259. if (n2.shapeFlag & 512) {
  6260. parentComponent.ctx.activate(
  6261. n2,
  6262. container,
  6263. anchor,
  6264. namespace,
  6265. optimized
  6266. );
  6267. } else {
  6268. mountComponent(
  6269. n2,
  6270. container,
  6271. anchor,
  6272. parentComponent,
  6273. parentSuspense,
  6274. namespace,
  6275. optimized
  6276. );
  6277. }
  6278. } else {
  6279. updateComponent(n1, n2, optimized);
  6280. }
  6281. };
  6282. const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
  6283. const instance = (initialVNode.component = createComponentInstance(
  6284. initialVNode,
  6285. parentComponent,
  6286. parentSuspense
  6287. ));
  6288. if (instance.type.__hmrId) {
  6289. registerHMR(instance);
  6290. }
  6291. {
  6292. pushWarningContext(initialVNode);
  6293. startMeasure(instance, `mount`);
  6294. }
  6295. if (isKeepAlive(initialVNode)) {
  6296. instance.ctx.renderer = internals;
  6297. }
  6298. {
  6299. {
  6300. startMeasure(instance, `init`);
  6301. }
  6302. setupComponent(instance, false, optimized);
  6303. {
  6304. endMeasure(instance, `init`);
  6305. }
  6306. }
  6307. if (instance.asyncDep) {
  6308. parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
  6309. if (!initialVNode.el) {
  6310. const placeholder = instance.subTree = createVNode(Comment);
  6311. processCommentNode(null, placeholder, container, anchor);
  6312. }
  6313. } else {
  6314. setupRenderEffect(
  6315. instance,
  6316. initialVNode,
  6317. container,
  6318. anchor,
  6319. parentSuspense,
  6320. namespace,
  6321. optimized
  6322. );
  6323. }
  6324. {
  6325. popWarningContext();
  6326. endMeasure(instance, `mount`);
  6327. }
  6328. };
  6329. const updateComponent = (n1, n2, optimized) => {
  6330. const instance = n2.component = n1.component;
  6331. if (shouldUpdateComponent(n1, n2, optimized)) {
  6332. if (instance.asyncDep && !instance.asyncResolved) {
  6333. {
  6334. pushWarningContext(n2);
  6335. }
  6336. updateComponentPreRender(instance, n2, optimized);
  6337. {
  6338. popWarningContext();
  6339. }
  6340. return;
  6341. } else {
  6342. instance.next = n2;
  6343. invalidateJob(instance.update);
  6344. instance.effect.dirty = true;
  6345. instance.update();
  6346. }
  6347. } else {
  6348. n2.el = n1.el;
  6349. instance.vnode = n2;
  6350. }
  6351. };
  6352. const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
  6353. const componentUpdateFn = () => {
  6354. if (!instance.isMounted) {
  6355. let vnodeHook;
  6356. const { el, props } = initialVNode;
  6357. const { bm, m, parent } = instance;
  6358. const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
  6359. toggleRecurse(instance, false);
  6360. if (bm) {
  6361. invokeArrayFns(bm);
  6362. }
  6363. if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeBeforeMount)) {
  6364. invokeVNodeHook(vnodeHook, parent, initialVNode);
  6365. }
  6366. toggleRecurse(instance, true);
  6367. if (el && hydrateNode) {
  6368. const hydrateSubTree = () => {
  6369. {
  6370. startMeasure(instance, `render`);
  6371. }
  6372. instance.subTree = renderComponentRoot(instance);
  6373. {
  6374. endMeasure(instance, `render`);
  6375. }
  6376. {
  6377. startMeasure(instance, `hydrate`);
  6378. }
  6379. hydrateNode(
  6380. el,
  6381. instance.subTree,
  6382. instance,
  6383. parentSuspense,
  6384. null
  6385. );
  6386. {
  6387. endMeasure(instance, `hydrate`);
  6388. }
  6389. };
  6390. if (isAsyncWrapperVNode) {
  6391. initialVNode.type.__asyncLoader().then(
  6392. // note: we are moving the render call into an async callback,
  6393. // which means it won't track dependencies - but it's ok because
  6394. // a server-rendered async wrapper is already in resolved state
  6395. // and it will never need to change.
  6396. () => !instance.isUnmounted && hydrateSubTree()
  6397. );
  6398. } else {
  6399. hydrateSubTree();
  6400. }
  6401. } else {
  6402. {
  6403. startMeasure(instance, `render`);
  6404. }
  6405. const subTree = instance.subTree = renderComponentRoot(instance);
  6406. {
  6407. endMeasure(instance, `render`);
  6408. }
  6409. {
  6410. startMeasure(instance, `patch`);
  6411. }
  6412. patch(
  6413. null,
  6414. subTree,
  6415. container,
  6416. anchor,
  6417. instance,
  6418. parentSuspense,
  6419. namespace
  6420. );
  6421. {
  6422. endMeasure(instance, `patch`);
  6423. }
  6424. initialVNode.el = subTree.el;
  6425. }
  6426. if (m) {
  6427. queuePostRenderEffect(m, parentSuspense);
  6428. }
  6429. if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) {
  6430. const scopedInitialVNode = initialVNode;
  6431. queuePostRenderEffect(
  6432. () => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode),
  6433. parentSuspense
  6434. );
  6435. }
  6436. if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) {
  6437. instance.a && queuePostRenderEffect(instance.a, parentSuspense);
  6438. }
  6439. instance.isMounted = true;
  6440. {
  6441. devtoolsComponentAdded(instance);
  6442. }
  6443. initialVNode = container = anchor = null;
  6444. } else {
  6445. let { next, bu, u, parent, vnode } = instance;
  6446. {
  6447. const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
  6448. if (nonHydratedAsyncRoot) {
  6449. if (next) {
  6450. next.el = vnode.el;
  6451. updateComponentPreRender(instance, next, optimized);
  6452. }
  6453. nonHydratedAsyncRoot.asyncDep.then(() => {
  6454. if (!instance.isUnmounted) {
  6455. componentUpdateFn();
  6456. }
  6457. });
  6458. return;
  6459. }
  6460. }
  6461. let originNext = next;
  6462. let vnodeHook;
  6463. {
  6464. pushWarningContext(next || instance.vnode);
  6465. }
  6466. toggleRecurse(instance, false);
  6467. if (next) {
  6468. next.el = vnode.el;
  6469. updateComponentPreRender(instance, next, optimized);
  6470. } else {
  6471. next = vnode;
  6472. }
  6473. if (bu) {
  6474. invokeArrayFns(bu);
  6475. }
  6476. if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) {
  6477. invokeVNodeHook(vnodeHook, parent, next, vnode);
  6478. }
  6479. toggleRecurse(instance, true);
  6480. {
  6481. startMeasure(instance, `render`);
  6482. }
  6483. const nextTree = renderComponentRoot(instance);
  6484. {
  6485. endMeasure(instance, `render`);
  6486. }
  6487. const prevTree = instance.subTree;
  6488. instance.subTree = nextTree;
  6489. {
  6490. startMeasure(instance, `patch`);
  6491. }
  6492. patch(
  6493. prevTree,
  6494. nextTree,
  6495. // parent may have changed if it's in a teleport
  6496. hostParentNode(prevTree.el),
  6497. // anchor may have changed if it's in a fragment
  6498. getNextHostNode(prevTree),
  6499. instance,
  6500. parentSuspense,
  6501. namespace
  6502. );
  6503. {
  6504. endMeasure(instance, `patch`);
  6505. }
  6506. next.el = nextTree.el;
  6507. if (originNext === null) {
  6508. updateHOCHostEl(instance, nextTree.el);
  6509. }
  6510. if (u) {
  6511. queuePostRenderEffect(u, parentSuspense);
  6512. }
  6513. if (vnodeHook = next.props && next.props.onVnodeUpdated) {
  6514. queuePostRenderEffect(
  6515. () => invokeVNodeHook(vnodeHook, parent, next, vnode),
  6516. parentSuspense
  6517. );
  6518. }
  6519. {
  6520. devtoolsComponentUpdated(instance);
  6521. }
  6522. {
  6523. popWarningContext();
  6524. }
  6525. }
  6526. };
  6527. const effect = instance.effect = new ReactiveEffect(
  6528. componentUpdateFn,
  6529. NOOP,
  6530. () => queueJob(update),
  6531. instance.scope
  6532. // track it in component's effect scope
  6533. );
  6534. const update = instance.update = () => {
  6535. if (effect.dirty) {
  6536. effect.run();
  6537. }
  6538. };
  6539. update.i = instance;
  6540. update.id = instance.uid;
  6541. toggleRecurse(instance, true);
  6542. {
  6543. effect.onTrack = instance.rtc ? (e) => invokeArrayFns(instance.rtc, e) : void 0;
  6544. effect.onTrigger = instance.rtg ? (e) => invokeArrayFns(instance.rtg, e) : void 0;
  6545. }
  6546. update();
  6547. };
  6548. const updateComponentPreRender = (instance, nextVNode, optimized) => {
  6549. nextVNode.component = instance;
  6550. const prevProps = instance.vnode.props;
  6551. instance.vnode = nextVNode;
  6552. instance.next = null;
  6553. updateProps(instance, nextVNode.props, prevProps, optimized);
  6554. updateSlots(instance, nextVNode.children, optimized);
  6555. pauseTracking();
  6556. flushPreFlushCbs(instance);
  6557. resetTracking();
  6558. };
  6559. const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => {
  6560. const c1 = n1 && n1.children;
  6561. const prevShapeFlag = n1 ? n1.shapeFlag : 0;
  6562. const c2 = n2.children;
  6563. const { patchFlag, shapeFlag } = n2;
  6564. if (patchFlag > 0) {
  6565. if (patchFlag & 128) {
  6566. patchKeyedChildren(
  6567. c1,
  6568. c2,
  6569. container,
  6570. anchor,
  6571. parentComponent,
  6572. parentSuspense,
  6573. namespace,
  6574. slotScopeIds,
  6575. optimized
  6576. );
  6577. return;
  6578. } else if (patchFlag & 256) {
  6579. patchUnkeyedChildren(
  6580. c1,
  6581. c2,
  6582. container,
  6583. anchor,
  6584. parentComponent,
  6585. parentSuspense,
  6586. namespace,
  6587. slotScopeIds,
  6588. optimized
  6589. );
  6590. return;
  6591. }
  6592. }
  6593. if (shapeFlag & 8) {
  6594. if (prevShapeFlag & 16) {
  6595. unmountChildren(c1, parentComponent, parentSuspense);
  6596. }
  6597. if (c2 !== c1) {
  6598. hostSetElementText(container, c2);
  6599. }
  6600. } else {
  6601. if (prevShapeFlag & 16) {
  6602. if (shapeFlag & 16) {
  6603. patchKeyedChildren(
  6604. c1,
  6605. c2,
  6606. container,
  6607. anchor,
  6608. parentComponent,
  6609. parentSuspense,
  6610. namespace,
  6611. slotScopeIds,
  6612. optimized
  6613. );
  6614. } else {
  6615. unmountChildren(c1, parentComponent, parentSuspense, true);
  6616. }
  6617. } else {
  6618. if (prevShapeFlag & 8) {
  6619. hostSetElementText(container, "");
  6620. }
  6621. if (shapeFlag & 16) {
  6622. mountChildren(
  6623. c2,
  6624. container,
  6625. anchor,
  6626. parentComponent,
  6627. parentSuspense,
  6628. namespace,
  6629. slotScopeIds,
  6630. optimized
  6631. );
  6632. }
  6633. }
  6634. }
  6635. };
  6636. const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  6637. c1 = c1 || EMPTY_ARR;
  6638. c2 = c2 || EMPTY_ARR;
  6639. const oldLength = c1.length;
  6640. const newLength = c2.length;
  6641. const commonLength = Math.min(oldLength, newLength);
  6642. let i;
  6643. for (i = 0; i < commonLength; i++) {
  6644. const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
  6645. patch(
  6646. c1[i],
  6647. nextChild,
  6648. container,
  6649. null,
  6650. parentComponent,
  6651. parentSuspense,
  6652. namespace,
  6653. slotScopeIds,
  6654. optimized
  6655. );
  6656. }
  6657. if (oldLength > newLength) {
  6658. unmountChildren(
  6659. c1,
  6660. parentComponent,
  6661. parentSuspense,
  6662. true,
  6663. false,
  6664. commonLength
  6665. );
  6666. } else {
  6667. mountChildren(
  6668. c2,
  6669. container,
  6670. anchor,
  6671. parentComponent,
  6672. parentSuspense,
  6673. namespace,
  6674. slotScopeIds,
  6675. optimized,
  6676. commonLength
  6677. );
  6678. }
  6679. };
  6680. const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
  6681. let i = 0;
  6682. const l2 = c2.length;
  6683. let e1 = c1.length - 1;
  6684. let e2 = l2 - 1;
  6685. while (i <= e1 && i <= e2) {
  6686. const n1 = c1[i];
  6687. const n2 = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
  6688. if (isSameVNodeType(n1, n2)) {
  6689. patch(
  6690. n1,
  6691. n2,
  6692. container,
  6693. null,
  6694. parentComponent,
  6695. parentSuspense,
  6696. namespace,
  6697. slotScopeIds,
  6698. optimized
  6699. );
  6700. } else {
  6701. break;
  6702. }
  6703. i++;
  6704. }
  6705. while (i <= e1 && i <= e2) {
  6706. const n1 = c1[e1];
  6707. const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode(c2[e2]);
  6708. if (isSameVNodeType(n1, n2)) {
  6709. patch(
  6710. n1,
  6711. n2,
  6712. container,
  6713. null,
  6714. parentComponent,
  6715. parentSuspense,
  6716. namespace,
  6717. slotScopeIds,
  6718. optimized
  6719. );
  6720. } else {
  6721. break;
  6722. }
  6723. e1--;
  6724. e2--;
  6725. }
  6726. if (i > e1) {
  6727. if (i <= e2) {
  6728. const nextPos = e2 + 1;
  6729. const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor;
  6730. while (i <= e2) {
  6731. patch(
  6732. null,
  6733. c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]),
  6734. container,
  6735. anchor,
  6736. parentComponent,
  6737. parentSuspense,
  6738. namespace,
  6739. slotScopeIds,
  6740. optimized
  6741. );
  6742. i++;
  6743. }
  6744. }
  6745. } else if (i > e2) {
  6746. while (i <= e1) {
  6747. unmount(c1[i], parentComponent, parentSuspense, true);
  6748. i++;
  6749. }
  6750. } else {
  6751. const s1 = i;
  6752. const s2 = i;
  6753. const keyToNewIndexMap = /* @__PURE__ */ new Map();
  6754. for (i = s2; i <= e2; i++) {
  6755. const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
  6756. if (nextChild.key != null) {
  6757. if (keyToNewIndexMap.has(nextChild.key)) {
  6758. warn$1(
  6759. `Duplicate keys found during update:`,
  6760. JSON.stringify(nextChild.key),
  6761. `Make sure keys are unique.`
  6762. );
  6763. }
  6764. keyToNewIndexMap.set(nextChild.key, i);
  6765. }
  6766. }
  6767. let j;
  6768. let patched = 0;
  6769. const toBePatched = e2 - s2 + 1;
  6770. let moved = false;
  6771. let maxNewIndexSoFar = 0;
  6772. const newIndexToOldIndexMap = new Array(toBePatched);
  6773. for (i = 0; i < toBePatched; i++) newIndexToOldIndexMap[i] = 0;
  6774. for (i = s1; i <= e1; i++) {
  6775. const prevChild = c1[i];
  6776. if (patched >= toBePatched) {
  6777. unmount(prevChild, parentComponent, parentSuspense, true);
  6778. continue;
  6779. }
  6780. let newIndex;
  6781. if (prevChild.key != null) {
  6782. newIndex = keyToNewIndexMap.get(prevChild.key);
  6783. } else {
  6784. for (j = s2; j <= e2; j++) {
  6785. if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) {
  6786. newIndex = j;
  6787. break;
  6788. }
  6789. }
  6790. }
  6791. if (newIndex === void 0) {
  6792. unmount(prevChild, parentComponent, parentSuspense, true);
  6793. } else {
  6794. newIndexToOldIndexMap[newIndex - s2] = i + 1;
  6795. if (newIndex >= maxNewIndexSoFar) {
  6796. maxNewIndexSoFar = newIndex;
  6797. } else {
  6798. moved = true;
  6799. }
  6800. patch(
  6801. prevChild,
  6802. c2[newIndex],
  6803. container,
  6804. null,
  6805. parentComponent,
  6806. parentSuspense,
  6807. namespace,
  6808. slotScopeIds,
  6809. optimized
  6810. );
  6811. patched++;
  6812. }
  6813. }
  6814. const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : EMPTY_ARR;
  6815. j = increasingNewIndexSequence.length - 1;
  6816. for (i = toBePatched - 1; i >= 0; i--) {
  6817. const nextIndex = s2 + i;
  6818. const nextChild = c2[nextIndex];
  6819. const anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor;
  6820. if (newIndexToOldIndexMap[i] === 0) {
  6821. patch(
  6822. null,
  6823. nextChild,
  6824. container,
  6825. anchor,
  6826. parentComponent,
  6827. parentSuspense,
  6828. namespace,
  6829. slotScopeIds,
  6830. optimized
  6831. );
  6832. } else if (moved) {
  6833. if (j < 0 || i !== increasingNewIndexSequence[j]) {
  6834. move(nextChild, container, anchor, 2);
  6835. } else {
  6836. j--;
  6837. }
  6838. }
  6839. }
  6840. }
  6841. };
  6842. const move = (vnode, container, anchor, moveType, parentSuspense = null) => {
  6843. const { el, type, transition, children, shapeFlag } = vnode;
  6844. if (shapeFlag & 6) {
  6845. move(vnode.component.subTree, container, anchor, moveType);
  6846. return;
  6847. }
  6848. if (shapeFlag & 128) {
  6849. vnode.suspense.move(container, anchor, moveType);
  6850. return;
  6851. }
  6852. if (shapeFlag & 64) {
  6853. type.move(vnode, container, anchor, internals);
  6854. return;
  6855. }
  6856. if (type === Fragment) {
  6857. hostInsert(el, container, anchor);
  6858. for (let i = 0; i < children.length; i++) {
  6859. move(children[i], container, anchor, moveType);
  6860. }
  6861. hostInsert(vnode.anchor, container, anchor);
  6862. return;
  6863. }
  6864. if (type === Static) {
  6865. moveStaticNode(vnode, container, anchor);
  6866. return;
  6867. }
  6868. const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
  6869. if (needTransition2) {
  6870. if (moveType === 0) {
  6871. transition.beforeEnter(el);
  6872. hostInsert(el, container, anchor);
  6873. queuePostRenderEffect(() => transition.enter(el), parentSuspense);
  6874. } else {
  6875. const { leave, delayLeave, afterLeave } = transition;
  6876. const remove2 = () => hostInsert(el, container, anchor);
  6877. const performLeave = () => {
  6878. leave(el, () => {
  6879. remove2();
  6880. afterLeave && afterLeave();
  6881. });
  6882. };
  6883. if (delayLeave) {
  6884. delayLeave(el, remove2, performLeave);
  6885. } else {
  6886. performLeave();
  6887. }
  6888. }
  6889. } else {
  6890. hostInsert(el, container, anchor);
  6891. }
  6892. };
  6893. const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
  6894. const {
  6895. type,
  6896. props,
  6897. ref,
  6898. children,
  6899. dynamicChildren,
  6900. shapeFlag,
  6901. patchFlag,
  6902. dirs,
  6903. cacheIndex
  6904. } = vnode;
  6905. if (patchFlag === -2) {
  6906. optimized = false;
  6907. }
  6908. if (ref != null) {
  6909. setRef(ref, null, parentSuspense, vnode, true);
  6910. }
  6911. if (cacheIndex != null) {
  6912. parentComponent.renderCache[cacheIndex] = void 0;
  6913. }
  6914. if (shapeFlag & 256) {
  6915. parentComponent.ctx.deactivate(vnode);
  6916. return;
  6917. }
  6918. const shouldInvokeDirs = shapeFlag & 1 && dirs;
  6919. const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
  6920. let vnodeHook;
  6921. if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) {
  6922. invokeVNodeHook(vnodeHook, parentComponent, vnode);
  6923. }
  6924. if (shapeFlag & 6) {
  6925. unmountComponent(vnode.component, parentSuspense, doRemove);
  6926. } else {
  6927. if (shapeFlag & 128) {
  6928. vnode.suspense.unmount(parentSuspense, doRemove);
  6929. return;
  6930. }
  6931. if (shouldInvokeDirs) {
  6932. invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
  6933. }
  6934. if (shapeFlag & 64) {
  6935. vnode.type.remove(
  6936. vnode,
  6937. parentComponent,
  6938. parentSuspense,
  6939. internals,
  6940. doRemove
  6941. );
  6942. } else if (dynamicChildren && // #5154
  6943. // when v-once is used inside a block, setBlockTracking(-1) marks the
  6944. // parent block with hasOnce: true
  6945. // so that it doesn't take the fast path during unmount - otherwise
  6946. // components nested in v-once are never unmounted.
  6947. !dynamicChildren.hasOnce && // #1153: fast path should not be taken for non-stable (v-for) fragments
  6948. (type !== Fragment || patchFlag > 0 && patchFlag & 64)) {
  6949. unmountChildren(
  6950. dynamicChildren,
  6951. parentComponent,
  6952. parentSuspense,
  6953. false,
  6954. true
  6955. );
  6956. } else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) {
  6957. unmountChildren(children, parentComponent, parentSuspense);
  6958. }
  6959. if (doRemove) {
  6960. remove(vnode);
  6961. }
  6962. }
  6963. if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) {
  6964. queuePostRenderEffect(() => {
  6965. vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
  6966. shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
  6967. }, parentSuspense);
  6968. }
  6969. };
  6970. const remove = (vnode) => {
  6971. const { type, el, anchor, transition } = vnode;
  6972. if (type === Fragment) {
  6973. if (vnode.patchFlag > 0 && vnode.patchFlag & 2048 && transition && !transition.persisted) {
  6974. vnode.children.forEach((child) => {
  6975. if (child.type === Comment) {
  6976. hostRemove(child.el);
  6977. } else {
  6978. remove(child);
  6979. }
  6980. });
  6981. } else {
  6982. removeFragment(el, anchor);
  6983. }
  6984. return;
  6985. }
  6986. if (type === Static) {
  6987. removeStaticNode(vnode);
  6988. return;
  6989. }
  6990. const performRemove = () => {
  6991. hostRemove(el);
  6992. if (transition && !transition.persisted && transition.afterLeave) {
  6993. transition.afterLeave();
  6994. }
  6995. };
  6996. if (vnode.shapeFlag & 1 && transition && !transition.persisted) {
  6997. const { leave, delayLeave } = transition;
  6998. const performLeave = () => leave(el, performRemove);
  6999. if (delayLeave) {
  7000. delayLeave(vnode.el, performRemove, performLeave);
  7001. } else {
  7002. performLeave();
  7003. }
  7004. } else {
  7005. performRemove();
  7006. }
  7007. };
  7008. const removeFragment = (cur, end) => {
  7009. let next;
  7010. while (cur !== end) {
  7011. next = hostNextSibling(cur);
  7012. hostRemove(cur);
  7013. cur = next;
  7014. }
  7015. hostRemove(end);
  7016. };
  7017. const unmountComponent = (instance, parentSuspense, doRemove) => {
  7018. if (instance.type.__hmrId) {
  7019. unregisterHMR(instance);
  7020. }
  7021. const { bum, scope, update, subTree, um, m, a } = instance;
  7022. invalidateMount(m);
  7023. invalidateMount(a);
  7024. if (bum) {
  7025. invokeArrayFns(bum);
  7026. }
  7027. scope.stop();
  7028. if (update) {
  7029. update.active = false;
  7030. unmount(subTree, instance, parentSuspense, doRemove);
  7031. }
  7032. if (um) {
  7033. queuePostRenderEffect(um, parentSuspense);
  7034. }
  7035. queuePostRenderEffect(() => {
  7036. instance.isUnmounted = true;
  7037. }, parentSuspense);
  7038. if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) {
  7039. parentSuspense.deps--;
  7040. if (parentSuspense.deps === 0) {
  7041. parentSuspense.resolve();
  7042. }
  7043. }
  7044. {
  7045. devtoolsComponentRemoved(instance);
  7046. }
  7047. };
  7048. const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {
  7049. for (let i = start; i < children.length; i++) {
  7050. unmount(children[i], parentComponent, parentSuspense, doRemove, optimized);
  7051. }
  7052. };
  7053. const getNextHostNode = (vnode) => {
  7054. if (vnode.shapeFlag & 6) {
  7055. return getNextHostNode(vnode.component.subTree);
  7056. }
  7057. if (vnode.shapeFlag & 128) {
  7058. return vnode.suspense.next();
  7059. }
  7060. const el = hostNextSibling(vnode.anchor || vnode.el);
  7061. const teleportEnd = el && el[TeleportEndKey];
  7062. return teleportEnd ? hostNextSibling(teleportEnd) : el;
  7063. };
  7064. let isFlushing = false;
  7065. const render = (vnode, container, namespace) => {
  7066. if (vnode == null) {
  7067. if (container._vnode) {
  7068. unmount(container._vnode, null, null, true);
  7069. }
  7070. } else {
  7071. patch(
  7072. container._vnode || null,
  7073. vnode,
  7074. container,
  7075. null,
  7076. null,
  7077. null,
  7078. namespace
  7079. );
  7080. }
  7081. container._vnode = vnode;
  7082. if (!isFlushing) {
  7083. isFlushing = true;
  7084. flushPreFlushCbs();
  7085. flushPostFlushCbs();
  7086. isFlushing = false;
  7087. }
  7088. };
  7089. const internals = {
  7090. p: patch,
  7091. um: unmount,
  7092. m: move,
  7093. r: remove,
  7094. mt: mountComponent,
  7095. mc: mountChildren,
  7096. pc: patchChildren,
  7097. pbc: patchBlockChildren,
  7098. n: getNextHostNode,
  7099. o: options
  7100. };
  7101. let hydrate;
  7102. let hydrateNode;
  7103. if (createHydrationFns) {
  7104. [hydrate, hydrateNode] = createHydrationFns(
  7105. internals
  7106. );
  7107. }
  7108. return {
  7109. render,
  7110. hydrate,
  7111. createApp: createAppAPI(render, hydrate)
  7112. };
  7113. }
  7114. function resolveChildrenNamespace({ type, props }, currentNamespace) {
  7115. return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
  7116. }
  7117. function toggleRecurse({ effect, update }, allowed) {
  7118. effect.allowRecurse = update.allowRecurse = allowed;
  7119. }
  7120. function needTransition(parentSuspense, transition) {
  7121. return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
  7122. }
  7123. function traverseStaticChildren(n1, n2, shallow = false) {
  7124. const ch1 = n1.children;
  7125. const ch2 = n2.children;
  7126. if (isArray(ch1) && isArray(ch2)) {
  7127. for (let i = 0; i < ch1.length; i++) {
  7128. const c1 = ch1[i];
  7129. let c2 = ch2[i];
  7130. if (c2.shapeFlag & 1 && !c2.dynamicChildren) {
  7131. if (c2.patchFlag <= 0 || c2.patchFlag === 32) {
  7132. c2 = ch2[i] = cloneIfMounted(ch2[i]);
  7133. c2.el = c1.el;
  7134. }
  7135. if (!shallow && c2.patchFlag !== -2)
  7136. traverseStaticChildren(c1, c2);
  7137. }
  7138. if (c2.type === Text) {
  7139. c2.el = c1.el;
  7140. }
  7141. if (c2.type === Comment && !c2.el) {
  7142. c2.el = c1.el;
  7143. }
  7144. }
  7145. }
  7146. }
  7147. function getSequence(arr) {
  7148. const p = arr.slice();
  7149. const result = [0];
  7150. let i, j, u, v, c;
  7151. const len = arr.length;
  7152. for (i = 0; i < len; i++) {
  7153. const arrI = arr[i];
  7154. if (arrI !== 0) {
  7155. j = result[result.length - 1];
  7156. if (arr[j] < arrI) {
  7157. p[i] = j;
  7158. result.push(i);
  7159. continue;
  7160. }
  7161. u = 0;
  7162. v = result.length - 1;
  7163. while (u < v) {
  7164. c = u + v >> 1;
  7165. if (arr[result[c]] < arrI) {
  7166. u = c + 1;
  7167. } else {
  7168. v = c;
  7169. }
  7170. }
  7171. if (arrI < arr[result[u]]) {
  7172. if (u > 0) {
  7173. p[i] = result[u - 1];
  7174. }
  7175. result[u] = i;
  7176. }
  7177. }
  7178. }
  7179. u = result.length;
  7180. v = result[u - 1];
  7181. while (u-- > 0) {
  7182. result[u] = v;
  7183. v = p[v];
  7184. }
  7185. return result;
  7186. }
  7187. function locateNonHydratedAsyncRoot(instance) {
  7188. const subComponent = instance.subTree.component;
  7189. if (subComponent) {
  7190. if (subComponent.asyncDep && !subComponent.asyncResolved) {
  7191. return subComponent;
  7192. } else {
  7193. return locateNonHydratedAsyncRoot(subComponent);
  7194. }
  7195. }
  7196. }
  7197. function invalidateMount(hooks) {
  7198. if (hooks) {
  7199. for (let i = 0; i < hooks.length; i++) hooks[i].active = false;
  7200. }
  7201. }
  7202. const ssrContextKey = Symbol.for("v-scx");
  7203. const useSSRContext = () => {
  7204. {
  7205. const ctx = inject(ssrContextKey);
  7206. if (!ctx) {
  7207. warn$1(
  7208. `Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.`
  7209. );
  7210. }
  7211. return ctx;
  7212. }
  7213. };
  7214. function watchEffect(effect, options) {
  7215. return doWatch(effect, null, options);
  7216. }
  7217. function watchPostEffect(effect, options) {
  7218. return doWatch(
  7219. effect,
  7220. null,
  7221. extend({}, options, { flush: "post" })
  7222. );
  7223. }
  7224. function watchSyncEffect(effect, options) {
  7225. return doWatch(
  7226. effect,
  7227. null,
  7228. extend({}, options, { flush: "sync" })
  7229. );
  7230. }
  7231. const INITIAL_WATCHER_VALUE = {};
  7232. function watch(source, cb, options) {
  7233. if (!isFunction(cb)) {
  7234. warn$1(
  7235. `\`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.`
  7236. );
  7237. }
  7238. return doWatch(source, cb, options);
  7239. }
  7240. function doWatch(source, cb, {
  7241. immediate,
  7242. deep,
  7243. flush,
  7244. once,
  7245. onTrack,
  7246. onTrigger
  7247. } = EMPTY_OBJ) {
  7248. if (cb && once) {
  7249. const _cb = cb;
  7250. cb = (...args) => {
  7251. _cb(...args);
  7252. unwatch();
  7253. };
  7254. }
  7255. if (deep !== void 0 && typeof deep === "number") {
  7256. warn$1(
  7257. `watch() "deep" option with number value will be used as watch depth in future versions. Please use a boolean instead to avoid potential breakage.`
  7258. );
  7259. }
  7260. if (!cb) {
  7261. if (immediate !== void 0) {
  7262. warn$1(
  7263. `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`
  7264. );
  7265. }
  7266. if (deep !== void 0) {
  7267. warn$1(
  7268. `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
  7269. );
  7270. }
  7271. if (once !== void 0) {
  7272. warn$1(
  7273. `watch() "once" option is only respected when using the watch(source, callback, options?) signature.`
  7274. );
  7275. }
  7276. }
  7277. const warnInvalidSource = (s) => {
  7278. warn$1(
  7279. `Invalid watch source: `,
  7280. s,
  7281. `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`
  7282. );
  7283. };
  7284. const instance = currentInstance;
  7285. const reactiveGetter = (source2) => deep === true ? source2 : (
  7286. // for deep: false, only traverse root-level properties
  7287. traverse(source2, deep === false ? 1 : void 0)
  7288. );
  7289. let getter;
  7290. let forceTrigger = false;
  7291. let isMultiSource = false;
  7292. if (isRef(source)) {
  7293. getter = () => source.value;
  7294. forceTrigger = isShallow(source);
  7295. } else if (isReactive(source)) {
  7296. getter = () => reactiveGetter(source);
  7297. forceTrigger = true;
  7298. } else if (isArray(source)) {
  7299. isMultiSource = true;
  7300. forceTrigger = source.some((s) => isReactive(s) || isShallow(s));
  7301. getter = () => source.map((s) => {
  7302. if (isRef(s)) {
  7303. return s.value;
  7304. } else if (isReactive(s)) {
  7305. return reactiveGetter(s);
  7306. } else if (isFunction(s)) {
  7307. return callWithErrorHandling(s, instance, 2);
  7308. } else {
  7309. warnInvalidSource(s);
  7310. }
  7311. });
  7312. } else if (isFunction(source)) {
  7313. if (cb) {
  7314. getter = () => callWithErrorHandling(source, instance, 2);
  7315. } else {
  7316. getter = () => {
  7317. if (cleanup) {
  7318. cleanup();
  7319. }
  7320. return callWithAsyncErrorHandling(
  7321. source,
  7322. instance,
  7323. 3,
  7324. [onCleanup]
  7325. );
  7326. };
  7327. }
  7328. } else {
  7329. getter = NOOP;
  7330. warnInvalidSource(source);
  7331. }
  7332. if (cb && deep) {
  7333. const baseGetter = getter;
  7334. getter = () => traverse(baseGetter());
  7335. }
  7336. let cleanup;
  7337. let onCleanup = (fn) => {
  7338. cleanup = effect.onStop = () => {
  7339. callWithErrorHandling(fn, instance, 4);
  7340. cleanup = effect.onStop = void 0;
  7341. };
  7342. };
  7343. let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
  7344. const job = () => {
  7345. if (!effect.active || !effect.dirty) {
  7346. return;
  7347. }
  7348. if (cb) {
  7349. const newValue = effect.run();
  7350. if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue)) || false) {
  7351. if (cleanup) {
  7352. cleanup();
  7353. }
  7354. callWithAsyncErrorHandling(cb, instance, 3, [
  7355. newValue,
  7356. // pass undefined as the old value when it's changed for the first time
  7357. oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
  7358. onCleanup
  7359. ]);
  7360. oldValue = newValue;
  7361. }
  7362. } else {
  7363. effect.run();
  7364. }
  7365. };
  7366. job.allowRecurse = !!cb;
  7367. let scheduler;
  7368. if (flush === "sync") {
  7369. scheduler = job;
  7370. } else if (flush === "post") {
  7371. scheduler = () => queuePostRenderEffect(job, instance && instance.suspense);
  7372. } else {
  7373. job.pre = true;
  7374. if (instance) job.id = instance.uid;
  7375. scheduler = () => queueJob(job);
  7376. }
  7377. const effect = new ReactiveEffect(getter, NOOP, scheduler);
  7378. const scope = getCurrentScope();
  7379. const unwatch = () => {
  7380. effect.stop();
  7381. if (scope) {
  7382. remove(scope.effects, effect);
  7383. }
  7384. };
  7385. {
  7386. effect.onTrack = onTrack;
  7387. effect.onTrigger = onTrigger;
  7388. }
  7389. if (cb) {
  7390. if (immediate) {
  7391. job();
  7392. } else {
  7393. oldValue = effect.run();
  7394. }
  7395. } else if (flush === "post") {
  7396. queuePostRenderEffect(
  7397. effect.run.bind(effect),
  7398. instance && instance.suspense
  7399. );
  7400. } else {
  7401. effect.run();
  7402. }
  7403. return unwatch;
  7404. }
  7405. function instanceWatch(source, value, options) {
  7406. const publicThis = this.proxy;
  7407. const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
  7408. let cb;
  7409. if (isFunction(value)) {
  7410. cb = value;
  7411. } else {
  7412. cb = value.handler;
  7413. options = value;
  7414. }
  7415. const reset = setCurrentInstance(this);
  7416. const res = doWatch(getter, cb.bind(publicThis), options);
  7417. reset();
  7418. return res;
  7419. }
  7420. function createPathGetter(ctx, path) {
  7421. const segments = path.split(".");
  7422. return () => {
  7423. let cur = ctx;
  7424. for (let i = 0; i < segments.length && cur; i++) {
  7425. cur = cur[segments[i]];
  7426. }
  7427. return cur;
  7428. };
  7429. }
  7430. function traverse(value, depth = Infinity, seen) {
  7431. if (depth <= 0 || !isObject(value) || value["__v_skip"]) {
  7432. return value;
  7433. }
  7434. seen = seen || /* @__PURE__ */ new Set();
  7435. if (seen.has(value)) {
  7436. return value;
  7437. }
  7438. seen.add(value);
  7439. depth--;
  7440. if (isRef(value)) {
  7441. traverse(value.value, depth, seen);
  7442. } else if (isArray(value)) {
  7443. for (let i = 0; i < value.length; i++) {
  7444. traverse(value[i], depth, seen);
  7445. }
  7446. } else if (isSet(value) || isMap(value)) {
  7447. value.forEach((v) => {
  7448. traverse(v, depth, seen);
  7449. });
  7450. } else if (isPlainObject(value)) {
  7451. for (const key in value) {
  7452. traverse(value[key], depth, seen);
  7453. }
  7454. for (const key of Object.getOwnPropertySymbols(value)) {
  7455. if (Object.prototype.propertyIsEnumerable.call(value, key)) {
  7456. traverse(value[key], depth, seen);
  7457. }
  7458. }
  7459. }
  7460. return value;
  7461. }
  7462. function useModel(props, name, options = EMPTY_OBJ) {
  7463. const i = getCurrentInstance();
  7464. if (!i) {
  7465. warn$1(`useModel() called without active instance.`);
  7466. return ref();
  7467. }
  7468. if (!i.propsOptions[0][name]) {
  7469. warn$1(`useModel() called with prop "${name}" which is not declared.`);
  7470. return ref();
  7471. }
  7472. const camelizedName = camelize(name);
  7473. const hyphenatedName = hyphenate(name);
  7474. const modifiers = getModelModifiers(props, name);
  7475. const res = customRef((track, trigger) => {
  7476. let localValue;
  7477. let prevSetValue = EMPTY_OBJ;
  7478. let prevEmittedValue;
  7479. watchSyncEffect(() => {
  7480. const propValue = props[name];
  7481. if (hasChanged(localValue, propValue)) {
  7482. localValue = propValue;
  7483. trigger();
  7484. }
  7485. });
  7486. return {
  7487. get() {
  7488. track();
  7489. return options.get ? options.get(localValue) : localValue;
  7490. },
  7491. set(value) {
  7492. const emittedValue = options.set ? options.set(value) : value;
  7493. if (!hasChanged(emittedValue, localValue) && !(prevSetValue !== EMPTY_OBJ && hasChanged(value, prevSetValue))) {
  7494. return;
  7495. }
  7496. const rawProps = i.vnode.props;
  7497. if (!(rawProps && // check if parent has passed v-model
  7498. (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps))) {
  7499. localValue = value;
  7500. trigger();
  7501. }
  7502. i.emit(`update:${name}`, emittedValue);
  7503. if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) {
  7504. trigger();
  7505. }
  7506. prevSetValue = value;
  7507. prevEmittedValue = emittedValue;
  7508. }
  7509. };
  7510. });
  7511. res[Symbol.iterator] = () => {
  7512. let i2 = 0;
  7513. return {
  7514. next() {
  7515. if (i2 < 2) {
  7516. return { value: i2++ ? modifiers || EMPTY_OBJ : res, done: false };
  7517. } else {
  7518. return { done: true };
  7519. }
  7520. }
  7521. };
  7522. };
  7523. return res;
  7524. }
  7525. const getModelModifiers = (props, modelName) => {
  7526. return modelName === "modelValue" || modelName === "model-value" ? props.modelModifiers : props[`${modelName}Modifiers`] || props[`${camelize(modelName)}Modifiers`] || props[`${hyphenate(modelName)}Modifiers`];
  7527. };
  7528. function emit(instance, event, ...rawArgs) {
  7529. if (instance.isUnmounted) return;
  7530. const props = instance.vnode.props || EMPTY_OBJ;
  7531. {
  7532. const {
  7533. emitsOptions,
  7534. propsOptions: [propsOptions]
  7535. } = instance;
  7536. if (emitsOptions) {
  7537. if (!(event in emitsOptions) && true) {
  7538. if (!propsOptions || !(toHandlerKey(camelize(event)) in propsOptions)) {
  7539. warn$1(
  7540. `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(camelize(event))}" prop.`
  7541. );
  7542. }
  7543. } else {
  7544. const validator = emitsOptions[event];
  7545. if (isFunction(validator)) {
  7546. const isValid = validator(...rawArgs);
  7547. if (!isValid) {
  7548. warn$1(
  7549. `Invalid event arguments: event validation failed for event "${event}".`
  7550. );
  7551. }
  7552. }
  7553. }
  7554. }
  7555. }
  7556. let args = rawArgs;
  7557. const isModelListener = event.startsWith("update:");
  7558. const modifiers = isModelListener && getModelModifiers(props, event.slice(7));
  7559. if (modifiers) {
  7560. if (modifiers.trim) {
  7561. args = rawArgs.map((a) => isString(a) ? a.trim() : a);
  7562. }
  7563. if (modifiers.number) {
  7564. args = rawArgs.map(looseToNumber);
  7565. }
  7566. }
  7567. {
  7568. devtoolsComponentEmit(instance, event, args);
  7569. }
  7570. {
  7571. const lowerCaseEvent = event.toLowerCase();
  7572. if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) {
  7573. warn$1(
  7574. `Event "${lowerCaseEvent}" is emitted in component ${formatComponentName(
  7575. instance,
  7576. instance.type
  7577. )} 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(
  7578. event
  7579. )}" instead of "${event}".`
  7580. );
  7581. }
  7582. }
  7583. let handlerName;
  7584. let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249)
  7585. props[handlerName = toHandlerKey(camelize(event))];
  7586. if (!handler && isModelListener) {
  7587. handler = props[handlerName = toHandlerKey(hyphenate(event))];
  7588. }
  7589. if (handler) {
  7590. callWithAsyncErrorHandling(
  7591. handler,
  7592. instance,
  7593. 6,
  7594. args
  7595. );
  7596. }
  7597. const onceHandler = props[handlerName + `Once`];
  7598. if (onceHandler) {
  7599. if (!instance.emitted) {
  7600. instance.emitted = {};
  7601. } else if (instance.emitted[handlerName]) {
  7602. return;
  7603. }
  7604. instance.emitted[handlerName] = true;
  7605. callWithAsyncErrorHandling(
  7606. onceHandler,
  7607. instance,
  7608. 6,
  7609. args
  7610. );
  7611. }
  7612. }
  7613. function normalizeEmitsOptions(comp, appContext, asMixin = false) {
  7614. const cache = appContext.emitsCache;
  7615. const cached = cache.get(comp);
  7616. if (cached !== void 0) {
  7617. return cached;
  7618. }
  7619. const raw = comp.emits;
  7620. let normalized = {};
  7621. let hasExtends = false;
  7622. if (!isFunction(comp)) {
  7623. const extendEmits = (raw2) => {
  7624. const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
  7625. if (normalizedFromExtend) {
  7626. hasExtends = true;
  7627. extend(normalized, normalizedFromExtend);
  7628. }
  7629. };
  7630. if (!asMixin && appContext.mixins.length) {
  7631. appContext.mixins.forEach(extendEmits);
  7632. }
  7633. if (comp.extends) {
  7634. extendEmits(comp.extends);
  7635. }
  7636. if (comp.mixins) {
  7637. comp.mixins.forEach(extendEmits);
  7638. }
  7639. }
  7640. if (!raw && !hasExtends) {
  7641. if (isObject(comp)) {
  7642. cache.set(comp, null);
  7643. }
  7644. return null;
  7645. }
  7646. if (isArray(raw)) {
  7647. raw.forEach((key) => normalized[key] = null);
  7648. } else {
  7649. extend(normalized, raw);
  7650. }
  7651. if (isObject(comp)) {
  7652. cache.set(comp, normalized);
  7653. }
  7654. return normalized;
  7655. }
  7656. function isEmitListener(options, key) {
  7657. if (!options || !isOn(key)) {
  7658. return false;
  7659. }
  7660. key = key.slice(2).replace(/Once$/, "");
  7661. return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
  7662. }
  7663. let accessedAttrs = false;
  7664. function markAttrsAccessed() {
  7665. accessedAttrs = true;
  7666. }
  7667. function renderComponentRoot(instance) {
  7668. const {
  7669. type: Component,
  7670. vnode,
  7671. proxy,
  7672. withProxy,
  7673. propsOptions: [propsOptions],
  7674. slots,
  7675. attrs,
  7676. emit,
  7677. render,
  7678. renderCache,
  7679. props,
  7680. data,
  7681. setupState,
  7682. ctx,
  7683. inheritAttrs
  7684. } = instance;
  7685. const prev = setCurrentRenderingInstance(instance);
  7686. let result;
  7687. let fallthroughAttrs;
  7688. {
  7689. accessedAttrs = false;
  7690. }
  7691. try {
  7692. if (vnode.shapeFlag & 4) {
  7693. const proxyToUse = withProxy || proxy;
  7694. const thisProxy = setupState.__isScriptSetup ? new Proxy(proxyToUse, {
  7695. get(target, key, receiver) {
  7696. warn$1(
  7697. `Property '${String(
  7698. key
  7699. )}' was accessed via 'this'. Avoid using 'this' in templates.`
  7700. );
  7701. return Reflect.get(target, key, receiver);
  7702. }
  7703. }) : proxyToUse;
  7704. result = normalizeVNode(
  7705. render.call(
  7706. thisProxy,
  7707. proxyToUse,
  7708. renderCache,
  7709. true ? shallowReadonly(props) : props,
  7710. setupState,
  7711. data,
  7712. ctx
  7713. )
  7714. );
  7715. fallthroughAttrs = attrs;
  7716. } else {
  7717. const render2 = Component;
  7718. if (attrs === props) {
  7719. markAttrsAccessed();
  7720. }
  7721. result = normalizeVNode(
  7722. render2.length > 1 ? render2(
  7723. true ? shallowReadonly(props) : props,
  7724. true ? {
  7725. get attrs() {
  7726. markAttrsAccessed();
  7727. return shallowReadonly(attrs);
  7728. },
  7729. slots,
  7730. emit
  7731. } : { attrs, slots, emit }
  7732. ) : render2(
  7733. true ? shallowReadonly(props) : props,
  7734. null
  7735. )
  7736. );
  7737. fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs);
  7738. }
  7739. } catch (err) {
  7740. blockStack.length = 0;
  7741. handleError(err, instance, 1);
  7742. result = createVNode(Comment);
  7743. }
  7744. let root = result;
  7745. let setRoot = void 0;
  7746. if (result.patchFlag > 0 && result.patchFlag & 2048) {
  7747. [root, setRoot] = getChildRoot(result);
  7748. }
  7749. if (fallthroughAttrs && inheritAttrs !== false) {
  7750. const keys = Object.keys(fallthroughAttrs);
  7751. const { shapeFlag } = root;
  7752. if (keys.length) {
  7753. if (shapeFlag & (1 | 6)) {
  7754. if (propsOptions && keys.some(isModelListener)) {
  7755. fallthroughAttrs = filterModelListeners(
  7756. fallthroughAttrs,
  7757. propsOptions
  7758. );
  7759. }
  7760. root = cloneVNode(root, fallthroughAttrs, false, true);
  7761. } else if (!accessedAttrs && root.type !== Comment) {
  7762. const allAttrs = Object.keys(attrs);
  7763. const eventAttrs = [];
  7764. const extraAttrs = [];
  7765. for (let i = 0, l = allAttrs.length; i < l; i++) {
  7766. const key = allAttrs[i];
  7767. if (isOn(key)) {
  7768. if (!isModelListener(key)) {
  7769. eventAttrs.push(key[2].toLowerCase() + key.slice(3));
  7770. }
  7771. } else {
  7772. extraAttrs.push(key);
  7773. }
  7774. }
  7775. if (extraAttrs.length) {
  7776. warn$1(
  7777. `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.`
  7778. );
  7779. }
  7780. if (eventAttrs.length) {
  7781. warn$1(
  7782. `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.`
  7783. );
  7784. }
  7785. }
  7786. }
  7787. }
  7788. if (vnode.dirs) {
  7789. if (!isElementRoot(root)) {
  7790. warn$1(
  7791. `Runtime directive used on component with non-element root node. The directives will not function as intended.`
  7792. );
  7793. }
  7794. root = cloneVNode(root, null, false, true);
  7795. root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
  7796. }
  7797. if (vnode.transition) {
  7798. if (!isElementRoot(root)) {
  7799. warn$1(
  7800. `Component inside <Transition> renders non-element root node that cannot be animated.`
  7801. );
  7802. }
  7803. root.transition = vnode.transition;
  7804. }
  7805. if (setRoot) {
  7806. setRoot(root);
  7807. } else {
  7808. result = root;
  7809. }
  7810. setCurrentRenderingInstance(prev);
  7811. return result;
  7812. }
  7813. const getChildRoot = (vnode) => {
  7814. const rawChildren = vnode.children;
  7815. const dynamicChildren = vnode.dynamicChildren;
  7816. const childRoot = filterSingleRoot(rawChildren, false);
  7817. if (!childRoot) {
  7818. return [vnode, void 0];
  7819. } else if (childRoot.patchFlag > 0 && childRoot.patchFlag & 2048) {
  7820. return getChildRoot(childRoot);
  7821. }
  7822. const index = rawChildren.indexOf(childRoot);
  7823. const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1;
  7824. const setRoot = (updatedRoot) => {
  7825. rawChildren[index] = updatedRoot;
  7826. if (dynamicChildren) {
  7827. if (dynamicIndex > -1) {
  7828. dynamicChildren[dynamicIndex] = updatedRoot;
  7829. } else if (updatedRoot.patchFlag > 0) {
  7830. vnode.dynamicChildren = [...dynamicChildren, updatedRoot];
  7831. }
  7832. }
  7833. };
  7834. return [normalizeVNode(childRoot), setRoot];
  7835. };
  7836. function filterSingleRoot(children, recurse = true) {
  7837. let singleRoot;
  7838. for (let i = 0; i < children.length; i++) {
  7839. const child = children[i];
  7840. if (isVNode(child)) {
  7841. if (child.type !== Comment || child.children === "v-if") {
  7842. if (singleRoot) {
  7843. return;
  7844. } else {
  7845. singleRoot = child;
  7846. if (recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) {
  7847. return filterSingleRoot(singleRoot.children);
  7848. }
  7849. }
  7850. }
  7851. } else {
  7852. return;
  7853. }
  7854. }
  7855. return singleRoot;
  7856. }
  7857. const getFunctionalFallthrough = (attrs) => {
  7858. let res;
  7859. for (const key in attrs) {
  7860. if (key === "class" || key === "style" || isOn(key)) {
  7861. (res || (res = {}))[key] = attrs[key];
  7862. }
  7863. }
  7864. return res;
  7865. };
  7866. const filterModelListeners = (attrs, props) => {
  7867. const res = {};
  7868. for (const key in attrs) {
  7869. if (!isModelListener(key) || !(key.slice(9) in props)) {
  7870. res[key] = attrs[key];
  7871. }
  7872. }
  7873. return res;
  7874. };
  7875. const isElementRoot = (vnode) => {
  7876. return vnode.shapeFlag & (6 | 1) || vnode.type === Comment;
  7877. };
  7878. function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
  7879. const { props: prevProps, children: prevChildren, component } = prevVNode;
  7880. const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;
  7881. const emits = component.emitsOptions;
  7882. if ((prevChildren || nextChildren) && isHmrUpdating) {
  7883. return true;
  7884. }
  7885. if (nextVNode.dirs || nextVNode.transition) {
  7886. return true;
  7887. }
  7888. if (optimized && patchFlag >= 0) {
  7889. if (patchFlag & 1024) {
  7890. return true;
  7891. }
  7892. if (patchFlag & 16) {
  7893. if (!prevProps) {
  7894. return !!nextProps;
  7895. }
  7896. return hasPropsChanged(prevProps, nextProps, emits);
  7897. } else if (patchFlag & 8) {
  7898. const dynamicProps = nextVNode.dynamicProps;
  7899. for (let i = 0; i < dynamicProps.length; i++) {
  7900. const key = dynamicProps[i];
  7901. if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) {
  7902. return true;
  7903. }
  7904. }
  7905. }
  7906. } else {
  7907. if (prevChildren || nextChildren) {
  7908. if (!nextChildren || !nextChildren.$stable) {
  7909. return true;
  7910. }
  7911. }
  7912. if (prevProps === nextProps) {
  7913. return false;
  7914. }
  7915. if (!prevProps) {
  7916. return !!nextProps;
  7917. }
  7918. if (!nextProps) {
  7919. return true;
  7920. }
  7921. return hasPropsChanged(prevProps, nextProps, emits);
  7922. }
  7923. return false;
  7924. }
  7925. function hasPropsChanged(prevProps, nextProps, emitsOptions) {
  7926. const nextKeys = Object.keys(nextProps);
  7927. if (nextKeys.length !== Object.keys(prevProps).length) {
  7928. return true;
  7929. }
  7930. for (let i = 0; i < nextKeys.length; i++) {
  7931. const key = nextKeys[i];
  7932. if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) {
  7933. return true;
  7934. }
  7935. }
  7936. return false;
  7937. }
  7938. function updateHOCHostEl({ vnode, parent }, el) {
  7939. while (parent) {
  7940. const root = parent.subTree;
  7941. if (root.suspense && root.suspense.activeBranch === vnode) {
  7942. root.el = vnode.el;
  7943. }
  7944. if (root === vnode) {
  7945. (vnode = parent.vnode).el = el;
  7946. parent = parent.parent;
  7947. } else {
  7948. break;
  7949. }
  7950. }
  7951. }
  7952. const isSuspense = (type) => type.__isSuspense;
  7953. let suspenseId = 0;
  7954. const SuspenseImpl = {
  7955. name: "Suspense",
  7956. // In order to make Suspense tree-shakable, we need to avoid importing it
  7957. // directly in the renderer. The renderer checks for the __isSuspense flag
  7958. // on a vnode's type and calls the `process` method, passing in renderer
  7959. // internals.
  7960. __isSuspense: true,
  7961. process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
  7962. if (n1 == null) {
  7963. mountSuspense(
  7964. n2,
  7965. container,
  7966. anchor,
  7967. parentComponent,
  7968. parentSuspense,
  7969. namespace,
  7970. slotScopeIds,
  7971. optimized,
  7972. rendererInternals
  7973. );
  7974. } else {
  7975. if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {
  7976. n2.suspense = n1.suspense;
  7977. n2.suspense.vnode = n2;
  7978. n2.el = n1.el;
  7979. return;
  7980. }
  7981. patchSuspense(
  7982. n1,
  7983. n2,
  7984. container,
  7985. anchor,
  7986. parentComponent,
  7987. namespace,
  7988. slotScopeIds,
  7989. optimized,
  7990. rendererInternals
  7991. );
  7992. }
  7993. },
  7994. hydrate: hydrateSuspense,
  7995. normalize: normalizeSuspenseChildren
  7996. };
  7997. const Suspense = SuspenseImpl ;
  7998. function triggerEvent(vnode, name) {
  7999. const eventListener = vnode.props && vnode.props[name];
  8000. if (isFunction(eventListener)) {
  8001. eventListener();
  8002. }
  8003. }
  8004. function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
  8005. const {
  8006. p: patch,
  8007. o: { createElement }
  8008. } = rendererInternals;
  8009. const hiddenContainer = createElement("div");
  8010. const suspense = vnode.suspense = createSuspenseBoundary(
  8011. vnode,
  8012. parentSuspense,
  8013. parentComponent,
  8014. container,
  8015. hiddenContainer,
  8016. anchor,
  8017. namespace,
  8018. slotScopeIds,
  8019. optimized,
  8020. rendererInternals
  8021. );
  8022. patch(
  8023. null,
  8024. suspense.pendingBranch = vnode.ssContent,
  8025. hiddenContainer,
  8026. null,
  8027. parentComponent,
  8028. suspense,
  8029. namespace,
  8030. slotScopeIds
  8031. );
  8032. if (suspense.deps > 0) {
  8033. triggerEvent(vnode, "onPending");
  8034. triggerEvent(vnode, "onFallback");
  8035. patch(
  8036. null,
  8037. vnode.ssFallback,
  8038. container,
  8039. anchor,
  8040. parentComponent,
  8041. null,
  8042. // fallback tree will not have suspense context
  8043. namespace,
  8044. slotScopeIds
  8045. );
  8046. setActiveBranch(suspense, vnode.ssFallback);
  8047. } else {
  8048. suspense.resolve(false, true);
  8049. }
  8050. }
  8051. function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {
  8052. const suspense = n2.suspense = n1.suspense;
  8053. suspense.vnode = n2;
  8054. n2.el = n1.el;
  8055. const newBranch = n2.ssContent;
  8056. const newFallback = n2.ssFallback;
  8057. const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense;
  8058. if (pendingBranch) {
  8059. suspense.pendingBranch = newBranch;
  8060. if (isSameVNodeType(newBranch, pendingBranch)) {
  8061. patch(
  8062. pendingBranch,
  8063. newBranch,
  8064. suspense.hiddenContainer,
  8065. null,
  8066. parentComponent,
  8067. suspense,
  8068. namespace,
  8069. slotScopeIds,
  8070. optimized
  8071. );
  8072. if (suspense.deps <= 0) {
  8073. suspense.resolve();
  8074. } else if (isInFallback) {
  8075. if (!isHydrating) {
  8076. patch(
  8077. activeBranch,
  8078. newFallback,
  8079. container,
  8080. anchor,
  8081. parentComponent,
  8082. null,
  8083. // fallback tree will not have suspense context
  8084. namespace,
  8085. slotScopeIds,
  8086. optimized
  8087. );
  8088. setActiveBranch(suspense, newFallback);
  8089. }
  8090. }
  8091. } else {
  8092. suspense.pendingId = suspenseId++;
  8093. if (isHydrating) {
  8094. suspense.isHydrating = false;
  8095. suspense.activeBranch = pendingBranch;
  8096. } else {
  8097. unmount(pendingBranch, parentComponent, suspense);
  8098. }
  8099. suspense.deps = 0;
  8100. suspense.effects.length = 0;
  8101. suspense.hiddenContainer = createElement("div");
  8102. if (isInFallback) {
  8103. patch(
  8104. null,
  8105. newBranch,
  8106. suspense.hiddenContainer,
  8107. null,
  8108. parentComponent,
  8109. suspense,
  8110. namespace,
  8111. slotScopeIds,
  8112. optimized
  8113. );
  8114. if (suspense.deps <= 0) {
  8115. suspense.resolve();
  8116. } else {
  8117. patch(
  8118. activeBranch,
  8119. newFallback,
  8120. container,
  8121. anchor,
  8122. parentComponent,
  8123. null,
  8124. // fallback tree will not have suspense context
  8125. namespace,
  8126. slotScopeIds,
  8127. optimized
  8128. );
  8129. setActiveBranch(suspense, newFallback);
  8130. }
  8131. } else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
  8132. patch(
  8133. activeBranch,
  8134. newBranch,
  8135. container,
  8136. anchor,
  8137. parentComponent,
  8138. suspense,
  8139. namespace,
  8140. slotScopeIds,
  8141. optimized
  8142. );
  8143. suspense.resolve(true);
  8144. } else {
  8145. patch(
  8146. null,
  8147. newBranch,
  8148. suspense.hiddenContainer,
  8149. null,
  8150. parentComponent,
  8151. suspense,
  8152. namespace,
  8153. slotScopeIds,
  8154. optimized
  8155. );
  8156. if (suspense.deps <= 0) {
  8157. suspense.resolve();
  8158. }
  8159. }
  8160. }
  8161. } else {
  8162. if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
  8163. patch(
  8164. activeBranch,
  8165. newBranch,
  8166. container,
  8167. anchor,
  8168. parentComponent,
  8169. suspense,
  8170. namespace,
  8171. slotScopeIds,
  8172. optimized
  8173. );
  8174. setActiveBranch(suspense, newBranch);
  8175. } else {
  8176. triggerEvent(n2, "onPending");
  8177. suspense.pendingBranch = newBranch;
  8178. if (newBranch.shapeFlag & 512) {
  8179. suspense.pendingId = newBranch.component.suspenseId;
  8180. } else {
  8181. suspense.pendingId = suspenseId++;
  8182. }
  8183. patch(
  8184. null,
  8185. newBranch,
  8186. suspense.hiddenContainer,
  8187. null,
  8188. parentComponent,
  8189. suspense,
  8190. namespace,
  8191. slotScopeIds,
  8192. optimized
  8193. );
  8194. if (suspense.deps <= 0) {
  8195. suspense.resolve();
  8196. } else {
  8197. const { timeout, pendingId } = suspense;
  8198. if (timeout > 0) {
  8199. setTimeout(() => {
  8200. if (suspense.pendingId === pendingId) {
  8201. suspense.fallback(newFallback);
  8202. }
  8203. }, timeout);
  8204. } else if (timeout === 0) {
  8205. suspense.fallback(newFallback);
  8206. }
  8207. }
  8208. }
  8209. }
  8210. }
  8211. let hasWarned = false;
  8212. function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, namespace, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
  8213. if (!hasWarned) {
  8214. hasWarned = true;
  8215. console[console.info ? "info" : "log"](
  8216. `<Suspense> is an experimental feature and its API will likely change.`
  8217. );
  8218. }
  8219. const {
  8220. p: patch,
  8221. m: move,
  8222. um: unmount,
  8223. n: next,
  8224. o: { parentNode, remove }
  8225. } = rendererInternals;
  8226. let parentSuspenseId;
  8227. const isSuspensible = isVNodeSuspensible(vnode);
  8228. if (isSuspensible) {
  8229. if (parentSuspense && parentSuspense.pendingBranch) {
  8230. parentSuspenseId = parentSuspense.pendingId;
  8231. parentSuspense.deps++;
  8232. }
  8233. }
  8234. const timeout = vnode.props ? toNumber(vnode.props.timeout) : void 0;
  8235. {
  8236. assertNumber(timeout, `Suspense timeout`);
  8237. }
  8238. const initialAnchor = anchor;
  8239. const suspense = {
  8240. vnode,
  8241. parent: parentSuspense,
  8242. parentComponent,
  8243. namespace,
  8244. container,
  8245. hiddenContainer,
  8246. deps: 0,
  8247. pendingId: suspenseId++,
  8248. timeout: typeof timeout === "number" ? timeout : -1,
  8249. activeBranch: null,
  8250. pendingBranch: null,
  8251. isInFallback: !isHydrating,
  8252. isHydrating,
  8253. isUnmounted: false,
  8254. effects: [],
  8255. resolve(resume = false, sync = false) {
  8256. {
  8257. if (!resume && !suspense.pendingBranch) {
  8258. throw new Error(
  8259. `suspense.resolve() is called without a pending branch.`
  8260. );
  8261. }
  8262. if (suspense.isUnmounted) {
  8263. throw new Error(
  8264. `suspense.resolve() is called on an already unmounted suspense boundary.`
  8265. );
  8266. }
  8267. }
  8268. const {
  8269. vnode: vnode2,
  8270. activeBranch,
  8271. pendingBranch,
  8272. pendingId,
  8273. effects,
  8274. parentComponent: parentComponent2,
  8275. container: container2
  8276. } = suspense;
  8277. let delayEnter = false;
  8278. if (suspense.isHydrating) {
  8279. suspense.isHydrating = false;
  8280. } else if (!resume) {
  8281. delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
  8282. if (delayEnter) {
  8283. activeBranch.transition.afterLeave = () => {
  8284. if (pendingId === suspense.pendingId) {
  8285. move(
  8286. pendingBranch,
  8287. container2,
  8288. anchor === initialAnchor ? next(activeBranch) : anchor,
  8289. 0
  8290. );
  8291. queuePostFlushCb(effects);
  8292. }
  8293. };
  8294. }
  8295. if (activeBranch) {
  8296. if (parentNode(activeBranch.el) !== suspense.hiddenContainer) {
  8297. anchor = next(activeBranch);
  8298. }
  8299. unmount(activeBranch, parentComponent2, suspense, true);
  8300. }
  8301. if (!delayEnter) {
  8302. move(pendingBranch, container2, anchor, 0);
  8303. }
  8304. }
  8305. setActiveBranch(suspense, pendingBranch);
  8306. suspense.pendingBranch = null;
  8307. suspense.isInFallback = false;
  8308. let parent = suspense.parent;
  8309. let hasUnresolvedAncestor = false;
  8310. while (parent) {
  8311. if (parent.pendingBranch) {
  8312. parent.effects.push(...effects);
  8313. hasUnresolvedAncestor = true;
  8314. break;
  8315. }
  8316. parent = parent.parent;
  8317. }
  8318. if (!hasUnresolvedAncestor && !delayEnter) {
  8319. queuePostFlushCb(effects);
  8320. }
  8321. suspense.effects = [];
  8322. if (isSuspensible) {
  8323. if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
  8324. parentSuspense.deps--;
  8325. if (parentSuspense.deps === 0 && !sync) {
  8326. parentSuspense.resolve();
  8327. }
  8328. }
  8329. }
  8330. triggerEvent(vnode2, "onResolve");
  8331. },
  8332. fallback(fallbackVNode) {
  8333. if (!suspense.pendingBranch) {
  8334. return;
  8335. }
  8336. const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;
  8337. triggerEvent(vnode2, "onFallback");
  8338. const anchor2 = next(activeBranch);
  8339. const mountFallback = () => {
  8340. if (!suspense.isInFallback) {
  8341. return;
  8342. }
  8343. patch(
  8344. null,
  8345. fallbackVNode,
  8346. container2,
  8347. anchor2,
  8348. parentComponent2,
  8349. null,
  8350. // fallback tree will not have suspense context
  8351. namespace2,
  8352. slotScopeIds,
  8353. optimized
  8354. );
  8355. setActiveBranch(suspense, fallbackVNode);
  8356. };
  8357. const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
  8358. if (delayEnter) {
  8359. activeBranch.transition.afterLeave = mountFallback;
  8360. }
  8361. suspense.isInFallback = true;
  8362. unmount(
  8363. activeBranch,
  8364. parentComponent2,
  8365. null,
  8366. // no suspense so unmount hooks fire now
  8367. true
  8368. // shouldRemove
  8369. );
  8370. if (!delayEnter) {
  8371. mountFallback();
  8372. }
  8373. },
  8374. move(container2, anchor2, type) {
  8375. suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type);
  8376. suspense.container = container2;
  8377. },
  8378. next() {
  8379. return suspense.activeBranch && next(suspense.activeBranch);
  8380. },
  8381. registerDep(instance, setupRenderEffect, optimized2) {
  8382. const isInPendingSuspense = !!suspense.pendingBranch;
  8383. if (isInPendingSuspense) {
  8384. suspense.deps++;
  8385. }
  8386. const hydratedEl = instance.vnode.el;
  8387. instance.asyncDep.catch((err) => {
  8388. handleError(err, instance, 0);
  8389. }).then((asyncSetupResult) => {
  8390. if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
  8391. return;
  8392. }
  8393. instance.asyncResolved = true;
  8394. const { vnode: vnode2 } = instance;
  8395. {
  8396. pushWarningContext(vnode2);
  8397. }
  8398. handleSetupResult(instance, asyncSetupResult, false);
  8399. if (hydratedEl) {
  8400. vnode2.el = hydratedEl;
  8401. }
  8402. const placeholder = !hydratedEl && instance.subTree.el;
  8403. setupRenderEffect(
  8404. instance,
  8405. vnode2,
  8406. // component may have been moved before resolve.
  8407. // if this is not a hydration, instance.subTree will be the comment
  8408. // placeholder.
  8409. parentNode(hydratedEl || instance.subTree.el),
  8410. // anchor will not be used if this is hydration, so only need to
  8411. // consider the comment placeholder case.
  8412. hydratedEl ? null : next(instance.subTree),
  8413. suspense,
  8414. namespace,
  8415. optimized2
  8416. );
  8417. if (placeholder) {
  8418. remove(placeholder);
  8419. }
  8420. updateHOCHostEl(instance, vnode2.el);
  8421. {
  8422. popWarningContext();
  8423. }
  8424. if (isInPendingSuspense && --suspense.deps === 0) {
  8425. suspense.resolve();
  8426. }
  8427. });
  8428. },
  8429. unmount(parentSuspense2, doRemove) {
  8430. suspense.isUnmounted = true;
  8431. if (suspense.activeBranch) {
  8432. unmount(
  8433. suspense.activeBranch,
  8434. parentComponent,
  8435. parentSuspense2,
  8436. doRemove
  8437. );
  8438. }
  8439. if (suspense.pendingBranch) {
  8440. unmount(
  8441. suspense.pendingBranch,
  8442. parentComponent,
  8443. parentSuspense2,
  8444. doRemove
  8445. );
  8446. }
  8447. }
  8448. };
  8449. return suspense;
  8450. }
  8451. function hydrateSuspense(node, vnode, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals, hydrateNode) {
  8452. const suspense = vnode.suspense = createSuspenseBoundary(
  8453. vnode,
  8454. parentSuspense,
  8455. parentComponent,
  8456. node.parentNode,
  8457. // eslint-disable-next-line no-restricted-globals
  8458. document.createElement("div"),
  8459. null,
  8460. namespace,
  8461. slotScopeIds,
  8462. optimized,
  8463. rendererInternals,
  8464. true
  8465. );
  8466. const result = hydrateNode(
  8467. node,
  8468. suspense.pendingBranch = vnode.ssContent,
  8469. parentComponent,
  8470. suspense,
  8471. slotScopeIds,
  8472. optimized
  8473. );
  8474. if (suspense.deps === 0) {
  8475. suspense.resolve(false, true);
  8476. }
  8477. return result;
  8478. }
  8479. function normalizeSuspenseChildren(vnode) {
  8480. const { shapeFlag, children } = vnode;
  8481. const isSlotChildren = shapeFlag & 32;
  8482. vnode.ssContent = normalizeSuspenseSlot(
  8483. isSlotChildren ? children.default : children
  8484. );
  8485. vnode.ssFallback = isSlotChildren ? normalizeSuspenseSlot(children.fallback) : createVNode(Comment);
  8486. }
  8487. function normalizeSuspenseSlot(s) {
  8488. let block;
  8489. if (isFunction(s)) {
  8490. const trackBlock = isBlockTreeEnabled && s._c;
  8491. if (trackBlock) {
  8492. s._d = false;
  8493. openBlock();
  8494. }
  8495. s = s();
  8496. if (trackBlock) {
  8497. s._d = true;
  8498. block = currentBlock;
  8499. closeBlock();
  8500. }
  8501. }
  8502. if (isArray(s)) {
  8503. const singleChild = filterSingleRoot(s);
  8504. if (!singleChild && s.filter((child) => child !== NULL_DYNAMIC_COMPONENT).length > 0) {
  8505. warn$1(`<Suspense> slots expect a single root node.`);
  8506. }
  8507. s = singleChild;
  8508. }
  8509. s = normalizeVNode(s);
  8510. if (block && !s.dynamicChildren) {
  8511. s.dynamicChildren = block.filter((c) => c !== s);
  8512. }
  8513. return s;
  8514. }
  8515. function queueEffectWithSuspense(fn, suspense) {
  8516. if (suspense && suspense.pendingBranch) {
  8517. if (isArray(fn)) {
  8518. suspense.effects.push(...fn);
  8519. } else {
  8520. suspense.effects.push(fn);
  8521. }
  8522. } else {
  8523. queuePostFlushCb(fn);
  8524. }
  8525. }
  8526. function setActiveBranch(suspense, branch) {
  8527. suspense.activeBranch = branch;
  8528. const { vnode, parentComponent } = suspense;
  8529. let el = branch.el;
  8530. while (!el && branch.component) {
  8531. branch = branch.component.subTree;
  8532. el = branch.el;
  8533. }
  8534. vnode.el = el;
  8535. if (parentComponent && parentComponent.subTree === vnode) {
  8536. parentComponent.vnode.el = el;
  8537. updateHOCHostEl(parentComponent, el);
  8538. }
  8539. }
  8540. function isVNodeSuspensible(vnode) {
  8541. const suspensible = vnode.props && vnode.props.suspensible;
  8542. return suspensible != null && suspensible !== false;
  8543. }
  8544. const Fragment = Symbol.for("v-fgt");
  8545. const Text = Symbol.for("v-txt");
  8546. const Comment = Symbol.for("v-cmt");
  8547. const Static = Symbol.for("v-stc");
  8548. const blockStack = [];
  8549. let currentBlock = null;
  8550. function openBlock(disableTracking = false) {
  8551. blockStack.push(currentBlock = disableTracking ? null : []);
  8552. }
  8553. function closeBlock() {
  8554. blockStack.pop();
  8555. currentBlock = blockStack[blockStack.length - 1] || null;
  8556. }
  8557. let isBlockTreeEnabled = 1;
  8558. function setBlockTracking(value) {
  8559. isBlockTreeEnabled += value;
  8560. if (value < 0 && currentBlock) {
  8561. currentBlock.hasOnce = true;
  8562. }
  8563. }
  8564. function setupBlock(vnode) {
  8565. vnode.dynamicChildren = isBlockTreeEnabled > 0 ? currentBlock || EMPTY_ARR : null;
  8566. closeBlock();
  8567. if (isBlockTreeEnabled > 0 && currentBlock) {
  8568. currentBlock.push(vnode);
  8569. }
  8570. return vnode;
  8571. }
  8572. function createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) {
  8573. return setupBlock(
  8574. createBaseVNode(
  8575. type,
  8576. props,
  8577. children,
  8578. patchFlag,
  8579. dynamicProps,
  8580. shapeFlag,
  8581. true
  8582. )
  8583. );
  8584. }
  8585. function createBlock(type, props, children, patchFlag, dynamicProps) {
  8586. return setupBlock(
  8587. createVNode(
  8588. type,
  8589. props,
  8590. children,
  8591. patchFlag,
  8592. dynamicProps,
  8593. true
  8594. )
  8595. );
  8596. }
  8597. function isVNode(value) {
  8598. return value ? value.__v_isVNode === true : false;
  8599. }
  8600. function isSameVNodeType(n1, n2) {
  8601. if (n2.shapeFlag & 6 && n1.component) {
  8602. const dirtyInstances = hmrDirtyComponents.get(n2.type);
  8603. if (dirtyInstances && dirtyInstances.has(n1.component)) {
  8604. n1.shapeFlag &= ~256;
  8605. n2.shapeFlag &= ~512;
  8606. return false;
  8607. }
  8608. }
  8609. return n1.type === n2.type && n1.key === n2.key;
  8610. }
  8611. let vnodeArgsTransformer;
  8612. function transformVNodeArgs(transformer) {
  8613. vnodeArgsTransformer = transformer;
  8614. }
  8615. const createVNodeWithArgsTransform = (...args) => {
  8616. return _createVNode(
  8617. ...vnodeArgsTransformer ? vnodeArgsTransformer(args, currentRenderingInstance) : args
  8618. );
  8619. };
  8620. const normalizeKey = ({ key }) => key != null ? key : null;
  8621. const normalizeRef = ({
  8622. ref,
  8623. ref_key,
  8624. ref_for
  8625. }) => {
  8626. if (typeof ref === "number") {
  8627. ref = "" + ref;
  8628. }
  8629. return ref != null ? isString(ref) || isRef(ref) || isFunction(ref) ? { i: currentRenderingInstance, r: ref, k: ref_key, f: !!ref_for } : ref : null;
  8630. };
  8631. function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) {
  8632. const vnode = {
  8633. __v_isVNode: true,
  8634. __v_skip: true,
  8635. type,
  8636. props,
  8637. key: props && normalizeKey(props),
  8638. ref: props && normalizeRef(props),
  8639. scopeId: currentScopeId,
  8640. slotScopeIds: null,
  8641. children,
  8642. component: null,
  8643. suspense: null,
  8644. ssContent: null,
  8645. ssFallback: null,
  8646. dirs: null,
  8647. transition: null,
  8648. el: null,
  8649. anchor: null,
  8650. target: null,
  8651. targetStart: null,
  8652. targetAnchor: null,
  8653. staticCount: 0,
  8654. shapeFlag,
  8655. patchFlag,
  8656. dynamicProps,
  8657. dynamicChildren: null,
  8658. appContext: null,
  8659. ctx: currentRenderingInstance
  8660. };
  8661. if (needFullChildrenNormalization) {
  8662. normalizeChildren(vnode, children);
  8663. if (shapeFlag & 128) {
  8664. type.normalize(vnode);
  8665. }
  8666. } else if (children) {
  8667. vnode.shapeFlag |= isString(children) ? 8 : 16;
  8668. }
  8669. if (vnode.key !== vnode.key) {
  8670. warn$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
  8671. }
  8672. if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself
  8673. !isBlockNode && // has current parent block
  8674. currentBlock && // presence of a patch flag indicates this node needs patching on updates.
  8675. // component nodes also should always be patched, because even if the
  8676. // component doesn't need to update, it needs to persist the instance on to
  8677. // the next vnode so that it can be properly unmounted later.
  8678. (vnode.patchFlag > 0 || shapeFlag & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the
  8679. // vnode should not be considered dynamic due to handler caching.
  8680. vnode.patchFlag !== 32) {
  8681. currentBlock.push(vnode);
  8682. }
  8683. return vnode;
  8684. }
  8685. const createVNode = createVNodeWithArgsTransform ;
  8686. function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
  8687. if (!type || type === NULL_DYNAMIC_COMPONENT) {
  8688. if (!type) {
  8689. warn$1(`Invalid vnode type when creating vnode: ${type}.`);
  8690. }
  8691. type = Comment;
  8692. }
  8693. if (isVNode(type)) {
  8694. const cloned = cloneVNode(
  8695. type,
  8696. props,
  8697. true
  8698. /* mergeRef: true */
  8699. );
  8700. if (children) {
  8701. normalizeChildren(cloned, children);
  8702. }
  8703. if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
  8704. if (cloned.shapeFlag & 6) {
  8705. currentBlock[currentBlock.indexOf(type)] = cloned;
  8706. } else {
  8707. currentBlock.push(cloned);
  8708. }
  8709. }
  8710. cloned.patchFlag = -2;
  8711. return cloned;
  8712. }
  8713. if (isClassComponent(type)) {
  8714. type = type.__vccOpts;
  8715. }
  8716. if (props) {
  8717. props = guardReactiveProps(props);
  8718. let { class: klass, style } = props;
  8719. if (klass && !isString(klass)) {
  8720. props.class = normalizeClass(klass);
  8721. }
  8722. if (isObject(style)) {
  8723. if (isProxy(style) && !isArray(style)) {
  8724. style = extend({}, style);
  8725. }
  8726. props.style = normalizeStyle(style);
  8727. }
  8728. }
  8729. const shapeFlag = isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject(type) ? 4 : isFunction(type) ? 2 : 0;
  8730. if (shapeFlag & 4 && isProxy(type)) {
  8731. type = toRaw(type);
  8732. warn$1(
  8733. `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\`.`,
  8734. `
  8735. Component that was made reactive: `,
  8736. type
  8737. );
  8738. }
  8739. return createBaseVNode(
  8740. type,
  8741. props,
  8742. children,
  8743. patchFlag,
  8744. dynamicProps,
  8745. shapeFlag,
  8746. isBlockNode,
  8747. true
  8748. );
  8749. }
  8750. function guardReactiveProps(props) {
  8751. if (!props) return null;
  8752. return isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
  8753. }
  8754. function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
  8755. const { props, ref, patchFlag, children, transition } = vnode;
  8756. const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props;
  8757. const cloned = {
  8758. __v_isVNode: true,
  8759. __v_skip: true,
  8760. type: vnode.type,
  8761. props: mergedProps,
  8762. key: mergedProps && normalizeKey(mergedProps),
  8763. ref: extraProps && extraProps.ref ? (
  8764. // #2078 in the case of <component :is="vnode" ref="extra"/>
  8765. // if the vnode itself already has a ref, cloneVNode will need to merge
  8766. // the refs so the single vnode can be set on multiple refs
  8767. mergeRef && ref ? isArray(ref) ? ref.concat(normalizeRef(extraProps)) : [ref, normalizeRef(extraProps)] : normalizeRef(extraProps)
  8768. ) : ref,
  8769. scopeId: vnode.scopeId,
  8770. slotScopeIds: vnode.slotScopeIds,
  8771. children: patchFlag === -1 && isArray(children) ? children.map(deepCloneVNode) : children,
  8772. target: vnode.target,
  8773. targetStart: vnode.targetStart,
  8774. targetAnchor: vnode.targetAnchor,
  8775. staticCount: vnode.staticCount,
  8776. shapeFlag: vnode.shapeFlag,
  8777. // if the vnode is cloned with extra props, we can no longer assume its
  8778. // existing patch flag to be reliable and need to add the FULL_PROPS flag.
  8779. // note: preserve flag for fragments since they use the flag for children
  8780. // fast paths only.
  8781. patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag,
  8782. dynamicProps: vnode.dynamicProps,
  8783. dynamicChildren: vnode.dynamicChildren,
  8784. appContext: vnode.appContext,
  8785. dirs: vnode.dirs,
  8786. transition,
  8787. // These should technically only be non-null on mounted VNodes. However,
  8788. // they *should* be copied for kept-alive vnodes. So we just always copy
  8789. // them since them being non-null during a mount doesn't affect the logic as
  8790. // they will simply be overwritten.
  8791. component: vnode.component,
  8792. suspense: vnode.suspense,
  8793. ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
  8794. ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
  8795. el: vnode.el,
  8796. anchor: vnode.anchor,
  8797. ctx: vnode.ctx,
  8798. ce: vnode.ce
  8799. };
  8800. if (transition && cloneTransition) {
  8801. setTransitionHooks(
  8802. cloned,
  8803. transition.clone(cloned)
  8804. );
  8805. }
  8806. return cloned;
  8807. }
  8808. function deepCloneVNode(vnode) {
  8809. const cloned = cloneVNode(vnode);
  8810. if (isArray(vnode.children)) {
  8811. cloned.children = vnode.children.map(deepCloneVNode);
  8812. }
  8813. return cloned;
  8814. }
  8815. function createTextVNode(text = " ", flag = 0) {
  8816. return createVNode(Text, null, text, flag);
  8817. }
  8818. function createStaticVNode(content, numberOfNodes) {
  8819. const vnode = createVNode(Static, null, content);
  8820. vnode.staticCount = numberOfNodes;
  8821. return vnode;
  8822. }
  8823. function createCommentVNode(text = "", asBlock = false) {
  8824. return asBlock ? (openBlock(), createBlock(Comment, null, text)) : createVNode(Comment, null, text);
  8825. }
  8826. function normalizeVNode(child) {
  8827. if (child == null || typeof child === "boolean") {
  8828. return createVNode(Comment);
  8829. } else if (isArray(child)) {
  8830. return createVNode(
  8831. Fragment,
  8832. null,
  8833. // #3666, avoid reference pollution when reusing vnode
  8834. child.slice()
  8835. );
  8836. } else if (typeof child === "object") {
  8837. return cloneIfMounted(child);
  8838. } else {
  8839. return createVNode(Text, null, String(child));
  8840. }
  8841. }
  8842. function cloneIfMounted(child) {
  8843. return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child);
  8844. }
  8845. function normalizeChildren(vnode, children) {
  8846. let type = 0;
  8847. const { shapeFlag } = vnode;
  8848. if (children == null) {
  8849. children = null;
  8850. } else if (isArray(children)) {
  8851. type = 16;
  8852. } else if (typeof children === "object") {
  8853. if (shapeFlag & (1 | 64)) {
  8854. const slot = children.default;
  8855. if (slot) {
  8856. slot._c && (slot._d = false);
  8857. normalizeChildren(vnode, slot());
  8858. slot._c && (slot._d = true);
  8859. }
  8860. return;
  8861. } else {
  8862. type = 32;
  8863. const slotFlag = children._;
  8864. if (!slotFlag && !isInternalObject(children)) {
  8865. children._ctx = currentRenderingInstance;
  8866. } else if (slotFlag === 3 && currentRenderingInstance) {
  8867. if (currentRenderingInstance.slots._ === 1) {
  8868. children._ = 1;
  8869. } else {
  8870. children._ = 2;
  8871. vnode.patchFlag |= 1024;
  8872. }
  8873. }
  8874. }
  8875. } else if (isFunction(children)) {
  8876. children = { default: children, _ctx: currentRenderingInstance };
  8877. type = 32;
  8878. } else {
  8879. children = String(children);
  8880. if (shapeFlag & 64) {
  8881. type = 16;
  8882. children = [createTextVNode(children)];
  8883. } else {
  8884. type = 8;
  8885. }
  8886. }
  8887. vnode.children = children;
  8888. vnode.shapeFlag |= type;
  8889. }
  8890. function mergeProps(...args) {
  8891. const ret = {};
  8892. for (let i = 0; i < args.length; i++) {
  8893. const toMerge = args[i];
  8894. for (const key in toMerge) {
  8895. if (key === "class") {
  8896. if (ret.class !== toMerge.class) {
  8897. ret.class = normalizeClass([ret.class, toMerge.class]);
  8898. }
  8899. } else if (key === "style") {
  8900. ret.style = normalizeStyle([ret.style, toMerge.style]);
  8901. } else if (isOn(key)) {
  8902. const existing = ret[key];
  8903. const incoming = toMerge[key];
  8904. if (incoming && existing !== incoming && !(isArray(existing) && existing.includes(incoming))) {
  8905. ret[key] = existing ? [].concat(existing, incoming) : incoming;
  8906. }
  8907. } else if (key !== "") {
  8908. ret[key] = toMerge[key];
  8909. }
  8910. }
  8911. }
  8912. return ret;
  8913. }
  8914. function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
  8915. callWithAsyncErrorHandling(hook, instance, 7, [
  8916. vnode,
  8917. prevVNode
  8918. ]);
  8919. }
  8920. const emptyAppContext = createAppContext();
  8921. let uid = 0;
  8922. function createComponentInstance(vnode, parent, suspense) {
  8923. const type = vnode.type;
  8924. const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
  8925. const instance = {
  8926. uid: uid++,
  8927. vnode,
  8928. type,
  8929. parent,
  8930. appContext,
  8931. root: null,
  8932. // to be immediately set
  8933. next: null,
  8934. subTree: null,
  8935. // will be set synchronously right after creation
  8936. effect: null,
  8937. update: null,
  8938. // will be set synchronously right after creation
  8939. scope: new EffectScope(
  8940. true
  8941. /* detached */
  8942. ),
  8943. render: null,
  8944. proxy: null,
  8945. exposed: null,
  8946. exposeProxy: null,
  8947. withProxy: null,
  8948. provides: parent ? parent.provides : Object.create(appContext.provides),
  8949. accessCache: null,
  8950. renderCache: [],
  8951. // local resolved assets
  8952. components: null,
  8953. directives: null,
  8954. // resolved props and emits options
  8955. propsOptions: normalizePropsOptions(type, appContext),
  8956. emitsOptions: normalizeEmitsOptions(type, appContext),
  8957. // emit
  8958. emit: null,
  8959. // to be set immediately
  8960. emitted: null,
  8961. // props default value
  8962. propsDefaults: EMPTY_OBJ,
  8963. // inheritAttrs
  8964. inheritAttrs: type.inheritAttrs,
  8965. // state
  8966. ctx: EMPTY_OBJ,
  8967. data: EMPTY_OBJ,
  8968. props: EMPTY_OBJ,
  8969. attrs: EMPTY_OBJ,
  8970. slots: EMPTY_OBJ,
  8971. refs: EMPTY_OBJ,
  8972. setupState: EMPTY_OBJ,
  8973. setupContext: null,
  8974. // suspense related
  8975. suspense,
  8976. suspenseId: suspense ? suspense.pendingId : 0,
  8977. asyncDep: null,
  8978. asyncResolved: false,
  8979. // lifecycle hooks
  8980. // not using enums here because it results in computed properties
  8981. isMounted: false,
  8982. isUnmounted: false,
  8983. isDeactivated: false,
  8984. bc: null,
  8985. c: null,
  8986. bm: null,
  8987. m: null,
  8988. bu: null,
  8989. u: null,
  8990. um: null,
  8991. bum: null,
  8992. da: null,
  8993. a: null,
  8994. rtg: null,
  8995. rtc: null,
  8996. ec: null,
  8997. sp: null
  8998. };
  8999. {
  9000. instance.ctx = createDevRenderContext(instance);
  9001. }
  9002. instance.root = parent ? parent.root : instance;
  9003. instance.emit = emit.bind(null, instance);
  9004. if (vnode.ce) {
  9005. vnode.ce(instance);
  9006. }
  9007. return instance;
  9008. }
  9009. let currentInstance = null;
  9010. const getCurrentInstance = () => currentInstance || currentRenderingInstance;
  9011. let internalSetCurrentInstance;
  9012. let setInSSRSetupState;
  9013. {
  9014. internalSetCurrentInstance = (i) => {
  9015. currentInstance = i;
  9016. };
  9017. setInSSRSetupState = (v) => {
  9018. isInSSRComponentSetup = v;
  9019. };
  9020. }
  9021. const setCurrentInstance = (instance) => {
  9022. const prev = currentInstance;
  9023. internalSetCurrentInstance(instance);
  9024. instance.scope.on();
  9025. return () => {
  9026. instance.scope.off();
  9027. internalSetCurrentInstance(prev);
  9028. };
  9029. };
  9030. const unsetCurrentInstance = () => {
  9031. currentInstance && currentInstance.scope.off();
  9032. internalSetCurrentInstance(null);
  9033. };
  9034. const isBuiltInTag = /* @__PURE__ */ makeMap("slot,component");
  9035. function validateComponentName(name, { isNativeTag }) {
  9036. if (isBuiltInTag(name) || isNativeTag(name)) {
  9037. warn$1(
  9038. "Do not use built-in or reserved HTML elements as component id: " + name
  9039. );
  9040. }
  9041. }
  9042. function isStatefulComponent(instance) {
  9043. return instance.vnode.shapeFlag & 4;
  9044. }
  9045. let isInSSRComponentSetup = false;
  9046. function setupComponent(instance, isSSR = false, optimized = false) {
  9047. isSSR && setInSSRSetupState(isSSR);
  9048. const { props, children } = instance.vnode;
  9049. const isStateful = isStatefulComponent(instance);
  9050. initProps(instance, props, isStateful, isSSR);
  9051. initSlots(instance, children, optimized);
  9052. const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
  9053. isSSR && setInSSRSetupState(false);
  9054. return setupResult;
  9055. }
  9056. function setupStatefulComponent(instance, isSSR) {
  9057. var _a;
  9058. const Component = instance.type;
  9059. {
  9060. if (Component.name) {
  9061. validateComponentName(Component.name, instance.appContext.config);
  9062. }
  9063. if (Component.components) {
  9064. const names = Object.keys(Component.components);
  9065. for (let i = 0; i < names.length; i++) {
  9066. validateComponentName(names[i], instance.appContext.config);
  9067. }
  9068. }
  9069. if (Component.directives) {
  9070. const names = Object.keys(Component.directives);
  9071. for (let i = 0; i < names.length; i++) {
  9072. validateDirectiveName(names[i]);
  9073. }
  9074. }
  9075. if (Component.compilerOptions && isRuntimeOnly()) {
  9076. warn$1(
  9077. `"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.`
  9078. );
  9079. }
  9080. }
  9081. instance.accessCache = /* @__PURE__ */ Object.create(null);
  9082. instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers);
  9083. {
  9084. exposePropsOnRenderContext(instance);
  9085. }
  9086. const { setup } = Component;
  9087. if (setup) {
  9088. const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
  9089. const reset = setCurrentInstance(instance);
  9090. pauseTracking();
  9091. const setupResult = callWithErrorHandling(
  9092. setup,
  9093. instance,
  9094. 0,
  9095. [
  9096. shallowReadonly(instance.props) ,
  9097. setupContext
  9098. ]
  9099. );
  9100. resetTracking();
  9101. reset();
  9102. if (isPromise(setupResult)) {
  9103. setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
  9104. if (isSSR) {
  9105. return setupResult.then((resolvedResult) => {
  9106. handleSetupResult(instance, resolvedResult, isSSR);
  9107. }).catch((e) => {
  9108. handleError(e, instance, 0);
  9109. });
  9110. } else {
  9111. instance.asyncDep = setupResult;
  9112. if (!instance.suspense) {
  9113. const name = (_a = Component.name) != null ? _a : "Anonymous";
  9114. warn$1(
  9115. `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.`
  9116. );
  9117. }
  9118. }
  9119. } else {
  9120. handleSetupResult(instance, setupResult, isSSR);
  9121. }
  9122. } else {
  9123. finishComponentSetup(instance, isSSR);
  9124. }
  9125. }
  9126. function handleSetupResult(instance, setupResult, isSSR) {
  9127. if (isFunction(setupResult)) {
  9128. {
  9129. instance.render = setupResult;
  9130. }
  9131. } else if (isObject(setupResult)) {
  9132. if (isVNode(setupResult)) {
  9133. warn$1(
  9134. `setup() should not return VNodes directly - return a render function instead.`
  9135. );
  9136. }
  9137. {
  9138. instance.devtoolsRawSetupState = setupResult;
  9139. }
  9140. instance.setupState = proxyRefs(setupResult);
  9141. {
  9142. exposeSetupStateOnRenderContext(instance);
  9143. }
  9144. } else if (setupResult !== void 0) {
  9145. warn$1(
  9146. `setup() should return an object. Received: ${setupResult === null ? "null" : typeof setupResult}`
  9147. );
  9148. }
  9149. finishComponentSetup(instance, isSSR);
  9150. }
  9151. let compile$1;
  9152. let installWithProxy;
  9153. function registerRuntimeCompiler(_compile) {
  9154. compile$1 = _compile;
  9155. installWithProxy = (i) => {
  9156. if (i.render._rc) {
  9157. i.withProxy = new Proxy(i.ctx, RuntimeCompiledPublicInstanceProxyHandlers);
  9158. }
  9159. };
  9160. }
  9161. const isRuntimeOnly = () => !compile$1;
  9162. function finishComponentSetup(instance, isSSR, skipOptions) {
  9163. const Component = instance.type;
  9164. if (!instance.render) {
  9165. if (!isSSR && compile$1 && !Component.render) {
  9166. const template = Component.template || resolveMergedOptions(instance).template;
  9167. if (template) {
  9168. {
  9169. startMeasure(instance, `compile`);
  9170. }
  9171. const { isCustomElement, compilerOptions } = instance.appContext.config;
  9172. const { delimiters, compilerOptions: componentCompilerOptions } = Component;
  9173. const finalCompilerOptions = extend(
  9174. extend(
  9175. {
  9176. isCustomElement,
  9177. delimiters
  9178. },
  9179. compilerOptions
  9180. ),
  9181. componentCompilerOptions
  9182. );
  9183. Component.render = compile$1(template, finalCompilerOptions);
  9184. {
  9185. endMeasure(instance, `compile`);
  9186. }
  9187. }
  9188. }
  9189. instance.render = Component.render || NOOP;
  9190. if (installWithProxy) {
  9191. installWithProxy(instance);
  9192. }
  9193. }
  9194. {
  9195. const reset = setCurrentInstance(instance);
  9196. pauseTracking();
  9197. try {
  9198. applyOptions(instance);
  9199. } finally {
  9200. resetTracking();
  9201. reset();
  9202. }
  9203. }
  9204. if (!Component.render && instance.render === NOOP && !isSSR) {
  9205. if (!compile$1 && Component.template) {
  9206. warn$1(
  9207. `Component provided template option but runtime compilation is not supported in this build of Vue.` + (` Use "vue.esm-browser.js" instead.` )
  9208. );
  9209. } else {
  9210. warn$1(`Component is missing template or render function: `, Component);
  9211. }
  9212. }
  9213. }
  9214. const attrsProxyHandlers = {
  9215. get(target, key) {
  9216. markAttrsAccessed();
  9217. track(target, "get", "");
  9218. return target[key];
  9219. },
  9220. set() {
  9221. warn$1(`setupContext.attrs is readonly.`);
  9222. return false;
  9223. },
  9224. deleteProperty() {
  9225. warn$1(`setupContext.attrs is readonly.`);
  9226. return false;
  9227. }
  9228. } ;
  9229. function getSlotsProxy(instance) {
  9230. return new Proxy(instance.slots, {
  9231. get(target, key) {
  9232. track(instance, "get", "$slots");
  9233. return target[key];
  9234. }
  9235. });
  9236. }
  9237. function createSetupContext(instance) {
  9238. const expose = (exposed) => {
  9239. {
  9240. if (instance.exposed) {
  9241. warn$1(`expose() should be called only once per setup().`);
  9242. }
  9243. if (exposed != null) {
  9244. let exposedType = typeof exposed;
  9245. if (exposedType === "object") {
  9246. if (isArray(exposed)) {
  9247. exposedType = "array";
  9248. } else if (isRef(exposed)) {
  9249. exposedType = "ref";
  9250. }
  9251. }
  9252. if (exposedType !== "object") {
  9253. warn$1(
  9254. `expose() should be passed a plain object, received ${exposedType}.`
  9255. );
  9256. }
  9257. }
  9258. }
  9259. instance.exposed = exposed || {};
  9260. };
  9261. {
  9262. let attrsProxy;
  9263. let slotsProxy;
  9264. return Object.freeze({
  9265. get attrs() {
  9266. return attrsProxy || (attrsProxy = new Proxy(instance.attrs, attrsProxyHandlers));
  9267. },
  9268. get slots() {
  9269. return slotsProxy || (slotsProxy = getSlotsProxy(instance));
  9270. },
  9271. get emit() {
  9272. return (event, ...args) => instance.emit(event, ...args);
  9273. },
  9274. expose
  9275. });
  9276. }
  9277. }
  9278. function getComponentPublicInstance(instance) {
  9279. if (instance.exposed) {
  9280. return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
  9281. get(target, key) {
  9282. if (key in target) {
  9283. return target[key];
  9284. } else if (key in publicPropertiesMap) {
  9285. return publicPropertiesMap[key](instance);
  9286. }
  9287. },
  9288. has(target, key) {
  9289. return key in target || key in publicPropertiesMap;
  9290. }
  9291. }));
  9292. } else {
  9293. return instance.proxy;
  9294. }
  9295. }
  9296. const classifyRE = /(?:^|[-_])(\w)/g;
  9297. const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, "");
  9298. function getComponentName(Component, includeInferred = true) {
  9299. return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
  9300. }
  9301. function formatComponentName(instance, Component, isRoot = false) {
  9302. let name = getComponentName(Component);
  9303. if (!name && Component.__file) {
  9304. const match = Component.__file.match(/([^/\\]+)\.\w+$/);
  9305. if (match) {
  9306. name = match[1];
  9307. }
  9308. }
  9309. if (!name && instance && instance.parent) {
  9310. const inferFromRegistry = (registry) => {
  9311. for (const key in registry) {
  9312. if (registry[key] === Component) {
  9313. return key;
  9314. }
  9315. }
  9316. };
  9317. name = inferFromRegistry(
  9318. instance.components || instance.parent.type.components
  9319. ) || inferFromRegistry(instance.appContext.components);
  9320. }
  9321. return name ? classify(name) : isRoot ? `App` : `Anonymous`;
  9322. }
  9323. function isClassComponent(value) {
  9324. return isFunction(value) && "__vccOpts" in value;
  9325. }
  9326. const computed = (getterOrOptions, debugOptions) => {
  9327. const c = computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
  9328. {
  9329. const i = getCurrentInstance();
  9330. if (i && i.appContext.config.warnRecursiveComputed) {
  9331. c._warnRecursive = true;
  9332. }
  9333. }
  9334. return c;
  9335. };
  9336. function h(type, propsOrChildren, children) {
  9337. const l = arguments.length;
  9338. if (l === 2) {
  9339. if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
  9340. if (isVNode(propsOrChildren)) {
  9341. return createVNode(type, null, [propsOrChildren]);
  9342. }
  9343. return createVNode(type, propsOrChildren);
  9344. } else {
  9345. return createVNode(type, null, propsOrChildren);
  9346. }
  9347. } else {
  9348. if (l > 3) {
  9349. children = Array.prototype.slice.call(arguments, 2);
  9350. } else if (l === 3 && isVNode(children)) {
  9351. children = [children];
  9352. }
  9353. return createVNode(type, propsOrChildren, children);
  9354. }
  9355. }
  9356. function initCustomFormatter() {
  9357. if (typeof window === "undefined") {
  9358. return;
  9359. }
  9360. const vueStyle = { style: "color:#3ba776" };
  9361. const numberStyle = { style: "color:#1677ff" };
  9362. const stringStyle = { style: "color:#f5222d" };
  9363. const keywordStyle = { style: "color:#eb2f96" };
  9364. const formatter = {
  9365. __vue_custom_formatter: true,
  9366. header(obj) {
  9367. if (!isObject(obj)) {
  9368. return null;
  9369. }
  9370. if (obj.__isVue) {
  9371. return ["div", vueStyle, `VueInstance`];
  9372. } else if (isRef(obj)) {
  9373. return [
  9374. "div",
  9375. {},
  9376. ["span", vueStyle, genRefFlag(obj)],
  9377. "<",
  9378. formatValue(obj.value),
  9379. `>`
  9380. ];
  9381. } else if (isReactive(obj)) {
  9382. return [
  9383. "div",
  9384. {},
  9385. ["span", vueStyle, isShallow(obj) ? "ShallowReactive" : "Reactive"],
  9386. "<",
  9387. formatValue(obj),
  9388. `>${isReadonly(obj) ? ` (readonly)` : ``}`
  9389. ];
  9390. } else if (isReadonly(obj)) {
  9391. return [
  9392. "div",
  9393. {},
  9394. ["span", vueStyle, isShallow(obj) ? "ShallowReadonly" : "Readonly"],
  9395. "<",
  9396. formatValue(obj),
  9397. ">"
  9398. ];
  9399. }
  9400. return null;
  9401. },
  9402. hasBody(obj) {
  9403. return obj && obj.__isVue;
  9404. },
  9405. body(obj) {
  9406. if (obj && obj.__isVue) {
  9407. return [
  9408. "div",
  9409. {},
  9410. ...formatInstance(obj.$)
  9411. ];
  9412. }
  9413. }
  9414. };
  9415. function formatInstance(instance) {
  9416. const blocks = [];
  9417. if (instance.type.props && instance.props) {
  9418. blocks.push(createInstanceBlock("props", toRaw(instance.props)));
  9419. }
  9420. if (instance.setupState !== EMPTY_OBJ) {
  9421. blocks.push(createInstanceBlock("setup", instance.setupState));
  9422. }
  9423. if (instance.data !== EMPTY_OBJ) {
  9424. blocks.push(createInstanceBlock("data", toRaw(instance.data)));
  9425. }
  9426. const computed = extractKeys(instance, "computed");
  9427. if (computed) {
  9428. blocks.push(createInstanceBlock("computed", computed));
  9429. }
  9430. const injected = extractKeys(instance, "inject");
  9431. if (injected) {
  9432. blocks.push(createInstanceBlock("injected", injected));
  9433. }
  9434. blocks.push([
  9435. "div",
  9436. {},
  9437. [
  9438. "span",
  9439. {
  9440. style: keywordStyle.style + ";opacity:0.66"
  9441. },
  9442. "$ (internal): "
  9443. ],
  9444. ["object", { object: instance }]
  9445. ]);
  9446. return blocks;
  9447. }
  9448. function createInstanceBlock(type, target) {
  9449. target = extend({}, target);
  9450. if (!Object.keys(target).length) {
  9451. return ["span", {}];
  9452. }
  9453. return [
  9454. "div",
  9455. { style: "line-height:1.25em;margin-bottom:0.6em" },
  9456. [
  9457. "div",
  9458. {
  9459. style: "color:#476582"
  9460. },
  9461. type
  9462. ],
  9463. [
  9464. "div",
  9465. {
  9466. style: "padding-left:1.25em"
  9467. },
  9468. ...Object.keys(target).map((key) => {
  9469. return [
  9470. "div",
  9471. {},
  9472. ["span", keywordStyle, key + ": "],
  9473. formatValue(target[key], false)
  9474. ];
  9475. })
  9476. ]
  9477. ];
  9478. }
  9479. function formatValue(v, asRaw = true) {
  9480. if (typeof v === "number") {
  9481. return ["span", numberStyle, v];
  9482. } else if (typeof v === "string") {
  9483. return ["span", stringStyle, JSON.stringify(v)];
  9484. } else if (typeof v === "boolean") {
  9485. return ["span", keywordStyle, v];
  9486. } else if (isObject(v)) {
  9487. return ["object", { object: asRaw ? toRaw(v) : v }];
  9488. } else {
  9489. return ["span", stringStyle, String(v)];
  9490. }
  9491. }
  9492. function extractKeys(instance, type) {
  9493. const Comp = instance.type;
  9494. if (isFunction(Comp)) {
  9495. return;
  9496. }
  9497. const extracted = {};
  9498. for (const key in instance.ctx) {
  9499. if (isKeyOfType(Comp, key, type)) {
  9500. extracted[key] = instance.ctx[key];
  9501. }
  9502. }
  9503. return extracted;
  9504. }
  9505. function isKeyOfType(Comp, key, type) {
  9506. const opts = Comp[type];
  9507. if (isArray(opts) && opts.includes(key) || isObject(opts) && key in opts) {
  9508. return true;
  9509. }
  9510. if (Comp.extends && isKeyOfType(Comp.extends, key, type)) {
  9511. return true;
  9512. }
  9513. if (Comp.mixins && Comp.mixins.some((m) => isKeyOfType(m, key, type))) {
  9514. return true;
  9515. }
  9516. }
  9517. function genRefFlag(v) {
  9518. if (isShallow(v)) {
  9519. return `ShallowRef`;
  9520. }
  9521. if (v.effect) {
  9522. return `ComputedRef`;
  9523. }
  9524. return `Ref`;
  9525. }
  9526. if (window.devtoolsFormatters) {
  9527. window.devtoolsFormatters.push(formatter);
  9528. } else {
  9529. window.devtoolsFormatters = [formatter];
  9530. }
  9531. }
  9532. function withMemo(memo, render, cache, index) {
  9533. const cached = cache[index];
  9534. if (cached && isMemoSame(cached, memo)) {
  9535. return cached;
  9536. }
  9537. const ret = render();
  9538. ret.memo = memo.slice();
  9539. ret.cacheIndex = index;
  9540. return cache[index] = ret;
  9541. }
  9542. function isMemoSame(cached, memo) {
  9543. const prev = cached.memo;
  9544. if (prev.length != memo.length) {
  9545. return false;
  9546. }
  9547. for (let i = 0; i < prev.length; i++) {
  9548. if (hasChanged(prev[i], memo[i])) {
  9549. return false;
  9550. }
  9551. }
  9552. if (isBlockTreeEnabled > 0 && currentBlock) {
  9553. currentBlock.push(cached);
  9554. }
  9555. return true;
  9556. }
  9557. const version = "3.4.38";
  9558. const warn = warn$1 ;
  9559. const ErrorTypeStrings = ErrorTypeStrings$1 ;
  9560. const devtools = devtools$1 ;
  9561. const setDevtoolsHook = setDevtoolsHook$1 ;
  9562. const ssrUtils = null;
  9563. const resolveFilter = null;
  9564. const compatUtils = null;
  9565. const DeprecationTypes = null;
  9566. const svgNS = "http://www.w3.org/2000/svg";
  9567. const mathmlNS = "http://www.w3.org/1998/Math/MathML";
  9568. const doc = typeof document !== "undefined" ? document : null;
  9569. const templateContainer = doc && /* @__PURE__ */ doc.createElement("template");
  9570. const nodeOps = {
  9571. insert: (child, parent, anchor) => {
  9572. parent.insertBefore(child, anchor || null);
  9573. },
  9574. remove: (child) => {
  9575. const parent = child.parentNode;
  9576. if (parent) {
  9577. parent.removeChild(child);
  9578. }
  9579. },
  9580. createElement: (tag, namespace, is, props) => {
  9581. const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : is ? doc.createElement(tag, { is }) : doc.createElement(tag);
  9582. if (tag === "select" && props && props.multiple != null) {
  9583. el.setAttribute("multiple", props.multiple);
  9584. }
  9585. return el;
  9586. },
  9587. createText: (text) => doc.createTextNode(text),
  9588. createComment: (text) => doc.createComment(text),
  9589. setText: (node, text) => {
  9590. node.nodeValue = text;
  9591. },
  9592. setElementText: (el, text) => {
  9593. el.textContent = text;
  9594. },
  9595. parentNode: (node) => node.parentNode,
  9596. nextSibling: (node) => node.nextSibling,
  9597. querySelector: (selector) => doc.querySelector(selector),
  9598. setScopeId(el, id) {
  9599. el.setAttribute(id, "");
  9600. },
  9601. // __UNSAFE__
  9602. // Reason: innerHTML.
  9603. // Static content here can only come from compiled templates.
  9604. // As long as the user only uses trusted templates, this is safe.
  9605. insertStaticContent(content, parent, anchor, namespace, start, end) {
  9606. const before = anchor ? anchor.previousSibling : parent.lastChild;
  9607. if (start && (start === end || start.nextSibling)) {
  9608. while (true) {
  9609. parent.insertBefore(start.cloneNode(true), anchor);
  9610. if (start === end || !(start = start.nextSibling)) break;
  9611. }
  9612. } else {
  9613. templateContainer.innerHTML = namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content;
  9614. const template = templateContainer.content;
  9615. if (namespace === "svg" || namespace === "mathml") {
  9616. const wrapper = template.firstChild;
  9617. while (wrapper.firstChild) {
  9618. template.appendChild(wrapper.firstChild);
  9619. }
  9620. template.removeChild(wrapper);
  9621. }
  9622. parent.insertBefore(template, anchor);
  9623. }
  9624. return [
  9625. // first
  9626. before ? before.nextSibling : parent.firstChild,
  9627. // last
  9628. anchor ? anchor.previousSibling : parent.lastChild
  9629. ];
  9630. }
  9631. };
  9632. const TRANSITION = "transition";
  9633. const ANIMATION = "animation";
  9634. const vtcKey = Symbol("_vtc");
  9635. const Transition = (props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots);
  9636. Transition.displayName = "Transition";
  9637. const DOMTransitionPropsValidators = {
  9638. name: String,
  9639. type: String,
  9640. css: {
  9641. type: Boolean,
  9642. default: true
  9643. },
  9644. duration: [String, Number, Object],
  9645. enterFromClass: String,
  9646. enterActiveClass: String,
  9647. enterToClass: String,
  9648. appearFromClass: String,
  9649. appearActiveClass: String,
  9650. appearToClass: String,
  9651. leaveFromClass: String,
  9652. leaveActiveClass: String,
  9653. leaveToClass: String
  9654. };
  9655. const TransitionPropsValidators = Transition.props = /* @__PURE__ */ extend(
  9656. {},
  9657. BaseTransitionPropsValidators,
  9658. DOMTransitionPropsValidators
  9659. );
  9660. const callHook = (hook, args = []) => {
  9661. if (isArray(hook)) {
  9662. hook.forEach((h2) => h2(...args));
  9663. } else if (hook) {
  9664. hook(...args);
  9665. }
  9666. };
  9667. const hasExplicitCallback = (hook) => {
  9668. return hook ? isArray(hook) ? hook.some((h2) => h2.length > 1) : hook.length > 1 : false;
  9669. };
  9670. function resolveTransitionProps(rawProps) {
  9671. const baseProps = {};
  9672. for (const key in rawProps) {
  9673. if (!(key in DOMTransitionPropsValidators)) {
  9674. baseProps[key] = rawProps[key];
  9675. }
  9676. }
  9677. if (rawProps.css === false) {
  9678. return baseProps;
  9679. }
  9680. const {
  9681. name = "v",
  9682. type,
  9683. duration,
  9684. enterFromClass = `${name}-enter-from`,
  9685. enterActiveClass = `${name}-enter-active`,
  9686. enterToClass = `${name}-enter-to`,
  9687. appearFromClass = enterFromClass,
  9688. appearActiveClass = enterActiveClass,
  9689. appearToClass = enterToClass,
  9690. leaveFromClass = `${name}-leave-from`,
  9691. leaveActiveClass = `${name}-leave-active`,
  9692. leaveToClass = `${name}-leave-to`
  9693. } = rawProps;
  9694. const durations = normalizeDuration(duration);
  9695. const enterDuration = durations && durations[0];
  9696. const leaveDuration = durations && durations[1];
  9697. const {
  9698. onBeforeEnter,
  9699. onEnter,
  9700. onEnterCancelled,
  9701. onLeave,
  9702. onLeaveCancelled,
  9703. onBeforeAppear = onBeforeEnter,
  9704. onAppear = onEnter,
  9705. onAppearCancelled = onEnterCancelled
  9706. } = baseProps;
  9707. const finishEnter = (el, isAppear, done) => {
  9708. removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
  9709. removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
  9710. done && done();
  9711. };
  9712. const finishLeave = (el, done) => {
  9713. el._isLeaving = false;
  9714. removeTransitionClass(el, leaveFromClass);
  9715. removeTransitionClass(el, leaveToClass);
  9716. removeTransitionClass(el, leaveActiveClass);
  9717. done && done();
  9718. };
  9719. const makeEnterHook = (isAppear) => {
  9720. return (el, done) => {
  9721. const hook = isAppear ? onAppear : onEnter;
  9722. const resolve = () => finishEnter(el, isAppear, done);
  9723. callHook(hook, [el, resolve]);
  9724. nextFrame(() => {
  9725. removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
  9726. addTransitionClass(el, isAppear ? appearToClass : enterToClass);
  9727. if (!hasExplicitCallback(hook)) {
  9728. whenTransitionEnds(el, type, enterDuration, resolve);
  9729. }
  9730. });
  9731. };
  9732. };
  9733. return extend(baseProps, {
  9734. onBeforeEnter(el) {
  9735. callHook(onBeforeEnter, [el]);
  9736. addTransitionClass(el, enterFromClass);
  9737. addTransitionClass(el, enterActiveClass);
  9738. },
  9739. onBeforeAppear(el) {
  9740. callHook(onBeforeAppear, [el]);
  9741. addTransitionClass(el, appearFromClass);
  9742. addTransitionClass(el, appearActiveClass);
  9743. },
  9744. onEnter: makeEnterHook(false),
  9745. onAppear: makeEnterHook(true),
  9746. onLeave(el, done) {
  9747. el._isLeaving = true;
  9748. const resolve = () => finishLeave(el, done);
  9749. addTransitionClass(el, leaveFromClass);
  9750. addTransitionClass(el, leaveActiveClass);
  9751. forceReflow();
  9752. nextFrame(() => {
  9753. if (!el._isLeaving) {
  9754. return;
  9755. }
  9756. removeTransitionClass(el, leaveFromClass);
  9757. addTransitionClass(el, leaveToClass);
  9758. if (!hasExplicitCallback(onLeave)) {
  9759. whenTransitionEnds(el, type, leaveDuration, resolve);
  9760. }
  9761. });
  9762. callHook(onLeave, [el, resolve]);
  9763. },
  9764. onEnterCancelled(el) {
  9765. finishEnter(el, false);
  9766. callHook(onEnterCancelled, [el]);
  9767. },
  9768. onAppearCancelled(el) {
  9769. finishEnter(el, true);
  9770. callHook(onAppearCancelled, [el]);
  9771. },
  9772. onLeaveCancelled(el) {
  9773. finishLeave(el);
  9774. callHook(onLeaveCancelled, [el]);
  9775. }
  9776. });
  9777. }
  9778. function normalizeDuration(duration) {
  9779. if (duration == null) {
  9780. return null;
  9781. } else if (isObject(duration)) {
  9782. return [NumberOf(duration.enter), NumberOf(duration.leave)];
  9783. } else {
  9784. const n = NumberOf(duration);
  9785. return [n, n];
  9786. }
  9787. }
  9788. function NumberOf(val) {
  9789. const res = toNumber(val);
  9790. {
  9791. assertNumber(res, "<transition> explicit duration");
  9792. }
  9793. return res;
  9794. }
  9795. function addTransitionClass(el, cls) {
  9796. cls.split(/\s+/).forEach((c) => c && el.classList.add(c));
  9797. (el[vtcKey] || (el[vtcKey] = /* @__PURE__ */ new Set())).add(cls);
  9798. }
  9799. function removeTransitionClass(el, cls) {
  9800. cls.split(/\s+/).forEach((c) => c && el.classList.remove(c));
  9801. const _vtc = el[vtcKey];
  9802. if (_vtc) {
  9803. _vtc.delete(cls);
  9804. if (!_vtc.size) {
  9805. el[vtcKey] = void 0;
  9806. }
  9807. }
  9808. }
  9809. function nextFrame(cb) {
  9810. requestAnimationFrame(() => {
  9811. requestAnimationFrame(cb);
  9812. });
  9813. }
  9814. let endId = 0;
  9815. function whenTransitionEnds(el, expectedType, explicitTimeout, resolve) {
  9816. const id = el._endId = ++endId;
  9817. const resolveIfNotStale = () => {
  9818. if (id === el._endId) {
  9819. resolve();
  9820. }
  9821. };
  9822. if (explicitTimeout) {
  9823. return setTimeout(resolveIfNotStale, explicitTimeout);
  9824. }
  9825. const { type, timeout, propCount } = getTransitionInfo(el, expectedType);
  9826. if (!type) {
  9827. return resolve();
  9828. }
  9829. const endEvent = type + "end";
  9830. let ended = 0;
  9831. const end = () => {
  9832. el.removeEventListener(endEvent, onEnd);
  9833. resolveIfNotStale();
  9834. };
  9835. const onEnd = (e) => {
  9836. if (e.target === el && ++ended >= propCount) {
  9837. end();
  9838. }
  9839. };
  9840. setTimeout(() => {
  9841. if (ended < propCount) {
  9842. end();
  9843. }
  9844. }, timeout + 1);
  9845. el.addEventListener(endEvent, onEnd);
  9846. }
  9847. function getTransitionInfo(el, expectedType) {
  9848. const styles = window.getComputedStyle(el);
  9849. const getStyleProperties = (key) => (styles[key] || "").split(", ");
  9850. const transitionDelays = getStyleProperties(`${TRANSITION}Delay`);
  9851. const transitionDurations = getStyleProperties(`${TRANSITION}Duration`);
  9852. const transitionTimeout = getTimeout(transitionDelays, transitionDurations);
  9853. const animationDelays = getStyleProperties(`${ANIMATION}Delay`);
  9854. const animationDurations = getStyleProperties(`${ANIMATION}Duration`);
  9855. const animationTimeout = getTimeout(animationDelays, animationDurations);
  9856. let type = null;
  9857. let timeout = 0;
  9858. let propCount = 0;
  9859. if (expectedType === TRANSITION) {
  9860. if (transitionTimeout > 0) {
  9861. type = TRANSITION;
  9862. timeout = transitionTimeout;
  9863. propCount = transitionDurations.length;
  9864. }
  9865. } else if (expectedType === ANIMATION) {
  9866. if (animationTimeout > 0) {
  9867. type = ANIMATION;
  9868. timeout = animationTimeout;
  9869. propCount = animationDurations.length;
  9870. }
  9871. } else {
  9872. timeout = Math.max(transitionTimeout, animationTimeout);
  9873. type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null;
  9874. propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0;
  9875. }
  9876. const hasTransform = type === TRANSITION && /\b(transform|all)(,|$)/.test(
  9877. getStyleProperties(`${TRANSITION}Property`).toString()
  9878. );
  9879. return {
  9880. type,
  9881. timeout,
  9882. propCount,
  9883. hasTransform
  9884. };
  9885. }
  9886. function getTimeout(delays, durations) {
  9887. while (delays.length < durations.length) {
  9888. delays = delays.concat(delays);
  9889. }
  9890. return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i])));
  9891. }
  9892. function toMs(s) {
  9893. if (s === "auto") return 0;
  9894. return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
  9895. }
  9896. function forceReflow() {
  9897. return document.body.offsetHeight;
  9898. }
  9899. function patchClass(el, value, isSVG) {
  9900. const transitionClasses = el[vtcKey];
  9901. if (transitionClasses) {
  9902. value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" ");
  9903. }
  9904. if (value == null) {
  9905. el.removeAttribute("class");
  9906. } else if (isSVG) {
  9907. el.setAttribute("class", value);
  9908. } else {
  9909. el.className = value;
  9910. }
  9911. }
  9912. const vShowOriginalDisplay = Symbol("_vod");
  9913. const vShowHidden = Symbol("_vsh");
  9914. const vShow = {
  9915. beforeMount(el, { value }, { transition }) {
  9916. el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display;
  9917. if (transition && value) {
  9918. transition.beforeEnter(el);
  9919. } else {
  9920. setDisplay(el, value);
  9921. }
  9922. },
  9923. mounted(el, { value }, { transition }) {
  9924. if (transition && value) {
  9925. transition.enter(el);
  9926. }
  9927. },
  9928. updated(el, { value, oldValue }, { transition }) {
  9929. if (!value === !oldValue) return;
  9930. if (transition) {
  9931. if (value) {
  9932. transition.beforeEnter(el);
  9933. setDisplay(el, true);
  9934. transition.enter(el);
  9935. } else {
  9936. transition.leave(el, () => {
  9937. setDisplay(el, false);
  9938. });
  9939. }
  9940. } else {
  9941. setDisplay(el, value);
  9942. }
  9943. },
  9944. beforeUnmount(el, { value }) {
  9945. setDisplay(el, value);
  9946. }
  9947. };
  9948. {
  9949. vShow.name = "show";
  9950. }
  9951. function setDisplay(el, value) {
  9952. el.style.display = value ? el[vShowOriginalDisplay] : "none";
  9953. el[vShowHidden] = !value;
  9954. }
  9955. const CSS_VAR_TEXT = Symbol("CSS_VAR_TEXT" );
  9956. function useCssVars(getter) {
  9957. const instance = getCurrentInstance();
  9958. if (!instance) {
  9959. warn(`useCssVars is called without current active component instance.`);
  9960. return;
  9961. }
  9962. const updateTeleports = instance.ut = (vars = getter(instance.proxy)) => {
  9963. Array.from(
  9964. document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)
  9965. ).forEach((node) => setVarsOnNode(node, vars));
  9966. };
  9967. {
  9968. instance.getCssVars = () => getter(instance.proxy);
  9969. }
  9970. const setVars = () => {
  9971. const vars = getter(instance.proxy);
  9972. setVarsOnVNode(instance.subTree, vars);
  9973. updateTeleports(vars);
  9974. };
  9975. onBeforeMount(() => {
  9976. watchPostEffect(setVars);
  9977. });
  9978. onMounted(() => {
  9979. const ob = new MutationObserver(setVars);
  9980. ob.observe(instance.subTree.el.parentNode, { childList: true });
  9981. onUnmounted(() => ob.disconnect());
  9982. });
  9983. }
  9984. function setVarsOnVNode(vnode, vars) {
  9985. if (vnode.shapeFlag & 128) {
  9986. const suspense = vnode.suspense;
  9987. vnode = suspense.activeBranch;
  9988. if (suspense.pendingBranch && !suspense.isHydrating) {
  9989. suspense.effects.push(() => {
  9990. setVarsOnVNode(suspense.activeBranch, vars);
  9991. });
  9992. }
  9993. }
  9994. while (vnode.component) {
  9995. vnode = vnode.component.subTree;
  9996. }
  9997. if (vnode.shapeFlag & 1 && vnode.el) {
  9998. setVarsOnNode(vnode.el, vars);
  9999. } else if (vnode.type === Fragment) {
  10000. vnode.children.forEach((c) => setVarsOnVNode(c, vars));
  10001. } else if (vnode.type === Static) {
  10002. let { el, anchor } = vnode;
  10003. while (el) {
  10004. setVarsOnNode(el, vars);
  10005. if (el === anchor) break;
  10006. el = el.nextSibling;
  10007. }
  10008. }
  10009. }
  10010. function setVarsOnNode(el, vars) {
  10011. if (el.nodeType === 1) {
  10012. const style = el.style;
  10013. let cssText = "";
  10014. for (const key in vars) {
  10015. style.setProperty(`--${key}`, vars[key]);
  10016. cssText += `--${key}: ${vars[key]};`;
  10017. }
  10018. style[CSS_VAR_TEXT] = cssText;
  10019. }
  10020. }
  10021. const displayRE = /(^|;)\s*display\s*:/;
  10022. function patchStyle(el, prev, next) {
  10023. const style = el.style;
  10024. const isCssString = isString(next);
  10025. let hasControlledDisplay = false;
  10026. if (next && !isCssString) {
  10027. if (prev) {
  10028. if (!isString(prev)) {
  10029. for (const key in prev) {
  10030. if (next[key] == null) {
  10031. setStyle(style, key, "");
  10032. }
  10033. }
  10034. } else {
  10035. for (const prevStyle of prev.split(";")) {
  10036. const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
  10037. if (next[key] == null) {
  10038. setStyle(style, key, "");
  10039. }
  10040. }
  10041. }
  10042. }
  10043. for (const key in next) {
  10044. if (key === "display") {
  10045. hasControlledDisplay = true;
  10046. }
  10047. setStyle(style, key, next[key]);
  10048. }
  10049. } else {
  10050. if (isCssString) {
  10051. if (prev !== next) {
  10052. const cssVarText = style[CSS_VAR_TEXT];
  10053. if (cssVarText) {
  10054. next += ";" + cssVarText;
  10055. }
  10056. style.cssText = next;
  10057. hasControlledDisplay = displayRE.test(next);
  10058. }
  10059. } else if (prev) {
  10060. el.removeAttribute("style");
  10061. }
  10062. }
  10063. if (vShowOriginalDisplay in el) {
  10064. el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
  10065. if (el[vShowHidden]) {
  10066. style.display = "none";
  10067. }
  10068. }
  10069. }
  10070. const semicolonRE = /[^\\];\s*$/;
  10071. const importantRE = /\s*!important$/;
  10072. function setStyle(style, name, val) {
  10073. if (isArray(val)) {
  10074. val.forEach((v) => setStyle(style, name, v));
  10075. } else {
  10076. if (val == null) val = "";
  10077. {
  10078. if (semicolonRE.test(val)) {
  10079. warn(
  10080. `Unexpected semicolon at the end of '${name}' style value: '${val}'`
  10081. );
  10082. }
  10083. }
  10084. if (name.startsWith("--")) {
  10085. style.setProperty(name, val);
  10086. } else {
  10087. const prefixed = autoPrefix(style, name);
  10088. if (importantRE.test(val)) {
  10089. style.setProperty(
  10090. hyphenate(prefixed),
  10091. val.replace(importantRE, ""),
  10092. "important"
  10093. );
  10094. } else {
  10095. style[prefixed] = val;
  10096. }
  10097. }
  10098. }
  10099. }
  10100. const prefixes = ["Webkit", "Moz", "ms"];
  10101. const prefixCache = {};
  10102. function autoPrefix(style, rawName) {
  10103. const cached = prefixCache[rawName];
  10104. if (cached) {
  10105. return cached;
  10106. }
  10107. let name = camelize(rawName);
  10108. if (name !== "filter" && name in style) {
  10109. return prefixCache[rawName] = name;
  10110. }
  10111. name = capitalize(name);
  10112. for (let i = 0; i < prefixes.length; i++) {
  10113. const prefixed = prefixes[i] + name;
  10114. if (prefixed in style) {
  10115. return prefixCache[rawName] = prefixed;
  10116. }
  10117. }
  10118. return rawName;
  10119. }
  10120. const xlinkNS = "http://www.w3.org/1999/xlink";
  10121. function patchAttr(el, key, value, isSVG, instance, isBoolean = isSpecialBooleanAttr(key)) {
  10122. if (isSVG && key.startsWith("xlink:")) {
  10123. if (value == null) {
  10124. el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
  10125. } else {
  10126. el.setAttributeNS(xlinkNS, key, value);
  10127. }
  10128. } else {
  10129. if (value == null || isBoolean && !includeBooleanAttr(value)) {
  10130. el.removeAttribute(key);
  10131. } else {
  10132. el.setAttribute(
  10133. key,
  10134. isBoolean ? "" : isSymbol(value) ? String(value) : value
  10135. );
  10136. }
  10137. }
  10138. }
  10139. function patchDOMProp(el, key, value, parentComponent) {
  10140. if (key === "innerHTML" || key === "textContent") {
  10141. if (value == null) return;
  10142. el[key] = value;
  10143. return;
  10144. }
  10145. const tag = el.tagName;
  10146. if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
  10147. !tag.includes("-")) {
  10148. const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
  10149. const newValue = value == null ? "" : String(value);
  10150. if (oldValue !== newValue || !("_value" in el)) {
  10151. el.value = newValue;
  10152. }
  10153. if (value == null) {
  10154. el.removeAttribute(key);
  10155. }
  10156. el._value = value;
  10157. return;
  10158. }
  10159. let needRemove = false;
  10160. if (value === "" || value == null) {
  10161. const type = typeof el[key];
  10162. if (type === "boolean") {
  10163. value = includeBooleanAttr(value);
  10164. } else if (value == null && type === "string") {
  10165. value = "";
  10166. needRemove = true;
  10167. } else if (type === "number") {
  10168. value = 0;
  10169. needRemove = true;
  10170. }
  10171. }
  10172. try {
  10173. el[key] = value;
  10174. } catch (e) {
  10175. if (!needRemove) {
  10176. warn(
  10177. `Failed setting prop "${key}" on <${tag.toLowerCase()}>: value ${value} is invalid.`,
  10178. e
  10179. );
  10180. }
  10181. }
  10182. needRemove && el.removeAttribute(key);
  10183. }
  10184. function addEventListener(el, event, handler, options) {
  10185. el.addEventListener(event, handler, options);
  10186. }
  10187. function removeEventListener(el, event, handler, options) {
  10188. el.removeEventListener(event, handler, options);
  10189. }
  10190. const veiKey = Symbol("_vei");
  10191. function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
  10192. const invokers = el[veiKey] || (el[veiKey] = {});
  10193. const existingInvoker = invokers[rawName];
  10194. if (nextValue && existingInvoker) {
  10195. existingInvoker.value = sanitizeEventValue(nextValue, rawName) ;
  10196. } else {
  10197. const [name, options] = parseName(rawName);
  10198. if (nextValue) {
  10199. const invoker = invokers[rawName] = createInvoker(
  10200. sanitizeEventValue(nextValue, rawName) ,
  10201. instance
  10202. );
  10203. addEventListener(el, name, invoker, options);
  10204. } else if (existingInvoker) {
  10205. removeEventListener(el, name, existingInvoker, options);
  10206. invokers[rawName] = void 0;
  10207. }
  10208. }
  10209. }
  10210. const optionsModifierRE = /(?:Once|Passive|Capture)$/;
  10211. function parseName(name) {
  10212. let options;
  10213. if (optionsModifierRE.test(name)) {
  10214. options = {};
  10215. let m;
  10216. while (m = name.match(optionsModifierRE)) {
  10217. name = name.slice(0, name.length - m[0].length);
  10218. options[m[0].toLowerCase()] = true;
  10219. }
  10220. }
  10221. const event = name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2));
  10222. return [event, options];
  10223. }
  10224. let cachedNow = 0;
  10225. const p = /* @__PURE__ */ Promise.resolve();
  10226. const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now());
  10227. function createInvoker(initialValue, instance) {
  10228. const invoker = (e) => {
  10229. if (!e._vts) {
  10230. e._vts = Date.now();
  10231. } else if (e._vts <= invoker.attached) {
  10232. return;
  10233. }
  10234. callWithAsyncErrorHandling(
  10235. patchStopImmediatePropagation(e, invoker.value),
  10236. instance,
  10237. 5,
  10238. [e]
  10239. );
  10240. };
  10241. invoker.value = initialValue;
  10242. invoker.attached = getNow();
  10243. return invoker;
  10244. }
  10245. function sanitizeEventValue(value, propName) {
  10246. if (isFunction(value) || isArray(value)) {
  10247. return value;
  10248. }
  10249. warn(
  10250. `Wrong type passed as event handler to ${propName} - did you forget @ or : in front of your prop?
  10251. Expected function or array of functions, received type ${typeof value}.`
  10252. );
  10253. return NOOP;
  10254. }
  10255. function patchStopImmediatePropagation(e, value) {
  10256. if (isArray(value)) {
  10257. const originalStop = e.stopImmediatePropagation;
  10258. e.stopImmediatePropagation = () => {
  10259. originalStop.call(e);
  10260. e._stopped = true;
  10261. };
  10262. return value.map(
  10263. (fn) => (e2) => !e2._stopped && fn && fn(e2)
  10264. );
  10265. } else {
  10266. return value;
  10267. }
  10268. }
  10269. const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
  10270. key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
  10271. const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => {
  10272. const isSVG = namespace === "svg";
  10273. if (key === "class") {
  10274. patchClass(el, nextValue, isSVG);
  10275. } else if (key === "style") {
  10276. patchStyle(el, prevValue, nextValue);
  10277. } else if (isOn(key)) {
  10278. if (!isModelListener(key)) {
  10279. patchEvent(el, key, prevValue, nextValue, parentComponent);
  10280. }
  10281. } else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) {
  10282. patchDOMProp(el, key, nextValue);
  10283. if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) {
  10284. patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value");
  10285. }
  10286. } else {
  10287. if (key === "true-value") {
  10288. el._trueValue = nextValue;
  10289. } else if (key === "false-value") {
  10290. el._falseValue = nextValue;
  10291. }
  10292. patchAttr(el, key, nextValue, isSVG);
  10293. }
  10294. };
  10295. function shouldSetAsProp(el, key, value, isSVG) {
  10296. if (isSVG) {
  10297. if (key === "innerHTML" || key === "textContent") {
  10298. return true;
  10299. }
  10300. if (key in el && isNativeOn(key) && isFunction(value)) {
  10301. return true;
  10302. }
  10303. return false;
  10304. }
  10305. if (key === "spellcheck" || key === "draggable" || key === "translate") {
  10306. return false;
  10307. }
  10308. if (key === "form") {
  10309. return false;
  10310. }
  10311. if (key === "list" && el.tagName === "INPUT") {
  10312. return false;
  10313. }
  10314. if (key === "type" && el.tagName === "TEXTAREA") {
  10315. return false;
  10316. }
  10317. if (key === "width" || key === "height") {
  10318. const tag = el.tagName;
  10319. if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") {
  10320. return false;
  10321. }
  10322. }
  10323. if (isNativeOn(key) && isString(value)) {
  10324. return false;
  10325. }
  10326. return key in el;
  10327. }
  10328. /*! #__NO_SIDE_EFFECTS__ */
  10329. // @__NO_SIDE_EFFECTS__
  10330. function defineCustomElement(options, extraOptions, hydrate2) {
  10331. const Comp = defineComponent(options, extraOptions);
  10332. class VueCustomElement extends VueElement {
  10333. constructor(initialProps) {
  10334. super(Comp, initialProps, hydrate2);
  10335. }
  10336. }
  10337. VueCustomElement.def = Comp;
  10338. return VueCustomElement;
  10339. }
  10340. /*! #__NO_SIDE_EFFECTS__ */
  10341. const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
  10342. return /* @__PURE__ */ defineCustomElement(options, extraOptions, hydrate);
  10343. };
  10344. const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
  10345. };
  10346. class VueElement extends BaseClass {
  10347. constructor(_def, _props = {}, hydrate2) {
  10348. super();
  10349. this._def = _def;
  10350. this._props = _props;
  10351. /**
  10352. * @internal
  10353. */
  10354. this._instance = null;
  10355. this._connected = false;
  10356. this._resolved = false;
  10357. this._numberProps = null;
  10358. this._ob = null;
  10359. if (this.shadowRoot && hydrate2) {
  10360. hydrate2(this._createVNode(), this.shadowRoot);
  10361. } else {
  10362. if (this.shadowRoot) {
  10363. warn(
  10364. `Custom element has pre-rendered declarative shadow root but is not defined as hydratable. Use \`defineSSRCustomElement\`.`
  10365. );
  10366. }
  10367. this.attachShadow({ mode: "open" });
  10368. if (!this._def.__asyncLoader) {
  10369. this._resolveProps(this._def);
  10370. }
  10371. }
  10372. }
  10373. connectedCallback() {
  10374. this._connected = true;
  10375. if (!this._instance) {
  10376. if (this._resolved) {
  10377. this._update();
  10378. } else {
  10379. this._resolveDef();
  10380. }
  10381. }
  10382. }
  10383. disconnectedCallback() {
  10384. this._connected = false;
  10385. nextTick(() => {
  10386. if (!this._connected) {
  10387. if (this._ob) {
  10388. this._ob.disconnect();
  10389. this._ob = null;
  10390. }
  10391. render(null, this.shadowRoot);
  10392. this._instance = null;
  10393. }
  10394. });
  10395. }
  10396. /**
  10397. * resolve inner component definition (handle possible async component)
  10398. */
  10399. _resolveDef() {
  10400. this._resolved = true;
  10401. for (let i = 0; i < this.attributes.length; i++) {
  10402. this._setAttr(this.attributes[i].name);
  10403. }
  10404. this._ob = new MutationObserver((mutations) => {
  10405. for (const m of mutations) {
  10406. this._setAttr(m.attributeName);
  10407. }
  10408. });
  10409. this._ob.observe(this, { attributes: true });
  10410. const resolve = (def, isAsync = false) => {
  10411. const { props, styles } = def;
  10412. let numberProps;
  10413. if (props && !isArray(props)) {
  10414. for (const key in props) {
  10415. const opt = props[key];
  10416. if (opt === Number || opt && opt.type === Number) {
  10417. if (key in this._props) {
  10418. this._props[key] = toNumber(this._props[key]);
  10419. }
  10420. (numberProps || (numberProps = /* @__PURE__ */ Object.create(null)))[camelize(key)] = true;
  10421. }
  10422. }
  10423. }
  10424. this._numberProps = numberProps;
  10425. if (isAsync) {
  10426. this._resolveProps(def);
  10427. }
  10428. this._applyStyles(styles);
  10429. this._update();
  10430. };
  10431. const asyncDef = this._def.__asyncLoader;
  10432. if (asyncDef) {
  10433. asyncDef().then((def) => resolve(def, true));
  10434. } else {
  10435. resolve(this._def);
  10436. }
  10437. }
  10438. _resolveProps(def) {
  10439. const { props } = def;
  10440. const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
  10441. for (const key of Object.keys(this)) {
  10442. if (key[0] !== "_" && declaredPropKeys.includes(key)) {
  10443. this._setProp(key, this[key], true, false);
  10444. }
  10445. }
  10446. for (const key of declaredPropKeys.map(camelize)) {
  10447. Object.defineProperty(this, key, {
  10448. get() {
  10449. return this._getProp(key);
  10450. },
  10451. set(val) {
  10452. this._setProp(key, val);
  10453. }
  10454. });
  10455. }
  10456. }
  10457. _setAttr(key) {
  10458. let value = this.hasAttribute(key) ? this.getAttribute(key) : void 0;
  10459. const camelKey = camelize(key);
  10460. if (this._numberProps && this._numberProps[camelKey]) {
  10461. value = toNumber(value);
  10462. }
  10463. this._setProp(camelKey, value, false);
  10464. }
  10465. /**
  10466. * @internal
  10467. */
  10468. _getProp(key) {
  10469. return this._props[key];
  10470. }
  10471. /**
  10472. * @internal
  10473. */
  10474. _setProp(key, val, shouldReflect = true, shouldUpdate = true) {
  10475. if (val !== this._props[key]) {
  10476. this._props[key] = val;
  10477. if (shouldUpdate && this._instance) {
  10478. this._update();
  10479. }
  10480. if (shouldReflect) {
  10481. if (val === true) {
  10482. this.setAttribute(hyphenate(key), "");
  10483. } else if (typeof val === "string" || typeof val === "number") {
  10484. this.setAttribute(hyphenate(key), val + "");
  10485. } else if (!val) {
  10486. this.removeAttribute(hyphenate(key));
  10487. }
  10488. }
  10489. }
  10490. }
  10491. _update() {
  10492. render(this._createVNode(), this.shadowRoot);
  10493. }
  10494. _createVNode() {
  10495. const vnode = createVNode(this._def, extend({}, this._props));
  10496. if (!this._instance) {
  10497. vnode.ce = (instance) => {
  10498. this._instance = instance;
  10499. instance.isCE = true;
  10500. {
  10501. instance.ceReload = (newStyles) => {
  10502. if (this._styles) {
  10503. this._styles.forEach((s) => this.shadowRoot.removeChild(s));
  10504. this._styles.length = 0;
  10505. }
  10506. this._applyStyles(newStyles);
  10507. this._instance = null;
  10508. this._update();
  10509. };
  10510. }
  10511. const dispatch = (event, args) => {
  10512. this.dispatchEvent(
  10513. new CustomEvent(event, {
  10514. detail: args
  10515. })
  10516. );
  10517. };
  10518. instance.emit = (event, ...args) => {
  10519. dispatch(event, args);
  10520. if (hyphenate(event) !== event) {
  10521. dispatch(hyphenate(event), args);
  10522. }
  10523. };
  10524. let parent = this;
  10525. while (parent = parent && (parent.parentNode || parent.host)) {
  10526. if (parent instanceof VueElement) {
  10527. instance.parent = parent._instance;
  10528. instance.provides = parent._instance.provides;
  10529. break;
  10530. }
  10531. }
  10532. };
  10533. }
  10534. return vnode;
  10535. }
  10536. _applyStyles(styles) {
  10537. if (styles) {
  10538. styles.forEach((css) => {
  10539. const s = document.createElement("style");
  10540. s.textContent = css;
  10541. this.shadowRoot.appendChild(s);
  10542. {
  10543. (this._styles || (this._styles = [])).push(s);
  10544. }
  10545. });
  10546. }
  10547. }
  10548. }
  10549. function useCssModule(name = "$style") {
  10550. {
  10551. const instance = getCurrentInstance();
  10552. if (!instance) {
  10553. warn(`useCssModule must be called inside setup()`);
  10554. return EMPTY_OBJ;
  10555. }
  10556. const modules = instance.type.__cssModules;
  10557. if (!modules) {
  10558. warn(`Current instance does not have CSS modules injected.`);
  10559. return EMPTY_OBJ;
  10560. }
  10561. const mod = modules[name];
  10562. if (!mod) {
  10563. warn(`Current instance does not have CSS module named "${name}".`);
  10564. return EMPTY_OBJ;
  10565. }
  10566. return mod;
  10567. }
  10568. }
  10569. const positionMap = /* @__PURE__ */ new WeakMap();
  10570. const newPositionMap = /* @__PURE__ */ new WeakMap();
  10571. const moveCbKey = Symbol("_moveCb");
  10572. const enterCbKey = Symbol("_enterCb");
  10573. const TransitionGroupImpl = {
  10574. name: "TransitionGroup",
  10575. props: /* @__PURE__ */ extend({}, TransitionPropsValidators, {
  10576. tag: String,
  10577. moveClass: String
  10578. }),
  10579. setup(props, { slots }) {
  10580. const instance = getCurrentInstance();
  10581. const state = useTransitionState();
  10582. let prevChildren;
  10583. let children;
  10584. onUpdated(() => {
  10585. if (!prevChildren.length) {
  10586. return;
  10587. }
  10588. const moveClass = props.moveClass || `${props.name || "v"}-move`;
  10589. if (!hasCSSTransform(
  10590. prevChildren[0].el,
  10591. instance.vnode.el,
  10592. moveClass
  10593. )) {
  10594. return;
  10595. }
  10596. prevChildren.forEach(callPendingCbs);
  10597. prevChildren.forEach(recordPosition);
  10598. const movedChildren = prevChildren.filter(applyTranslation);
  10599. forceReflow();
  10600. movedChildren.forEach((c) => {
  10601. const el = c.el;
  10602. const style = el.style;
  10603. addTransitionClass(el, moveClass);
  10604. style.transform = style.webkitTransform = style.transitionDuration = "";
  10605. const cb = el[moveCbKey] = (e) => {
  10606. if (e && e.target !== el) {
  10607. return;
  10608. }
  10609. if (!e || /transform$/.test(e.propertyName)) {
  10610. el.removeEventListener("transitionend", cb);
  10611. el[moveCbKey] = null;
  10612. removeTransitionClass(el, moveClass);
  10613. }
  10614. };
  10615. el.addEventListener("transitionend", cb);
  10616. });
  10617. });
  10618. return () => {
  10619. const rawProps = toRaw(props);
  10620. const cssTransitionProps = resolveTransitionProps(rawProps);
  10621. let tag = rawProps.tag || Fragment;
  10622. prevChildren = [];
  10623. if (children) {
  10624. for (let i = 0; i < children.length; i++) {
  10625. const child = children[i];
  10626. if (child.el && child.el instanceof Element) {
  10627. prevChildren.push(child);
  10628. setTransitionHooks(
  10629. child,
  10630. resolveTransitionHooks(
  10631. child,
  10632. cssTransitionProps,
  10633. state,
  10634. instance
  10635. )
  10636. );
  10637. positionMap.set(
  10638. child,
  10639. child.el.getBoundingClientRect()
  10640. );
  10641. }
  10642. }
  10643. }
  10644. children = slots.default ? getTransitionRawChildren(slots.default()) : [];
  10645. for (let i = 0; i < children.length; i++) {
  10646. const child = children[i];
  10647. if (child.key != null) {
  10648. setTransitionHooks(
  10649. child,
  10650. resolveTransitionHooks(child, cssTransitionProps, state, instance)
  10651. );
  10652. } else {
  10653. warn(`<TransitionGroup> children must be keyed.`);
  10654. }
  10655. }
  10656. return createVNode(tag, null, children);
  10657. };
  10658. }
  10659. };
  10660. const removeMode = (props) => delete props.mode;
  10661. /* @__PURE__ */ removeMode(TransitionGroupImpl.props);
  10662. const TransitionGroup = TransitionGroupImpl;
  10663. function callPendingCbs(c) {
  10664. const el = c.el;
  10665. if (el[moveCbKey]) {
  10666. el[moveCbKey]();
  10667. }
  10668. if (el[enterCbKey]) {
  10669. el[enterCbKey]();
  10670. }
  10671. }
  10672. function recordPosition(c) {
  10673. newPositionMap.set(c, c.el.getBoundingClientRect());
  10674. }
  10675. function applyTranslation(c) {
  10676. const oldPos = positionMap.get(c);
  10677. const newPos = newPositionMap.get(c);
  10678. const dx = oldPos.left - newPos.left;
  10679. const dy = oldPos.top - newPos.top;
  10680. if (dx || dy) {
  10681. const s = c.el.style;
  10682. s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`;
  10683. s.transitionDuration = "0s";
  10684. return c;
  10685. }
  10686. }
  10687. function hasCSSTransform(el, root, moveClass) {
  10688. const clone = el.cloneNode();
  10689. const _vtc = el[vtcKey];
  10690. if (_vtc) {
  10691. _vtc.forEach((cls) => {
  10692. cls.split(/\s+/).forEach((c) => c && clone.classList.remove(c));
  10693. });
  10694. }
  10695. moveClass.split(/\s+/).forEach((c) => c && clone.classList.add(c));
  10696. clone.style.display = "none";
  10697. const container = root.nodeType === 1 ? root : root.parentNode;
  10698. container.appendChild(clone);
  10699. const { hasTransform } = getTransitionInfo(clone);
  10700. container.removeChild(clone);
  10701. return hasTransform;
  10702. }
  10703. const getModelAssigner = (vnode) => {
  10704. const fn = vnode.props["onUpdate:modelValue"] || false;
  10705. return isArray(fn) ? (value) => invokeArrayFns(fn, value) : fn;
  10706. };
  10707. function onCompositionStart(e) {
  10708. e.target.composing = true;
  10709. }
  10710. function onCompositionEnd(e) {
  10711. const target = e.target;
  10712. if (target.composing) {
  10713. target.composing = false;
  10714. target.dispatchEvent(new Event("input"));
  10715. }
  10716. }
  10717. const assignKey = Symbol("_assign");
  10718. const vModelText = {
  10719. created(el, { modifiers: { lazy, trim, number } }, vnode) {
  10720. el[assignKey] = getModelAssigner(vnode);
  10721. const castToNumber = number || vnode.props && vnode.props.type === "number";
  10722. addEventListener(el, lazy ? "change" : "input", (e) => {
  10723. if (e.target.composing) return;
  10724. let domValue = el.value;
  10725. if (trim) {
  10726. domValue = domValue.trim();
  10727. }
  10728. if (castToNumber) {
  10729. domValue = looseToNumber(domValue);
  10730. }
  10731. el[assignKey](domValue);
  10732. });
  10733. if (trim) {
  10734. addEventListener(el, "change", () => {
  10735. el.value = el.value.trim();
  10736. });
  10737. }
  10738. if (!lazy) {
  10739. addEventListener(el, "compositionstart", onCompositionStart);
  10740. addEventListener(el, "compositionend", onCompositionEnd);
  10741. addEventListener(el, "change", onCompositionEnd);
  10742. }
  10743. },
  10744. // set value on mounted so it's after min/max for type="range"
  10745. mounted(el, { value }) {
  10746. el.value = value == null ? "" : value;
  10747. },
  10748. beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
  10749. el[assignKey] = getModelAssigner(vnode);
  10750. if (el.composing) return;
  10751. const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? looseToNumber(el.value) : el.value;
  10752. const newValue = value == null ? "" : value;
  10753. if (elValue === newValue) {
  10754. return;
  10755. }
  10756. if (document.activeElement === el && el.type !== "range") {
  10757. if (lazy && value === oldValue) {
  10758. return;
  10759. }
  10760. if (trim && el.value.trim() === newValue) {
  10761. return;
  10762. }
  10763. }
  10764. el.value = newValue;
  10765. }
  10766. };
  10767. const vModelCheckbox = {
  10768. // #4096 array checkboxes need to be deep traversed
  10769. deep: true,
  10770. created(el, _, vnode) {
  10771. el[assignKey] = getModelAssigner(vnode);
  10772. addEventListener(el, "change", () => {
  10773. const modelValue = el._modelValue;
  10774. const elementValue = getValue(el);
  10775. const checked = el.checked;
  10776. const assign = el[assignKey];
  10777. if (isArray(modelValue)) {
  10778. const index = looseIndexOf(modelValue, elementValue);
  10779. const found = index !== -1;
  10780. if (checked && !found) {
  10781. assign(modelValue.concat(elementValue));
  10782. } else if (!checked && found) {
  10783. const filtered = [...modelValue];
  10784. filtered.splice(index, 1);
  10785. assign(filtered);
  10786. }
  10787. } else if (isSet(modelValue)) {
  10788. const cloned = new Set(modelValue);
  10789. if (checked) {
  10790. cloned.add(elementValue);
  10791. } else {
  10792. cloned.delete(elementValue);
  10793. }
  10794. assign(cloned);
  10795. } else {
  10796. assign(getCheckboxValue(el, checked));
  10797. }
  10798. });
  10799. },
  10800. // set initial checked on mount to wait for true-value/false-value
  10801. mounted: setChecked,
  10802. beforeUpdate(el, binding, vnode) {
  10803. el[assignKey] = getModelAssigner(vnode);
  10804. setChecked(el, binding, vnode);
  10805. }
  10806. };
  10807. function setChecked(el, { value, oldValue }, vnode) {
  10808. el._modelValue = value;
  10809. if (isArray(value)) {
  10810. el.checked = looseIndexOf(value, vnode.props.value) > -1;
  10811. } else if (isSet(value)) {
  10812. el.checked = value.has(vnode.props.value);
  10813. } else if (value !== oldValue) {
  10814. el.checked = looseEqual(value, getCheckboxValue(el, true));
  10815. }
  10816. }
  10817. const vModelRadio = {
  10818. created(el, { value }, vnode) {
  10819. el.checked = looseEqual(value, vnode.props.value);
  10820. el[assignKey] = getModelAssigner(vnode);
  10821. addEventListener(el, "change", () => {
  10822. el[assignKey](getValue(el));
  10823. });
  10824. },
  10825. beforeUpdate(el, { value, oldValue }, vnode) {
  10826. el[assignKey] = getModelAssigner(vnode);
  10827. if (value !== oldValue) {
  10828. el.checked = looseEqual(value, vnode.props.value);
  10829. }
  10830. }
  10831. };
  10832. const vModelSelect = {
  10833. // <select multiple> value need to be deep traversed
  10834. deep: true,
  10835. created(el, { value, modifiers: { number } }, vnode) {
  10836. const isSetModel = isSet(value);
  10837. addEventListener(el, "change", () => {
  10838. const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
  10839. (o) => number ? looseToNumber(getValue(o)) : getValue(o)
  10840. );
  10841. el[assignKey](
  10842. el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]
  10843. );
  10844. el._assigning = true;
  10845. nextTick(() => {
  10846. el._assigning = false;
  10847. });
  10848. });
  10849. el[assignKey] = getModelAssigner(vnode);
  10850. },
  10851. // set value in mounted & updated because <select> relies on its children
  10852. // <option>s.
  10853. mounted(el, { value, modifiers: { number } }) {
  10854. setSelected(el, value);
  10855. },
  10856. beforeUpdate(el, _binding, vnode) {
  10857. el[assignKey] = getModelAssigner(vnode);
  10858. },
  10859. updated(el, { value, modifiers: { number } }) {
  10860. if (!el._assigning) {
  10861. setSelected(el, value);
  10862. }
  10863. }
  10864. };
  10865. function setSelected(el, value, number) {
  10866. const isMultiple = el.multiple;
  10867. const isArrayValue = isArray(value);
  10868. if (isMultiple && !isArrayValue && !isSet(value)) {
  10869. warn(
  10870. `<select multiple v-model> expects an Array or Set value for its binding, but got ${Object.prototype.toString.call(value).slice(8, -1)}.`
  10871. );
  10872. return;
  10873. }
  10874. for (let i = 0, l = el.options.length; i < l; i++) {
  10875. const option = el.options[i];
  10876. const optionValue = getValue(option);
  10877. if (isMultiple) {
  10878. if (isArrayValue) {
  10879. const optionType = typeof optionValue;
  10880. if (optionType === "string" || optionType === "number") {
  10881. option.selected = value.some((v) => String(v) === String(optionValue));
  10882. } else {
  10883. option.selected = looseIndexOf(value, optionValue) > -1;
  10884. }
  10885. } else {
  10886. option.selected = value.has(optionValue);
  10887. }
  10888. } else if (looseEqual(getValue(option), value)) {
  10889. if (el.selectedIndex !== i) el.selectedIndex = i;
  10890. return;
  10891. }
  10892. }
  10893. if (!isMultiple && el.selectedIndex !== -1) {
  10894. el.selectedIndex = -1;
  10895. }
  10896. }
  10897. function getValue(el) {
  10898. return "_value" in el ? el._value : el.value;
  10899. }
  10900. function getCheckboxValue(el, checked) {
  10901. const key = checked ? "_trueValue" : "_falseValue";
  10902. return key in el ? el[key] : checked;
  10903. }
  10904. const vModelDynamic = {
  10905. created(el, binding, vnode) {
  10906. callModelHook(el, binding, vnode, null, "created");
  10907. },
  10908. mounted(el, binding, vnode) {
  10909. callModelHook(el, binding, vnode, null, "mounted");
  10910. },
  10911. beforeUpdate(el, binding, vnode, prevVNode) {
  10912. callModelHook(el, binding, vnode, prevVNode, "beforeUpdate");
  10913. },
  10914. updated(el, binding, vnode, prevVNode) {
  10915. callModelHook(el, binding, vnode, prevVNode, "updated");
  10916. }
  10917. };
  10918. function resolveDynamicModel(tagName, type) {
  10919. switch (tagName) {
  10920. case "SELECT":
  10921. return vModelSelect;
  10922. case "TEXTAREA":
  10923. return vModelText;
  10924. default:
  10925. switch (type) {
  10926. case "checkbox":
  10927. return vModelCheckbox;
  10928. case "radio":
  10929. return vModelRadio;
  10930. default:
  10931. return vModelText;
  10932. }
  10933. }
  10934. }
  10935. function callModelHook(el, binding, vnode, prevVNode, hook) {
  10936. const modelToUse = resolveDynamicModel(
  10937. el.tagName,
  10938. vnode.props && vnode.props.type
  10939. );
  10940. const fn = modelToUse[hook];
  10941. fn && fn(el, binding, vnode, prevVNode);
  10942. }
  10943. const systemModifiers = ["ctrl", "shift", "alt", "meta"];
  10944. const modifierGuards = {
  10945. stop: (e) => e.stopPropagation(),
  10946. prevent: (e) => e.preventDefault(),
  10947. self: (e) => e.target !== e.currentTarget,
  10948. ctrl: (e) => !e.ctrlKey,
  10949. shift: (e) => !e.shiftKey,
  10950. alt: (e) => !e.altKey,
  10951. meta: (e) => !e.metaKey,
  10952. left: (e) => "button" in e && e.button !== 0,
  10953. middle: (e) => "button" in e && e.button !== 1,
  10954. right: (e) => "button" in e && e.button !== 2,
  10955. exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
  10956. };
  10957. const withModifiers = (fn, modifiers) => {
  10958. const cache = fn._withMods || (fn._withMods = {});
  10959. const cacheKey = modifiers.join(".");
  10960. return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => {
  10961. for (let i = 0; i < modifiers.length; i++) {
  10962. const guard = modifierGuards[modifiers[i]];
  10963. if (guard && guard(event, modifiers)) return;
  10964. }
  10965. return fn(event, ...args);
  10966. });
  10967. };
  10968. const keyNames = {
  10969. esc: "escape",
  10970. space: " ",
  10971. up: "arrow-up",
  10972. left: "arrow-left",
  10973. right: "arrow-right",
  10974. down: "arrow-down",
  10975. delete: "backspace"
  10976. };
  10977. const withKeys = (fn, modifiers) => {
  10978. const cache = fn._withKeys || (fn._withKeys = {});
  10979. const cacheKey = modifiers.join(".");
  10980. return cache[cacheKey] || (cache[cacheKey] = (event) => {
  10981. if (!("key" in event)) {
  10982. return;
  10983. }
  10984. const eventKey = hyphenate(event.key);
  10985. if (modifiers.some((k) => k === eventKey || keyNames[k] === eventKey)) {
  10986. return fn(event);
  10987. }
  10988. });
  10989. };
  10990. const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
  10991. let renderer;
  10992. let enabledHydration = false;
  10993. function ensureRenderer() {
  10994. return renderer || (renderer = createRenderer(rendererOptions));
  10995. }
  10996. function ensureHydrationRenderer() {
  10997. renderer = enabledHydration ? renderer : createHydrationRenderer(rendererOptions);
  10998. enabledHydration = true;
  10999. return renderer;
  11000. }
  11001. const render = (...args) => {
  11002. ensureRenderer().render(...args);
  11003. };
  11004. const hydrate = (...args) => {
  11005. ensureHydrationRenderer().hydrate(...args);
  11006. };
  11007. const createApp = (...args) => {
  11008. const app = ensureRenderer().createApp(...args);
  11009. {
  11010. injectNativeTagCheck(app);
  11011. injectCompilerOptionsCheck(app);
  11012. }
  11013. const { mount } = app;
  11014. app.mount = (containerOrSelector) => {
  11015. const container = normalizeContainer(containerOrSelector);
  11016. if (!container) return;
  11017. const component = app._component;
  11018. if (!isFunction(component) && !component.render && !component.template) {
  11019. component.template = container.innerHTML;
  11020. }
  11021. container.innerHTML = "";
  11022. const proxy = mount(container, false, resolveRootNamespace(container));
  11023. if (container instanceof Element) {
  11024. container.removeAttribute("v-cloak");
  11025. container.setAttribute("data-v-app", "");
  11026. }
  11027. return proxy;
  11028. };
  11029. return app;
  11030. };
  11031. const createSSRApp = (...args) => {
  11032. const app = ensureHydrationRenderer().createApp(...args);
  11033. {
  11034. injectNativeTagCheck(app);
  11035. injectCompilerOptionsCheck(app);
  11036. }
  11037. const { mount } = app;
  11038. app.mount = (containerOrSelector) => {
  11039. const container = normalizeContainer(containerOrSelector);
  11040. if (container) {
  11041. return mount(container, true, resolveRootNamespace(container));
  11042. }
  11043. };
  11044. return app;
  11045. };
  11046. function resolveRootNamespace(container) {
  11047. if (container instanceof SVGElement) {
  11048. return "svg";
  11049. }
  11050. if (typeof MathMLElement === "function" && container instanceof MathMLElement) {
  11051. return "mathml";
  11052. }
  11053. }
  11054. function injectNativeTagCheck(app) {
  11055. Object.defineProperty(app.config, "isNativeTag", {
  11056. value: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag),
  11057. writable: false
  11058. });
  11059. }
  11060. function injectCompilerOptionsCheck(app) {
  11061. if (isRuntimeOnly()) {
  11062. const isCustomElement = app.config.isCustomElement;
  11063. Object.defineProperty(app.config, "isCustomElement", {
  11064. get() {
  11065. return isCustomElement;
  11066. },
  11067. set() {
  11068. warn(
  11069. `The \`isCustomElement\` config option is deprecated. Use \`compilerOptions.isCustomElement\` instead.`
  11070. );
  11071. }
  11072. });
  11073. const compilerOptions = app.config.compilerOptions;
  11074. const msg = `The \`compilerOptions\` config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, \`compilerOptions\` must be passed to \`@vue/compiler-dom\` in the build setup instead.
  11075. - For vue-loader: pass it via vue-loader's \`compilerOptions\` loader option.
  11076. - For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader
  11077. - For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-sfc`;
  11078. Object.defineProperty(app.config, "compilerOptions", {
  11079. get() {
  11080. warn(msg);
  11081. return compilerOptions;
  11082. },
  11083. set() {
  11084. warn(msg);
  11085. }
  11086. });
  11087. }
  11088. }
  11089. function normalizeContainer(container) {
  11090. if (isString(container)) {
  11091. const res = document.querySelector(container);
  11092. if (!res) {
  11093. warn(
  11094. `Failed to mount app: mount target selector "${container}" returned null.`
  11095. );
  11096. }
  11097. return res;
  11098. }
  11099. if (window.ShadowRoot && container instanceof window.ShadowRoot && container.mode === "closed") {
  11100. warn(
  11101. `mounting on a ShadowRoot with \`{mode: "closed"}\` may lead to unpredictable bugs`
  11102. );
  11103. }
  11104. return container;
  11105. }
  11106. const initDirectivesForSSR = NOOP;
  11107. function initDev() {
  11108. {
  11109. {
  11110. console.info(
  11111. `You are running a development build of Vue.
  11112. Make sure to use the production build (*.prod.js) when deploying for production.`
  11113. );
  11114. }
  11115. initCustomFormatter();
  11116. }
  11117. }
  11118. {
  11119. initDev();
  11120. }
  11121. const compile = () => {
  11122. {
  11123. warn(
  11124. `Runtime compilation is not supported in this build of Vue.` + (` Use "vue.esm-browser.js" instead.` )
  11125. );
  11126. }
  11127. };
  11128. export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, TrackOpTypes, Transition, TransitionGroup, TriggerOpTypes, VueElement, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, compile, computed, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrate, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toValue, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useModel, useSSRContext, useSlots, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };