vue.runtime.esm.js 298 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825
  1. /*!
  2. * Vue.js v2.7.16
  3. * (c) 2014-2023 Evan You
  4. * Released under the MIT License.
  5. */
  6. var emptyObject = Object.freeze({});
  7. var isArray = Array.isArray;
  8. // These helpers produce better VM code in JS engines due to their
  9. // explicitness and function inlining.
  10. function isUndef(v) {
  11. return v === undefined || v === null;
  12. }
  13. function isDef(v) {
  14. return v !== undefined && v !== null;
  15. }
  16. function isTrue(v) {
  17. return v === true;
  18. }
  19. function isFalse(v) {
  20. return v === false;
  21. }
  22. /**
  23. * Check if value is primitive.
  24. */
  25. function isPrimitive(value) {
  26. return (typeof value === 'string' ||
  27. typeof value === 'number' ||
  28. // $flow-disable-line
  29. typeof value === 'symbol' ||
  30. typeof value === 'boolean');
  31. }
  32. function isFunction(value) {
  33. return typeof value === 'function';
  34. }
  35. /**
  36. * Quick object check - this is primarily used to tell
  37. * objects from primitive values when we know the value
  38. * is a JSON-compliant type.
  39. */
  40. function isObject(obj) {
  41. return obj !== null && typeof obj === 'object';
  42. }
  43. /**
  44. * Get the raw type string of a value, e.g., [object Object].
  45. */
  46. var _toString = Object.prototype.toString;
  47. function toRawType(value) {
  48. return _toString.call(value).slice(8, -1);
  49. }
  50. /**
  51. * Strict object type check. Only returns true
  52. * for plain JavaScript objects.
  53. */
  54. function isPlainObject(obj) {
  55. return _toString.call(obj) === '[object Object]';
  56. }
  57. function isRegExp(v) {
  58. return _toString.call(v) === '[object RegExp]';
  59. }
  60. /**
  61. * Check if val is a valid array index.
  62. */
  63. function isValidArrayIndex(val) {
  64. var n = parseFloat(String(val));
  65. return n >= 0 && Math.floor(n) === n && isFinite(val);
  66. }
  67. function isPromise(val) {
  68. return (isDef(val) &&
  69. typeof val.then === 'function' &&
  70. typeof val.catch === 'function');
  71. }
  72. /**
  73. * Convert a value to a string that is actually rendered.
  74. */
  75. function toString(val) {
  76. return val == null
  77. ? ''
  78. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  79. ? JSON.stringify(val, replacer, 2)
  80. : String(val);
  81. }
  82. function replacer(_key, val) {
  83. // avoid circular deps from v3
  84. if (val && val.__v_isRef) {
  85. return val.value;
  86. }
  87. return val;
  88. }
  89. /**
  90. * Convert an input value to a number for persistence.
  91. * If the conversion fails, return original string.
  92. */
  93. function toNumber(val) {
  94. var n = parseFloat(val);
  95. return isNaN(n) ? val : n;
  96. }
  97. /**
  98. * Make a map and return a function for checking if a key
  99. * is in that map.
  100. */
  101. function makeMap(str, expectsLowerCase) {
  102. var map = Object.create(null);
  103. var list = str.split(',');
  104. for (var i = 0; i < list.length; i++) {
  105. map[list[i]] = true;
  106. }
  107. return expectsLowerCase ? function (val) { return map[val.toLowerCase()]; } : function (val) { return map[val]; };
  108. }
  109. /**
  110. * Check if a tag is a built-in tag.
  111. */
  112. var isBuiltInTag = makeMap('slot,component', true);
  113. /**
  114. * Check if an attribute is a reserved attribute.
  115. */
  116. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  117. /**
  118. * Remove an item from an array.
  119. */
  120. function remove$2(arr, item) {
  121. var len = arr.length;
  122. if (len) {
  123. // fast path for the only / last item
  124. if (item === arr[len - 1]) {
  125. arr.length = len - 1;
  126. return;
  127. }
  128. var index = arr.indexOf(item);
  129. if (index > -1) {
  130. return arr.splice(index, 1);
  131. }
  132. }
  133. }
  134. /**
  135. * Check whether an object has the property.
  136. */
  137. var hasOwnProperty = Object.prototype.hasOwnProperty;
  138. function hasOwn(obj, key) {
  139. return hasOwnProperty.call(obj, key);
  140. }
  141. /**
  142. * Create a cached version of a pure function.
  143. */
  144. function cached(fn) {
  145. var cache = Object.create(null);
  146. return function cachedFn(str) {
  147. var hit = cache[str];
  148. return hit || (cache[str] = fn(str));
  149. };
  150. }
  151. /**
  152. * Camelize a hyphen-delimited string.
  153. */
  154. var camelizeRE = /-(\w)/g;
  155. var camelize = cached(function (str) {
  156. return str.replace(camelizeRE, function (_, c) { return (c ? c.toUpperCase() : ''); });
  157. });
  158. /**
  159. * Capitalize a string.
  160. */
  161. var capitalize = cached(function (str) {
  162. return str.charAt(0).toUpperCase() + str.slice(1);
  163. });
  164. /**
  165. * Hyphenate a camelCase string.
  166. */
  167. var hyphenateRE = /\B([A-Z])/g;
  168. var hyphenate = cached(function (str) {
  169. return str.replace(hyphenateRE, '-$1').toLowerCase();
  170. });
  171. /**
  172. * Simple bind polyfill for environments that do not support it,
  173. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  174. * since native bind is now performant enough in most browsers.
  175. * But removing it would mean breaking code that was able to run in
  176. * PhantomJS 1.x, so this must be kept for backward compatibility.
  177. */
  178. /* istanbul ignore next */
  179. function polyfillBind(fn, ctx) {
  180. function boundFn(a) {
  181. var l = arguments.length;
  182. return l
  183. ? l > 1
  184. ? fn.apply(ctx, arguments)
  185. : fn.call(ctx, a)
  186. : fn.call(ctx);
  187. }
  188. boundFn._length = fn.length;
  189. return boundFn;
  190. }
  191. function nativeBind(fn, ctx) {
  192. return fn.bind(ctx);
  193. }
  194. // @ts-expect-error bind cannot be `undefined`
  195. var bind = Function.prototype.bind ? nativeBind : polyfillBind;
  196. /**
  197. * Convert an Array-like object to a real Array.
  198. */
  199. function toArray(list, start) {
  200. start = start || 0;
  201. var i = list.length - start;
  202. var ret = new Array(i);
  203. while (i--) {
  204. ret[i] = list[i + start];
  205. }
  206. return ret;
  207. }
  208. /**
  209. * Mix properties into target object.
  210. */
  211. function extend(to, _from) {
  212. for (var key in _from) {
  213. to[key] = _from[key];
  214. }
  215. return to;
  216. }
  217. /**
  218. * Merge an Array of Objects into a single Object.
  219. */
  220. function toObject(arr) {
  221. var res = {};
  222. for (var i = 0; i < arr.length; i++) {
  223. if (arr[i]) {
  224. extend(res, arr[i]);
  225. }
  226. }
  227. return res;
  228. }
  229. /* eslint-disable no-unused-vars */
  230. /**
  231. * Perform no operation.
  232. * Stubbing args to make Flow happy without leaving useless transpiled code
  233. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  234. */
  235. function noop(a, b, c) { }
  236. /**
  237. * Always return false.
  238. */
  239. var no = function (a, b, c) { return false; };
  240. /* eslint-enable no-unused-vars */
  241. /**
  242. * Return the same value.
  243. */
  244. var identity = function (_) { return _; };
  245. /**
  246. * Check if two values are loosely equal - that is,
  247. * if they are plain objects, do they have the same shape?
  248. */
  249. function looseEqual(a, b) {
  250. if (a === b)
  251. return true;
  252. var isObjectA = isObject(a);
  253. var isObjectB = isObject(b);
  254. if (isObjectA && isObjectB) {
  255. try {
  256. var isArrayA = Array.isArray(a);
  257. var isArrayB = Array.isArray(b);
  258. if (isArrayA && isArrayB) {
  259. return (a.length === b.length &&
  260. a.every(function (e, i) {
  261. return looseEqual(e, b[i]);
  262. }));
  263. }
  264. else if (a instanceof Date && b instanceof Date) {
  265. return a.getTime() === b.getTime();
  266. }
  267. else if (!isArrayA && !isArrayB) {
  268. var keysA = Object.keys(a);
  269. var keysB = Object.keys(b);
  270. return (keysA.length === keysB.length &&
  271. keysA.every(function (key) {
  272. return looseEqual(a[key], b[key]);
  273. }));
  274. }
  275. else {
  276. /* istanbul ignore next */
  277. return false;
  278. }
  279. }
  280. catch (e) {
  281. /* istanbul ignore next */
  282. return false;
  283. }
  284. }
  285. else if (!isObjectA && !isObjectB) {
  286. return String(a) === String(b);
  287. }
  288. else {
  289. return false;
  290. }
  291. }
  292. /**
  293. * Return the first index at which a loosely equal value can be
  294. * found in the array (if value is a plain object, the array must
  295. * contain an object of the same shape), or -1 if it is not present.
  296. */
  297. function looseIndexOf(arr, val) {
  298. for (var i = 0; i < arr.length; i++) {
  299. if (looseEqual(arr[i], val))
  300. return i;
  301. }
  302. return -1;
  303. }
  304. /**
  305. * Ensure a function is called only once.
  306. */
  307. function once(fn) {
  308. var called = false;
  309. return function () {
  310. if (!called) {
  311. called = true;
  312. fn.apply(this, arguments);
  313. }
  314. };
  315. }
  316. // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is#polyfill
  317. function hasChanged(x, y) {
  318. if (x === y) {
  319. return x === 0 && 1 / x !== 1 / y;
  320. }
  321. else {
  322. return x === x || y === y;
  323. }
  324. }
  325. var SSR_ATTR = 'data-server-rendered';
  326. var ASSET_TYPES = ['component', 'directive', 'filter'];
  327. var LIFECYCLE_HOOKS = [
  328. 'beforeCreate',
  329. 'created',
  330. 'beforeMount',
  331. 'mounted',
  332. 'beforeUpdate',
  333. 'updated',
  334. 'beforeDestroy',
  335. 'destroyed',
  336. 'activated',
  337. 'deactivated',
  338. 'errorCaptured',
  339. 'serverPrefetch',
  340. 'renderTracked',
  341. 'renderTriggered'
  342. ];
  343. var config = {
  344. /**
  345. * Option merge strategies (used in core/util/options)
  346. */
  347. // $flow-disable-line
  348. optionMergeStrategies: Object.create(null),
  349. /**
  350. * Whether to suppress warnings.
  351. */
  352. silent: false,
  353. /**
  354. * Show production mode tip message on boot?
  355. */
  356. productionTip: process.env.NODE_ENV !== 'production',
  357. /**
  358. * Whether to enable devtools
  359. */
  360. devtools: process.env.NODE_ENV !== 'production',
  361. /**
  362. * Whether to record perf
  363. */
  364. performance: false,
  365. /**
  366. * Error handler for watcher errors
  367. */
  368. errorHandler: null,
  369. /**
  370. * Warn handler for watcher warns
  371. */
  372. warnHandler: null,
  373. /**
  374. * Ignore certain custom elements
  375. */
  376. ignoredElements: [],
  377. /**
  378. * Custom user key aliases for v-on
  379. */
  380. // $flow-disable-line
  381. keyCodes: Object.create(null),
  382. /**
  383. * Check if a tag is reserved so that it cannot be registered as a
  384. * component. This is platform-dependent and may be overwritten.
  385. */
  386. isReservedTag: no,
  387. /**
  388. * Check if an attribute is reserved so that it cannot be used as a component
  389. * prop. This is platform-dependent and may be overwritten.
  390. */
  391. isReservedAttr: no,
  392. /**
  393. * Check if a tag is an unknown element.
  394. * Platform-dependent.
  395. */
  396. isUnknownElement: no,
  397. /**
  398. * Get the namespace of an element
  399. */
  400. getTagNamespace: noop,
  401. /**
  402. * Parse the real tag name for the specific platform.
  403. */
  404. parsePlatformTagName: identity,
  405. /**
  406. * Check if an attribute must be bound using property, e.g. value
  407. * Platform-dependent.
  408. */
  409. mustUseProp: no,
  410. /**
  411. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  412. * This will significantly reduce performance if set to false.
  413. */
  414. async: true,
  415. /**
  416. * Exposed for legacy reasons
  417. */
  418. _lifecycleHooks: LIFECYCLE_HOOKS
  419. };
  420. /**
  421. * unicode letters used for parsing html tags, component names and property paths.
  422. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  423. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  424. */
  425. var unicodeRegExp = /a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;
  426. /**
  427. * Check if a string starts with $ or _
  428. */
  429. function isReserved(str) {
  430. var c = (str + '').charCodeAt(0);
  431. return c === 0x24 || c === 0x5f;
  432. }
  433. /**
  434. * Define a property.
  435. */
  436. function def(obj, key, val, enumerable) {
  437. Object.defineProperty(obj, key, {
  438. value: val,
  439. enumerable: !!enumerable,
  440. writable: true,
  441. configurable: true
  442. });
  443. }
  444. /**
  445. * Parse simple path.
  446. */
  447. var bailRE = new RegExp("[^".concat(unicodeRegExp.source, ".$_\\d]"));
  448. function parsePath(path) {
  449. if (bailRE.test(path)) {
  450. return;
  451. }
  452. var segments = path.split('.');
  453. return function (obj) {
  454. for (var i = 0; i < segments.length; i++) {
  455. if (!obj)
  456. return;
  457. obj = obj[segments[i]];
  458. }
  459. return obj;
  460. };
  461. }
  462. // can we use __proto__?
  463. var hasProto = '__proto__' in {};
  464. // Browser environment sniffing
  465. var inBrowser = typeof window !== 'undefined';
  466. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  467. var isIE = UA && /msie|trident/.test(UA);
  468. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  469. var isEdge = UA && UA.indexOf('edge/') > 0;
  470. UA && UA.indexOf('android') > 0;
  471. var isIOS = UA && /iphone|ipad|ipod|ios/.test(UA);
  472. UA && /chrome\/\d+/.test(UA) && !isEdge;
  473. UA && /phantomjs/.test(UA);
  474. var isFF = UA && UA.match(/firefox\/(\d+)/);
  475. // Firefox has a "watch" function on Object.prototype...
  476. // @ts-expect-error firebox support
  477. var nativeWatch = {}.watch;
  478. var supportsPassive = false;
  479. if (inBrowser) {
  480. try {
  481. var opts = {};
  482. Object.defineProperty(opts, 'passive', {
  483. get: function () {
  484. /* istanbul ignore next */
  485. supportsPassive = true;
  486. }
  487. }); // https://github.com/facebook/flow/issues/285
  488. window.addEventListener('test-passive', null, opts);
  489. }
  490. catch (e) { }
  491. }
  492. // this needs to be lazy-evaled because vue may be required before
  493. // vue-server-renderer can set VUE_ENV
  494. var _isServer;
  495. var isServerRendering = function () {
  496. if (_isServer === undefined) {
  497. /* istanbul ignore if */
  498. if (!inBrowser && typeof global !== 'undefined') {
  499. // detect presence of vue-server-renderer and avoid
  500. // Webpack shimming the process
  501. _isServer =
  502. global['process'] && global['process'].env.VUE_ENV === 'server';
  503. }
  504. else {
  505. _isServer = false;
  506. }
  507. }
  508. return _isServer;
  509. };
  510. // detect devtools
  511. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  512. /* istanbul ignore next */
  513. function isNative(Ctor) {
  514. return typeof Ctor === 'function' && /native code/.test(Ctor.toString());
  515. }
  516. var hasSymbol = typeof Symbol !== 'undefined' &&
  517. isNative(Symbol) &&
  518. typeof Reflect !== 'undefined' &&
  519. isNative(Reflect.ownKeys);
  520. var _Set; // $flow-disable-line
  521. /* istanbul ignore if */ if (typeof Set !== 'undefined' && isNative(Set)) {
  522. // use native Set when available.
  523. _Set = Set;
  524. }
  525. else {
  526. // a non-standard Set polyfill that only works with primitive keys.
  527. _Set = /** @class */ (function () {
  528. function Set() {
  529. this.set = Object.create(null);
  530. }
  531. Set.prototype.has = function (key) {
  532. return this.set[key] === true;
  533. };
  534. Set.prototype.add = function (key) {
  535. this.set[key] = true;
  536. };
  537. Set.prototype.clear = function () {
  538. this.set = Object.create(null);
  539. };
  540. return Set;
  541. }());
  542. }
  543. var currentInstance = null;
  544. /**
  545. * This is exposed for compatibility with v3 (e.g. some functions in VueUse
  546. * relies on it). Do not use this internally, just use `currentInstance`.
  547. *
  548. * @internal this function needs manual type declaration because it relies
  549. * on previously manually authored types from Vue 2
  550. */
  551. function getCurrentInstance() {
  552. return currentInstance && { proxy: currentInstance };
  553. }
  554. /**
  555. * @internal
  556. */
  557. function setCurrentInstance(vm) {
  558. if (vm === void 0) { vm = null; }
  559. if (!vm)
  560. currentInstance && currentInstance._scope.off();
  561. currentInstance = vm;
  562. vm && vm._scope.on();
  563. }
  564. /**
  565. * @internal
  566. */
  567. var VNode = /** @class */ (function () {
  568. function VNode(tag, data, children, text, elm, context, componentOptions, asyncFactory) {
  569. this.tag = tag;
  570. this.data = data;
  571. this.children = children;
  572. this.text = text;
  573. this.elm = elm;
  574. this.ns = undefined;
  575. this.context = context;
  576. this.fnContext = undefined;
  577. this.fnOptions = undefined;
  578. this.fnScopeId = undefined;
  579. this.key = data && data.key;
  580. this.componentOptions = componentOptions;
  581. this.componentInstance = undefined;
  582. this.parent = undefined;
  583. this.raw = false;
  584. this.isStatic = false;
  585. this.isRootInsert = true;
  586. this.isComment = false;
  587. this.isCloned = false;
  588. this.isOnce = false;
  589. this.asyncFactory = asyncFactory;
  590. this.asyncMeta = undefined;
  591. this.isAsyncPlaceholder = false;
  592. }
  593. Object.defineProperty(VNode.prototype, "child", {
  594. // DEPRECATED: alias for componentInstance for backwards compat.
  595. /* istanbul ignore next */
  596. get: function () {
  597. return this.componentInstance;
  598. },
  599. enumerable: false,
  600. configurable: true
  601. });
  602. return VNode;
  603. }());
  604. var createEmptyVNode = function (text) {
  605. if (text === void 0) { text = ''; }
  606. var node = new VNode();
  607. node.text = text;
  608. node.isComment = true;
  609. return node;
  610. };
  611. function createTextVNode(val) {
  612. return new VNode(undefined, undefined, undefined, String(val));
  613. }
  614. // optimized shallow clone
  615. // used for static nodes and slot nodes because they may be reused across
  616. // multiple renders, cloning them avoids errors when DOM manipulations rely
  617. // on their elm reference.
  618. function cloneVNode(vnode) {
  619. var cloned = new VNode(vnode.tag, vnode.data,
  620. // #7975
  621. // clone children array to avoid mutating original in case of cloning
  622. // a child.
  623. vnode.children && vnode.children.slice(), vnode.text, vnode.elm, vnode.context, vnode.componentOptions, vnode.asyncFactory);
  624. cloned.ns = vnode.ns;
  625. cloned.isStatic = vnode.isStatic;
  626. cloned.key = vnode.key;
  627. cloned.isComment = vnode.isComment;
  628. cloned.fnContext = vnode.fnContext;
  629. cloned.fnOptions = vnode.fnOptions;
  630. cloned.fnScopeId = vnode.fnScopeId;
  631. cloned.asyncMeta = vnode.asyncMeta;
  632. cloned.isCloned = true;
  633. return cloned;
  634. }
  635. /******************************************************************************
  636. Copyright (c) Microsoft Corporation.
  637. Permission to use, copy, modify, and/or distribute this software for any
  638. purpose with or without fee is hereby granted.
  639. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  640. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  641. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  642. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  643. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  644. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  645. PERFORMANCE OF THIS SOFTWARE.
  646. ***************************************************************************** */
  647. var __assign = function() {
  648. __assign = Object.assign || function __assign(t) {
  649. for (var s, i = 1, n = arguments.length; i < n; i++) {
  650. s = arguments[i];
  651. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  652. }
  653. return t;
  654. };
  655. return __assign.apply(this, arguments);
  656. };
  657. typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
  658. var e = new Error(message);
  659. return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
  660. };
  661. var uid$2 = 0;
  662. var pendingCleanupDeps = [];
  663. var cleanupDeps = function () {
  664. for (var i = 0; i < pendingCleanupDeps.length; i++) {
  665. var dep = pendingCleanupDeps[i];
  666. dep.subs = dep.subs.filter(function (s) { return s; });
  667. dep._pending = false;
  668. }
  669. pendingCleanupDeps.length = 0;
  670. };
  671. /**
  672. * A dep is an observable that can have multiple
  673. * directives subscribing to it.
  674. * @internal
  675. */
  676. var Dep = /** @class */ (function () {
  677. function Dep() {
  678. // pending subs cleanup
  679. this._pending = false;
  680. this.id = uid$2++;
  681. this.subs = [];
  682. }
  683. Dep.prototype.addSub = function (sub) {
  684. this.subs.push(sub);
  685. };
  686. Dep.prototype.removeSub = function (sub) {
  687. // #12696 deps with massive amount of subscribers are extremely slow to
  688. // clean up in Chromium
  689. // to workaround this, we unset the sub for now, and clear them on
  690. // next scheduler flush.
  691. this.subs[this.subs.indexOf(sub)] = null;
  692. if (!this._pending) {
  693. this._pending = true;
  694. pendingCleanupDeps.push(this);
  695. }
  696. };
  697. Dep.prototype.depend = function (info) {
  698. if (Dep.target) {
  699. Dep.target.addDep(this);
  700. if (process.env.NODE_ENV !== 'production' && info && Dep.target.onTrack) {
  701. Dep.target.onTrack(__assign({ effect: Dep.target }, info));
  702. }
  703. }
  704. };
  705. Dep.prototype.notify = function (info) {
  706. // stabilize the subscriber list first
  707. var subs = this.subs.filter(function (s) { return s; });
  708. if (process.env.NODE_ENV !== 'production' && !config.async) {
  709. // subs aren't sorted in scheduler if not running async
  710. // we need to sort them now to make sure they fire in correct
  711. // order
  712. subs.sort(function (a, b) { return a.id - b.id; });
  713. }
  714. for (var i = 0, l = subs.length; i < l; i++) {
  715. var sub = subs[i];
  716. if (process.env.NODE_ENV !== 'production' && info) {
  717. sub.onTrigger &&
  718. sub.onTrigger(__assign({ effect: subs[i] }, info));
  719. }
  720. sub.update();
  721. }
  722. };
  723. return Dep;
  724. }());
  725. // The current target watcher being evaluated.
  726. // This is globally unique because only one watcher
  727. // can be evaluated at a time.
  728. Dep.target = null;
  729. var targetStack = [];
  730. function pushTarget(target) {
  731. targetStack.push(target);
  732. Dep.target = target;
  733. }
  734. function popTarget() {
  735. targetStack.pop();
  736. Dep.target = targetStack[targetStack.length - 1];
  737. }
  738. /*
  739. * not type checking this file because flow doesn't play well with
  740. * dynamically accessing methods on Array prototype
  741. */
  742. var arrayProto = Array.prototype;
  743. var arrayMethods = Object.create(arrayProto);
  744. var methodsToPatch = [
  745. 'push',
  746. 'pop',
  747. 'shift',
  748. 'unshift',
  749. 'splice',
  750. 'sort',
  751. 'reverse'
  752. ];
  753. /**
  754. * Intercept mutating methods and emit events
  755. */
  756. methodsToPatch.forEach(function (method) {
  757. // cache original method
  758. var original = arrayProto[method];
  759. def(arrayMethods, method, function mutator() {
  760. var args = [];
  761. for (var _i = 0; _i < arguments.length; _i++) {
  762. args[_i] = arguments[_i];
  763. }
  764. var result = original.apply(this, args);
  765. var ob = this.__ob__;
  766. var inserted;
  767. switch (method) {
  768. case 'push':
  769. case 'unshift':
  770. inserted = args;
  771. break;
  772. case 'splice':
  773. inserted = args.slice(2);
  774. break;
  775. }
  776. if (inserted)
  777. ob.observeArray(inserted);
  778. // notify change
  779. if (process.env.NODE_ENV !== 'production') {
  780. ob.dep.notify({
  781. type: "array mutation" /* TriggerOpTypes.ARRAY_MUTATION */,
  782. target: this,
  783. key: method
  784. });
  785. }
  786. else {
  787. ob.dep.notify();
  788. }
  789. return result;
  790. });
  791. });
  792. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  793. var NO_INITIAL_VALUE = {};
  794. /**
  795. * In some cases we may want to disable observation inside a component's
  796. * update computation.
  797. */
  798. var shouldObserve = true;
  799. function toggleObserving(value) {
  800. shouldObserve = value;
  801. }
  802. // ssr mock dep
  803. var mockDep = {
  804. notify: noop,
  805. depend: noop,
  806. addSub: noop,
  807. removeSub: noop
  808. };
  809. /**
  810. * Observer class that is attached to each observed
  811. * object. Once attached, the observer converts the target
  812. * object's property keys into getter/setters that
  813. * collect dependencies and dispatch updates.
  814. */
  815. var Observer = /** @class */ (function () {
  816. function Observer(value, shallow, mock) {
  817. if (shallow === void 0) { shallow = false; }
  818. if (mock === void 0) { mock = false; }
  819. this.value = value;
  820. this.shallow = shallow;
  821. this.mock = mock;
  822. // this.value = value
  823. this.dep = mock ? mockDep : new Dep();
  824. this.vmCount = 0;
  825. def(value, '__ob__', this);
  826. if (isArray(value)) {
  827. if (!mock) {
  828. if (hasProto) {
  829. value.__proto__ = arrayMethods;
  830. /* eslint-enable no-proto */
  831. }
  832. else {
  833. for (var i = 0, l = arrayKeys.length; i < l; i++) {
  834. var key = arrayKeys[i];
  835. def(value, key, arrayMethods[key]);
  836. }
  837. }
  838. }
  839. if (!shallow) {
  840. this.observeArray(value);
  841. }
  842. }
  843. else {
  844. /**
  845. * Walk through all properties and convert them into
  846. * getter/setters. This method should only be called when
  847. * value type is Object.
  848. */
  849. var keys = Object.keys(value);
  850. for (var i = 0; i < keys.length; i++) {
  851. var key = keys[i];
  852. defineReactive(value, key, NO_INITIAL_VALUE, undefined, shallow, mock);
  853. }
  854. }
  855. }
  856. /**
  857. * Observe a list of Array items.
  858. */
  859. Observer.prototype.observeArray = function (value) {
  860. for (var i = 0, l = value.length; i < l; i++) {
  861. observe(value[i], false, this.mock);
  862. }
  863. };
  864. return Observer;
  865. }());
  866. // helpers
  867. /**
  868. * Attempt to create an observer instance for a value,
  869. * returns the new observer if successfully observed,
  870. * or the existing observer if the value already has one.
  871. */
  872. function observe(value, shallow, ssrMockReactivity) {
  873. if (value && hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  874. return value.__ob__;
  875. }
  876. if (shouldObserve &&
  877. (ssrMockReactivity || !isServerRendering()) &&
  878. (isArray(value) || isPlainObject(value)) &&
  879. Object.isExtensible(value) &&
  880. !value.__v_skip /* ReactiveFlags.SKIP */ &&
  881. !isRef(value) &&
  882. !(value instanceof VNode)) {
  883. return new Observer(value, shallow, ssrMockReactivity);
  884. }
  885. }
  886. /**
  887. * Define a reactive property on an Object.
  888. */
  889. function defineReactive(obj, key, val, customSetter, shallow, mock, observeEvenIfShallow) {
  890. if (observeEvenIfShallow === void 0) { observeEvenIfShallow = false; }
  891. var dep = new Dep();
  892. var property = Object.getOwnPropertyDescriptor(obj, key);
  893. if (property && property.configurable === false) {
  894. return;
  895. }
  896. // cater for pre-defined getter/setters
  897. var getter = property && property.get;
  898. var setter = property && property.set;
  899. if ((!getter || setter) &&
  900. (val === NO_INITIAL_VALUE || arguments.length === 2)) {
  901. val = obj[key];
  902. }
  903. var childOb = shallow ? val && val.__ob__ : observe(val, false, mock);
  904. Object.defineProperty(obj, key, {
  905. enumerable: true,
  906. configurable: true,
  907. get: function reactiveGetter() {
  908. var value = getter ? getter.call(obj) : val;
  909. if (Dep.target) {
  910. if (process.env.NODE_ENV !== 'production') {
  911. dep.depend({
  912. target: obj,
  913. type: "get" /* TrackOpTypes.GET */,
  914. key: key
  915. });
  916. }
  917. else {
  918. dep.depend();
  919. }
  920. if (childOb) {
  921. childOb.dep.depend();
  922. if (isArray(value)) {
  923. dependArray(value);
  924. }
  925. }
  926. }
  927. return isRef(value) && !shallow ? value.value : value;
  928. },
  929. set: function reactiveSetter(newVal) {
  930. var value = getter ? getter.call(obj) : val;
  931. if (!hasChanged(value, newVal)) {
  932. return;
  933. }
  934. if (process.env.NODE_ENV !== 'production' && customSetter) {
  935. customSetter();
  936. }
  937. if (setter) {
  938. setter.call(obj, newVal);
  939. }
  940. else if (getter) {
  941. // #7981: for accessor properties without setter
  942. return;
  943. }
  944. else if (!shallow && isRef(value) && !isRef(newVal)) {
  945. value.value = newVal;
  946. return;
  947. }
  948. else {
  949. val = newVal;
  950. }
  951. childOb = shallow ? newVal && newVal.__ob__ : observe(newVal, false, mock);
  952. if (process.env.NODE_ENV !== 'production') {
  953. dep.notify({
  954. type: "set" /* TriggerOpTypes.SET */,
  955. target: obj,
  956. key: key,
  957. newValue: newVal,
  958. oldValue: value
  959. });
  960. }
  961. else {
  962. dep.notify();
  963. }
  964. }
  965. });
  966. return dep;
  967. }
  968. function set(target, key, val) {
  969. if (process.env.NODE_ENV !== 'production' && (isUndef(target) || isPrimitive(target))) {
  970. warn("Cannot set reactive property on undefined, null, or primitive value: ".concat(target));
  971. }
  972. if (isReadonly(target)) {
  973. process.env.NODE_ENV !== 'production' && warn("Set operation on key \"".concat(key, "\" failed: target is readonly."));
  974. return;
  975. }
  976. var ob = target.__ob__;
  977. if (isArray(target) && isValidArrayIndex(key)) {
  978. target.length = Math.max(target.length, key);
  979. target.splice(key, 1, val);
  980. // when mocking for SSR, array methods are not hijacked
  981. if (ob && !ob.shallow && ob.mock) {
  982. observe(val, false, true);
  983. }
  984. return val;
  985. }
  986. if (key in target && !(key in Object.prototype)) {
  987. target[key] = val;
  988. return val;
  989. }
  990. if (target._isVue || (ob && ob.vmCount)) {
  991. process.env.NODE_ENV !== 'production' &&
  992. warn('Avoid adding reactive properties to a Vue instance or its root $data ' +
  993. 'at runtime - declare it upfront in the data option.');
  994. return val;
  995. }
  996. if (!ob) {
  997. target[key] = val;
  998. return val;
  999. }
  1000. defineReactive(ob.value, key, val, undefined, ob.shallow, ob.mock);
  1001. if (process.env.NODE_ENV !== 'production') {
  1002. ob.dep.notify({
  1003. type: "add" /* TriggerOpTypes.ADD */,
  1004. target: target,
  1005. key: key,
  1006. newValue: val,
  1007. oldValue: undefined
  1008. });
  1009. }
  1010. else {
  1011. ob.dep.notify();
  1012. }
  1013. return val;
  1014. }
  1015. function del(target, key) {
  1016. if (process.env.NODE_ENV !== 'production' && (isUndef(target) || isPrimitive(target))) {
  1017. warn("Cannot delete reactive property on undefined, null, or primitive value: ".concat(target));
  1018. }
  1019. if (isArray(target) && isValidArrayIndex(key)) {
  1020. target.splice(key, 1);
  1021. return;
  1022. }
  1023. var ob = target.__ob__;
  1024. if (target._isVue || (ob && ob.vmCount)) {
  1025. process.env.NODE_ENV !== 'production' &&
  1026. warn('Avoid deleting properties on a Vue instance or its root $data ' +
  1027. '- just set it to null.');
  1028. return;
  1029. }
  1030. if (isReadonly(target)) {
  1031. process.env.NODE_ENV !== 'production' &&
  1032. warn("Delete operation on key \"".concat(key, "\" failed: target is readonly."));
  1033. return;
  1034. }
  1035. if (!hasOwn(target, key)) {
  1036. return;
  1037. }
  1038. delete target[key];
  1039. if (!ob) {
  1040. return;
  1041. }
  1042. if (process.env.NODE_ENV !== 'production') {
  1043. ob.dep.notify({
  1044. type: "delete" /* TriggerOpTypes.DELETE */,
  1045. target: target,
  1046. key: key
  1047. });
  1048. }
  1049. else {
  1050. ob.dep.notify();
  1051. }
  1052. }
  1053. /**
  1054. * Collect dependencies on array elements when the array is touched, since
  1055. * we cannot intercept array element access like property getters.
  1056. */
  1057. function dependArray(value) {
  1058. for (var e = void 0, i = 0, l = value.length; i < l; i++) {
  1059. e = value[i];
  1060. if (e && e.__ob__) {
  1061. e.__ob__.dep.depend();
  1062. }
  1063. if (isArray(e)) {
  1064. dependArray(e);
  1065. }
  1066. }
  1067. }
  1068. function reactive(target) {
  1069. makeReactive(target, false);
  1070. return target;
  1071. }
  1072. /**
  1073. * Return a shallowly-reactive copy of the original object, where only the root
  1074. * level properties are reactive. It also does not auto-unwrap refs (even at the
  1075. * root level).
  1076. */
  1077. function shallowReactive(target) {
  1078. makeReactive(target, true);
  1079. def(target, "__v_isShallow" /* ReactiveFlags.IS_SHALLOW */, true);
  1080. return target;
  1081. }
  1082. function makeReactive(target, shallow) {
  1083. // if trying to observe a readonly proxy, return the readonly version.
  1084. if (!isReadonly(target)) {
  1085. if (process.env.NODE_ENV !== 'production') {
  1086. if (isArray(target)) {
  1087. warn("Avoid using Array as root value for ".concat(shallow ? "shallowReactive()" : "reactive()", " as it cannot be tracked in watch() or watchEffect(). Use ").concat(shallow ? "shallowRef()" : "ref()", " instead. This is a Vue-2-only limitation."));
  1088. }
  1089. var existingOb = target && target.__ob__;
  1090. if (existingOb && existingOb.shallow !== shallow) {
  1091. warn("Target is already a ".concat(existingOb.shallow ? "" : "non-", "shallow reactive object, and cannot be converted to ").concat(shallow ? "" : "non-", "shallow."));
  1092. }
  1093. }
  1094. var ob = observe(target, shallow, isServerRendering() /* ssr mock reactivity */);
  1095. if (process.env.NODE_ENV !== 'production' && !ob) {
  1096. if (target == null || isPrimitive(target)) {
  1097. warn("value cannot be made reactive: ".concat(String(target)));
  1098. }
  1099. if (isCollectionType(target)) {
  1100. warn("Vue 2 does not support reactive collection types such as Map or Set.");
  1101. }
  1102. }
  1103. }
  1104. }
  1105. function isReactive(value) {
  1106. if (isReadonly(value)) {
  1107. return isReactive(value["__v_raw" /* ReactiveFlags.RAW */]);
  1108. }
  1109. return !!(value && value.__ob__);
  1110. }
  1111. function isShallow(value) {
  1112. return !!(value && value.__v_isShallow);
  1113. }
  1114. function isReadonly(value) {
  1115. return !!(value && value.__v_isReadonly);
  1116. }
  1117. function isProxy(value) {
  1118. return isReactive(value) || isReadonly(value);
  1119. }
  1120. function toRaw(observed) {
  1121. var raw = observed && observed["__v_raw" /* ReactiveFlags.RAW */];
  1122. return raw ? toRaw(raw) : observed;
  1123. }
  1124. function markRaw(value) {
  1125. // non-extensible objects won't be observed anyway
  1126. if (Object.isExtensible(value)) {
  1127. def(value, "__v_skip" /* ReactiveFlags.SKIP */, true);
  1128. }
  1129. return value;
  1130. }
  1131. /**
  1132. * @internal
  1133. */
  1134. function isCollectionType(value) {
  1135. var type = toRawType(value);
  1136. return (type === 'Map' || type === 'WeakMap' || type === 'Set' || type === 'WeakSet');
  1137. }
  1138. /**
  1139. * @internal
  1140. */
  1141. var RefFlag = "__v_isRef";
  1142. function isRef(r) {
  1143. return !!(r && r.__v_isRef === true);
  1144. }
  1145. function ref$1(value) {
  1146. return createRef(value, false);
  1147. }
  1148. function shallowRef(value) {
  1149. return createRef(value, true);
  1150. }
  1151. function createRef(rawValue, shallow) {
  1152. if (isRef(rawValue)) {
  1153. return rawValue;
  1154. }
  1155. var ref = {};
  1156. def(ref, RefFlag, true);
  1157. def(ref, "__v_isShallow" /* ReactiveFlags.IS_SHALLOW */, shallow);
  1158. def(ref, 'dep', defineReactive(ref, 'value', rawValue, null, shallow, isServerRendering()));
  1159. return ref;
  1160. }
  1161. function triggerRef(ref) {
  1162. if (process.env.NODE_ENV !== 'production' && !ref.dep) {
  1163. warn("received object is not a triggerable ref.");
  1164. }
  1165. if (process.env.NODE_ENV !== 'production') {
  1166. ref.dep &&
  1167. ref.dep.notify({
  1168. type: "set" /* TriggerOpTypes.SET */,
  1169. target: ref,
  1170. key: 'value'
  1171. });
  1172. }
  1173. else {
  1174. ref.dep && ref.dep.notify();
  1175. }
  1176. }
  1177. function unref(ref) {
  1178. return isRef(ref) ? ref.value : ref;
  1179. }
  1180. function proxyRefs(objectWithRefs) {
  1181. if (isReactive(objectWithRefs)) {
  1182. return objectWithRefs;
  1183. }
  1184. var proxy = {};
  1185. var keys = Object.keys(objectWithRefs);
  1186. for (var i = 0; i < keys.length; i++) {
  1187. proxyWithRefUnwrap(proxy, objectWithRefs, keys[i]);
  1188. }
  1189. return proxy;
  1190. }
  1191. function proxyWithRefUnwrap(target, source, key) {
  1192. Object.defineProperty(target, key, {
  1193. enumerable: true,
  1194. configurable: true,
  1195. get: function () {
  1196. var val = source[key];
  1197. if (isRef(val)) {
  1198. return val.value;
  1199. }
  1200. else {
  1201. var ob = val && val.__ob__;
  1202. if (ob)
  1203. ob.dep.depend();
  1204. return val;
  1205. }
  1206. },
  1207. set: function (value) {
  1208. var oldValue = source[key];
  1209. if (isRef(oldValue) && !isRef(value)) {
  1210. oldValue.value = value;
  1211. }
  1212. else {
  1213. source[key] = value;
  1214. }
  1215. }
  1216. });
  1217. }
  1218. function customRef(factory) {
  1219. var dep = new Dep();
  1220. var _a = factory(function () {
  1221. if (process.env.NODE_ENV !== 'production') {
  1222. dep.depend({
  1223. target: ref,
  1224. type: "get" /* TrackOpTypes.GET */,
  1225. key: 'value'
  1226. });
  1227. }
  1228. else {
  1229. dep.depend();
  1230. }
  1231. }, function () {
  1232. if (process.env.NODE_ENV !== 'production') {
  1233. dep.notify({
  1234. target: ref,
  1235. type: "set" /* TriggerOpTypes.SET */,
  1236. key: 'value'
  1237. });
  1238. }
  1239. else {
  1240. dep.notify();
  1241. }
  1242. }), get = _a.get, set = _a.set;
  1243. var ref = {
  1244. get value() {
  1245. return get();
  1246. },
  1247. set value(newVal) {
  1248. set(newVal);
  1249. }
  1250. };
  1251. def(ref, RefFlag, true);
  1252. return ref;
  1253. }
  1254. function toRefs(object) {
  1255. if (process.env.NODE_ENV !== 'production' && !isReactive(object)) {
  1256. warn("toRefs() expects a reactive object but received a plain one.");
  1257. }
  1258. var ret = isArray(object) ? new Array(object.length) : {};
  1259. for (var key in object) {
  1260. ret[key] = toRef(object, key);
  1261. }
  1262. return ret;
  1263. }
  1264. function toRef(object, key, defaultValue) {
  1265. var val = object[key];
  1266. if (isRef(val)) {
  1267. return val;
  1268. }
  1269. var ref = {
  1270. get value() {
  1271. var val = object[key];
  1272. return val === undefined ? defaultValue : val;
  1273. },
  1274. set value(newVal) {
  1275. object[key] = newVal;
  1276. }
  1277. };
  1278. def(ref, RefFlag, true);
  1279. return ref;
  1280. }
  1281. var rawToReadonlyFlag = "__v_rawToReadonly";
  1282. var rawToShallowReadonlyFlag = "__v_rawToShallowReadonly";
  1283. function readonly(target) {
  1284. return createReadonly(target, false);
  1285. }
  1286. function createReadonly(target, shallow) {
  1287. if (!isPlainObject(target)) {
  1288. if (process.env.NODE_ENV !== 'production') {
  1289. if (isArray(target)) {
  1290. warn("Vue 2 does not support readonly arrays.");
  1291. }
  1292. else if (isCollectionType(target)) {
  1293. warn("Vue 2 does not support readonly collection types such as Map or Set.");
  1294. }
  1295. else {
  1296. warn("value cannot be made readonly: ".concat(typeof target));
  1297. }
  1298. }
  1299. return target;
  1300. }
  1301. if (process.env.NODE_ENV !== 'production' && !Object.isExtensible(target)) {
  1302. warn("Vue 2 does not support creating readonly proxy for non-extensible object.");
  1303. }
  1304. // already a readonly object
  1305. if (isReadonly(target)) {
  1306. return target;
  1307. }
  1308. // already has a readonly proxy
  1309. var existingFlag = shallow ? rawToShallowReadonlyFlag : rawToReadonlyFlag;
  1310. var existingProxy = target[existingFlag];
  1311. if (existingProxy) {
  1312. return existingProxy;
  1313. }
  1314. var proxy = Object.create(Object.getPrototypeOf(target));
  1315. def(target, existingFlag, proxy);
  1316. def(proxy, "__v_isReadonly" /* ReactiveFlags.IS_READONLY */, true);
  1317. def(proxy, "__v_raw" /* ReactiveFlags.RAW */, target);
  1318. if (isRef(target)) {
  1319. def(proxy, RefFlag, true);
  1320. }
  1321. if (shallow || isShallow(target)) {
  1322. def(proxy, "__v_isShallow" /* ReactiveFlags.IS_SHALLOW */, true);
  1323. }
  1324. var keys = Object.keys(target);
  1325. for (var i = 0; i < keys.length; i++) {
  1326. defineReadonlyProperty(proxy, target, keys[i], shallow);
  1327. }
  1328. return proxy;
  1329. }
  1330. function defineReadonlyProperty(proxy, target, key, shallow) {
  1331. Object.defineProperty(proxy, key, {
  1332. enumerable: true,
  1333. configurable: true,
  1334. get: function () {
  1335. var val = target[key];
  1336. return shallow || !isPlainObject(val) ? val : readonly(val);
  1337. },
  1338. set: function () {
  1339. process.env.NODE_ENV !== 'production' &&
  1340. warn("Set operation on key \"".concat(key, "\" failed: target is readonly."));
  1341. }
  1342. });
  1343. }
  1344. /**
  1345. * Returns a reactive-copy of the original object, where only the root level
  1346. * properties are readonly, and does NOT unwrap refs nor recursively convert
  1347. * returned properties.
  1348. * This is used for creating the props proxy object for stateful components.
  1349. */
  1350. function shallowReadonly(target) {
  1351. return createReadonly(target, true);
  1352. }
  1353. function computed(getterOrOptions, debugOptions) {
  1354. var getter;
  1355. var setter;
  1356. var onlyGetter = isFunction(getterOrOptions);
  1357. if (onlyGetter) {
  1358. getter = getterOrOptions;
  1359. setter = process.env.NODE_ENV !== 'production'
  1360. ? function () {
  1361. warn('Write operation failed: computed value is readonly');
  1362. }
  1363. : noop;
  1364. }
  1365. else {
  1366. getter = getterOrOptions.get;
  1367. setter = getterOrOptions.set;
  1368. }
  1369. var watcher = isServerRendering()
  1370. ? null
  1371. : new Watcher(currentInstance, getter, noop, { lazy: true });
  1372. if (process.env.NODE_ENV !== 'production' && watcher && debugOptions) {
  1373. watcher.onTrack = debugOptions.onTrack;
  1374. watcher.onTrigger = debugOptions.onTrigger;
  1375. }
  1376. var ref = {
  1377. // some libs rely on the presence effect for checking computed refs
  1378. // from normal refs, but the implementation doesn't matter
  1379. effect: watcher,
  1380. get value() {
  1381. if (watcher) {
  1382. if (watcher.dirty) {
  1383. watcher.evaluate();
  1384. }
  1385. if (Dep.target) {
  1386. if (process.env.NODE_ENV !== 'production' && Dep.target.onTrack) {
  1387. Dep.target.onTrack({
  1388. effect: Dep.target,
  1389. target: ref,
  1390. type: "get" /* TrackOpTypes.GET */,
  1391. key: 'value'
  1392. });
  1393. }
  1394. watcher.depend();
  1395. }
  1396. return watcher.value;
  1397. }
  1398. else {
  1399. return getter();
  1400. }
  1401. },
  1402. set value(newVal) {
  1403. setter(newVal);
  1404. }
  1405. };
  1406. def(ref, RefFlag, true);
  1407. def(ref, "__v_isReadonly" /* ReactiveFlags.IS_READONLY */, onlyGetter);
  1408. return ref;
  1409. }
  1410. var WATCHER = "watcher";
  1411. var WATCHER_CB = "".concat(WATCHER, " callback");
  1412. var WATCHER_GETTER = "".concat(WATCHER, " getter");
  1413. var WATCHER_CLEANUP = "".concat(WATCHER, " cleanup");
  1414. // Simple effect.
  1415. function watchEffect(effect, options) {
  1416. return doWatch(effect, null, options);
  1417. }
  1418. function watchPostEffect(effect, options) {
  1419. return doWatch(effect, null, (process.env.NODE_ENV !== 'production'
  1420. ? __assign(__assign({}, options), { flush: 'post' }) : { flush: 'post' }));
  1421. }
  1422. function watchSyncEffect(effect, options) {
  1423. return doWatch(effect, null, (process.env.NODE_ENV !== 'production'
  1424. ? __assign(__assign({}, options), { flush: 'sync' }) : { flush: 'sync' }));
  1425. }
  1426. // initial value for watchers to trigger on undefined initial values
  1427. var INITIAL_WATCHER_VALUE = {};
  1428. // implementation
  1429. function watch(source, cb, options) {
  1430. if (process.env.NODE_ENV !== 'production' && typeof cb !== 'function') {
  1431. warn("`watch(fn, options?)` signature has been moved to a separate API. " +
  1432. "Use `watchEffect(fn, options?)` instead. `watch` now only " +
  1433. "supports `watch(source, cb, options?) signature.");
  1434. }
  1435. return doWatch(source, cb, options);
  1436. }
  1437. function doWatch(source, cb, _a) {
  1438. var _b = _a === void 0 ? emptyObject : _a, immediate = _b.immediate, deep = _b.deep, _c = _b.flush, flush = _c === void 0 ? 'pre' : _c, onTrack = _b.onTrack, onTrigger = _b.onTrigger;
  1439. if (process.env.NODE_ENV !== 'production' && !cb) {
  1440. if (immediate !== undefined) {
  1441. warn("watch() \"immediate\" option is only respected when using the " +
  1442. "watch(source, callback, options?) signature.");
  1443. }
  1444. if (deep !== undefined) {
  1445. warn("watch() \"deep\" option is only respected when using the " +
  1446. "watch(source, callback, options?) signature.");
  1447. }
  1448. }
  1449. var warnInvalidSource = function (s) {
  1450. warn("Invalid watch source: ".concat(s, ". A watch source can only be a getter/effect ") +
  1451. "function, a ref, a reactive object, or an array of these types.");
  1452. };
  1453. var instance = currentInstance;
  1454. var call = function (fn, type, args) {
  1455. if (args === void 0) { args = null; }
  1456. var res = invokeWithErrorHandling(fn, null, args, instance, type);
  1457. if (deep && res && res.__ob__)
  1458. res.__ob__.dep.depend();
  1459. return res;
  1460. };
  1461. var getter;
  1462. var forceTrigger = false;
  1463. var isMultiSource = false;
  1464. if (isRef(source)) {
  1465. getter = function () { return source.value; };
  1466. forceTrigger = isShallow(source);
  1467. }
  1468. else if (isReactive(source)) {
  1469. getter = function () {
  1470. source.__ob__.dep.depend();
  1471. return source;
  1472. };
  1473. deep = true;
  1474. }
  1475. else if (isArray(source)) {
  1476. isMultiSource = true;
  1477. forceTrigger = source.some(function (s) { return isReactive(s) || isShallow(s); });
  1478. getter = function () {
  1479. return source.map(function (s) {
  1480. if (isRef(s)) {
  1481. return s.value;
  1482. }
  1483. else if (isReactive(s)) {
  1484. s.__ob__.dep.depend();
  1485. return traverse(s);
  1486. }
  1487. else if (isFunction(s)) {
  1488. return call(s, WATCHER_GETTER);
  1489. }
  1490. else {
  1491. process.env.NODE_ENV !== 'production' && warnInvalidSource(s);
  1492. }
  1493. });
  1494. };
  1495. }
  1496. else if (isFunction(source)) {
  1497. if (cb) {
  1498. // getter with cb
  1499. getter = function () { return call(source, WATCHER_GETTER); };
  1500. }
  1501. else {
  1502. // no cb -> simple effect
  1503. getter = function () {
  1504. if (instance && instance._isDestroyed) {
  1505. return;
  1506. }
  1507. if (cleanup) {
  1508. cleanup();
  1509. }
  1510. return call(source, WATCHER, [onCleanup]);
  1511. };
  1512. }
  1513. }
  1514. else {
  1515. getter = noop;
  1516. process.env.NODE_ENV !== 'production' && warnInvalidSource(source);
  1517. }
  1518. if (cb && deep) {
  1519. var baseGetter_1 = getter;
  1520. getter = function () { return traverse(baseGetter_1()); };
  1521. }
  1522. var cleanup;
  1523. var onCleanup = function (fn) {
  1524. cleanup = watcher.onStop = function () {
  1525. call(fn, WATCHER_CLEANUP);
  1526. };
  1527. };
  1528. // in SSR there is no need to setup an actual effect, and it should be noop
  1529. // unless it's eager
  1530. if (isServerRendering()) {
  1531. // we will also not call the invalidate callback (+ runner is not set up)
  1532. onCleanup = noop;
  1533. if (!cb) {
  1534. getter();
  1535. }
  1536. else if (immediate) {
  1537. call(cb, WATCHER_CB, [
  1538. getter(),
  1539. isMultiSource ? [] : undefined,
  1540. onCleanup
  1541. ]);
  1542. }
  1543. return noop;
  1544. }
  1545. var watcher = new Watcher(currentInstance, getter, noop, {
  1546. lazy: true
  1547. });
  1548. watcher.noRecurse = !cb;
  1549. var oldValue = isMultiSource ? [] : INITIAL_WATCHER_VALUE;
  1550. // overwrite default run
  1551. watcher.run = function () {
  1552. if (!watcher.active) {
  1553. return;
  1554. }
  1555. if (cb) {
  1556. // watch(source, cb)
  1557. var newValue = watcher.get();
  1558. if (deep ||
  1559. forceTrigger ||
  1560. (isMultiSource
  1561. ? newValue.some(function (v, i) {
  1562. return hasChanged(v, oldValue[i]);
  1563. })
  1564. : hasChanged(newValue, oldValue))) {
  1565. // cleanup before running cb again
  1566. if (cleanup) {
  1567. cleanup();
  1568. }
  1569. call(cb, WATCHER_CB, [
  1570. newValue,
  1571. // pass undefined as the old value when it's changed for the first time
  1572. oldValue === INITIAL_WATCHER_VALUE ? undefined : oldValue,
  1573. onCleanup
  1574. ]);
  1575. oldValue = newValue;
  1576. }
  1577. }
  1578. else {
  1579. // watchEffect
  1580. watcher.get();
  1581. }
  1582. };
  1583. if (flush === 'sync') {
  1584. watcher.update = watcher.run;
  1585. }
  1586. else if (flush === 'post') {
  1587. watcher.post = true;
  1588. watcher.update = function () { return queueWatcher(watcher); };
  1589. }
  1590. else {
  1591. // pre
  1592. watcher.update = function () {
  1593. if (instance && instance === currentInstance && !instance._isMounted) {
  1594. // pre-watcher triggered before
  1595. var buffer = instance._preWatchers || (instance._preWatchers = []);
  1596. if (buffer.indexOf(watcher) < 0)
  1597. buffer.push(watcher);
  1598. }
  1599. else {
  1600. queueWatcher(watcher);
  1601. }
  1602. };
  1603. }
  1604. if (process.env.NODE_ENV !== 'production') {
  1605. watcher.onTrack = onTrack;
  1606. watcher.onTrigger = onTrigger;
  1607. }
  1608. // initial run
  1609. if (cb) {
  1610. if (immediate) {
  1611. watcher.run();
  1612. }
  1613. else {
  1614. oldValue = watcher.get();
  1615. }
  1616. }
  1617. else if (flush === 'post' && instance) {
  1618. instance.$once('hook:mounted', function () { return watcher.get(); });
  1619. }
  1620. else {
  1621. watcher.get();
  1622. }
  1623. return function () {
  1624. watcher.teardown();
  1625. };
  1626. }
  1627. var activeEffectScope;
  1628. var EffectScope = /** @class */ (function () {
  1629. function EffectScope(detached) {
  1630. if (detached === void 0) { detached = false; }
  1631. this.detached = detached;
  1632. /**
  1633. * @internal
  1634. */
  1635. this.active = true;
  1636. /**
  1637. * @internal
  1638. */
  1639. this.effects = [];
  1640. /**
  1641. * @internal
  1642. */
  1643. this.cleanups = [];
  1644. this.parent = activeEffectScope;
  1645. if (!detached && activeEffectScope) {
  1646. this.index =
  1647. (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(this) - 1;
  1648. }
  1649. }
  1650. EffectScope.prototype.run = function (fn) {
  1651. if (this.active) {
  1652. var currentEffectScope = activeEffectScope;
  1653. try {
  1654. activeEffectScope = this;
  1655. return fn();
  1656. }
  1657. finally {
  1658. activeEffectScope = currentEffectScope;
  1659. }
  1660. }
  1661. else if (process.env.NODE_ENV !== 'production') {
  1662. warn("cannot run an inactive effect scope.");
  1663. }
  1664. };
  1665. /**
  1666. * This should only be called on non-detached scopes
  1667. * @internal
  1668. */
  1669. EffectScope.prototype.on = function () {
  1670. activeEffectScope = this;
  1671. };
  1672. /**
  1673. * This should only be called on non-detached scopes
  1674. * @internal
  1675. */
  1676. EffectScope.prototype.off = function () {
  1677. activeEffectScope = this.parent;
  1678. };
  1679. EffectScope.prototype.stop = function (fromParent) {
  1680. if (this.active) {
  1681. var i = void 0, l = void 0;
  1682. for (i = 0, l = this.effects.length; i < l; i++) {
  1683. this.effects[i].teardown();
  1684. }
  1685. for (i = 0, l = this.cleanups.length; i < l; i++) {
  1686. this.cleanups[i]();
  1687. }
  1688. if (this.scopes) {
  1689. for (i = 0, l = this.scopes.length; i < l; i++) {
  1690. this.scopes[i].stop(true);
  1691. }
  1692. }
  1693. // nested scope, dereference from parent to avoid memory leaks
  1694. if (!this.detached && this.parent && !fromParent) {
  1695. // optimized O(1) removal
  1696. var last = this.parent.scopes.pop();
  1697. if (last && last !== this) {
  1698. this.parent.scopes[this.index] = last;
  1699. last.index = this.index;
  1700. }
  1701. }
  1702. this.parent = undefined;
  1703. this.active = false;
  1704. }
  1705. };
  1706. return EffectScope;
  1707. }());
  1708. function effectScope(detached) {
  1709. return new EffectScope(detached);
  1710. }
  1711. /**
  1712. * @internal
  1713. */
  1714. function recordEffectScope(effect, scope) {
  1715. if (scope === void 0) { scope = activeEffectScope; }
  1716. if (scope && scope.active) {
  1717. scope.effects.push(effect);
  1718. }
  1719. }
  1720. function getCurrentScope() {
  1721. return activeEffectScope;
  1722. }
  1723. function onScopeDispose(fn) {
  1724. if (activeEffectScope) {
  1725. activeEffectScope.cleanups.push(fn);
  1726. }
  1727. else if (process.env.NODE_ENV !== 'production') {
  1728. warn("onScopeDispose() is called when there is no active effect scope" +
  1729. " to be associated with.");
  1730. }
  1731. }
  1732. function provide(key, value) {
  1733. if (!currentInstance) {
  1734. if (process.env.NODE_ENV !== 'production') {
  1735. warn("provide() can only be used inside setup().");
  1736. }
  1737. }
  1738. else {
  1739. // TS doesn't allow symbol as index type
  1740. resolveProvided(currentInstance)[key] = value;
  1741. }
  1742. }
  1743. function resolveProvided(vm) {
  1744. // by default an instance inherits its parent's provides object
  1745. // but when it needs to provide values of its own, it creates its
  1746. // own provides object using parent provides object as prototype.
  1747. // this way in `inject` we can simply look up injections from direct
  1748. // parent and let the prototype chain do the work.
  1749. var existing = vm._provided;
  1750. var parentProvides = vm.$parent && vm.$parent._provided;
  1751. if (parentProvides === existing) {
  1752. return (vm._provided = Object.create(parentProvides));
  1753. }
  1754. else {
  1755. return existing;
  1756. }
  1757. }
  1758. function inject(key, defaultValue, treatDefaultAsFactory) {
  1759. if (treatDefaultAsFactory === void 0) { treatDefaultAsFactory = false; }
  1760. // fallback to `currentRenderingInstance` so that this can be called in
  1761. // a functional component
  1762. var instance = currentInstance;
  1763. if (instance) {
  1764. // #2400
  1765. // to support `app.use` plugins,
  1766. // fallback to appContext's `provides` if the instance is at root
  1767. var provides = instance.$parent && instance.$parent._provided;
  1768. if (provides && key in provides) {
  1769. // TS doesn't allow symbol as index type
  1770. return provides[key];
  1771. }
  1772. else if (arguments.length > 1) {
  1773. return treatDefaultAsFactory && isFunction(defaultValue)
  1774. ? defaultValue.call(instance)
  1775. : defaultValue;
  1776. }
  1777. else if (process.env.NODE_ENV !== 'production') {
  1778. warn("injection \"".concat(String(key), "\" not found."));
  1779. }
  1780. }
  1781. else if (process.env.NODE_ENV !== 'production') {
  1782. warn("inject() can only be used inside setup() or functional components.");
  1783. }
  1784. }
  1785. var normalizeEvent = cached(function (name) {
  1786. var passive = name.charAt(0) === '&';
  1787. name = passive ? name.slice(1) : name;
  1788. var once = name.charAt(0) === '~'; // Prefixed last, checked first
  1789. name = once ? name.slice(1) : name;
  1790. var capture = name.charAt(0) === '!';
  1791. name = capture ? name.slice(1) : name;
  1792. return {
  1793. name: name,
  1794. once: once,
  1795. capture: capture,
  1796. passive: passive
  1797. };
  1798. });
  1799. function createFnInvoker(fns, vm) {
  1800. function invoker() {
  1801. var fns = invoker.fns;
  1802. if (isArray(fns)) {
  1803. var cloned = fns.slice();
  1804. for (var i = 0; i < cloned.length; i++) {
  1805. invokeWithErrorHandling(cloned[i], null, arguments, vm, "v-on handler");
  1806. }
  1807. }
  1808. else {
  1809. // return handler return value for single handlers
  1810. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler");
  1811. }
  1812. }
  1813. invoker.fns = fns;
  1814. return invoker;
  1815. }
  1816. function updateListeners(on, oldOn, add, remove, createOnceHandler, vm) {
  1817. var name, cur, old, event;
  1818. for (name in on) {
  1819. cur = on[name];
  1820. old = oldOn[name];
  1821. event = normalizeEvent(name);
  1822. if (isUndef(cur)) {
  1823. process.env.NODE_ENV !== 'production' &&
  1824. warn("Invalid handler for event \"".concat(event.name, "\": got ") + String(cur), vm);
  1825. }
  1826. else if (isUndef(old)) {
  1827. if (isUndef(cur.fns)) {
  1828. cur = on[name] = createFnInvoker(cur, vm);
  1829. }
  1830. if (isTrue(event.once)) {
  1831. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  1832. }
  1833. add(event.name, cur, event.capture, event.passive, event.params);
  1834. }
  1835. else if (cur !== old) {
  1836. old.fns = cur;
  1837. on[name] = old;
  1838. }
  1839. }
  1840. for (name in oldOn) {
  1841. if (isUndef(on[name])) {
  1842. event = normalizeEvent(name);
  1843. remove(event.name, oldOn[name], event.capture);
  1844. }
  1845. }
  1846. }
  1847. function mergeVNodeHook(def, hookKey, hook) {
  1848. if (def instanceof VNode) {
  1849. def = def.data.hook || (def.data.hook = {});
  1850. }
  1851. var invoker;
  1852. var oldHook = def[hookKey];
  1853. function wrappedHook() {
  1854. hook.apply(this, arguments);
  1855. // important: remove merged hook to ensure it's called only once
  1856. // and prevent memory leak
  1857. remove$2(invoker.fns, wrappedHook);
  1858. }
  1859. if (isUndef(oldHook)) {
  1860. // no existing hook
  1861. invoker = createFnInvoker([wrappedHook]);
  1862. }
  1863. else {
  1864. /* istanbul ignore if */
  1865. if (isDef(oldHook.fns) && isTrue(oldHook.merged)) {
  1866. // already a merged invoker
  1867. invoker = oldHook;
  1868. invoker.fns.push(wrappedHook);
  1869. }
  1870. else {
  1871. // existing plain hook
  1872. invoker = createFnInvoker([oldHook, wrappedHook]);
  1873. }
  1874. }
  1875. invoker.merged = true;
  1876. def[hookKey] = invoker;
  1877. }
  1878. function extractPropsFromVNodeData(data, Ctor, tag) {
  1879. // we are only extracting raw values here.
  1880. // validation and default values are handled in the child
  1881. // component itself.
  1882. var propOptions = Ctor.options.props;
  1883. if (isUndef(propOptions)) {
  1884. return;
  1885. }
  1886. var res = {};
  1887. var attrs = data.attrs, props = data.props;
  1888. if (isDef(attrs) || isDef(props)) {
  1889. for (var key in propOptions) {
  1890. var altKey = hyphenate(key);
  1891. if (process.env.NODE_ENV !== 'production') {
  1892. var keyInLowerCase = key.toLowerCase();
  1893. if (key !== keyInLowerCase && attrs && hasOwn(attrs, keyInLowerCase)) {
  1894. tip("Prop \"".concat(keyInLowerCase, "\" is passed to component ") +
  1895. "".concat(formatComponentName(
  1896. // @ts-expect-error tag is string
  1897. tag || Ctor), ", but the declared prop name is") +
  1898. " \"".concat(key, "\". ") +
  1899. "Note that HTML attributes are case-insensitive and camelCased " +
  1900. "props need to use their kebab-case equivalents when using in-DOM " +
  1901. "templates. You should probably use \"".concat(altKey, "\" instead of \"").concat(key, "\"."));
  1902. }
  1903. }
  1904. checkProp(res, props, key, altKey, true) ||
  1905. checkProp(res, attrs, key, altKey, false);
  1906. }
  1907. }
  1908. return res;
  1909. }
  1910. function checkProp(res, hash, key, altKey, preserve) {
  1911. if (isDef(hash)) {
  1912. if (hasOwn(hash, key)) {
  1913. res[key] = hash[key];
  1914. if (!preserve) {
  1915. delete hash[key];
  1916. }
  1917. return true;
  1918. }
  1919. else if (hasOwn(hash, altKey)) {
  1920. res[key] = hash[altKey];
  1921. if (!preserve) {
  1922. delete hash[altKey];
  1923. }
  1924. return true;
  1925. }
  1926. }
  1927. return false;
  1928. }
  1929. // The template compiler attempts to minimize the need for normalization by
  1930. // statically analyzing the template at compile time.
  1931. //
  1932. // For plain HTML markup, normalization can be completely skipped because the
  1933. // generated render function is guaranteed to return Array<VNode>. There are
  1934. // two cases where extra normalization is needed:
  1935. // 1. When the children contains components - because a functional component
  1936. // may return an Array instead of a single root. In this case, just a simple
  1937. // normalization is needed - if any child is an Array, we flatten the whole
  1938. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  1939. // because functional components already normalize their own children.
  1940. function simpleNormalizeChildren(children) {
  1941. for (var i = 0; i < children.length; i++) {
  1942. if (isArray(children[i])) {
  1943. return Array.prototype.concat.apply([], children);
  1944. }
  1945. }
  1946. return children;
  1947. }
  1948. // 2. When the children contains constructs that always generated nested Arrays,
  1949. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  1950. // with hand-written render functions / JSX. In such cases a full normalization
  1951. // is needed to cater to all possible types of children values.
  1952. function normalizeChildren(children) {
  1953. return isPrimitive(children)
  1954. ? [createTextVNode(children)]
  1955. : isArray(children)
  1956. ? normalizeArrayChildren(children)
  1957. : undefined;
  1958. }
  1959. function isTextNode(node) {
  1960. return isDef(node) && isDef(node.text) && isFalse(node.isComment);
  1961. }
  1962. function normalizeArrayChildren(children, nestedIndex) {
  1963. var res = [];
  1964. var i, c, lastIndex, last;
  1965. for (i = 0; i < children.length; i++) {
  1966. c = children[i];
  1967. if (isUndef(c) || typeof c === 'boolean')
  1968. continue;
  1969. lastIndex = res.length - 1;
  1970. last = res[lastIndex];
  1971. // nested
  1972. if (isArray(c)) {
  1973. if (c.length > 0) {
  1974. c = normalizeArrayChildren(c, "".concat(nestedIndex || '', "_").concat(i));
  1975. // merge adjacent text nodes
  1976. if (isTextNode(c[0]) && isTextNode(last)) {
  1977. res[lastIndex] = createTextVNode(last.text + c[0].text);
  1978. c.shift();
  1979. }
  1980. res.push.apply(res, c);
  1981. }
  1982. }
  1983. else if (isPrimitive(c)) {
  1984. if (isTextNode(last)) {
  1985. // merge adjacent text nodes
  1986. // this is necessary for SSR hydration because text nodes are
  1987. // essentially merged when rendered to HTML strings
  1988. res[lastIndex] = createTextVNode(last.text + c);
  1989. }
  1990. else if (c !== '') {
  1991. // convert primitive to vnode
  1992. res.push(createTextVNode(c));
  1993. }
  1994. }
  1995. else {
  1996. if (isTextNode(c) && isTextNode(last)) {
  1997. // merge adjacent text nodes
  1998. res[lastIndex] = createTextVNode(last.text + c.text);
  1999. }
  2000. else {
  2001. // default key for nested array children (likely generated by v-for)
  2002. if (isTrue(children._isVList) &&
  2003. isDef(c.tag) &&
  2004. isUndef(c.key) &&
  2005. isDef(nestedIndex)) {
  2006. c.key = "__vlist".concat(nestedIndex, "_").concat(i, "__");
  2007. }
  2008. res.push(c);
  2009. }
  2010. }
  2011. }
  2012. return res;
  2013. }
  2014. /**
  2015. * Runtime helper for rendering v-for lists.
  2016. */
  2017. function renderList(val, render) {
  2018. var ret = null, i, l, keys, key;
  2019. if (isArray(val) || typeof val === 'string') {
  2020. ret = new Array(val.length);
  2021. for (i = 0, l = val.length; i < l; i++) {
  2022. ret[i] = render(val[i], i);
  2023. }
  2024. }
  2025. else if (typeof val === 'number') {
  2026. ret = new Array(val);
  2027. for (i = 0; i < val; i++) {
  2028. ret[i] = render(i + 1, i);
  2029. }
  2030. }
  2031. else if (isObject(val)) {
  2032. if (hasSymbol && val[Symbol.iterator]) {
  2033. ret = [];
  2034. var iterator = val[Symbol.iterator]();
  2035. var result = iterator.next();
  2036. while (!result.done) {
  2037. ret.push(render(result.value, ret.length));
  2038. result = iterator.next();
  2039. }
  2040. }
  2041. else {
  2042. keys = Object.keys(val);
  2043. ret = new Array(keys.length);
  2044. for (i = 0, l = keys.length; i < l; i++) {
  2045. key = keys[i];
  2046. ret[i] = render(val[key], key, i);
  2047. }
  2048. }
  2049. }
  2050. if (!isDef(ret)) {
  2051. ret = [];
  2052. }
  2053. ret._isVList = true;
  2054. return ret;
  2055. }
  2056. /**
  2057. * Runtime helper for rendering <slot>
  2058. */
  2059. function renderSlot(name, fallbackRender, props, bindObject) {
  2060. var scopedSlotFn = this.$scopedSlots[name];
  2061. var nodes;
  2062. if (scopedSlotFn) {
  2063. // scoped slot
  2064. props = props || {};
  2065. if (bindObject) {
  2066. if (process.env.NODE_ENV !== 'production' && !isObject(bindObject)) {
  2067. warn('slot v-bind without argument expects an Object', this);
  2068. }
  2069. props = extend(extend({}, bindObject), props);
  2070. }
  2071. nodes =
  2072. scopedSlotFn(props) ||
  2073. (isFunction(fallbackRender) ? fallbackRender() : fallbackRender);
  2074. }
  2075. else {
  2076. nodes =
  2077. this.$slots[name] ||
  2078. (isFunction(fallbackRender) ? fallbackRender() : fallbackRender);
  2079. }
  2080. var target = props && props.slot;
  2081. if (target) {
  2082. return this.$createElement('template', { slot: target }, nodes);
  2083. }
  2084. else {
  2085. return nodes;
  2086. }
  2087. }
  2088. /**
  2089. * Runtime helper for resolving filters
  2090. */
  2091. function resolveFilter(id) {
  2092. return resolveAsset(this.$options, 'filters', id, true) || identity;
  2093. }
  2094. function isKeyNotMatch(expect, actual) {
  2095. if (isArray(expect)) {
  2096. return expect.indexOf(actual) === -1;
  2097. }
  2098. else {
  2099. return expect !== actual;
  2100. }
  2101. }
  2102. /**
  2103. * Runtime helper for checking keyCodes from config.
  2104. * exposed as Vue.prototype._k
  2105. * passing in eventKeyName as last argument separately for backwards compat
  2106. */
  2107. function checkKeyCodes(eventKeyCode, key, builtInKeyCode, eventKeyName, builtInKeyName) {
  2108. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  2109. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  2110. return isKeyNotMatch(builtInKeyName, eventKeyName);
  2111. }
  2112. else if (mappedKeyCode) {
  2113. return isKeyNotMatch(mappedKeyCode, eventKeyCode);
  2114. }
  2115. else if (eventKeyName) {
  2116. return hyphenate(eventKeyName) !== key;
  2117. }
  2118. return eventKeyCode === undefined;
  2119. }
  2120. /**
  2121. * Runtime helper for merging v-bind="object" into a VNode's data.
  2122. */
  2123. function bindObjectProps(data, tag, value, asProp, isSync) {
  2124. if (value) {
  2125. if (!isObject(value)) {
  2126. process.env.NODE_ENV !== 'production' &&
  2127. warn('v-bind without argument expects an Object or Array value', this);
  2128. }
  2129. else {
  2130. if (isArray(value)) {
  2131. value = toObject(value);
  2132. }
  2133. var hash = void 0;
  2134. var _loop_1 = function (key) {
  2135. if (key === 'class' || key === 'style' || isReservedAttribute(key)) {
  2136. hash = data;
  2137. }
  2138. else {
  2139. var type = data.attrs && data.attrs.type;
  2140. hash =
  2141. asProp || config.mustUseProp(tag, type, key)
  2142. ? data.domProps || (data.domProps = {})
  2143. : data.attrs || (data.attrs = {});
  2144. }
  2145. var camelizedKey = camelize(key);
  2146. var hyphenatedKey = hyphenate(key);
  2147. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  2148. hash[key] = value[key];
  2149. if (isSync) {
  2150. var on = data.on || (data.on = {});
  2151. on["update:".concat(key)] = function ($event) {
  2152. value[key] = $event;
  2153. };
  2154. }
  2155. }
  2156. };
  2157. for (var key in value) {
  2158. _loop_1(key);
  2159. }
  2160. }
  2161. }
  2162. return data;
  2163. }
  2164. /**
  2165. * Runtime helper for rendering static trees.
  2166. */
  2167. function renderStatic(index, isInFor) {
  2168. var cached = this._staticTrees || (this._staticTrees = []);
  2169. var tree = cached[index];
  2170. // if has already-rendered static tree and not inside v-for,
  2171. // we can reuse the same tree.
  2172. if (tree && !isInFor) {
  2173. return tree;
  2174. }
  2175. // otherwise, render a fresh tree.
  2176. tree = cached[index] = this.$options.staticRenderFns[index].call(this._renderProxy, this._c, this // for render fns generated for functional component templates
  2177. );
  2178. markStatic(tree, "__static__".concat(index), false);
  2179. return tree;
  2180. }
  2181. /**
  2182. * Runtime helper for v-once.
  2183. * Effectively it means marking the node as static with a unique key.
  2184. */
  2185. function markOnce(tree, index, key) {
  2186. markStatic(tree, "__once__".concat(index).concat(key ? "_".concat(key) : ""), true);
  2187. return tree;
  2188. }
  2189. function markStatic(tree, key, isOnce) {
  2190. if (isArray(tree)) {
  2191. for (var i = 0; i < tree.length; i++) {
  2192. if (tree[i] && typeof tree[i] !== 'string') {
  2193. markStaticNode(tree[i], "".concat(key, "_").concat(i), isOnce);
  2194. }
  2195. }
  2196. }
  2197. else {
  2198. markStaticNode(tree, key, isOnce);
  2199. }
  2200. }
  2201. function markStaticNode(node, key, isOnce) {
  2202. node.isStatic = true;
  2203. node.key = key;
  2204. node.isOnce = isOnce;
  2205. }
  2206. function bindObjectListeners(data, value) {
  2207. if (value) {
  2208. if (!isPlainObject(value)) {
  2209. process.env.NODE_ENV !== 'production' && warn('v-on without argument expects an Object value', this);
  2210. }
  2211. else {
  2212. var on = (data.on = data.on ? extend({}, data.on) : {});
  2213. for (var key in value) {
  2214. var existing = on[key];
  2215. var ours = value[key];
  2216. on[key] = existing ? [].concat(existing, ours) : ours;
  2217. }
  2218. }
  2219. }
  2220. return data;
  2221. }
  2222. function resolveScopedSlots(fns, res,
  2223. // the following are added in 2.6
  2224. hasDynamicKeys, contentHashKey) {
  2225. res = res || { $stable: !hasDynamicKeys };
  2226. for (var i = 0; i < fns.length; i++) {
  2227. var slot = fns[i];
  2228. if (isArray(slot)) {
  2229. resolveScopedSlots(slot, res, hasDynamicKeys);
  2230. }
  2231. else if (slot) {
  2232. // marker for reverse proxying v-slot without scope on this.$slots
  2233. // @ts-expect-error
  2234. if (slot.proxy) {
  2235. // @ts-expect-error
  2236. slot.fn.proxy = true;
  2237. }
  2238. res[slot.key] = slot.fn;
  2239. }
  2240. }
  2241. if (contentHashKey) {
  2242. res.$key = contentHashKey;
  2243. }
  2244. return res;
  2245. }
  2246. // helper to process dynamic keys for dynamic arguments in v-bind and v-on.
  2247. function bindDynamicKeys(baseObj, values) {
  2248. for (var i = 0; i < values.length; i += 2) {
  2249. var key = values[i];
  2250. if (typeof key === 'string' && key) {
  2251. baseObj[values[i]] = values[i + 1];
  2252. }
  2253. else if (process.env.NODE_ENV !== 'production' && key !== '' && key !== null) {
  2254. // null is a special value for explicitly removing a binding
  2255. warn("Invalid value for dynamic directive argument (expected string or null): ".concat(key), this);
  2256. }
  2257. }
  2258. return baseObj;
  2259. }
  2260. // helper to dynamically append modifier runtime markers to event names.
  2261. // ensure only append when value is already string, otherwise it will be cast
  2262. // to string and cause the type check to miss.
  2263. function prependModifier(value, symbol) {
  2264. return typeof value === 'string' ? symbol + value : value;
  2265. }
  2266. function installRenderHelpers(target) {
  2267. target._o = markOnce;
  2268. target._n = toNumber;
  2269. target._s = toString;
  2270. target._l = renderList;
  2271. target._t = renderSlot;
  2272. target._q = looseEqual;
  2273. target._i = looseIndexOf;
  2274. target._m = renderStatic;
  2275. target._f = resolveFilter;
  2276. target._k = checkKeyCodes;
  2277. target._b = bindObjectProps;
  2278. target._v = createTextVNode;
  2279. target._e = createEmptyVNode;
  2280. target._u = resolveScopedSlots;
  2281. target._g = bindObjectListeners;
  2282. target._d = bindDynamicKeys;
  2283. target._p = prependModifier;
  2284. }
  2285. /**
  2286. * Runtime helper for resolving raw children VNodes into a slot object.
  2287. */
  2288. function resolveSlots(children, context) {
  2289. if (!children || !children.length) {
  2290. return {};
  2291. }
  2292. var slots = {};
  2293. for (var i = 0, l = children.length; i < l; i++) {
  2294. var child = children[i];
  2295. var data = child.data;
  2296. // remove slot attribute if the node is resolved as a Vue slot node
  2297. if (data && data.attrs && data.attrs.slot) {
  2298. delete data.attrs.slot;
  2299. }
  2300. // named slots should only be respected if the vnode was rendered in the
  2301. // same context.
  2302. if ((child.context === context || child.fnContext === context) &&
  2303. data &&
  2304. data.slot != null) {
  2305. var name_1 = data.slot;
  2306. var slot = slots[name_1] || (slots[name_1] = []);
  2307. if (child.tag === 'template') {
  2308. slot.push.apply(slot, child.children || []);
  2309. }
  2310. else {
  2311. slot.push(child);
  2312. }
  2313. }
  2314. else {
  2315. (slots.default || (slots.default = [])).push(child);
  2316. }
  2317. }
  2318. // ignore slots that contains only whitespace
  2319. for (var name_2 in slots) {
  2320. if (slots[name_2].every(isWhitespace)) {
  2321. delete slots[name_2];
  2322. }
  2323. }
  2324. return slots;
  2325. }
  2326. function isWhitespace(node) {
  2327. return (node.isComment && !node.asyncFactory) || node.text === ' ';
  2328. }
  2329. function isAsyncPlaceholder(node) {
  2330. // @ts-expect-error not really boolean type
  2331. return node.isComment && node.asyncFactory;
  2332. }
  2333. function normalizeScopedSlots(ownerVm, scopedSlots, normalSlots, prevScopedSlots) {
  2334. var res;
  2335. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  2336. var isStable = scopedSlots ? !!scopedSlots.$stable : !hasNormalSlots;
  2337. var key = scopedSlots && scopedSlots.$key;
  2338. if (!scopedSlots) {
  2339. res = {};
  2340. }
  2341. else if (scopedSlots._normalized) {
  2342. // fast path 1: child component re-render only, parent did not change
  2343. return scopedSlots._normalized;
  2344. }
  2345. else if (isStable &&
  2346. prevScopedSlots &&
  2347. prevScopedSlots !== emptyObject &&
  2348. key === prevScopedSlots.$key &&
  2349. !hasNormalSlots &&
  2350. !prevScopedSlots.$hasNormal) {
  2351. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  2352. // only need to normalize once
  2353. return prevScopedSlots;
  2354. }
  2355. else {
  2356. res = {};
  2357. for (var key_1 in scopedSlots) {
  2358. if (scopedSlots[key_1] && key_1[0] !== '$') {
  2359. res[key_1] = normalizeScopedSlot(ownerVm, normalSlots, key_1, scopedSlots[key_1]);
  2360. }
  2361. }
  2362. }
  2363. // expose normal slots on scopedSlots
  2364. for (var key_2 in normalSlots) {
  2365. if (!(key_2 in res)) {
  2366. res[key_2] = proxyNormalSlot(normalSlots, key_2);
  2367. }
  2368. }
  2369. // avoriaz seems to mock a non-extensible $scopedSlots object
  2370. // and when that is passed down this would cause an error
  2371. if (scopedSlots && Object.isExtensible(scopedSlots)) {
  2372. scopedSlots._normalized = res;
  2373. }
  2374. def(res, '$stable', isStable);
  2375. def(res, '$key', key);
  2376. def(res, '$hasNormal', hasNormalSlots);
  2377. return res;
  2378. }
  2379. function normalizeScopedSlot(vm, normalSlots, key, fn) {
  2380. var normalized = function () {
  2381. var cur = currentInstance;
  2382. setCurrentInstance(vm);
  2383. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  2384. res =
  2385. res && typeof res === 'object' && !isArray(res)
  2386. ? [res] // single vnode
  2387. : normalizeChildren(res);
  2388. var vnode = res && res[0];
  2389. setCurrentInstance(cur);
  2390. return res &&
  2391. (!vnode ||
  2392. (res.length === 1 && vnode.isComment && !isAsyncPlaceholder(vnode))) // #9658, #10391
  2393. ? undefined
  2394. : res;
  2395. };
  2396. // this is a slot using the new v-slot syntax without scope. although it is
  2397. // compiled as a scoped slot, render fn users would expect it to be present
  2398. // on this.$slots because the usage is semantically a normal slot.
  2399. if (fn.proxy) {
  2400. Object.defineProperty(normalSlots, key, {
  2401. get: normalized,
  2402. enumerable: true,
  2403. configurable: true
  2404. });
  2405. }
  2406. return normalized;
  2407. }
  2408. function proxyNormalSlot(slots, key) {
  2409. return function () { return slots[key]; };
  2410. }
  2411. function initSetup(vm) {
  2412. var options = vm.$options;
  2413. var setup = options.setup;
  2414. if (setup) {
  2415. var ctx = (vm._setupContext = createSetupContext(vm));
  2416. setCurrentInstance(vm);
  2417. pushTarget();
  2418. var setupResult = invokeWithErrorHandling(setup, null, [vm._props || shallowReactive({}), ctx], vm, "setup");
  2419. popTarget();
  2420. setCurrentInstance();
  2421. if (isFunction(setupResult)) {
  2422. // render function
  2423. // @ts-ignore
  2424. options.render = setupResult;
  2425. }
  2426. else if (isObject(setupResult)) {
  2427. // bindings
  2428. if (process.env.NODE_ENV !== 'production' && setupResult instanceof VNode) {
  2429. warn("setup() should not return VNodes directly - " +
  2430. "return a render function instead.");
  2431. }
  2432. vm._setupState = setupResult;
  2433. // __sfc indicates compiled bindings from <script setup>
  2434. if (!setupResult.__sfc) {
  2435. for (var key in setupResult) {
  2436. if (!isReserved(key)) {
  2437. proxyWithRefUnwrap(vm, setupResult, key);
  2438. }
  2439. else if (process.env.NODE_ENV !== 'production') {
  2440. warn("Avoid using variables that start with _ or $ in setup().");
  2441. }
  2442. }
  2443. }
  2444. else {
  2445. // exposed for compiled render fn
  2446. var proxy = (vm._setupProxy = {});
  2447. for (var key in setupResult) {
  2448. if (key !== '__sfc') {
  2449. proxyWithRefUnwrap(proxy, setupResult, key);
  2450. }
  2451. }
  2452. }
  2453. }
  2454. else if (process.env.NODE_ENV !== 'production' && setupResult !== undefined) {
  2455. warn("setup() should return an object. Received: ".concat(setupResult === null ? 'null' : typeof setupResult));
  2456. }
  2457. }
  2458. }
  2459. function createSetupContext(vm) {
  2460. var exposeCalled = false;
  2461. return {
  2462. get attrs() {
  2463. if (!vm._attrsProxy) {
  2464. var proxy = (vm._attrsProxy = {});
  2465. def(proxy, '_v_attr_proxy', true);
  2466. syncSetupProxy(proxy, vm.$attrs, emptyObject, vm, '$attrs');
  2467. }
  2468. return vm._attrsProxy;
  2469. },
  2470. get listeners() {
  2471. if (!vm._listenersProxy) {
  2472. var proxy = (vm._listenersProxy = {});
  2473. syncSetupProxy(proxy, vm.$listeners, emptyObject, vm, '$listeners');
  2474. }
  2475. return vm._listenersProxy;
  2476. },
  2477. get slots() {
  2478. return initSlotsProxy(vm);
  2479. },
  2480. emit: bind(vm.$emit, vm),
  2481. expose: function (exposed) {
  2482. if (process.env.NODE_ENV !== 'production') {
  2483. if (exposeCalled) {
  2484. warn("expose() should be called only once per setup().", vm);
  2485. }
  2486. exposeCalled = true;
  2487. }
  2488. if (exposed) {
  2489. Object.keys(exposed).forEach(function (key) {
  2490. return proxyWithRefUnwrap(vm, exposed, key);
  2491. });
  2492. }
  2493. }
  2494. };
  2495. }
  2496. function syncSetupProxy(to, from, prev, instance, type) {
  2497. var changed = false;
  2498. for (var key in from) {
  2499. if (!(key in to)) {
  2500. changed = true;
  2501. defineProxyAttr(to, key, instance, type);
  2502. }
  2503. else if (from[key] !== prev[key]) {
  2504. changed = true;
  2505. }
  2506. }
  2507. for (var key in to) {
  2508. if (!(key in from)) {
  2509. changed = true;
  2510. delete to[key];
  2511. }
  2512. }
  2513. return changed;
  2514. }
  2515. function defineProxyAttr(proxy, key, instance, type) {
  2516. Object.defineProperty(proxy, key, {
  2517. enumerable: true,
  2518. configurable: true,
  2519. get: function () {
  2520. return instance[type][key];
  2521. }
  2522. });
  2523. }
  2524. function initSlotsProxy(vm) {
  2525. if (!vm._slotsProxy) {
  2526. syncSetupSlots((vm._slotsProxy = {}), vm.$scopedSlots);
  2527. }
  2528. return vm._slotsProxy;
  2529. }
  2530. function syncSetupSlots(to, from) {
  2531. for (var key in from) {
  2532. to[key] = from[key];
  2533. }
  2534. for (var key in to) {
  2535. if (!(key in from)) {
  2536. delete to[key];
  2537. }
  2538. }
  2539. }
  2540. /**
  2541. * @internal use manual type def because public setup context type relies on
  2542. * legacy VNode types
  2543. */
  2544. function useSlots() {
  2545. return getContext().slots;
  2546. }
  2547. /**
  2548. * @internal use manual type def because public setup context type relies on
  2549. * legacy VNode types
  2550. */
  2551. function useAttrs() {
  2552. return getContext().attrs;
  2553. }
  2554. /**
  2555. * Vue 2 only
  2556. * @internal use manual type def because public setup context type relies on
  2557. * legacy VNode types
  2558. */
  2559. function useListeners() {
  2560. return getContext().listeners;
  2561. }
  2562. function getContext() {
  2563. if (process.env.NODE_ENV !== 'production' && !currentInstance) {
  2564. warn("useContext() called without active instance.");
  2565. }
  2566. var vm = currentInstance;
  2567. return vm._setupContext || (vm._setupContext = createSetupContext(vm));
  2568. }
  2569. /**
  2570. * Runtime helper for merging default declarations. Imported by compiled code
  2571. * only.
  2572. * @internal
  2573. */
  2574. function mergeDefaults(raw, defaults) {
  2575. var props = isArray(raw)
  2576. ? raw.reduce(function (normalized, p) { return ((normalized[p] = {}), normalized); }, {})
  2577. : raw;
  2578. for (var key in defaults) {
  2579. var opt = props[key];
  2580. if (opt) {
  2581. if (isArray(opt) || isFunction(opt)) {
  2582. props[key] = { type: opt, default: defaults[key] };
  2583. }
  2584. else {
  2585. opt.default = defaults[key];
  2586. }
  2587. }
  2588. else if (opt === null) {
  2589. props[key] = { default: defaults[key] };
  2590. }
  2591. else if (process.env.NODE_ENV !== 'production') {
  2592. warn("props default key \"".concat(key, "\" has no corresponding declaration."));
  2593. }
  2594. }
  2595. return props;
  2596. }
  2597. function initRender(vm) {
  2598. vm._vnode = null; // the root of the child tree
  2599. vm._staticTrees = null; // v-once cached trees
  2600. var options = vm.$options;
  2601. var parentVnode = (vm.$vnode = options._parentVnode); // the placeholder node in parent tree
  2602. var renderContext = parentVnode && parentVnode.context;
  2603. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  2604. vm.$scopedSlots = parentVnode
  2605. ? normalizeScopedSlots(vm.$parent, parentVnode.data.scopedSlots, vm.$slots)
  2606. : emptyObject;
  2607. // bind the createElement fn to this instance
  2608. // so that we get proper render context inside it.
  2609. // args order: tag, data, children, normalizationType, alwaysNormalize
  2610. // internal version is used by render functions compiled from templates
  2611. // @ts-expect-error
  2612. vm._c = function (a, b, c, d) { return createElement$1(vm, a, b, c, d, false); };
  2613. // normalization is always applied for the public version, used in
  2614. // user-written render functions.
  2615. // @ts-expect-error
  2616. vm.$createElement = function (a, b, c, d) { return createElement$1(vm, a, b, c, d, true); };
  2617. // $attrs & $listeners are exposed for easier HOC creation.
  2618. // they need to be reactive so that HOCs using them are always updated
  2619. var parentData = parentVnode && parentVnode.data;
  2620. /* istanbul ignore else */
  2621. if (process.env.NODE_ENV !== 'production') {
  2622. defineReactive(vm, '$attrs', (parentData && parentData.attrs) || emptyObject, function () {
  2623. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  2624. }, true);
  2625. defineReactive(vm, '$listeners', options._parentListeners || emptyObject, function () {
  2626. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  2627. }, true);
  2628. }
  2629. else {
  2630. defineReactive(vm, '$attrs', (parentData && parentData.attrs) || emptyObject, null, true);
  2631. defineReactive(vm, '$listeners', options._parentListeners || emptyObject, null, true);
  2632. }
  2633. }
  2634. var currentRenderingInstance = null;
  2635. function renderMixin(Vue) {
  2636. // install runtime convenience helpers
  2637. installRenderHelpers(Vue.prototype);
  2638. Vue.prototype.$nextTick = function (fn) {
  2639. return nextTick(fn, this);
  2640. };
  2641. Vue.prototype._render = function () {
  2642. var vm = this;
  2643. var _a = vm.$options, render = _a.render, _parentVnode = _a._parentVnode;
  2644. if (_parentVnode && vm._isMounted) {
  2645. vm.$scopedSlots = normalizeScopedSlots(vm.$parent, _parentVnode.data.scopedSlots, vm.$slots, vm.$scopedSlots);
  2646. if (vm._slotsProxy) {
  2647. syncSetupSlots(vm._slotsProxy, vm.$scopedSlots);
  2648. }
  2649. }
  2650. // set parent vnode. this allows render functions to have access
  2651. // to the data on the placeholder node.
  2652. vm.$vnode = _parentVnode;
  2653. // render self
  2654. var prevInst = currentInstance;
  2655. var prevRenderInst = currentRenderingInstance;
  2656. var vnode;
  2657. try {
  2658. setCurrentInstance(vm);
  2659. currentRenderingInstance = vm;
  2660. vnode = render.call(vm._renderProxy, vm.$createElement);
  2661. }
  2662. catch (e) {
  2663. handleError(e, vm, "render");
  2664. // return error render result,
  2665. // or previous vnode to prevent render error causing blank component
  2666. /* istanbul ignore else */
  2667. if (process.env.NODE_ENV !== 'production' && vm.$options.renderError) {
  2668. try {
  2669. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  2670. }
  2671. catch (e) {
  2672. handleError(e, vm, "renderError");
  2673. vnode = vm._vnode;
  2674. }
  2675. }
  2676. else {
  2677. vnode = vm._vnode;
  2678. }
  2679. }
  2680. finally {
  2681. currentRenderingInstance = prevRenderInst;
  2682. setCurrentInstance(prevInst);
  2683. }
  2684. // if the returned array contains only a single node, allow it
  2685. if (isArray(vnode) && vnode.length === 1) {
  2686. vnode = vnode[0];
  2687. }
  2688. // return empty vnode in case the render function errored out
  2689. if (!(vnode instanceof VNode)) {
  2690. if (process.env.NODE_ENV !== 'production' && isArray(vnode)) {
  2691. warn('Multiple root nodes returned from render function. Render function ' +
  2692. 'should return a single root node.', vm);
  2693. }
  2694. vnode = createEmptyVNode();
  2695. }
  2696. // set parent
  2697. vnode.parent = _parentVnode;
  2698. return vnode;
  2699. };
  2700. }
  2701. function ensureCtor(comp, base) {
  2702. if (comp.__esModule || (hasSymbol && comp[Symbol.toStringTag] === 'Module')) {
  2703. comp = comp.default;
  2704. }
  2705. return isObject(comp) ? base.extend(comp) : comp;
  2706. }
  2707. function createAsyncPlaceholder(factory, data, context, children, tag) {
  2708. var node = createEmptyVNode();
  2709. node.asyncFactory = factory;
  2710. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  2711. return node;
  2712. }
  2713. function resolveAsyncComponent(factory, baseCtor) {
  2714. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  2715. return factory.errorComp;
  2716. }
  2717. if (isDef(factory.resolved)) {
  2718. return factory.resolved;
  2719. }
  2720. var owner = currentRenderingInstance;
  2721. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  2722. // already pending
  2723. factory.owners.push(owner);
  2724. }
  2725. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  2726. return factory.loadingComp;
  2727. }
  2728. if (owner && !isDef(factory.owners)) {
  2729. var owners_1 = (factory.owners = [owner]);
  2730. var sync_1 = true;
  2731. var timerLoading_1 = null;
  2732. var timerTimeout_1 = null;
  2733. owner.$on('hook:destroyed', function () { return remove$2(owners_1, owner); });
  2734. var forceRender_1 = function (renderCompleted) {
  2735. for (var i = 0, l = owners_1.length; i < l; i++) {
  2736. owners_1[i].$forceUpdate();
  2737. }
  2738. if (renderCompleted) {
  2739. owners_1.length = 0;
  2740. if (timerLoading_1 !== null) {
  2741. clearTimeout(timerLoading_1);
  2742. timerLoading_1 = null;
  2743. }
  2744. if (timerTimeout_1 !== null) {
  2745. clearTimeout(timerTimeout_1);
  2746. timerTimeout_1 = null;
  2747. }
  2748. }
  2749. };
  2750. var resolve = once(function (res) {
  2751. // cache resolved
  2752. factory.resolved = ensureCtor(res, baseCtor);
  2753. // invoke callbacks only if this is not a synchronous resolve
  2754. // (async resolves are shimmed as synchronous during SSR)
  2755. if (!sync_1) {
  2756. forceRender_1(true);
  2757. }
  2758. else {
  2759. owners_1.length = 0;
  2760. }
  2761. });
  2762. var reject_1 = once(function (reason) {
  2763. process.env.NODE_ENV !== 'production' &&
  2764. warn("Failed to resolve async component: ".concat(String(factory)) +
  2765. (reason ? "\nReason: ".concat(reason) : ''));
  2766. if (isDef(factory.errorComp)) {
  2767. factory.error = true;
  2768. forceRender_1(true);
  2769. }
  2770. });
  2771. var res_1 = factory(resolve, reject_1);
  2772. if (isObject(res_1)) {
  2773. if (isPromise(res_1)) {
  2774. // () => Promise
  2775. if (isUndef(factory.resolved)) {
  2776. res_1.then(resolve, reject_1);
  2777. }
  2778. }
  2779. else if (isPromise(res_1.component)) {
  2780. res_1.component.then(resolve, reject_1);
  2781. if (isDef(res_1.error)) {
  2782. factory.errorComp = ensureCtor(res_1.error, baseCtor);
  2783. }
  2784. if (isDef(res_1.loading)) {
  2785. factory.loadingComp = ensureCtor(res_1.loading, baseCtor);
  2786. if (res_1.delay === 0) {
  2787. factory.loading = true;
  2788. }
  2789. else {
  2790. // @ts-expect-error NodeJS timeout type
  2791. timerLoading_1 = setTimeout(function () {
  2792. timerLoading_1 = null;
  2793. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  2794. factory.loading = true;
  2795. forceRender_1(false);
  2796. }
  2797. }, res_1.delay || 200);
  2798. }
  2799. }
  2800. if (isDef(res_1.timeout)) {
  2801. // @ts-expect-error NodeJS timeout type
  2802. timerTimeout_1 = setTimeout(function () {
  2803. timerTimeout_1 = null;
  2804. if (isUndef(factory.resolved)) {
  2805. reject_1(process.env.NODE_ENV !== 'production' ? "timeout (".concat(res_1.timeout, "ms)") : null);
  2806. }
  2807. }, res_1.timeout);
  2808. }
  2809. }
  2810. }
  2811. sync_1 = false;
  2812. // return in case resolved synchronously
  2813. return factory.loading ? factory.loadingComp : factory.resolved;
  2814. }
  2815. }
  2816. function getFirstComponentChild(children) {
  2817. if (isArray(children)) {
  2818. for (var i = 0; i < children.length; i++) {
  2819. var c = children[i];
  2820. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  2821. return c;
  2822. }
  2823. }
  2824. }
  2825. }
  2826. var SIMPLE_NORMALIZE = 1;
  2827. var ALWAYS_NORMALIZE = 2;
  2828. // wrapper function for providing a more flexible interface
  2829. // without getting yelled at by flow
  2830. function createElement$1(context, tag, data, children, normalizationType, alwaysNormalize) {
  2831. if (isArray(data) || isPrimitive(data)) {
  2832. normalizationType = children;
  2833. children = data;
  2834. data = undefined;
  2835. }
  2836. if (isTrue(alwaysNormalize)) {
  2837. normalizationType = ALWAYS_NORMALIZE;
  2838. }
  2839. return _createElement(context, tag, data, children, normalizationType);
  2840. }
  2841. function _createElement(context, tag, data, children, normalizationType) {
  2842. if (isDef(data) && isDef(data.__ob__)) {
  2843. process.env.NODE_ENV !== 'production' &&
  2844. warn("Avoid using observed data object as vnode data: ".concat(JSON.stringify(data), "\n") + 'Always create fresh vnode data objects in each render!', context);
  2845. return createEmptyVNode();
  2846. }
  2847. // object syntax in v-bind
  2848. if (isDef(data) && isDef(data.is)) {
  2849. tag = data.is;
  2850. }
  2851. if (!tag) {
  2852. // in case of component :is set to falsy value
  2853. return createEmptyVNode();
  2854. }
  2855. // warn against non-primitive key
  2856. if (process.env.NODE_ENV !== 'production' && isDef(data) && isDef(data.key) && !isPrimitive(data.key)) {
  2857. warn('Avoid using non-primitive value as key, ' +
  2858. 'use string/number value instead.', context);
  2859. }
  2860. // support single function children as default scoped slot
  2861. if (isArray(children) && isFunction(children[0])) {
  2862. data = data || {};
  2863. data.scopedSlots = { default: children[0] };
  2864. children.length = 0;
  2865. }
  2866. if (normalizationType === ALWAYS_NORMALIZE) {
  2867. children = normalizeChildren(children);
  2868. }
  2869. else if (normalizationType === SIMPLE_NORMALIZE) {
  2870. children = simpleNormalizeChildren(children);
  2871. }
  2872. var vnode, ns;
  2873. if (typeof tag === 'string') {
  2874. var Ctor = void 0;
  2875. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  2876. if (config.isReservedTag(tag)) {
  2877. // platform built-in elements
  2878. if (process.env.NODE_ENV !== 'production' &&
  2879. isDef(data) &&
  2880. isDef(data.nativeOn) &&
  2881. data.tag !== 'component') {
  2882. warn("The .native modifier for v-on is only valid on components but it was used on <".concat(tag, ">."), context);
  2883. }
  2884. vnode = new VNode(config.parsePlatformTagName(tag), data, children, undefined, undefined, context);
  2885. }
  2886. else if ((!data || !data.pre) &&
  2887. isDef((Ctor = resolveAsset(context.$options, 'components', tag)))) {
  2888. // component
  2889. vnode = createComponent(Ctor, data, context, children, tag);
  2890. }
  2891. else {
  2892. // unknown or unlisted namespaced elements
  2893. // check at runtime because it may get assigned a namespace when its
  2894. // parent normalizes children
  2895. vnode = new VNode(tag, data, children, undefined, undefined, context);
  2896. }
  2897. }
  2898. else {
  2899. // direct component options / constructor
  2900. vnode = createComponent(tag, data, context, children);
  2901. }
  2902. if (isArray(vnode)) {
  2903. return vnode;
  2904. }
  2905. else if (isDef(vnode)) {
  2906. if (isDef(ns))
  2907. applyNS(vnode, ns);
  2908. if (isDef(data))
  2909. registerDeepBindings(data);
  2910. return vnode;
  2911. }
  2912. else {
  2913. return createEmptyVNode();
  2914. }
  2915. }
  2916. function applyNS(vnode, ns, force) {
  2917. vnode.ns = ns;
  2918. if (vnode.tag === 'foreignObject') {
  2919. // use default namespace inside foreignObject
  2920. ns = undefined;
  2921. force = true;
  2922. }
  2923. if (isDef(vnode.children)) {
  2924. for (var i = 0, l = vnode.children.length; i < l; i++) {
  2925. var child = vnode.children[i];
  2926. if (isDef(child.tag) &&
  2927. (isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  2928. applyNS(child, ns, force);
  2929. }
  2930. }
  2931. }
  2932. }
  2933. // ref #5318
  2934. // necessary to ensure parent re-render when deep bindings like :style and
  2935. // :class are used on slot nodes
  2936. function registerDeepBindings(data) {
  2937. if (isObject(data.style)) {
  2938. traverse(data.style);
  2939. }
  2940. if (isObject(data.class)) {
  2941. traverse(data.class);
  2942. }
  2943. }
  2944. /**
  2945. * @internal this function needs manual public type declaration because it relies
  2946. * on previously manually authored types from Vue 2
  2947. */
  2948. function h(type, props, children) {
  2949. if (!currentInstance) {
  2950. process.env.NODE_ENV !== 'production' &&
  2951. warn("globally imported h() can only be invoked when there is an active " +
  2952. "component instance, e.g. synchronously in a component's render or setup function.");
  2953. }
  2954. return createElement$1(currentInstance, type, props, children, 2, true);
  2955. }
  2956. function handleError(err, vm, info) {
  2957. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  2958. // See: https://github.com/vuejs/vuex/issues/1505
  2959. pushTarget();
  2960. try {
  2961. if (vm) {
  2962. var cur = vm;
  2963. while ((cur = cur.$parent)) {
  2964. var hooks = cur.$options.errorCaptured;
  2965. if (hooks) {
  2966. for (var i = 0; i < hooks.length; i++) {
  2967. try {
  2968. var capture = hooks[i].call(cur, err, vm, info) === false;
  2969. if (capture)
  2970. return;
  2971. }
  2972. catch (e) {
  2973. globalHandleError(e, cur, 'errorCaptured hook');
  2974. }
  2975. }
  2976. }
  2977. }
  2978. }
  2979. globalHandleError(err, vm, info);
  2980. }
  2981. finally {
  2982. popTarget();
  2983. }
  2984. }
  2985. function invokeWithErrorHandling(handler, context, args, vm, info) {
  2986. var res;
  2987. try {
  2988. res = args ? handler.apply(context, args) : handler.call(context);
  2989. if (res && !res._isVue && isPromise(res) && !res._handled) {
  2990. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  2991. res._handled = true;
  2992. }
  2993. }
  2994. catch (e) {
  2995. handleError(e, vm, info);
  2996. }
  2997. return res;
  2998. }
  2999. function globalHandleError(err, vm, info) {
  3000. if (config.errorHandler) {
  3001. try {
  3002. return config.errorHandler.call(null, err, vm, info);
  3003. }
  3004. catch (e) {
  3005. // if the user intentionally throws the original error in the handler,
  3006. // do not log it twice
  3007. if (e !== err) {
  3008. logError(e, null, 'config.errorHandler');
  3009. }
  3010. }
  3011. }
  3012. logError(err, vm, info);
  3013. }
  3014. function logError(err, vm, info) {
  3015. if (process.env.NODE_ENV !== 'production') {
  3016. warn("Error in ".concat(info, ": \"").concat(err.toString(), "\""), vm);
  3017. }
  3018. /* istanbul ignore else */
  3019. if (inBrowser && typeof console !== 'undefined') {
  3020. console.error(err);
  3021. }
  3022. else {
  3023. throw err;
  3024. }
  3025. }
  3026. /* globals MutationObserver */
  3027. var isUsingMicroTask = false;
  3028. var callbacks = [];
  3029. var pending = false;
  3030. function flushCallbacks() {
  3031. pending = false;
  3032. var copies = callbacks.slice(0);
  3033. callbacks.length = 0;
  3034. for (var i = 0; i < copies.length; i++) {
  3035. copies[i]();
  3036. }
  3037. }
  3038. // Here we have async deferring wrappers using microtasks.
  3039. // In 2.5 we used (macro) tasks (in combination with microtasks).
  3040. // However, it has subtle problems when state is changed right before repaint
  3041. // (e.g. #6813, out-in transitions).
  3042. // Also, using (macro) tasks in event handler would cause some weird behaviors
  3043. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  3044. // So we now use microtasks everywhere, again.
  3045. // A major drawback of this tradeoff is that there are some scenarios
  3046. // where microtasks have too high a priority and fire in between supposedly
  3047. // sequential events (e.g. #4521, #6690, which have workarounds)
  3048. // or even between bubbling of the same event (#6566).
  3049. var timerFunc;
  3050. // The nextTick behavior leverages the microtask queue, which can be accessed
  3051. // via either native Promise.then or MutationObserver.
  3052. // MutationObserver has wider support, however it is seriously bugged in
  3053. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  3054. // completely stops working after triggering a few times... so, if native
  3055. // Promise is available, we will use it:
  3056. /* istanbul ignore next, $flow-disable-line */
  3057. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  3058. var p_1 = Promise.resolve();
  3059. timerFunc = function () {
  3060. p_1.then(flushCallbacks);
  3061. // In problematic UIWebViews, Promise.then doesn't completely break, but
  3062. // it can get stuck in a weird state where callbacks are pushed into the
  3063. // microtask queue but the queue isn't being flushed, until the browser
  3064. // needs to do some other work, e.g. handle a timer. Therefore we can
  3065. // "force" the microtask queue to be flushed by adding an empty timer.
  3066. if (isIOS)
  3067. setTimeout(noop);
  3068. };
  3069. isUsingMicroTask = true;
  3070. }
  3071. else if (!isIE &&
  3072. typeof MutationObserver !== 'undefined' &&
  3073. (isNative(MutationObserver) ||
  3074. // PhantomJS and iOS 7.x
  3075. MutationObserver.toString() === '[object MutationObserverConstructor]')) {
  3076. // Use MutationObserver where native Promise is not available,
  3077. // e.g. PhantomJS, iOS7, Android 4.4
  3078. // (#6466 MutationObserver is unreliable in IE11)
  3079. var counter_1 = 1;
  3080. var observer = new MutationObserver(flushCallbacks);
  3081. var textNode_1 = document.createTextNode(String(counter_1));
  3082. observer.observe(textNode_1, {
  3083. characterData: true
  3084. });
  3085. timerFunc = function () {
  3086. counter_1 = (counter_1 + 1) % 2;
  3087. textNode_1.data = String(counter_1);
  3088. };
  3089. isUsingMicroTask = true;
  3090. }
  3091. else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  3092. // Fallback to setImmediate.
  3093. // Technically it leverages the (macro) task queue,
  3094. // but it is still a better choice than setTimeout.
  3095. timerFunc = function () {
  3096. setImmediate(flushCallbacks);
  3097. };
  3098. }
  3099. else {
  3100. // Fallback to setTimeout.
  3101. timerFunc = function () {
  3102. setTimeout(flushCallbacks, 0);
  3103. };
  3104. }
  3105. /**
  3106. * @internal
  3107. */
  3108. function nextTick(cb, ctx) {
  3109. var _resolve;
  3110. callbacks.push(function () {
  3111. if (cb) {
  3112. try {
  3113. cb.call(ctx);
  3114. }
  3115. catch (e) {
  3116. handleError(e, ctx, 'nextTick');
  3117. }
  3118. }
  3119. else if (_resolve) {
  3120. _resolve(ctx);
  3121. }
  3122. });
  3123. if (!pending) {
  3124. pending = true;
  3125. timerFunc();
  3126. }
  3127. // $flow-disable-line
  3128. if (!cb && typeof Promise !== 'undefined') {
  3129. return new Promise(function (resolve) {
  3130. _resolve = resolve;
  3131. });
  3132. }
  3133. }
  3134. function useCssModule(name) {
  3135. if (name === void 0) { name = '$style'; }
  3136. /* istanbul ignore else */
  3137. {
  3138. if (!currentInstance) {
  3139. process.env.NODE_ENV !== 'production' && warn("useCssModule must be called inside setup()");
  3140. return emptyObject;
  3141. }
  3142. var mod = currentInstance[name];
  3143. if (!mod) {
  3144. process.env.NODE_ENV !== 'production' &&
  3145. warn("Current instance does not have CSS module named \"".concat(name, "\"."));
  3146. return emptyObject;
  3147. }
  3148. return mod;
  3149. }
  3150. }
  3151. /**
  3152. * Runtime helper for SFC's CSS variable injection feature.
  3153. * @private
  3154. */
  3155. function useCssVars(getter) {
  3156. if (!inBrowser && !false)
  3157. return;
  3158. var instance = currentInstance;
  3159. if (!instance) {
  3160. process.env.NODE_ENV !== 'production' &&
  3161. warn("useCssVars is called without current active component instance.");
  3162. return;
  3163. }
  3164. watchPostEffect(function () {
  3165. var el = instance.$el;
  3166. var vars = getter(instance, instance._setupProxy);
  3167. if (el && el.nodeType === 1) {
  3168. var style = el.style;
  3169. for (var key in vars) {
  3170. style.setProperty("--".concat(key), vars[key]);
  3171. }
  3172. }
  3173. });
  3174. }
  3175. /**
  3176. * v3-compatible async component API.
  3177. * @internal the type is manually declared in <root>/types/v3-define-async-component.d.ts
  3178. * because it relies on existing manual types
  3179. */
  3180. function defineAsyncComponent(source) {
  3181. if (isFunction(source)) {
  3182. source = { loader: source };
  3183. }
  3184. var loader = source.loader, loadingComponent = source.loadingComponent, errorComponent = source.errorComponent, _a = source.delay, delay = _a === void 0 ? 200 : _a, timeout = source.timeout, // undefined = never times out
  3185. _b = source.suspensible, // undefined = never times out
  3186. suspensible = _b === void 0 ? false : _b, // in Vue 3 default is true
  3187. userOnError = source.onError;
  3188. if (process.env.NODE_ENV !== 'production' && suspensible) {
  3189. warn("The suspensible option for async components is not supported in Vue2. It is ignored.");
  3190. }
  3191. var pendingRequest = null;
  3192. var retries = 0;
  3193. var retry = function () {
  3194. retries++;
  3195. pendingRequest = null;
  3196. return load();
  3197. };
  3198. var load = function () {
  3199. var thisRequest;
  3200. return (pendingRequest ||
  3201. (thisRequest = pendingRequest =
  3202. loader()
  3203. .catch(function (err) {
  3204. err = err instanceof Error ? err : new Error(String(err));
  3205. if (userOnError) {
  3206. return new Promise(function (resolve, reject) {
  3207. var userRetry = function () { return resolve(retry()); };
  3208. var userFail = function () { return reject(err); };
  3209. userOnError(err, userRetry, userFail, retries + 1);
  3210. });
  3211. }
  3212. else {
  3213. throw err;
  3214. }
  3215. })
  3216. .then(function (comp) {
  3217. if (thisRequest !== pendingRequest && pendingRequest) {
  3218. return pendingRequest;
  3219. }
  3220. if (process.env.NODE_ENV !== 'production' && !comp) {
  3221. warn("Async component loader resolved to undefined. " +
  3222. "If you are using retry(), make sure to return its return value.");
  3223. }
  3224. // interop module default
  3225. if (comp &&
  3226. (comp.__esModule || comp[Symbol.toStringTag] === 'Module')) {
  3227. comp = comp.default;
  3228. }
  3229. if (process.env.NODE_ENV !== 'production' && comp && !isObject(comp) && !isFunction(comp)) {
  3230. throw new Error("Invalid async component load result: ".concat(comp));
  3231. }
  3232. return comp;
  3233. })));
  3234. };
  3235. return function () {
  3236. var component = load();
  3237. return {
  3238. component: component,
  3239. delay: delay,
  3240. timeout: timeout,
  3241. error: errorComponent,
  3242. loading: loadingComponent
  3243. };
  3244. };
  3245. }
  3246. function createLifeCycle(hookName) {
  3247. return function (fn, target) {
  3248. if (target === void 0) { target = currentInstance; }
  3249. if (!target) {
  3250. process.env.NODE_ENV !== 'production' &&
  3251. warn("".concat(formatName(hookName), " is called when there is no active component instance to be ") +
  3252. "associated with. " +
  3253. "Lifecycle injection APIs can only be used during execution of setup().");
  3254. return;
  3255. }
  3256. return injectHook(target, hookName, fn);
  3257. };
  3258. }
  3259. function formatName(name) {
  3260. if (name === 'beforeDestroy') {
  3261. name = 'beforeUnmount';
  3262. }
  3263. else if (name === 'destroyed') {
  3264. name = 'unmounted';
  3265. }
  3266. return "on".concat(name[0].toUpperCase() + name.slice(1));
  3267. }
  3268. function injectHook(instance, hookName, fn) {
  3269. var options = instance.$options;
  3270. options[hookName] = mergeLifecycleHook(options[hookName], fn);
  3271. }
  3272. var onBeforeMount = createLifeCycle('beforeMount');
  3273. var onMounted = createLifeCycle('mounted');
  3274. var onBeforeUpdate = createLifeCycle('beforeUpdate');
  3275. var onUpdated = createLifeCycle('updated');
  3276. var onBeforeUnmount = createLifeCycle('beforeDestroy');
  3277. var onUnmounted = createLifeCycle('destroyed');
  3278. var onActivated = createLifeCycle('activated');
  3279. var onDeactivated = createLifeCycle('deactivated');
  3280. var onServerPrefetch = createLifeCycle('serverPrefetch');
  3281. var onRenderTracked = createLifeCycle('renderTracked');
  3282. var onRenderTriggered = createLifeCycle('renderTriggered');
  3283. var injectErrorCapturedHook = createLifeCycle('errorCaptured');
  3284. function onErrorCaptured(hook, target) {
  3285. if (target === void 0) { target = currentInstance; }
  3286. injectErrorCapturedHook(hook, target);
  3287. }
  3288. /**
  3289. * Note: also update dist/vue.runtime.mjs when adding new exports to this file.
  3290. */
  3291. var version = '2.7.16';
  3292. /**
  3293. * @internal type is manually declared in <root>/types/v3-define-component.d.ts
  3294. */
  3295. function defineComponent(options) {
  3296. return options;
  3297. }
  3298. var seenObjects = new _Set();
  3299. /**
  3300. * Recursively traverse an object to evoke all converted
  3301. * getters, so that every nested property inside the object
  3302. * is collected as a "deep" dependency.
  3303. */
  3304. function traverse(val) {
  3305. _traverse(val, seenObjects);
  3306. seenObjects.clear();
  3307. return val;
  3308. }
  3309. function _traverse(val, seen) {
  3310. var i, keys;
  3311. var isA = isArray(val);
  3312. if ((!isA && !isObject(val)) ||
  3313. val.__v_skip /* ReactiveFlags.SKIP */ ||
  3314. Object.isFrozen(val) ||
  3315. val instanceof VNode) {
  3316. return;
  3317. }
  3318. if (val.__ob__) {
  3319. var depId = val.__ob__.dep.id;
  3320. if (seen.has(depId)) {
  3321. return;
  3322. }
  3323. seen.add(depId);
  3324. }
  3325. if (isA) {
  3326. i = val.length;
  3327. while (i--)
  3328. _traverse(val[i], seen);
  3329. }
  3330. else if (isRef(val)) {
  3331. _traverse(val.value, seen);
  3332. }
  3333. else {
  3334. keys = Object.keys(val);
  3335. i = keys.length;
  3336. while (i--)
  3337. _traverse(val[keys[i]], seen);
  3338. }
  3339. }
  3340. var uid$1 = 0;
  3341. /**
  3342. * A watcher parses an expression, collects dependencies,
  3343. * and fires callback when the expression value changes.
  3344. * This is used for both the $watch() api and directives.
  3345. * @internal
  3346. */
  3347. var Watcher = /** @class */ (function () {
  3348. function Watcher(vm, expOrFn, cb, options, isRenderWatcher) {
  3349. recordEffectScope(this,
  3350. // if the active effect scope is manually created (not a component scope),
  3351. // prioritize it
  3352. activeEffectScope && !activeEffectScope._vm
  3353. ? activeEffectScope
  3354. : vm
  3355. ? vm._scope
  3356. : undefined);
  3357. if ((this.vm = vm) && isRenderWatcher) {
  3358. vm._watcher = this;
  3359. }
  3360. // options
  3361. if (options) {
  3362. this.deep = !!options.deep;
  3363. this.user = !!options.user;
  3364. this.lazy = !!options.lazy;
  3365. this.sync = !!options.sync;
  3366. this.before = options.before;
  3367. if (process.env.NODE_ENV !== 'production') {
  3368. this.onTrack = options.onTrack;
  3369. this.onTrigger = options.onTrigger;
  3370. }
  3371. }
  3372. else {
  3373. this.deep = this.user = this.lazy = this.sync = false;
  3374. }
  3375. this.cb = cb;
  3376. this.id = ++uid$1; // uid for batching
  3377. this.active = true;
  3378. this.post = false;
  3379. this.dirty = this.lazy; // for lazy watchers
  3380. this.deps = [];
  3381. this.newDeps = [];
  3382. this.depIds = new _Set();
  3383. this.newDepIds = new _Set();
  3384. this.expression = process.env.NODE_ENV !== 'production' ? expOrFn.toString() : '';
  3385. // parse expression for getter
  3386. if (isFunction(expOrFn)) {
  3387. this.getter = expOrFn;
  3388. }
  3389. else {
  3390. this.getter = parsePath(expOrFn);
  3391. if (!this.getter) {
  3392. this.getter = noop;
  3393. process.env.NODE_ENV !== 'production' &&
  3394. warn("Failed watching path: \"".concat(expOrFn, "\" ") +
  3395. 'Watcher only accepts simple dot-delimited paths. ' +
  3396. 'For full control, use a function instead.', vm);
  3397. }
  3398. }
  3399. this.value = this.lazy ? undefined : this.get();
  3400. }
  3401. /**
  3402. * Evaluate the getter, and re-collect dependencies.
  3403. */
  3404. Watcher.prototype.get = function () {
  3405. pushTarget(this);
  3406. var value;
  3407. var vm = this.vm;
  3408. try {
  3409. value = this.getter.call(vm, vm);
  3410. }
  3411. catch (e) {
  3412. if (this.user) {
  3413. handleError(e, vm, "getter for watcher \"".concat(this.expression, "\""));
  3414. }
  3415. else {
  3416. throw e;
  3417. }
  3418. }
  3419. finally {
  3420. // "touch" every property so they are all tracked as
  3421. // dependencies for deep watching
  3422. if (this.deep) {
  3423. traverse(value);
  3424. }
  3425. popTarget();
  3426. this.cleanupDeps();
  3427. }
  3428. return value;
  3429. };
  3430. /**
  3431. * Add a dependency to this directive.
  3432. */
  3433. Watcher.prototype.addDep = function (dep) {
  3434. var id = dep.id;
  3435. if (!this.newDepIds.has(id)) {
  3436. this.newDepIds.add(id);
  3437. this.newDeps.push(dep);
  3438. if (!this.depIds.has(id)) {
  3439. dep.addSub(this);
  3440. }
  3441. }
  3442. };
  3443. /**
  3444. * Clean up for dependency collection.
  3445. */
  3446. Watcher.prototype.cleanupDeps = function () {
  3447. var i = this.deps.length;
  3448. while (i--) {
  3449. var dep = this.deps[i];
  3450. if (!this.newDepIds.has(dep.id)) {
  3451. dep.removeSub(this);
  3452. }
  3453. }
  3454. var tmp = this.depIds;
  3455. this.depIds = this.newDepIds;
  3456. this.newDepIds = tmp;
  3457. this.newDepIds.clear();
  3458. tmp = this.deps;
  3459. this.deps = this.newDeps;
  3460. this.newDeps = tmp;
  3461. this.newDeps.length = 0;
  3462. };
  3463. /**
  3464. * Subscriber interface.
  3465. * Will be called when a dependency changes.
  3466. */
  3467. Watcher.prototype.update = function () {
  3468. /* istanbul ignore else */
  3469. if (this.lazy) {
  3470. this.dirty = true;
  3471. }
  3472. else if (this.sync) {
  3473. this.run();
  3474. }
  3475. else {
  3476. queueWatcher(this);
  3477. }
  3478. };
  3479. /**
  3480. * Scheduler job interface.
  3481. * Will be called by the scheduler.
  3482. */
  3483. Watcher.prototype.run = function () {
  3484. if (this.active) {
  3485. var value = this.get();
  3486. if (value !== this.value ||
  3487. // Deep watchers and watchers on Object/Arrays should fire even
  3488. // when the value is the same, because the value may
  3489. // have mutated.
  3490. isObject(value) ||
  3491. this.deep) {
  3492. // set new value
  3493. var oldValue = this.value;
  3494. this.value = value;
  3495. if (this.user) {
  3496. var info = "callback for watcher \"".concat(this.expression, "\"");
  3497. invokeWithErrorHandling(this.cb, this.vm, [value, oldValue], this.vm, info);
  3498. }
  3499. else {
  3500. this.cb.call(this.vm, value, oldValue);
  3501. }
  3502. }
  3503. }
  3504. };
  3505. /**
  3506. * Evaluate the value of the watcher.
  3507. * This only gets called for lazy watchers.
  3508. */
  3509. Watcher.prototype.evaluate = function () {
  3510. this.value = this.get();
  3511. this.dirty = false;
  3512. };
  3513. /**
  3514. * Depend on all deps collected by this watcher.
  3515. */
  3516. Watcher.prototype.depend = function () {
  3517. var i = this.deps.length;
  3518. while (i--) {
  3519. this.deps[i].depend();
  3520. }
  3521. };
  3522. /**
  3523. * Remove self from all dependencies' subscriber list.
  3524. */
  3525. Watcher.prototype.teardown = function () {
  3526. if (this.vm && !this.vm._isBeingDestroyed) {
  3527. remove$2(this.vm._scope.effects, this);
  3528. }
  3529. if (this.active) {
  3530. var i = this.deps.length;
  3531. while (i--) {
  3532. this.deps[i].removeSub(this);
  3533. }
  3534. this.active = false;
  3535. if (this.onStop) {
  3536. this.onStop();
  3537. }
  3538. }
  3539. };
  3540. return Watcher;
  3541. }());
  3542. var mark;
  3543. var measure;
  3544. if (process.env.NODE_ENV !== 'production') {
  3545. var perf_1 = inBrowser && window.performance;
  3546. /* istanbul ignore if */
  3547. if (perf_1 &&
  3548. // @ts-ignore
  3549. perf_1.mark &&
  3550. // @ts-ignore
  3551. perf_1.measure &&
  3552. // @ts-ignore
  3553. perf_1.clearMarks &&
  3554. // @ts-ignore
  3555. perf_1.clearMeasures) {
  3556. mark = function (tag) { return perf_1.mark(tag); };
  3557. measure = function (name, startTag, endTag) {
  3558. perf_1.measure(name, startTag, endTag);
  3559. perf_1.clearMarks(startTag);
  3560. perf_1.clearMarks(endTag);
  3561. // perf.clearMeasures(name)
  3562. };
  3563. }
  3564. }
  3565. function initEvents(vm) {
  3566. vm._events = Object.create(null);
  3567. vm._hasHookEvent = false;
  3568. // init parent attached events
  3569. var listeners = vm.$options._parentListeners;
  3570. if (listeners) {
  3571. updateComponentListeners(vm, listeners);
  3572. }
  3573. }
  3574. var target$1;
  3575. function add$1(event, fn) {
  3576. target$1.$on(event, fn);
  3577. }
  3578. function remove$1(event, fn) {
  3579. target$1.$off(event, fn);
  3580. }
  3581. function createOnceHandler$1(event, fn) {
  3582. var _target = target$1;
  3583. return function onceHandler() {
  3584. var res = fn.apply(null, arguments);
  3585. if (res !== null) {
  3586. _target.$off(event, onceHandler);
  3587. }
  3588. };
  3589. }
  3590. function updateComponentListeners(vm, listeners, oldListeners) {
  3591. target$1 = vm;
  3592. updateListeners(listeners, oldListeners || {}, add$1, remove$1, createOnceHandler$1, vm);
  3593. target$1 = undefined;
  3594. }
  3595. function eventsMixin(Vue) {
  3596. var hookRE = /^hook:/;
  3597. Vue.prototype.$on = function (event, fn) {
  3598. var vm = this;
  3599. if (isArray(event)) {
  3600. for (var i = 0, l = event.length; i < l; i++) {
  3601. vm.$on(event[i], fn);
  3602. }
  3603. }
  3604. else {
  3605. (vm._events[event] || (vm._events[event] = [])).push(fn);
  3606. // optimize hook:event cost by using a boolean flag marked at registration
  3607. // instead of a hash lookup
  3608. if (hookRE.test(event)) {
  3609. vm._hasHookEvent = true;
  3610. }
  3611. }
  3612. return vm;
  3613. };
  3614. Vue.prototype.$once = function (event, fn) {
  3615. var vm = this;
  3616. function on() {
  3617. vm.$off(event, on);
  3618. fn.apply(vm, arguments);
  3619. }
  3620. on.fn = fn;
  3621. vm.$on(event, on);
  3622. return vm;
  3623. };
  3624. Vue.prototype.$off = function (event, fn) {
  3625. var vm = this;
  3626. // all
  3627. if (!arguments.length) {
  3628. vm._events = Object.create(null);
  3629. return vm;
  3630. }
  3631. // array of events
  3632. if (isArray(event)) {
  3633. for (var i_1 = 0, l = event.length; i_1 < l; i_1++) {
  3634. vm.$off(event[i_1], fn);
  3635. }
  3636. return vm;
  3637. }
  3638. // specific event
  3639. var cbs = vm._events[event];
  3640. if (!cbs) {
  3641. return vm;
  3642. }
  3643. if (!fn) {
  3644. vm._events[event] = null;
  3645. return vm;
  3646. }
  3647. // specific handler
  3648. var cb;
  3649. var i = cbs.length;
  3650. while (i--) {
  3651. cb = cbs[i];
  3652. if (cb === fn || cb.fn === fn) {
  3653. cbs.splice(i, 1);
  3654. break;
  3655. }
  3656. }
  3657. return vm;
  3658. };
  3659. Vue.prototype.$emit = function (event) {
  3660. var vm = this;
  3661. if (process.env.NODE_ENV !== 'production') {
  3662. var lowerCaseEvent = event.toLowerCase();
  3663. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  3664. tip("Event \"".concat(lowerCaseEvent, "\" is emitted in component ") +
  3665. "".concat(formatComponentName(vm), " but the handler is registered for \"").concat(event, "\". ") +
  3666. "Note that HTML attributes are case-insensitive and you cannot use " +
  3667. "v-on to listen to camelCase events when using in-DOM templates. " +
  3668. "You should probably use \"".concat(hyphenate(event), "\" instead of \"").concat(event, "\"."));
  3669. }
  3670. }
  3671. var cbs = vm._events[event];
  3672. if (cbs) {
  3673. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  3674. var args = toArray(arguments, 1);
  3675. var info = "event handler for \"".concat(event, "\"");
  3676. for (var i = 0, l = cbs.length; i < l; i++) {
  3677. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  3678. }
  3679. }
  3680. return vm;
  3681. };
  3682. }
  3683. var activeInstance = null;
  3684. var isUpdatingChildComponent = false;
  3685. function setActiveInstance(vm) {
  3686. var prevActiveInstance = activeInstance;
  3687. activeInstance = vm;
  3688. return function () {
  3689. activeInstance = prevActiveInstance;
  3690. };
  3691. }
  3692. function initLifecycle(vm) {
  3693. var options = vm.$options;
  3694. // locate first non-abstract parent
  3695. var parent = options.parent;
  3696. if (parent && !options.abstract) {
  3697. while (parent.$options.abstract && parent.$parent) {
  3698. parent = parent.$parent;
  3699. }
  3700. parent.$children.push(vm);
  3701. }
  3702. vm.$parent = parent;
  3703. vm.$root = parent ? parent.$root : vm;
  3704. vm.$children = [];
  3705. vm.$refs = {};
  3706. vm._provided = parent ? parent._provided : Object.create(null);
  3707. vm._watcher = null;
  3708. vm._inactive = null;
  3709. vm._directInactive = false;
  3710. vm._isMounted = false;
  3711. vm._isDestroyed = false;
  3712. vm._isBeingDestroyed = false;
  3713. }
  3714. function lifecycleMixin(Vue) {
  3715. Vue.prototype._update = function (vnode, hydrating) {
  3716. var vm = this;
  3717. var prevEl = vm.$el;
  3718. var prevVnode = vm._vnode;
  3719. var restoreActiveInstance = setActiveInstance(vm);
  3720. vm._vnode = vnode;
  3721. // Vue.prototype.__patch__ is injected in entry points
  3722. // based on the rendering backend used.
  3723. if (!prevVnode) {
  3724. // initial render
  3725. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  3726. }
  3727. else {
  3728. // updates
  3729. vm.$el = vm.__patch__(prevVnode, vnode);
  3730. }
  3731. restoreActiveInstance();
  3732. // update __vue__ reference
  3733. if (prevEl) {
  3734. prevEl.__vue__ = null;
  3735. }
  3736. if (vm.$el) {
  3737. vm.$el.__vue__ = vm;
  3738. }
  3739. // if parent is an HOC, update its $el as well
  3740. var wrapper = vm;
  3741. while (wrapper &&
  3742. wrapper.$vnode &&
  3743. wrapper.$parent &&
  3744. wrapper.$vnode === wrapper.$parent._vnode) {
  3745. wrapper.$parent.$el = wrapper.$el;
  3746. wrapper = wrapper.$parent;
  3747. }
  3748. // updated hook is called by the scheduler to ensure that children are
  3749. // updated in a parent's updated hook.
  3750. };
  3751. Vue.prototype.$forceUpdate = function () {
  3752. var vm = this;
  3753. if (vm._watcher) {
  3754. vm._watcher.update();
  3755. }
  3756. };
  3757. Vue.prototype.$destroy = function () {
  3758. var vm = this;
  3759. if (vm._isBeingDestroyed) {
  3760. return;
  3761. }
  3762. callHook$1(vm, 'beforeDestroy');
  3763. vm._isBeingDestroyed = true;
  3764. // remove self from parent
  3765. var parent = vm.$parent;
  3766. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  3767. remove$2(parent.$children, vm);
  3768. }
  3769. // teardown scope. this includes both the render watcher and other
  3770. // watchers created
  3771. vm._scope.stop();
  3772. // remove reference from data ob
  3773. // frozen object may not have observer.
  3774. if (vm._data.__ob__) {
  3775. vm._data.__ob__.vmCount--;
  3776. }
  3777. // call the last hook...
  3778. vm._isDestroyed = true;
  3779. // invoke destroy hooks on current rendered tree
  3780. vm.__patch__(vm._vnode, null);
  3781. // fire destroyed hook
  3782. callHook$1(vm, 'destroyed');
  3783. // turn off all instance listeners.
  3784. vm.$off();
  3785. // remove __vue__ reference
  3786. if (vm.$el) {
  3787. vm.$el.__vue__ = null;
  3788. }
  3789. // release circular reference (#6759)
  3790. if (vm.$vnode) {
  3791. vm.$vnode.parent = null;
  3792. }
  3793. };
  3794. }
  3795. function mountComponent(vm, el, hydrating) {
  3796. vm.$el = el;
  3797. if (!vm.$options.render) {
  3798. // @ts-expect-error invalid type
  3799. vm.$options.render = createEmptyVNode;
  3800. if (process.env.NODE_ENV !== 'production') {
  3801. /* istanbul ignore if */
  3802. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  3803. vm.$options.el ||
  3804. el) {
  3805. warn('You are using the runtime-only build of Vue where the template ' +
  3806. 'compiler is not available. Either pre-compile the templates into ' +
  3807. 'render functions, or use the compiler-included build.', vm);
  3808. }
  3809. else {
  3810. warn('Failed to mount component: template or render function not defined.', vm);
  3811. }
  3812. }
  3813. }
  3814. callHook$1(vm, 'beforeMount');
  3815. var updateComponent;
  3816. /* istanbul ignore if */
  3817. if (process.env.NODE_ENV !== 'production' && config.performance && mark) {
  3818. updateComponent = function () {
  3819. var name = vm._name;
  3820. var id = vm._uid;
  3821. var startTag = "vue-perf-start:".concat(id);
  3822. var endTag = "vue-perf-end:".concat(id);
  3823. mark(startTag);
  3824. var vnode = vm._render();
  3825. mark(endTag);
  3826. measure("vue ".concat(name, " render"), startTag, endTag);
  3827. mark(startTag);
  3828. vm._update(vnode, hydrating);
  3829. mark(endTag);
  3830. measure("vue ".concat(name, " patch"), startTag, endTag);
  3831. };
  3832. }
  3833. else {
  3834. updateComponent = function () {
  3835. vm._update(vm._render(), hydrating);
  3836. };
  3837. }
  3838. var watcherOptions = {
  3839. before: function () {
  3840. if (vm._isMounted && !vm._isDestroyed) {
  3841. callHook$1(vm, 'beforeUpdate');
  3842. }
  3843. }
  3844. };
  3845. if (process.env.NODE_ENV !== 'production') {
  3846. watcherOptions.onTrack = function (e) { return callHook$1(vm, 'renderTracked', [e]); };
  3847. watcherOptions.onTrigger = function (e) { return callHook$1(vm, 'renderTriggered', [e]); };
  3848. }
  3849. // we set this to vm._watcher inside the watcher's constructor
  3850. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  3851. // component's mounted hook), which relies on vm._watcher being already defined
  3852. new Watcher(vm, updateComponent, noop, watcherOptions, true /* isRenderWatcher */);
  3853. hydrating = false;
  3854. // flush buffer for flush: "pre" watchers queued in setup()
  3855. var preWatchers = vm._preWatchers;
  3856. if (preWatchers) {
  3857. for (var i = 0; i < preWatchers.length; i++) {
  3858. preWatchers[i].run();
  3859. }
  3860. }
  3861. // manually mounted instance, call mounted on self
  3862. // mounted is called for render-created child components in its inserted hook
  3863. if (vm.$vnode == null) {
  3864. vm._isMounted = true;
  3865. callHook$1(vm, 'mounted');
  3866. }
  3867. return vm;
  3868. }
  3869. function updateChildComponent(vm, propsData, listeners, parentVnode, renderChildren) {
  3870. if (process.env.NODE_ENV !== 'production') {
  3871. isUpdatingChildComponent = true;
  3872. }
  3873. // determine whether component has slot children
  3874. // we need to do this before overwriting $options._renderChildren.
  3875. // check if there are dynamic scopedSlots (hand-written or compiled but with
  3876. // dynamic slot names). Static scoped slots compiled from template has the
  3877. // "$stable" marker.
  3878. var newScopedSlots = parentVnode.data.scopedSlots;
  3879. var oldScopedSlots = vm.$scopedSlots;
  3880. var hasDynamicScopedSlot = !!((newScopedSlots && !newScopedSlots.$stable) ||
  3881. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  3882. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key) ||
  3883. (!newScopedSlots && vm.$scopedSlots.$key));
  3884. // Any static slot children from the parent may have changed during parent's
  3885. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  3886. // update is necessary to ensure correctness.
  3887. var needsForceUpdate = !!(renderChildren || // has new static slots
  3888. vm.$options._renderChildren || // has old static slots
  3889. hasDynamicScopedSlot);
  3890. var prevVNode = vm.$vnode;
  3891. vm.$options._parentVnode = parentVnode;
  3892. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  3893. if (vm._vnode) {
  3894. // update child tree's parent
  3895. vm._vnode.parent = parentVnode;
  3896. }
  3897. vm.$options._renderChildren = renderChildren;
  3898. // update $attrs and $listeners hash
  3899. // these are also reactive so they may trigger child update if the child
  3900. // used them during render
  3901. var attrs = parentVnode.data.attrs || emptyObject;
  3902. if (vm._attrsProxy) {
  3903. // force update if attrs are accessed and has changed since it may be
  3904. // passed to a child component.
  3905. if (syncSetupProxy(vm._attrsProxy, attrs, (prevVNode.data && prevVNode.data.attrs) || emptyObject, vm, '$attrs')) {
  3906. needsForceUpdate = true;
  3907. }
  3908. }
  3909. vm.$attrs = attrs;
  3910. // update listeners
  3911. listeners = listeners || emptyObject;
  3912. var prevListeners = vm.$options._parentListeners;
  3913. if (vm._listenersProxy) {
  3914. syncSetupProxy(vm._listenersProxy, listeners, prevListeners || emptyObject, vm, '$listeners');
  3915. }
  3916. vm.$listeners = vm.$options._parentListeners = listeners;
  3917. updateComponentListeners(vm, listeners, prevListeners);
  3918. // update props
  3919. if (propsData && vm.$options.props) {
  3920. toggleObserving(false);
  3921. var props = vm._props;
  3922. var propKeys = vm.$options._propKeys || [];
  3923. for (var i = 0; i < propKeys.length; i++) {
  3924. var key = propKeys[i];
  3925. var propOptions = vm.$options.props; // wtf flow?
  3926. props[key] = validateProp(key, propOptions, propsData, vm);
  3927. }
  3928. toggleObserving(true);
  3929. // keep a copy of raw propsData
  3930. vm.$options.propsData = propsData;
  3931. }
  3932. // resolve slots + force update if has children
  3933. if (needsForceUpdate) {
  3934. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  3935. vm.$forceUpdate();
  3936. }
  3937. if (process.env.NODE_ENV !== 'production') {
  3938. isUpdatingChildComponent = false;
  3939. }
  3940. }
  3941. function isInInactiveTree(vm) {
  3942. while (vm && (vm = vm.$parent)) {
  3943. if (vm._inactive)
  3944. return true;
  3945. }
  3946. return false;
  3947. }
  3948. function activateChildComponent(vm, direct) {
  3949. if (direct) {
  3950. vm._directInactive = false;
  3951. if (isInInactiveTree(vm)) {
  3952. return;
  3953. }
  3954. }
  3955. else if (vm._directInactive) {
  3956. return;
  3957. }
  3958. if (vm._inactive || vm._inactive === null) {
  3959. vm._inactive = false;
  3960. for (var i = 0; i < vm.$children.length; i++) {
  3961. activateChildComponent(vm.$children[i]);
  3962. }
  3963. callHook$1(vm, 'activated');
  3964. }
  3965. }
  3966. function deactivateChildComponent(vm, direct) {
  3967. if (direct) {
  3968. vm._directInactive = true;
  3969. if (isInInactiveTree(vm)) {
  3970. return;
  3971. }
  3972. }
  3973. if (!vm._inactive) {
  3974. vm._inactive = true;
  3975. for (var i = 0; i < vm.$children.length; i++) {
  3976. deactivateChildComponent(vm.$children[i]);
  3977. }
  3978. callHook$1(vm, 'deactivated');
  3979. }
  3980. }
  3981. function callHook$1(vm, hook, args, setContext) {
  3982. if (setContext === void 0) { setContext = true; }
  3983. // #7573 disable dep collection when invoking lifecycle hooks
  3984. pushTarget();
  3985. var prevInst = currentInstance;
  3986. var prevScope = getCurrentScope();
  3987. setContext && setCurrentInstance(vm);
  3988. var handlers = vm.$options[hook];
  3989. var info = "".concat(hook, " hook");
  3990. if (handlers) {
  3991. for (var i = 0, j = handlers.length; i < j; i++) {
  3992. invokeWithErrorHandling(handlers[i], vm, args || null, vm, info);
  3993. }
  3994. }
  3995. if (vm._hasHookEvent) {
  3996. vm.$emit('hook:' + hook);
  3997. }
  3998. if (setContext) {
  3999. setCurrentInstance(prevInst);
  4000. prevScope && prevScope.on();
  4001. }
  4002. popTarget();
  4003. }
  4004. var MAX_UPDATE_COUNT = 100;
  4005. var queue = [];
  4006. var activatedChildren = [];
  4007. var has = {};
  4008. var circular = {};
  4009. var waiting = false;
  4010. var flushing = false;
  4011. var index = 0;
  4012. /**
  4013. * Reset the scheduler's state.
  4014. */
  4015. function resetSchedulerState() {
  4016. index = queue.length = activatedChildren.length = 0;
  4017. has = {};
  4018. if (process.env.NODE_ENV !== 'production') {
  4019. circular = {};
  4020. }
  4021. waiting = flushing = false;
  4022. }
  4023. // Async edge case #6566 requires saving the timestamp when event listeners are
  4024. // attached. However, calling performance.now() has a perf overhead especially
  4025. // if the page has thousands of event listeners. Instead, we take a timestamp
  4026. // every time the scheduler flushes and use that for all event listeners
  4027. // attached during that flush.
  4028. var currentFlushTimestamp = 0;
  4029. // Async edge case fix requires storing an event listener's attach timestamp.
  4030. var getNow = Date.now;
  4031. // Determine what event timestamp the browser is using. Annoyingly, the
  4032. // timestamp can either be hi-res (relative to page load) or low-res
  4033. // (relative to UNIX epoch), so in order to compare time we have to use the
  4034. // same timestamp type when saving the flush timestamp.
  4035. // All IE versions use low-res event timestamps, and have problematic clock
  4036. // implementations (#9632)
  4037. if (inBrowser && !isIE) {
  4038. var performance_1 = window.performance;
  4039. if (performance_1 &&
  4040. typeof performance_1.now === 'function' &&
  4041. getNow() > document.createEvent('Event').timeStamp) {
  4042. // if the event timestamp, although evaluated AFTER the Date.now(), is
  4043. // smaller than it, it means the event is using a hi-res timestamp,
  4044. // and we need to use the hi-res version for event listener timestamps as
  4045. // well.
  4046. getNow = function () { return performance_1.now(); };
  4047. }
  4048. }
  4049. var sortCompareFn = function (a, b) {
  4050. if (a.post) {
  4051. if (!b.post)
  4052. return 1;
  4053. }
  4054. else if (b.post) {
  4055. return -1;
  4056. }
  4057. return a.id - b.id;
  4058. };
  4059. /**
  4060. * Flush both queues and run the watchers.
  4061. */
  4062. function flushSchedulerQueue() {
  4063. currentFlushTimestamp = getNow();
  4064. flushing = true;
  4065. var watcher, id;
  4066. // Sort queue before flush.
  4067. // This ensures that:
  4068. // 1. Components are updated from parent to child. (because parent is always
  4069. // created before the child)
  4070. // 2. A component's user watchers are run before its render watcher (because
  4071. // user watchers are created before the render watcher)
  4072. // 3. If a component is destroyed during a parent component's watcher run,
  4073. // its watchers can be skipped.
  4074. queue.sort(sortCompareFn);
  4075. // do not cache length because more watchers might be pushed
  4076. // as we run existing watchers
  4077. for (index = 0; index < queue.length; index++) {
  4078. watcher = queue[index];
  4079. if (watcher.before) {
  4080. watcher.before();
  4081. }
  4082. id = watcher.id;
  4083. has[id] = null;
  4084. watcher.run();
  4085. // in dev build, check and stop circular updates.
  4086. if (process.env.NODE_ENV !== 'production' && has[id] != null) {
  4087. circular[id] = (circular[id] || 0) + 1;
  4088. if (circular[id] > MAX_UPDATE_COUNT) {
  4089. warn('You may have an infinite update loop ' +
  4090. (watcher.user
  4091. ? "in watcher with expression \"".concat(watcher.expression, "\"")
  4092. : "in a component render function."), watcher.vm);
  4093. break;
  4094. }
  4095. }
  4096. }
  4097. // keep copies of post queues before resetting state
  4098. var activatedQueue = activatedChildren.slice();
  4099. var updatedQueue = queue.slice();
  4100. resetSchedulerState();
  4101. // call component updated and activated hooks
  4102. callActivatedHooks(activatedQueue);
  4103. callUpdatedHooks(updatedQueue);
  4104. cleanupDeps();
  4105. // devtool hook
  4106. /* istanbul ignore if */
  4107. if (devtools && config.devtools) {
  4108. devtools.emit('flush');
  4109. }
  4110. }
  4111. function callUpdatedHooks(queue) {
  4112. var i = queue.length;
  4113. while (i--) {
  4114. var watcher = queue[i];
  4115. var vm = watcher.vm;
  4116. if (vm && vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  4117. callHook$1(vm, 'updated');
  4118. }
  4119. }
  4120. }
  4121. /**
  4122. * Queue a kept-alive component that was activated during patch.
  4123. * The queue will be processed after the entire tree has been patched.
  4124. */
  4125. function queueActivatedComponent(vm) {
  4126. // setting _inactive to false here so that a render function can
  4127. // rely on checking whether it's in an inactive tree (e.g. router-view)
  4128. vm._inactive = false;
  4129. activatedChildren.push(vm);
  4130. }
  4131. function callActivatedHooks(queue) {
  4132. for (var i = 0; i < queue.length; i++) {
  4133. queue[i]._inactive = true;
  4134. activateChildComponent(queue[i], true /* true */);
  4135. }
  4136. }
  4137. /**
  4138. * Push a watcher into the watcher queue.
  4139. * Jobs with duplicate IDs will be skipped unless it's
  4140. * pushed when the queue is being flushed.
  4141. */
  4142. function queueWatcher(watcher) {
  4143. var id = watcher.id;
  4144. if (has[id] != null) {
  4145. return;
  4146. }
  4147. if (watcher === Dep.target && watcher.noRecurse) {
  4148. return;
  4149. }
  4150. has[id] = true;
  4151. if (!flushing) {
  4152. queue.push(watcher);
  4153. }
  4154. else {
  4155. // if already flushing, splice the watcher based on its id
  4156. // if already past its id, it will be run next immediately.
  4157. var i = queue.length - 1;
  4158. while (i > index && queue[i].id > watcher.id) {
  4159. i--;
  4160. }
  4161. queue.splice(i + 1, 0, watcher);
  4162. }
  4163. // queue the flush
  4164. if (!waiting) {
  4165. waiting = true;
  4166. if (process.env.NODE_ENV !== 'production' && !config.async) {
  4167. flushSchedulerQueue();
  4168. return;
  4169. }
  4170. nextTick(flushSchedulerQueue);
  4171. }
  4172. }
  4173. function initProvide(vm) {
  4174. var provideOption = vm.$options.provide;
  4175. if (provideOption) {
  4176. var provided = isFunction(provideOption)
  4177. ? provideOption.call(vm)
  4178. : provideOption;
  4179. if (!isObject(provided)) {
  4180. return;
  4181. }
  4182. var source = resolveProvided(vm);
  4183. // IE9 doesn't support Object.getOwnPropertyDescriptors so we have to
  4184. // iterate the keys ourselves.
  4185. var keys = hasSymbol ? Reflect.ownKeys(provided) : Object.keys(provided);
  4186. for (var i = 0; i < keys.length; i++) {
  4187. var key = keys[i];
  4188. Object.defineProperty(source, key, Object.getOwnPropertyDescriptor(provided, key));
  4189. }
  4190. }
  4191. }
  4192. function initInjections(vm) {
  4193. var result = resolveInject(vm.$options.inject, vm);
  4194. if (result) {
  4195. toggleObserving(false);
  4196. Object.keys(result).forEach(function (key) {
  4197. /* istanbul ignore else */
  4198. if (process.env.NODE_ENV !== 'production') {
  4199. defineReactive(vm, key, result[key], function () {
  4200. warn("Avoid mutating an injected value directly since the changes will be " +
  4201. "overwritten whenever the provided component re-renders. " +
  4202. "injection being mutated: \"".concat(key, "\""), vm);
  4203. });
  4204. }
  4205. else {
  4206. defineReactive(vm, key, result[key]);
  4207. }
  4208. });
  4209. toggleObserving(true);
  4210. }
  4211. }
  4212. function resolveInject(inject, vm) {
  4213. if (inject) {
  4214. // inject is :any because flow is not smart enough to figure out cached
  4215. var result = Object.create(null);
  4216. var keys = hasSymbol ? Reflect.ownKeys(inject) : Object.keys(inject);
  4217. for (var i = 0; i < keys.length; i++) {
  4218. var key = keys[i];
  4219. // #6574 in case the inject object is observed...
  4220. if (key === '__ob__')
  4221. continue;
  4222. var provideKey = inject[key].from;
  4223. if (provideKey in vm._provided) {
  4224. result[key] = vm._provided[provideKey];
  4225. }
  4226. else if ('default' in inject[key]) {
  4227. var provideDefault = inject[key].default;
  4228. result[key] = isFunction(provideDefault)
  4229. ? provideDefault.call(vm)
  4230. : provideDefault;
  4231. }
  4232. else if (process.env.NODE_ENV !== 'production') {
  4233. warn("Injection \"".concat(key, "\" not found"), vm);
  4234. }
  4235. }
  4236. return result;
  4237. }
  4238. }
  4239. function FunctionalRenderContext(data, props, children, parent, Ctor) {
  4240. var _this = this;
  4241. var options = Ctor.options;
  4242. // ensure the createElement function in functional components
  4243. // gets a unique context - this is necessary for correct named slot check
  4244. var contextVm;
  4245. if (hasOwn(parent, '_uid')) {
  4246. contextVm = Object.create(parent);
  4247. contextVm._original = parent;
  4248. }
  4249. else {
  4250. // the context vm passed in is a functional context as well.
  4251. // in this case we want to make sure we are able to get a hold to the
  4252. // real context instance.
  4253. contextVm = parent;
  4254. // @ts-ignore
  4255. parent = parent._original;
  4256. }
  4257. var isCompiled = isTrue(options._compiled);
  4258. var needNormalization = !isCompiled;
  4259. this.data = data;
  4260. this.props = props;
  4261. this.children = children;
  4262. this.parent = parent;
  4263. this.listeners = data.on || emptyObject;
  4264. this.injections = resolveInject(options.inject, parent);
  4265. this.slots = function () {
  4266. if (!_this.$slots) {
  4267. normalizeScopedSlots(parent, data.scopedSlots, (_this.$slots = resolveSlots(children, parent)));
  4268. }
  4269. return _this.$slots;
  4270. };
  4271. Object.defineProperty(this, 'scopedSlots', {
  4272. enumerable: true,
  4273. get: function () {
  4274. return normalizeScopedSlots(parent, data.scopedSlots, this.slots());
  4275. }
  4276. });
  4277. // support for compiled functional template
  4278. if (isCompiled) {
  4279. // exposing $options for renderStatic()
  4280. this.$options = options;
  4281. // pre-resolve slots for renderSlot()
  4282. this.$slots = this.slots();
  4283. this.$scopedSlots = normalizeScopedSlots(parent, data.scopedSlots, this.$slots);
  4284. }
  4285. if (options._scopeId) {
  4286. this._c = function (a, b, c, d) {
  4287. var vnode = createElement$1(contextVm, a, b, c, d, needNormalization);
  4288. if (vnode && !isArray(vnode)) {
  4289. vnode.fnScopeId = options._scopeId;
  4290. vnode.fnContext = parent;
  4291. }
  4292. return vnode;
  4293. };
  4294. }
  4295. else {
  4296. this._c = function (a, b, c, d) {
  4297. return createElement$1(contextVm, a, b, c, d, needNormalization);
  4298. };
  4299. }
  4300. }
  4301. installRenderHelpers(FunctionalRenderContext.prototype);
  4302. function createFunctionalComponent(Ctor, propsData, data, contextVm, children) {
  4303. var options = Ctor.options;
  4304. var props = {};
  4305. var propOptions = options.props;
  4306. if (isDef(propOptions)) {
  4307. for (var key in propOptions) {
  4308. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  4309. }
  4310. }
  4311. else {
  4312. if (isDef(data.attrs))
  4313. mergeProps(props, data.attrs);
  4314. if (isDef(data.props))
  4315. mergeProps(props, data.props);
  4316. }
  4317. var renderContext = new FunctionalRenderContext(data, props, children, contextVm, Ctor);
  4318. var vnode = options.render.call(null, renderContext._c, renderContext);
  4319. if (vnode instanceof VNode) {
  4320. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext);
  4321. }
  4322. else if (isArray(vnode)) {
  4323. var vnodes = normalizeChildren(vnode) || [];
  4324. var res = new Array(vnodes.length);
  4325. for (var i = 0; i < vnodes.length; i++) {
  4326. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  4327. }
  4328. return res;
  4329. }
  4330. }
  4331. function cloneAndMarkFunctionalResult(vnode, data, contextVm, options, renderContext) {
  4332. // #7817 clone node before setting fnContext, otherwise if the node is reused
  4333. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  4334. // that should not be matched to match.
  4335. var clone = cloneVNode(vnode);
  4336. clone.fnContext = contextVm;
  4337. clone.fnOptions = options;
  4338. if (process.env.NODE_ENV !== 'production') {
  4339. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext =
  4340. renderContext;
  4341. }
  4342. if (data.slot) {
  4343. (clone.data || (clone.data = {})).slot = data.slot;
  4344. }
  4345. return clone;
  4346. }
  4347. function mergeProps(to, from) {
  4348. for (var key in from) {
  4349. to[camelize(key)] = from[key];
  4350. }
  4351. }
  4352. function getComponentName(options) {
  4353. return options.name || options.__name || options._componentTag;
  4354. }
  4355. // inline hooks to be invoked on component VNodes during patch
  4356. var componentVNodeHooks = {
  4357. init: function (vnode, hydrating) {
  4358. if (vnode.componentInstance &&
  4359. !vnode.componentInstance._isDestroyed &&
  4360. vnode.data.keepAlive) {
  4361. // kept-alive components, treat as a patch
  4362. var mountedNode = vnode; // work around flow
  4363. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  4364. }
  4365. else {
  4366. var child = (vnode.componentInstance = createComponentInstanceForVnode(vnode, activeInstance));
  4367. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  4368. }
  4369. },
  4370. prepatch: function (oldVnode, vnode) {
  4371. var options = vnode.componentOptions;
  4372. var child = (vnode.componentInstance = oldVnode.componentInstance);
  4373. updateChildComponent(child, options.propsData, // updated props
  4374. options.listeners, // updated listeners
  4375. vnode, // new parent vnode
  4376. options.children // new children
  4377. );
  4378. },
  4379. insert: function (vnode) {
  4380. var context = vnode.context, componentInstance = vnode.componentInstance;
  4381. if (!componentInstance._isMounted) {
  4382. componentInstance._isMounted = true;
  4383. callHook$1(componentInstance, 'mounted');
  4384. }
  4385. if (vnode.data.keepAlive) {
  4386. if (context._isMounted) {
  4387. // vue-router#1212
  4388. // During updates, a kept-alive component's child components may
  4389. // change, so directly walking the tree here may call activated hooks
  4390. // on incorrect children. Instead we push them into a queue which will
  4391. // be processed after the whole patch process ended.
  4392. queueActivatedComponent(componentInstance);
  4393. }
  4394. else {
  4395. activateChildComponent(componentInstance, true /* direct */);
  4396. }
  4397. }
  4398. },
  4399. destroy: function (vnode) {
  4400. var componentInstance = vnode.componentInstance;
  4401. if (!componentInstance._isDestroyed) {
  4402. if (!vnode.data.keepAlive) {
  4403. componentInstance.$destroy();
  4404. }
  4405. else {
  4406. deactivateChildComponent(componentInstance, true /* direct */);
  4407. }
  4408. }
  4409. }
  4410. };
  4411. var hooksToMerge = Object.keys(componentVNodeHooks);
  4412. function createComponent(Ctor, data, context, children, tag) {
  4413. if (isUndef(Ctor)) {
  4414. return;
  4415. }
  4416. var baseCtor = context.$options._base;
  4417. // plain options object: turn it into a constructor
  4418. if (isObject(Ctor)) {
  4419. Ctor = baseCtor.extend(Ctor);
  4420. }
  4421. // if at this stage it's not a constructor or an async component factory,
  4422. // reject.
  4423. if (typeof Ctor !== 'function') {
  4424. if (process.env.NODE_ENV !== 'production') {
  4425. warn("Invalid Component definition: ".concat(String(Ctor)), context);
  4426. }
  4427. return;
  4428. }
  4429. // async component
  4430. var asyncFactory;
  4431. // @ts-expect-error
  4432. if (isUndef(Ctor.cid)) {
  4433. asyncFactory = Ctor;
  4434. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  4435. if (Ctor === undefined) {
  4436. // return a placeholder node for async component, which is rendered
  4437. // as a comment node but preserves all the raw information for the node.
  4438. // the information will be used for async server-rendering and hydration.
  4439. return createAsyncPlaceholder(asyncFactory, data, context, children, tag);
  4440. }
  4441. }
  4442. data = data || {};
  4443. // resolve constructor options in case global mixins are applied after
  4444. // component constructor creation
  4445. resolveConstructorOptions(Ctor);
  4446. // transform component v-model data into props & events
  4447. if (isDef(data.model)) {
  4448. // @ts-expect-error
  4449. transformModel(Ctor.options, data);
  4450. }
  4451. // extract props
  4452. // @ts-expect-error
  4453. var propsData = extractPropsFromVNodeData(data, Ctor, tag);
  4454. // functional component
  4455. // @ts-expect-error
  4456. if (isTrue(Ctor.options.functional)) {
  4457. return createFunctionalComponent(Ctor, propsData, data, context, children);
  4458. }
  4459. // extract listeners, since these needs to be treated as
  4460. // child component listeners instead of DOM listeners
  4461. var listeners = data.on;
  4462. // replace with listeners with .native modifier
  4463. // so it gets processed during parent component patch.
  4464. data.on = data.nativeOn;
  4465. // @ts-expect-error
  4466. if (isTrue(Ctor.options.abstract)) {
  4467. // abstract components do not keep anything
  4468. // other than props & listeners & slot
  4469. // work around flow
  4470. var slot = data.slot;
  4471. data = {};
  4472. if (slot) {
  4473. data.slot = slot;
  4474. }
  4475. }
  4476. // install component management hooks onto the placeholder node
  4477. installComponentHooks(data);
  4478. // return a placeholder vnode
  4479. // @ts-expect-error
  4480. var name = getComponentName(Ctor.options) || tag;
  4481. var vnode = new VNode(
  4482. // @ts-expect-error
  4483. "vue-component-".concat(Ctor.cid).concat(name ? "-".concat(name) : ''), data, undefined, undefined, undefined, context,
  4484. // @ts-expect-error
  4485. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children }, asyncFactory);
  4486. return vnode;
  4487. }
  4488. function createComponentInstanceForVnode(
  4489. // we know it's MountedComponentVNode but flow doesn't
  4490. vnode,
  4491. // activeInstance in lifecycle state
  4492. parent) {
  4493. var options = {
  4494. _isComponent: true,
  4495. _parentVnode: vnode,
  4496. parent: parent
  4497. };
  4498. // check inline-template render functions
  4499. var inlineTemplate = vnode.data.inlineTemplate;
  4500. if (isDef(inlineTemplate)) {
  4501. options.render = inlineTemplate.render;
  4502. options.staticRenderFns = inlineTemplate.staticRenderFns;
  4503. }
  4504. return new vnode.componentOptions.Ctor(options);
  4505. }
  4506. function installComponentHooks(data) {
  4507. var hooks = data.hook || (data.hook = {});
  4508. for (var i = 0; i < hooksToMerge.length; i++) {
  4509. var key = hooksToMerge[i];
  4510. var existing = hooks[key];
  4511. var toMerge = componentVNodeHooks[key];
  4512. // @ts-expect-error
  4513. if (existing !== toMerge && !(existing && existing._merged)) {
  4514. hooks[key] = existing ? mergeHook(toMerge, existing) : toMerge;
  4515. }
  4516. }
  4517. }
  4518. function mergeHook(f1, f2) {
  4519. var merged = function (a, b) {
  4520. // flow complains about extra args which is why we use any
  4521. f1(a, b);
  4522. f2(a, b);
  4523. };
  4524. merged._merged = true;
  4525. return merged;
  4526. }
  4527. // transform component v-model info (value and callback) into
  4528. // prop and event handler respectively.
  4529. function transformModel(options, data) {
  4530. var prop = (options.model && options.model.prop) || 'value';
  4531. var event = (options.model && options.model.event) || 'input';
  4532. (data.attrs || (data.attrs = {}))[prop] = data.model.value;
  4533. var on = data.on || (data.on = {});
  4534. var existing = on[event];
  4535. var callback = data.model.callback;
  4536. if (isDef(existing)) {
  4537. if (isArray(existing)
  4538. ? existing.indexOf(callback) === -1
  4539. : existing !== callback) {
  4540. on[event] = [callback].concat(existing);
  4541. }
  4542. }
  4543. else {
  4544. on[event] = callback;
  4545. }
  4546. }
  4547. var warn = noop;
  4548. var tip = noop;
  4549. var generateComponentTrace; // work around flow check
  4550. var formatComponentName;
  4551. if (process.env.NODE_ENV !== 'production') {
  4552. var hasConsole_1 = typeof console !== 'undefined';
  4553. var classifyRE_1 = /(?:^|[-_])(\w)/g;
  4554. var classify_1 = function (str) {
  4555. return str.replace(classifyRE_1, function (c) { return c.toUpperCase(); }).replace(/[-_]/g, '');
  4556. };
  4557. warn = function (msg, vm) {
  4558. if (vm === void 0) { vm = currentInstance; }
  4559. var trace = vm ? generateComponentTrace(vm) : '';
  4560. if (config.warnHandler) {
  4561. config.warnHandler.call(null, msg, vm, trace);
  4562. }
  4563. else if (hasConsole_1 && !config.silent) {
  4564. console.error("[Vue warn]: ".concat(msg).concat(trace));
  4565. }
  4566. };
  4567. tip = function (msg, vm) {
  4568. if (hasConsole_1 && !config.silent) {
  4569. console.warn("[Vue tip]: ".concat(msg) + (vm ? generateComponentTrace(vm) : ''));
  4570. }
  4571. };
  4572. formatComponentName = function (vm, includeFile) {
  4573. if (vm.$root === vm) {
  4574. return '<Root>';
  4575. }
  4576. var options = isFunction(vm) && vm.cid != null
  4577. ? vm.options
  4578. : vm._isVue
  4579. ? vm.$options || vm.constructor.options
  4580. : vm;
  4581. var name = getComponentName(options);
  4582. var file = options.__file;
  4583. if (!name && file) {
  4584. var match = file.match(/([^/\\]+)\.vue$/);
  4585. name = match && match[1];
  4586. }
  4587. return ((name ? "<".concat(classify_1(name), ">") : "<Anonymous>") +
  4588. (file && includeFile !== false ? " at ".concat(file) : ''));
  4589. };
  4590. var repeat_1 = function (str, n) {
  4591. var res = '';
  4592. while (n) {
  4593. if (n % 2 === 1)
  4594. res += str;
  4595. if (n > 1)
  4596. str += str;
  4597. n >>= 1;
  4598. }
  4599. return res;
  4600. };
  4601. generateComponentTrace = function (vm) {
  4602. if (vm._isVue && vm.$parent) {
  4603. var tree = [];
  4604. var currentRecursiveSequence = 0;
  4605. while (vm) {
  4606. if (tree.length > 0) {
  4607. var last = tree[tree.length - 1];
  4608. if (last.constructor === vm.constructor) {
  4609. currentRecursiveSequence++;
  4610. vm = vm.$parent;
  4611. continue;
  4612. }
  4613. else if (currentRecursiveSequence > 0) {
  4614. tree[tree.length - 1] = [last, currentRecursiveSequence];
  4615. currentRecursiveSequence = 0;
  4616. }
  4617. }
  4618. tree.push(vm);
  4619. vm = vm.$parent;
  4620. }
  4621. return ('\n\nfound in\n\n' +
  4622. tree
  4623. .map(function (vm, i) {
  4624. return "".concat(i === 0 ? '---> ' : repeat_1(' ', 5 + i * 2)).concat(isArray(vm)
  4625. ? "".concat(formatComponentName(vm[0]), "... (").concat(vm[1], " recursive calls)")
  4626. : formatComponentName(vm));
  4627. })
  4628. .join('\n'));
  4629. }
  4630. else {
  4631. return "\n\n(found in ".concat(formatComponentName(vm), ")");
  4632. }
  4633. };
  4634. }
  4635. /**
  4636. * Option overwriting strategies are functions that handle
  4637. * how to merge a parent option value and a child option
  4638. * value into the final value.
  4639. */
  4640. var strats = config.optionMergeStrategies;
  4641. /**
  4642. * Options with restrictions
  4643. */
  4644. if (process.env.NODE_ENV !== 'production') {
  4645. strats.el = strats.propsData = function (parent, child, vm, key) {
  4646. if (!vm) {
  4647. warn("option \"".concat(key, "\" can only be used during instance ") +
  4648. 'creation with the `new` keyword.');
  4649. }
  4650. return defaultStrat(parent, child);
  4651. };
  4652. }
  4653. /**
  4654. * Helper that recursively merges two data objects together.
  4655. */
  4656. function mergeData(to, from, recursive) {
  4657. if (recursive === void 0) { recursive = true; }
  4658. if (!from)
  4659. return to;
  4660. var key, toVal, fromVal;
  4661. var keys = hasSymbol
  4662. ? Reflect.ownKeys(from)
  4663. : Object.keys(from);
  4664. for (var i = 0; i < keys.length; i++) {
  4665. key = keys[i];
  4666. // in case the object is already observed...
  4667. if (key === '__ob__')
  4668. continue;
  4669. toVal = to[key];
  4670. fromVal = from[key];
  4671. if (!recursive || !hasOwn(to, key)) {
  4672. set(to, key, fromVal);
  4673. }
  4674. else if (toVal !== fromVal &&
  4675. isPlainObject(toVal) &&
  4676. isPlainObject(fromVal)) {
  4677. mergeData(toVal, fromVal);
  4678. }
  4679. }
  4680. return to;
  4681. }
  4682. /**
  4683. * Data
  4684. */
  4685. function mergeDataOrFn(parentVal, childVal, vm) {
  4686. if (!vm) {
  4687. // in a Vue.extend merge, both should be functions
  4688. if (!childVal) {
  4689. return parentVal;
  4690. }
  4691. if (!parentVal) {
  4692. return childVal;
  4693. }
  4694. // when parentVal & childVal are both present,
  4695. // we need to return a function that returns the
  4696. // merged result of both functions... no need to
  4697. // check if parentVal is a function here because
  4698. // it has to be a function to pass previous merges.
  4699. return function mergedDataFn() {
  4700. return mergeData(isFunction(childVal) ? childVal.call(this, this) : childVal, isFunction(parentVal) ? parentVal.call(this, this) : parentVal);
  4701. };
  4702. }
  4703. else {
  4704. return function mergedInstanceDataFn() {
  4705. // instance merge
  4706. var instanceData = isFunction(childVal)
  4707. ? childVal.call(vm, vm)
  4708. : childVal;
  4709. var defaultData = isFunction(parentVal)
  4710. ? parentVal.call(vm, vm)
  4711. : parentVal;
  4712. if (instanceData) {
  4713. return mergeData(instanceData, defaultData);
  4714. }
  4715. else {
  4716. return defaultData;
  4717. }
  4718. };
  4719. }
  4720. }
  4721. strats.data = function (parentVal, childVal, vm) {
  4722. if (!vm) {
  4723. if (childVal && typeof childVal !== 'function') {
  4724. process.env.NODE_ENV !== 'production' &&
  4725. warn('The "data" option should be a function ' +
  4726. 'that returns a per-instance value in component ' +
  4727. 'definitions.', vm);
  4728. return parentVal;
  4729. }
  4730. return mergeDataOrFn(parentVal, childVal);
  4731. }
  4732. return mergeDataOrFn(parentVal, childVal, vm);
  4733. };
  4734. /**
  4735. * Hooks and props are merged as arrays.
  4736. */
  4737. function mergeLifecycleHook(parentVal, childVal) {
  4738. var res = childVal
  4739. ? parentVal
  4740. ? parentVal.concat(childVal)
  4741. : isArray(childVal)
  4742. ? childVal
  4743. : [childVal]
  4744. : parentVal;
  4745. return res ? dedupeHooks(res) : res;
  4746. }
  4747. function dedupeHooks(hooks) {
  4748. var res = [];
  4749. for (var i = 0; i < hooks.length; i++) {
  4750. if (res.indexOf(hooks[i]) === -1) {
  4751. res.push(hooks[i]);
  4752. }
  4753. }
  4754. return res;
  4755. }
  4756. LIFECYCLE_HOOKS.forEach(function (hook) {
  4757. strats[hook] = mergeLifecycleHook;
  4758. });
  4759. /**
  4760. * Assets
  4761. *
  4762. * When a vm is present (instance creation), we need to do
  4763. * a three-way merge between constructor options, instance
  4764. * options and parent options.
  4765. */
  4766. function mergeAssets(parentVal, childVal, vm, key) {
  4767. var res = Object.create(parentVal || null);
  4768. if (childVal) {
  4769. process.env.NODE_ENV !== 'production' && assertObjectType(key, childVal, vm);
  4770. return extend(res, childVal);
  4771. }
  4772. else {
  4773. return res;
  4774. }
  4775. }
  4776. ASSET_TYPES.forEach(function (type) {
  4777. strats[type + 's'] = mergeAssets;
  4778. });
  4779. /**
  4780. * Watchers.
  4781. *
  4782. * Watchers hashes should not overwrite one
  4783. * another, so we merge them as arrays.
  4784. */
  4785. strats.watch = function (parentVal, childVal, vm, key) {
  4786. // work around Firefox's Object.prototype.watch...
  4787. //@ts-expect-error work around
  4788. if (parentVal === nativeWatch)
  4789. parentVal = undefined;
  4790. //@ts-expect-error work around
  4791. if (childVal === nativeWatch)
  4792. childVal = undefined;
  4793. /* istanbul ignore if */
  4794. if (!childVal)
  4795. return Object.create(parentVal || null);
  4796. if (process.env.NODE_ENV !== 'production') {
  4797. assertObjectType(key, childVal, vm);
  4798. }
  4799. if (!parentVal)
  4800. return childVal;
  4801. var ret = {};
  4802. extend(ret, parentVal);
  4803. for (var key_1 in childVal) {
  4804. var parent_1 = ret[key_1];
  4805. var child = childVal[key_1];
  4806. if (parent_1 && !isArray(parent_1)) {
  4807. parent_1 = [parent_1];
  4808. }
  4809. ret[key_1] = parent_1 ? parent_1.concat(child) : isArray(child) ? child : [child];
  4810. }
  4811. return ret;
  4812. };
  4813. /**
  4814. * Other object hashes.
  4815. */
  4816. strats.props =
  4817. strats.methods =
  4818. strats.inject =
  4819. strats.computed =
  4820. function (parentVal, childVal, vm, key) {
  4821. if (childVal && process.env.NODE_ENV !== 'production') {
  4822. assertObjectType(key, childVal, vm);
  4823. }
  4824. if (!parentVal)
  4825. return childVal;
  4826. var ret = Object.create(null);
  4827. extend(ret, parentVal);
  4828. if (childVal)
  4829. extend(ret, childVal);
  4830. return ret;
  4831. };
  4832. strats.provide = function (parentVal, childVal) {
  4833. if (!parentVal)
  4834. return childVal;
  4835. return function () {
  4836. var ret = Object.create(null);
  4837. mergeData(ret, isFunction(parentVal) ? parentVal.call(this) : parentVal);
  4838. if (childVal) {
  4839. mergeData(ret, isFunction(childVal) ? childVal.call(this) : childVal, false // non-recursive
  4840. );
  4841. }
  4842. return ret;
  4843. };
  4844. };
  4845. /**
  4846. * Default strategy.
  4847. */
  4848. var defaultStrat = function (parentVal, childVal) {
  4849. return childVal === undefined ? parentVal : childVal;
  4850. };
  4851. /**
  4852. * Validate component names
  4853. */
  4854. function checkComponents(options) {
  4855. for (var key in options.components) {
  4856. validateComponentName(key);
  4857. }
  4858. }
  4859. function validateComponentName(name) {
  4860. if (!new RegExp("^[a-zA-Z][\\-\\.0-9_".concat(unicodeRegExp.source, "]*$")).test(name)) {
  4861. warn('Invalid component name: "' +
  4862. name +
  4863. '". Component names ' +
  4864. 'should conform to valid custom element name in html5 specification.');
  4865. }
  4866. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  4867. warn('Do not use built-in or reserved HTML elements as component ' +
  4868. 'id: ' +
  4869. name);
  4870. }
  4871. }
  4872. /**
  4873. * Ensure all props option syntax are normalized into the
  4874. * Object-based format.
  4875. */
  4876. function normalizeProps(options, vm) {
  4877. var props = options.props;
  4878. if (!props)
  4879. return;
  4880. var res = {};
  4881. var i, val, name;
  4882. if (isArray(props)) {
  4883. i = props.length;
  4884. while (i--) {
  4885. val = props[i];
  4886. if (typeof val === 'string') {
  4887. name = camelize(val);
  4888. res[name] = { type: null };
  4889. }
  4890. else if (process.env.NODE_ENV !== 'production') {
  4891. warn('props must be strings when using array syntax.');
  4892. }
  4893. }
  4894. }
  4895. else if (isPlainObject(props)) {
  4896. for (var key in props) {
  4897. val = props[key];
  4898. name = camelize(key);
  4899. res[name] = isPlainObject(val) ? val : { type: val };
  4900. }
  4901. }
  4902. else if (process.env.NODE_ENV !== 'production') {
  4903. warn("Invalid value for option \"props\": expected an Array or an Object, " +
  4904. "but got ".concat(toRawType(props), "."), vm);
  4905. }
  4906. options.props = res;
  4907. }
  4908. /**
  4909. * Normalize all injections into Object-based format
  4910. */
  4911. function normalizeInject(options, vm) {
  4912. var inject = options.inject;
  4913. if (!inject)
  4914. return;
  4915. var normalized = (options.inject = {});
  4916. if (isArray(inject)) {
  4917. for (var i = 0; i < inject.length; i++) {
  4918. normalized[inject[i]] = { from: inject[i] };
  4919. }
  4920. }
  4921. else if (isPlainObject(inject)) {
  4922. for (var key in inject) {
  4923. var val = inject[key];
  4924. normalized[key] = isPlainObject(val)
  4925. ? extend({ from: key }, val)
  4926. : { from: val };
  4927. }
  4928. }
  4929. else if (process.env.NODE_ENV !== 'production') {
  4930. warn("Invalid value for option \"inject\": expected an Array or an Object, " +
  4931. "but got ".concat(toRawType(inject), "."), vm);
  4932. }
  4933. }
  4934. /**
  4935. * Normalize raw function directives into object format.
  4936. */
  4937. function normalizeDirectives$1(options) {
  4938. var dirs = options.directives;
  4939. if (dirs) {
  4940. for (var key in dirs) {
  4941. var def = dirs[key];
  4942. if (isFunction(def)) {
  4943. dirs[key] = { bind: def, update: def };
  4944. }
  4945. }
  4946. }
  4947. }
  4948. function assertObjectType(name, value, vm) {
  4949. if (!isPlainObject(value)) {
  4950. warn("Invalid value for option \"".concat(name, "\": expected an Object, ") +
  4951. "but got ".concat(toRawType(value), "."), vm);
  4952. }
  4953. }
  4954. /**
  4955. * Merge two option objects into a new one.
  4956. * Core utility used in both instantiation and inheritance.
  4957. */
  4958. function mergeOptions(parent, child, vm) {
  4959. if (process.env.NODE_ENV !== 'production') {
  4960. checkComponents(child);
  4961. }
  4962. if (isFunction(child)) {
  4963. // @ts-expect-error
  4964. child = child.options;
  4965. }
  4966. normalizeProps(child, vm);
  4967. normalizeInject(child, vm);
  4968. normalizeDirectives$1(child);
  4969. // Apply extends and mixins on the child options,
  4970. // but only if it is a raw options object that isn't
  4971. // the result of another mergeOptions call.
  4972. // Only merged options has the _base property.
  4973. if (!child._base) {
  4974. if (child.extends) {
  4975. parent = mergeOptions(parent, child.extends, vm);
  4976. }
  4977. if (child.mixins) {
  4978. for (var i = 0, l = child.mixins.length; i < l; i++) {
  4979. parent = mergeOptions(parent, child.mixins[i], vm);
  4980. }
  4981. }
  4982. }
  4983. var options = {};
  4984. var key;
  4985. for (key in parent) {
  4986. mergeField(key);
  4987. }
  4988. for (key in child) {
  4989. if (!hasOwn(parent, key)) {
  4990. mergeField(key);
  4991. }
  4992. }
  4993. function mergeField(key) {
  4994. var strat = strats[key] || defaultStrat;
  4995. options[key] = strat(parent[key], child[key], vm, key);
  4996. }
  4997. return options;
  4998. }
  4999. /**
  5000. * Resolve an asset.
  5001. * This function is used because child instances need access
  5002. * to assets defined in its ancestor chain.
  5003. */
  5004. function resolveAsset(options, type, id, warnMissing) {
  5005. /* istanbul ignore if */
  5006. if (typeof id !== 'string') {
  5007. return;
  5008. }
  5009. var assets = options[type];
  5010. // check local registration variations first
  5011. if (hasOwn(assets, id))
  5012. return assets[id];
  5013. var camelizedId = camelize(id);
  5014. if (hasOwn(assets, camelizedId))
  5015. return assets[camelizedId];
  5016. var PascalCaseId = capitalize(camelizedId);
  5017. if (hasOwn(assets, PascalCaseId))
  5018. return assets[PascalCaseId];
  5019. // fallback to prototype chain
  5020. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  5021. if (process.env.NODE_ENV !== 'production' && warnMissing && !res) {
  5022. warn('Failed to resolve ' + type.slice(0, -1) + ': ' + id);
  5023. }
  5024. return res;
  5025. }
  5026. function validateProp(key, propOptions, propsData, vm) {
  5027. var prop = propOptions[key];
  5028. var absent = !hasOwn(propsData, key);
  5029. var value = propsData[key];
  5030. // boolean casting
  5031. var booleanIndex = getTypeIndex(Boolean, prop.type);
  5032. if (booleanIndex > -1) {
  5033. if (absent && !hasOwn(prop, 'default')) {
  5034. value = false;
  5035. }
  5036. else if (value === '' || value === hyphenate(key)) {
  5037. // only cast empty string / same name to boolean if
  5038. // boolean has higher priority
  5039. var stringIndex = getTypeIndex(String, prop.type);
  5040. if (stringIndex < 0 || booleanIndex < stringIndex) {
  5041. value = true;
  5042. }
  5043. }
  5044. }
  5045. // check default value
  5046. if (value === undefined) {
  5047. value = getPropDefaultValue(vm, prop, key);
  5048. // since the default value is a fresh copy,
  5049. // make sure to observe it.
  5050. var prevShouldObserve = shouldObserve;
  5051. toggleObserving(true);
  5052. observe(value);
  5053. toggleObserving(prevShouldObserve);
  5054. }
  5055. if (process.env.NODE_ENV !== 'production') {
  5056. assertProp(prop, key, value, vm, absent);
  5057. }
  5058. return value;
  5059. }
  5060. /**
  5061. * Get the default value of a prop.
  5062. */
  5063. function getPropDefaultValue(vm, prop, key) {
  5064. // no default, return undefined
  5065. if (!hasOwn(prop, 'default')) {
  5066. return undefined;
  5067. }
  5068. var def = prop.default;
  5069. // warn against non-factory defaults for Object & Array
  5070. if (process.env.NODE_ENV !== 'production' && isObject(def)) {
  5071. warn('Invalid default value for prop "' +
  5072. key +
  5073. '": ' +
  5074. 'Props with type Object/Array must use a factory function ' +
  5075. 'to return the default value.', vm);
  5076. }
  5077. // the raw prop value was also undefined from previous render,
  5078. // return previous default value to avoid unnecessary watcher trigger
  5079. if (vm &&
  5080. vm.$options.propsData &&
  5081. vm.$options.propsData[key] === undefined &&
  5082. vm._props[key] !== undefined) {
  5083. return vm._props[key];
  5084. }
  5085. // call factory function for non-Function types
  5086. // a value is Function if its prototype is function even across different execution context
  5087. return isFunction(def) && getType(prop.type) !== 'Function'
  5088. ? def.call(vm)
  5089. : def;
  5090. }
  5091. /**
  5092. * Assert whether a prop is valid.
  5093. */
  5094. function assertProp(prop, name, value, vm, absent) {
  5095. if (prop.required && absent) {
  5096. warn('Missing required prop: "' + name + '"', vm);
  5097. return;
  5098. }
  5099. if (value == null && !prop.required) {
  5100. return;
  5101. }
  5102. var type = prop.type;
  5103. var valid = !type || type === true;
  5104. var expectedTypes = [];
  5105. if (type) {
  5106. if (!isArray(type)) {
  5107. type = [type];
  5108. }
  5109. for (var i = 0; i < type.length && !valid; i++) {
  5110. var assertedType = assertType(value, type[i], vm);
  5111. expectedTypes.push(assertedType.expectedType || '');
  5112. valid = assertedType.valid;
  5113. }
  5114. }
  5115. var haveExpectedTypes = expectedTypes.some(function (t) { return t; });
  5116. if (!valid && haveExpectedTypes) {
  5117. warn(getInvalidTypeMessage(name, value, expectedTypes), vm);
  5118. return;
  5119. }
  5120. var validator = prop.validator;
  5121. if (validator) {
  5122. if (!validator(value)) {
  5123. warn('Invalid prop: custom validator check failed for prop "' + name + '".', vm);
  5124. }
  5125. }
  5126. }
  5127. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol|BigInt)$/;
  5128. function assertType(value, type, vm) {
  5129. var valid;
  5130. var expectedType = getType(type);
  5131. if (simpleCheckRE.test(expectedType)) {
  5132. var t = typeof value;
  5133. valid = t === expectedType.toLowerCase();
  5134. // for primitive wrapper objects
  5135. if (!valid && t === 'object') {
  5136. valid = value instanceof type;
  5137. }
  5138. }
  5139. else if (expectedType === 'Object') {
  5140. valid = isPlainObject(value);
  5141. }
  5142. else if (expectedType === 'Array') {
  5143. valid = isArray(value);
  5144. }
  5145. else {
  5146. try {
  5147. valid = value instanceof type;
  5148. }
  5149. catch (e) {
  5150. warn('Invalid prop type: "' + String(type) + '" is not a constructor', vm);
  5151. valid = false;
  5152. }
  5153. }
  5154. return {
  5155. valid: valid,
  5156. expectedType: expectedType
  5157. };
  5158. }
  5159. var functionTypeCheckRE = /^\s*function (\w+)/;
  5160. /**
  5161. * Use function string name to check built-in types,
  5162. * because a simple equality check will fail when running
  5163. * across different vms / iframes.
  5164. */
  5165. function getType(fn) {
  5166. var match = fn && fn.toString().match(functionTypeCheckRE);
  5167. return match ? match[1] : '';
  5168. }
  5169. function isSameType(a, b) {
  5170. return getType(a) === getType(b);
  5171. }
  5172. function getTypeIndex(type, expectedTypes) {
  5173. if (!isArray(expectedTypes)) {
  5174. return isSameType(expectedTypes, type) ? 0 : -1;
  5175. }
  5176. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  5177. if (isSameType(expectedTypes[i], type)) {
  5178. return i;
  5179. }
  5180. }
  5181. return -1;
  5182. }
  5183. function getInvalidTypeMessage(name, value, expectedTypes) {
  5184. var message = "Invalid prop: type check failed for prop \"".concat(name, "\".") +
  5185. " Expected ".concat(expectedTypes.map(capitalize).join(', '));
  5186. var expectedType = expectedTypes[0];
  5187. var receivedType = toRawType(value);
  5188. // check if we need to specify expected value
  5189. if (expectedTypes.length === 1 &&
  5190. isExplicable(expectedType) &&
  5191. isExplicable(typeof value) &&
  5192. !isBoolean(expectedType, receivedType)) {
  5193. message += " with value ".concat(styleValue(value, expectedType));
  5194. }
  5195. message += ", got ".concat(receivedType, " ");
  5196. // check if we need to specify received value
  5197. if (isExplicable(receivedType)) {
  5198. message += "with value ".concat(styleValue(value, receivedType), ".");
  5199. }
  5200. return message;
  5201. }
  5202. function styleValue(value, type) {
  5203. if (type === 'String') {
  5204. return "\"".concat(value, "\"");
  5205. }
  5206. else if (type === 'Number') {
  5207. return "".concat(Number(value));
  5208. }
  5209. else {
  5210. return "".concat(value);
  5211. }
  5212. }
  5213. var EXPLICABLE_TYPES = ['string', 'number', 'boolean'];
  5214. function isExplicable(value) {
  5215. return EXPLICABLE_TYPES.some(function (elem) { return value.toLowerCase() === elem; });
  5216. }
  5217. function isBoolean() {
  5218. var args = [];
  5219. for (var _i = 0; _i < arguments.length; _i++) {
  5220. args[_i] = arguments[_i];
  5221. }
  5222. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; });
  5223. }
  5224. /* not type checking this file because flow doesn't play well with Proxy */
  5225. var initProxy;
  5226. if (process.env.NODE_ENV !== 'production') {
  5227. var allowedGlobals_1 = makeMap('Infinity,undefined,NaN,isFinite,isNaN,' +
  5228. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  5229. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,' +
  5230. 'require' // for Webpack/Browserify
  5231. );
  5232. var warnNonPresent_1 = function (target, key) {
  5233. warn("Property or method \"".concat(key, "\" is not defined on the instance but ") +
  5234. 'referenced during render. Make sure that this property is reactive, ' +
  5235. 'either in the data option, or for class-based components, by ' +
  5236. 'initializing the property. ' +
  5237. 'See: https://v2.vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.', target);
  5238. };
  5239. var warnReservedPrefix_1 = function (target, key) {
  5240. warn("Property \"".concat(key, "\" must be accessed with \"$data.").concat(key, "\" because ") +
  5241. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  5242. 'prevent conflicts with Vue internals. ' +
  5243. 'See: https://v2.vuejs.org/v2/api/#data', target);
  5244. };
  5245. var hasProxy_1 = typeof Proxy !== 'undefined' && isNative(Proxy);
  5246. if (hasProxy_1) {
  5247. var isBuiltInModifier_1 = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  5248. config.keyCodes = new Proxy(config.keyCodes, {
  5249. set: function (target, key, value) {
  5250. if (isBuiltInModifier_1(key)) {
  5251. warn("Avoid overwriting built-in modifier in config.keyCodes: .".concat(key));
  5252. return false;
  5253. }
  5254. else {
  5255. target[key] = value;
  5256. return true;
  5257. }
  5258. }
  5259. });
  5260. }
  5261. var hasHandler_1 = {
  5262. has: function (target, key) {
  5263. var has = key in target;
  5264. var isAllowed = allowedGlobals_1(key) ||
  5265. (typeof key === 'string' &&
  5266. key.charAt(0) === '_' &&
  5267. !(key in target.$data));
  5268. if (!has && !isAllowed) {
  5269. if (key in target.$data)
  5270. warnReservedPrefix_1(target, key);
  5271. else
  5272. warnNonPresent_1(target, key);
  5273. }
  5274. return has || !isAllowed;
  5275. }
  5276. };
  5277. var getHandler_1 = {
  5278. get: function (target, key) {
  5279. if (typeof key === 'string' && !(key in target)) {
  5280. if (key in target.$data)
  5281. warnReservedPrefix_1(target, key);
  5282. else
  5283. warnNonPresent_1(target, key);
  5284. }
  5285. return target[key];
  5286. }
  5287. };
  5288. initProxy = function initProxy(vm) {
  5289. if (hasProxy_1) {
  5290. // determine which proxy handler to use
  5291. var options = vm.$options;
  5292. var handlers = options.render && options.render._withStripped ? getHandler_1 : hasHandler_1;
  5293. vm._renderProxy = new Proxy(vm, handlers);
  5294. }
  5295. else {
  5296. vm._renderProxy = vm;
  5297. }
  5298. };
  5299. }
  5300. var sharedPropertyDefinition = {
  5301. enumerable: true,
  5302. configurable: true,
  5303. get: noop,
  5304. set: noop
  5305. };
  5306. function proxy(target, sourceKey, key) {
  5307. sharedPropertyDefinition.get = function proxyGetter() {
  5308. return this[sourceKey][key];
  5309. };
  5310. sharedPropertyDefinition.set = function proxySetter(val) {
  5311. this[sourceKey][key] = val;
  5312. };
  5313. Object.defineProperty(target, key, sharedPropertyDefinition);
  5314. }
  5315. function initState(vm) {
  5316. var opts = vm.$options;
  5317. if (opts.props)
  5318. initProps$1(vm, opts.props);
  5319. // Composition API
  5320. initSetup(vm);
  5321. if (opts.methods)
  5322. initMethods(vm, opts.methods);
  5323. if (opts.data) {
  5324. initData(vm);
  5325. }
  5326. else {
  5327. var ob = observe((vm._data = {}));
  5328. ob && ob.vmCount++;
  5329. }
  5330. if (opts.computed)
  5331. initComputed$1(vm, opts.computed);
  5332. if (opts.watch && opts.watch !== nativeWatch) {
  5333. initWatch(vm, opts.watch);
  5334. }
  5335. }
  5336. function initProps$1(vm, propsOptions) {
  5337. var propsData = vm.$options.propsData || {};
  5338. var props = (vm._props = shallowReactive({}));
  5339. // cache prop keys so that future props updates can iterate using Array
  5340. // instead of dynamic object key enumeration.
  5341. var keys = (vm.$options._propKeys = []);
  5342. var isRoot = !vm.$parent;
  5343. // root instance props should be converted
  5344. if (!isRoot) {
  5345. toggleObserving(false);
  5346. }
  5347. var _loop_1 = function (key) {
  5348. keys.push(key);
  5349. var value = validateProp(key, propsOptions, propsData, vm);
  5350. /* istanbul ignore else */
  5351. if (process.env.NODE_ENV !== 'production') {
  5352. var hyphenatedKey = hyphenate(key);
  5353. if (isReservedAttribute(hyphenatedKey) ||
  5354. config.isReservedAttr(hyphenatedKey)) {
  5355. warn("\"".concat(hyphenatedKey, "\" is a reserved attribute and cannot be used as component prop."), vm);
  5356. }
  5357. defineReactive(props, key, value, function () {
  5358. if (!isRoot && !isUpdatingChildComponent) {
  5359. warn("Avoid mutating a prop directly since the value will be " +
  5360. "overwritten whenever the parent component re-renders. " +
  5361. "Instead, use a data or computed property based on the prop's " +
  5362. "value. Prop being mutated: \"".concat(key, "\""), vm);
  5363. }
  5364. }, true /* shallow */);
  5365. }
  5366. else {
  5367. defineReactive(props, key, value, undefined, true /* shallow */);
  5368. }
  5369. // static props are already proxied on the component's prototype
  5370. // during Vue.extend(). We only need to proxy props defined at
  5371. // instantiation here.
  5372. if (!(key in vm)) {
  5373. proxy(vm, "_props", key);
  5374. }
  5375. };
  5376. for (var key in propsOptions) {
  5377. _loop_1(key);
  5378. }
  5379. toggleObserving(true);
  5380. }
  5381. function initData(vm) {
  5382. var data = vm.$options.data;
  5383. data = vm._data = isFunction(data) ? getData(data, vm) : data || {};
  5384. if (!isPlainObject(data)) {
  5385. data = {};
  5386. process.env.NODE_ENV !== 'production' &&
  5387. warn('data functions should return an object:\n' +
  5388. 'https://v2.vuejs.org/v2/guide/components.html#data-Must-Be-a-Function', vm);
  5389. }
  5390. // proxy data on instance
  5391. var keys = Object.keys(data);
  5392. var props = vm.$options.props;
  5393. var methods = vm.$options.methods;
  5394. var i = keys.length;
  5395. while (i--) {
  5396. var key = keys[i];
  5397. if (process.env.NODE_ENV !== 'production') {
  5398. if (methods && hasOwn(methods, key)) {
  5399. warn("Method \"".concat(key, "\" has already been defined as a data property."), vm);
  5400. }
  5401. }
  5402. if (props && hasOwn(props, key)) {
  5403. process.env.NODE_ENV !== 'production' &&
  5404. warn("The data property \"".concat(key, "\" is already declared as a prop. ") +
  5405. "Use prop default value instead.", vm);
  5406. }
  5407. else if (!isReserved(key)) {
  5408. proxy(vm, "_data", key);
  5409. }
  5410. }
  5411. // observe data
  5412. var ob = observe(data);
  5413. ob && ob.vmCount++;
  5414. }
  5415. function getData(data, vm) {
  5416. // #7573 disable dep collection when invoking data getters
  5417. pushTarget();
  5418. try {
  5419. return data.call(vm, vm);
  5420. }
  5421. catch (e) {
  5422. handleError(e, vm, "data()");
  5423. return {};
  5424. }
  5425. finally {
  5426. popTarget();
  5427. }
  5428. }
  5429. var computedWatcherOptions = { lazy: true };
  5430. function initComputed$1(vm, computed) {
  5431. // $flow-disable-line
  5432. var watchers = (vm._computedWatchers = Object.create(null));
  5433. // computed properties are just getters during SSR
  5434. var isSSR = isServerRendering();
  5435. for (var key in computed) {
  5436. var userDef = computed[key];
  5437. var getter = isFunction(userDef) ? userDef : userDef.get;
  5438. if (process.env.NODE_ENV !== 'production' && getter == null) {
  5439. warn("Getter is missing for computed property \"".concat(key, "\"."), vm);
  5440. }
  5441. if (!isSSR) {
  5442. // create internal watcher for the computed property.
  5443. watchers[key] = new Watcher(vm, getter || noop, noop, computedWatcherOptions);
  5444. }
  5445. // component-defined computed properties are already defined on the
  5446. // component prototype. We only need to define computed properties defined
  5447. // at instantiation here.
  5448. if (!(key in vm)) {
  5449. defineComputed(vm, key, userDef);
  5450. }
  5451. else if (process.env.NODE_ENV !== 'production') {
  5452. if (key in vm.$data) {
  5453. warn("The computed property \"".concat(key, "\" is already defined in data."), vm);
  5454. }
  5455. else if (vm.$options.props && key in vm.$options.props) {
  5456. warn("The computed property \"".concat(key, "\" is already defined as a prop."), vm);
  5457. }
  5458. else if (vm.$options.methods && key in vm.$options.methods) {
  5459. warn("The computed property \"".concat(key, "\" is already defined as a method."), vm);
  5460. }
  5461. }
  5462. }
  5463. }
  5464. function defineComputed(target, key, userDef) {
  5465. var shouldCache = !isServerRendering();
  5466. if (isFunction(userDef)) {
  5467. sharedPropertyDefinition.get = shouldCache
  5468. ? createComputedGetter(key)
  5469. : createGetterInvoker(userDef);
  5470. sharedPropertyDefinition.set = noop;
  5471. }
  5472. else {
  5473. sharedPropertyDefinition.get = userDef.get
  5474. ? shouldCache && userDef.cache !== false
  5475. ? createComputedGetter(key)
  5476. : createGetterInvoker(userDef.get)
  5477. : noop;
  5478. sharedPropertyDefinition.set = userDef.set || noop;
  5479. }
  5480. if (process.env.NODE_ENV !== 'production' && sharedPropertyDefinition.set === noop) {
  5481. sharedPropertyDefinition.set = function () {
  5482. warn("Computed property \"".concat(key, "\" was assigned to but it has no setter."), this);
  5483. };
  5484. }
  5485. Object.defineProperty(target, key, sharedPropertyDefinition);
  5486. }
  5487. function createComputedGetter(key) {
  5488. return function computedGetter() {
  5489. var watcher = this._computedWatchers && this._computedWatchers[key];
  5490. if (watcher) {
  5491. if (watcher.dirty) {
  5492. watcher.evaluate();
  5493. }
  5494. if (Dep.target) {
  5495. if (process.env.NODE_ENV !== 'production' && Dep.target.onTrack) {
  5496. Dep.target.onTrack({
  5497. effect: Dep.target,
  5498. target: this,
  5499. type: "get" /* TrackOpTypes.GET */,
  5500. key: key
  5501. });
  5502. }
  5503. watcher.depend();
  5504. }
  5505. return watcher.value;
  5506. }
  5507. };
  5508. }
  5509. function createGetterInvoker(fn) {
  5510. return function computedGetter() {
  5511. return fn.call(this, this);
  5512. };
  5513. }
  5514. function initMethods(vm, methods) {
  5515. var props = vm.$options.props;
  5516. for (var key in methods) {
  5517. if (process.env.NODE_ENV !== 'production') {
  5518. if (typeof methods[key] !== 'function') {
  5519. warn("Method \"".concat(key, "\" has type \"").concat(typeof methods[key], "\" in the component definition. ") +
  5520. "Did you reference the function correctly?", vm);
  5521. }
  5522. if (props && hasOwn(props, key)) {
  5523. warn("Method \"".concat(key, "\" has already been defined as a prop."), vm);
  5524. }
  5525. if (key in vm && isReserved(key)) {
  5526. warn("Method \"".concat(key, "\" conflicts with an existing Vue instance method. ") +
  5527. "Avoid defining component methods that start with _ or $.");
  5528. }
  5529. }
  5530. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  5531. }
  5532. }
  5533. function initWatch(vm, watch) {
  5534. for (var key in watch) {
  5535. var handler = watch[key];
  5536. if (isArray(handler)) {
  5537. for (var i = 0; i < handler.length; i++) {
  5538. createWatcher(vm, key, handler[i]);
  5539. }
  5540. }
  5541. else {
  5542. createWatcher(vm, key, handler);
  5543. }
  5544. }
  5545. }
  5546. function createWatcher(vm, expOrFn, handler, options) {
  5547. if (isPlainObject(handler)) {
  5548. options = handler;
  5549. handler = handler.handler;
  5550. }
  5551. if (typeof handler === 'string') {
  5552. handler = vm[handler];
  5553. }
  5554. return vm.$watch(expOrFn, handler, options);
  5555. }
  5556. function stateMixin(Vue) {
  5557. // flow somehow has problems with directly declared definition object
  5558. // when using Object.defineProperty, so we have to procedurally build up
  5559. // the object here.
  5560. var dataDef = {};
  5561. dataDef.get = function () {
  5562. return this._data;
  5563. };
  5564. var propsDef = {};
  5565. propsDef.get = function () {
  5566. return this._props;
  5567. };
  5568. if (process.env.NODE_ENV !== 'production') {
  5569. dataDef.set = function () {
  5570. warn('Avoid replacing instance root $data. ' +
  5571. 'Use nested data properties instead.', this);
  5572. };
  5573. propsDef.set = function () {
  5574. warn("$props is readonly.", this);
  5575. };
  5576. }
  5577. Object.defineProperty(Vue.prototype, '$data', dataDef);
  5578. Object.defineProperty(Vue.prototype, '$props', propsDef);
  5579. Vue.prototype.$set = set;
  5580. Vue.prototype.$delete = del;
  5581. Vue.prototype.$watch = function (expOrFn, cb, options) {
  5582. var vm = this;
  5583. if (isPlainObject(cb)) {
  5584. return createWatcher(vm, expOrFn, cb, options);
  5585. }
  5586. options = options || {};
  5587. options.user = true;
  5588. var watcher = new Watcher(vm, expOrFn, cb, options);
  5589. if (options.immediate) {
  5590. var info = "callback for immediate watcher \"".concat(watcher.expression, "\"");
  5591. pushTarget();
  5592. invokeWithErrorHandling(cb, vm, [watcher.value], vm, info);
  5593. popTarget();
  5594. }
  5595. return function unwatchFn() {
  5596. watcher.teardown();
  5597. };
  5598. };
  5599. }
  5600. var uid = 0;
  5601. function initMixin$1(Vue) {
  5602. Vue.prototype._init = function (options) {
  5603. var vm = this;
  5604. // a uid
  5605. vm._uid = uid++;
  5606. var startTag, endTag;
  5607. /* istanbul ignore if */
  5608. if (process.env.NODE_ENV !== 'production' && config.performance && mark) {
  5609. startTag = "vue-perf-start:".concat(vm._uid);
  5610. endTag = "vue-perf-end:".concat(vm._uid);
  5611. mark(startTag);
  5612. }
  5613. // a flag to mark this as a Vue instance without having to do instanceof
  5614. // check
  5615. vm._isVue = true;
  5616. // avoid instances from being observed
  5617. vm.__v_skip = true;
  5618. // effect scope
  5619. vm._scope = new EffectScope(true /* detached */);
  5620. // #13134 edge case where a child component is manually created during the
  5621. // render of a parent component
  5622. vm._scope.parent = undefined;
  5623. vm._scope._vm = true;
  5624. // merge options
  5625. if (options && options._isComponent) {
  5626. // optimize internal component instantiation
  5627. // since dynamic options merging is pretty slow, and none of the
  5628. // internal component options needs special treatment.
  5629. initInternalComponent(vm, options);
  5630. }
  5631. else {
  5632. vm.$options = mergeOptions(resolveConstructorOptions(vm.constructor), options || {}, vm);
  5633. }
  5634. /* istanbul ignore else */
  5635. if (process.env.NODE_ENV !== 'production') {
  5636. initProxy(vm);
  5637. }
  5638. else {
  5639. vm._renderProxy = vm;
  5640. }
  5641. // expose real self
  5642. vm._self = vm;
  5643. initLifecycle(vm);
  5644. initEvents(vm);
  5645. initRender(vm);
  5646. callHook$1(vm, 'beforeCreate', undefined, false /* setContext */);
  5647. initInjections(vm); // resolve injections before data/props
  5648. initState(vm);
  5649. initProvide(vm); // resolve provide after data/props
  5650. callHook$1(vm, 'created');
  5651. /* istanbul ignore if */
  5652. if (process.env.NODE_ENV !== 'production' && config.performance && mark) {
  5653. vm._name = formatComponentName(vm, false);
  5654. mark(endTag);
  5655. measure("vue ".concat(vm._name, " init"), startTag, endTag);
  5656. }
  5657. if (vm.$options.el) {
  5658. vm.$mount(vm.$options.el);
  5659. }
  5660. };
  5661. }
  5662. function initInternalComponent(vm, options) {
  5663. var opts = (vm.$options = Object.create(vm.constructor.options));
  5664. // doing this because it's faster than dynamic enumeration.
  5665. var parentVnode = options._parentVnode;
  5666. opts.parent = options.parent;
  5667. opts._parentVnode = parentVnode;
  5668. var vnodeComponentOptions = parentVnode.componentOptions;
  5669. opts.propsData = vnodeComponentOptions.propsData;
  5670. opts._parentListeners = vnodeComponentOptions.listeners;
  5671. opts._renderChildren = vnodeComponentOptions.children;
  5672. opts._componentTag = vnodeComponentOptions.tag;
  5673. if (options.render) {
  5674. opts.render = options.render;
  5675. opts.staticRenderFns = options.staticRenderFns;
  5676. }
  5677. }
  5678. function resolveConstructorOptions(Ctor) {
  5679. var options = Ctor.options;
  5680. if (Ctor.super) {
  5681. var superOptions = resolveConstructorOptions(Ctor.super);
  5682. var cachedSuperOptions = Ctor.superOptions;
  5683. if (superOptions !== cachedSuperOptions) {
  5684. // super option changed,
  5685. // need to resolve new options.
  5686. Ctor.superOptions = superOptions;
  5687. // check if there are any late-modified/attached options (#4976)
  5688. var modifiedOptions = resolveModifiedOptions(Ctor);
  5689. // update base extend options
  5690. if (modifiedOptions) {
  5691. extend(Ctor.extendOptions, modifiedOptions);
  5692. }
  5693. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  5694. if (options.name) {
  5695. options.components[options.name] = Ctor;
  5696. }
  5697. }
  5698. }
  5699. return options;
  5700. }
  5701. function resolveModifiedOptions(Ctor) {
  5702. var modified;
  5703. var latest = Ctor.options;
  5704. var sealed = Ctor.sealedOptions;
  5705. for (var key in latest) {
  5706. if (latest[key] !== sealed[key]) {
  5707. if (!modified)
  5708. modified = {};
  5709. modified[key] = latest[key];
  5710. }
  5711. }
  5712. return modified;
  5713. }
  5714. function Vue(options) {
  5715. if (process.env.NODE_ENV !== 'production' && !(this instanceof Vue)) {
  5716. warn('Vue is a constructor and should be called with the `new` keyword');
  5717. }
  5718. this._init(options);
  5719. }
  5720. //@ts-expect-error Vue has function type
  5721. initMixin$1(Vue);
  5722. //@ts-expect-error Vue has function type
  5723. stateMixin(Vue);
  5724. //@ts-expect-error Vue has function type
  5725. eventsMixin(Vue);
  5726. //@ts-expect-error Vue has function type
  5727. lifecycleMixin(Vue);
  5728. //@ts-expect-error Vue has function type
  5729. renderMixin(Vue);
  5730. function initUse(Vue) {
  5731. Vue.use = function (plugin) {
  5732. var installedPlugins = this._installedPlugins || (this._installedPlugins = []);
  5733. if (installedPlugins.indexOf(plugin) > -1) {
  5734. return this;
  5735. }
  5736. // additional parameters
  5737. var args = toArray(arguments, 1);
  5738. args.unshift(this);
  5739. if (isFunction(plugin.install)) {
  5740. plugin.install.apply(plugin, args);
  5741. }
  5742. else if (isFunction(plugin)) {
  5743. plugin.apply(null, args);
  5744. }
  5745. installedPlugins.push(plugin);
  5746. return this;
  5747. };
  5748. }
  5749. function initMixin(Vue) {
  5750. Vue.mixin = function (mixin) {
  5751. this.options = mergeOptions(this.options, mixin);
  5752. return this;
  5753. };
  5754. }
  5755. function initExtend(Vue) {
  5756. /**
  5757. * Each instance constructor, including Vue, has a unique
  5758. * cid. This enables us to create wrapped "child
  5759. * constructors" for prototypal inheritance and cache them.
  5760. */
  5761. Vue.cid = 0;
  5762. var cid = 1;
  5763. /**
  5764. * Class inheritance
  5765. */
  5766. Vue.extend = function (extendOptions) {
  5767. extendOptions = extendOptions || {};
  5768. var Super = this;
  5769. var SuperId = Super.cid;
  5770. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  5771. if (cachedCtors[SuperId]) {
  5772. return cachedCtors[SuperId];
  5773. }
  5774. var name = getComponentName(extendOptions) || getComponentName(Super.options);
  5775. if (process.env.NODE_ENV !== 'production' && name) {
  5776. validateComponentName(name);
  5777. }
  5778. var Sub = function VueComponent(options) {
  5779. this._init(options);
  5780. };
  5781. Sub.prototype = Object.create(Super.prototype);
  5782. Sub.prototype.constructor = Sub;
  5783. Sub.cid = cid++;
  5784. Sub.options = mergeOptions(Super.options, extendOptions);
  5785. Sub['super'] = Super;
  5786. // For props and computed properties, we define the proxy getters on
  5787. // the Vue instances at extension time, on the extended prototype. This
  5788. // avoids Object.defineProperty calls for each instance created.
  5789. if (Sub.options.props) {
  5790. initProps(Sub);
  5791. }
  5792. if (Sub.options.computed) {
  5793. initComputed(Sub);
  5794. }
  5795. // allow further extension/mixin/plugin usage
  5796. Sub.extend = Super.extend;
  5797. Sub.mixin = Super.mixin;
  5798. Sub.use = Super.use;
  5799. // create asset registers, so extended classes
  5800. // can have their private assets too.
  5801. ASSET_TYPES.forEach(function (type) {
  5802. Sub[type] = Super[type];
  5803. });
  5804. // enable recursive self-lookup
  5805. if (name) {
  5806. Sub.options.components[name] = Sub;
  5807. }
  5808. // keep a reference to the super options at extension time.
  5809. // later at instantiation we can check if Super's options have
  5810. // been updated.
  5811. Sub.superOptions = Super.options;
  5812. Sub.extendOptions = extendOptions;
  5813. Sub.sealedOptions = extend({}, Sub.options);
  5814. // cache constructor
  5815. cachedCtors[SuperId] = Sub;
  5816. return Sub;
  5817. };
  5818. }
  5819. function initProps(Comp) {
  5820. var props = Comp.options.props;
  5821. for (var key in props) {
  5822. proxy(Comp.prototype, "_props", key);
  5823. }
  5824. }
  5825. function initComputed(Comp) {
  5826. var computed = Comp.options.computed;
  5827. for (var key in computed) {
  5828. defineComputed(Comp.prototype, key, computed[key]);
  5829. }
  5830. }
  5831. function initAssetRegisters(Vue) {
  5832. /**
  5833. * Create asset registration methods.
  5834. */
  5835. ASSET_TYPES.forEach(function (type) {
  5836. // @ts-expect-error function is not exact same type
  5837. Vue[type] = function (id, definition) {
  5838. if (!definition) {
  5839. return this.options[type + 's'][id];
  5840. }
  5841. else {
  5842. /* istanbul ignore if */
  5843. if (process.env.NODE_ENV !== 'production' && type === 'component') {
  5844. validateComponentName(id);
  5845. }
  5846. if (type === 'component' && isPlainObject(definition)) {
  5847. // @ts-expect-error
  5848. definition.name = definition.name || id;
  5849. definition = this.options._base.extend(definition);
  5850. }
  5851. if (type === 'directive' && isFunction(definition)) {
  5852. definition = { bind: definition, update: definition };
  5853. }
  5854. this.options[type + 's'][id] = definition;
  5855. return definition;
  5856. }
  5857. };
  5858. });
  5859. }
  5860. function _getComponentName(opts) {
  5861. return opts && (getComponentName(opts.Ctor.options) || opts.tag);
  5862. }
  5863. function matches(pattern, name) {
  5864. if (isArray(pattern)) {
  5865. return pattern.indexOf(name) > -1;
  5866. }
  5867. else if (typeof pattern === 'string') {
  5868. return pattern.split(',').indexOf(name) > -1;
  5869. }
  5870. else if (isRegExp(pattern)) {
  5871. return pattern.test(name);
  5872. }
  5873. /* istanbul ignore next */
  5874. return false;
  5875. }
  5876. function pruneCache(keepAliveInstance, filter) {
  5877. var cache = keepAliveInstance.cache, keys = keepAliveInstance.keys, _vnode = keepAliveInstance._vnode, $vnode = keepAliveInstance.$vnode;
  5878. for (var key in cache) {
  5879. var entry = cache[key];
  5880. if (entry) {
  5881. var name_1 = entry.name;
  5882. if (name_1 && !filter(name_1)) {
  5883. pruneCacheEntry(cache, key, keys, _vnode);
  5884. }
  5885. }
  5886. }
  5887. $vnode.componentOptions.children = undefined;
  5888. }
  5889. function pruneCacheEntry(cache, key, keys, current) {
  5890. var entry = cache[key];
  5891. if (entry && (!current || entry.tag !== current.tag)) {
  5892. // @ts-expect-error can be undefined
  5893. entry.componentInstance.$destroy();
  5894. }
  5895. cache[key] = null;
  5896. remove$2(keys, key);
  5897. }
  5898. var patternTypes = [String, RegExp, Array];
  5899. // TODO defineComponent
  5900. var KeepAlive = {
  5901. name: 'keep-alive',
  5902. abstract: true,
  5903. props: {
  5904. include: patternTypes,
  5905. exclude: patternTypes,
  5906. max: [String, Number]
  5907. },
  5908. methods: {
  5909. cacheVNode: function () {
  5910. var _a = this, cache = _a.cache, keys = _a.keys, vnodeToCache = _a.vnodeToCache, keyToCache = _a.keyToCache;
  5911. if (vnodeToCache) {
  5912. var tag = vnodeToCache.tag, componentInstance = vnodeToCache.componentInstance, componentOptions = vnodeToCache.componentOptions;
  5913. cache[keyToCache] = {
  5914. name: _getComponentName(componentOptions),
  5915. tag: tag,
  5916. componentInstance: componentInstance
  5917. };
  5918. keys.push(keyToCache);
  5919. // prune oldest entry
  5920. if (this.max && keys.length > parseInt(this.max)) {
  5921. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  5922. }
  5923. this.vnodeToCache = null;
  5924. }
  5925. }
  5926. },
  5927. created: function () {
  5928. this.cache = Object.create(null);
  5929. this.keys = [];
  5930. },
  5931. destroyed: function () {
  5932. for (var key in this.cache) {
  5933. pruneCacheEntry(this.cache, key, this.keys);
  5934. }
  5935. },
  5936. mounted: function () {
  5937. var _this = this;
  5938. this.cacheVNode();
  5939. this.$watch('include', function (val) {
  5940. pruneCache(_this, function (name) { return matches(val, name); });
  5941. });
  5942. this.$watch('exclude', function (val) {
  5943. pruneCache(_this, function (name) { return !matches(val, name); });
  5944. });
  5945. },
  5946. updated: function () {
  5947. this.cacheVNode();
  5948. },
  5949. render: function () {
  5950. var slot = this.$slots.default;
  5951. var vnode = getFirstComponentChild(slot);
  5952. var componentOptions = vnode && vnode.componentOptions;
  5953. if (componentOptions) {
  5954. // check pattern
  5955. var name_2 = _getComponentName(componentOptions);
  5956. var _a = this, include = _a.include, exclude = _a.exclude;
  5957. if (
  5958. // not included
  5959. (include && (!name_2 || !matches(include, name_2))) ||
  5960. // excluded
  5961. (exclude && name_2 && matches(exclude, name_2))) {
  5962. return vnode;
  5963. }
  5964. var _b = this, cache = _b.cache, keys = _b.keys;
  5965. var key = vnode.key == null
  5966. ? // same constructor may get registered as different local components
  5967. // so cid alone is not enough (#3269)
  5968. componentOptions.Ctor.cid +
  5969. (componentOptions.tag ? "::".concat(componentOptions.tag) : '')
  5970. : vnode.key;
  5971. if (cache[key]) {
  5972. vnode.componentInstance = cache[key].componentInstance;
  5973. // make current key freshest
  5974. remove$2(keys, key);
  5975. keys.push(key);
  5976. }
  5977. else {
  5978. // delay setting the cache until update
  5979. this.vnodeToCache = vnode;
  5980. this.keyToCache = key;
  5981. }
  5982. // @ts-expect-error can vnode.data can be undefined
  5983. vnode.data.keepAlive = true;
  5984. }
  5985. return vnode || (slot && slot[0]);
  5986. }
  5987. };
  5988. var builtInComponents = {
  5989. KeepAlive: KeepAlive
  5990. };
  5991. function initGlobalAPI(Vue) {
  5992. // config
  5993. var configDef = {};
  5994. configDef.get = function () { return config; };
  5995. if (process.env.NODE_ENV !== 'production') {
  5996. configDef.set = function () {
  5997. warn('Do not replace the Vue.config object, set individual fields instead.');
  5998. };
  5999. }
  6000. Object.defineProperty(Vue, 'config', configDef);
  6001. // exposed util methods.
  6002. // NOTE: these are not considered part of the public API - avoid relying on
  6003. // them unless you are aware of the risk.
  6004. Vue.util = {
  6005. warn: warn,
  6006. extend: extend,
  6007. mergeOptions: mergeOptions,
  6008. defineReactive: defineReactive
  6009. };
  6010. Vue.set = set;
  6011. Vue.delete = del;
  6012. Vue.nextTick = nextTick;
  6013. // 2.6 explicit observable API
  6014. Vue.observable = function (obj) {
  6015. observe(obj);
  6016. return obj;
  6017. };
  6018. Vue.options = Object.create(null);
  6019. ASSET_TYPES.forEach(function (type) {
  6020. Vue.options[type + 's'] = Object.create(null);
  6021. });
  6022. // this is used to identify the "base" constructor to extend all plain-object
  6023. // components with in Weex's multi-instance scenarios.
  6024. Vue.options._base = Vue;
  6025. extend(Vue.options.components, builtInComponents);
  6026. initUse(Vue);
  6027. initMixin(Vue);
  6028. initExtend(Vue);
  6029. initAssetRegisters(Vue);
  6030. }
  6031. initGlobalAPI(Vue);
  6032. Object.defineProperty(Vue.prototype, '$isServer', {
  6033. get: isServerRendering
  6034. });
  6035. Object.defineProperty(Vue.prototype, '$ssrContext', {
  6036. get: function () {
  6037. /* istanbul ignore next */
  6038. return this.$vnode && this.$vnode.ssrContext;
  6039. }
  6040. });
  6041. // expose FunctionalRenderContext for ssr runtime helper installation
  6042. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  6043. value: FunctionalRenderContext
  6044. });
  6045. Vue.version = version;
  6046. // these are reserved for web because they are directly compiled away
  6047. // during template compilation
  6048. var isReservedAttr = makeMap('style,class');
  6049. // attributes that should be using props for binding
  6050. var acceptValue = makeMap('input,textarea,option,select,progress');
  6051. var mustUseProp = function (tag, type, attr) {
  6052. return ((attr === 'value' && acceptValue(tag) && type !== 'button') ||
  6053. (attr === 'selected' && tag === 'option') ||
  6054. (attr === 'checked' && tag === 'input') ||
  6055. (attr === 'muted' && tag === 'video'));
  6056. };
  6057. var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');
  6058. var isValidContentEditableValue = makeMap('events,caret,typing,plaintext-only');
  6059. var convertEnumeratedValue = function (key, value) {
  6060. return isFalsyAttrValue(value) || value === 'false'
  6061. ? 'false'
  6062. : // allow arbitrary string value for contenteditable
  6063. key === 'contenteditable' && isValidContentEditableValue(value)
  6064. ? value
  6065. : 'true';
  6066. };
  6067. var isBooleanAttr = makeMap('allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +
  6068. 'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +
  6069. 'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +
  6070. 'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +
  6071. 'required,reversed,scoped,seamless,selected,sortable,' +
  6072. 'truespeed,typemustmatch,visible');
  6073. var xlinkNS = 'http://www.w3.org/1999/xlink';
  6074. var isXlink = function (name) {
  6075. return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink';
  6076. };
  6077. var getXlinkProp = function (name) {
  6078. return isXlink(name) ? name.slice(6, name.length) : '';
  6079. };
  6080. var isFalsyAttrValue = function (val) {
  6081. return val == null || val === false;
  6082. };
  6083. function genClassForVnode(vnode) {
  6084. var data = vnode.data;
  6085. var parentNode = vnode;
  6086. var childNode = vnode;
  6087. while (isDef(childNode.componentInstance)) {
  6088. childNode = childNode.componentInstance._vnode;
  6089. if (childNode && childNode.data) {
  6090. data = mergeClassData(childNode.data, data);
  6091. }
  6092. }
  6093. // @ts-expect-error parentNode.parent not VNodeWithData
  6094. while (isDef((parentNode = parentNode.parent))) {
  6095. if (parentNode && parentNode.data) {
  6096. data = mergeClassData(data, parentNode.data);
  6097. }
  6098. }
  6099. return renderClass(data.staticClass, data.class);
  6100. }
  6101. function mergeClassData(child, parent) {
  6102. return {
  6103. staticClass: concat(child.staticClass, parent.staticClass),
  6104. class: isDef(child.class) ? [child.class, parent.class] : parent.class
  6105. };
  6106. }
  6107. function renderClass(staticClass, dynamicClass) {
  6108. if (isDef(staticClass) || isDef(dynamicClass)) {
  6109. return concat(staticClass, stringifyClass(dynamicClass));
  6110. }
  6111. /* istanbul ignore next */
  6112. return '';
  6113. }
  6114. function concat(a, b) {
  6115. return a ? (b ? a + ' ' + b : a) : b || '';
  6116. }
  6117. function stringifyClass(value) {
  6118. if (Array.isArray(value)) {
  6119. return stringifyArray(value);
  6120. }
  6121. if (isObject(value)) {
  6122. return stringifyObject(value);
  6123. }
  6124. if (typeof value === 'string') {
  6125. return value;
  6126. }
  6127. /* istanbul ignore next */
  6128. return '';
  6129. }
  6130. function stringifyArray(value) {
  6131. var res = '';
  6132. var stringified;
  6133. for (var i = 0, l = value.length; i < l; i++) {
  6134. if (isDef((stringified = stringifyClass(value[i]))) && stringified !== '') {
  6135. if (res)
  6136. res += ' ';
  6137. res += stringified;
  6138. }
  6139. }
  6140. return res;
  6141. }
  6142. function stringifyObject(value) {
  6143. var res = '';
  6144. for (var key in value) {
  6145. if (value[key]) {
  6146. if (res)
  6147. res += ' ';
  6148. res += key;
  6149. }
  6150. }
  6151. return res;
  6152. }
  6153. var namespaceMap = {
  6154. svg: 'http://www.w3.org/2000/svg',
  6155. math: 'http://www.w3.org/1998/Math/MathML'
  6156. };
  6157. var isHTMLTag = makeMap('html,body,base,head,link,meta,style,title,' +
  6158. 'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +
  6159. 'div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,' +
  6160. 'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +
  6161. 's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +
  6162. 'embed,object,param,source,canvas,script,noscript,del,ins,' +
  6163. 'caption,col,colgroup,table,thead,tbody,td,th,tr,' +
  6164. 'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' +
  6165. 'output,progress,select,textarea,' +
  6166. 'details,dialog,menu,menuitem,summary,' +
  6167. 'content,element,shadow,template,blockquote,iframe,tfoot');
  6168. // this map is intentionally selective, only covering SVG elements that may
  6169. // contain child elements.
  6170. var isSVG = makeMap('svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' +
  6171. 'foreignobject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +
  6172. 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view', true);
  6173. var isReservedTag = function (tag) {
  6174. return isHTMLTag(tag) || isSVG(tag);
  6175. };
  6176. function getTagNamespace(tag) {
  6177. if (isSVG(tag)) {
  6178. return 'svg';
  6179. }
  6180. // basic support for MathML
  6181. // note it doesn't support other MathML elements being component roots
  6182. if (tag === 'math') {
  6183. return 'math';
  6184. }
  6185. }
  6186. var unknownElementCache = Object.create(null);
  6187. function isUnknownElement(tag) {
  6188. /* istanbul ignore if */
  6189. if (!inBrowser) {
  6190. return true;
  6191. }
  6192. if (isReservedTag(tag)) {
  6193. return false;
  6194. }
  6195. tag = tag.toLowerCase();
  6196. /* istanbul ignore if */
  6197. if (unknownElementCache[tag] != null) {
  6198. return unknownElementCache[tag];
  6199. }
  6200. var el = document.createElement(tag);
  6201. if (tag.indexOf('-') > -1) {
  6202. // https://stackoverflow.com/a/28210364/1070244
  6203. return (unknownElementCache[tag] =
  6204. el.constructor === window.HTMLUnknownElement ||
  6205. el.constructor === window.HTMLElement);
  6206. }
  6207. else {
  6208. return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()));
  6209. }
  6210. }
  6211. var isTextInputType = makeMap('text,number,password,search,email,tel,url');
  6212. /**
  6213. * Query an element selector if it's not an element already.
  6214. */
  6215. function query(el) {
  6216. if (typeof el === 'string') {
  6217. var selected = document.querySelector(el);
  6218. if (!selected) {
  6219. process.env.NODE_ENV !== 'production' && warn('Cannot find element: ' + el);
  6220. return document.createElement('div');
  6221. }
  6222. return selected;
  6223. }
  6224. else {
  6225. return el;
  6226. }
  6227. }
  6228. function createElement(tagName, vnode) {
  6229. var elm = document.createElement(tagName);
  6230. if (tagName !== 'select') {
  6231. return elm;
  6232. }
  6233. // false or null will remove the attribute but undefined will not
  6234. if (vnode.data &&
  6235. vnode.data.attrs &&
  6236. vnode.data.attrs.multiple !== undefined) {
  6237. elm.setAttribute('multiple', 'multiple');
  6238. }
  6239. return elm;
  6240. }
  6241. function createElementNS(namespace, tagName) {
  6242. return document.createElementNS(namespaceMap[namespace], tagName);
  6243. }
  6244. function createTextNode(text) {
  6245. return document.createTextNode(text);
  6246. }
  6247. function createComment(text) {
  6248. return document.createComment(text);
  6249. }
  6250. function insertBefore(parentNode, newNode, referenceNode) {
  6251. parentNode.insertBefore(newNode, referenceNode);
  6252. }
  6253. function removeChild(node, child) {
  6254. node.removeChild(child);
  6255. }
  6256. function appendChild(node, child) {
  6257. node.appendChild(child);
  6258. }
  6259. function parentNode(node) {
  6260. return node.parentNode;
  6261. }
  6262. function nextSibling(node) {
  6263. return node.nextSibling;
  6264. }
  6265. function tagName(node) {
  6266. return node.tagName;
  6267. }
  6268. function setTextContent(node, text) {
  6269. node.textContent = text;
  6270. }
  6271. function setStyleScope(node, scopeId) {
  6272. node.setAttribute(scopeId, '');
  6273. }
  6274. var nodeOps = /*#__PURE__*/Object.freeze({
  6275. __proto__: null,
  6276. createElement: createElement,
  6277. createElementNS: createElementNS,
  6278. createTextNode: createTextNode,
  6279. createComment: createComment,
  6280. insertBefore: insertBefore,
  6281. removeChild: removeChild,
  6282. appendChild: appendChild,
  6283. parentNode: parentNode,
  6284. nextSibling: nextSibling,
  6285. tagName: tagName,
  6286. setTextContent: setTextContent,
  6287. setStyleScope: setStyleScope
  6288. });
  6289. var ref = {
  6290. create: function (_, vnode) {
  6291. registerRef(vnode);
  6292. },
  6293. update: function (oldVnode, vnode) {
  6294. if (oldVnode.data.ref !== vnode.data.ref) {
  6295. registerRef(oldVnode, true);
  6296. registerRef(vnode);
  6297. }
  6298. },
  6299. destroy: function (vnode) {
  6300. registerRef(vnode, true);
  6301. }
  6302. };
  6303. function registerRef(vnode, isRemoval) {
  6304. var ref = vnode.data.ref;
  6305. if (!isDef(ref))
  6306. return;
  6307. var vm = vnode.context;
  6308. var refValue = vnode.componentInstance || vnode.elm;
  6309. var value = isRemoval ? null : refValue;
  6310. var $refsValue = isRemoval ? undefined : refValue;
  6311. if (isFunction(ref)) {
  6312. invokeWithErrorHandling(ref, vm, [value], vm, "template ref function");
  6313. return;
  6314. }
  6315. var isFor = vnode.data.refInFor;
  6316. var _isString = typeof ref === 'string' || typeof ref === 'number';
  6317. var _isRef = isRef(ref);
  6318. var refs = vm.$refs;
  6319. if (_isString || _isRef) {
  6320. if (isFor) {
  6321. var existing = _isString ? refs[ref] : ref.value;
  6322. if (isRemoval) {
  6323. isArray(existing) && remove$2(existing, refValue);
  6324. }
  6325. else {
  6326. if (!isArray(existing)) {
  6327. if (_isString) {
  6328. refs[ref] = [refValue];
  6329. setSetupRef(vm, ref, refs[ref]);
  6330. }
  6331. else {
  6332. ref.value = [refValue];
  6333. }
  6334. }
  6335. else if (!existing.includes(refValue)) {
  6336. existing.push(refValue);
  6337. }
  6338. }
  6339. }
  6340. else if (_isString) {
  6341. if (isRemoval && refs[ref] !== refValue) {
  6342. return;
  6343. }
  6344. refs[ref] = $refsValue;
  6345. setSetupRef(vm, ref, value);
  6346. }
  6347. else if (_isRef) {
  6348. if (isRemoval && ref.value !== refValue) {
  6349. return;
  6350. }
  6351. ref.value = value;
  6352. }
  6353. else if (process.env.NODE_ENV !== 'production') {
  6354. warn("Invalid template ref type: ".concat(typeof ref));
  6355. }
  6356. }
  6357. }
  6358. function setSetupRef(_a, key, val) {
  6359. var _setupState = _a._setupState;
  6360. if (_setupState && hasOwn(_setupState, key)) {
  6361. if (isRef(_setupState[key])) {
  6362. _setupState[key].value = val;
  6363. }
  6364. else {
  6365. _setupState[key] = val;
  6366. }
  6367. }
  6368. }
  6369. /**
  6370. * Virtual DOM patching algorithm based on Snabbdom by
  6371. * Simon Friis Vindum (@paldepind)
  6372. * Licensed under the MIT License
  6373. * https://github.com/paldepind/snabbdom/blob/master/LICENSE
  6374. *
  6375. * modified by Evan You (@yyx990803)
  6376. *
  6377. * Not type-checking this because this file is perf-critical and the cost
  6378. * of making flow understand it is not worth it.
  6379. */
  6380. var emptyNode = new VNode('', {}, []);
  6381. var hooks = ['create', 'activate', 'update', 'remove', 'destroy'];
  6382. function sameVnode(a, b) {
  6383. return (a.key === b.key &&
  6384. a.asyncFactory === b.asyncFactory &&
  6385. ((a.tag === b.tag &&
  6386. a.isComment === b.isComment &&
  6387. isDef(a.data) === isDef(b.data) &&
  6388. sameInputType(a, b)) ||
  6389. (isTrue(a.isAsyncPlaceholder) && isUndef(b.asyncFactory.error))));
  6390. }
  6391. function sameInputType(a, b) {
  6392. if (a.tag !== 'input')
  6393. return true;
  6394. var i;
  6395. var typeA = isDef((i = a.data)) && isDef((i = i.attrs)) && i.type;
  6396. var typeB = isDef((i = b.data)) && isDef((i = i.attrs)) && i.type;
  6397. return typeA === typeB || (isTextInputType(typeA) && isTextInputType(typeB));
  6398. }
  6399. function createKeyToOldIdx(children, beginIdx, endIdx) {
  6400. var i, key;
  6401. var map = {};
  6402. for (i = beginIdx; i <= endIdx; ++i) {
  6403. key = children[i].key;
  6404. if (isDef(key))
  6405. map[key] = i;
  6406. }
  6407. return map;
  6408. }
  6409. function createPatchFunction(backend) {
  6410. var i, j;
  6411. var cbs = {};
  6412. var modules = backend.modules, nodeOps = backend.nodeOps;
  6413. for (i = 0; i < hooks.length; ++i) {
  6414. cbs[hooks[i]] = [];
  6415. for (j = 0; j < modules.length; ++j) {
  6416. if (isDef(modules[j][hooks[i]])) {
  6417. cbs[hooks[i]].push(modules[j][hooks[i]]);
  6418. }
  6419. }
  6420. }
  6421. function emptyNodeAt(elm) {
  6422. return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm);
  6423. }
  6424. function createRmCb(childElm, listeners) {
  6425. function remove() {
  6426. if (--remove.listeners === 0) {
  6427. removeNode(childElm);
  6428. }
  6429. }
  6430. remove.listeners = listeners;
  6431. return remove;
  6432. }
  6433. function removeNode(el) {
  6434. var parent = nodeOps.parentNode(el);
  6435. // element may have already been removed due to v-html / v-text
  6436. if (isDef(parent)) {
  6437. nodeOps.removeChild(parent, el);
  6438. }
  6439. }
  6440. function isUnknownElement(vnode, inVPre) {
  6441. return (!inVPre &&
  6442. !vnode.ns &&
  6443. !(config.ignoredElements.length &&
  6444. config.ignoredElements.some(function (ignore) {
  6445. return isRegExp(ignore)
  6446. ? ignore.test(vnode.tag)
  6447. : ignore === vnode.tag;
  6448. })) &&
  6449. config.isUnknownElement(vnode.tag));
  6450. }
  6451. var creatingElmInVPre = 0;
  6452. function createElm(vnode, insertedVnodeQueue, parentElm, refElm, nested, ownerArray, index) {
  6453. if (isDef(vnode.elm) && isDef(ownerArray)) {
  6454. // This vnode was used in a previous render!
  6455. // now it's used as a new node, overwriting its elm would cause
  6456. // potential patch errors down the road when it's used as an insertion
  6457. // reference node. Instead, we clone the node on-demand before creating
  6458. // associated DOM element for it.
  6459. vnode = ownerArray[index] = cloneVNode(vnode);
  6460. }
  6461. vnode.isRootInsert = !nested; // for transition enter check
  6462. if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) {
  6463. return;
  6464. }
  6465. var data = vnode.data;
  6466. var children = vnode.children;
  6467. var tag = vnode.tag;
  6468. if (isDef(tag)) {
  6469. if (process.env.NODE_ENV !== 'production') {
  6470. if (data && data.pre) {
  6471. creatingElmInVPre++;
  6472. }
  6473. if (isUnknownElement(vnode, creatingElmInVPre)) {
  6474. warn('Unknown custom element: <' +
  6475. tag +
  6476. '> - did you ' +
  6477. 'register the component correctly? For recursive components, ' +
  6478. 'make sure to provide the "name" option.', vnode.context);
  6479. }
  6480. }
  6481. vnode.elm = vnode.ns
  6482. ? nodeOps.createElementNS(vnode.ns, tag)
  6483. : nodeOps.createElement(tag, vnode);
  6484. setScope(vnode);
  6485. createChildren(vnode, children, insertedVnodeQueue);
  6486. if (isDef(data)) {
  6487. invokeCreateHooks(vnode, insertedVnodeQueue);
  6488. }
  6489. insert(parentElm, vnode.elm, refElm);
  6490. if (process.env.NODE_ENV !== 'production' && data && data.pre) {
  6491. creatingElmInVPre--;
  6492. }
  6493. }
  6494. else if (isTrue(vnode.isComment)) {
  6495. vnode.elm = nodeOps.createComment(vnode.text);
  6496. insert(parentElm, vnode.elm, refElm);
  6497. }
  6498. else {
  6499. vnode.elm = nodeOps.createTextNode(vnode.text);
  6500. insert(parentElm, vnode.elm, refElm);
  6501. }
  6502. }
  6503. function createComponent(vnode, insertedVnodeQueue, parentElm, refElm) {
  6504. var i = vnode.data;
  6505. if (isDef(i)) {
  6506. var isReactivated = isDef(vnode.componentInstance) && i.keepAlive;
  6507. if (isDef((i = i.hook)) && isDef((i = i.init))) {
  6508. i(vnode, false /* hydrating */);
  6509. }
  6510. // after calling the init hook, if the vnode is a child component
  6511. // it should've created a child instance and mounted it. the child
  6512. // component also has set the placeholder vnode's elm.
  6513. // in that case we can just return the element and be done.
  6514. if (isDef(vnode.componentInstance)) {
  6515. initComponent(vnode, insertedVnodeQueue);
  6516. insert(parentElm, vnode.elm, refElm);
  6517. if (isTrue(isReactivated)) {
  6518. reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm);
  6519. }
  6520. return true;
  6521. }
  6522. }
  6523. }
  6524. function initComponent(vnode, insertedVnodeQueue) {
  6525. if (isDef(vnode.data.pendingInsert)) {
  6526. insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert);
  6527. vnode.data.pendingInsert = null;
  6528. }
  6529. vnode.elm = vnode.componentInstance.$el;
  6530. if (isPatchable(vnode)) {
  6531. invokeCreateHooks(vnode, insertedVnodeQueue);
  6532. setScope(vnode);
  6533. }
  6534. else {
  6535. // empty component root.
  6536. // skip all element-related modules except for ref (#3455)
  6537. registerRef(vnode);
  6538. // make sure to invoke the insert hook
  6539. insertedVnodeQueue.push(vnode);
  6540. }
  6541. }
  6542. function reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm) {
  6543. var i;
  6544. // hack for #4339: a reactivated component with inner transition
  6545. // does not trigger because the inner node's created hooks are not called
  6546. // again. It's not ideal to involve module-specific logic in here but
  6547. // there doesn't seem to be a better way to do it.
  6548. var innerNode = vnode;
  6549. while (innerNode.componentInstance) {
  6550. innerNode = innerNode.componentInstance._vnode;
  6551. if (isDef((i = innerNode.data)) && isDef((i = i.transition))) {
  6552. for (i = 0; i < cbs.activate.length; ++i) {
  6553. cbs.activate[i](emptyNode, innerNode);
  6554. }
  6555. insertedVnodeQueue.push(innerNode);
  6556. break;
  6557. }
  6558. }
  6559. // unlike a newly created component,
  6560. // a reactivated keep-alive component doesn't insert itself
  6561. insert(parentElm, vnode.elm, refElm);
  6562. }
  6563. function insert(parent, elm, ref) {
  6564. if (isDef(parent)) {
  6565. if (isDef(ref)) {
  6566. if (nodeOps.parentNode(ref) === parent) {
  6567. nodeOps.insertBefore(parent, elm, ref);
  6568. }
  6569. }
  6570. else {
  6571. nodeOps.appendChild(parent, elm);
  6572. }
  6573. }
  6574. }
  6575. function createChildren(vnode, children, insertedVnodeQueue) {
  6576. if (isArray(children)) {
  6577. if (process.env.NODE_ENV !== 'production') {
  6578. checkDuplicateKeys(children);
  6579. }
  6580. for (var i_1 = 0; i_1 < children.length; ++i_1) {
  6581. createElm(children[i_1], insertedVnodeQueue, vnode.elm, null, true, children, i_1);
  6582. }
  6583. }
  6584. else if (isPrimitive(vnode.text)) {
  6585. nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(String(vnode.text)));
  6586. }
  6587. }
  6588. function isPatchable(vnode) {
  6589. while (vnode.componentInstance) {
  6590. vnode = vnode.componentInstance._vnode;
  6591. }
  6592. return isDef(vnode.tag);
  6593. }
  6594. function invokeCreateHooks(vnode, insertedVnodeQueue) {
  6595. for (var i_2 = 0; i_2 < cbs.create.length; ++i_2) {
  6596. cbs.create[i_2](emptyNode, vnode);
  6597. }
  6598. i = vnode.data.hook; // Reuse variable
  6599. if (isDef(i)) {
  6600. if (isDef(i.create))
  6601. i.create(emptyNode, vnode);
  6602. if (isDef(i.insert))
  6603. insertedVnodeQueue.push(vnode);
  6604. }
  6605. }
  6606. // set scope id attribute for scoped CSS.
  6607. // this is implemented as a special case to avoid the overhead
  6608. // of going through the normal attribute patching process.
  6609. function setScope(vnode) {
  6610. var i;
  6611. if (isDef((i = vnode.fnScopeId))) {
  6612. nodeOps.setStyleScope(vnode.elm, i);
  6613. }
  6614. else {
  6615. var ancestor = vnode;
  6616. while (ancestor) {
  6617. if (isDef((i = ancestor.context)) && isDef((i = i.$options._scopeId))) {
  6618. nodeOps.setStyleScope(vnode.elm, i);
  6619. }
  6620. ancestor = ancestor.parent;
  6621. }
  6622. }
  6623. // for slot content they should also get the scopeId from the host instance.
  6624. if (isDef((i = activeInstance)) &&
  6625. i !== vnode.context &&
  6626. i !== vnode.fnContext &&
  6627. isDef((i = i.$options._scopeId))) {
  6628. nodeOps.setStyleScope(vnode.elm, i);
  6629. }
  6630. }
  6631. function addVnodes(parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) {
  6632. for (; startIdx <= endIdx; ++startIdx) {
  6633. createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm, false, vnodes, startIdx);
  6634. }
  6635. }
  6636. function invokeDestroyHook(vnode) {
  6637. var i, j;
  6638. var data = vnode.data;
  6639. if (isDef(data)) {
  6640. if (isDef((i = data.hook)) && isDef((i = i.destroy)))
  6641. i(vnode);
  6642. for (i = 0; i < cbs.destroy.length; ++i)
  6643. cbs.destroy[i](vnode);
  6644. }
  6645. if (isDef((i = vnode.children))) {
  6646. for (j = 0; j < vnode.children.length; ++j) {
  6647. invokeDestroyHook(vnode.children[j]);
  6648. }
  6649. }
  6650. }
  6651. function removeVnodes(vnodes, startIdx, endIdx) {
  6652. for (; startIdx <= endIdx; ++startIdx) {
  6653. var ch = vnodes[startIdx];
  6654. if (isDef(ch)) {
  6655. if (isDef(ch.tag)) {
  6656. removeAndInvokeRemoveHook(ch);
  6657. invokeDestroyHook(ch);
  6658. }
  6659. else {
  6660. // Text node
  6661. removeNode(ch.elm);
  6662. }
  6663. }
  6664. }
  6665. }
  6666. function removeAndInvokeRemoveHook(vnode, rm) {
  6667. if (isDef(rm) || isDef(vnode.data)) {
  6668. var i_3;
  6669. var listeners = cbs.remove.length + 1;
  6670. if (isDef(rm)) {
  6671. // we have a recursively passed down rm callback
  6672. // increase the listeners count
  6673. rm.listeners += listeners;
  6674. }
  6675. else {
  6676. // directly removing
  6677. rm = createRmCb(vnode.elm, listeners);
  6678. }
  6679. // recursively invoke hooks on child component root node
  6680. if (isDef((i_3 = vnode.componentInstance)) &&
  6681. isDef((i_3 = i_3._vnode)) &&
  6682. isDef(i_3.data)) {
  6683. removeAndInvokeRemoveHook(i_3, rm);
  6684. }
  6685. for (i_3 = 0; i_3 < cbs.remove.length; ++i_3) {
  6686. cbs.remove[i_3](vnode, rm);
  6687. }
  6688. if (isDef((i_3 = vnode.data.hook)) && isDef((i_3 = i_3.remove))) {
  6689. i_3(vnode, rm);
  6690. }
  6691. else {
  6692. rm();
  6693. }
  6694. }
  6695. else {
  6696. removeNode(vnode.elm);
  6697. }
  6698. }
  6699. function updateChildren(parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) {
  6700. var oldStartIdx = 0;
  6701. var newStartIdx = 0;
  6702. var oldEndIdx = oldCh.length - 1;
  6703. var oldStartVnode = oldCh[0];
  6704. var oldEndVnode = oldCh[oldEndIdx];
  6705. var newEndIdx = newCh.length - 1;
  6706. var newStartVnode = newCh[0];
  6707. var newEndVnode = newCh[newEndIdx];
  6708. var oldKeyToIdx, idxInOld, vnodeToMove, refElm;
  6709. // removeOnly is a special flag used only by <transition-group>
  6710. // to ensure removed elements stay in correct relative positions
  6711. // during leaving transitions
  6712. var canMove = !removeOnly;
  6713. if (process.env.NODE_ENV !== 'production') {
  6714. checkDuplicateKeys(newCh);
  6715. }
  6716. while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
  6717. if (isUndef(oldStartVnode)) {
  6718. oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left
  6719. }
  6720. else if (isUndef(oldEndVnode)) {
  6721. oldEndVnode = oldCh[--oldEndIdx];
  6722. }
  6723. else if (sameVnode(oldStartVnode, newStartVnode)) {
  6724. patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
  6725. oldStartVnode = oldCh[++oldStartIdx];
  6726. newStartVnode = newCh[++newStartIdx];
  6727. }
  6728. else if (sameVnode(oldEndVnode, newEndVnode)) {
  6729. patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);
  6730. oldEndVnode = oldCh[--oldEndIdx];
  6731. newEndVnode = newCh[--newEndIdx];
  6732. }
  6733. else if (sameVnode(oldStartVnode, newEndVnode)) {
  6734. // Vnode moved right
  6735. patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);
  6736. canMove &&
  6737. nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm));
  6738. oldStartVnode = oldCh[++oldStartIdx];
  6739. newEndVnode = newCh[--newEndIdx];
  6740. }
  6741. else if (sameVnode(oldEndVnode, newStartVnode)) {
  6742. // Vnode moved left
  6743. patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
  6744. canMove &&
  6745. nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);
  6746. oldEndVnode = oldCh[--oldEndIdx];
  6747. newStartVnode = newCh[++newStartIdx];
  6748. }
  6749. else {
  6750. if (isUndef(oldKeyToIdx))
  6751. oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx);
  6752. idxInOld = isDef(newStartVnode.key)
  6753. ? oldKeyToIdx[newStartVnode.key]
  6754. : findIdxInOld(newStartVnode, oldCh, oldStartIdx, oldEndIdx);
  6755. if (isUndef(idxInOld)) {
  6756. // New element
  6757. createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);
  6758. }
  6759. else {
  6760. vnodeToMove = oldCh[idxInOld];
  6761. if (sameVnode(vnodeToMove, newStartVnode)) {
  6762. patchVnode(vnodeToMove, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
  6763. oldCh[idxInOld] = undefined;
  6764. canMove &&
  6765. nodeOps.insertBefore(parentElm, vnodeToMove.elm, oldStartVnode.elm);
  6766. }
  6767. else {
  6768. // same key but different element. treat as new element
  6769. createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);
  6770. }
  6771. }
  6772. newStartVnode = newCh[++newStartIdx];
  6773. }
  6774. }
  6775. if (oldStartIdx > oldEndIdx) {
  6776. refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;
  6777. addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
  6778. }
  6779. else if (newStartIdx > newEndIdx) {
  6780. removeVnodes(oldCh, oldStartIdx, oldEndIdx);
  6781. }
  6782. }
  6783. function checkDuplicateKeys(children) {
  6784. var seenKeys = {};
  6785. for (var i_4 = 0; i_4 < children.length; i_4++) {
  6786. var vnode = children[i_4];
  6787. var key = vnode.key;
  6788. if (isDef(key)) {
  6789. if (seenKeys[key]) {
  6790. warn("Duplicate keys detected: '".concat(key, "'. This may cause an update error."), vnode.context);
  6791. }
  6792. else {
  6793. seenKeys[key] = true;
  6794. }
  6795. }
  6796. }
  6797. }
  6798. function findIdxInOld(node, oldCh, start, end) {
  6799. for (var i_5 = start; i_5 < end; i_5++) {
  6800. var c = oldCh[i_5];
  6801. if (isDef(c) && sameVnode(node, c))
  6802. return i_5;
  6803. }
  6804. }
  6805. function patchVnode(oldVnode, vnode, insertedVnodeQueue, ownerArray, index, removeOnly) {
  6806. if (oldVnode === vnode) {
  6807. return;
  6808. }
  6809. if (isDef(vnode.elm) && isDef(ownerArray)) {
  6810. // clone reused vnode
  6811. vnode = ownerArray[index] = cloneVNode(vnode);
  6812. }
  6813. var elm = (vnode.elm = oldVnode.elm);
  6814. if (isTrue(oldVnode.isAsyncPlaceholder)) {
  6815. if (isDef(vnode.asyncFactory.resolved)) {
  6816. hydrate(oldVnode.elm, vnode, insertedVnodeQueue);
  6817. }
  6818. else {
  6819. vnode.isAsyncPlaceholder = true;
  6820. }
  6821. return;
  6822. }
  6823. // reuse element for static trees.
  6824. // note we only do this if the vnode is cloned -
  6825. // if the new node is not cloned it means the render functions have been
  6826. // reset by the hot-reload-api and we need to do a proper re-render.
  6827. if (isTrue(vnode.isStatic) &&
  6828. isTrue(oldVnode.isStatic) &&
  6829. vnode.key === oldVnode.key &&
  6830. (isTrue(vnode.isCloned) || isTrue(vnode.isOnce))) {
  6831. vnode.componentInstance = oldVnode.componentInstance;
  6832. return;
  6833. }
  6834. var i;
  6835. var data = vnode.data;
  6836. if (isDef(data) && isDef((i = data.hook)) && isDef((i = i.prepatch))) {
  6837. i(oldVnode, vnode);
  6838. }
  6839. var oldCh = oldVnode.children;
  6840. var ch = vnode.children;
  6841. if (isDef(data) && isPatchable(vnode)) {
  6842. for (i = 0; i < cbs.update.length; ++i)
  6843. cbs.update[i](oldVnode, vnode);
  6844. if (isDef((i = data.hook)) && isDef((i = i.update)))
  6845. i(oldVnode, vnode);
  6846. }
  6847. if (isUndef(vnode.text)) {
  6848. if (isDef(oldCh) && isDef(ch)) {
  6849. if (oldCh !== ch)
  6850. updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly);
  6851. }
  6852. else if (isDef(ch)) {
  6853. if (process.env.NODE_ENV !== 'production') {
  6854. checkDuplicateKeys(ch);
  6855. }
  6856. if (isDef(oldVnode.text))
  6857. nodeOps.setTextContent(elm, '');
  6858. addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
  6859. }
  6860. else if (isDef(oldCh)) {
  6861. removeVnodes(oldCh, 0, oldCh.length - 1);
  6862. }
  6863. else if (isDef(oldVnode.text)) {
  6864. nodeOps.setTextContent(elm, '');
  6865. }
  6866. }
  6867. else if (oldVnode.text !== vnode.text) {
  6868. nodeOps.setTextContent(elm, vnode.text);
  6869. }
  6870. if (isDef(data)) {
  6871. if (isDef((i = data.hook)) && isDef((i = i.postpatch)))
  6872. i(oldVnode, vnode);
  6873. }
  6874. }
  6875. function invokeInsertHook(vnode, queue, initial) {
  6876. // delay insert hooks for component root nodes, invoke them after the
  6877. // element is really inserted
  6878. if (isTrue(initial) && isDef(vnode.parent)) {
  6879. vnode.parent.data.pendingInsert = queue;
  6880. }
  6881. else {
  6882. for (var i_6 = 0; i_6 < queue.length; ++i_6) {
  6883. queue[i_6].data.hook.insert(queue[i_6]);
  6884. }
  6885. }
  6886. }
  6887. var hydrationBailed = false;
  6888. // list of modules that can skip create hook during hydration because they
  6889. // are already rendered on the client or has no need for initialization
  6890. // Note: style is excluded because it relies on initial clone for future
  6891. // deep updates (#7063).
  6892. var isRenderedModule = makeMap('attrs,class,staticClass,staticStyle,key');
  6893. // Note: this is a browser-only function so we can assume elms are DOM nodes.
  6894. function hydrate(elm, vnode, insertedVnodeQueue, inVPre) {
  6895. var i;
  6896. var tag = vnode.tag, data = vnode.data, children = vnode.children;
  6897. inVPre = inVPre || (data && data.pre);
  6898. vnode.elm = elm;
  6899. if (isTrue(vnode.isComment) && isDef(vnode.asyncFactory)) {
  6900. vnode.isAsyncPlaceholder = true;
  6901. return true;
  6902. }
  6903. // assert node match
  6904. if (process.env.NODE_ENV !== 'production') {
  6905. if (!assertNodeMatch(elm, vnode, inVPre)) {
  6906. return false;
  6907. }
  6908. }
  6909. if (isDef(data)) {
  6910. if (isDef((i = data.hook)) && isDef((i = i.init)))
  6911. i(vnode, true /* hydrating */);
  6912. if (isDef((i = vnode.componentInstance))) {
  6913. // child component. it should have hydrated its own tree.
  6914. initComponent(vnode, insertedVnodeQueue);
  6915. return true;
  6916. }
  6917. }
  6918. if (isDef(tag)) {
  6919. if (isDef(children)) {
  6920. // empty element, allow client to pick up and populate children
  6921. if (!elm.hasChildNodes()) {
  6922. createChildren(vnode, children, insertedVnodeQueue);
  6923. }
  6924. else {
  6925. // v-html and domProps: innerHTML
  6926. if (isDef((i = data)) &&
  6927. isDef((i = i.domProps)) &&
  6928. isDef((i = i.innerHTML))) {
  6929. if (i !== elm.innerHTML) {
  6930. /* istanbul ignore if */
  6931. if (process.env.NODE_ENV !== 'production' &&
  6932. typeof console !== 'undefined' &&
  6933. !hydrationBailed) {
  6934. hydrationBailed = true;
  6935. console.warn('Parent: ', elm);
  6936. console.warn('server innerHTML: ', i);
  6937. console.warn('client innerHTML: ', elm.innerHTML);
  6938. }
  6939. return false;
  6940. }
  6941. }
  6942. else {
  6943. // iterate and compare children lists
  6944. var childrenMatch = true;
  6945. var childNode = elm.firstChild;
  6946. for (var i_7 = 0; i_7 < children.length; i_7++) {
  6947. if (!childNode ||
  6948. !hydrate(childNode, children[i_7], insertedVnodeQueue, inVPre)) {
  6949. childrenMatch = false;
  6950. break;
  6951. }
  6952. childNode = childNode.nextSibling;
  6953. }
  6954. // if childNode is not null, it means the actual childNodes list is
  6955. // longer than the virtual children list.
  6956. if (!childrenMatch || childNode) {
  6957. /* istanbul ignore if */
  6958. if (process.env.NODE_ENV !== 'production' &&
  6959. typeof console !== 'undefined' &&
  6960. !hydrationBailed) {
  6961. hydrationBailed = true;
  6962. console.warn('Parent: ', elm);
  6963. console.warn('Mismatching childNodes vs. VNodes: ', elm.childNodes, children);
  6964. }
  6965. return false;
  6966. }
  6967. }
  6968. }
  6969. }
  6970. if (isDef(data)) {
  6971. var fullInvoke = false;
  6972. for (var key in data) {
  6973. if (!isRenderedModule(key)) {
  6974. fullInvoke = true;
  6975. invokeCreateHooks(vnode, insertedVnodeQueue);
  6976. break;
  6977. }
  6978. }
  6979. if (!fullInvoke && data['class']) {
  6980. // ensure collecting deps for deep class bindings for future updates
  6981. traverse(data['class']);
  6982. }
  6983. }
  6984. }
  6985. else if (elm.data !== vnode.text) {
  6986. elm.data = vnode.text;
  6987. }
  6988. return true;
  6989. }
  6990. function assertNodeMatch(node, vnode, inVPre) {
  6991. if (isDef(vnode.tag)) {
  6992. return (vnode.tag.indexOf('vue-component') === 0 ||
  6993. (!isUnknownElement(vnode, inVPre) &&
  6994. vnode.tag.toLowerCase() ===
  6995. (node.tagName && node.tagName.toLowerCase())));
  6996. }
  6997. else {
  6998. return node.nodeType === (vnode.isComment ? 8 : 3);
  6999. }
  7000. }
  7001. return function patch(oldVnode, vnode, hydrating, removeOnly) {
  7002. if (isUndef(vnode)) {
  7003. if (isDef(oldVnode))
  7004. invokeDestroyHook(oldVnode);
  7005. return;
  7006. }
  7007. var isInitialPatch = false;
  7008. var insertedVnodeQueue = [];
  7009. if (isUndef(oldVnode)) {
  7010. // empty mount (likely as component), create new root element
  7011. isInitialPatch = true;
  7012. createElm(vnode, insertedVnodeQueue);
  7013. }
  7014. else {
  7015. var isRealElement = isDef(oldVnode.nodeType);
  7016. if (!isRealElement && sameVnode(oldVnode, vnode)) {
  7017. // patch existing root node
  7018. patchVnode(oldVnode, vnode, insertedVnodeQueue, null, null, removeOnly);
  7019. }
  7020. else {
  7021. if (isRealElement) {
  7022. // mounting to a real element
  7023. // check if this is server-rendered content and if we can perform
  7024. // a successful hydration.
  7025. if (oldVnode.nodeType === 1 && oldVnode.hasAttribute(SSR_ATTR)) {
  7026. oldVnode.removeAttribute(SSR_ATTR);
  7027. hydrating = true;
  7028. }
  7029. if (isTrue(hydrating)) {
  7030. if (hydrate(oldVnode, vnode, insertedVnodeQueue)) {
  7031. invokeInsertHook(vnode, insertedVnodeQueue, true);
  7032. return oldVnode;
  7033. }
  7034. else if (process.env.NODE_ENV !== 'production') {
  7035. warn('The client-side rendered virtual DOM tree is not matching ' +
  7036. 'server-rendered content. This is likely caused by incorrect ' +
  7037. 'HTML markup, for example nesting block-level elements inside ' +
  7038. '<p>, or missing <tbody>. Bailing hydration and performing ' +
  7039. 'full client-side render.');
  7040. }
  7041. }
  7042. // either not server-rendered, or hydration failed.
  7043. // create an empty node and replace it
  7044. oldVnode = emptyNodeAt(oldVnode);
  7045. }
  7046. // replacing existing element
  7047. var oldElm = oldVnode.elm;
  7048. var parentElm = nodeOps.parentNode(oldElm);
  7049. // create new node
  7050. createElm(vnode, insertedVnodeQueue,
  7051. // extremely rare edge case: do not insert if old element is in a
  7052. // leaving transition. Only happens when combining transition +
  7053. // keep-alive + HOCs. (#4590)
  7054. oldElm._leaveCb ? null : parentElm, nodeOps.nextSibling(oldElm));
  7055. // update parent placeholder node element, recursively
  7056. if (isDef(vnode.parent)) {
  7057. var ancestor = vnode.parent;
  7058. var patchable = isPatchable(vnode);
  7059. while (ancestor) {
  7060. for (var i_8 = 0; i_8 < cbs.destroy.length; ++i_8) {
  7061. cbs.destroy[i_8](ancestor);
  7062. }
  7063. ancestor.elm = vnode.elm;
  7064. if (patchable) {
  7065. for (var i_9 = 0; i_9 < cbs.create.length; ++i_9) {
  7066. cbs.create[i_9](emptyNode, ancestor);
  7067. }
  7068. // #6513
  7069. // invoke insert hooks that may have been merged by create hooks.
  7070. // e.g. for directives that uses the "inserted" hook.
  7071. var insert_1 = ancestor.data.hook.insert;
  7072. if (insert_1.merged) {
  7073. // start at index 1 to avoid re-invoking component mounted hook
  7074. // clone insert hooks to avoid being mutated during iteration.
  7075. // e.g. for customed directives under transition group.
  7076. var cloned = insert_1.fns.slice(1);
  7077. for (var i_10 = 0; i_10 < cloned.length; i_10++) {
  7078. cloned[i_10]();
  7079. }
  7080. }
  7081. }
  7082. else {
  7083. registerRef(ancestor);
  7084. }
  7085. ancestor = ancestor.parent;
  7086. }
  7087. }
  7088. // destroy old node
  7089. if (isDef(parentElm)) {
  7090. removeVnodes([oldVnode], 0, 0);
  7091. }
  7092. else if (isDef(oldVnode.tag)) {
  7093. invokeDestroyHook(oldVnode);
  7094. }
  7095. }
  7096. }
  7097. invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch);
  7098. return vnode.elm;
  7099. };
  7100. }
  7101. var directives = {
  7102. create: updateDirectives,
  7103. update: updateDirectives,
  7104. destroy: function unbindDirectives(vnode) {
  7105. // @ts-expect-error emptyNode is not VNodeWithData
  7106. updateDirectives(vnode, emptyNode);
  7107. }
  7108. };
  7109. function updateDirectives(oldVnode, vnode) {
  7110. if (oldVnode.data.directives || vnode.data.directives) {
  7111. _update(oldVnode, vnode);
  7112. }
  7113. }
  7114. function _update(oldVnode, vnode) {
  7115. var isCreate = oldVnode === emptyNode;
  7116. var isDestroy = vnode === emptyNode;
  7117. var oldDirs = normalizeDirectives(oldVnode.data.directives, oldVnode.context);
  7118. var newDirs = normalizeDirectives(vnode.data.directives, vnode.context);
  7119. var dirsWithInsert = [];
  7120. var dirsWithPostpatch = [];
  7121. var key, oldDir, dir;
  7122. for (key in newDirs) {
  7123. oldDir = oldDirs[key];
  7124. dir = newDirs[key];
  7125. if (!oldDir) {
  7126. // new directive, bind
  7127. callHook(dir, 'bind', vnode, oldVnode);
  7128. if (dir.def && dir.def.inserted) {
  7129. dirsWithInsert.push(dir);
  7130. }
  7131. }
  7132. else {
  7133. // existing directive, update
  7134. dir.oldValue = oldDir.value;
  7135. dir.oldArg = oldDir.arg;
  7136. callHook(dir, 'update', vnode, oldVnode);
  7137. if (dir.def && dir.def.componentUpdated) {
  7138. dirsWithPostpatch.push(dir);
  7139. }
  7140. }
  7141. }
  7142. if (dirsWithInsert.length) {
  7143. var callInsert = function () {
  7144. for (var i = 0; i < dirsWithInsert.length; i++) {
  7145. callHook(dirsWithInsert[i], 'inserted', vnode, oldVnode);
  7146. }
  7147. };
  7148. if (isCreate) {
  7149. mergeVNodeHook(vnode, 'insert', callInsert);
  7150. }
  7151. else {
  7152. callInsert();
  7153. }
  7154. }
  7155. if (dirsWithPostpatch.length) {
  7156. mergeVNodeHook(vnode, 'postpatch', function () {
  7157. for (var i = 0; i < dirsWithPostpatch.length; i++) {
  7158. callHook(dirsWithPostpatch[i], 'componentUpdated', vnode, oldVnode);
  7159. }
  7160. });
  7161. }
  7162. if (!isCreate) {
  7163. for (key in oldDirs) {
  7164. if (!newDirs[key]) {
  7165. // no longer present, unbind
  7166. callHook(oldDirs[key], 'unbind', oldVnode, oldVnode, isDestroy);
  7167. }
  7168. }
  7169. }
  7170. }
  7171. var emptyModifiers = Object.create(null);
  7172. function normalizeDirectives(dirs, vm) {
  7173. var res = Object.create(null);
  7174. if (!dirs) {
  7175. // $flow-disable-line
  7176. return res;
  7177. }
  7178. var i, dir;
  7179. for (i = 0; i < dirs.length; i++) {
  7180. dir = dirs[i];
  7181. if (!dir.modifiers) {
  7182. // $flow-disable-line
  7183. dir.modifiers = emptyModifiers;
  7184. }
  7185. res[getRawDirName(dir)] = dir;
  7186. if (vm._setupState && vm._setupState.__sfc) {
  7187. var setupDef = dir.def || resolveAsset(vm, '_setupState', 'v-' + dir.name);
  7188. if (typeof setupDef === 'function') {
  7189. dir.def = {
  7190. bind: setupDef,
  7191. update: setupDef,
  7192. };
  7193. }
  7194. else {
  7195. dir.def = setupDef;
  7196. }
  7197. }
  7198. dir.def = dir.def || resolveAsset(vm.$options, 'directives', dir.name, true);
  7199. }
  7200. // $flow-disable-line
  7201. return res;
  7202. }
  7203. function getRawDirName(dir) {
  7204. return (dir.rawName || "".concat(dir.name, ".").concat(Object.keys(dir.modifiers || {}).join('.')));
  7205. }
  7206. function callHook(dir, hook, vnode, oldVnode, isDestroy) {
  7207. var fn = dir.def && dir.def[hook];
  7208. if (fn) {
  7209. try {
  7210. fn(vnode.elm, dir, vnode, oldVnode, isDestroy);
  7211. }
  7212. catch (e) {
  7213. handleError(e, vnode.context, "directive ".concat(dir.name, " ").concat(hook, " hook"));
  7214. }
  7215. }
  7216. }
  7217. var baseModules = [ref, directives];
  7218. function updateAttrs(oldVnode, vnode) {
  7219. var opts = vnode.componentOptions;
  7220. if (isDef(opts) && opts.Ctor.options.inheritAttrs === false) {
  7221. return;
  7222. }
  7223. if (isUndef(oldVnode.data.attrs) && isUndef(vnode.data.attrs)) {
  7224. return;
  7225. }
  7226. var key, cur, old;
  7227. var elm = vnode.elm;
  7228. var oldAttrs = oldVnode.data.attrs || {};
  7229. var attrs = vnode.data.attrs || {};
  7230. // clone observed objects, as the user probably wants to mutate it
  7231. if (isDef(attrs.__ob__) || isTrue(attrs._v_attr_proxy)) {
  7232. attrs = vnode.data.attrs = extend({}, attrs);
  7233. }
  7234. for (key in attrs) {
  7235. cur = attrs[key];
  7236. old = oldAttrs[key];
  7237. if (old !== cur) {
  7238. setAttr(elm, key, cur, vnode.data.pre);
  7239. }
  7240. }
  7241. // #4391: in IE9, setting type can reset value for input[type=radio]
  7242. // #6666: IE/Edge forces progress value down to 1 before setting a max
  7243. /* istanbul ignore if */
  7244. if ((isIE || isEdge) && attrs.value !== oldAttrs.value) {
  7245. setAttr(elm, 'value', attrs.value);
  7246. }
  7247. for (key in oldAttrs) {
  7248. if (isUndef(attrs[key])) {
  7249. if (isXlink(key)) {
  7250. elm.removeAttributeNS(xlinkNS, getXlinkProp(key));
  7251. }
  7252. else if (!isEnumeratedAttr(key)) {
  7253. elm.removeAttribute(key);
  7254. }
  7255. }
  7256. }
  7257. }
  7258. function setAttr(el, key, value, isInPre) {
  7259. if (isInPre || el.tagName.indexOf('-') > -1) {
  7260. baseSetAttr(el, key, value);
  7261. }
  7262. else if (isBooleanAttr(key)) {
  7263. // set attribute for blank value
  7264. // e.g. <option disabled>Select one</option>
  7265. if (isFalsyAttrValue(value)) {
  7266. el.removeAttribute(key);
  7267. }
  7268. else {
  7269. // technically allowfullscreen is a boolean attribute for <iframe>,
  7270. // but Flash expects a value of "true" when used on <embed> tag
  7271. value = key === 'allowfullscreen' && el.tagName === 'EMBED' ? 'true' : key;
  7272. el.setAttribute(key, value);
  7273. }
  7274. }
  7275. else if (isEnumeratedAttr(key)) {
  7276. el.setAttribute(key, convertEnumeratedValue(key, value));
  7277. }
  7278. else if (isXlink(key)) {
  7279. if (isFalsyAttrValue(value)) {
  7280. el.removeAttributeNS(xlinkNS, getXlinkProp(key));
  7281. }
  7282. else {
  7283. el.setAttributeNS(xlinkNS, key, value);
  7284. }
  7285. }
  7286. else {
  7287. baseSetAttr(el, key, value);
  7288. }
  7289. }
  7290. function baseSetAttr(el, key, value) {
  7291. if (isFalsyAttrValue(value)) {
  7292. el.removeAttribute(key);
  7293. }
  7294. else {
  7295. // #7138: IE10 & 11 fires input event when setting placeholder on
  7296. // <textarea>... block the first input event and remove the blocker
  7297. // immediately.
  7298. /* istanbul ignore if */
  7299. if (isIE &&
  7300. !isIE9 &&
  7301. el.tagName === 'TEXTAREA' &&
  7302. key === 'placeholder' &&
  7303. value !== '' &&
  7304. !el.__ieph) {
  7305. var blocker_1 = function (e) {
  7306. e.stopImmediatePropagation();
  7307. el.removeEventListener('input', blocker_1);
  7308. };
  7309. el.addEventListener('input', blocker_1);
  7310. // $flow-disable-line
  7311. el.__ieph = true; /* IE placeholder patched */
  7312. }
  7313. el.setAttribute(key, value);
  7314. }
  7315. }
  7316. var attrs = {
  7317. create: updateAttrs,
  7318. update: updateAttrs
  7319. };
  7320. function updateClass(oldVnode, vnode) {
  7321. var el = vnode.elm;
  7322. var data = vnode.data;
  7323. var oldData = oldVnode.data;
  7324. if (isUndef(data.staticClass) &&
  7325. isUndef(data.class) &&
  7326. (isUndef(oldData) ||
  7327. (isUndef(oldData.staticClass) && isUndef(oldData.class)))) {
  7328. return;
  7329. }
  7330. var cls = genClassForVnode(vnode);
  7331. // handle transition classes
  7332. var transitionClass = el._transitionClasses;
  7333. if (isDef(transitionClass)) {
  7334. cls = concat(cls, stringifyClass(transitionClass));
  7335. }
  7336. // set the class
  7337. if (cls !== el._prevClass) {
  7338. el.setAttribute('class', cls);
  7339. el._prevClass = cls;
  7340. }
  7341. }
  7342. var klass = {
  7343. create: updateClass,
  7344. update: updateClass
  7345. };
  7346. // in some cases, the event used has to be determined at runtime
  7347. // so we used some reserved tokens during compile.
  7348. var RANGE_TOKEN = '__r';
  7349. var CHECKBOX_RADIO_TOKEN = '__c';
  7350. // normalize v-model event tokens that can only be determined at runtime.
  7351. // it's important to place the event as the first in the array because
  7352. // the whole point is ensuring the v-model callback gets called before
  7353. // user-attached handlers.
  7354. function normalizeEvents(on) {
  7355. /* istanbul ignore if */
  7356. if (isDef(on[RANGE_TOKEN])) {
  7357. // IE input[type=range] only supports `change` event
  7358. var event_1 = isIE ? 'change' : 'input';
  7359. on[event_1] = [].concat(on[RANGE_TOKEN], on[event_1] || []);
  7360. delete on[RANGE_TOKEN];
  7361. }
  7362. // This was originally intended to fix #4521 but no longer necessary
  7363. // after 2.5. Keeping it for backwards compat with generated code from < 2.4
  7364. /* istanbul ignore if */
  7365. if (isDef(on[CHECKBOX_RADIO_TOKEN])) {
  7366. on.change = [].concat(on[CHECKBOX_RADIO_TOKEN], on.change || []);
  7367. delete on[CHECKBOX_RADIO_TOKEN];
  7368. }
  7369. }
  7370. var target;
  7371. function createOnceHandler(event, handler, capture) {
  7372. var _target = target; // save current target element in closure
  7373. return function onceHandler() {
  7374. var res = handler.apply(null, arguments);
  7375. if (res !== null) {
  7376. remove(event, onceHandler, capture, _target);
  7377. }
  7378. };
  7379. }
  7380. // #9446: Firefox <= 53 (in particular, ESR 52) has incorrect Event.timeStamp
  7381. // implementation and does not fire microtasks in between event propagation, so
  7382. // safe to exclude.
  7383. var useMicrotaskFix = isUsingMicroTask && !(isFF && Number(isFF[1]) <= 53);
  7384. function add(name, handler, capture, passive) {
  7385. // async edge case #6566: inner click event triggers patch, event handler
  7386. // attached to outer element during patch, and triggered again. This
  7387. // happens because browsers fire microtask ticks between event propagation.
  7388. // the solution is simple: we save the timestamp when a handler is attached,
  7389. // and the handler would only fire if the event passed to it was fired
  7390. // AFTER it was attached.
  7391. if (useMicrotaskFix) {
  7392. var attachedTimestamp_1 = currentFlushTimestamp;
  7393. var original_1 = handler;
  7394. //@ts-expect-error
  7395. handler = original_1._wrapper = function (e) {
  7396. if (
  7397. // no bubbling, should always fire.
  7398. // this is just a safety net in case event.timeStamp is unreliable in
  7399. // certain weird environments...
  7400. e.target === e.currentTarget ||
  7401. // event is fired after handler attachment
  7402. e.timeStamp >= attachedTimestamp_1 ||
  7403. // bail for environments that have buggy event.timeStamp implementations
  7404. // #9462 iOS 9 bug: event.timeStamp is 0 after history.pushState
  7405. // #9681 QtWebEngine event.timeStamp is negative value
  7406. e.timeStamp <= 0 ||
  7407. // #9448 bail if event is fired in another document in a multi-page
  7408. // electron/nw.js app, since event.timeStamp will be using a different
  7409. // starting reference
  7410. e.target.ownerDocument !== document) {
  7411. return original_1.apply(this, arguments);
  7412. }
  7413. };
  7414. }
  7415. target.addEventListener(name, handler, supportsPassive ? { capture: capture, passive: passive } : capture);
  7416. }
  7417. function remove(name, handler, capture, _target) {
  7418. (_target || target).removeEventListener(name,
  7419. //@ts-expect-error
  7420. handler._wrapper || handler, capture);
  7421. }
  7422. function updateDOMListeners(oldVnode, vnode) {
  7423. if (isUndef(oldVnode.data.on) && isUndef(vnode.data.on)) {
  7424. return;
  7425. }
  7426. var on = vnode.data.on || {};
  7427. var oldOn = oldVnode.data.on || {};
  7428. // vnode is empty when removing all listeners,
  7429. // and use old vnode dom element
  7430. target = vnode.elm || oldVnode.elm;
  7431. normalizeEvents(on);
  7432. updateListeners(on, oldOn, add, remove, createOnceHandler, vnode.context);
  7433. target = undefined;
  7434. }
  7435. var events = {
  7436. create: updateDOMListeners,
  7437. update: updateDOMListeners,
  7438. // @ts-expect-error emptyNode has actually data
  7439. destroy: function (vnode) { return updateDOMListeners(vnode, emptyNode); }
  7440. };
  7441. var svgContainer;
  7442. function updateDOMProps(oldVnode, vnode) {
  7443. if (isUndef(oldVnode.data.domProps) && isUndef(vnode.data.domProps)) {
  7444. return;
  7445. }
  7446. var key, cur;
  7447. var elm = vnode.elm;
  7448. var oldProps = oldVnode.data.domProps || {};
  7449. var props = vnode.data.domProps || {};
  7450. // clone observed objects, as the user probably wants to mutate it
  7451. if (isDef(props.__ob__) || isTrue(props._v_attr_proxy)) {
  7452. props = vnode.data.domProps = extend({}, props);
  7453. }
  7454. for (key in oldProps) {
  7455. if (!(key in props)) {
  7456. elm[key] = '';
  7457. }
  7458. }
  7459. for (key in props) {
  7460. cur = props[key];
  7461. // ignore children if the node has textContent or innerHTML,
  7462. // as these will throw away existing DOM nodes and cause removal errors
  7463. // on subsequent patches (#3360)
  7464. if (key === 'textContent' || key === 'innerHTML') {
  7465. if (vnode.children)
  7466. vnode.children.length = 0;
  7467. if (cur === oldProps[key])
  7468. continue;
  7469. // #6601 work around Chrome version <= 55 bug where single textNode
  7470. // replaced by innerHTML/textContent retains its parentNode property
  7471. if (elm.childNodes.length === 1) {
  7472. elm.removeChild(elm.childNodes[0]);
  7473. }
  7474. }
  7475. if (key === 'value' && elm.tagName !== 'PROGRESS') {
  7476. // store value as _value as well since
  7477. // non-string values will be stringified
  7478. elm._value = cur;
  7479. // avoid resetting cursor position when value is the same
  7480. var strCur = isUndef(cur) ? '' : String(cur);
  7481. if (shouldUpdateValue(elm, strCur)) {
  7482. elm.value = strCur;
  7483. }
  7484. }
  7485. else if (key === 'innerHTML' &&
  7486. isSVG(elm.tagName) &&
  7487. isUndef(elm.innerHTML)) {
  7488. // IE doesn't support innerHTML for SVG elements
  7489. svgContainer = svgContainer || document.createElement('div');
  7490. svgContainer.innerHTML = "<svg>".concat(cur, "</svg>");
  7491. var svg = svgContainer.firstChild;
  7492. while (elm.firstChild) {
  7493. elm.removeChild(elm.firstChild);
  7494. }
  7495. while (svg.firstChild) {
  7496. elm.appendChild(svg.firstChild);
  7497. }
  7498. }
  7499. else if (
  7500. // skip the update if old and new VDOM state is the same.
  7501. // `value` is handled separately because the DOM value may be temporarily
  7502. // out of sync with VDOM state due to focus, composition and modifiers.
  7503. // This #4521 by skipping the unnecessary `checked` update.
  7504. cur !== oldProps[key]) {
  7505. // some property updates can throw
  7506. // e.g. `value` on <progress> w/ non-finite value
  7507. try {
  7508. elm[key] = cur;
  7509. }
  7510. catch (e) { }
  7511. }
  7512. }
  7513. }
  7514. function shouldUpdateValue(elm, checkVal) {
  7515. return (
  7516. //@ts-expect-error
  7517. !elm.composing &&
  7518. (elm.tagName === 'OPTION' ||
  7519. isNotInFocusAndDirty(elm, checkVal) ||
  7520. isDirtyWithModifiers(elm, checkVal)));
  7521. }
  7522. function isNotInFocusAndDirty(elm, checkVal) {
  7523. // return true when textbox (.number and .trim) loses focus and its value is
  7524. // not equal to the updated value
  7525. var notInFocus = true;
  7526. // #6157
  7527. // work around IE bug when accessing document.activeElement in an iframe
  7528. try {
  7529. notInFocus = document.activeElement !== elm;
  7530. }
  7531. catch (e) { }
  7532. return notInFocus && elm.value !== checkVal;
  7533. }
  7534. function isDirtyWithModifiers(elm, newVal) {
  7535. var value = elm.value;
  7536. var modifiers = elm._vModifiers; // injected by v-model runtime
  7537. if (isDef(modifiers)) {
  7538. if (modifiers.number) {
  7539. return toNumber(value) !== toNumber(newVal);
  7540. }
  7541. if (modifiers.trim) {
  7542. return value.trim() !== newVal.trim();
  7543. }
  7544. }
  7545. return value !== newVal;
  7546. }
  7547. var domProps = {
  7548. create: updateDOMProps,
  7549. update: updateDOMProps
  7550. };
  7551. var parseStyleText = cached(function (cssText) {
  7552. var res = {};
  7553. var listDelimiter = /;(?![^(]*\))/g;
  7554. var propertyDelimiter = /:(.+)/;
  7555. cssText.split(listDelimiter).forEach(function (item) {
  7556. if (item) {
  7557. var tmp = item.split(propertyDelimiter);
  7558. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  7559. }
  7560. });
  7561. return res;
  7562. });
  7563. // merge static and dynamic style data on the same vnode
  7564. function normalizeStyleData(data) {
  7565. var style = normalizeStyleBinding(data.style);
  7566. // static style is pre-processed into an object during compilation
  7567. // and is always a fresh object, so it's safe to merge into it
  7568. return data.staticStyle ? extend(data.staticStyle, style) : style;
  7569. }
  7570. // normalize possible array / string values into Object
  7571. function normalizeStyleBinding(bindingStyle) {
  7572. if (Array.isArray(bindingStyle)) {
  7573. return toObject(bindingStyle);
  7574. }
  7575. if (typeof bindingStyle === 'string') {
  7576. return parseStyleText(bindingStyle);
  7577. }
  7578. return bindingStyle;
  7579. }
  7580. /**
  7581. * parent component style should be after child's
  7582. * so that parent component's style could override it
  7583. */
  7584. function getStyle(vnode, checkChild) {
  7585. var res = {};
  7586. var styleData;
  7587. if (checkChild) {
  7588. var childNode = vnode;
  7589. while (childNode.componentInstance) {
  7590. childNode = childNode.componentInstance._vnode;
  7591. if (childNode &&
  7592. childNode.data &&
  7593. (styleData = normalizeStyleData(childNode.data))) {
  7594. extend(res, styleData);
  7595. }
  7596. }
  7597. }
  7598. if ((styleData = normalizeStyleData(vnode.data))) {
  7599. extend(res, styleData);
  7600. }
  7601. var parentNode = vnode;
  7602. // @ts-expect-error parentNode.parent not VNodeWithData
  7603. while ((parentNode = parentNode.parent)) {
  7604. if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {
  7605. extend(res, styleData);
  7606. }
  7607. }
  7608. return res;
  7609. }
  7610. var cssVarRE = /^--/;
  7611. var importantRE = /\s*!important$/;
  7612. var setProp = function (el, name, val) {
  7613. /* istanbul ignore if */
  7614. if (cssVarRE.test(name)) {
  7615. el.style.setProperty(name, val);
  7616. }
  7617. else if (importantRE.test(val)) {
  7618. el.style.setProperty(hyphenate(name), val.replace(importantRE, ''), 'important');
  7619. }
  7620. else {
  7621. var normalizedName = normalize(name);
  7622. if (Array.isArray(val)) {
  7623. // Support values array created by autoprefixer, e.g.
  7624. // {display: ["-webkit-box", "-ms-flexbox", "flex"]}
  7625. // Set them one by one, and the browser will only set those it can recognize
  7626. for (var i = 0, len = val.length; i < len; i++) {
  7627. el.style[normalizedName] = val[i];
  7628. }
  7629. }
  7630. else {
  7631. el.style[normalizedName] = val;
  7632. }
  7633. }
  7634. };
  7635. var vendorNames = ['Webkit', 'Moz', 'ms'];
  7636. var emptyStyle;
  7637. var normalize = cached(function (prop) {
  7638. emptyStyle = emptyStyle || document.createElement('div').style;
  7639. prop = camelize(prop);
  7640. if (prop !== 'filter' && prop in emptyStyle) {
  7641. return prop;
  7642. }
  7643. var capName = prop.charAt(0).toUpperCase() + prop.slice(1);
  7644. for (var i = 0; i < vendorNames.length; i++) {
  7645. var name_1 = vendorNames[i] + capName;
  7646. if (name_1 in emptyStyle) {
  7647. return name_1;
  7648. }
  7649. }
  7650. });
  7651. function updateStyle(oldVnode, vnode) {
  7652. var data = vnode.data;
  7653. var oldData = oldVnode.data;
  7654. if (isUndef(data.staticStyle) &&
  7655. isUndef(data.style) &&
  7656. isUndef(oldData.staticStyle) &&
  7657. isUndef(oldData.style)) {
  7658. return;
  7659. }
  7660. var cur, name;
  7661. var el = vnode.elm;
  7662. var oldStaticStyle = oldData.staticStyle;
  7663. var oldStyleBinding = oldData.normalizedStyle || oldData.style || {};
  7664. // if static style exists, stylebinding already merged into it when doing normalizeStyleData
  7665. var oldStyle = oldStaticStyle || oldStyleBinding;
  7666. var style = normalizeStyleBinding(vnode.data.style) || {};
  7667. // store normalized style under a different key for next diff
  7668. // make sure to clone it if it's reactive, since the user likely wants
  7669. // to mutate it.
  7670. vnode.data.normalizedStyle = isDef(style.__ob__) ? extend({}, style) : style;
  7671. var newStyle = getStyle(vnode, true);
  7672. for (name in oldStyle) {
  7673. if (isUndef(newStyle[name])) {
  7674. setProp(el, name, '');
  7675. }
  7676. }
  7677. for (name in newStyle) {
  7678. cur = newStyle[name];
  7679. // ie9 setting to null has no effect, must use empty string
  7680. setProp(el, name, cur == null ? '' : cur);
  7681. }
  7682. }
  7683. var style = {
  7684. create: updateStyle,
  7685. update: updateStyle
  7686. };
  7687. var whitespaceRE = /\s+/;
  7688. /**
  7689. * Add class with compatibility for SVG since classList is not supported on
  7690. * SVG elements in IE
  7691. */
  7692. function addClass(el, cls) {
  7693. /* istanbul ignore if */
  7694. if (!cls || !(cls = cls.trim())) {
  7695. return;
  7696. }
  7697. /* istanbul ignore else */
  7698. if (el.classList) {
  7699. if (cls.indexOf(' ') > -1) {
  7700. cls.split(whitespaceRE).forEach(function (c) { return el.classList.add(c); });
  7701. }
  7702. else {
  7703. el.classList.add(cls);
  7704. }
  7705. }
  7706. else {
  7707. var cur = " ".concat(el.getAttribute('class') || '', " ");
  7708. if (cur.indexOf(' ' + cls + ' ') < 0) {
  7709. el.setAttribute('class', (cur + cls).trim());
  7710. }
  7711. }
  7712. }
  7713. /**
  7714. * Remove class with compatibility for SVG since classList is not supported on
  7715. * SVG elements in IE
  7716. */
  7717. function removeClass(el, cls) {
  7718. /* istanbul ignore if */
  7719. if (!cls || !(cls = cls.trim())) {
  7720. return;
  7721. }
  7722. /* istanbul ignore else */
  7723. if (el.classList) {
  7724. if (cls.indexOf(' ') > -1) {
  7725. cls.split(whitespaceRE).forEach(function (c) { return el.classList.remove(c); });
  7726. }
  7727. else {
  7728. el.classList.remove(cls);
  7729. }
  7730. if (!el.classList.length) {
  7731. el.removeAttribute('class');
  7732. }
  7733. }
  7734. else {
  7735. var cur = " ".concat(el.getAttribute('class') || '', " ");
  7736. var tar = ' ' + cls + ' ';
  7737. while (cur.indexOf(tar) >= 0) {
  7738. cur = cur.replace(tar, ' ');
  7739. }
  7740. cur = cur.trim();
  7741. if (cur) {
  7742. el.setAttribute('class', cur);
  7743. }
  7744. else {
  7745. el.removeAttribute('class');
  7746. }
  7747. }
  7748. }
  7749. function resolveTransition(def) {
  7750. if (!def) {
  7751. return;
  7752. }
  7753. /* istanbul ignore else */
  7754. if (typeof def === 'object') {
  7755. var res = {};
  7756. if (def.css !== false) {
  7757. extend(res, autoCssTransition(def.name || 'v'));
  7758. }
  7759. extend(res, def);
  7760. return res;
  7761. }
  7762. else if (typeof def === 'string') {
  7763. return autoCssTransition(def);
  7764. }
  7765. }
  7766. var autoCssTransition = cached(function (name) {
  7767. return {
  7768. enterClass: "".concat(name, "-enter"),
  7769. enterToClass: "".concat(name, "-enter-to"),
  7770. enterActiveClass: "".concat(name, "-enter-active"),
  7771. leaveClass: "".concat(name, "-leave"),
  7772. leaveToClass: "".concat(name, "-leave-to"),
  7773. leaveActiveClass: "".concat(name, "-leave-active")
  7774. };
  7775. });
  7776. var hasTransition = inBrowser && !isIE9;
  7777. var TRANSITION = 'transition';
  7778. var ANIMATION = 'animation';
  7779. // Transition property/event sniffing
  7780. var transitionProp = 'transition';
  7781. var transitionEndEvent = 'transitionend';
  7782. var animationProp = 'animation';
  7783. var animationEndEvent = 'animationend';
  7784. if (hasTransition) {
  7785. /* istanbul ignore if */
  7786. if (window.ontransitionend === undefined &&
  7787. window.onwebkittransitionend !== undefined) {
  7788. transitionProp = 'WebkitTransition';
  7789. transitionEndEvent = 'webkitTransitionEnd';
  7790. }
  7791. if (window.onanimationend === undefined &&
  7792. window.onwebkitanimationend !== undefined) {
  7793. animationProp = 'WebkitAnimation';
  7794. animationEndEvent = 'webkitAnimationEnd';
  7795. }
  7796. }
  7797. // binding to window is necessary to make hot reload work in IE in strict mode
  7798. var raf = inBrowser
  7799. ? window.requestAnimationFrame
  7800. ? window.requestAnimationFrame.bind(window)
  7801. : setTimeout
  7802. : /* istanbul ignore next */ function (/* istanbul ignore next */ fn) { return fn(); };
  7803. function nextFrame(fn) {
  7804. raf(function () {
  7805. // @ts-expect-error
  7806. raf(fn);
  7807. });
  7808. }
  7809. function addTransitionClass(el, cls) {
  7810. var transitionClasses = el._transitionClasses || (el._transitionClasses = []);
  7811. if (transitionClasses.indexOf(cls) < 0) {
  7812. transitionClasses.push(cls);
  7813. addClass(el, cls);
  7814. }
  7815. }
  7816. function removeTransitionClass(el, cls) {
  7817. if (el._transitionClasses) {
  7818. remove$2(el._transitionClasses, cls);
  7819. }
  7820. removeClass(el, cls);
  7821. }
  7822. function whenTransitionEnds(el, expectedType, cb) {
  7823. var _a = getTransitionInfo(el, expectedType), type = _a.type, timeout = _a.timeout, propCount = _a.propCount;
  7824. if (!type)
  7825. return cb();
  7826. var event = type === TRANSITION ? transitionEndEvent : animationEndEvent;
  7827. var ended = 0;
  7828. var end = function () {
  7829. el.removeEventListener(event, onEnd);
  7830. cb();
  7831. };
  7832. var onEnd = function (e) {
  7833. if (e.target === el) {
  7834. if (++ended >= propCount) {
  7835. end();
  7836. }
  7837. }
  7838. };
  7839. setTimeout(function () {
  7840. if (ended < propCount) {
  7841. end();
  7842. }
  7843. }, timeout + 1);
  7844. el.addEventListener(event, onEnd);
  7845. }
  7846. var transformRE = /\b(transform|all)(,|$)/;
  7847. function getTransitionInfo(el, expectedType) {
  7848. var styles = window.getComputedStyle(el);
  7849. // JSDOM may return undefined for transition properties
  7850. var transitionDelays = (styles[transitionProp + 'Delay'] || '').split(', ');
  7851. var transitionDurations = (styles[transitionProp + 'Duration'] || '').split(', ');
  7852. var transitionTimeout = getTimeout(transitionDelays, transitionDurations);
  7853. var animationDelays = (styles[animationProp + 'Delay'] || '').split(', ');
  7854. var animationDurations = (styles[animationProp + 'Duration'] || '').split(', ');
  7855. var animationTimeout = getTimeout(animationDelays, animationDurations);
  7856. var type;
  7857. var timeout = 0;
  7858. var propCount = 0;
  7859. /* istanbul ignore if */
  7860. if (expectedType === TRANSITION) {
  7861. if (transitionTimeout > 0) {
  7862. type = TRANSITION;
  7863. timeout = transitionTimeout;
  7864. propCount = transitionDurations.length;
  7865. }
  7866. }
  7867. else if (expectedType === ANIMATION) {
  7868. if (animationTimeout > 0) {
  7869. type = ANIMATION;
  7870. timeout = animationTimeout;
  7871. propCount = animationDurations.length;
  7872. }
  7873. }
  7874. else {
  7875. timeout = Math.max(transitionTimeout, animationTimeout);
  7876. type =
  7877. timeout > 0
  7878. ? transitionTimeout > animationTimeout
  7879. ? TRANSITION
  7880. : ANIMATION
  7881. : null;
  7882. propCount = type
  7883. ? type === TRANSITION
  7884. ? transitionDurations.length
  7885. : animationDurations.length
  7886. : 0;
  7887. }
  7888. var hasTransform = type === TRANSITION && transformRE.test(styles[transitionProp + 'Property']);
  7889. return {
  7890. type: type,
  7891. timeout: timeout,
  7892. propCount: propCount,
  7893. hasTransform: hasTransform
  7894. };
  7895. }
  7896. function getTimeout(delays, durations) {
  7897. /* istanbul ignore next */
  7898. while (delays.length < durations.length) {
  7899. delays = delays.concat(delays);
  7900. }
  7901. return Math.max.apply(null, durations.map(function (d, i) {
  7902. return toMs(d) + toMs(delays[i]);
  7903. }));
  7904. }
  7905. // Old versions of Chromium (below 61.0.3163.100) formats floating pointer numbers
  7906. // in a locale-dependent way, using a comma instead of a dot.
  7907. // If comma is not replaced with a dot, the input will be rounded down (i.e. acting
  7908. // as a floor function) causing unexpected behaviors
  7909. function toMs(s) {
  7910. return Number(s.slice(0, -1).replace(',', '.')) * 1000;
  7911. }
  7912. function enter(vnode, toggleDisplay) {
  7913. var el = vnode.elm;
  7914. // call leave callback now
  7915. if (isDef(el._leaveCb)) {
  7916. el._leaveCb.cancelled = true;
  7917. el._leaveCb();
  7918. }
  7919. var data = resolveTransition(vnode.data.transition);
  7920. if (isUndef(data)) {
  7921. return;
  7922. }
  7923. /* istanbul ignore if */
  7924. if (isDef(el._enterCb) || el.nodeType !== 1) {
  7925. return;
  7926. }
  7927. var css = data.css, type = data.type, enterClass = data.enterClass, enterToClass = data.enterToClass, enterActiveClass = data.enterActiveClass, appearClass = data.appearClass, appearToClass = data.appearToClass, appearActiveClass = data.appearActiveClass, beforeEnter = data.beforeEnter, enter = data.enter, afterEnter = data.afterEnter, enterCancelled = data.enterCancelled, beforeAppear = data.beforeAppear, appear = data.appear, afterAppear = data.afterAppear, appearCancelled = data.appearCancelled, duration = data.duration;
  7928. // activeInstance will always be the <transition> component managing this
  7929. // transition. One edge case to check is when the <transition> is placed
  7930. // as the root node of a child component. In that case we need to check
  7931. // <transition>'s parent for appear check.
  7932. var context = activeInstance;
  7933. var transitionNode = activeInstance.$vnode;
  7934. while (transitionNode && transitionNode.parent) {
  7935. context = transitionNode.context;
  7936. transitionNode = transitionNode.parent;
  7937. }
  7938. var isAppear = !context._isMounted || !vnode.isRootInsert;
  7939. if (isAppear && !appear && appear !== '') {
  7940. return;
  7941. }
  7942. var startClass = isAppear && appearClass ? appearClass : enterClass;
  7943. var activeClass = isAppear && appearActiveClass ? appearActiveClass : enterActiveClass;
  7944. var toClass = isAppear && appearToClass ? appearToClass : enterToClass;
  7945. var beforeEnterHook = isAppear ? beforeAppear || beforeEnter : beforeEnter;
  7946. var enterHook = isAppear ? (isFunction(appear) ? appear : enter) : enter;
  7947. var afterEnterHook = isAppear ? afterAppear || afterEnter : afterEnter;
  7948. var enterCancelledHook = isAppear
  7949. ? appearCancelled || enterCancelled
  7950. : enterCancelled;
  7951. var explicitEnterDuration = toNumber(isObject(duration) ? duration.enter : duration);
  7952. if (process.env.NODE_ENV !== 'production' && explicitEnterDuration != null) {
  7953. checkDuration(explicitEnterDuration, 'enter', vnode);
  7954. }
  7955. var expectsCSS = css !== false && !isIE9;
  7956. var userWantsControl = getHookArgumentsLength(enterHook);
  7957. var cb = (el._enterCb = once(function () {
  7958. if (expectsCSS) {
  7959. removeTransitionClass(el, toClass);
  7960. removeTransitionClass(el, activeClass);
  7961. }
  7962. // @ts-expect-error
  7963. if (cb.cancelled) {
  7964. if (expectsCSS) {
  7965. removeTransitionClass(el, startClass);
  7966. }
  7967. enterCancelledHook && enterCancelledHook(el);
  7968. }
  7969. else {
  7970. afterEnterHook && afterEnterHook(el);
  7971. }
  7972. el._enterCb = null;
  7973. }));
  7974. if (!vnode.data.show) {
  7975. // remove pending leave element on enter by injecting an insert hook
  7976. mergeVNodeHook(vnode, 'insert', function () {
  7977. var parent = el.parentNode;
  7978. var pendingNode = parent && parent._pending && parent._pending[vnode.key];
  7979. if (pendingNode &&
  7980. pendingNode.tag === vnode.tag &&
  7981. pendingNode.elm._leaveCb) {
  7982. pendingNode.elm._leaveCb();
  7983. }
  7984. enterHook && enterHook(el, cb);
  7985. });
  7986. }
  7987. // start enter transition
  7988. beforeEnterHook && beforeEnterHook(el);
  7989. if (expectsCSS) {
  7990. addTransitionClass(el, startClass);
  7991. addTransitionClass(el, activeClass);
  7992. nextFrame(function () {
  7993. removeTransitionClass(el, startClass);
  7994. // @ts-expect-error
  7995. if (!cb.cancelled) {
  7996. addTransitionClass(el, toClass);
  7997. if (!userWantsControl) {
  7998. if (isValidDuration(explicitEnterDuration)) {
  7999. setTimeout(cb, explicitEnterDuration);
  8000. }
  8001. else {
  8002. whenTransitionEnds(el, type, cb);
  8003. }
  8004. }
  8005. }
  8006. });
  8007. }
  8008. if (vnode.data.show) {
  8009. toggleDisplay && toggleDisplay();
  8010. enterHook && enterHook(el, cb);
  8011. }
  8012. if (!expectsCSS && !userWantsControl) {
  8013. cb();
  8014. }
  8015. }
  8016. function leave(vnode, rm) {
  8017. var el = vnode.elm;
  8018. // call enter callback now
  8019. if (isDef(el._enterCb)) {
  8020. el._enterCb.cancelled = true;
  8021. el._enterCb();
  8022. }
  8023. var data = resolveTransition(vnode.data.transition);
  8024. if (isUndef(data) || el.nodeType !== 1) {
  8025. return rm();
  8026. }
  8027. /* istanbul ignore if */
  8028. if (isDef(el._leaveCb)) {
  8029. return;
  8030. }
  8031. var css = data.css, type = data.type, leaveClass = data.leaveClass, leaveToClass = data.leaveToClass, leaveActiveClass = data.leaveActiveClass, beforeLeave = data.beforeLeave, leave = data.leave, afterLeave = data.afterLeave, leaveCancelled = data.leaveCancelled, delayLeave = data.delayLeave, duration = data.duration;
  8032. var expectsCSS = css !== false && !isIE9;
  8033. var userWantsControl = getHookArgumentsLength(leave);
  8034. var explicitLeaveDuration = toNumber(isObject(duration) ? duration.leave : duration);
  8035. if (process.env.NODE_ENV !== 'production' && isDef(explicitLeaveDuration)) {
  8036. checkDuration(explicitLeaveDuration, 'leave', vnode);
  8037. }
  8038. var cb = (el._leaveCb = once(function () {
  8039. if (el.parentNode && el.parentNode._pending) {
  8040. el.parentNode._pending[vnode.key] = null;
  8041. }
  8042. if (expectsCSS) {
  8043. removeTransitionClass(el, leaveToClass);
  8044. removeTransitionClass(el, leaveActiveClass);
  8045. }
  8046. // @ts-expect-error
  8047. if (cb.cancelled) {
  8048. if (expectsCSS) {
  8049. removeTransitionClass(el, leaveClass);
  8050. }
  8051. leaveCancelled && leaveCancelled(el);
  8052. }
  8053. else {
  8054. rm();
  8055. afterLeave && afterLeave(el);
  8056. }
  8057. el._leaveCb = null;
  8058. }));
  8059. if (delayLeave) {
  8060. delayLeave(performLeave);
  8061. }
  8062. else {
  8063. performLeave();
  8064. }
  8065. function performLeave() {
  8066. // the delayed leave may have already been cancelled
  8067. // @ts-expect-error
  8068. if (cb.cancelled) {
  8069. return;
  8070. }
  8071. // record leaving element
  8072. if (!vnode.data.show && el.parentNode) {
  8073. (el.parentNode._pending || (el.parentNode._pending = {}))[vnode.key] =
  8074. vnode;
  8075. }
  8076. beforeLeave && beforeLeave(el);
  8077. if (expectsCSS) {
  8078. addTransitionClass(el, leaveClass);
  8079. addTransitionClass(el, leaveActiveClass);
  8080. nextFrame(function () {
  8081. removeTransitionClass(el, leaveClass);
  8082. // @ts-expect-error
  8083. if (!cb.cancelled) {
  8084. addTransitionClass(el, leaveToClass);
  8085. if (!userWantsControl) {
  8086. if (isValidDuration(explicitLeaveDuration)) {
  8087. setTimeout(cb, explicitLeaveDuration);
  8088. }
  8089. else {
  8090. whenTransitionEnds(el, type, cb);
  8091. }
  8092. }
  8093. }
  8094. });
  8095. }
  8096. leave && leave(el, cb);
  8097. if (!expectsCSS && !userWantsControl) {
  8098. cb();
  8099. }
  8100. }
  8101. }
  8102. // only used in dev mode
  8103. function checkDuration(val, name, vnode) {
  8104. if (typeof val !== 'number') {
  8105. warn("<transition> explicit ".concat(name, " duration is not a valid number - ") +
  8106. "got ".concat(JSON.stringify(val), "."), vnode.context);
  8107. }
  8108. else if (isNaN(val)) {
  8109. warn("<transition> explicit ".concat(name, " duration is NaN - ") +
  8110. 'the duration expression might be incorrect.', vnode.context);
  8111. }
  8112. }
  8113. function isValidDuration(val) {
  8114. return typeof val === 'number' && !isNaN(val);
  8115. }
  8116. /**
  8117. * Normalize a transition hook's argument length. The hook may be:
  8118. * - a merged hook (invoker) with the original in .fns
  8119. * - a wrapped component method (check ._length)
  8120. * - a plain function (.length)
  8121. */
  8122. function getHookArgumentsLength(fn) {
  8123. if (isUndef(fn)) {
  8124. return false;
  8125. }
  8126. // @ts-expect-error
  8127. var invokerFns = fn.fns;
  8128. if (isDef(invokerFns)) {
  8129. // invoker
  8130. return getHookArgumentsLength(Array.isArray(invokerFns) ? invokerFns[0] : invokerFns);
  8131. }
  8132. else {
  8133. // @ts-expect-error
  8134. return (fn._length || fn.length) > 1;
  8135. }
  8136. }
  8137. function _enter(_, vnode) {
  8138. if (vnode.data.show !== true) {
  8139. enter(vnode);
  8140. }
  8141. }
  8142. var transition = inBrowser
  8143. ? {
  8144. create: _enter,
  8145. activate: _enter,
  8146. remove: function (vnode, rm) {
  8147. /* istanbul ignore else */
  8148. if (vnode.data.show !== true) {
  8149. // @ts-expect-error
  8150. leave(vnode, rm);
  8151. }
  8152. else {
  8153. rm();
  8154. }
  8155. }
  8156. }
  8157. : {};
  8158. var platformModules = [attrs, klass, events, domProps, style, transition];
  8159. // the directive module should be applied last, after all
  8160. // built-in modules have been applied.
  8161. var modules = platformModules.concat(baseModules);
  8162. var patch = createPatchFunction({ nodeOps: nodeOps, modules: modules });
  8163. /**
  8164. * Not type checking this file because flow doesn't like attaching
  8165. * properties to Elements.
  8166. */
  8167. /* istanbul ignore if */
  8168. if (isIE9) {
  8169. // http://www.matts411.com/post/internet-explorer-9-oninput/
  8170. document.addEventListener('selectionchange', function () {
  8171. var el = document.activeElement;
  8172. // @ts-expect-error
  8173. if (el && el.vmodel) {
  8174. trigger(el, 'input');
  8175. }
  8176. });
  8177. }
  8178. var directive = {
  8179. inserted: function (el, binding, vnode, oldVnode) {
  8180. if (vnode.tag === 'select') {
  8181. // #6903
  8182. if (oldVnode.elm && !oldVnode.elm._vOptions) {
  8183. mergeVNodeHook(vnode, 'postpatch', function () {
  8184. directive.componentUpdated(el, binding, vnode);
  8185. });
  8186. }
  8187. else {
  8188. setSelected(el, binding, vnode.context);
  8189. }
  8190. el._vOptions = [].map.call(el.options, getValue);
  8191. }
  8192. else if (vnode.tag === 'textarea' || isTextInputType(el.type)) {
  8193. el._vModifiers = binding.modifiers;
  8194. if (!binding.modifiers.lazy) {
  8195. el.addEventListener('compositionstart', onCompositionStart);
  8196. el.addEventListener('compositionend', onCompositionEnd);
  8197. // Safari < 10.2 & UIWebView doesn't fire compositionend when
  8198. // switching focus before confirming composition choice
  8199. // this also fixes the issue where some browsers e.g. iOS Chrome
  8200. // fires "change" instead of "input" on autocomplete.
  8201. el.addEventListener('change', onCompositionEnd);
  8202. /* istanbul ignore if */
  8203. if (isIE9) {
  8204. el.vmodel = true;
  8205. }
  8206. }
  8207. }
  8208. },
  8209. componentUpdated: function (el, binding, vnode) {
  8210. if (vnode.tag === 'select') {
  8211. setSelected(el, binding, vnode.context);
  8212. // in case the options rendered by v-for have changed,
  8213. // it's possible that the value is out-of-sync with the rendered options.
  8214. // detect such cases and filter out values that no longer has a matching
  8215. // option in the DOM.
  8216. var prevOptions_1 = el._vOptions;
  8217. var curOptions_1 = (el._vOptions = [].map.call(el.options, getValue));
  8218. if (curOptions_1.some(function (o, i) { return !looseEqual(o, prevOptions_1[i]); })) {
  8219. // trigger change event if
  8220. // no matching option found for at least one value
  8221. var needReset = el.multiple
  8222. ? binding.value.some(function (v) { return hasNoMatchingOption(v, curOptions_1); })
  8223. : binding.value !== binding.oldValue &&
  8224. hasNoMatchingOption(binding.value, curOptions_1);
  8225. if (needReset) {
  8226. trigger(el, 'change');
  8227. }
  8228. }
  8229. }
  8230. }
  8231. };
  8232. function setSelected(el, binding, vm) {
  8233. actuallySetSelected(el, binding, vm);
  8234. /* istanbul ignore if */
  8235. if (isIE || isEdge) {
  8236. setTimeout(function () {
  8237. actuallySetSelected(el, binding, vm);
  8238. }, 0);
  8239. }
  8240. }
  8241. function actuallySetSelected(el, binding, vm) {
  8242. var value = binding.value;
  8243. var isMultiple = el.multiple;
  8244. if (isMultiple && !Array.isArray(value)) {
  8245. process.env.NODE_ENV !== 'production' &&
  8246. warn("<select multiple v-model=\"".concat(binding.expression, "\"> ") +
  8247. "expects an Array value for its binding, but got ".concat(Object.prototype.toString
  8248. .call(value)
  8249. .slice(8, -1)), vm);
  8250. return;
  8251. }
  8252. var selected, option;
  8253. for (var i = 0, l = el.options.length; i < l; i++) {
  8254. option = el.options[i];
  8255. if (isMultiple) {
  8256. selected = looseIndexOf(value, getValue(option)) > -1;
  8257. if (option.selected !== selected) {
  8258. option.selected = selected;
  8259. }
  8260. }
  8261. else {
  8262. if (looseEqual(getValue(option), value)) {
  8263. if (el.selectedIndex !== i) {
  8264. el.selectedIndex = i;
  8265. }
  8266. return;
  8267. }
  8268. }
  8269. }
  8270. if (!isMultiple) {
  8271. el.selectedIndex = -1;
  8272. }
  8273. }
  8274. function hasNoMatchingOption(value, options) {
  8275. return options.every(function (o) { return !looseEqual(o, value); });
  8276. }
  8277. function getValue(option) {
  8278. return '_value' in option ? option._value : option.value;
  8279. }
  8280. function onCompositionStart(e) {
  8281. e.target.composing = true;
  8282. }
  8283. function onCompositionEnd(e) {
  8284. // prevent triggering an input event for no reason
  8285. if (!e.target.composing)
  8286. return;
  8287. e.target.composing = false;
  8288. trigger(e.target, 'input');
  8289. }
  8290. function trigger(el, type) {
  8291. var e = document.createEvent('HTMLEvents');
  8292. e.initEvent(type, true, true);
  8293. el.dispatchEvent(e);
  8294. }
  8295. // recursively search for possible transition defined inside the component root
  8296. function locateNode(vnode) {
  8297. // @ts-expect-error
  8298. return vnode.componentInstance && (!vnode.data || !vnode.data.transition)
  8299. ? locateNode(vnode.componentInstance._vnode)
  8300. : vnode;
  8301. }
  8302. var show = {
  8303. bind: function (el, _a, vnode) {
  8304. var value = _a.value;
  8305. vnode = locateNode(vnode);
  8306. var transition = vnode.data && vnode.data.transition;
  8307. var originalDisplay = (el.__vOriginalDisplay =
  8308. el.style.display === 'none' ? '' : el.style.display);
  8309. if (value && transition) {
  8310. vnode.data.show = true;
  8311. enter(vnode, function () {
  8312. el.style.display = originalDisplay;
  8313. });
  8314. }
  8315. else {
  8316. el.style.display = value ? originalDisplay : 'none';
  8317. }
  8318. },
  8319. update: function (el, _a, vnode) {
  8320. var value = _a.value, oldValue = _a.oldValue;
  8321. /* istanbul ignore if */
  8322. if (!value === !oldValue)
  8323. return;
  8324. vnode = locateNode(vnode);
  8325. var transition = vnode.data && vnode.data.transition;
  8326. if (transition) {
  8327. vnode.data.show = true;
  8328. if (value) {
  8329. enter(vnode, function () {
  8330. el.style.display = el.__vOriginalDisplay;
  8331. });
  8332. }
  8333. else {
  8334. leave(vnode, function () {
  8335. el.style.display = 'none';
  8336. });
  8337. }
  8338. }
  8339. else {
  8340. el.style.display = value ? el.__vOriginalDisplay : 'none';
  8341. }
  8342. },
  8343. unbind: function (el, binding, vnode, oldVnode, isDestroy) {
  8344. if (!isDestroy) {
  8345. el.style.display = el.__vOriginalDisplay;
  8346. }
  8347. }
  8348. };
  8349. var platformDirectives = {
  8350. model: directive,
  8351. show: show
  8352. };
  8353. // Provides transition support for a single element/component.
  8354. var transitionProps = {
  8355. name: String,
  8356. appear: Boolean,
  8357. css: Boolean,
  8358. mode: String,
  8359. type: String,
  8360. enterClass: String,
  8361. leaveClass: String,
  8362. enterToClass: String,
  8363. leaveToClass: String,
  8364. enterActiveClass: String,
  8365. leaveActiveClass: String,
  8366. appearClass: String,
  8367. appearActiveClass: String,
  8368. appearToClass: String,
  8369. duration: [Number, String, Object]
  8370. };
  8371. // in case the child is also an abstract component, e.g. <keep-alive>
  8372. // we want to recursively retrieve the real component to be rendered
  8373. function getRealChild(vnode) {
  8374. var compOptions = vnode && vnode.componentOptions;
  8375. if (compOptions && compOptions.Ctor.options.abstract) {
  8376. return getRealChild(getFirstComponentChild(compOptions.children));
  8377. }
  8378. else {
  8379. return vnode;
  8380. }
  8381. }
  8382. function extractTransitionData(comp) {
  8383. var data = {};
  8384. var options = comp.$options;
  8385. // props
  8386. for (var key in options.propsData) {
  8387. data[key] = comp[key];
  8388. }
  8389. // events.
  8390. // extract listeners and pass them directly to the transition methods
  8391. var listeners = options._parentListeners;
  8392. for (var key in listeners) {
  8393. data[camelize(key)] = listeners[key];
  8394. }
  8395. return data;
  8396. }
  8397. function placeholder(h, rawChild) {
  8398. // @ts-expect-error
  8399. if (/\d-keep-alive$/.test(rawChild.tag)) {
  8400. return h('keep-alive', {
  8401. props: rawChild.componentOptions.propsData
  8402. });
  8403. }
  8404. }
  8405. function hasParentTransition(vnode) {
  8406. while ((vnode = vnode.parent)) {
  8407. if (vnode.data.transition) {
  8408. return true;
  8409. }
  8410. }
  8411. }
  8412. function isSameChild(child, oldChild) {
  8413. return oldChild.key === child.key && oldChild.tag === child.tag;
  8414. }
  8415. var isNotTextNode = function (c) { return c.tag || isAsyncPlaceholder(c); };
  8416. var isVShowDirective = function (d) { return d.name === 'show'; };
  8417. var Transition = {
  8418. name: 'transition',
  8419. props: transitionProps,
  8420. abstract: true,
  8421. render: function (h) {
  8422. var _this = this;
  8423. var children = this.$slots.default;
  8424. if (!children) {
  8425. return;
  8426. }
  8427. // filter out text nodes (possible whitespaces)
  8428. children = children.filter(isNotTextNode);
  8429. /* istanbul ignore if */
  8430. if (!children.length) {
  8431. return;
  8432. }
  8433. // warn multiple elements
  8434. if (process.env.NODE_ENV !== 'production' && children.length > 1) {
  8435. warn('<transition> can only be used on a single element. Use ' +
  8436. '<transition-group> for lists.', this.$parent);
  8437. }
  8438. var mode = this.mode;
  8439. // warn invalid mode
  8440. if (process.env.NODE_ENV !== 'production' && mode && mode !== 'in-out' && mode !== 'out-in') {
  8441. warn('invalid <transition> mode: ' + mode, this.$parent);
  8442. }
  8443. var rawChild = children[0];
  8444. // if this is a component root node and the component's
  8445. // parent container node also has transition, skip.
  8446. if (hasParentTransition(this.$vnode)) {
  8447. return rawChild;
  8448. }
  8449. // apply transition data to child
  8450. // use getRealChild() to ignore abstract components e.g. keep-alive
  8451. var child = getRealChild(rawChild);
  8452. /* istanbul ignore if */
  8453. if (!child) {
  8454. return rawChild;
  8455. }
  8456. if (this._leaving) {
  8457. return placeholder(h, rawChild);
  8458. }
  8459. // ensure a key that is unique to the vnode type and to this transition
  8460. // component instance. This key will be used to remove pending leaving nodes
  8461. // during entering.
  8462. var id = "__transition-".concat(this._uid, "-");
  8463. child.key =
  8464. child.key == null
  8465. ? child.isComment
  8466. ? id + 'comment'
  8467. : id + child.tag
  8468. : isPrimitive(child.key)
  8469. ? String(child.key).indexOf(id) === 0
  8470. ? child.key
  8471. : id + child.key
  8472. : child.key;
  8473. var data = ((child.data || (child.data = {})).transition =
  8474. extractTransitionData(this));
  8475. var oldRawChild = this._vnode;
  8476. var oldChild = getRealChild(oldRawChild);
  8477. // mark v-show
  8478. // so that the transition module can hand over the control to the directive
  8479. if (child.data.directives && child.data.directives.some(isVShowDirective)) {
  8480. child.data.show = true;
  8481. }
  8482. if (oldChild &&
  8483. oldChild.data &&
  8484. !isSameChild(child, oldChild) &&
  8485. !isAsyncPlaceholder(oldChild) &&
  8486. // #6687 component root is a comment node
  8487. !(oldChild.componentInstance &&
  8488. oldChild.componentInstance._vnode.isComment)) {
  8489. // replace old child transition data with fresh one
  8490. // important for dynamic transitions!
  8491. var oldData = (oldChild.data.transition = extend({}, data));
  8492. // handle transition mode
  8493. if (mode === 'out-in') {
  8494. // return placeholder node and queue update when leave finishes
  8495. this._leaving = true;
  8496. mergeVNodeHook(oldData, 'afterLeave', function () {
  8497. _this._leaving = false;
  8498. _this.$forceUpdate();
  8499. });
  8500. return placeholder(h, rawChild);
  8501. }
  8502. else if (mode === 'in-out') {
  8503. if (isAsyncPlaceholder(child)) {
  8504. return oldRawChild;
  8505. }
  8506. var delayedLeave_1;
  8507. var performLeave = function () {
  8508. delayedLeave_1();
  8509. };
  8510. mergeVNodeHook(data, 'afterEnter', performLeave);
  8511. mergeVNodeHook(data, 'enterCancelled', performLeave);
  8512. mergeVNodeHook(oldData, 'delayLeave', function (leave) {
  8513. delayedLeave_1 = leave;
  8514. });
  8515. }
  8516. }
  8517. return rawChild;
  8518. }
  8519. };
  8520. // Provides transition support for list items.
  8521. var props = extend({
  8522. tag: String,
  8523. moveClass: String
  8524. }, transitionProps);
  8525. delete props.mode;
  8526. var TransitionGroup = {
  8527. props: props,
  8528. beforeMount: function () {
  8529. var _this = this;
  8530. var update = this._update;
  8531. this._update = function (vnode, hydrating) {
  8532. var restoreActiveInstance = setActiveInstance(_this);
  8533. // force removing pass
  8534. _this.__patch__(_this._vnode, _this.kept, false, // hydrating
  8535. true // removeOnly (!important, avoids unnecessary moves)
  8536. );
  8537. _this._vnode = _this.kept;
  8538. restoreActiveInstance();
  8539. update.call(_this, vnode, hydrating);
  8540. };
  8541. },
  8542. render: function (h) {
  8543. var tag = this.tag || this.$vnode.data.tag || 'span';
  8544. var map = Object.create(null);
  8545. var prevChildren = (this.prevChildren = this.children);
  8546. var rawChildren = this.$slots.default || [];
  8547. var children = (this.children = []);
  8548. var transitionData = extractTransitionData(this);
  8549. for (var i = 0; i < rawChildren.length; i++) {
  8550. var c = rawChildren[i];
  8551. if (c.tag) {
  8552. if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {
  8553. children.push(c);
  8554. map[c.key] = c;
  8555. (c.data || (c.data = {})).transition = transitionData;
  8556. }
  8557. else if (process.env.NODE_ENV !== 'production') {
  8558. var opts = c.componentOptions;
  8559. var name_1 = opts
  8560. ? getComponentName(opts.Ctor.options) || opts.tag || ''
  8561. : c.tag;
  8562. warn("<transition-group> children must be keyed: <".concat(name_1, ">"));
  8563. }
  8564. }
  8565. }
  8566. if (prevChildren) {
  8567. var kept = [];
  8568. var removed = [];
  8569. for (var i = 0; i < prevChildren.length; i++) {
  8570. var c = prevChildren[i];
  8571. c.data.transition = transitionData;
  8572. // @ts-expect-error .getBoundingClientRect is not typed in Node
  8573. c.data.pos = c.elm.getBoundingClientRect();
  8574. if (map[c.key]) {
  8575. kept.push(c);
  8576. }
  8577. else {
  8578. removed.push(c);
  8579. }
  8580. }
  8581. this.kept = h(tag, null, kept);
  8582. this.removed = removed;
  8583. }
  8584. return h(tag, null, children);
  8585. },
  8586. updated: function () {
  8587. var children = this.prevChildren;
  8588. var moveClass = this.moveClass || (this.name || 'v') + '-move';
  8589. if (!children.length || !this.hasMove(children[0].elm, moveClass)) {
  8590. return;
  8591. }
  8592. // we divide the work into three loops to avoid mixing DOM reads and writes
  8593. // in each iteration - which helps prevent layout thrashing.
  8594. children.forEach(callPendingCbs);
  8595. children.forEach(recordPosition);
  8596. children.forEach(applyTranslation);
  8597. // force reflow to put everything in position
  8598. // assign to this to avoid being removed in tree-shaking
  8599. // $flow-disable-line
  8600. this._reflow = document.body.offsetHeight;
  8601. children.forEach(function (c) {
  8602. if (c.data.moved) {
  8603. var el_1 = c.elm;
  8604. var s = el_1.style;
  8605. addTransitionClass(el_1, moveClass);
  8606. s.transform = s.WebkitTransform = s.transitionDuration = '';
  8607. el_1.addEventListener(transitionEndEvent, (el_1._moveCb = function cb(e) {
  8608. if (e && e.target !== el_1) {
  8609. return;
  8610. }
  8611. if (!e || /transform$/.test(e.propertyName)) {
  8612. el_1.removeEventListener(transitionEndEvent, cb);
  8613. el_1._moveCb = null;
  8614. removeTransitionClass(el_1, moveClass);
  8615. }
  8616. }));
  8617. }
  8618. });
  8619. },
  8620. methods: {
  8621. hasMove: function (el, moveClass) {
  8622. /* istanbul ignore if */
  8623. if (!hasTransition) {
  8624. return false;
  8625. }
  8626. /* istanbul ignore if */
  8627. if (this._hasMove) {
  8628. return this._hasMove;
  8629. }
  8630. // Detect whether an element with the move class applied has
  8631. // CSS transitions. Since the element may be inside an entering
  8632. // transition at this very moment, we make a clone of it and remove
  8633. // all other transition classes applied to ensure only the move class
  8634. // is applied.
  8635. var clone = el.cloneNode();
  8636. if (el._transitionClasses) {
  8637. el._transitionClasses.forEach(function (cls) {
  8638. removeClass(clone, cls);
  8639. });
  8640. }
  8641. addClass(clone, moveClass);
  8642. clone.style.display = 'none';
  8643. this.$el.appendChild(clone);
  8644. var info = getTransitionInfo(clone);
  8645. this.$el.removeChild(clone);
  8646. return (this._hasMove = info.hasTransform);
  8647. }
  8648. }
  8649. };
  8650. function callPendingCbs(c) {
  8651. /* istanbul ignore if */
  8652. if (c.elm._moveCb) {
  8653. c.elm._moveCb();
  8654. }
  8655. /* istanbul ignore if */
  8656. if (c.elm._enterCb) {
  8657. c.elm._enterCb();
  8658. }
  8659. }
  8660. function recordPosition(c) {
  8661. c.data.newPos = c.elm.getBoundingClientRect();
  8662. }
  8663. function applyTranslation(c) {
  8664. var oldPos = c.data.pos;
  8665. var newPos = c.data.newPos;
  8666. var dx = oldPos.left - newPos.left;
  8667. var dy = oldPos.top - newPos.top;
  8668. if (dx || dy) {
  8669. c.data.moved = true;
  8670. var s = c.elm.style;
  8671. s.transform = s.WebkitTransform = "translate(".concat(dx, "px,").concat(dy, "px)");
  8672. s.transitionDuration = '0s';
  8673. }
  8674. }
  8675. var platformComponents = {
  8676. Transition: Transition,
  8677. TransitionGroup: TransitionGroup
  8678. };
  8679. // install platform specific utils
  8680. Vue.config.mustUseProp = mustUseProp;
  8681. Vue.config.isReservedTag = isReservedTag;
  8682. Vue.config.isReservedAttr = isReservedAttr;
  8683. Vue.config.getTagNamespace = getTagNamespace;
  8684. Vue.config.isUnknownElement = isUnknownElement;
  8685. // install platform runtime directives & components
  8686. extend(Vue.options.directives, platformDirectives);
  8687. extend(Vue.options.components, platformComponents);
  8688. // install platform patch function
  8689. Vue.prototype.__patch__ = inBrowser ? patch : noop;
  8690. // public mount method
  8691. Vue.prototype.$mount = function (el, hydrating) {
  8692. el = el && inBrowser ? query(el) : undefined;
  8693. return mountComponent(this, el, hydrating);
  8694. };
  8695. // devtools global hook
  8696. /* istanbul ignore next */
  8697. if (inBrowser) {
  8698. setTimeout(function () {
  8699. if (config.devtools) {
  8700. if (devtools) {
  8701. devtools.emit('init', Vue);
  8702. }
  8703. else if (process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test') {
  8704. // @ts-expect-error
  8705. console[console.info ? 'info' : 'log']('Download the Vue Devtools extension for a better development experience:\n' +
  8706. 'https://github.com/vuejs/vue-devtools');
  8707. }
  8708. }
  8709. if (process.env.NODE_ENV !== 'production' &&
  8710. process.env.NODE_ENV !== 'test' &&
  8711. config.productionTip !== false &&
  8712. typeof console !== 'undefined') {
  8713. // @ts-expect-error
  8714. console[console.info ? 'info' : 'log']("You are running Vue in development mode.\n" +
  8715. "Make sure to turn on production mode when deploying for production.\n" +
  8716. "See more tips at https://vuejs.org/guide/deployment.html");
  8717. }
  8718. }, 0);
  8719. }
  8720. export { EffectScope, computed, customRef, Vue as default, defineAsyncComponent, defineComponent, del, effectScope, getCurrentInstance, getCurrentScope, h, inject, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, mergeDefaults, nextTick, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, provide, proxyRefs, reactive, readonly, ref$1 as ref, set, shallowReactive, shallowReadonly, shallowRef, toRaw, toRef, toRefs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useListeners, useSlots, version, watch, watchEffect, watchPostEffect, watchSyncEffect };