vue.js 424 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914
  1. /*!
  2. * Vue.js v2.7.15
  3. * (c) 2014-2023 Evan You
  4. * Released under the MIT License.
  5. */
  6. (function (global, factory) {
  7. typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
  8. typeof define === 'function' && define.amd ? define(factory) :
  9. (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Vue = factory());
  10. })(this, (function () { 'use strict';
  11. var emptyObject = Object.freeze({});
  12. var isArray = Array.isArray;
  13. // These helpers produce better VM code in JS engines due to their
  14. // explicitness and function inlining.
  15. function isUndef(v) {
  16. return v === undefined || v === null;
  17. }
  18. function isDef(v) {
  19. return v !== undefined && v !== null;
  20. }
  21. function isTrue(v) {
  22. return v === true;
  23. }
  24. function isFalse(v) {
  25. return v === false;
  26. }
  27. /**
  28. * Check if value is primitive.
  29. */
  30. function isPrimitive(value) {
  31. return (typeof value === 'string' ||
  32. typeof value === 'number' ||
  33. // $flow-disable-line
  34. typeof value === 'symbol' ||
  35. typeof value === 'boolean');
  36. }
  37. function isFunction(value) {
  38. return typeof value === 'function';
  39. }
  40. /**
  41. * Quick object check - this is primarily used to tell
  42. * objects from primitive values when we know the value
  43. * is a JSON-compliant type.
  44. */
  45. function isObject(obj) {
  46. return obj !== null && typeof obj === 'object';
  47. }
  48. /**
  49. * Get the raw type string of a value, e.g., [object Object].
  50. */
  51. var _toString = Object.prototype.toString;
  52. function toRawType(value) {
  53. return _toString.call(value).slice(8, -1);
  54. }
  55. /**
  56. * Strict object type check. Only returns true
  57. * for plain JavaScript objects.
  58. */
  59. function isPlainObject(obj) {
  60. return _toString.call(obj) === '[object Object]';
  61. }
  62. function isRegExp(v) {
  63. return _toString.call(v) === '[object RegExp]';
  64. }
  65. /**
  66. * Check if val is a valid array index.
  67. */
  68. function isValidArrayIndex(val) {
  69. var n = parseFloat(String(val));
  70. return n >= 0 && Math.floor(n) === n && isFinite(val);
  71. }
  72. function isPromise(val) {
  73. return (isDef(val) &&
  74. typeof val.then === 'function' &&
  75. typeof val.catch === 'function');
  76. }
  77. /**
  78. * Convert a value to a string that is actually rendered.
  79. */
  80. function toString(val) {
  81. return val == null
  82. ? ''
  83. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  84. ? JSON.stringify(val, null, 2)
  85. : String(val);
  86. }
  87. /**
  88. * Convert an input value to a number for persistence.
  89. * If the conversion fails, return original string.
  90. */
  91. function toNumber(val) {
  92. var n = parseFloat(val);
  93. return isNaN(n) ? val : n;
  94. }
  95. /**
  96. * Make a map and return a function for checking if a key
  97. * is in that map.
  98. */
  99. function makeMap(str, expectsLowerCase) {
  100. var map = Object.create(null);
  101. var list = str.split(',');
  102. for (var i = 0; i < list.length; i++) {
  103. map[list[i]] = true;
  104. }
  105. return expectsLowerCase ? function (val) { return map[val.toLowerCase()]; } : function (val) { return map[val]; };
  106. }
  107. /**
  108. * Check if a tag is a built-in tag.
  109. */
  110. var isBuiltInTag = makeMap('slot,component', true);
  111. /**
  112. * Check if an attribute is a reserved attribute.
  113. */
  114. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  115. /**
  116. * Remove an item from an array.
  117. */
  118. function remove$2(arr, item) {
  119. var len = arr.length;
  120. if (len) {
  121. // fast path for the only / last item
  122. if (item === arr[len - 1]) {
  123. arr.length = len - 1;
  124. return;
  125. }
  126. var index = arr.indexOf(item);
  127. if (index > -1) {
  128. return arr.splice(index, 1);
  129. }
  130. }
  131. }
  132. /**
  133. * Check whether an object has the property.
  134. */
  135. var hasOwnProperty = Object.prototype.hasOwnProperty;
  136. function hasOwn(obj, key) {
  137. return hasOwnProperty.call(obj, key);
  138. }
  139. /**
  140. * Create a cached version of a pure function.
  141. */
  142. function cached(fn) {
  143. var cache = Object.create(null);
  144. return function cachedFn(str) {
  145. var hit = cache[str];
  146. return hit || (cache[str] = fn(str));
  147. };
  148. }
  149. /**
  150. * Camelize a hyphen-delimited string.
  151. */
  152. var camelizeRE = /-(\w)/g;
  153. var camelize = cached(function (str) {
  154. return str.replace(camelizeRE, function (_, c) { return (c ? c.toUpperCase() : ''); });
  155. });
  156. /**
  157. * Capitalize a string.
  158. */
  159. var capitalize = cached(function (str) {
  160. return str.charAt(0).toUpperCase() + str.slice(1);
  161. });
  162. /**
  163. * Hyphenate a camelCase string.
  164. */
  165. var hyphenateRE = /\B([A-Z])/g;
  166. var hyphenate = cached(function (str) {
  167. return str.replace(hyphenateRE, '-$1').toLowerCase();
  168. });
  169. /**
  170. * Simple bind polyfill for environments that do not support it,
  171. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  172. * since native bind is now performant enough in most browsers.
  173. * But removing it would mean breaking code that was able to run in
  174. * PhantomJS 1.x, so this must be kept for backward compatibility.
  175. */
  176. /* istanbul ignore next */
  177. function polyfillBind(fn, ctx) {
  178. function boundFn(a) {
  179. var l = arguments.length;
  180. return l
  181. ? l > 1
  182. ? fn.apply(ctx, arguments)
  183. : fn.call(ctx, a)
  184. : fn.call(ctx);
  185. }
  186. boundFn._length = fn.length;
  187. return boundFn;
  188. }
  189. function nativeBind(fn, ctx) {
  190. return fn.bind(ctx);
  191. }
  192. // @ts-expect-error bind cannot be `undefined`
  193. var bind$1 = Function.prototype.bind ? nativeBind : polyfillBind;
  194. /**
  195. * Convert an Array-like object to a real Array.
  196. */
  197. function toArray(list, start) {
  198. start = start || 0;
  199. var i = list.length - start;
  200. var ret = new Array(i);
  201. while (i--) {
  202. ret[i] = list[i + start];
  203. }
  204. return ret;
  205. }
  206. /**
  207. * Mix properties into target object.
  208. */
  209. function extend(to, _from) {
  210. for (var key in _from) {
  211. to[key] = _from[key];
  212. }
  213. return to;
  214. }
  215. /**
  216. * Merge an Array of Objects into a single Object.
  217. */
  218. function toObject(arr) {
  219. var res = {};
  220. for (var i = 0; i < arr.length; i++) {
  221. if (arr[i]) {
  222. extend(res, arr[i]);
  223. }
  224. }
  225. return res;
  226. }
  227. /* eslint-disable no-unused-vars */
  228. /**
  229. * Perform no operation.
  230. * Stubbing args to make Flow happy without leaving useless transpiled code
  231. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  232. */
  233. function noop(a, b, c) { }
  234. /**
  235. * Always return false.
  236. */
  237. var no = function (a, b, c) { return false; };
  238. /* eslint-enable no-unused-vars */
  239. /**
  240. * Return the same value.
  241. */
  242. var identity = function (_) { return _; };
  243. /**
  244. * Generate a string containing static keys from compiler modules.
  245. */
  246. function genStaticKeys$1(modules) {
  247. return modules
  248. .reduce(function (keys, m) { return keys.concat(m.staticKeys || []); }, [])
  249. .join(',');
  250. }
  251. /**
  252. * Check if two values are loosely equal - that is,
  253. * if they are plain objects, do they have the same shape?
  254. */
  255. function looseEqual(a, b) {
  256. if (a === b)
  257. return true;
  258. var isObjectA = isObject(a);
  259. var isObjectB = isObject(b);
  260. if (isObjectA && isObjectB) {
  261. try {
  262. var isArrayA = Array.isArray(a);
  263. var isArrayB = Array.isArray(b);
  264. if (isArrayA && isArrayB) {
  265. return (a.length === b.length &&
  266. a.every(function (e, i) {
  267. return looseEqual(e, b[i]);
  268. }));
  269. }
  270. else if (a instanceof Date && b instanceof Date) {
  271. return a.getTime() === b.getTime();
  272. }
  273. else if (!isArrayA && !isArrayB) {
  274. var keysA = Object.keys(a);
  275. var keysB = Object.keys(b);
  276. return (keysA.length === keysB.length &&
  277. keysA.every(function (key) {
  278. return looseEqual(a[key], b[key]);
  279. }));
  280. }
  281. else {
  282. /* istanbul ignore next */
  283. return false;
  284. }
  285. }
  286. catch (e) {
  287. /* istanbul ignore next */
  288. return false;
  289. }
  290. }
  291. else if (!isObjectA && !isObjectB) {
  292. return String(a) === String(b);
  293. }
  294. else {
  295. return false;
  296. }
  297. }
  298. /**
  299. * Return the first index at which a loosely equal value can be
  300. * found in the array (if value is a plain object, the array must
  301. * contain an object of the same shape), or -1 if it is not present.
  302. */
  303. function looseIndexOf(arr, val) {
  304. for (var i = 0; i < arr.length; i++) {
  305. if (looseEqual(arr[i], val))
  306. return i;
  307. }
  308. return -1;
  309. }
  310. /**
  311. * Ensure a function is called only once.
  312. */
  313. function once(fn) {
  314. var called = false;
  315. return function () {
  316. if (!called) {
  317. called = true;
  318. fn.apply(this, arguments);
  319. }
  320. };
  321. }
  322. // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is#polyfill
  323. function hasChanged(x, y) {
  324. if (x === y) {
  325. return x === 0 && 1 / x !== 1 / y;
  326. }
  327. else {
  328. return x === x || y === y;
  329. }
  330. }
  331. var SSR_ATTR = 'data-server-rendered';
  332. var ASSET_TYPES = ['component', 'directive', 'filter'];
  333. var LIFECYCLE_HOOKS = [
  334. 'beforeCreate',
  335. 'created',
  336. 'beforeMount',
  337. 'mounted',
  338. 'beforeUpdate',
  339. 'updated',
  340. 'beforeDestroy',
  341. 'destroyed',
  342. 'activated',
  343. 'deactivated',
  344. 'errorCaptured',
  345. 'serverPrefetch',
  346. 'renderTracked',
  347. 'renderTriggered'
  348. ];
  349. var config = {
  350. /**
  351. * Option merge strategies (used in core/util/options)
  352. */
  353. // $flow-disable-line
  354. optionMergeStrategies: Object.create(null),
  355. /**
  356. * Whether to suppress warnings.
  357. */
  358. silent: false,
  359. /**
  360. * Show production mode tip message on boot?
  361. */
  362. productionTip: true,
  363. /**
  364. * Whether to enable devtools
  365. */
  366. devtools: true,
  367. /**
  368. * Whether to record perf
  369. */
  370. performance: false,
  371. /**
  372. * Error handler for watcher errors
  373. */
  374. errorHandler: null,
  375. /**
  376. * Warn handler for watcher warns
  377. */
  378. warnHandler: null,
  379. /**
  380. * Ignore certain custom elements
  381. */
  382. ignoredElements: [],
  383. /**
  384. * Custom user key aliases for v-on
  385. */
  386. // $flow-disable-line
  387. keyCodes: Object.create(null),
  388. /**
  389. * Check if a tag is reserved so that it cannot be registered as a
  390. * component. This is platform-dependent and may be overwritten.
  391. */
  392. isReservedTag: no,
  393. /**
  394. * Check if an attribute is reserved so that it cannot be used as a component
  395. * prop. This is platform-dependent and may be overwritten.
  396. */
  397. isReservedAttr: no,
  398. /**
  399. * Check if a tag is an unknown element.
  400. * Platform-dependent.
  401. */
  402. isUnknownElement: no,
  403. /**
  404. * Get the namespace of an element
  405. */
  406. getTagNamespace: noop,
  407. /**
  408. * Parse the real tag name for the specific platform.
  409. */
  410. parsePlatformTagName: identity,
  411. /**
  412. * Check if an attribute must be bound using property, e.g. value
  413. * Platform-dependent.
  414. */
  415. mustUseProp: no,
  416. /**
  417. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  418. * This will significantly reduce performance if set to false.
  419. */
  420. async: true,
  421. /**
  422. * Exposed for legacy reasons
  423. */
  424. _lifecycleHooks: LIFECYCLE_HOOKS
  425. };
  426. /**
  427. * unicode letters used for parsing html tags, component names and property paths.
  428. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  429. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  430. */
  431. 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/;
  432. /**
  433. * Check if a string starts with $ or _
  434. */
  435. function isReserved(str) {
  436. var c = (str + '').charCodeAt(0);
  437. return c === 0x24 || c === 0x5f;
  438. }
  439. /**
  440. * Define a property.
  441. */
  442. function def(obj, key, val, enumerable) {
  443. Object.defineProperty(obj, key, {
  444. value: val,
  445. enumerable: !!enumerable,
  446. writable: true,
  447. configurable: true
  448. });
  449. }
  450. /**
  451. * Parse simple path.
  452. */
  453. var bailRE = new RegExp("[^".concat(unicodeRegExp.source, ".$_\\d]"));
  454. function parsePath(path) {
  455. if (bailRE.test(path)) {
  456. return;
  457. }
  458. var segments = path.split('.');
  459. return function (obj) {
  460. for (var i = 0; i < segments.length; i++) {
  461. if (!obj)
  462. return;
  463. obj = obj[segments[i]];
  464. }
  465. return obj;
  466. };
  467. }
  468. // can we use __proto__?
  469. var hasProto = '__proto__' in {};
  470. // Browser environment sniffing
  471. var inBrowser = typeof window !== 'undefined';
  472. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  473. var isIE = UA && /msie|trident/.test(UA);
  474. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  475. var isEdge = UA && UA.indexOf('edge/') > 0;
  476. UA && UA.indexOf('android') > 0;
  477. var isIOS = UA && /iphone|ipad|ipod|ios/.test(UA);
  478. UA && /chrome\/\d+/.test(UA) && !isEdge;
  479. UA && /phantomjs/.test(UA);
  480. var isFF = UA && UA.match(/firefox\/(\d+)/);
  481. // Firefox has a "watch" function on Object.prototype...
  482. // @ts-expect-error firebox support
  483. var nativeWatch = {}.watch;
  484. var supportsPassive = false;
  485. if (inBrowser) {
  486. try {
  487. var opts = {};
  488. Object.defineProperty(opts, 'passive', {
  489. get: function () {
  490. /* istanbul ignore next */
  491. supportsPassive = true;
  492. }
  493. }); // https://github.com/facebook/flow/issues/285
  494. window.addEventListener('test-passive', null, opts);
  495. }
  496. catch (e) { }
  497. }
  498. // this needs to be lazy-evaled because vue may be required before
  499. // vue-server-renderer can set VUE_ENV
  500. var _isServer;
  501. var isServerRendering = function () {
  502. if (_isServer === undefined) {
  503. /* istanbul ignore if */
  504. if (!inBrowser && typeof global !== 'undefined') {
  505. // detect presence of vue-server-renderer and avoid
  506. // Webpack shimming the process
  507. _isServer =
  508. global['process'] && global['process'].env.VUE_ENV === 'server';
  509. }
  510. else {
  511. _isServer = false;
  512. }
  513. }
  514. return _isServer;
  515. };
  516. // detect devtools
  517. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  518. /* istanbul ignore next */
  519. function isNative(Ctor) {
  520. return typeof Ctor === 'function' && /native code/.test(Ctor.toString());
  521. }
  522. var hasSymbol = typeof Symbol !== 'undefined' &&
  523. isNative(Symbol) &&
  524. typeof Reflect !== 'undefined' &&
  525. isNative(Reflect.ownKeys);
  526. var _Set; // $flow-disable-line
  527. /* istanbul ignore if */ if (typeof Set !== 'undefined' && isNative(Set)) {
  528. // use native Set when available.
  529. _Set = Set;
  530. }
  531. else {
  532. // a non-standard Set polyfill that only works with primitive keys.
  533. _Set = /** @class */ (function () {
  534. function Set() {
  535. this.set = Object.create(null);
  536. }
  537. Set.prototype.has = function (key) {
  538. return this.set[key] === true;
  539. };
  540. Set.prototype.add = function (key) {
  541. this.set[key] = true;
  542. };
  543. Set.prototype.clear = function () {
  544. this.set = Object.create(null);
  545. };
  546. return Set;
  547. }());
  548. }
  549. var currentInstance = null;
  550. /**
  551. * This is exposed for compatibility with v3 (e.g. some functions in VueUse
  552. * relies on it). Do not use this internally, just use `currentInstance`.
  553. *
  554. * @internal this function needs manual type declaration because it relies
  555. * on previously manually authored types from Vue 2
  556. */
  557. function getCurrentInstance() {
  558. return currentInstance && { proxy: currentInstance };
  559. }
  560. /**
  561. * @internal
  562. */
  563. function setCurrentInstance(vm) {
  564. if (vm === void 0) { vm = null; }
  565. if (!vm)
  566. currentInstance && currentInstance._scope.off();
  567. currentInstance = vm;
  568. vm && vm._scope.on();
  569. }
  570. /**
  571. * @internal
  572. */
  573. var VNode = /** @class */ (function () {
  574. function VNode(tag, data, children, text, elm, context, componentOptions, asyncFactory) {
  575. this.tag = tag;
  576. this.data = data;
  577. this.children = children;
  578. this.text = text;
  579. this.elm = elm;
  580. this.ns = undefined;
  581. this.context = context;
  582. this.fnContext = undefined;
  583. this.fnOptions = undefined;
  584. this.fnScopeId = undefined;
  585. this.key = data && data.key;
  586. this.componentOptions = componentOptions;
  587. this.componentInstance = undefined;
  588. this.parent = undefined;
  589. this.raw = false;
  590. this.isStatic = false;
  591. this.isRootInsert = true;
  592. this.isComment = false;
  593. this.isCloned = false;
  594. this.isOnce = false;
  595. this.asyncFactory = asyncFactory;
  596. this.asyncMeta = undefined;
  597. this.isAsyncPlaceholder = false;
  598. }
  599. Object.defineProperty(VNode.prototype, "child", {
  600. // DEPRECATED: alias for componentInstance for backwards compat.
  601. /* istanbul ignore next */
  602. get: function () {
  603. return this.componentInstance;
  604. },
  605. enumerable: false,
  606. configurable: true
  607. });
  608. return VNode;
  609. }());
  610. var createEmptyVNode = function (text) {
  611. if (text === void 0) { text = ''; }
  612. var node = new VNode();
  613. node.text = text;
  614. node.isComment = true;
  615. return node;
  616. };
  617. function createTextVNode(val) {
  618. return new VNode(undefined, undefined, undefined, String(val));
  619. }
  620. // optimized shallow clone
  621. // used for static nodes and slot nodes because they may be reused across
  622. // multiple renders, cloning them avoids errors when DOM manipulations rely
  623. // on their elm reference.
  624. function cloneVNode(vnode) {
  625. var cloned = new VNode(vnode.tag, vnode.data,
  626. // #7975
  627. // clone children array to avoid mutating original in case of cloning
  628. // a child.
  629. vnode.children && vnode.children.slice(), vnode.text, vnode.elm, vnode.context, vnode.componentOptions, vnode.asyncFactory);
  630. cloned.ns = vnode.ns;
  631. cloned.isStatic = vnode.isStatic;
  632. cloned.key = vnode.key;
  633. cloned.isComment = vnode.isComment;
  634. cloned.fnContext = vnode.fnContext;
  635. cloned.fnOptions = vnode.fnOptions;
  636. cloned.fnScopeId = vnode.fnScopeId;
  637. cloned.asyncMeta = vnode.asyncMeta;
  638. cloned.isCloned = true;
  639. return cloned;
  640. }
  641. /* not type checking this file because flow doesn't play well with Proxy */
  642. var initProxy;
  643. {
  644. var allowedGlobals_1 = makeMap('Infinity,undefined,NaN,isFinite,isNaN,' +
  645. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  646. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,' +
  647. 'require' // for Webpack/Browserify
  648. );
  649. var warnNonPresent_1 = function (target, key) {
  650. warn$2("Property or method \"".concat(key, "\" is not defined on the instance but ") +
  651. 'referenced during render. Make sure that this property is reactive, ' +
  652. 'either in the data option, or for class-based components, by ' +
  653. 'initializing the property. ' +
  654. 'See: https://v2.vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.', target);
  655. };
  656. var warnReservedPrefix_1 = function (target, key) {
  657. warn$2("Property \"".concat(key, "\" must be accessed with \"$data.").concat(key, "\" because ") +
  658. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  659. 'prevent conflicts with Vue internals. ' +
  660. 'See: https://v2.vuejs.org/v2/api/#data', target);
  661. };
  662. var hasProxy_1 = typeof Proxy !== 'undefined' && isNative(Proxy);
  663. if (hasProxy_1) {
  664. var isBuiltInModifier_1 = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  665. config.keyCodes = new Proxy(config.keyCodes, {
  666. set: function (target, key, value) {
  667. if (isBuiltInModifier_1(key)) {
  668. warn$2("Avoid overwriting built-in modifier in config.keyCodes: .".concat(key));
  669. return false;
  670. }
  671. else {
  672. target[key] = value;
  673. return true;
  674. }
  675. }
  676. });
  677. }
  678. var hasHandler_1 = {
  679. has: function (target, key) {
  680. var has = key in target;
  681. var isAllowed = allowedGlobals_1(key) ||
  682. (typeof key === 'string' &&
  683. key.charAt(0) === '_' &&
  684. !(key in target.$data));
  685. if (!has && !isAllowed) {
  686. if (key in target.$data)
  687. warnReservedPrefix_1(target, key);
  688. else
  689. warnNonPresent_1(target, key);
  690. }
  691. return has || !isAllowed;
  692. }
  693. };
  694. var getHandler_1 = {
  695. get: function (target, key) {
  696. if (typeof key === 'string' && !(key in target)) {
  697. if (key in target.$data)
  698. warnReservedPrefix_1(target, key);
  699. else
  700. warnNonPresent_1(target, key);
  701. }
  702. return target[key];
  703. }
  704. };
  705. initProxy = function initProxy(vm) {
  706. if (hasProxy_1) {
  707. // determine which proxy handler to use
  708. var options = vm.$options;
  709. var handlers = options.render && options.render._withStripped ? getHandler_1 : hasHandler_1;
  710. vm._renderProxy = new Proxy(vm, handlers);
  711. }
  712. else {
  713. vm._renderProxy = vm;
  714. }
  715. };
  716. }
  717. /******************************************************************************
  718. Copyright (c) Microsoft Corporation.
  719. Permission to use, copy, modify, and/or distribute this software for any
  720. purpose with or without fee is hereby granted.
  721. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  722. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  723. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  724. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  725. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  726. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  727. PERFORMANCE OF THIS SOFTWARE.
  728. ***************************************************************************** */
  729. var __assign = function() {
  730. __assign = Object.assign || function __assign(t) {
  731. for (var s, i = 1, n = arguments.length; i < n; i++) {
  732. s = arguments[i];
  733. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  734. }
  735. return t;
  736. };
  737. return __assign.apply(this, arguments);
  738. };
  739. var uid$2 = 0;
  740. var pendingCleanupDeps = [];
  741. var cleanupDeps = function () {
  742. for (var i = 0; i < pendingCleanupDeps.length; i++) {
  743. var dep = pendingCleanupDeps[i];
  744. dep.subs = dep.subs.filter(function (s) { return s; });
  745. dep._pending = false;
  746. }
  747. pendingCleanupDeps.length = 0;
  748. };
  749. /**
  750. * A dep is an observable that can have multiple
  751. * directives subscribing to it.
  752. * @internal
  753. */
  754. var Dep = /** @class */ (function () {
  755. function Dep() {
  756. // pending subs cleanup
  757. this._pending = false;
  758. this.id = uid$2++;
  759. this.subs = [];
  760. }
  761. Dep.prototype.addSub = function (sub) {
  762. this.subs.push(sub);
  763. };
  764. Dep.prototype.removeSub = function (sub) {
  765. // #12696 deps with massive amount of subscribers are extremely slow to
  766. // clean up in Chromium
  767. // to workaround this, we unset the sub for now, and clear them on
  768. // next scheduler flush.
  769. this.subs[this.subs.indexOf(sub)] = null;
  770. if (!this._pending) {
  771. this._pending = true;
  772. pendingCleanupDeps.push(this);
  773. }
  774. };
  775. Dep.prototype.depend = function (info) {
  776. if (Dep.target) {
  777. Dep.target.addDep(this);
  778. if (info && Dep.target.onTrack) {
  779. Dep.target.onTrack(__assign({ effect: Dep.target }, info));
  780. }
  781. }
  782. };
  783. Dep.prototype.notify = function (info) {
  784. // stabilize the subscriber list first
  785. var subs = this.subs.filter(function (s) { return s; });
  786. if (!config.async) {
  787. // subs aren't sorted in scheduler if not running async
  788. // we need to sort them now to make sure they fire in correct
  789. // order
  790. subs.sort(function (a, b) { return a.id - b.id; });
  791. }
  792. for (var i = 0, l = subs.length; i < l; i++) {
  793. var sub = subs[i];
  794. if (info) {
  795. sub.onTrigger &&
  796. sub.onTrigger(__assign({ effect: subs[i] }, info));
  797. }
  798. sub.update();
  799. }
  800. };
  801. return Dep;
  802. }());
  803. // The current target watcher being evaluated.
  804. // This is globally unique because only one watcher
  805. // can be evaluated at a time.
  806. Dep.target = null;
  807. var targetStack = [];
  808. function pushTarget(target) {
  809. targetStack.push(target);
  810. Dep.target = target;
  811. }
  812. function popTarget() {
  813. targetStack.pop();
  814. Dep.target = targetStack[targetStack.length - 1];
  815. }
  816. /*
  817. * not type checking this file because flow doesn't play well with
  818. * dynamically accessing methods on Array prototype
  819. */
  820. var arrayProto = Array.prototype;
  821. var arrayMethods = Object.create(arrayProto);
  822. var methodsToPatch = [
  823. 'push',
  824. 'pop',
  825. 'shift',
  826. 'unshift',
  827. 'splice',
  828. 'sort',
  829. 'reverse'
  830. ];
  831. /**
  832. * Intercept mutating methods and emit events
  833. */
  834. methodsToPatch.forEach(function (method) {
  835. // cache original method
  836. var original = arrayProto[method];
  837. def(arrayMethods, method, function mutator() {
  838. var args = [];
  839. for (var _i = 0; _i < arguments.length; _i++) {
  840. args[_i] = arguments[_i];
  841. }
  842. var result = original.apply(this, args);
  843. var ob = this.__ob__;
  844. var inserted;
  845. switch (method) {
  846. case 'push':
  847. case 'unshift':
  848. inserted = args;
  849. break;
  850. case 'splice':
  851. inserted = args.slice(2);
  852. break;
  853. }
  854. if (inserted)
  855. ob.observeArray(inserted);
  856. // notify change
  857. {
  858. ob.dep.notify({
  859. type: "array mutation" /* TriggerOpTypes.ARRAY_MUTATION */,
  860. target: this,
  861. key: method
  862. });
  863. }
  864. return result;
  865. });
  866. });
  867. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  868. var NO_INITIAL_VALUE = {};
  869. /**
  870. * In some cases we may want to disable observation inside a component's
  871. * update computation.
  872. */
  873. var shouldObserve = true;
  874. function toggleObserving(value) {
  875. shouldObserve = value;
  876. }
  877. // ssr mock dep
  878. var mockDep = {
  879. notify: noop,
  880. depend: noop,
  881. addSub: noop,
  882. removeSub: noop
  883. };
  884. /**
  885. * Observer class that is attached to each observed
  886. * object. Once attached, the observer converts the target
  887. * object's property keys into getter/setters that
  888. * collect dependencies and dispatch updates.
  889. */
  890. var Observer = /** @class */ (function () {
  891. function Observer(value, shallow, mock) {
  892. if (shallow === void 0) { shallow = false; }
  893. if (mock === void 0) { mock = false; }
  894. this.value = value;
  895. this.shallow = shallow;
  896. this.mock = mock;
  897. // this.value = value
  898. this.dep = mock ? mockDep : new Dep();
  899. this.vmCount = 0;
  900. def(value, '__ob__', this);
  901. if (isArray(value)) {
  902. if (!mock) {
  903. if (hasProto) {
  904. value.__proto__ = arrayMethods;
  905. /* eslint-enable no-proto */
  906. }
  907. else {
  908. for (var i = 0, l = arrayKeys.length; i < l; i++) {
  909. var key = arrayKeys[i];
  910. def(value, key, arrayMethods[key]);
  911. }
  912. }
  913. }
  914. if (!shallow) {
  915. this.observeArray(value);
  916. }
  917. }
  918. else {
  919. /**
  920. * Walk through all properties and convert them into
  921. * getter/setters. This method should only be called when
  922. * value type is Object.
  923. */
  924. var keys = Object.keys(value);
  925. for (var i = 0; i < keys.length; i++) {
  926. var key = keys[i];
  927. defineReactive(value, key, NO_INITIAL_VALUE, undefined, shallow, mock);
  928. }
  929. }
  930. }
  931. /**
  932. * Observe a list of Array items.
  933. */
  934. Observer.prototype.observeArray = function (value) {
  935. for (var i = 0, l = value.length; i < l; i++) {
  936. observe(value[i], false, this.mock);
  937. }
  938. };
  939. return Observer;
  940. }());
  941. // helpers
  942. /**
  943. * Attempt to create an observer instance for a value,
  944. * returns the new observer if successfully observed,
  945. * or the existing observer if the value already has one.
  946. */
  947. function observe(value, shallow, ssrMockReactivity) {
  948. if (value && hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  949. return value.__ob__;
  950. }
  951. if (shouldObserve &&
  952. (ssrMockReactivity || !isServerRendering()) &&
  953. (isArray(value) || isPlainObject(value)) &&
  954. Object.isExtensible(value) &&
  955. !value.__v_skip /* ReactiveFlags.SKIP */ &&
  956. !isRef(value) &&
  957. !(value instanceof VNode)) {
  958. return new Observer(value, shallow, ssrMockReactivity);
  959. }
  960. }
  961. /**
  962. * Define a reactive property on an Object.
  963. */
  964. function defineReactive(obj, key, val, customSetter, shallow, mock) {
  965. var dep = new Dep();
  966. var property = Object.getOwnPropertyDescriptor(obj, key);
  967. if (property && property.configurable === false) {
  968. return;
  969. }
  970. // cater for pre-defined getter/setters
  971. var getter = property && property.get;
  972. var setter = property && property.set;
  973. if ((!getter || setter) &&
  974. (val === NO_INITIAL_VALUE || arguments.length === 2)) {
  975. val = obj[key];
  976. }
  977. var childOb = !shallow && observe(val, false, mock);
  978. Object.defineProperty(obj, key, {
  979. enumerable: true,
  980. configurable: true,
  981. get: function reactiveGetter() {
  982. var value = getter ? getter.call(obj) : val;
  983. if (Dep.target) {
  984. {
  985. dep.depend({
  986. target: obj,
  987. type: "get" /* TrackOpTypes.GET */,
  988. key: key
  989. });
  990. }
  991. if (childOb) {
  992. childOb.dep.depend();
  993. if (isArray(value)) {
  994. dependArray(value);
  995. }
  996. }
  997. }
  998. return isRef(value) && !shallow ? value.value : value;
  999. },
  1000. set: function reactiveSetter(newVal) {
  1001. var value = getter ? getter.call(obj) : val;
  1002. if (!hasChanged(value, newVal)) {
  1003. return;
  1004. }
  1005. if (customSetter) {
  1006. customSetter();
  1007. }
  1008. if (setter) {
  1009. setter.call(obj, newVal);
  1010. }
  1011. else if (getter) {
  1012. // #7981: for accessor properties without setter
  1013. return;
  1014. }
  1015. else if (!shallow && isRef(value) && !isRef(newVal)) {
  1016. value.value = newVal;
  1017. return;
  1018. }
  1019. else {
  1020. val = newVal;
  1021. }
  1022. childOb = !shallow && observe(newVal, false, mock);
  1023. {
  1024. dep.notify({
  1025. type: "set" /* TriggerOpTypes.SET */,
  1026. target: obj,
  1027. key: key,
  1028. newValue: newVal,
  1029. oldValue: value
  1030. });
  1031. }
  1032. }
  1033. });
  1034. return dep;
  1035. }
  1036. function set(target, key, val) {
  1037. if ((isUndef(target) || isPrimitive(target))) {
  1038. warn$2("Cannot set reactive property on undefined, null, or primitive value: ".concat(target));
  1039. }
  1040. if (isReadonly(target)) {
  1041. warn$2("Set operation on key \"".concat(key, "\" failed: target is readonly."));
  1042. return;
  1043. }
  1044. var ob = target.__ob__;
  1045. if (isArray(target) && isValidArrayIndex(key)) {
  1046. target.length = Math.max(target.length, key);
  1047. target.splice(key, 1, val);
  1048. // when mocking for SSR, array methods are not hijacked
  1049. if (ob && !ob.shallow && ob.mock) {
  1050. observe(val, false, true);
  1051. }
  1052. return val;
  1053. }
  1054. if (key in target && !(key in Object.prototype)) {
  1055. target[key] = val;
  1056. return val;
  1057. }
  1058. if (target._isVue || (ob && ob.vmCount)) {
  1059. warn$2('Avoid adding reactive properties to a Vue instance or its root $data ' +
  1060. 'at runtime - declare it upfront in the data option.');
  1061. return val;
  1062. }
  1063. if (!ob) {
  1064. target[key] = val;
  1065. return val;
  1066. }
  1067. defineReactive(ob.value, key, val, undefined, ob.shallow, ob.mock);
  1068. {
  1069. ob.dep.notify({
  1070. type: "add" /* TriggerOpTypes.ADD */,
  1071. target: target,
  1072. key: key,
  1073. newValue: val,
  1074. oldValue: undefined
  1075. });
  1076. }
  1077. return val;
  1078. }
  1079. function del(target, key) {
  1080. if ((isUndef(target) || isPrimitive(target))) {
  1081. warn$2("Cannot delete reactive property on undefined, null, or primitive value: ".concat(target));
  1082. }
  1083. if (isArray(target) && isValidArrayIndex(key)) {
  1084. target.splice(key, 1);
  1085. return;
  1086. }
  1087. var ob = target.__ob__;
  1088. if (target._isVue || (ob && ob.vmCount)) {
  1089. warn$2('Avoid deleting properties on a Vue instance or its root $data ' +
  1090. '- just set it to null.');
  1091. return;
  1092. }
  1093. if (isReadonly(target)) {
  1094. warn$2("Delete operation on key \"".concat(key, "\" failed: target is readonly."));
  1095. return;
  1096. }
  1097. if (!hasOwn(target, key)) {
  1098. return;
  1099. }
  1100. delete target[key];
  1101. if (!ob) {
  1102. return;
  1103. }
  1104. {
  1105. ob.dep.notify({
  1106. type: "delete" /* TriggerOpTypes.DELETE */,
  1107. target: target,
  1108. key: key
  1109. });
  1110. }
  1111. }
  1112. /**
  1113. * Collect dependencies on array elements when the array is touched, since
  1114. * we cannot intercept array element access like property getters.
  1115. */
  1116. function dependArray(value) {
  1117. for (var e = void 0, i = 0, l = value.length; i < l; i++) {
  1118. e = value[i];
  1119. if (e && e.__ob__) {
  1120. e.__ob__.dep.depend();
  1121. }
  1122. if (isArray(e)) {
  1123. dependArray(e);
  1124. }
  1125. }
  1126. }
  1127. function reactive(target) {
  1128. makeReactive(target, false);
  1129. return target;
  1130. }
  1131. /**
  1132. * Return a shallowly-reactive copy of the original object, where only the root
  1133. * level properties are reactive. It also does not auto-unwrap refs (even at the
  1134. * root level).
  1135. */
  1136. function shallowReactive(target) {
  1137. makeReactive(target, true);
  1138. def(target, "__v_isShallow" /* ReactiveFlags.IS_SHALLOW */, true);
  1139. return target;
  1140. }
  1141. function makeReactive(target, shallow) {
  1142. // if trying to observe a readonly proxy, return the readonly version.
  1143. if (!isReadonly(target)) {
  1144. {
  1145. if (isArray(target)) {
  1146. warn$2("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."));
  1147. }
  1148. var existingOb = target && target.__ob__;
  1149. if (existingOb && existingOb.shallow !== shallow) {
  1150. warn$2("Target is already a ".concat(existingOb.shallow ? "" : "non-", "shallow reactive object, and cannot be converted to ").concat(shallow ? "" : "non-", "shallow."));
  1151. }
  1152. }
  1153. var ob = observe(target, shallow, isServerRendering() /* ssr mock reactivity */);
  1154. if (!ob) {
  1155. if (target == null || isPrimitive(target)) {
  1156. warn$2("value cannot be made reactive: ".concat(String(target)));
  1157. }
  1158. if (isCollectionType(target)) {
  1159. warn$2("Vue 2 does not support reactive collection types such as Map or Set.");
  1160. }
  1161. }
  1162. }
  1163. }
  1164. function isReactive(value) {
  1165. if (isReadonly(value)) {
  1166. return isReactive(value["__v_raw" /* ReactiveFlags.RAW */]);
  1167. }
  1168. return !!(value && value.__ob__);
  1169. }
  1170. function isShallow(value) {
  1171. return !!(value && value.__v_isShallow);
  1172. }
  1173. function isReadonly(value) {
  1174. return !!(value && value.__v_isReadonly);
  1175. }
  1176. function isProxy(value) {
  1177. return isReactive(value) || isReadonly(value);
  1178. }
  1179. function toRaw(observed) {
  1180. var raw = observed && observed["__v_raw" /* ReactiveFlags.RAW */];
  1181. return raw ? toRaw(raw) : observed;
  1182. }
  1183. function markRaw(value) {
  1184. // non-extensible objects won't be observed anyway
  1185. if (Object.isExtensible(value)) {
  1186. def(value, "__v_skip" /* ReactiveFlags.SKIP */, true);
  1187. }
  1188. return value;
  1189. }
  1190. /**
  1191. * @internal
  1192. */
  1193. function isCollectionType(value) {
  1194. var type = toRawType(value);
  1195. return (type === 'Map' || type === 'WeakMap' || type === 'Set' || type === 'WeakSet');
  1196. }
  1197. /**
  1198. * @internal
  1199. */
  1200. var RefFlag = "__v_isRef";
  1201. function isRef(r) {
  1202. return !!(r && r.__v_isRef === true);
  1203. }
  1204. function ref$1(value) {
  1205. return createRef(value, false);
  1206. }
  1207. function shallowRef(value) {
  1208. return createRef(value, true);
  1209. }
  1210. function createRef(rawValue, shallow) {
  1211. if (isRef(rawValue)) {
  1212. return rawValue;
  1213. }
  1214. var ref = {};
  1215. def(ref, RefFlag, true);
  1216. def(ref, "__v_isShallow" /* ReactiveFlags.IS_SHALLOW */, shallow);
  1217. def(ref, 'dep', defineReactive(ref, 'value', rawValue, null, shallow, isServerRendering()));
  1218. return ref;
  1219. }
  1220. function triggerRef(ref) {
  1221. if (!ref.dep) {
  1222. warn$2("received object is not a triggerable ref.");
  1223. }
  1224. {
  1225. ref.dep &&
  1226. ref.dep.notify({
  1227. type: "set" /* TriggerOpTypes.SET */,
  1228. target: ref,
  1229. key: 'value'
  1230. });
  1231. }
  1232. }
  1233. function unref(ref) {
  1234. return isRef(ref) ? ref.value : ref;
  1235. }
  1236. function proxyRefs(objectWithRefs) {
  1237. if (isReactive(objectWithRefs)) {
  1238. return objectWithRefs;
  1239. }
  1240. var proxy = {};
  1241. var keys = Object.keys(objectWithRefs);
  1242. for (var i = 0; i < keys.length; i++) {
  1243. proxyWithRefUnwrap(proxy, objectWithRefs, keys[i]);
  1244. }
  1245. return proxy;
  1246. }
  1247. function proxyWithRefUnwrap(target, source, key) {
  1248. Object.defineProperty(target, key, {
  1249. enumerable: true,
  1250. configurable: true,
  1251. get: function () {
  1252. var val = source[key];
  1253. if (isRef(val)) {
  1254. return val.value;
  1255. }
  1256. else {
  1257. var ob = val && val.__ob__;
  1258. if (ob)
  1259. ob.dep.depend();
  1260. return val;
  1261. }
  1262. },
  1263. set: function (value) {
  1264. var oldValue = source[key];
  1265. if (isRef(oldValue) && !isRef(value)) {
  1266. oldValue.value = value;
  1267. }
  1268. else {
  1269. source[key] = value;
  1270. }
  1271. }
  1272. });
  1273. }
  1274. function customRef(factory) {
  1275. var dep = new Dep();
  1276. var _a = factory(function () {
  1277. {
  1278. dep.depend({
  1279. target: ref,
  1280. type: "get" /* TrackOpTypes.GET */,
  1281. key: 'value'
  1282. });
  1283. }
  1284. }, function () {
  1285. {
  1286. dep.notify({
  1287. target: ref,
  1288. type: "set" /* TriggerOpTypes.SET */,
  1289. key: 'value'
  1290. });
  1291. }
  1292. }), get = _a.get, set = _a.set;
  1293. var ref = {
  1294. get value() {
  1295. return get();
  1296. },
  1297. set value(newVal) {
  1298. set(newVal);
  1299. }
  1300. };
  1301. def(ref, RefFlag, true);
  1302. return ref;
  1303. }
  1304. function toRefs(object) {
  1305. if (!isReactive(object)) {
  1306. warn$2("toRefs() expects a reactive object but received a plain one.");
  1307. }
  1308. var ret = isArray(object) ? new Array(object.length) : {};
  1309. for (var key in object) {
  1310. ret[key] = toRef(object, key);
  1311. }
  1312. return ret;
  1313. }
  1314. function toRef(object, key, defaultValue) {
  1315. var val = object[key];
  1316. if (isRef(val)) {
  1317. return val;
  1318. }
  1319. var ref = {
  1320. get value() {
  1321. var val = object[key];
  1322. return val === undefined ? defaultValue : val;
  1323. },
  1324. set value(newVal) {
  1325. object[key] = newVal;
  1326. }
  1327. };
  1328. def(ref, RefFlag, true);
  1329. return ref;
  1330. }
  1331. var rawToReadonlyFlag = "__v_rawToReadonly";
  1332. var rawToShallowReadonlyFlag = "__v_rawToShallowReadonly";
  1333. function readonly(target) {
  1334. return createReadonly(target, false);
  1335. }
  1336. function createReadonly(target, shallow) {
  1337. if (!isPlainObject(target)) {
  1338. {
  1339. if (isArray(target)) {
  1340. warn$2("Vue 2 does not support readonly arrays.");
  1341. }
  1342. else if (isCollectionType(target)) {
  1343. warn$2("Vue 2 does not support readonly collection types such as Map or Set.");
  1344. }
  1345. else {
  1346. warn$2("value cannot be made readonly: ".concat(typeof target));
  1347. }
  1348. }
  1349. return target;
  1350. }
  1351. if (!Object.isExtensible(target)) {
  1352. warn$2("Vue 2 does not support creating readonly proxy for non-extensible object.");
  1353. }
  1354. // already a readonly object
  1355. if (isReadonly(target)) {
  1356. return target;
  1357. }
  1358. // already has a readonly proxy
  1359. var existingFlag = shallow ? rawToShallowReadonlyFlag : rawToReadonlyFlag;
  1360. var existingProxy = target[existingFlag];
  1361. if (existingProxy) {
  1362. return existingProxy;
  1363. }
  1364. var proxy = Object.create(Object.getPrototypeOf(target));
  1365. def(target, existingFlag, proxy);
  1366. def(proxy, "__v_isReadonly" /* ReactiveFlags.IS_READONLY */, true);
  1367. def(proxy, "__v_raw" /* ReactiveFlags.RAW */, target);
  1368. if (isRef(target)) {
  1369. def(proxy, RefFlag, true);
  1370. }
  1371. if (shallow || isShallow(target)) {
  1372. def(proxy, "__v_isShallow" /* ReactiveFlags.IS_SHALLOW */, true);
  1373. }
  1374. var keys = Object.keys(target);
  1375. for (var i = 0; i < keys.length; i++) {
  1376. defineReadonlyProperty(proxy, target, keys[i], shallow);
  1377. }
  1378. return proxy;
  1379. }
  1380. function defineReadonlyProperty(proxy, target, key, shallow) {
  1381. Object.defineProperty(proxy, key, {
  1382. enumerable: true,
  1383. configurable: true,
  1384. get: function () {
  1385. var val = target[key];
  1386. return shallow || !isPlainObject(val) ? val : readonly(val);
  1387. },
  1388. set: function () {
  1389. warn$2("Set operation on key \"".concat(key, "\" failed: target is readonly."));
  1390. }
  1391. });
  1392. }
  1393. /**
  1394. * Returns a reactive-copy of the original object, where only the root level
  1395. * properties are readonly, and does NOT unwrap refs nor recursively convert
  1396. * returned properties.
  1397. * This is used for creating the props proxy object for stateful components.
  1398. */
  1399. function shallowReadonly(target) {
  1400. return createReadonly(target, true);
  1401. }
  1402. function computed(getterOrOptions, debugOptions) {
  1403. var getter;
  1404. var setter;
  1405. var onlyGetter = isFunction(getterOrOptions);
  1406. if (onlyGetter) {
  1407. getter = getterOrOptions;
  1408. setter = function () {
  1409. warn$2('Write operation failed: computed value is readonly');
  1410. }
  1411. ;
  1412. }
  1413. else {
  1414. getter = getterOrOptions.get;
  1415. setter = getterOrOptions.set;
  1416. }
  1417. var watcher = isServerRendering()
  1418. ? null
  1419. : new Watcher(currentInstance, getter, noop, { lazy: true });
  1420. if (watcher && debugOptions) {
  1421. watcher.onTrack = debugOptions.onTrack;
  1422. watcher.onTrigger = debugOptions.onTrigger;
  1423. }
  1424. var ref = {
  1425. // some libs rely on the presence effect for checking computed refs
  1426. // from normal refs, but the implementation doesn't matter
  1427. effect: watcher,
  1428. get value() {
  1429. if (watcher) {
  1430. if (watcher.dirty) {
  1431. watcher.evaluate();
  1432. }
  1433. if (Dep.target) {
  1434. if (Dep.target.onTrack) {
  1435. Dep.target.onTrack({
  1436. effect: Dep.target,
  1437. target: ref,
  1438. type: "get" /* TrackOpTypes.GET */,
  1439. key: 'value'
  1440. });
  1441. }
  1442. watcher.depend();
  1443. }
  1444. return watcher.value;
  1445. }
  1446. else {
  1447. return getter();
  1448. }
  1449. },
  1450. set value(newVal) {
  1451. setter(newVal);
  1452. }
  1453. };
  1454. def(ref, RefFlag, true);
  1455. def(ref, "__v_isReadonly" /* ReactiveFlags.IS_READONLY */, onlyGetter);
  1456. return ref;
  1457. }
  1458. var mark;
  1459. var measure;
  1460. {
  1461. var perf_1 = inBrowser && window.performance;
  1462. /* istanbul ignore if */
  1463. if (perf_1 &&
  1464. // @ts-ignore
  1465. perf_1.mark &&
  1466. // @ts-ignore
  1467. perf_1.measure &&
  1468. // @ts-ignore
  1469. perf_1.clearMarks &&
  1470. // @ts-ignore
  1471. perf_1.clearMeasures) {
  1472. mark = function (tag) { return perf_1.mark(tag); };
  1473. measure = function (name, startTag, endTag) {
  1474. perf_1.measure(name, startTag, endTag);
  1475. perf_1.clearMarks(startTag);
  1476. perf_1.clearMarks(endTag);
  1477. // perf.clearMeasures(name)
  1478. };
  1479. }
  1480. }
  1481. var normalizeEvent = cached(function (name) {
  1482. var passive = name.charAt(0) === '&';
  1483. name = passive ? name.slice(1) : name;
  1484. var once = name.charAt(0) === '~'; // Prefixed last, checked first
  1485. name = once ? name.slice(1) : name;
  1486. var capture = name.charAt(0) === '!';
  1487. name = capture ? name.slice(1) : name;
  1488. return {
  1489. name: name,
  1490. once: once,
  1491. capture: capture,
  1492. passive: passive
  1493. };
  1494. });
  1495. function createFnInvoker(fns, vm) {
  1496. function invoker() {
  1497. var fns = invoker.fns;
  1498. if (isArray(fns)) {
  1499. var cloned = fns.slice();
  1500. for (var i = 0; i < cloned.length; i++) {
  1501. invokeWithErrorHandling(cloned[i], null, arguments, vm, "v-on handler");
  1502. }
  1503. }
  1504. else {
  1505. // return handler return value for single handlers
  1506. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler");
  1507. }
  1508. }
  1509. invoker.fns = fns;
  1510. return invoker;
  1511. }
  1512. function updateListeners(on, oldOn, add, remove, createOnceHandler, vm) {
  1513. var name, cur, old, event;
  1514. for (name in on) {
  1515. cur = on[name];
  1516. old = oldOn[name];
  1517. event = normalizeEvent(name);
  1518. if (isUndef(cur)) {
  1519. warn$2("Invalid handler for event \"".concat(event.name, "\": got ") + String(cur), vm);
  1520. }
  1521. else if (isUndef(old)) {
  1522. if (isUndef(cur.fns)) {
  1523. cur = on[name] = createFnInvoker(cur, vm);
  1524. }
  1525. if (isTrue(event.once)) {
  1526. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  1527. }
  1528. add(event.name, cur, event.capture, event.passive, event.params);
  1529. }
  1530. else if (cur !== old) {
  1531. old.fns = cur;
  1532. on[name] = old;
  1533. }
  1534. }
  1535. for (name in oldOn) {
  1536. if (isUndef(on[name])) {
  1537. event = normalizeEvent(name);
  1538. remove(event.name, oldOn[name], event.capture);
  1539. }
  1540. }
  1541. }
  1542. function mergeVNodeHook(def, hookKey, hook) {
  1543. if (def instanceof VNode) {
  1544. def = def.data.hook || (def.data.hook = {});
  1545. }
  1546. var invoker;
  1547. var oldHook = def[hookKey];
  1548. function wrappedHook() {
  1549. hook.apply(this, arguments);
  1550. // important: remove merged hook to ensure it's called only once
  1551. // and prevent memory leak
  1552. remove$2(invoker.fns, wrappedHook);
  1553. }
  1554. if (isUndef(oldHook)) {
  1555. // no existing hook
  1556. invoker = createFnInvoker([wrappedHook]);
  1557. }
  1558. else {
  1559. /* istanbul ignore if */
  1560. if (isDef(oldHook.fns) && isTrue(oldHook.merged)) {
  1561. // already a merged invoker
  1562. invoker = oldHook;
  1563. invoker.fns.push(wrappedHook);
  1564. }
  1565. else {
  1566. // existing plain hook
  1567. invoker = createFnInvoker([oldHook, wrappedHook]);
  1568. }
  1569. }
  1570. invoker.merged = true;
  1571. def[hookKey] = invoker;
  1572. }
  1573. function extractPropsFromVNodeData(data, Ctor, tag) {
  1574. // we are only extracting raw values here.
  1575. // validation and default values are handled in the child
  1576. // component itself.
  1577. var propOptions = Ctor.options.props;
  1578. if (isUndef(propOptions)) {
  1579. return;
  1580. }
  1581. var res = {};
  1582. var attrs = data.attrs, props = data.props;
  1583. if (isDef(attrs) || isDef(props)) {
  1584. for (var key in propOptions) {
  1585. var altKey = hyphenate(key);
  1586. {
  1587. var keyInLowerCase = key.toLowerCase();
  1588. if (key !== keyInLowerCase && attrs && hasOwn(attrs, keyInLowerCase)) {
  1589. tip("Prop \"".concat(keyInLowerCase, "\" is passed to component ") +
  1590. "".concat(formatComponentName(
  1591. // @ts-expect-error tag is string
  1592. tag || Ctor), ", but the declared prop name is") +
  1593. " \"".concat(key, "\". ") +
  1594. "Note that HTML attributes are case-insensitive and camelCased " +
  1595. "props need to use their kebab-case equivalents when using in-DOM " +
  1596. "templates. You should probably use \"".concat(altKey, "\" instead of \"").concat(key, "\"."));
  1597. }
  1598. }
  1599. checkProp(res, props, key, altKey, true) ||
  1600. checkProp(res, attrs, key, altKey, false);
  1601. }
  1602. }
  1603. return res;
  1604. }
  1605. function checkProp(res, hash, key, altKey, preserve) {
  1606. if (isDef(hash)) {
  1607. if (hasOwn(hash, key)) {
  1608. res[key] = hash[key];
  1609. if (!preserve) {
  1610. delete hash[key];
  1611. }
  1612. return true;
  1613. }
  1614. else if (hasOwn(hash, altKey)) {
  1615. res[key] = hash[altKey];
  1616. if (!preserve) {
  1617. delete hash[altKey];
  1618. }
  1619. return true;
  1620. }
  1621. }
  1622. return false;
  1623. }
  1624. // The template compiler attempts to minimize the need for normalization by
  1625. // statically analyzing the template at compile time.
  1626. //
  1627. // For plain HTML markup, normalization can be completely skipped because the
  1628. // generated render function is guaranteed to return Array<VNode>. There are
  1629. // two cases where extra normalization is needed:
  1630. // 1. When the children contains components - because a functional component
  1631. // may return an Array instead of a single root. In this case, just a simple
  1632. // normalization is needed - if any child is an Array, we flatten the whole
  1633. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  1634. // because functional components already normalize their own children.
  1635. function simpleNormalizeChildren(children) {
  1636. for (var i = 0; i < children.length; i++) {
  1637. if (isArray(children[i])) {
  1638. return Array.prototype.concat.apply([], children);
  1639. }
  1640. }
  1641. return children;
  1642. }
  1643. // 2. When the children contains constructs that always generated nested Arrays,
  1644. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  1645. // with hand-written render functions / JSX. In such cases a full normalization
  1646. // is needed to cater to all possible types of children values.
  1647. function normalizeChildren(children) {
  1648. return isPrimitive(children)
  1649. ? [createTextVNode(children)]
  1650. : isArray(children)
  1651. ? normalizeArrayChildren(children)
  1652. : undefined;
  1653. }
  1654. function isTextNode(node) {
  1655. return isDef(node) && isDef(node.text) && isFalse(node.isComment);
  1656. }
  1657. function normalizeArrayChildren(children, nestedIndex) {
  1658. var res = [];
  1659. var i, c, lastIndex, last;
  1660. for (i = 0; i < children.length; i++) {
  1661. c = children[i];
  1662. if (isUndef(c) || typeof c === 'boolean')
  1663. continue;
  1664. lastIndex = res.length - 1;
  1665. last = res[lastIndex];
  1666. // nested
  1667. if (isArray(c)) {
  1668. if (c.length > 0) {
  1669. c = normalizeArrayChildren(c, "".concat(nestedIndex || '', "_").concat(i));
  1670. // merge adjacent text nodes
  1671. if (isTextNode(c[0]) && isTextNode(last)) {
  1672. res[lastIndex] = createTextVNode(last.text + c[0].text);
  1673. c.shift();
  1674. }
  1675. res.push.apply(res, c);
  1676. }
  1677. }
  1678. else if (isPrimitive(c)) {
  1679. if (isTextNode(last)) {
  1680. // merge adjacent text nodes
  1681. // this is necessary for SSR hydration because text nodes are
  1682. // essentially merged when rendered to HTML strings
  1683. res[lastIndex] = createTextVNode(last.text + c);
  1684. }
  1685. else if (c !== '') {
  1686. // convert primitive to vnode
  1687. res.push(createTextVNode(c));
  1688. }
  1689. }
  1690. else {
  1691. if (isTextNode(c) && isTextNode(last)) {
  1692. // merge adjacent text nodes
  1693. res[lastIndex] = createTextVNode(last.text + c.text);
  1694. }
  1695. else {
  1696. // default key for nested array children (likely generated by v-for)
  1697. if (isTrue(children._isVList) &&
  1698. isDef(c.tag) &&
  1699. isUndef(c.key) &&
  1700. isDef(nestedIndex)) {
  1701. c.key = "__vlist".concat(nestedIndex, "_").concat(i, "__");
  1702. }
  1703. res.push(c);
  1704. }
  1705. }
  1706. }
  1707. return res;
  1708. }
  1709. var SIMPLE_NORMALIZE = 1;
  1710. var ALWAYS_NORMALIZE = 2;
  1711. // wrapper function for providing a more flexible interface
  1712. // without getting yelled at by flow
  1713. function createElement$1(context, tag, data, children, normalizationType, alwaysNormalize) {
  1714. if (isArray(data) || isPrimitive(data)) {
  1715. normalizationType = children;
  1716. children = data;
  1717. data = undefined;
  1718. }
  1719. if (isTrue(alwaysNormalize)) {
  1720. normalizationType = ALWAYS_NORMALIZE;
  1721. }
  1722. return _createElement(context, tag, data, children, normalizationType);
  1723. }
  1724. function _createElement(context, tag, data, children, normalizationType) {
  1725. if (isDef(data) && isDef(data.__ob__)) {
  1726. warn$2("Avoid using observed data object as vnode data: ".concat(JSON.stringify(data), "\n") + 'Always create fresh vnode data objects in each render!', context);
  1727. return createEmptyVNode();
  1728. }
  1729. // object syntax in v-bind
  1730. if (isDef(data) && isDef(data.is)) {
  1731. tag = data.is;
  1732. }
  1733. if (!tag) {
  1734. // in case of component :is set to falsy value
  1735. return createEmptyVNode();
  1736. }
  1737. // warn against non-primitive key
  1738. if (isDef(data) && isDef(data.key) && !isPrimitive(data.key)) {
  1739. warn$2('Avoid using non-primitive value as key, ' +
  1740. 'use string/number value instead.', context);
  1741. }
  1742. // support single function children as default scoped slot
  1743. if (isArray(children) && isFunction(children[0])) {
  1744. data = data || {};
  1745. data.scopedSlots = { default: children[0] };
  1746. children.length = 0;
  1747. }
  1748. if (normalizationType === ALWAYS_NORMALIZE) {
  1749. children = normalizeChildren(children);
  1750. }
  1751. else if (normalizationType === SIMPLE_NORMALIZE) {
  1752. children = simpleNormalizeChildren(children);
  1753. }
  1754. var vnode, ns;
  1755. if (typeof tag === 'string') {
  1756. var Ctor = void 0;
  1757. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  1758. if (config.isReservedTag(tag)) {
  1759. // platform built-in elements
  1760. if (isDef(data) &&
  1761. isDef(data.nativeOn) &&
  1762. data.tag !== 'component') {
  1763. warn$2("The .native modifier for v-on is only valid on components but it was used on <".concat(tag, ">."), context);
  1764. }
  1765. vnode = new VNode(config.parsePlatformTagName(tag), data, children, undefined, undefined, context);
  1766. }
  1767. else if ((!data || !data.pre) &&
  1768. isDef((Ctor = resolveAsset(context.$options, 'components', tag)))) {
  1769. // component
  1770. vnode = createComponent(Ctor, data, context, children, tag);
  1771. }
  1772. else {
  1773. // unknown or unlisted namespaced elements
  1774. // check at runtime because it may get assigned a namespace when its
  1775. // parent normalizes children
  1776. vnode = new VNode(tag, data, children, undefined, undefined, context);
  1777. }
  1778. }
  1779. else {
  1780. // direct component options / constructor
  1781. vnode = createComponent(tag, data, context, children);
  1782. }
  1783. if (isArray(vnode)) {
  1784. return vnode;
  1785. }
  1786. else if (isDef(vnode)) {
  1787. if (isDef(ns))
  1788. applyNS(vnode, ns);
  1789. if (isDef(data))
  1790. registerDeepBindings(data);
  1791. return vnode;
  1792. }
  1793. else {
  1794. return createEmptyVNode();
  1795. }
  1796. }
  1797. function applyNS(vnode, ns, force) {
  1798. vnode.ns = ns;
  1799. if (vnode.tag === 'foreignObject') {
  1800. // use default namespace inside foreignObject
  1801. ns = undefined;
  1802. force = true;
  1803. }
  1804. if (isDef(vnode.children)) {
  1805. for (var i = 0, l = vnode.children.length; i < l; i++) {
  1806. var child = vnode.children[i];
  1807. if (isDef(child.tag) &&
  1808. (isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  1809. applyNS(child, ns, force);
  1810. }
  1811. }
  1812. }
  1813. }
  1814. // ref #5318
  1815. // necessary to ensure parent re-render when deep bindings like :style and
  1816. // :class are used on slot nodes
  1817. function registerDeepBindings(data) {
  1818. if (isObject(data.style)) {
  1819. traverse(data.style);
  1820. }
  1821. if (isObject(data.class)) {
  1822. traverse(data.class);
  1823. }
  1824. }
  1825. /**
  1826. * Runtime helper for rendering v-for lists.
  1827. */
  1828. function renderList(val, render) {
  1829. var ret = null, i, l, keys, key;
  1830. if (isArray(val) || typeof val === 'string') {
  1831. ret = new Array(val.length);
  1832. for (i = 0, l = val.length; i < l; i++) {
  1833. ret[i] = render(val[i], i);
  1834. }
  1835. }
  1836. else if (typeof val === 'number') {
  1837. ret = new Array(val);
  1838. for (i = 0; i < val; i++) {
  1839. ret[i] = render(i + 1, i);
  1840. }
  1841. }
  1842. else if (isObject(val)) {
  1843. if (hasSymbol && val[Symbol.iterator]) {
  1844. ret = [];
  1845. var iterator = val[Symbol.iterator]();
  1846. var result = iterator.next();
  1847. while (!result.done) {
  1848. ret.push(render(result.value, ret.length));
  1849. result = iterator.next();
  1850. }
  1851. }
  1852. else {
  1853. keys = Object.keys(val);
  1854. ret = new Array(keys.length);
  1855. for (i = 0, l = keys.length; i < l; i++) {
  1856. key = keys[i];
  1857. ret[i] = render(val[key], key, i);
  1858. }
  1859. }
  1860. }
  1861. if (!isDef(ret)) {
  1862. ret = [];
  1863. }
  1864. ret._isVList = true;
  1865. return ret;
  1866. }
  1867. /**
  1868. * Runtime helper for rendering <slot>
  1869. */
  1870. function renderSlot(name, fallbackRender, props, bindObject) {
  1871. var scopedSlotFn = this.$scopedSlots[name];
  1872. var nodes;
  1873. if (scopedSlotFn) {
  1874. // scoped slot
  1875. props = props || {};
  1876. if (bindObject) {
  1877. if (!isObject(bindObject)) {
  1878. warn$2('slot v-bind without argument expects an Object', this);
  1879. }
  1880. props = extend(extend({}, bindObject), props);
  1881. }
  1882. nodes =
  1883. scopedSlotFn(props) ||
  1884. (isFunction(fallbackRender) ? fallbackRender() : fallbackRender);
  1885. }
  1886. else {
  1887. nodes =
  1888. this.$slots[name] ||
  1889. (isFunction(fallbackRender) ? fallbackRender() : fallbackRender);
  1890. }
  1891. var target = props && props.slot;
  1892. if (target) {
  1893. return this.$createElement('template', { slot: target }, nodes);
  1894. }
  1895. else {
  1896. return nodes;
  1897. }
  1898. }
  1899. /**
  1900. * Runtime helper for resolving filters
  1901. */
  1902. function resolveFilter(id) {
  1903. return resolveAsset(this.$options, 'filters', id, true) || identity;
  1904. }
  1905. function isKeyNotMatch(expect, actual) {
  1906. if (isArray(expect)) {
  1907. return expect.indexOf(actual) === -1;
  1908. }
  1909. else {
  1910. return expect !== actual;
  1911. }
  1912. }
  1913. /**
  1914. * Runtime helper for checking keyCodes from config.
  1915. * exposed as Vue.prototype._k
  1916. * passing in eventKeyName as last argument separately for backwards compat
  1917. */
  1918. function checkKeyCodes(eventKeyCode, key, builtInKeyCode, eventKeyName, builtInKeyName) {
  1919. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  1920. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  1921. return isKeyNotMatch(builtInKeyName, eventKeyName);
  1922. }
  1923. else if (mappedKeyCode) {
  1924. return isKeyNotMatch(mappedKeyCode, eventKeyCode);
  1925. }
  1926. else if (eventKeyName) {
  1927. return hyphenate(eventKeyName) !== key;
  1928. }
  1929. return eventKeyCode === undefined;
  1930. }
  1931. /**
  1932. * Runtime helper for merging v-bind="object" into a VNode's data.
  1933. */
  1934. function bindObjectProps(data, tag, value, asProp, isSync) {
  1935. if (value) {
  1936. if (!isObject(value)) {
  1937. warn$2('v-bind without argument expects an Object or Array value', this);
  1938. }
  1939. else {
  1940. if (isArray(value)) {
  1941. value = toObject(value);
  1942. }
  1943. var hash = void 0;
  1944. var _loop_1 = function (key) {
  1945. if (key === 'class' || key === 'style' || isReservedAttribute(key)) {
  1946. hash = data;
  1947. }
  1948. else {
  1949. var type = data.attrs && data.attrs.type;
  1950. hash =
  1951. asProp || config.mustUseProp(tag, type, key)
  1952. ? data.domProps || (data.domProps = {})
  1953. : data.attrs || (data.attrs = {});
  1954. }
  1955. var camelizedKey = camelize(key);
  1956. var hyphenatedKey = hyphenate(key);
  1957. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  1958. hash[key] = value[key];
  1959. if (isSync) {
  1960. var on = data.on || (data.on = {});
  1961. on["update:".concat(key)] = function ($event) {
  1962. value[key] = $event;
  1963. };
  1964. }
  1965. }
  1966. };
  1967. for (var key in value) {
  1968. _loop_1(key);
  1969. }
  1970. }
  1971. }
  1972. return data;
  1973. }
  1974. /**
  1975. * Runtime helper for rendering static trees.
  1976. */
  1977. function renderStatic(index, isInFor) {
  1978. var cached = this._staticTrees || (this._staticTrees = []);
  1979. var tree = cached[index];
  1980. // if has already-rendered static tree and not inside v-for,
  1981. // we can reuse the same tree.
  1982. if (tree && !isInFor) {
  1983. return tree;
  1984. }
  1985. // otherwise, render a fresh tree.
  1986. tree = cached[index] = this.$options.staticRenderFns[index].call(this._renderProxy, this._c, this // for render fns generated for functional component templates
  1987. );
  1988. markStatic$1(tree, "__static__".concat(index), false);
  1989. return tree;
  1990. }
  1991. /**
  1992. * Runtime helper for v-once.
  1993. * Effectively it means marking the node as static with a unique key.
  1994. */
  1995. function markOnce(tree, index, key) {
  1996. markStatic$1(tree, "__once__".concat(index).concat(key ? "_".concat(key) : ""), true);
  1997. return tree;
  1998. }
  1999. function markStatic$1(tree, key, isOnce) {
  2000. if (isArray(tree)) {
  2001. for (var i = 0; i < tree.length; i++) {
  2002. if (tree[i] && typeof tree[i] !== 'string') {
  2003. markStaticNode(tree[i], "".concat(key, "_").concat(i), isOnce);
  2004. }
  2005. }
  2006. }
  2007. else {
  2008. markStaticNode(tree, key, isOnce);
  2009. }
  2010. }
  2011. function markStaticNode(node, key, isOnce) {
  2012. node.isStatic = true;
  2013. node.key = key;
  2014. node.isOnce = isOnce;
  2015. }
  2016. function bindObjectListeners(data, value) {
  2017. if (value) {
  2018. if (!isPlainObject(value)) {
  2019. warn$2('v-on without argument expects an Object value', this);
  2020. }
  2021. else {
  2022. var on = (data.on = data.on ? extend({}, data.on) : {});
  2023. for (var key in value) {
  2024. var existing = on[key];
  2025. var ours = value[key];
  2026. on[key] = existing ? [].concat(existing, ours) : ours;
  2027. }
  2028. }
  2029. }
  2030. return data;
  2031. }
  2032. function resolveScopedSlots(fns, res,
  2033. // the following are added in 2.6
  2034. hasDynamicKeys, contentHashKey) {
  2035. res = res || { $stable: !hasDynamicKeys };
  2036. for (var i = 0; i < fns.length; i++) {
  2037. var slot = fns[i];
  2038. if (isArray(slot)) {
  2039. resolveScopedSlots(slot, res, hasDynamicKeys);
  2040. }
  2041. else if (slot) {
  2042. // marker for reverse proxying v-slot without scope on this.$slots
  2043. // @ts-expect-error
  2044. if (slot.proxy) {
  2045. // @ts-expect-error
  2046. slot.fn.proxy = true;
  2047. }
  2048. res[slot.key] = slot.fn;
  2049. }
  2050. }
  2051. if (contentHashKey) {
  2052. res.$key = contentHashKey;
  2053. }
  2054. return res;
  2055. }
  2056. // helper to process dynamic keys for dynamic arguments in v-bind and v-on.
  2057. function bindDynamicKeys(baseObj, values) {
  2058. for (var i = 0; i < values.length; i += 2) {
  2059. var key = values[i];
  2060. if (typeof key === 'string' && key) {
  2061. baseObj[values[i]] = values[i + 1];
  2062. }
  2063. else if (key !== '' && key !== null) {
  2064. // null is a special value for explicitly removing a binding
  2065. warn$2("Invalid value for dynamic directive argument (expected string or null): ".concat(key), this);
  2066. }
  2067. }
  2068. return baseObj;
  2069. }
  2070. // helper to dynamically append modifier runtime markers to event names.
  2071. // ensure only append when value is already string, otherwise it will be cast
  2072. // to string and cause the type check to miss.
  2073. function prependModifier(value, symbol) {
  2074. return typeof value === 'string' ? symbol + value : value;
  2075. }
  2076. function installRenderHelpers(target) {
  2077. target._o = markOnce;
  2078. target._n = toNumber;
  2079. target._s = toString;
  2080. target._l = renderList;
  2081. target._t = renderSlot;
  2082. target._q = looseEqual;
  2083. target._i = looseIndexOf;
  2084. target._m = renderStatic;
  2085. target._f = resolveFilter;
  2086. target._k = checkKeyCodes;
  2087. target._b = bindObjectProps;
  2088. target._v = createTextVNode;
  2089. target._e = createEmptyVNode;
  2090. target._u = resolveScopedSlots;
  2091. target._g = bindObjectListeners;
  2092. target._d = bindDynamicKeys;
  2093. target._p = prependModifier;
  2094. }
  2095. /**
  2096. * Runtime helper for resolving raw children VNodes into a slot object.
  2097. */
  2098. function resolveSlots(children, context) {
  2099. if (!children || !children.length) {
  2100. return {};
  2101. }
  2102. var slots = {};
  2103. for (var i = 0, l = children.length; i < l; i++) {
  2104. var child = children[i];
  2105. var data = child.data;
  2106. // remove slot attribute if the node is resolved as a Vue slot node
  2107. if (data && data.attrs && data.attrs.slot) {
  2108. delete data.attrs.slot;
  2109. }
  2110. // named slots should only be respected if the vnode was rendered in the
  2111. // same context.
  2112. if ((child.context === context || child.fnContext === context) &&
  2113. data &&
  2114. data.slot != null) {
  2115. var name_1 = data.slot;
  2116. var slot = slots[name_1] || (slots[name_1] = []);
  2117. if (child.tag === 'template') {
  2118. slot.push.apply(slot, child.children || []);
  2119. }
  2120. else {
  2121. slot.push(child);
  2122. }
  2123. }
  2124. else {
  2125. (slots.default || (slots.default = [])).push(child);
  2126. }
  2127. }
  2128. // ignore slots that contains only whitespace
  2129. for (var name_2 in slots) {
  2130. if (slots[name_2].every(isWhitespace)) {
  2131. delete slots[name_2];
  2132. }
  2133. }
  2134. return slots;
  2135. }
  2136. function isWhitespace(node) {
  2137. return (node.isComment && !node.asyncFactory) || node.text === ' ';
  2138. }
  2139. function isAsyncPlaceholder(node) {
  2140. // @ts-expect-error not really boolean type
  2141. return node.isComment && node.asyncFactory;
  2142. }
  2143. function normalizeScopedSlots(ownerVm, scopedSlots, normalSlots, prevScopedSlots) {
  2144. var res;
  2145. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  2146. var isStable = scopedSlots ? !!scopedSlots.$stable : !hasNormalSlots;
  2147. var key = scopedSlots && scopedSlots.$key;
  2148. if (!scopedSlots) {
  2149. res = {};
  2150. }
  2151. else if (scopedSlots._normalized) {
  2152. // fast path 1: child component re-render only, parent did not change
  2153. return scopedSlots._normalized;
  2154. }
  2155. else if (isStable &&
  2156. prevScopedSlots &&
  2157. prevScopedSlots !== emptyObject &&
  2158. key === prevScopedSlots.$key &&
  2159. !hasNormalSlots &&
  2160. !prevScopedSlots.$hasNormal) {
  2161. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  2162. // only need to normalize once
  2163. return prevScopedSlots;
  2164. }
  2165. else {
  2166. res = {};
  2167. for (var key_1 in scopedSlots) {
  2168. if (scopedSlots[key_1] && key_1[0] !== '$') {
  2169. res[key_1] = normalizeScopedSlot(ownerVm, normalSlots, key_1, scopedSlots[key_1]);
  2170. }
  2171. }
  2172. }
  2173. // expose normal slots on scopedSlots
  2174. for (var key_2 in normalSlots) {
  2175. if (!(key_2 in res)) {
  2176. res[key_2] = proxyNormalSlot(normalSlots, key_2);
  2177. }
  2178. }
  2179. // avoriaz seems to mock a non-extensible $scopedSlots object
  2180. // and when that is passed down this would cause an error
  2181. if (scopedSlots && Object.isExtensible(scopedSlots)) {
  2182. scopedSlots._normalized = res;
  2183. }
  2184. def(res, '$stable', isStable);
  2185. def(res, '$key', key);
  2186. def(res, '$hasNormal', hasNormalSlots);
  2187. return res;
  2188. }
  2189. function normalizeScopedSlot(vm, normalSlots, key, fn) {
  2190. var normalized = function () {
  2191. var cur = currentInstance;
  2192. setCurrentInstance(vm);
  2193. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  2194. res =
  2195. res && typeof res === 'object' && !isArray(res)
  2196. ? [res] // single vnode
  2197. : normalizeChildren(res);
  2198. var vnode = res && res[0];
  2199. setCurrentInstance(cur);
  2200. return res &&
  2201. (!vnode ||
  2202. (res.length === 1 && vnode.isComment && !isAsyncPlaceholder(vnode))) // #9658, #10391
  2203. ? undefined
  2204. : res;
  2205. };
  2206. // this is a slot using the new v-slot syntax without scope. although it is
  2207. // compiled as a scoped slot, render fn users would expect it to be present
  2208. // on this.$slots because the usage is semantically a normal slot.
  2209. if (fn.proxy) {
  2210. Object.defineProperty(normalSlots, key, {
  2211. get: normalized,
  2212. enumerable: true,
  2213. configurable: true
  2214. });
  2215. }
  2216. return normalized;
  2217. }
  2218. function proxyNormalSlot(slots, key) {
  2219. return function () { return slots[key]; };
  2220. }
  2221. function initSetup(vm) {
  2222. var options = vm.$options;
  2223. var setup = options.setup;
  2224. if (setup) {
  2225. var ctx = (vm._setupContext = createSetupContext(vm));
  2226. setCurrentInstance(vm);
  2227. pushTarget();
  2228. var setupResult = invokeWithErrorHandling(setup, null, [vm._props || shallowReactive({}), ctx], vm, "setup");
  2229. popTarget();
  2230. setCurrentInstance();
  2231. if (isFunction(setupResult)) {
  2232. // render function
  2233. // @ts-ignore
  2234. options.render = setupResult;
  2235. }
  2236. else if (isObject(setupResult)) {
  2237. // bindings
  2238. if (setupResult instanceof VNode) {
  2239. warn$2("setup() should not return VNodes directly - " +
  2240. "return a render function instead.");
  2241. }
  2242. vm._setupState = setupResult;
  2243. // __sfc indicates compiled bindings from <script setup>
  2244. if (!setupResult.__sfc) {
  2245. for (var key in setupResult) {
  2246. if (!isReserved(key)) {
  2247. proxyWithRefUnwrap(vm, setupResult, key);
  2248. }
  2249. else {
  2250. warn$2("Avoid using variables that start with _ or $ in setup().");
  2251. }
  2252. }
  2253. }
  2254. else {
  2255. // exposed for compiled render fn
  2256. var proxy = (vm._setupProxy = {});
  2257. for (var key in setupResult) {
  2258. if (key !== '__sfc') {
  2259. proxyWithRefUnwrap(proxy, setupResult, key);
  2260. }
  2261. }
  2262. }
  2263. }
  2264. else if (setupResult !== undefined) {
  2265. warn$2("setup() should return an object. Received: ".concat(setupResult === null ? 'null' : typeof setupResult));
  2266. }
  2267. }
  2268. }
  2269. function createSetupContext(vm) {
  2270. var exposeCalled = false;
  2271. return {
  2272. get attrs() {
  2273. if (!vm._attrsProxy) {
  2274. var proxy = (vm._attrsProxy = {});
  2275. def(proxy, '_v_attr_proxy', true);
  2276. syncSetupProxy(proxy, vm.$attrs, emptyObject, vm, '$attrs');
  2277. }
  2278. return vm._attrsProxy;
  2279. },
  2280. get listeners() {
  2281. if (!vm._listenersProxy) {
  2282. var proxy = (vm._listenersProxy = {});
  2283. syncSetupProxy(proxy, vm.$listeners, emptyObject, vm, '$listeners');
  2284. }
  2285. return vm._listenersProxy;
  2286. },
  2287. get slots() {
  2288. return initSlotsProxy(vm);
  2289. },
  2290. emit: bind$1(vm.$emit, vm),
  2291. expose: function (exposed) {
  2292. {
  2293. if (exposeCalled) {
  2294. warn$2("expose() should be called only once per setup().", vm);
  2295. }
  2296. exposeCalled = true;
  2297. }
  2298. if (exposed) {
  2299. Object.keys(exposed).forEach(function (key) {
  2300. return proxyWithRefUnwrap(vm, exposed, key);
  2301. });
  2302. }
  2303. }
  2304. };
  2305. }
  2306. function syncSetupProxy(to, from, prev, instance, type) {
  2307. var changed = false;
  2308. for (var key in from) {
  2309. if (!(key in to)) {
  2310. changed = true;
  2311. defineProxyAttr(to, key, instance, type);
  2312. }
  2313. else if (from[key] !== prev[key]) {
  2314. changed = true;
  2315. }
  2316. }
  2317. for (var key in to) {
  2318. if (!(key in from)) {
  2319. changed = true;
  2320. delete to[key];
  2321. }
  2322. }
  2323. return changed;
  2324. }
  2325. function defineProxyAttr(proxy, key, instance, type) {
  2326. Object.defineProperty(proxy, key, {
  2327. enumerable: true,
  2328. configurable: true,
  2329. get: function () {
  2330. return instance[type][key];
  2331. }
  2332. });
  2333. }
  2334. function initSlotsProxy(vm) {
  2335. if (!vm._slotsProxy) {
  2336. syncSetupSlots((vm._slotsProxy = {}), vm.$scopedSlots);
  2337. }
  2338. return vm._slotsProxy;
  2339. }
  2340. function syncSetupSlots(to, from) {
  2341. for (var key in from) {
  2342. to[key] = from[key];
  2343. }
  2344. for (var key in to) {
  2345. if (!(key in from)) {
  2346. delete to[key];
  2347. }
  2348. }
  2349. }
  2350. /**
  2351. * @internal use manual type def because public setup context type relies on
  2352. * legacy VNode types
  2353. */
  2354. function useSlots() {
  2355. return getContext().slots;
  2356. }
  2357. /**
  2358. * @internal use manual type def because public setup context type relies on
  2359. * legacy VNode types
  2360. */
  2361. function useAttrs() {
  2362. return getContext().attrs;
  2363. }
  2364. /**
  2365. * Vue 2 only
  2366. * @internal use manual type def because public setup context type relies on
  2367. * legacy VNode types
  2368. */
  2369. function useListeners() {
  2370. return getContext().listeners;
  2371. }
  2372. function getContext() {
  2373. if (!currentInstance) {
  2374. warn$2("useContext() called without active instance.");
  2375. }
  2376. var vm = currentInstance;
  2377. return vm._setupContext || (vm._setupContext = createSetupContext(vm));
  2378. }
  2379. /**
  2380. * Runtime helper for merging default declarations. Imported by compiled code
  2381. * only.
  2382. * @internal
  2383. */
  2384. function mergeDefaults(raw, defaults) {
  2385. var props = isArray(raw)
  2386. ? raw.reduce(function (normalized, p) { return ((normalized[p] = {}), normalized); }, {})
  2387. : raw;
  2388. for (var key in defaults) {
  2389. var opt = props[key];
  2390. if (opt) {
  2391. if (isArray(opt) || isFunction(opt)) {
  2392. props[key] = { type: opt, default: defaults[key] };
  2393. }
  2394. else {
  2395. opt.default = defaults[key];
  2396. }
  2397. }
  2398. else if (opt === null) {
  2399. props[key] = { default: defaults[key] };
  2400. }
  2401. else {
  2402. warn$2("props default key \"".concat(key, "\" has no corresponding declaration."));
  2403. }
  2404. }
  2405. return props;
  2406. }
  2407. function initRender(vm) {
  2408. vm._vnode = null; // the root of the child tree
  2409. vm._staticTrees = null; // v-once cached trees
  2410. var options = vm.$options;
  2411. var parentVnode = (vm.$vnode = options._parentVnode); // the placeholder node in parent tree
  2412. var renderContext = parentVnode && parentVnode.context;
  2413. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  2414. vm.$scopedSlots = parentVnode
  2415. ? normalizeScopedSlots(vm.$parent, parentVnode.data.scopedSlots, vm.$slots)
  2416. : emptyObject;
  2417. // bind the createElement fn to this instance
  2418. // so that we get proper render context inside it.
  2419. // args order: tag, data, children, normalizationType, alwaysNormalize
  2420. // internal version is used by render functions compiled from templates
  2421. // @ts-expect-error
  2422. vm._c = function (a, b, c, d) { return createElement$1(vm, a, b, c, d, false); };
  2423. // normalization is always applied for the public version, used in
  2424. // user-written render functions.
  2425. // @ts-expect-error
  2426. vm.$createElement = function (a, b, c, d) { return createElement$1(vm, a, b, c, d, true); };
  2427. // $attrs & $listeners are exposed for easier HOC creation.
  2428. // they need to be reactive so that HOCs using them are always updated
  2429. var parentData = parentVnode && parentVnode.data;
  2430. /* istanbul ignore else */
  2431. {
  2432. defineReactive(vm, '$attrs', (parentData && parentData.attrs) || emptyObject, function () {
  2433. !isUpdatingChildComponent && warn$2("$attrs is readonly.", vm);
  2434. }, true);
  2435. defineReactive(vm, '$listeners', options._parentListeners || emptyObject, function () {
  2436. !isUpdatingChildComponent && warn$2("$listeners is readonly.", vm);
  2437. }, true);
  2438. }
  2439. }
  2440. var currentRenderingInstance = null;
  2441. function renderMixin(Vue) {
  2442. // install runtime convenience helpers
  2443. installRenderHelpers(Vue.prototype);
  2444. Vue.prototype.$nextTick = function (fn) {
  2445. return nextTick(fn, this);
  2446. };
  2447. Vue.prototype._render = function () {
  2448. var vm = this;
  2449. var _a = vm.$options, render = _a.render, _parentVnode = _a._parentVnode;
  2450. if (_parentVnode && vm._isMounted) {
  2451. vm.$scopedSlots = normalizeScopedSlots(vm.$parent, _parentVnode.data.scopedSlots, vm.$slots, vm.$scopedSlots);
  2452. if (vm._slotsProxy) {
  2453. syncSetupSlots(vm._slotsProxy, vm.$scopedSlots);
  2454. }
  2455. }
  2456. // set parent vnode. this allows render functions to have access
  2457. // to the data on the placeholder node.
  2458. vm.$vnode = _parentVnode;
  2459. // render self
  2460. var vnode;
  2461. try {
  2462. // There's no need to maintain a stack because all render fns are called
  2463. // separately from one another. Nested component's render fns are called
  2464. // when parent component is patched.
  2465. setCurrentInstance(vm);
  2466. currentRenderingInstance = vm;
  2467. vnode = render.call(vm._renderProxy, vm.$createElement);
  2468. }
  2469. catch (e) {
  2470. handleError(e, vm, "render");
  2471. // return error render result,
  2472. // or previous vnode to prevent render error causing blank component
  2473. /* istanbul ignore else */
  2474. if (vm.$options.renderError) {
  2475. try {
  2476. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  2477. }
  2478. catch (e) {
  2479. handleError(e, vm, "renderError");
  2480. vnode = vm._vnode;
  2481. }
  2482. }
  2483. else {
  2484. vnode = vm._vnode;
  2485. }
  2486. }
  2487. finally {
  2488. currentRenderingInstance = null;
  2489. setCurrentInstance();
  2490. }
  2491. // if the returned array contains only a single node, allow it
  2492. if (isArray(vnode) && vnode.length === 1) {
  2493. vnode = vnode[0];
  2494. }
  2495. // return empty vnode in case the render function errored out
  2496. if (!(vnode instanceof VNode)) {
  2497. if (isArray(vnode)) {
  2498. warn$2('Multiple root nodes returned from render function. Render function ' +
  2499. 'should return a single root node.', vm);
  2500. }
  2501. vnode = createEmptyVNode();
  2502. }
  2503. // set parent
  2504. vnode.parent = _parentVnode;
  2505. return vnode;
  2506. };
  2507. }
  2508. function ensureCtor(comp, base) {
  2509. if (comp.__esModule || (hasSymbol && comp[Symbol.toStringTag] === 'Module')) {
  2510. comp = comp.default;
  2511. }
  2512. return isObject(comp) ? base.extend(comp) : comp;
  2513. }
  2514. function createAsyncPlaceholder(factory, data, context, children, tag) {
  2515. var node = createEmptyVNode();
  2516. node.asyncFactory = factory;
  2517. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  2518. return node;
  2519. }
  2520. function resolveAsyncComponent(factory, baseCtor) {
  2521. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  2522. return factory.errorComp;
  2523. }
  2524. if (isDef(factory.resolved)) {
  2525. return factory.resolved;
  2526. }
  2527. var owner = currentRenderingInstance;
  2528. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  2529. // already pending
  2530. factory.owners.push(owner);
  2531. }
  2532. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  2533. return factory.loadingComp;
  2534. }
  2535. if (owner && !isDef(factory.owners)) {
  2536. var owners_1 = (factory.owners = [owner]);
  2537. var sync_1 = true;
  2538. var timerLoading_1 = null;
  2539. var timerTimeout_1 = null;
  2540. owner.$on('hook:destroyed', function () { return remove$2(owners_1, owner); });
  2541. var forceRender_1 = function (renderCompleted) {
  2542. for (var i = 0, l = owners_1.length; i < l; i++) {
  2543. owners_1[i].$forceUpdate();
  2544. }
  2545. if (renderCompleted) {
  2546. owners_1.length = 0;
  2547. if (timerLoading_1 !== null) {
  2548. clearTimeout(timerLoading_1);
  2549. timerLoading_1 = null;
  2550. }
  2551. if (timerTimeout_1 !== null) {
  2552. clearTimeout(timerTimeout_1);
  2553. timerTimeout_1 = null;
  2554. }
  2555. }
  2556. };
  2557. var resolve = once(function (res) {
  2558. // cache resolved
  2559. factory.resolved = ensureCtor(res, baseCtor);
  2560. // invoke callbacks only if this is not a synchronous resolve
  2561. // (async resolves are shimmed as synchronous during SSR)
  2562. if (!sync_1) {
  2563. forceRender_1(true);
  2564. }
  2565. else {
  2566. owners_1.length = 0;
  2567. }
  2568. });
  2569. var reject_1 = once(function (reason) {
  2570. warn$2("Failed to resolve async component: ".concat(String(factory)) +
  2571. (reason ? "\nReason: ".concat(reason) : ''));
  2572. if (isDef(factory.errorComp)) {
  2573. factory.error = true;
  2574. forceRender_1(true);
  2575. }
  2576. });
  2577. var res_1 = factory(resolve, reject_1);
  2578. if (isObject(res_1)) {
  2579. if (isPromise(res_1)) {
  2580. // () => Promise
  2581. if (isUndef(factory.resolved)) {
  2582. res_1.then(resolve, reject_1);
  2583. }
  2584. }
  2585. else if (isPromise(res_1.component)) {
  2586. res_1.component.then(resolve, reject_1);
  2587. if (isDef(res_1.error)) {
  2588. factory.errorComp = ensureCtor(res_1.error, baseCtor);
  2589. }
  2590. if (isDef(res_1.loading)) {
  2591. factory.loadingComp = ensureCtor(res_1.loading, baseCtor);
  2592. if (res_1.delay === 0) {
  2593. factory.loading = true;
  2594. }
  2595. else {
  2596. // @ts-expect-error NodeJS timeout type
  2597. timerLoading_1 = setTimeout(function () {
  2598. timerLoading_1 = null;
  2599. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  2600. factory.loading = true;
  2601. forceRender_1(false);
  2602. }
  2603. }, res_1.delay || 200);
  2604. }
  2605. }
  2606. if (isDef(res_1.timeout)) {
  2607. // @ts-expect-error NodeJS timeout type
  2608. timerTimeout_1 = setTimeout(function () {
  2609. timerTimeout_1 = null;
  2610. if (isUndef(factory.resolved)) {
  2611. reject_1("timeout (".concat(res_1.timeout, "ms)") );
  2612. }
  2613. }, res_1.timeout);
  2614. }
  2615. }
  2616. }
  2617. sync_1 = false;
  2618. // return in case resolved synchronously
  2619. return factory.loading ? factory.loadingComp : factory.resolved;
  2620. }
  2621. }
  2622. function getFirstComponentChild(children) {
  2623. if (isArray(children)) {
  2624. for (var i = 0; i < children.length; i++) {
  2625. var c = children[i];
  2626. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  2627. return c;
  2628. }
  2629. }
  2630. }
  2631. }
  2632. function initEvents(vm) {
  2633. vm._events = Object.create(null);
  2634. vm._hasHookEvent = false;
  2635. // init parent attached events
  2636. var listeners = vm.$options._parentListeners;
  2637. if (listeners) {
  2638. updateComponentListeners(vm, listeners);
  2639. }
  2640. }
  2641. var target$1;
  2642. function add$1(event, fn) {
  2643. target$1.$on(event, fn);
  2644. }
  2645. function remove$1(event, fn) {
  2646. target$1.$off(event, fn);
  2647. }
  2648. function createOnceHandler$1(event, fn) {
  2649. var _target = target$1;
  2650. return function onceHandler() {
  2651. var res = fn.apply(null, arguments);
  2652. if (res !== null) {
  2653. _target.$off(event, onceHandler);
  2654. }
  2655. };
  2656. }
  2657. function updateComponentListeners(vm, listeners, oldListeners) {
  2658. target$1 = vm;
  2659. updateListeners(listeners, oldListeners || {}, add$1, remove$1, createOnceHandler$1, vm);
  2660. target$1 = undefined;
  2661. }
  2662. function eventsMixin(Vue) {
  2663. var hookRE = /^hook:/;
  2664. Vue.prototype.$on = function (event, fn) {
  2665. var vm = this;
  2666. if (isArray(event)) {
  2667. for (var i = 0, l = event.length; i < l; i++) {
  2668. vm.$on(event[i], fn);
  2669. }
  2670. }
  2671. else {
  2672. (vm._events[event] || (vm._events[event] = [])).push(fn);
  2673. // optimize hook:event cost by using a boolean flag marked at registration
  2674. // instead of a hash lookup
  2675. if (hookRE.test(event)) {
  2676. vm._hasHookEvent = true;
  2677. }
  2678. }
  2679. return vm;
  2680. };
  2681. Vue.prototype.$once = function (event, fn) {
  2682. var vm = this;
  2683. function on() {
  2684. vm.$off(event, on);
  2685. fn.apply(vm, arguments);
  2686. }
  2687. on.fn = fn;
  2688. vm.$on(event, on);
  2689. return vm;
  2690. };
  2691. Vue.prototype.$off = function (event, fn) {
  2692. var vm = this;
  2693. // all
  2694. if (!arguments.length) {
  2695. vm._events = Object.create(null);
  2696. return vm;
  2697. }
  2698. // array of events
  2699. if (isArray(event)) {
  2700. for (var i_1 = 0, l = event.length; i_1 < l; i_1++) {
  2701. vm.$off(event[i_1], fn);
  2702. }
  2703. return vm;
  2704. }
  2705. // specific event
  2706. var cbs = vm._events[event];
  2707. if (!cbs) {
  2708. return vm;
  2709. }
  2710. if (!fn) {
  2711. vm._events[event] = null;
  2712. return vm;
  2713. }
  2714. // specific handler
  2715. var cb;
  2716. var i = cbs.length;
  2717. while (i--) {
  2718. cb = cbs[i];
  2719. if (cb === fn || cb.fn === fn) {
  2720. cbs.splice(i, 1);
  2721. break;
  2722. }
  2723. }
  2724. return vm;
  2725. };
  2726. Vue.prototype.$emit = function (event) {
  2727. var vm = this;
  2728. {
  2729. var lowerCaseEvent = event.toLowerCase();
  2730. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  2731. tip("Event \"".concat(lowerCaseEvent, "\" is emitted in component ") +
  2732. "".concat(formatComponentName(vm), " but the handler is registered for \"").concat(event, "\". ") +
  2733. "Note that HTML attributes are case-insensitive and you cannot use " +
  2734. "v-on to listen to camelCase events when using in-DOM templates. " +
  2735. "You should probably use \"".concat(hyphenate(event), "\" instead of \"").concat(event, "\"."));
  2736. }
  2737. }
  2738. var cbs = vm._events[event];
  2739. if (cbs) {
  2740. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  2741. var args = toArray(arguments, 1);
  2742. var info = "event handler for \"".concat(event, "\"");
  2743. for (var i = 0, l = cbs.length; i < l; i++) {
  2744. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  2745. }
  2746. }
  2747. return vm;
  2748. };
  2749. }
  2750. var activeEffectScope;
  2751. var EffectScope = /** @class */ (function () {
  2752. function EffectScope(detached) {
  2753. if (detached === void 0) { detached = false; }
  2754. this.detached = detached;
  2755. /**
  2756. * @internal
  2757. */
  2758. this.active = true;
  2759. /**
  2760. * @internal
  2761. */
  2762. this.effects = [];
  2763. /**
  2764. * @internal
  2765. */
  2766. this.cleanups = [];
  2767. this.parent = activeEffectScope;
  2768. if (!detached && activeEffectScope) {
  2769. this.index =
  2770. (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(this) - 1;
  2771. }
  2772. }
  2773. EffectScope.prototype.run = function (fn) {
  2774. if (this.active) {
  2775. var currentEffectScope = activeEffectScope;
  2776. try {
  2777. activeEffectScope = this;
  2778. return fn();
  2779. }
  2780. finally {
  2781. activeEffectScope = currentEffectScope;
  2782. }
  2783. }
  2784. else {
  2785. warn$2("cannot run an inactive effect scope.");
  2786. }
  2787. };
  2788. /**
  2789. * This should only be called on non-detached scopes
  2790. * @internal
  2791. */
  2792. EffectScope.prototype.on = function () {
  2793. activeEffectScope = this;
  2794. };
  2795. /**
  2796. * This should only be called on non-detached scopes
  2797. * @internal
  2798. */
  2799. EffectScope.prototype.off = function () {
  2800. activeEffectScope = this.parent;
  2801. };
  2802. EffectScope.prototype.stop = function (fromParent) {
  2803. if (this.active) {
  2804. var i = void 0, l = void 0;
  2805. for (i = 0, l = this.effects.length; i < l; i++) {
  2806. this.effects[i].teardown();
  2807. }
  2808. for (i = 0, l = this.cleanups.length; i < l; i++) {
  2809. this.cleanups[i]();
  2810. }
  2811. if (this.scopes) {
  2812. for (i = 0, l = this.scopes.length; i < l; i++) {
  2813. this.scopes[i].stop(true);
  2814. }
  2815. }
  2816. // nested scope, dereference from parent to avoid memory leaks
  2817. if (!this.detached && this.parent && !fromParent) {
  2818. // optimized O(1) removal
  2819. var last = this.parent.scopes.pop();
  2820. if (last && last !== this) {
  2821. this.parent.scopes[this.index] = last;
  2822. last.index = this.index;
  2823. }
  2824. }
  2825. this.parent = undefined;
  2826. this.active = false;
  2827. }
  2828. };
  2829. return EffectScope;
  2830. }());
  2831. function effectScope(detached) {
  2832. return new EffectScope(detached);
  2833. }
  2834. /**
  2835. * @internal
  2836. */
  2837. function recordEffectScope(effect, scope) {
  2838. if (scope === void 0) { scope = activeEffectScope; }
  2839. if (scope && scope.active) {
  2840. scope.effects.push(effect);
  2841. }
  2842. }
  2843. function getCurrentScope() {
  2844. return activeEffectScope;
  2845. }
  2846. function onScopeDispose(fn) {
  2847. if (activeEffectScope) {
  2848. activeEffectScope.cleanups.push(fn);
  2849. }
  2850. else {
  2851. warn$2("onScopeDispose() is called when there is no active effect scope" +
  2852. " to be associated with.");
  2853. }
  2854. }
  2855. var activeInstance = null;
  2856. var isUpdatingChildComponent = false;
  2857. function setActiveInstance(vm) {
  2858. var prevActiveInstance = activeInstance;
  2859. activeInstance = vm;
  2860. return function () {
  2861. activeInstance = prevActiveInstance;
  2862. };
  2863. }
  2864. function initLifecycle(vm) {
  2865. var options = vm.$options;
  2866. // locate first non-abstract parent
  2867. var parent = options.parent;
  2868. if (parent && !options.abstract) {
  2869. while (parent.$options.abstract && parent.$parent) {
  2870. parent = parent.$parent;
  2871. }
  2872. parent.$children.push(vm);
  2873. }
  2874. vm.$parent = parent;
  2875. vm.$root = parent ? parent.$root : vm;
  2876. vm.$children = [];
  2877. vm.$refs = {};
  2878. vm._provided = parent ? parent._provided : Object.create(null);
  2879. vm._watcher = null;
  2880. vm._inactive = null;
  2881. vm._directInactive = false;
  2882. vm._isMounted = false;
  2883. vm._isDestroyed = false;
  2884. vm._isBeingDestroyed = false;
  2885. }
  2886. function lifecycleMixin(Vue) {
  2887. Vue.prototype._update = function (vnode, hydrating) {
  2888. var vm = this;
  2889. var prevEl = vm.$el;
  2890. var prevVnode = vm._vnode;
  2891. var restoreActiveInstance = setActiveInstance(vm);
  2892. vm._vnode = vnode;
  2893. // Vue.prototype.__patch__ is injected in entry points
  2894. // based on the rendering backend used.
  2895. if (!prevVnode) {
  2896. // initial render
  2897. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  2898. }
  2899. else {
  2900. // updates
  2901. vm.$el = vm.__patch__(prevVnode, vnode);
  2902. }
  2903. restoreActiveInstance();
  2904. // update __vue__ reference
  2905. if (prevEl) {
  2906. prevEl.__vue__ = null;
  2907. }
  2908. if (vm.$el) {
  2909. vm.$el.__vue__ = vm;
  2910. }
  2911. // if parent is an HOC, update its $el as well
  2912. var wrapper = vm;
  2913. while (wrapper &&
  2914. wrapper.$vnode &&
  2915. wrapper.$parent &&
  2916. wrapper.$vnode === wrapper.$parent._vnode) {
  2917. wrapper.$parent.$el = wrapper.$el;
  2918. wrapper = wrapper.$parent;
  2919. }
  2920. // updated hook is called by the scheduler to ensure that children are
  2921. // updated in a parent's updated hook.
  2922. };
  2923. Vue.prototype.$forceUpdate = function () {
  2924. var vm = this;
  2925. if (vm._watcher) {
  2926. vm._watcher.update();
  2927. }
  2928. };
  2929. Vue.prototype.$destroy = function () {
  2930. var vm = this;
  2931. if (vm._isBeingDestroyed) {
  2932. return;
  2933. }
  2934. callHook$1(vm, 'beforeDestroy');
  2935. vm._isBeingDestroyed = true;
  2936. // remove self from parent
  2937. var parent = vm.$parent;
  2938. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  2939. remove$2(parent.$children, vm);
  2940. }
  2941. // teardown scope. this includes both the render watcher and other
  2942. // watchers created
  2943. vm._scope.stop();
  2944. // remove reference from data ob
  2945. // frozen object may not have observer.
  2946. if (vm._data.__ob__) {
  2947. vm._data.__ob__.vmCount--;
  2948. }
  2949. // call the last hook...
  2950. vm._isDestroyed = true;
  2951. // invoke destroy hooks on current rendered tree
  2952. vm.__patch__(vm._vnode, null);
  2953. // fire destroyed hook
  2954. callHook$1(vm, 'destroyed');
  2955. // turn off all instance listeners.
  2956. vm.$off();
  2957. // remove __vue__ reference
  2958. if (vm.$el) {
  2959. vm.$el.__vue__ = null;
  2960. }
  2961. // release circular reference (#6759)
  2962. if (vm.$vnode) {
  2963. vm.$vnode.parent = null;
  2964. }
  2965. };
  2966. }
  2967. function mountComponent(vm, el, hydrating) {
  2968. vm.$el = el;
  2969. if (!vm.$options.render) {
  2970. // @ts-expect-error invalid type
  2971. vm.$options.render = createEmptyVNode;
  2972. {
  2973. /* istanbul ignore if */
  2974. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  2975. vm.$options.el ||
  2976. el) {
  2977. warn$2('You are using the runtime-only build of Vue where the template ' +
  2978. 'compiler is not available. Either pre-compile the templates into ' +
  2979. 'render functions, or use the compiler-included build.', vm);
  2980. }
  2981. else {
  2982. warn$2('Failed to mount component: template or render function not defined.', vm);
  2983. }
  2984. }
  2985. }
  2986. callHook$1(vm, 'beforeMount');
  2987. var updateComponent;
  2988. /* istanbul ignore if */
  2989. if (config.performance && mark) {
  2990. updateComponent = function () {
  2991. var name = vm._name;
  2992. var id = vm._uid;
  2993. var startTag = "vue-perf-start:".concat(id);
  2994. var endTag = "vue-perf-end:".concat(id);
  2995. mark(startTag);
  2996. var vnode = vm._render();
  2997. mark(endTag);
  2998. measure("vue ".concat(name, " render"), startTag, endTag);
  2999. mark(startTag);
  3000. vm._update(vnode, hydrating);
  3001. mark(endTag);
  3002. measure("vue ".concat(name, " patch"), startTag, endTag);
  3003. };
  3004. }
  3005. else {
  3006. updateComponent = function () {
  3007. vm._update(vm._render(), hydrating);
  3008. };
  3009. }
  3010. var watcherOptions = {
  3011. before: function () {
  3012. if (vm._isMounted && !vm._isDestroyed) {
  3013. callHook$1(vm, 'beforeUpdate');
  3014. }
  3015. }
  3016. };
  3017. {
  3018. watcherOptions.onTrack = function (e) { return callHook$1(vm, 'renderTracked', [e]); };
  3019. watcherOptions.onTrigger = function (e) { return callHook$1(vm, 'renderTriggered', [e]); };
  3020. }
  3021. // we set this to vm._watcher inside the watcher's constructor
  3022. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  3023. // component's mounted hook), which relies on vm._watcher being already defined
  3024. new Watcher(vm, updateComponent, noop, watcherOptions, true /* isRenderWatcher */);
  3025. hydrating = false;
  3026. // flush buffer for flush: "pre" watchers queued in setup()
  3027. var preWatchers = vm._preWatchers;
  3028. if (preWatchers) {
  3029. for (var i = 0; i < preWatchers.length; i++) {
  3030. preWatchers[i].run();
  3031. }
  3032. }
  3033. // manually mounted instance, call mounted on self
  3034. // mounted is called for render-created child components in its inserted hook
  3035. if (vm.$vnode == null) {
  3036. vm._isMounted = true;
  3037. callHook$1(vm, 'mounted');
  3038. }
  3039. return vm;
  3040. }
  3041. function updateChildComponent(vm, propsData, listeners, parentVnode, renderChildren) {
  3042. {
  3043. isUpdatingChildComponent = true;
  3044. }
  3045. // determine whether component has slot children
  3046. // we need to do this before overwriting $options._renderChildren.
  3047. // check if there are dynamic scopedSlots (hand-written or compiled but with
  3048. // dynamic slot names). Static scoped slots compiled from template has the
  3049. // "$stable" marker.
  3050. var newScopedSlots = parentVnode.data.scopedSlots;
  3051. var oldScopedSlots = vm.$scopedSlots;
  3052. var hasDynamicScopedSlot = !!((newScopedSlots && !newScopedSlots.$stable) ||
  3053. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  3054. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key) ||
  3055. (!newScopedSlots && vm.$scopedSlots.$key));
  3056. // Any static slot children from the parent may have changed during parent's
  3057. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  3058. // update is necessary to ensure correctness.
  3059. var needsForceUpdate = !!(renderChildren || // has new static slots
  3060. vm.$options._renderChildren || // has old static slots
  3061. hasDynamicScopedSlot);
  3062. var prevVNode = vm.$vnode;
  3063. vm.$options._parentVnode = parentVnode;
  3064. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  3065. if (vm._vnode) {
  3066. // update child tree's parent
  3067. vm._vnode.parent = parentVnode;
  3068. }
  3069. vm.$options._renderChildren = renderChildren;
  3070. // update $attrs and $listeners hash
  3071. // these are also reactive so they may trigger child update if the child
  3072. // used them during render
  3073. var attrs = parentVnode.data.attrs || emptyObject;
  3074. if (vm._attrsProxy) {
  3075. // force update if attrs are accessed and has changed since it may be
  3076. // passed to a child component.
  3077. if (syncSetupProxy(vm._attrsProxy, attrs, (prevVNode.data && prevVNode.data.attrs) || emptyObject, vm, '$attrs')) {
  3078. needsForceUpdate = true;
  3079. }
  3080. }
  3081. vm.$attrs = attrs;
  3082. // update listeners
  3083. listeners = listeners || emptyObject;
  3084. var prevListeners = vm.$options._parentListeners;
  3085. if (vm._listenersProxy) {
  3086. syncSetupProxy(vm._listenersProxy, listeners, prevListeners || emptyObject, vm, '$listeners');
  3087. }
  3088. vm.$listeners = vm.$options._parentListeners = listeners;
  3089. updateComponentListeners(vm, listeners, prevListeners);
  3090. // update props
  3091. if (propsData && vm.$options.props) {
  3092. toggleObserving(false);
  3093. var props = vm._props;
  3094. var propKeys = vm.$options._propKeys || [];
  3095. for (var i = 0; i < propKeys.length; i++) {
  3096. var key = propKeys[i];
  3097. var propOptions = vm.$options.props; // wtf flow?
  3098. props[key] = validateProp(key, propOptions, propsData, vm);
  3099. }
  3100. toggleObserving(true);
  3101. // keep a copy of raw propsData
  3102. vm.$options.propsData = propsData;
  3103. }
  3104. // resolve slots + force update if has children
  3105. if (needsForceUpdate) {
  3106. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  3107. vm.$forceUpdate();
  3108. }
  3109. {
  3110. isUpdatingChildComponent = false;
  3111. }
  3112. }
  3113. function isInInactiveTree(vm) {
  3114. while (vm && (vm = vm.$parent)) {
  3115. if (vm._inactive)
  3116. return true;
  3117. }
  3118. return false;
  3119. }
  3120. function activateChildComponent(vm, direct) {
  3121. if (direct) {
  3122. vm._directInactive = false;
  3123. if (isInInactiveTree(vm)) {
  3124. return;
  3125. }
  3126. }
  3127. else if (vm._directInactive) {
  3128. return;
  3129. }
  3130. if (vm._inactive || vm._inactive === null) {
  3131. vm._inactive = false;
  3132. for (var i = 0; i < vm.$children.length; i++) {
  3133. activateChildComponent(vm.$children[i]);
  3134. }
  3135. callHook$1(vm, 'activated');
  3136. }
  3137. }
  3138. function deactivateChildComponent(vm, direct) {
  3139. if (direct) {
  3140. vm._directInactive = true;
  3141. if (isInInactiveTree(vm)) {
  3142. return;
  3143. }
  3144. }
  3145. if (!vm._inactive) {
  3146. vm._inactive = true;
  3147. for (var i = 0; i < vm.$children.length; i++) {
  3148. deactivateChildComponent(vm.$children[i]);
  3149. }
  3150. callHook$1(vm, 'deactivated');
  3151. }
  3152. }
  3153. function callHook$1(vm, hook, args, setContext) {
  3154. if (setContext === void 0) { setContext = true; }
  3155. // #7573 disable dep collection when invoking lifecycle hooks
  3156. pushTarget();
  3157. var prevInst = currentInstance;
  3158. var prevScope = getCurrentScope();
  3159. setContext && setCurrentInstance(vm);
  3160. var handlers = vm.$options[hook];
  3161. var info = "".concat(hook, " hook");
  3162. if (handlers) {
  3163. for (var i = 0, j = handlers.length; i < j; i++) {
  3164. invokeWithErrorHandling(handlers[i], vm, args || null, vm, info);
  3165. }
  3166. }
  3167. if (vm._hasHookEvent) {
  3168. vm.$emit('hook:' + hook);
  3169. }
  3170. if (setContext) {
  3171. setCurrentInstance(prevInst);
  3172. prevScope && prevScope.on();
  3173. }
  3174. popTarget();
  3175. }
  3176. var MAX_UPDATE_COUNT = 100;
  3177. var queue = [];
  3178. var activatedChildren = [];
  3179. var has = {};
  3180. var circular = {};
  3181. var waiting = false;
  3182. var flushing = false;
  3183. var index$1 = 0;
  3184. /**
  3185. * Reset the scheduler's state.
  3186. */
  3187. function resetSchedulerState() {
  3188. index$1 = queue.length = activatedChildren.length = 0;
  3189. has = {};
  3190. {
  3191. circular = {};
  3192. }
  3193. waiting = flushing = false;
  3194. }
  3195. // Async edge case #6566 requires saving the timestamp when event listeners are
  3196. // attached. However, calling performance.now() has a perf overhead especially
  3197. // if the page has thousands of event listeners. Instead, we take a timestamp
  3198. // every time the scheduler flushes and use that for all event listeners
  3199. // attached during that flush.
  3200. var currentFlushTimestamp = 0;
  3201. // Async edge case fix requires storing an event listener's attach timestamp.
  3202. var getNow = Date.now;
  3203. // Determine what event timestamp the browser is using. Annoyingly, the
  3204. // timestamp can either be hi-res (relative to page load) or low-res
  3205. // (relative to UNIX epoch), so in order to compare time we have to use the
  3206. // same timestamp type when saving the flush timestamp.
  3207. // All IE versions use low-res event timestamps, and have problematic clock
  3208. // implementations (#9632)
  3209. if (inBrowser && !isIE) {
  3210. var performance_1 = window.performance;
  3211. if (performance_1 &&
  3212. typeof performance_1.now === 'function' &&
  3213. getNow() > document.createEvent('Event').timeStamp) {
  3214. // if the event timestamp, although evaluated AFTER the Date.now(), is
  3215. // smaller than it, it means the event is using a hi-res timestamp,
  3216. // and we need to use the hi-res version for event listener timestamps as
  3217. // well.
  3218. getNow = function () { return performance_1.now(); };
  3219. }
  3220. }
  3221. var sortCompareFn = function (a, b) {
  3222. if (a.post) {
  3223. if (!b.post)
  3224. return 1;
  3225. }
  3226. else if (b.post) {
  3227. return -1;
  3228. }
  3229. return a.id - b.id;
  3230. };
  3231. /**
  3232. * Flush both queues and run the watchers.
  3233. */
  3234. function flushSchedulerQueue() {
  3235. currentFlushTimestamp = getNow();
  3236. flushing = true;
  3237. var watcher, id;
  3238. // Sort queue before flush.
  3239. // This ensures that:
  3240. // 1. Components are updated from parent to child. (because parent is always
  3241. // created before the child)
  3242. // 2. A component's user watchers are run before its render watcher (because
  3243. // user watchers are created before the render watcher)
  3244. // 3. If a component is destroyed during a parent component's watcher run,
  3245. // its watchers can be skipped.
  3246. queue.sort(sortCompareFn);
  3247. // do not cache length because more watchers might be pushed
  3248. // as we run existing watchers
  3249. for (index$1 = 0; index$1 < queue.length; index$1++) {
  3250. watcher = queue[index$1];
  3251. if (watcher.before) {
  3252. watcher.before();
  3253. }
  3254. id = watcher.id;
  3255. has[id] = null;
  3256. watcher.run();
  3257. // in dev build, check and stop circular updates.
  3258. if (has[id] != null) {
  3259. circular[id] = (circular[id] || 0) + 1;
  3260. if (circular[id] > MAX_UPDATE_COUNT) {
  3261. warn$2('You may have an infinite update loop ' +
  3262. (watcher.user
  3263. ? "in watcher with expression \"".concat(watcher.expression, "\"")
  3264. : "in a component render function."), watcher.vm);
  3265. break;
  3266. }
  3267. }
  3268. }
  3269. // keep copies of post queues before resetting state
  3270. var activatedQueue = activatedChildren.slice();
  3271. var updatedQueue = queue.slice();
  3272. resetSchedulerState();
  3273. // call component updated and activated hooks
  3274. callActivatedHooks(activatedQueue);
  3275. callUpdatedHooks(updatedQueue);
  3276. cleanupDeps();
  3277. // devtool hook
  3278. /* istanbul ignore if */
  3279. if (devtools && config.devtools) {
  3280. devtools.emit('flush');
  3281. }
  3282. }
  3283. function callUpdatedHooks(queue) {
  3284. var i = queue.length;
  3285. while (i--) {
  3286. var watcher = queue[i];
  3287. var vm = watcher.vm;
  3288. if (vm && vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  3289. callHook$1(vm, 'updated');
  3290. }
  3291. }
  3292. }
  3293. /**
  3294. * Queue a kept-alive component that was activated during patch.
  3295. * The queue will be processed after the entire tree has been patched.
  3296. */
  3297. function queueActivatedComponent(vm) {
  3298. // setting _inactive to false here so that a render function can
  3299. // rely on checking whether it's in an inactive tree (e.g. router-view)
  3300. vm._inactive = false;
  3301. activatedChildren.push(vm);
  3302. }
  3303. function callActivatedHooks(queue) {
  3304. for (var i = 0; i < queue.length; i++) {
  3305. queue[i]._inactive = true;
  3306. activateChildComponent(queue[i], true /* true */);
  3307. }
  3308. }
  3309. /**
  3310. * Push a watcher into the watcher queue.
  3311. * Jobs with duplicate IDs will be skipped unless it's
  3312. * pushed when the queue is being flushed.
  3313. */
  3314. function queueWatcher(watcher) {
  3315. var id = watcher.id;
  3316. if (has[id] != null) {
  3317. return;
  3318. }
  3319. if (watcher === Dep.target && watcher.noRecurse) {
  3320. return;
  3321. }
  3322. has[id] = true;
  3323. if (!flushing) {
  3324. queue.push(watcher);
  3325. }
  3326. else {
  3327. // if already flushing, splice the watcher based on its id
  3328. // if already past its id, it will be run next immediately.
  3329. var i = queue.length - 1;
  3330. while (i > index$1 && queue[i].id > watcher.id) {
  3331. i--;
  3332. }
  3333. queue.splice(i + 1, 0, watcher);
  3334. }
  3335. // queue the flush
  3336. if (!waiting) {
  3337. waiting = true;
  3338. if (!config.async) {
  3339. flushSchedulerQueue();
  3340. return;
  3341. }
  3342. nextTick(flushSchedulerQueue);
  3343. }
  3344. }
  3345. var WATCHER = "watcher";
  3346. var WATCHER_CB = "".concat(WATCHER, " callback");
  3347. var WATCHER_GETTER = "".concat(WATCHER, " getter");
  3348. var WATCHER_CLEANUP = "".concat(WATCHER, " cleanup");
  3349. // Simple effect.
  3350. function watchEffect(effect, options) {
  3351. return doWatch(effect, null, options);
  3352. }
  3353. function watchPostEffect(effect, options) {
  3354. return doWatch(effect, null, (__assign(__assign({}, options), { flush: 'post' }) ));
  3355. }
  3356. function watchSyncEffect(effect, options) {
  3357. return doWatch(effect, null, (__assign(__assign({}, options), { flush: 'sync' }) ));
  3358. }
  3359. // initial value for watchers to trigger on undefined initial values
  3360. var INITIAL_WATCHER_VALUE = {};
  3361. // implementation
  3362. function watch(source, cb, options) {
  3363. if (typeof cb !== 'function') {
  3364. warn$2("`watch(fn, options?)` signature has been moved to a separate API. " +
  3365. "Use `watchEffect(fn, options?)` instead. `watch` now only " +
  3366. "supports `watch(source, cb, options?) signature.");
  3367. }
  3368. return doWatch(source, cb, options);
  3369. }
  3370. function doWatch(source, cb, _a) {
  3371. 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;
  3372. if (!cb) {
  3373. if (immediate !== undefined) {
  3374. warn$2("watch() \"immediate\" option is only respected when using the " +
  3375. "watch(source, callback, options?) signature.");
  3376. }
  3377. if (deep !== undefined) {
  3378. warn$2("watch() \"deep\" option is only respected when using the " +
  3379. "watch(source, callback, options?) signature.");
  3380. }
  3381. }
  3382. var warnInvalidSource = function (s) {
  3383. warn$2("Invalid watch source: ".concat(s, ". A watch source can only be a getter/effect ") +
  3384. "function, a ref, a reactive object, or an array of these types.");
  3385. };
  3386. var instance = currentInstance;
  3387. var call = function (fn, type, args) {
  3388. if (args === void 0) { args = null; }
  3389. return invokeWithErrorHandling(fn, null, args, instance, type);
  3390. };
  3391. var getter;
  3392. var forceTrigger = false;
  3393. var isMultiSource = false;
  3394. if (isRef(source)) {
  3395. getter = function () { return source.value; };
  3396. forceTrigger = isShallow(source);
  3397. }
  3398. else if (isReactive(source)) {
  3399. getter = function () {
  3400. source.__ob__.dep.depend();
  3401. return source;
  3402. };
  3403. deep = true;
  3404. }
  3405. else if (isArray(source)) {
  3406. isMultiSource = true;
  3407. forceTrigger = source.some(function (s) { return isReactive(s) || isShallow(s); });
  3408. getter = function () {
  3409. return source.map(function (s) {
  3410. if (isRef(s)) {
  3411. return s.value;
  3412. }
  3413. else if (isReactive(s)) {
  3414. return traverse(s);
  3415. }
  3416. else if (isFunction(s)) {
  3417. return call(s, WATCHER_GETTER);
  3418. }
  3419. else {
  3420. warnInvalidSource(s);
  3421. }
  3422. });
  3423. };
  3424. }
  3425. else if (isFunction(source)) {
  3426. if (cb) {
  3427. // getter with cb
  3428. getter = function () { return call(source, WATCHER_GETTER); };
  3429. }
  3430. else {
  3431. // no cb -> simple effect
  3432. getter = function () {
  3433. if (instance && instance._isDestroyed) {
  3434. return;
  3435. }
  3436. if (cleanup) {
  3437. cleanup();
  3438. }
  3439. return call(source, WATCHER, [onCleanup]);
  3440. };
  3441. }
  3442. }
  3443. else {
  3444. getter = noop;
  3445. warnInvalidSource(source);
  3446. }
  3447. if (cb && deep) {
  3448. var baseGetter_1 = getter;
  3449. getter = function () { return traverse(baseGetter_1()); };
  3450. }
  3451. var cleanup;
  3452. var onCleanup = function (fn) {
  3453. cleanup = watcher.onStop = function () {
  3454. call(fn, WATCHER_CLEANUP);
  3455. };
  3456. };
  3457. // in SSR there is no need to setup an actual effect, and it should be noop
  3458. // unless it's eager
  3459. if (isServerRendering()) {
  3460. // we will also not call the invalidate callback (+ runner is not set up)
  3461. onCleanup = noop;
  3462. if (!cb) {
  3463. getter();
  3464. }
  3465. else if (immediate) {
  3466. call(cb, WATCHER_CB, [
  3467. getter(),
  3468. isMultiSource ? [] : undefined,
  3469. onCleanup
  3470. ]);
  3471. }
  3472. return noop;
  3473. }
  3474. var watcher = new Watcher(currentInstance, getter, noop, {
  3475. lazy: true
  3476. });
  3477. watcher.noRecurse = !cb;
  3478. var oldValue = isMultiSource ? [] : INITIAL_WATCHER_VALUE;
  3479. // overwrite default run
  3480. watcher.run = function () {
  3481. if (!watcher.active) {
  3482. return;
  3483. }
  3484. if (cb) {
  3485. // watch(source, cb)
  3486. var newValue = watcher.get();
  3487. if (deep ||
  3488. forceTrigger ||
  3489. (isMultiSource
  3490. ? newValue.some(function (v, i) {
  3491. return hasChanged(v, oldValue[i]);
  3492. })
  3493. : hasChanged(newValue, oldValue))) {
  3494. // cleanup before running cb again
  3495. if (cleanup) {
  3496. cleanup();
  3497. }
  3498. call(cb, WATCHER_CB, [
  3499. newValue,
  3500. // pass undefined as the old value when it's changed for the first time
  3501. oldValue === INITIAL_WATCHER_VALUE ? undefined : oldValue,
  3502. onCleanup
  3503. ]);
  3504. oldValue = newValue;
  3505. }
  3506. }
  3507. else {
  3508. // watchEffect
  3509. watcher.get();
  3510. }
  3511. };
  3512. if (flush === 'sync') {
  3513. watcher.update = watcher.run;
  3514. }
  3515. else if (flush === 'post') {
  3516. watcher.post = true;
  3517. watcher.update = function () { return queueWatcher(watcher); };
  3518. }
  3519. else {
  3520. // pre
  3521. watcher.update = function () {
  3522. if (instance && instance === currentInstance && !instance._isMounted) {
  3523. // pre-watcher triggered before
  3524. var buffer = instance._preWatchers || (instance._preWatchers = []);
  3525. if (buffer.indexOf(watcher) < 0)
  3526. buffer.push(watcher);
  3527. }
  3528. else {
  3529. queueWatcher(watcher);
  3530. }
  3531. };
  3532. }
  3533. {
  3534. watcher.onTrack = onTrack;
  3535. watcher.onTrigger = onTrigger;
  3536. }
  3537. // initial run
  3538. if (cb) {
  3539. if (immediate) {
  3540. watcher.run();
  3541. }
  3542. else {
  3543. oldValue = watcher.get();
  3544. }
  3545. }
  3546. else if (flush === 'post' && instance) {
  3547. instance.$once('hook:mounted', function () { return watcher.get(); });
  3548. }
  3549. else {
  3550. watcher.get();
  3551. }
  3552. return function () {
  3553. watcher.teardown();
  3554. };
  3555. }
  3556. function provide(key, value) {
  3557. if (!currentInstance) {
  3558. {
  3559. warn$2("provide() can only be used inside setup().");
  3560. }
  3561. }
  3562. else {
  3563. // TS doesn't allow symbol as index type
  3564. resolveProvided(currentInstance)[key] = value;
  3565. }
  3566. }
  3567. function resolveProvided(vm) {
  3568. // by default an instance inherits its parent's provides object
  3569. // but when it needs to provide values of its own, it creates its
  3570. // own provides object using parent provides object as prototype.
  3571. // this way in `inject` we can simply look up injections from direct
  3572. // parent and let the prototype chain do the work.
  3573. var existing = vm._provided;
  3574. var parentProvides = vm.$parent && vm.$parent._provided;
  3575. if (parentProvides === existing) {
  3576. return (vm._provided = Object.create(parentProvides));
  3577. }
  3578. else {
  3579. return existing;
  3580. }
  3581. }
  3582. function inject(key, defaultValue, treatDefaultAsFactory) {
  3583. if (treatDefaultAsFactory === void 0) { treatDefaultAsFactory = false; }
  3584. // fallback to `currentRenderingInstance` so that this can be called in
  3585. // a functional component
  3586. var instance = currentInstance;
  3587. if (instance) {
  3588. // #2400
  3589. // to support `app.use` plugins,
  3590. // fallback to appContext's `provides` if the instance is at root
  3591. var provides = instance.$parent && instance.$parent._provided;
  3592. if (provides && key in provides) {
  3593. // TS doesn't allow symbol as index type
  3594. return provides[key];
  3595. }
  3596. else if (arguments.length > 1) {
  3597. return treatDefaultAsFactory && isFunction(defaultValue)
  3598. ? defaultValue.call(instance)
  3599. : defaultValue;
  3600. }
  3601. else {
  3602. warn$2("injection \"".concat(String(key), "\" not found."));
  3603. }
  3604. }
  3605. else {
  3606. warn$2("inject() can only be used inside setup() or functional components.");
  3607. }
  3608. }
  3609. /**
  3610. * @internal this function needs manual public type declaration because it relies
  3611. * on previously manually authored types from Vue 2
  3612. */
  3613. function h(type, props, children) {
  3614. if (!currentInstance) {
  3615. warn$2("globally imported h() can only be invoked when there is an active " +
  3616. "component instance, e.g. synchronously in a component's render or setup function.");
  3617. }
  3618. return createElement$1(currentInstance, type, props, children, 2, true);
  3619. }
  3620. function handleError(err, vm, info) {
  3621. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  3622. // See: https://github.com/vuejs/vuex/issues/1505
  3623. pushTarget();
  3624. try {
  3625. if (vm) {
  3626. var cur = vm;
  3627. while ((cur = cur.$parent)) {
  3628. var hooks = cur.$options.errorCaptured;
  3629. if (hooks) {
  3630. for (var i = 0; i < hooks.length; i++) {
  3631. try {
  3632. var capture = hooks[i].call(cur, err, vm, info) === false;
  3633. if (capture)
  3634. return;
  3635. }
  3636. catch (e) {
  3637. globalHandleError(e, cur, 'errorCaptured hook');
  3638. }
  3639. }
  3640. }
  3641. }
  3642. }
  3643. globalHandleError(err, vm, info);
  3644. }
  3645. finally {
  3646. popTarget();
  3647. }
  3648. }
  3649. function invokeWithErrorHandling(handler, context, args, vm, info) {
  3650. var res;
  3651. try {
  3652. res = args ? handler.apply(context, args) : handler.call(context);
  3653. if (res && !res._isVue && isPromise(res) && !res._handled) {
  3654. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  3655. res._handled = true;
  3656. }
  3657. }
  3658. catch (e) {
  3659. handleError(e, vm, info);
  3660. }
  3661. return res;
  3662. }
  3663. function globalHandleError(err, vm, info) {
  3664. if (config.errorHandler) {
  3665. try {
  3666. return config.errorHandler.call(null, err, vm, info);
  3667. }
  3668. catch (e) {
  3669. // if the user intentionally throws the original error in the handler,
  3670. // do not log it twice
  3671. if (e !== err) {
  3672. logError(e, null, 'config.errorHandler');
  3673. }
  3674. }
  3675. }
  3676. logError(err, vm, info);
  3677. }
  3678. function logError(err, vm, info) {
  3679. {
  3680. warn$2("Error in ".concat(info, ": \"").concat(err.toString(), "\""), vm);
  3681. }
  3682. /* istanbul ignore else */
  3683. if (inBrowser && typeof console !== 'undefined') {
  3684. console.error(err);
  3685. }
  3686. else {
  3687. throw err;
  3688. }
  3689. }
  3690. /* globals MutationObserver */
  3691. var isUsingMicroTask = false;
  3692. var callbacks = [];
  3693. var pending = false;
  3694. function flushCallbacks() {
  3695. pending = false;
  3696. var copies = callbacks.slice(0);
  3697. callbacks.length = 0;
  3698. for (var i = 0; i < copies.length; i++) {
  3699. copies[i]();
  3700. }
  3701. }
  3702. // Here we have async deferring wrappers using microtasks.
  3703. // In 2.5 we used (macro) tasks (in combination with microtasks).
  3704. // However, it has subtle problems when state is changed right before repaint
  3705. // (e.g. #6813, out-in transitions).
  3706. // Also, using (macro) tasks in event handler would cause some weird behaviors
  3707. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  3708. // So we now use microtasks everywhere, again.
  3709. // A major drawback of this tradeoff is that there are some scenarios
  3710. // where microtasks have too high a priority and fire in between supposedly
  3711. // sequential events (e.g. #4521, #6690, which have workarounds)
  3712. // or even between bubbling of the same event (#6566).
  3713. var timerFunc;
  3714. // The nextTick behavior leverages the microtask queue, which can be accessed
  3715. // via either native Promise.then or MutationObserver.
  3716. // MutationObserver has wider support, however it is seriously bugged in
  3717. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  3718. // completely stops working after triggering a few times... so, if native
  3719. // Promise is available, we will use it:
  3720. /* istanbul ignore next, $flow-disable-line */
  3721. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  3722. var p_1 = Promise.resolve();
  3723. timerFunc = function () {
  3724. p_1.then(flushCallbacks);
  3725. // In problematic UIWebViews, Promise.then doesn't completely break, but
  3726. // it can get stuck in a weird state where callbacks are pushed into the
  3727. // microtask queue but the queue isn't being flushed, until the browser
  3728. // needs to do some other work, e.g. handle a timer. Therefore we can
  3729. // "force" the microtask queue to be flushed by adding an empty timer.
  3730. if (isIOS)
  3731. setTimeout(noop);
  3732. };
  3733. isUsingMicroTask = true;
  3734. }
  3735. else if (!isIE &&
  3736. typeof MutationObserver !== 'undefined' &&
  3737. (isNative(MutationObserver) ||
  3738. // PhantomJS and iOS 7.x
  3739. MutationObserver.toString() === '[object MutationObserverConstructor]')) {
  3740. // Use MutationObserver where native Promise is not available,
  3741. // e.g. PhantomJS, iOS7, Android 4.4
  3742. // (#6466 MutationObserver is unreliable in IE11)
  3743. var counter_1 = 1;
  3744. var observer = new MutationObserver(flushCallbacks);
  3745. var textNode_1 = document.createTextNode(String(counter_1));
  3746. observer.observe(textNode_1, {
  3747. characterData: true
  3748. });
  3749. timerFunc = function () {
  3750. counter_1 = (counter_1 + 1) % 2;
  3751. textNode_1.data = String(counter_1);
  3752. };
  3753. isUsingMicroTask = true;
  3754. }
  3755. else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  3756. // Fallback to setImmediate.
  3757. // Technically it leverages the (macro) task queue,
  3758. // but it is still a better choice than setTimeout.
  3759. timerFunc = function () {
  3760. setImmediate(flushCallbacks);
  3761. };
  3762. }
  3763. else {
  3764. // Fallback to setTimeout.
  3765. timerFunc = function () {
  3766. setTimeout(flushCallbacks, 0);
  3767. };
  3768. }
  3769. /**
  3770. * @internal
  3771. */
  3772. function nextTick(cb, ctx) {
  3773. var _resolve;
  3774. callbacks.push(function () {
  3775. if (cb) {
  3776. try {
  3777. cb.call(ctx);
  3778. }
  3779. catch (e) {
  3780. handleError(e, ctx, 'nextTick');
  3781. }
  3782. }
  3783. else if (_resolve) {
  3784. _resolve(ctx);
  3785. }
  3786. });
  3787. if (!pending) {
  3788. pending = true;
  3789. timerFunc();
  3790. }
  3791. // $flow-disable-line
  3792. if (!cb && typeof Promise !== 'undefined') {
  3793. return new Promise(function (resolve) {
  3794. _resolve = resolve;
  3795. });
  3796. }
  3797. }
  3798. function useCssModule(name) {
  3799. /* istanbul ignore else */
  3800. {
  3801. {
  3802. warn$2("useCssModule() is not supported in the global build.");
  3803. }
  3804. return emptyObject;
  3805. }
  3806. }
  3807. /**
  3808. * Runtime helper for SFC's CSS variable injection feature.
  3809. * @private
  3810. */
  3811. function useCssVars(getter) {
  3812. if (!inBrowser && !false)
  3813. return;
  3814. var instance = currentInstance;
  3815. if (!instance) {
  3816. warn$2("useCssVars is called without current active component instance.");
  3817. return;
  3818. }
  3819. watchPostEffect(function () {
  3820. var el = instance.$el;
  3821. var vars = getter(instance, instance._setupProxy);
  3822. if (el && el.nodeType === 1) {
  3823. var style = el.style;
  3824. for (var key in vars) {
  3825. style.setProperty("--".concat(key), vars[key]);
  3826. }
  3827. }
  3828. });
  3829. }
  3830. /**
  3831. * v3-compatible async component API.
  3832. * @internal the type is manually declared in <root>/types/v3-define-async-component.d.ts
  3833. * because it relies on existing manual types
  3834. */
  3835. function defineAsyncComponent(source) {
  3836. if (isFunction(source)) {
  3837. source = { loader: source };
  3838. }
  3839. 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
  3840. _b = source.suspensible, // undefined = never times out
  3841. suspensible = _b === void 0 ? false : _b, // in Vue 3 default is true
  3842. userOnError = source.onError;
  3843. if (suspensible) {
  3844. warn$2("The suspensible option for async components is not supported in Vue2. It is ignored.");
  3845. }
  3846. var pendingRequest = null;
  3847. var retries = 0;
  3848. var retry = function () {
  3849. retries++;
  3850. pendingRequest = null;
  3851. return load();
  3852. };
  3853. var load = function () {
  3854. var thisRequest;
  3855. return (pendingRequest ||
  3856. (thisRequest = pendingRequest =
  3857. loader()
  3858. .catch(function (err) {
  3859. err = err instanceof Error ? err : new Error(String(err));
  3860. if (userOnError) {
  3861. return new Promise(function (resolve, reject) {
  3862. var userRetry = function () { return resolve(retry()); };
  3863. var userFail = function () { return reject(err); };
  3864. userOnError(err, userRetry, userFail, retries + 1);
  3865. });
  3866. }
  3867. else {
  3868. throw err;
  3869. }
  3870. })
  3871. .then(function (comp) {
  3872. if (thisRequest !== pendingRequest && pendingRequest) {
  3873. return pendingRequest;
  3874. }
  3875. if (!comp) {
  3876. warn$2("Async component loader resolved to undefined. " +
  3877. "If you are using retry(), make sure to return its return value.");
  3878. }
  3879. // interop module default
  3880. if (comp &&
  3881. (comp.__esModule || comp[Symbol.toStringTag] === 'Module')) {
  3882. comp = comp.default;
  3883. }
  3884. if (comp && !isObject(comp) && !isFunction(comp)) {
  3885. throw new Error("Invalid async component load result: ".concat(comp));
  3886. }
  3887. return comp;
  3888. })));
  3889. };
  3890. return function () {
  3891. var component = load();
  3892. return {
  3893. component: component,
  3894. delay: delay,
  3895. timeout: timeout,
  3896. error: errorComponent,
  3897. loading: loadingComponent
  3898. };
  3899. };
  3900. }
  3901. function createLifeCycle(hookName) {
  3902. return function (fn, target) {
  3903. if (target === void 0) { target = currentInstance; }
  3904. if (!target) {
  3905. warn$2("".concat(formatName(hookName), " is called when there is no active component instance to be ") +
  3906. "associated with. " +
  3907. "Lifecycle injection APIs can only be used during execution of setup().");
  3908. return;
  3909. }
  3910. return injectHook(target, hookName, fn);
  3911. };
  3912. }
  3913. function formatName(name) {
  3914. if (name === 'beforeDestroy') {
  3915. name = 'beforeUnmount';
  3916. }
  3917. else if (name === 'destroyed') {
  3918. name = 'unmounted';
  3919. }
  3920. return "on".concat(name[0].toUpperCase() + name.slice(1));
  3921. }
  3922. function injectHook(instance, hookName, fn) {
  3923. var options = instance.$options;
  3924. options[hookName] = mergeLifecycleHook(options[hookName], fn);
  3925. }
  3926. var onBeforeMount = createLifeCycle('beforeMount');
  3927. var onMounted = createLifeCycle('mounted');
  3928. var onBeforeUpdate = createLifeCycle('beforeUpdate');
  3929. var onUpdated = createLifeCycle('updated');
  3930. var onBeforeUnmount = createLifeCycle('beforeDestroy');
  3931. var onUnmounted = createLifeCycle('destroyed');
  3932. var onActivated = createLifeCycle('activated');
  3933. var onDeactivated = createLifeCycle('deactivated');
  3934. var onServerPrefetch = createLifeCycle('serverPrefetch');
  3935. var onRenderTracked = createLifeCycle('renderTracked');
  3936. var onRenderTriggered = createLifeCycle('renderTriggered');
  3937. var injectErrorCapturedHook = createLifeCycle('errorCaptured');
  3938. function onErrorCaptured(hook, target) {
  3939. if (target === void 0) { target = currentInstance; }
  3940. injectErrorCapturedHook(hook, target);
  3941. }
  3942. /**
  3943. * Note: also update dist/vue.runtime.mjs when adding new exports to this file.
  3944. */
  3945. var version = '2.7.15';
  3946. /**
  3947. * @internal type is manually declared in <root>/types/v3-define-component.d.ts
  3948. */
  3949. function defineComponent(options) {
  3950. return options;
  3951. }
  3952. var vca = /*#__PURE__*/Object.freeze({
  3953. __proto__: null,
  3954. version: version,
  3955. defineComponent: defineComponent,
  3956. ref: ref$1,
  3957. shallowRef: shallowRef,
  3958. isRef: isRef,
  3959. toRef: toRef,
  3960. toRefs: toRefs,
  3961. unref: unref,
  3962. proxyRefs: proxyRefs,
  3963. customRef: customRef,
  3964. triggerRef: triggerRef,
  3965. reactive: reactive,
  3966. isReactive: isReactive,
  3967. isReadonly: isReadonly,
  3968. isShallow: isShallow,
  3969. isProxy: isProxy,
  3970. shallowReactive: shallowReactive,
  3971. markRaw: markRaw,
  3972. toRaw: toRaw,
  3973. readonly: readonly,
  3974. shallowReadonly: shallowReadonly,
  3975. computed: computed,
  3976. watch: watch,
  3977. watchEffect: watchEffect,
  3978. watchPostEffect: watchPostEffect,
  3979. watchSyncEffect: watchSyncEffect,
  3980. EffectScope: EffectScope,
  3981. effectScope: effectScope,
  3982. onScopeDispose: onScopeDispose,
  3983. getCurrentScope: getCurrentScope,
  3984. provide: provide,
  3985. inject: inject,
  3986. h: h,
  3987. getCurrentInstance: getCurrentInstance,
  3988. useSlots: useSlots,
  3989. useAttrs: useAttrs,
  3990. useListeners: useListeners,
  3991. mergeDefaults: mergeDefaults,
  3992. nextTick: nextTick,
  3993. set: set,
  3994. del: del,
  3995. useCssModule: useCssModule,
  3996. useCssVars: useCssVars,
  3997. defineAsyncComponent: defineAsyncComponent,
  3998. onBeforeMount: onBeforeMount,
  3999. onMounted: onMounted,
  4000. onBeforeUpdate: onBeforeUpdate,
  4001. onUpdated: onUpdated,
  4002. onBeforeUnmount: onBeforeUnmount,
  4003. onUnmounted: onUnmounted,
  4004. onActivated: onActivated,
  4005. onDeactivated: onDeactivated,
  4006. onServerPrefetch: onServerPrefetch,
  4007. onRenderTracked: onRenderTracked,
  4008. onRenderTriggered: onRenderTriggered,
  4009. onErrorCaptured: onErrorCaptured
  4010. });
  4011. var seenObjects = new _Set();
  4012. /**
  4013. * Recursively traverse an object to evoke all converted
  4014. * getters, so that every nested property inside the object
  4015. * is collected as a "deep" dependency.
  4016. */
  4017. function traverse(val) {
  4018. _traverse(val, seenObjects);
  4019. seenObjects.clear();
  4020. return val;
  4021. }
  4022. function _traverse(val, seen) {
  4023. var i, keys;
  4024. var isA = isArray(val);
  4025. if ((!isA && !isObject(val)) ||
  4026. val.__v_skip /* ReactiveFlags.SKIP */ ||
  4027. Object.isFrozen(val) ||
  4028. val instanceof VNode) {
  4029. return;
  4030. }
  4031. if (val.__ob__) {
  4032. var depId = val.__ob__.dep.id;
  4033. if (seen.has(depId)) {
  4034. return;
  4035. }
  4036. seen.add(depId);
  4037. }
  4038. if (isA) {
  4039. i = val.length;
  4040. while (i--)
  4041. _traverse(val[i], seen);
  4042. }
  4043. else if (isRef(val)) {
  4044. _traverse(val.value, seen);
  4045. }
  4046. else {
  4047. keys = Object.keys(val);
  4048. i = keys.length;
  4049. while (i--)
  4050. _traverse(val[keys[i]], seen);
  4051. }
  4052. }
  4053. var uid$1 = 0;
  4054. /**
  4055. * A watcher parses an expression, collects dependencies,
  4056. * and fires callback when the expression value changes.
  4057. * This is used for both the $watch() api and directives.
  4058. * @internal
  4059. */
  4060. var Watcher = /** @class */ (function () {
  4061. function Watcher(vm, expOrFn, cb, options, isRenderWatcher) {
  4062. recordEffectScope(this,
  4063. // if the active effect scope is manually created (not a component scope),
  4064. // prioritize it
  4065. activeEffectScope && !activeEffectScope._vm
  4066. ? activeEffectScope
  4067. : vm
  4068. ? vm._scope
  4069. : undefined);
  4070. if ((this.vm = vm) && isRenderWatcher) {
  4071. vm._watcher = this;
  4072. }
  4073. // options
  4074. if (options) {
  4075. this.deep = !!options.deep;
  4076. this.user = !!options.user;
  4077. this.lazy = !!options.lazy;
  4078. this.sync = !!options.sync;
  4079. this.before = options.before;
  4080. {
  4081. this.onTrack = options.onTrack;
  4082. this.onTrigger = options.onTrigger;
  4083. }
  4084. }
  4085. else {
  4086. this.deep = this.user = this.lazy = this.sync = false;
  4087. }
  4088. this.cb = cb;
  4089. this.id = ++uid$1; // uid for batching
  4090. this.active = true;
  4091. this.post = false;
  4092. this.dirty = this.lazy; // for lazy watchers
  4093. this.deps = [];
  4094. this.newDeps = [];
  4095. this.depIds = new _Set();
  4096. this.newDepIds = new _Set();
  4097. this.expression = expOrFn.toString() ;
  4098. // parse expression for getter
  4099. if (isFunction(expOrFn)) {
  4100. this.getter = expOrFn;
  4101. }
  4102. else {
  4103. this.getter = parsePath(expOrFn);
  4104. if (!this.getter) {
  4105. this.getter = noop;
  4106. warn$2("Failed watching path: \"".concat(expOrFn, "\" ") +
  4107. 'Watcher only accepts simple dot-delimited paths. ' +
  4108. 'For full control, use a function instead.', vm);
  4109. }
  4110. }
  4111. this.value = this.lazy ? undefined : this.get();
  4112. }
  4113. /**
  4114. * Evaluate the getter, and re-collect dependencies.
  4115. */
  4116. Watcher.prototype.get = function () {
  4117. pushTarget(this);
  4118. var value;
  4119. var vm = this.vm;
  4120. try {
  4121. value = this.getter.call(vm, vm);
  4122. }
  4123. catch (e) {
  4124. if (this.user) {
  4125. handleError(e, vm, "getter for watcher \"".concat(this.expression, "\""));
  4126. }
  4127. else {
  4128. throw e;
  4129. }
  4130. }
  4131. finally {
  4132. // "touch" every property so they are all tracked as
  4133. // dependencies for deep watching
  4134. if (this.deep) {
  4135. traverse(value);
  4136. }
  4137. popTarget();
  4138. this.cleanupDeps();
  4139. }
  4140. return value;
  4141. };
  4142. /**
  4143. * Add a dependency to this directive.
  4144. */
  4145. Watcher.prototype.addDep = function (dep) {
  4146. var id = dep.id;
  4147. if (!this.newDepIds.has(id)) {
  4148. this.newDepIds.add(id);
  4149. this.newDeps.push(dep);
  4150. if (!this.depIds.has(id)) {
  4151. dep.addSub(this);
  4152. }
  4153. }
  4154. };
  4155. /**
  4156. * Clean up for dependency collection.
  4157. */
  4158. Watcher.prototype.cleanupDeps = function () {
  4159. var i = this.deps.length;
  4160. while (i--) {
  4161. var dep = this.deps[i];
  4162. if (!this.newDepIds.has(dep.id)) {
  4163. dep.removeSub(this);
  4164. }
  4165. }
  4166. var tmp = this.depIds;
  4167. this.depIds = this.newDepIds;
  4168. this.newDepIds = tmp;
  4169. this.newDepIds.clear();
  4170. tmp = this.deps;
  4171. this.deps = this.newDeps;
  4172. this.newDeps = tmp;
  4173. this.newDeps.length = 0;
  4174. };
  4175. /**
  4176. * Subscriber interface.
  4177. * Will be called when a dependency changes.
  4178. */
  4179. Watcher.prototype.update = function () {
  4180. /* istanbul ignore else */
  4181. if (this.lazy) {
  4182. this.dirty = true;
  4183. }
  4184. else if (this.sync) {
  4185. this.run();
  4186. }
  4187. else {
  4188. queueWatcher(this);
  4189. }
  4190. };
  4191. /**
  4192. * Scheduler job interface.
  4193. * Will be called by the scheduler.
  4194. */
  4195. Watcher.prototype.run = function () {
  4196. if (this.active) {
  4197. var value = this.get();
  4198. if (value !== this.value ||
  4199. // Deep watchers and watchers on Object/Arrays should fire even
  4200. // when the value is the same, because the value may
  4201. // have mutated.
  4202. isObject(value) ||
  4203. this.deep) {
  4204. // set new value
  4205. var oldValue = this.value;
  4206. this.value = value;
  4207. if (this.user) {
  4208. var info = "callback for watcher \"".concat(this.expression, "\"");
  4209. invokeWithErrorHandling(this.cb, this.vm, [value, oldValue], this.vm, info);
  4210. }
  4211. else {
  4212. this.cb.call(this.vm, value, oldValue);
  4213. }
  4214. }
  4215. }
  4216. };
  4217. /**
  4218. * Evaluate the value of the watcher.
  4219. * This only gets called for lazy watchers.
  4220. */
  4221. Watcher.prototype.evaluate = function () {
  4222. this.value = this.get();
  4223. this.dirty = false;
  4224. };
  4225. /**
  4226. * Depend on all deps collected by this watcher.
  4227. */
  4228. Watcher.prototype.depend = function () {
  4229. var i = this.deps.length;
  4230. while (i--) {
  4231. this.deps[i].depend();
  4232. }
  4233. };
  4234. /**
  4235. * Remove self from all dependencies' subscriber list.
  4236. */
  4237. Watcher.prototype.teardown = function () {
  4238. if (this.vm && !this.vm._isBeingDestroyed) {
  4239. remove$2(this.vm._scope.effects, this);
  4240. }
  4241. if (this.active) {
  4242. var i = this.deps.length;
  4243. while (i--) {
  4244. this.deps[i].removeSub(this);
  4245. }
  4246. this.active = false;
  4247. if (this.onStop) {
  4248. this.onStop();
  4249. }
  4250. }
  4251. };
  4252. return Watcher;
  4253. }());
  4254. var sharedPropertyDefinition = {
  4255. enumerable: true,
  4256. configurable: true,
  4257. get: noop,
  4258. set: noop
  4259. };
  4260. function proxy(target, sourceKey, key) {
  4261. sharedPropertyDefinition.get = function proxyGetter() {
  4262. return this[sourceKey][key];
  4263. };
  4264. sharedPropertyDefinition.set = function proxySetter(val) {
  4265. this[sourceKey][key] = val;
  4266. };
  4267. Object.defineProperty(target, key, sharedPropertyDefinition);
  4268. }
  4269. function initState(vm) {
  4270. var opts = vm.$options;
  4271. if (opts.props)
  4272. initProps$1(vm, opts.props);
  4273. // Composition API
  4274. initSetup(vm);
  4275. if (opts.methods)
  4276. initMethods(vm, opts.methods);
  4277. if (opts.data) {
  4278. initData(vm);
  4279. }
  4280. else {
  4281. var ob = observe((vm._data = {}));
  4282. ob && ob.vmCount++;
  4283. }
  4284. if (opts.computed)
  4285. initComputed$1(vm, opts.computed);
  4286. if (opts.watch && opts.watch !== nativeWatch) {
  4287. initWatch(vm, opts.watch);
  4288. }
  4289. }
  4290. function initProps$1(vm, propsOptions) {
  4291. var propsData = vm.$options.propsData || {};
  4292. var props = (vm._props = shallowReactive({}));
  4293. // cache prop keys so that future props updates can iterate using Array
  4294. // instead of dynamic object key enumeration.
  4295. var keys = (vm.$options._propKeys = []);
  4296. var isRoot = !vm.$parent;
  4297. // root instance props should be converted
  4298. if (!isRoot) {
  4299. toggleObserving(false);
  4300. }
  4301. var _loop_1 = function (key) {
  4302. keys.push(key);
  4303. var value = validateProp(key, propsOptions, propsData, vm);
  4304. /* istanbul ignore else */
  4305. {
  4306. var hyphenatedKey = hyphenate(key);
  4307. if (isReservedAttribute(hyphenatedKey) ||
  4308. config.isReservedAttr(hyphenatedKey)) {
  4309. warn$2("\"".concat(hyphenatedKey, "\" is a reserved attribute and cannot be used as component prop."), vm);
  4310. }
  4311. defineReactive(props, key, value, function () {
  4312. if (!isRoot && !isUpdatingChildComponent) {
  4313. warn$2("Avoid mutating a prop directly since the value will be " +
  4314. "overwritten whenever the parent component re-renders. " +
  4315. "Instead, use a data or computed property based on the prop's " +
  4316. "value. Prop being mutated: \"".concat(key, "\""), vm);
  4317. }
  4318. });
  4319. }
  4320. // static props are already proxied on the component's prototype
  4321. // during Vue.extend(). We only need to proxy props defined at
  4322. // instantiation here.
  4323. if (!(key in vm)) {
  4324. proxy(vm, "_props", key);
  4325. }
  4326. };
  4327. for (var key in propsOptions) {
  4328. _loop_1(key);
  4329. }
  4330. toggleObserving(true);
  4331. }
  4332. function initData(vm) {
  4333. var data = vm.$options.data;
  4334. data = vm._data = isFunction(data) ? getData(data, vm) : data || {};
  4335. if (!isPlainObject(data)) {
  4336. data = {};
  4337. warn$2('data functions should return an object:\n' +
  4338. 'https://v2.vuejs.org/v2/guide/components.html#data-Must-Be-a-Function', vm);
  4339. }
  4340. // proxy data on instance
  4341. var keys = Object.keys(data);
  4342. var props = vm.$options.props;
  4343. var methods = vm.$options.methods;
  4344. var i = keys.length;
  4345. while (i--) {
  4346. var key = keys[i];
  4347. {
  4348. if (methods && hasOwn(methods, key)) {
  4349. warn$2("Method \"".concat(key, "\" has already been defined as a data property."), vm);
  4350. }
  4351. }
  4352. if (props && hasOwn(props, key)) {
  4353. warn$2("The data property \"".concat(key, "\" is already declared as a prop. ") +
  4354. "Use prop default value instead.", vm);
  4355. }
  4356. else if (!isReserved(key)) {
  4357. proxy(vm, "_data", key);
  4358. }
  4359. }
  4360. // observe data
  4361. var ob = observe(data);
  4362. ob && ob.vmCount++;
  4363. }
  4364. function getData(data, vm) {
  4365. // #7573 disable dep collection when invoking data getters
  4366. pushTarget();
  4367. try {
  4368. return data.call(vm, vm);
  4369. }
  4370. catch (e) {
  4371. handleError(e, vm, "data()");
  4372. return {};
  4373. }
  4374. finally {
  4375. popTarget();
  4376. }
  4377. }
  4378. var computedWatcherOptions = { lazy: true };
  4379. function initComputed$1(vm, computed) {
  4380. // $flow-disable-line
  4381. var watchers = (vm._computedWatchers = Object.create(null));
  4382. // computed properties are just getters during SSR
  4383. var isSSR = isServerRendering();
  4384. for (var key in computed) {
  4385. var userDef = computed[key];
  4386. var getter = isFunction(userDef) ? userDef : userDef.get;
  4387. if (getter == null) {
  4388. warn$2("Getter is missing for computed property \"".concat(key, "\"."), vm);
  4389. }
  4390. if (!isSSR) {
  4391. // create internal watcher for the computed property.
  4392. watchers[key] = new Watcher(vm, getter || noop, noop, computedWatcherOptions);
  4393. }
  4394. // component-defined computed properties are already defined on the
  4395. // component prototype. We only need to define computed properties defined
  4396. // at instantiation here.
  4397. if (!(key in vm)) {
  4398. defineComputed(vm, key, userDef);
  4399. }
  4400. else {
  4401. if (key in vm.$data) {
  4402. warn$2("The computed property \"".concat(key, "\" is already defined in data."), vm);
  4403. }
  4404. else if (vm.$options.props && key in vm.$options.props) {
  4405. warn$2("The computed property \"".concat(key, "\" is already defined as a prop."), vm);
  4406. }
  4407. else if (vm.$options.methods && key in vm.$options.methods) {
  4408. warn$2("The computed property \"".concat(key, "\" is already defined as a method."), vm);
  4409. }
  4410. }
  4411. }
  4412. }
  4413. function defineComputed(target, key, userDef) {
  4414. var shouldCache = !isServerRendering();
  4415. if (isFunction(userDef)) {
  4416. sharedPropertyDefinition.get = shouldCache
  4417. ? createComputedGetter(key)
  4418. : createGetterInvoker(userDef);
  4419. sharedPropertyDefinition.set = noop;
  4420. }
  4421. else {
  4422. sharedPropertyDefinition.get = userDef.get
  4423. ? shouldCache && userDef.cache !== false
  4424. ? createComputedGetter(key)
  4425. : createGetterInvoker(userDef.get)
  4426. : noop;
  4427. sharedPropertyDefinition.set = userDef.set || noop;
  4428. }
  4429. if (sharedPropertyDefinition.set === noop) {
  4430. sharedPropertyDefinition.set = function () {
  4431. warn$2("Computed property \"".concat(key, "\" was assigned to but it has no setter."), this);
  4432. };
  4433. }
  4434. Object.defineProperty(target, key, sharedPropertyDefinition);
  4435. }
  4436. function createComputedGetter(key) {
  4437. return function computedGetter() {
  4438. var watcher = this._computedWatchers && this._computedWatchers[key];
  4439. if (watcher) {
  4440. if (watcher.dirty) {
  4441. watcher.evaluate();
  4442. }
  4443. if (Dep.target) {
  4444. if (Dep.target.onTrack) {
  4445. Dep.target.onTrack({
  4446. effect: Dep.target,
  4447. target: this,
  4448. type: "get" /* TrackOpTypes.GET */,
  4449. key: key
  4450. });
  4451. }
  4452. watcher.depend();
  4453. }
  4454. return watcher.value;
  4455. }
  4456. };
  4457. }
  4458. function createGetterInvoker(fn) {
  4459. return function computedGetter() {
  4460. return fn.call(this, this);
  4461. };
  4462. }
  4463. function initMethods(vm, methods) {
  4464. var props = vm.$options.props;
  4465. for (var key in methods) {
  4466. {
  4467. if (typeof methods[key] !== 'function') {
  4468. warn$2("Method \"".concat(key, "\" has type \"").concat(typeof methods[key], "\" in the component definition. ") +
  4469. "Did you reference the function correctly?", vm);
  4470. }
  4471. if (props && hasOwn(props, key)) {
  4472. warn$2("Method \"".concat(key, "\" has already been defined as a prop."), vm);
  4473. }
  4474. if (key in vm && isReserved(key)) {
  4475. warn$2("Method \"".concat(key, "\" conflicts with an existing Vue instance method. ") +
  4476. "Avoid defining component methods that start with _ or $.");
  4477. }
  4478. }
  4479. vm[key] = typeof methods[key] !== 'function' ? noop : bind$1(methods[key], vm);
  4480. }
  4481. }
  4482. function initWatch(vm, watch) {
  4483. for (var key in watch) {
  4484. var handler = watch[key];
  4485. if (isArray(handler)) {
  4486. for (var i = 0; i < handler.length; i++) {
  4487. createWatcher(vm, key, handler[i]);
  4488. }
  4489. }
  4490. else {
  4491. createWatcher(vm, key, handler);
  4492. }
  4493. }
  4494. }
  4495. function createWatcher(vm, expOrFn, handler, options) {
  4496. if (isPlainObject(handler)) {
  4497. options = handler;
  4498. handler = handler.handler;
  4499. }
  4500. if (typeof handler === 'string') {
  4501. handler = vm[handler];
  4502. }
  4503. return vm.$watch(expOrFn, handler, options);
  4504. }
  4505. function stateMixin(Vue) {
  4506. // flow somehow has problems with directly declared definition object
  4507. // when using Object.defineProperty, so we have to procedurally build up
  4508. // the object here.
  4509. var dataDef = {};
  4510. dataDef.get = function () {
  4511. return this._data;
  4512. };
  4513. var propsDef = {};
  4514. propsDef.get = function () {
  4515. return this._props;
  4516. };
  4517. {
  4518. dataDef.set = function () {
  4519. warn$2('Avoid replacing instance root $data. ' +
  4520. 'Use nested data properties instead.', this);
  4521. };
  4522. propsDef.set = function () {
  4523. warn$2("$props is readonly.", this);
  4524. };
  4525. }
  4526. Object.defineProperty(Vue.prototype, '$data', dataDef);
  4527. Object.defineProperty(Vue.prototype, '$props', propsDef);
  4528. Vue.prototype.$set = set;
  4529. Vue.prototype.$delete = del;
  4530. Vue.prototype.$watch = function (expOrFn, cb, options) {
  4531. var vm = this;
  4532. if (isPlainObject(cb)) {
  4533. return createWatcher(vm, expOrFn, cb, options);
  4534. }
  4535. options = options || {};
  4536. options.user = true;
  4537. var watcher = new Watcher(vm, expOrFn, cb, options);
  4538. if (options.immediate) {
  4539. var info = "callback for immediate watcher \"".concat(watcher.expression, "\"");
  4540. pushTarget();
  4541. invokeWithErrorHandling(cb, vm, [watcher.value], vm, info);
  4542. popTarget();
  4543. }
  4544. return function unwatchFn() {
  4545. watcher.teardown();
  4546. };
  4547. };
  4548. }
  4549. function initProvide(vm) {
  4550. var provideOption = vm.$options.provide;
  4551. if (provideOption) {
  4552. var provided = isFunction(provideOption)
  4553. ? provideOption.call(vm)
  4554. : provideOption;
  4555. if (!isObject(provided)) {
  4556. return;
  4557. }
  4558. var source = resolveProvided(vm);
  4559. // IE9 doesn't support Object.getOwnPropertyDescriptors so we have to
  4560. // iterate the keys ourselves.
  4561. var keys = hasSymbol ? Reflect.ownKeys(provided) : Object.keys(provided);
  4562. for (var i = 0; i < keys.length; i++) {
  4563. var key = keys[i];
  4564. Object.defineProperty(source, key, Object.getOwnPropertyDescriptor(provided, key));
  4565. }
  4566. }
  4567. }
  4568. function initInjections(vm) {
  4569. var result = resolveInject(vm.$options.inject, vm);
  4570. if (result) {
  4571. toggleObserving(false);
  4572. Object.keys(result).forEach(function (key) {
  4573. /* istanbul ignore else */
  4574. {
  4575. defineReactive(vm, key, result[key], function () {
  4576. warn$2("Avoid mutating an injected value directly since the changes will be " +
  4577. "overwritten whenever the provided component re-renders. " +
  4578. "injection being mutated: \"".concat(key, "\""), vm);
  4579. });
  4580. }
  4581. });
  4582. toggleObserving(true);
  4583. }
  4584. }
  4585. function resolveInject(inject, vm) {
  4586. if (inject) {
  4587. // inject is :any because flow is not smart enough to figure out cached
  4588. var result = Object.create(null);
  4589. var keys = hasSymbol ? Reflect.ownKeys(inject) : Object.keys(inject);
  4590. for (var i = 0; i < keys.length; i++) {
  4591. var key = keys[i];
  4592. // #6574 in case the inject object is observed...
  4593. if (key === '__ob__')
  4594. continue;
  4595. var provideKey = inject[key].from;
  4596. if (provideKey in vm._provided) {
  4597. result[key] = vm._provided[provideKey];
  4598. }
  4599. else if ('default' in inject[key]) {
  4600. var provideDefault = inject[key].default;
  4601. result[key] = isFunction(provideDefault)
  4602. ? provideDefault.call(vm)
  4603. : provideDefault;
  4604. }
  4605. else {
  4606. warn$2("Injection \"".concat(key, "\" not found"), vm);
  4607. }
  4608. }
  4609. return result;
  4610. }
  4611. }
  4612. var uid = 0;
  4613. function initMixin$1(Vue) {
  4614. Vue.prototype._init = function (options) {
  4615. var vm = this;
  4616. // a uid
  4617. vm._uid = uid++;
  4618. var startTag, endTag;
  4619. /* istanbul ignore if */
  4620. if (config.performance && mark) {
  4621. startTag = "vue-perf-start:".concat(vm._uid);
  4622. endTag = "vue-perf-end:".concat(vm._uid);
  4623. mark(startTag);
  4624. }
  4625. // a flag to mark this as a Vue instance without having to do instanceof
  4626. // check
  4627. vm._isVue = true;
  4628. // avoid instances from being observed
  4629. vm.__v_skip = true;
  4630. // effect scope
  4631. vm._scope = new EffectScope(true /* detached */);
  4632. vm._scope._vm = true;
  4633. // merge options
  4634. if (options && options._isComponent) {
  4635. // optimize internal component instantiation
  4636. // since dynamic options merging is pretty slow, and none of the
  4637. // internal component options needs special treatment.
  4638. initInternalComponent(vm, options);
  4639. }
  4640. else {
  4641. vm.$options = mergeOptions(resolveConstructorOptions(vm.constructor), options || {}, vm);
  4642. }
  4643. /* istanbul ignore else */
  4644. {
  4645. initProxy(vm);
  4646. }
  4647. // expose real self
  4648. vm._self = vm;
  4649. initLifecycle(vm);
  4650. initEvents(vm);
  4651. initRender(vm);
  4652. callHook$1(vm, 'beforeCreate', undefined, false /* setContext */);
  4653. initInjections(vm); // resolve injections before data/props
  4654. initState(vm);
  4655. initProvide(vm); // resolve provide after data/props
  4656. callHook$1(vm, 'created');
  4657. /* istanbul ignore if */
  4658. if (config.performance && mark) {
  4659. vm._name = formatComponentName(vm, false);
  4660. mark(endTag);
  4661. measure("vue ".concat(vm._name, " init"), startTag, endTag);
  4662. }
  4663. if (vm.$options.el) {
  4664. vm.$mount(vm.$options.el);
  4665. }
  4666. };
  4667. }
  4668. function initInternalComponent(vm, options) {
  4669. var opts = (vm.$options = Object.create(vm.constructor.options));
  4670. // doing this because it's faster than dynamic enumeration.
  4671. var parentVnode = options._parentVnode;
  4672. opts.parent = options.parent;
  4673. opts._parentVnode = parentVnode;
  4674. var vnodeComponentOptions = parentVnode.componentOptions;
  4675. opts.propsData = vnodeComponentOptions.propsData;
  4676. opts._parentListeners = vnodeComponentOptions.listeners;
  4677. opts._renderChildren = vnodeComponentOptions.children;
  4678. opts._componentTag = vnodeComponentOptions.tag;
  4679. if (options.render) {
  4680. opts.render = options.render;
  4681. opts.staticRenderFns = options.staticRenderFns;
  4682. }
  4683. }
  4684. function resolveConstructorOptions(Ctor) {
  4685. var options = Ctor.options;
  4686. if (Ctor.super) {
  4687. var superOptions = resolveConstructorOptions(Ctor.super);
  4688. var cachedSuperOptions = Ctor.superOptions;
  4689. if (superOptions !== cachedSuperOptions) {
  4690. // super option changed,
  4691. // need to resolve new options.
  4692. Ctor.superOptions = superOptions;
  4693. // check if there are any late-modified/attached options (#4976)
  4694. var modifiedOptions = resolveModifiedOptions(Ctor);
  4695. // update base extend options
  4696. if (modifiedOptions) {
  4697. extend(Ctor.extendOptions, modifiedOptions);
  4698. }
  4699. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  4700. if (options.name) {
  4701. options.components[options.name] = Ctor;
  4702. }
  4703. }
  4704. }
  4705. return options;
  4706. }
  4707. function resolveModifiedOptions(Ctor) {
  4708. var modified;
  4709. var latest = Ctor.options;
  4710. var sealed = Ctor.sealedOptions;
  4711. for (var key in latest) {
  4712. if (latest[key] !== sealed[key]) {
  4713. if (!modified)
  4714. modified = {};
  4715. modified[key] = latest[key];
  4716. }
  4717. }
  4718. return modified;
  4719. }
  4720. function FunctionalRenderContext(data, props, children, parent, Ctor) {
  4721. var _this = this;
  4722. var options = Ctor.options;
  4723. // ensure the createElement function in functional components
  4724. // gets a unique context - this is necessary for correct named slot check
  4725. var contextVm;
  4726. if (hasOwn(parent, '_uid')) {
  4727. contextVm = Object.create(parent);
  4728. contextVm._original = parent;
  4729. }
  4730. else {
  4731. // the context vm passed in is a functional context as well.
  4732. // in this case we want to make sure we are able to get a hold to the
  4733. // real context instance.
  4734. contextVm = parent;
  4735. // @ts-ignore
  4736. parent = parent._original;
  4737. }
  4738. var isCompiled = isTrue(options._compiled);
  4739. var needNormalization = !isCompiled;
  4740. this.data = data;
  4741. this.props = props;
  4742. this.children = children;
  4743. this.parent = parent;
  4744. this.listeners = data.on || emptyObject;
  4745. this.injections = resolveInject(options.inject, parent);
  4746. this.slots = function () {
  4747. if (!_this.$slots) {
  4748. normalizeScopedSlots(parent, data.scopedSlots, (_this.$slots = resolveSlots(children, parent)));
  4749. }
  4750. return _this.$slots;
  4751. };
  4752. Object.defineProperty(this, 'scopedSlots', {
  4753. enumerable: true,
  4754. get: function () {
  4755. return normalizeScopedSlots(parent, data.scopedSlots, this.slots());
  4756. }
  4757. });
  4758. // support for compiled functional template
  4759. if (isCompiled) {
  4760. // exposing $options for renderStatic()
  4761. this.$options = options;
  4762. // pre-resolve slots for renderSlot()
  4763. this.$slots = this.slots();
  4764. this.$scopedSlots = normalizeScopedSlots(parent, data.scopedSlots, this.$slots);
  4765. }
  4766. if (options._scopeId) {
  4767. this._c = function (a, b, c, d) {
  4768. var vnode = createElement$1(contextVm, a, b, c, d, needNormalization);
  4769. if (vnode && !isArray(vnode)) {
  4770. vnode.fnScopeId = options._scopeId;
  4771. vnode.fnContext = parent;
  4772. }
  4773. return vnode;
  4774. };
  4775. }
  4776. else {
  4777. this._c = function (a, b, c, d) {
  4778. return createElement$1(contextVm, a, b, c, d, needNormalization);
  4779. };
  4780. }
  4781. }
  4782. installRenderHelpers(FunctionalRenderContext.prototype);
  4783. function createFunctionalComponent(Ctor, propsData, data, contextVm, children) {
  4784. var options = Ctor.options;
  4785. var props = {};
  4786. var propOptions = options.props;
  4787. if (isDef(propOptions)) {
  4788. for (var key in propOptions) {
  4789. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  4790. }
  4791. }
  4792. else {
  4793. if (isDef(data.attrs))
  4794. mergeProps(props, data.attrs);
  4795. if (isDef(data.props))
  4796. mergeProps(props, data.props);
  4797. }
  4798. var renderContext = new FunctionalRenderContext(data, props, children, contextVm, Ctor);
  4799. var vnode = options.render.call(null, renderContext._c, renderContext);
  4800. if (vnode instanceof VNode) {
  4801. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext);
  4802. }
  4803. else if (isArray(vnode)) {
  4804. var vnodes = normalizeChildren(vnode) || [];
  4805. var res = new Array(vnodes.length);
  4806. for (var i = 0; i < vnodes.length; i++) {
  4807. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  4808. }
  4809. return res;
  4810. }
  4811. }
  4812. function cloneAndMarkFunctionalResult(vnode, data, contextVm, options, renderContext) {
  4813. // #7817 clone node before setting fnContext, otherwise if the node is reused
  4814. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  4815. // that should not be matched to match.
  4816. var clone = cloneVNode(vnode);
  4817. clone.fnContext = contextVm;
  4818. clone.fnOptions = options;
  4819. {
  4820. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext =
  4821. renderContext;
  4822. }
  4823. if (data.slot) {
  4824. (clone.data || (clone.data = {})).slot = data.slot;
  4825. }
  4826. return clone;
  4827. }
  4828. function mergeProps(to, from) {
  4829. for (var key in from) {
  4830. to[camelize(key)] = from[key];
  4831. }
  4832. }
  4833. function getComponentName(options) {
  4834. return options.name || options.__name || options._componentTag;
  4835. }
  4836. // inline hooks to be invoked on component VNodes during patch
  4837. var componentVNodeHooks = {
  4838. init: function (vnode, hydrating) {
  4839. if (vnode.componentInstance &&
  4840. !vnode.componentInstance._isDestroyed &&
  4841. vnode.data.keepAlive) {
  4842. // kept-alive components, treat as a patch
  4843. var mountedNode = vnode; // work around flow
  4844. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  4845. }
  4846. else {
  4847. var child = (vnode.componentInstance = createComponentInstanceForVnode(vnode, activeInstance));
  4848. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  4849. }
  4850. },
  4851. prepatch: function (oldVnode, vnode) {
  4852. var options = vnode.componentOptions;
  4853. var child = (vnode.componentInstance = oldVnode.componentInstance);
  4854. updateChildComponent(child, options.propsData, // updated props
  4855. options.listeners, // updated listeners
  4856. vnode, // new parent vnode
  4857. options.children // new children
  4858. );
  4859. },
  4860. insert: function (vnode) {
  4861. var context = vnode.context, componentInstance = vnode.componentInstance;
  4862. if (!componentInstance._isMounted) {
  4863. componentInstance._isMounted = true;
  4864. callHook$1(componentInstance, 'mounted');
  4865. }
  4866. if (vnode.data.keepAlive) {
  4867. if (context._isMounted) {
  4868. // vue-router#1212
  4869. // During updates, a kept-alive component's child components may
  4870. // change, so directly walking the tree here may call activated hooks
  4871. // on incorrect children. Instead we push them into a queue which will
  4872. // be processed after the whole patch process ended.
  4873. queueActivatedComponent(componentInstance);
  4874. }
  4875. else {
  4876. activateChildComponent(componentInstance, true /* direct */);
  4877. }
  4878. }
  4879. },
  4880. destroy: function (vnode) {
  4881. var componentInstance = vnode.componentInstance;
  4882. if (!componentInstance._isDestroyed) {
  4883. if (!vnode.data.keepAlive) {
  4884. componentInstance.$destroy();
  4885. }
  4886. else {
  4887. deactivateChildComponent(componentInstance, true /* direct */);
  4888. }
  4889. }
  4890. }
  4891. };
  4892. var hooksToMerge = Object.keys(componentVNodeHooks);
  4893. function createComponent(Ctor, data, context, children, tag) {
  4894. if (isUndef(Ctor)) {
  4895. return;
  4896. }
  4897. var baseCtor = context.$options._base;
  4898. // plain options object: turn it into a constructor
  4899. if (isObject(Ctor)) {
  4900. Ctor = baseCtor.extend(Ctor);
  4901. }
  4902. // if at this stage it's not a constructor or an async component factory,
  4903. // reject.
  4904. if (typeof Ctor !== 'function') {
  4905. {
  4906. warn$2("Invalid Component definition: ".concat(String(Ctor)), context);
  4907. }
  4908. return;
  4909. }
  4910. // async component
  4911. var asyncFactory;
  4912. // @ts-expect-error
  4913. if (isUndef(Ctor.cid)) {
  4914. asyncFactory = Ctor;
  4915. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  4916. if (Ctor === undefined) {
  4917. // return a placeholder node for async component, which is rendered
  4918. // as a comment node but preserves all the raw information for the node.
  4919. // the information will be used for async server-rendering and hydration.
  4920. return createAsyncPlaceholder(asyncFactory, data, context, children, tag);
  4921. }
  4922. }
  4923. data = data || {};
  4924. // resolve constructor options in case global mixins are applied after
  4925. // component constructor creation
  4926. resolveConstructorOptions(Ctor);
  4927. // transform component v-model data into props & events
  4928. if (isDef(data.model)) {
  4929. // @ts-expect-error
  4930. transformModel(Ctor.options, data);
  4931. }
  4932. // extract props
  4933. // @ts-expect-error
  4934. var propsData = extractPropsFromVNodeData(data, Ctor, tag);
  4935. // functional component
  4936. // @ts-expect-error
  4937. if (isTrue(Ctor.options.functional)) {
  4938. return createFunctionalComponent(Ctor, propsData, data, context, children);
  4939. }
  4940. // extract listeners, since these needs to be treated as
  4941. // child component listeners instead of DOM listeners
  4942. var listeners = data.on;
  4943. // replace with listeners with .native modifier
  4944. // so it gets processed during parent component patch.
  4945. data.on = data.nativeOn;
  4946. // @ts-expect-error
  4947. if (isTrue(Ctor.options.abstract)) {
  4948. // abstract components do not keep anything
  4949. // other than props & listeners & slot
  4950. // work around flow
  4951. var slot = data.slot;
  4952. data = {};
  4953. if (slot) {
  4954. data.slot = slot;
  4955. }
  4956. }
  4957. // install component management hooks onto the placeholder node
  4958. installComponentHooks(data);
  4959. // return a placeholder vnode
  4960. // @ts-expect-error
  4961. var name = getComponentName(Ctor.options) || tag;
  4962. var vnode = new VNode(
  4963. // @ts-expect-error
  4964. "vue-component-".concat(Ctor.cid).concat(name ? "-".concat(name) : ''), data, undefined, undefined, undefined, context,
  4965. // @ts-expect-error
  4966. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children }, asyncFactory);
  4967. return vnode;
  4968. }
  4969. function createComponentInstanceForVnode(
  4970. // we know it's MountedComponentVNode but flow doesn't
  4971. vnode,
  4972. // activeInstance in lifecycle state
  4973. parent) {
  4974. var options = {
  4975. _isComponent: true,
  4976. _parentVnode: vnode,
  4977. parent: parent
  4978. };
  4979. // check inline-template render functions
  4980. var inlineTemplate = vnode.data.inlineTemplate;
  4981. if (isDef(inlineTemplate)) {
  4982. options.render = inlineTemplate.render;
  4983. options.staticRenderFns = inlineTemplate.staticRenderFns;
  4984. }
  4985. return new vnode.componentOptions.Ctor(options);
  4986. }
  4987. function installComponentHooks(data) {
  4988. var hooks = data.hook || (data.hook = {});
  4989. for (var i = 0; i < hooksToMerge.length; i++) {
  4990. var key = hooksToMerge[i];
  4991. var existing = hooks[key];
  4992. var toMerge = componentVNodeHooks[key];
  4993. // @ts-expect-error
  4994. if (existing !== toMerge && !(existing && existing._merged)) {
  4995. hooks[key] = existing ? mergeHook(toMerge, existing) : toMerge;
  4996. }
  4997. }
  4998. }
  4999. function mergeHook(f1, f2) {
  5000. var merged = function (a, b) {
  5001. // flow complains about extra args which is why we use any
  5002. f1(a, b);
  5003. f2(a, b);
  5004. };
  5005. merged._merged = true;
  5006. return merged;
  5007. }
  5008. // transform component v-model info (value and callback) into
  5009. // prop and event handler respectively.
  5010. function transformModel(options, data) {
  5011. var prop = (options.model && options.model.prop) || 'value';
  5012. var event = (options.model && options.model.event) || 'input';
  5013. (data.attrs || (data.attrs = {}))[prop] = data.model.value;
  5014. var on = data.on || (data.on = {});
  5015. var existing = on[event];
  5016. var callback = data.model.callback;
  5017. if (isDef(existing)) {
  5018. if (isArray(existing)
  5019. ? existing.indexOf(callback) === -1
  5020. : existing !== callback) {
  5021. on[event] = [callback].concat(existing);
  5022. }
  5023. }
  5024. else {
  5025. on[event] = callback;
  5026. }
  5027. }
  5028. var warn$2 = noop;
  5029. var tip = noop;
  5030. var generateComponentTrace; // work around flow check
  5031. var formatComponentName;
  5032. {
  5033. var hasConsole_1 = typeof console !== 'undefined';
  5034. var classifyRE_1 = /(?:^|[-_])(\w)/g;
  5035. var classify_1 = function (str) {
  5036. return str.replace(classifyRE_1, function (c) { return c.toUpperCase(); }).replace(/[-_]/g, '');
  5037. };
  5038. warn$2 = function (msg, vm) {
  5039. if (vm === void 0) { vm = currentInstance; }
  5040. var trace = vm ? generateComponentTrace(vm) : '';
  5041. if (config.warnHandler) {
  5042. config.warnHandler.call(null, msg, vm, trace);
  5043. }
  5044. else if (hasConsole_1 && !config.silent) {
  5045. console.error("[Vue warn]: ".concat(msg).concat(trace));
  5046. }
  5047. };
  5048. tip = function (msg, vm) {
  5049. if (hasConsole_1 && !config.silent) {
  5050. console.warn("[Vue tip]: ".concat(msg) + (vm ? generateComponentTrace(vm) : ''));
  5051. }
  5052. };
  5053. formatComponentName = function (vm, includeFile) {
  5054. if (vm.$root === vm) {
  5055. return '<Root>';
  5056. }
  5057. var options = isFunction(vm) && vm.cid != null
  5058. ? vm.options
  5059. : vm._isVue
  5060. ? vm.$options || vm.constructor.options
  5061. : vm;
  5062. var name = getComponentName(options);
  5063. var file = options.__file;
  5064. if (!name && file) {
  5065. var match = file.match(/([^/\\]+)\.vue$/);
  5066. name = match && match[1];
  5067. }
  5068. return ((name ? "<".concat(classify_1(name), ">") : "<Anonymous>") +
  5069. (file && includeFile !== false ? " at ".concat(file) : ''));
  5070. };
  5071. var repeat_1 = function (str, n) {
  5072. var res = '';
  5073. while (n) {
  5074. if (n % 2 === 1)
  5075. res += str;
  5076. if (n > 1)
  5077. str += str;
  5078. n >>= 1;
  5079. }
  5080. return res;
  5081. };
  5082. generateComponentTrace = function (vm) {
  5083. if (vm._isVue && vm.$parent) {
  5084. var tree = [];
  5085. var currentRecursiveSequence = 0;
  5086. while (vm) {
  5087. if (tree.length > 0) {
  5088. var last = tree[tree.length - 1];
  5089. if (last.constructor === vm.constructor) {
  5090. currentRecursiveSequence++;
  5091. vm = vm.$parent;
  5092. continue;
  5093. }
  5094. else if (currentRecursiveSequence > 0) {
  5095. tree[tree.length - 1] = [last, currentRecursiveSequence];
  5096. currentRecursiveSequence = 0;
  5097. }
  5098. }
  5099. tree.push(vm);
  5100. vm = vm.$parent;
  5101. }
  5102. return ('\n\nfound in\n\n' +
  5103. tree
  5104. .map(function (vm, i) {
  5105. return "".concat(i === 0 ? '---> ' : repeat_1(' ', 5 + i * 2)).concat(isArray(vm)
  5106. ? "".concat(formatComponentName(vm[0]), "... (").concat(vm[1], " recursive calls)")
  5107. : formatComponentName(vm));
  5108. })
  5109. .join('\n'));
  5110. }
  5111. else {
  5112. return "\n\n(found in ".concat(formatComponentName(vm), ")");
  5113. }
  5114. };
  5115. }
  5116. /**
  5117. * Option overwriting strategies are functions that handle
  5118. * how to merge a parent option value and a child option
  5119. * value into the final value.
  5120. */
  5121. var strats = config.optionMergeStrategies;
  5122. /**
  5123. * Options with restrictions
  5124. */
  5125. {
  5126. strats.el = strats.propsData = function (parent, child, vm, key) {
  5127. if (!vm) {
  5128. warn$2("option \"".concat(key, "\" can only be used during instance ") +
  5129. 'creation with the `new` keyword.');
  5130. }
  5131. return defaultStrat(parent, child);
  5132. };
  5133. }
  5134. /**
  5135. * Helper that recursively merges two data objects together.
  5136. */
  5137. function mergeData(to, from, recursive) {
  5138. if (recursive === void 0) { recursive = true; }
  5139. if (!from)
  5140. return to;
  5141. var key, toVal, fromVal;
  5142. var keys = hasSymbol
  5143. ? Reflect.ownKeys(from)
  5144. : Object.keys(from);
  5145. for (var i = 0; i < keys.length; i++) {
  5146. key = keys[i];
  5147. // in case the object is already observed...
  5148. if (key === '__ob__')
  5149. continue;
  5150. toVal = to[key];
  5151. fromVal = from[key];
  5152. if (!recursive || !hasOwn(to, key)) {
  5153. set(to, key, fromVal);
  5154. }
  5155. else if (toVal !== fromVal &&
  5156. isPlainObject(toVal) &&
  5157. isPlainObject(fromVal)) {
  5158. mergeData(toVal, fromVal);
  5159. }
  5160. }
  5161. return to;
  5162. }
  5163. /**
  5164. * Data
  5165. */
  5166. function mergeDataOrFn(parentVal, childVal, vm) {
  5167. if (!vm) {
  5168. // in a Vue.extend merge, both should be functions
  5169. if (!childVal) {
  5170. return parentVal;
  5171. }
  5172. if (!parentVal) {
  5173. return childVal;
  5174. }
  5175. // when parentVal & childVal are both present,
  5176. // we need to return a function that returns the
  5177. // merged result of both functions... no need to
  5178. // check if parentVal is a function here because
  5179. // it has to be a function to pass previous merges.
  5180. return function mergedDataFn() {
  5181. return mergeData(isFunction(childVal) ? childVal.call(this, this) : childVal, isFunction(parentVal) ? parentVal.call(this, this) : parentVal);
  5182. };
  5183. }
  5184. else {
  5185. return function mergedInstanceDataFn() {
  5186. // instance merge
  5187. var instanceData = isFunction(childVal)
  5188. ? childVal.call(vm, vm)
  5189. : childVal;
  5190. var defaultData = isFunction(parentVal)
  5191. ? parentVal.call(vm, vm)
  5192. : parentVal;
  5193. if (instanceData) {
  5194. return mergeData(instanceData, defaultData);
  5195. }
  5196. else {
  5197. return defaultData;
  5198. }
  5199. };
  5200. }
  5201. }
  5202. strats.data = function (parentVal, childVal, vm) {
  5203. if (!vm) {
  5204. if (childVal && typeof childVal !== 'function') {
  5205. warn$2('The "data" option should be a function ' +
  5206. 'that returns a per-instance value in component ' +
  5207. 'definitions.', vm);
  5208. return parentVal;
  5209. }
  5210. return mergeDataOrFn(parentVal, childVal);
  5211. }
  5212. return mergeDataOrFn(parentVal, childVal, vm);
  5213. };
  5214. /**
  5215. * Hooks and props are merged as arrays.
  5216. */
  5217. function mergeLifecycleHook(parentVal, childVal) {
  5218. var res = childVal
  5219. ? parentVal
  5220. ? parentVal.concat(childVal)
  5221. : isArray(childVal)
  5222. ? childVal
  5223. : [childVal]
  5224. : parentVal;
  5225. return res ? dedupeHooks(res) : res;
  5226. }
  5227. function dedupeHooks(hooks) {
  5228. var res = [];
  5229. for (var i = 0; i < hooks.length; i++) {
  5230. if (res.indexOf(hooks[i]) === -1) {
  5231. res.push(hooks[i]);
  5232. }
  5233. }
  5234. return res;
  5235. }
  5236. LIFECYCLE_HOOKS.forEach(function (hook) {
  5237. strats[hook] = mergeLifecycleHook;
  5238. });
  5239. /**
  5240. * Assets
  5241. *
  5242. * When a vm is present (instance creation), we need to do
  5243. * a three-way merge between constructor options, instance
  5244. * options and parent options.
  5245. */
  5246. function mergeAssets(parentVal, childVal, vm, key) {
  5247. var res = Object.create(parentVal || null);
  5248. if (childVal) {
  5249. assertObjectType(key, childVal, vm);
  5250. return extend(res, childVal);
  5251. }
  5252. else {
  5253. return res;
  5254. }
  5255. }
  5256. ASSET_TYPES.forEach(function (type) {
  5257. strats[type + 's'] = mergeAssets;
  5258. });
  5259. /**
  5260. * Watchers.
  5261. *
  5262. * Watchers hashes should not overwrite one
  5263. * another, so we merge them as arrays.
  5264. */
  5265. strats.watch = function (parentVal, childVal, vm, key) {
  5266. // work around Firefox's Object.prototype.watch...
  5267. //@ts-expect-error work around
  5268. if (parentVal === nativeWatch)
  5269. parentVal = undefined;
  5270. //@ts-expect-error work around
  5271. if (childVal === nativeWatch)
  5272. childVal = undefined;
  5273. /* istanbul ignore if */
  5274. if (!childVal)
  5275. return Object.create(parentVal || null);
  5276. {
  5277. assertObjectType(key, childVal, vm);
  5278. }
  5279. if (!parentVal)
  5280. return childVal;
  5281. var ret = {};
  5282. extend(ret, parentVal);
  5283. for (var key_1 in childVal) {
  5284. var parent_1 = ret[key_1];
  5285. var child = childVal[key_1];
  5286. if (parent_1 && !isArray(parent_1)) {
  5287. parent_1 = [parent_1];
  5288. }
  5289. ret[key_1] = parent_1 ? parent_1.concat(child) : isArray(child) ? child : [child];
  5290. }
  5291. return ret;
  5292. };
  5293. /**
  5294. * Other object hashes.
  5295. */
  5296. strats.props =
  5297. strats.methods =
  5298. strats.inject =
  5299. strats.computed =
  5300. function (parentVal, childVal, vm, key) {
  5301. if (childVal && true) {
  5302. assertObjectType(key, childVal, vm);
  5303. }
  5304. if (!parentVal)
  5305. return childVal;
  5306. var ret = Object.create(null);
  5307. extend(ret, parentVal);
  5308. if (childVal)
  5309. extend(ret, childVal);
  5310. return ret;
  5311. };
  5312. strats.provide = function (parentVal, childVal) {
  5313. if (!parentVal)
  5314. return childVal;
  5315. return function () {
  5316. var ret = Object.create(null);
  5317. mergeData(ret, isFunction(parentVal) ? parentVal.call(this) : parentVal);
  5318. if (childVal) {
  5319. mergeData(ret, isFunction(childVal) ? childVal.call(this) : childVal, false // non-recursive
  5320. );
  5321. }
  5322. return ret;
  5323. };
  5324. };
  5325. /**
  5326. * Default strategy.
  5327. */
  5328. var defaultStrat = function (parentVal, childVal) {
  5329. return childVal === undefined ? parentVal : childVal;
  5330. };
  5331. /**
  5332. * Validate component names
  5333. */
  5334. function checkComponents(options) {
  5335. for (var key in options.components) {
  5336. validateComponentName(key);
  5337. }
  5338. }
  5339. function validateComponentName(name) {
  5340. if (!new RegExp("^[a-zA-Z][\\-\\.0-9_".concat(unicodeRegExp.source, "]*$")).test(name)) {
  5341. warn$2('Invalid component name: "' +
  5342. name +
  5343. '". Component names ' +
  5344. 'should conform to valid custom element name in html5 specification.');
  5345. }
  5346. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  5347. warn$2('Do not use built-in or reserved HTML elements as component ' +
  5348. 'id: ' +
  5349. name);
  5350. }
  5351. }
  5352. /**
  5353. * Ensure all props option syntax are normalized into the
  5354. * Object-based format.
  5355. */
  5356. function normalizeProps(options, vm) {
  5357. var props = options.props;
  5358. if (!props)
  5359. return;
  5360. var res = {};
  5361. var i, val, name;
  5362. if (isArray(props)) {
  5363. i = props.length;
  5364. while (i--) {
  5365. val = props[i];
  5366. if (typeof val === 'string') {
  5367. name = camelize(val);
  5368. res[name] = { type: null };
  5369. }
  5370. else {
  5371. warn$2('props must be strings when using array syntax.');
  5372. }
  5373. }
  5374. }
  5375. else if (isPlainObject(props)) {
  5376. for (var key in props) {
  5377. val = props[key];
  5378. name = camelize(key);
  5379. res[name] = isPlainObject(val) ? val : { type: val };
  5380. }
  5381. }
  5382. else {
  5383. warn$2("Invalid value for option \"props\": expected an Array or an Object, " +
  5384. "but got ".concat(toRawType(props), "."), vm);
  5385. }
  5386. options.props = res;
  5387. }
  5388. /**
  5389. * Normalize all injections into Object-based format
  5390. */
  5391. function normalizeInject(options, vm) {
  5392. var inject = options.inject;
  5393. if (!inject)
  5394. return;
  5395. var normalized = (options.inject = {});
  5396. if (isArray(inject)) {
  5397. for (var i = 0; i < inject.length; i++) {
  5398. normalized[inject[i]] = { from: inject[i] };
  5399. }
  5400. }
  5401. else if (isPlainObject(inject)) {
  5402. for (var key in inject) {
  5403. var val = inject[key];
  5404. normalized[key] = isPlainObject(val)
  5405. ? extend({ from: key }, val)
  5406. : { from: val };
  5407. }
  5408. }
  5409. else {
  5410. warn$2("Invalid value for option \"inject\": expected an Array or an Object, " +
  5411. "but got ".concat(toRawType(inject), "."), vm);
  5412. }
  5413. }
  5414. /**
  5415. * Normalize raw function directives into object format.
  5416. */
  5417. function normalizeDirectives$1(options) {
  5418. var dirs = options.directives;
  5419. if (dirs) {
  5420. for (var key in dirs) {
  5421. var def = dirs[key];
  5422. if (isFunction(def)) {
  5423. dirs[key] = { bind: def, update: def };
  5424. }
  5425. }
  5426. }
  5427. }
  5428. function assertObjectType(name, value, vm) {
  5429. if (!isPlainObject(value)) {
  5430. warn$2("Invalid value for option \"".concat(name, "\": expected an Object, ") +
  5431. "but got ".concat(toRawType(value), "."), vm);
  5432. }
  5433. }
  5434. /**
  5435. * Merge two option objects into a new one.
  5436. * Core utility used in both instantiation and inheritance.
  5437. */
  5438. function mergeOptions(parent, child, vm) {
  5439. {
  5440. checkComponents(child);
  5441. }
  5442. if (isFunction(child)) {
  5443. // @ts-expect-error
  5444. child = child.options;
  5445. }
  5446. normalizeProps(child, vm);
  5447. normalizeInject(child, vm);
  5448. normalizeDirectives$1(child);
  5449. // Apply extends and mixins on the child options,
  5450. // but only if it is a raw options object that isn't
  5451. // the result of another mergeOptions call.
  5452. // Only merged options has the _base property.
  5453. if (!child._base) {
  5454. if (child.extends) {
  5455. parent = mergeOptions(parent, child.extends, vm);
  5456. }
  5457. if (child.mixins) {
  5458. for (var i = 0, l = child.mixins.length; i < l; i++) {
  5459. parent = mergeOptions(parent, child.mixins[i], vm);
  5460. }
  5461. }
  5462. }
  5463. var options = {};
  5464. var key;
  5465. for (key in parent) {
  5466. mergeField(key);
  5467. }
  5468. for (key in child) {
  5469. if (!hasOwn(parent, key)) {
  5470. mergeField(key);
  5471. }
  5472. }
  5473. function mergeField(key) {
  5474. var strat = strats[key] || defaultStrat;
  5475. options[key] = strat(parent[key], child[key], vm, key);
  5476. }
  5477. return options;
  5478. }
  5479. /**
  5480. * Resolve an asset.
  5481. * This function is used because child instances need access
  5482. * to assets defined in its ancestor chain.
  5483. */
  5484. function resolveAsset(options, type, id, warnMissing) {
  5485. /* istanbul ignore if */
  5486. if (typeof id !== 'string') {
  5487. return;
  5488. }
  5489. var assets = options[type];
  5490. // check local registration variations first
  5491. if (hasOwn(assets, id))
  5492. return assets[id];
  5493. var camelizedId = camelize(id);
  5494. if (hasOwn(assets, camelizedId))
  5495. return assets[camelizedId];
  5496. var PascalCaseId = capitalize(camelizedId);
  5497. if (hasOwn(assets, PascalCaseId))
  5498. return assets[PascalCaseId];
  5499. // fallback to prototype chain
  5500. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  5501. if (warnMissing && !res) {
  5502. warn$2('Failed to resolve ' + type.slice(0, -1) + ': ' + id);
  5503. }
  5504. return res;
  5505. }
  5506. function validateProp(key, propOptions, propsData, vm) {
  5507. var prop = propOptions[key];
  5508. var absent = !hasOwn(propsData, key);
  5509. var value = propsData[key];
  5510. // boolean casting
  5511. var booleanIndex = getTypeIndex(Boolean, prop.type);
  5512. if (booleanIndex > -1) {
  5513. if (absent && !hasOwn(prop, 'default')) {
  5514. value = false;
  5515. }
  5516. else if (value === '' || value === hyphenate(key)) {
  5517. // only cast empty string / same name to boolean if
  5518. // boolean has higher priority
  5519. var stringIndex = getTypeIndex(String, prop.type);
  5520. if (stringIndex < 0 || booleanIndex < stringIndex) {
  5521. value = true;
  5522. }
  5523. }
  5524. }
  5525. // check default value
  5526. if (value === undefined) {
  5527. value = getPropDefaultValue(vm, prop, key);
  5528. // since the default value is a fresh copy,
  5529. // make sure to observe it.
  5530. var prevShouldObserve = shouldObserve;
  5531. toggleObserving(true);
  5532. observe(value);
  5533. toggleObserving(prevShouldObserve);
  5534. }
  5535. {
  5536. assertProp(prop, key, value, vm, absent);
  5537. }
  5538. return value;
  5539. }
  5540. /**
  5541. * Get the default value of a prop.
  5542. */
  5543. function getPropDefaultValue(vm, prop, key) {
  5544. // no default, return undefined
  5545. if (!hasOwn(prop, 'default')) {
  5546. return undefined;
  5547. }
  5548. var def = prop.default;
  5549. // warn against non-factory defaults for Object & Array
  5550. if (isObject(def)) {
  5551. warn$2('Invalid default value for prop "' +
  5552. key +
  5553. '": ' +
  5554. 'Props with type Object/Array must use a factory function ' +
  5555. 'to return the default value.', vm);
  5556. }
  5557. // the raw prop value was also undefined from previous render,
  5558. // return previous default value to avoid unnecessary watcher trigger
  5559. if (vm &&
  5560. vm.$options.propsData &&
  5561. vm.$options.propsData[key] === undefined &&
  5562. vm._props[key] !== undefined) {
  5563. return vm._props[key];
  5564. }
  5565. // call factory function for non-Function types
  5566. // a value is Function if its prototype is function even across different execution context
  5567. return isFunction(def) && getType(prop.type) !== 'Function'
  5568. ? def.call(vm)
  5569. : def;
  5570. }
  5571. /**
  5572. * Assert whether a prop is valid.
  5573. */
  5574. function assertProp(prop, name, value, vm, absent) {
  5575. if (prop.required && absent) {
  5576. warn$2('Missing required prop: "' + name + '"', vm);
  5577. return;
  5578. }
  5579. if (value == null && !prop.required) {
  5580. return;
  5581. }
  5582. var type = prop.type;
  5583. var valid = !type || type === true;
  5584. var expectedTypes = [];
  5585. if (type) {
  5586. if (!isArray(type)) {
  5587. type = [type];
  5588. }
  5589. for (var i = 0; i < type.length && !valid; i++) {
  5590. var assertedType = assertType(value, type[i], vm);
  5591. expectedTypes.push(assertedType.expectedType || '');
  5592. valid = assertedType.valid;
  5593. }
  5594. }
  5595. var haveExpectedTypes = expectedTypes.some(function (t) { return t; });
  5596. if (!valid && haveExpectedTypes) {
  5597. warn$2(getInvalidTypeMessage(name, value, expectedTypes), vm);
  5598. return;
  5599. }
  5600. var validator = prop.validator;
  5601. if (validator) {
  5602. if (!validator(value)) {
  5603. warn$2('Invalid prop: custom validator check failed for prop "' + name + '".', vm);
  5604. }
  5605. }
  5606. }
  5607. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol|BigInt)$/;
  5608. function assertType(value, type, vm) {
  5609. var valid;
  5610. var expectedType = getType(type);
  5611. if (simpleCheckRE.test(expectedType)) {
  5612. var t = typeof value;
  5613. valid = t === expectedType.toLowerCase();
  5614. // for primitive wrapper objects
  5615. if (!valid && t === 'object') {
  5616. valid = value instanceof type;
  5617. }
  5618. }
  5619. else if (expectedType === 'Object') {
  5620. valid = isPlainObject(value);
  5621. }
  5622. else if (expectedType === 'Array') {
  5623. valid = isArray(value);
  5624. }
  5625. else {
  5626. try {
  5627. valid = value instanceof type;
  5628. }
  5629. catch (e) {
  5630. warn$2('Invalid prop type: "' + String(type) + '" is not a constructor', vm);
  5631. valid = false;
  5632. }
  5633. }
  5634. return {
  5635. valid: valid,
  5636. expectedType: expectedType
  5637. };
  5638. }
  5639. var functionTypeCheckRE = /^\s*function (\w+)/;
  5640. /**
  5641. * Use function string name to check built-in types,
  5642. * because a simple equality check will fail when running
  5643. * across different vms / iframes.
  5644. */
  5645. function getType(fn) {
  5646. var match = fn && fn.toString().match(functionTypeCheckRE);
  5647. return match ? match[1] : '';
  5648. }
  5649. function isSameType(a, b) {
  5650. return getType(a) === getType(b);
  5651. }
  5652. function getTypeIndex(type, expectedTypes) {
  5653. if (!isArray(expectedTypes)) {
  5654. return isSameType(expectedTypes, type) ? 0 : -1;
  5655. }
  5656. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  5657. if (isSameType(expectedTypes[i], type)) {
  5658. return i;
  5659. }
  5660. }
  5661. return -1;
  5662. }
  5663. function getInvalidTypeMessage(name, value, expectedTypes) {
  5664. var message = "Invalid prop: type check failed for prop \"".concat(name, "\".") +
  5665. " Expected ".concat(expectedTypes.map(capitalize).join(', '));
  5666. var expectedType = expectedTypes[0];
  5667. var receivedType = toRawType(value);
  5668. // check if we need to specify expected value
  5669. if (expectedTypes.length === 1 &&
  5670. isExplicable(expectedType) &&
  5671. isExplicable(typeof value) &&
  5672. !isBoolean(expectedType, receivedType)) {
  5673. message += " with value ".concat(styleValue(value, expectedType));
  5674. }
  5675. message += ", got ".concat(receivedType, " ");
  5676. // check if we need to specify received value
  5677. if (isExplicable(receivedType)) {
  5678. message += "with value ".concat(styleValue(value, receivedType), ".");
  5679. }
  5680. return message;
  5681. }
  5682. function styleValue(value, type) {
  5683. if (type === 'String') {
  5684. return "\"".concat(value, "\"");
  5685. }
  5686. else if (type === 'Number') {
  5687. return "".concat(Number(value));
  5688. }
  5689. else {
  5690. return "".concat(value);
  5691. }
  5692. }
  5693. var EXPLICABLE_TYPES = ['string', 'number', 'boolean'];
  5694. function isExplicable(value) {
  5695. return EXPLICABLE_TYPES.some(function (elem) { return value.toLowerCase() === elem; });
  5696. }
  5697. function isBoolean() {
  5698. var args = [];
  5699. for (var _i = 0; _i < arguments.length; _i++) {
  5700. args[_i] = arguments[_i];
  5701. }
  5702. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; });
  5703. }
  5704. function Vue(options) {
  5705. if (!(this instanceof Vue)) {
  5706. warn$2('Vue is a constructor and should be called with the `new` keyword');
  5707. }
  5708. this._init(options);
  5709. }
  5710. //@ts-expect-error Vue has function type
  5711. initMixin$1(Vue);
  5712. //@ts-expect-error Vue has function type
  5713. stateMixin(Vue);
  5714. //@ts-expect-error Vue has function type
  5715. eventsMixin(Vue);
  5716. //@ts-expect-error Vue has function type
  5717. lifecycleMixin(Vue);
  5718. //@ts-expect-error Vue has function type
  5719. renderMixin(Vue);
  5720. function initUse(Vue) {
  5721. Vue.use = function (plugin) {
  5722. var installedPlugins = this._installedPlugins || (this._installedPlugins = []);
  5723. if (installedPlugins.indexOf(plugin) > -1) {
  5724. return this;
  5725. }
  5726. // additional parameters
  5727. var args = toArray(arguments, 1);
  5728. args.unshift(this);
  5729. if (isFunction(plugin.install)) {
  5730. plugin.install.apply(plugin, args);
  5731. }
  5732. else if (isFunction(plugin)) {
  5733. plugin.apply(null, args);
  5734. }
  5735. installedPlugins.push(plugin);
  5736. return this;
  5737. };
  5738. }
  5739. function initMixin(Vue) {
  5740. Vue.mixin = function (mixin) {
  5741. this.options = mergeOptions(this.options, mixin);
  5742. return this;
  5743. };
  5744. }
  5745. function initExtend(Vue) {
  5746. /**
  5747. * Each instance constructor, including Vue, has a unique
  5748. * cid. This enables us to create wrapped "child
  5749. * constructors" for prototypal inheritance and cache them.
  5750. */
  5751. Vue.cid = 0;
  5752. var cid = 1;
  5753. /**
  5754. * Class inheritance
  5755. */
  5756. Vue.extend = function (extendOptions) {
  5757. extendOptions = extendOptions || {};
  5758. var Super = this;
  5759. var SuperId = Super.cid;
  5760. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  5761. if (cachedCtors[SuperId]) {
  5762. return cachedCtors[SuperId];
  5763. }
  5764. var name = getComponentName(extendOptions) || getComponentName(Super.options);
  5765. if (name) {
  5766. validateComponentName(name);
  5767. }
  5768. var Sub = function VueComponent(options) {
  5769. this._init(options);
  5770. };
  5771. Sub.prototype = Object.create(Super.prototype);
  5772. Sub.prototype.constructor = Sub;
  5773. Sub.cid = cid++;
  5774. Sub.options = mergeOptions(Super.options, extendOptions);
  5775. Sub['super'] = Super;
  5776. // For props and computed properties, we define the proxy getters on
  5777. // the Vue instances at extension time, on the extended prototype. This
  5778. // avoids Object.defineProperty calls for each instance created.
  5779. if (Sub.options.props) {
  5780. initProps(Sub);
  5781. }
  5782. if (Sub.options.computed) {
  5783. initComputed(Sub);
  5784. }
  5785. // allow further extension/mixin/plugin usage
  5786. Sub.extend = Super.extend;
  5787. Sub.mixin = Super.mixin;
  5788. Sub.use = Super.use;
  5789. // create asset registers, so extended classes
  5790. // can have their private assets too.
  5791. ASSET_TYPES.forEach(function (type) {
  5792. Sub[type] = Super[type];
  5793. });
  5794. // enable recursive self-lookup
  5795. if (name) {
  5796. Sub.options.components[name] = Sub;
  5797. }
  5798. // keep a reference to the super options at extension time.
  5799. // later at instantiation we can check if Super's options have
  5800. // been updated.
  5801. Sub.superOptions = Super.options;
  5802. Sub.extendOptions = extendOptions;
  5803. Sub.sealedOptions = extend({}, Sub.options);
  5804. // cache constructor
  5805. cachedCtors[SuperId] = Sub;
  5806. return Sub;
  5807. };
  5808. }
  5809. function initProps(Comp) {
  5810. var props = Comp.options.props;
  5811. for (var key in props) {
  5812. proxy(Comp.prototype, "_props", key);
  5813. }
  5814. }
  5815. function initComputed(Comp) {
  5816. var computed = Comp.options.computed;
  5817. for (var key in computed) {
  5818. defineComputed(Comp.prototype, key, computed[key]);
  5819. }
  5820. }
  5821. function initAssetRegisters(Vue) {
  5822. /**
  5823. * Create asset registration methods.
  5824. */
  5825. ASSET_TYPES.forEach(function (type) {
  5826. // @ts-expect-error function is not exact same type
  5827. Vue[type] = function (id, definition) {
  5828. if (!definition) {
  5829. return this.options[type + 's'][id];
  5830. }
  5831. else {
  5832. /* istanbul ignore if */
  5833. if (type === 'component') {
  5834. validateComponentName(id);
  5835. }
  5836. if (type === 'component' && isPlainObject(definition)) {
  5837. // @ts-expect-error
  5838. definition.name = definition.name || id;
  5839. definition = this.options._base.extend(definition);
  5840. }
  5841. if (type === 'directive' && isFunction(definition)) {
  5842. definition = { bind: definition, update: definition };
  5843. }
  5844. this.options[type + 's'][id] = definition;
  5845. return definition;
  5846. }
  5847. };
  5848. });
  5849. }
  5850. function _getComponentName(opts) {
  5851. return opts && (getComponentName(opts.Ctor.options) || opts.tag);
  5852. }
  5853. function matches(pattern, name) {
  5854. if (isArray(pattern)) {
  5855. return pattern.indexOf(name) > -1;
  5856. }
  5857. else if (typeof pattern === 'string') {
  5858. return pattern.split(',').indexOf(name) > -1;
  5859. }
  5860. else if (isRegExp(pattern)) {
  5861. return pattern.test(name);
  5862. }
  5863. /* istanbul ignore next */
  5864. return false;
  5865. }
  5866. function pruneCache(keepAliveInstance, filter) {
  5867. var cache = keepAliveInstance.cache, keys = keepAliveInstance.keys, _vnode = keepAliveInstance._vnode;
  5868. for (var key in cache) {
  5869. var entry = cache[key];
  5870. if (entry) {
  5871. var name_1 = entry.name;
  5872. if (name_1 && !filter(name_1)) {
  5873. pruneCacheEntry(cache, key, keys, _vnode);
  5874. }
  5875. }
  5876. }
  5877. }
  5878. function pruneCacheEntry(cache, key, keys, current) {
  5879. var entry = cache[key];
  5880. if (entry && (!current || entry.tag !== current.tag)) {
  5881. // @ts-expect-error can be undefined
  5882. entry.componentInstance.$destroy();
  5883. }
  5884. cache[key] = null;
  5885. remove$2(keys, key);
  5886. }
  5887. var patternTypes = [String, RegExp, Array];
  5888. // TODO defineComponent
  5889. var KeepAlive = {
  5890. name: 'keep-alive',
  5891. abstract: true,
  5892. props: {
  5893. include: patternTypes,
  5894. exclude: patternTypes,
  5895. max: [String, Number]
  5896. },
  5897. methods: {
  5898. cacheVNode: function () {
  5899. var _a = this, cache = _a.cache, keys = _a.keys, vnodeToCache = _a.vnodeToCache, keyToCache = _a.keyToCache;
  5900. if (vnodeToCache) {
  5901. var tag = vnodeToCache.tag, componentInstance = vnodeToCache.componentInstance, componentOptions = vnodeToCache.componentOptions;
  5902. cache[keyToCache] = {
  5903. name: _getComponentName(componentOptions),
  5904. tag: tag,
  5905. componentInstance: componentInstance
  5906. };
  5907. keys.push(keyToCache);
  5908. // prune oldest entry
  5909. if (this.max && keys.length > parseInt(this.max)) {
  5910. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  5911. }
  5912. this.vnodeToCache = null;
  5913. }
  5914. }
  5915. },
  5916. created: function () {
  5917. this.cache = Object.create(null);
  5918. this.keys = [];
  5919. },
  5920. destroyed: function () {
  5921. for (var key in this.cache) {
  5922. pruneCacheEntry(this.cache, key, this.keys);
  5923. }
  5924. },
  5925. mounted: function () {
  5926. var _this = this;
  5927. this.cacheVNode();
  5928. this.$watch('include', function (val) {
  5929. pruneCache(_this, function (name) { return matches(val, name); });
  5930. });
  5931. this.$watch('exclude', function (val) {
  5932. pruneCache(_this, function (name) { return !matches(val, name); });
  5933. });
  5934. },
  5935. updated: function () {
  5936. this.cacheVNode();
  5937. },
  5938. render: function () {
  5939. var slot = this.$slots.default;
  5940. var vnode = getFirstComponentChild(slot);
  5941. var componentOptions = vnode && vnode.componentOptions;
  5942. if (componentOptions) {
  5943. // check pattern
  5944. var name_2 = _getComponentName(componentOptions);
  5945. var _a = this, include = _a.include, exclude = _a.exclude;
  5946. if (
  5947. // not included
  5948. (include && (!name_2 || !matches(include, name_2))) ||
  5949. // excluded
  5950. (exclude && name_2 && matches(exclude, name_2))) {
  5951. return vnode;
  5952. }
  5953. var _b = this, cache = _b.cache, keys = _b.keys;
  5954. var key = vnode.key == null
  5955. ? // same constructor may get registered as different local components
  5956. // so cid alone is not enough (#3269)
  5957. componentOptions.Ctor.cid +
  5958. (componentOptions.tag ? "::".concat(componentOptions.tag) : '')
  5959. : vnode.key;
  5960. if (cache[key]) {
  5961. vnode.componentInstance = cache[key].componentInstance;
  5962. // make current key freshest
  5963. remove$2(keys, key);
  5964. keys.push(key);
  5965. }
  5966. else {
  5967. // delay setting the cache until update
  5968. this.vnodeToCache = vnode;
  5969. this.keyToCache = key;
  5970. }
  5971. // @ts-expect-error can vnode.data can be undefined
  5972. vnode.data.keepAlive = true;
  5973. }
  5974. return vnode || (slot && slot[0]);
  5975. }
  5976. };
  5977. var builtInComponents = {
  5978. KeepAlive: KeepAlive
  5979. };
  5980. function initGlobalAPI(Vue) {
  5981. // config
  5982. var configDef = {};
  5983. configDef.get = function () { return config; };
  5984. {
  5985. configDef.set = function () {
  5986. warn$2('Do not replace the Vue.config object, set individual fields instead.');
  5987. };
  5988. }
  5989. Object.defineProperty(Vue, 'config', configDef);
  5990. // exposed util methods.
  5991. // NOTE: these are not considered part of the public API - avoid relying on
  5992. // them unless you are aware of the risk.
  5993. Vue.util = {
  5994. warn: warn$2,
  5995. extend: extend,
  5996. mergeOptions: mergeOptions,
  5997. defineReactive: defineReactive
  5998. };
  5999. Vue.set = set;
  6000. Vue.delete = del;
  6001. Vue.nextTick = nextTick;
  6002. // 2.6 explicit observable API
  6003. Vue.observable = function (obj) {
  6004. observe(obj);
  6005. return obj;
  6006. };
  6007. Vue.options = Object.create(null);
  6008. ASSET_TYPES.forEach(function (type) {
  6009. Vue.options[type + 's'] = Object.create(null);
  6010. });
  6011. // this is used to identify the "base" constructor to extend all plain-object
  6012. // components with in Weex's multi-instance scenarios.
  6013. Vue.options._base = Vue;
  6014. extend(Vue.options.components, builtInComponents);
  6015. initUse(Vue);
  6016. initMixin(Vue);
  6017. initExtend(Vue);
  6018. initAssetRegisters(Vue);
  6019. }
  6020. initGlobalAPI(Vue);
  6021. Object.defineProperty(Vue.prototype, '$isServer', {
  6022. get: isServerRendering
  6023. });
  6024. Object.defineProperty(Vue.prototype, '$ssrContext', {
  6025. get: function () {
  6026. /* istanbul ignore next */
  6027. return this.$vnode && this.$vnode.ssrContext;
  6028. }
  6029. });
  6030. // expose FunctionalRenderContext for ssr runtime helper installation
  6031. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  6032. value: FunctionalRenderContext
  6033. });
  6034. Vue.version = version;
  6035. // these are reserved for web because they are directly compiled away
  6036. // during template compilation
  6037. var isReservedAttr = makeMap('style,class');
  6038. // attributes that should be using props for binding
  6039. var acceptValue = makeMap('input,textarea,option,select,progress');
  6040. var mustUseProp = function (tag, type, attr) {
  6041. return ((attr === 'value' && acceptValue(tag) && type !== 'button') ||
  6042. (attr === 'selected' && tag === 'option') ||
  6043. (attr === 'checked' && tag === 'input') ||
  6044. (attr === 'muted' && tag === 'video'));
  6045. };
  6046. var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');
  6047. var isValidContentEditableValue = makeMap('events,caret,typing,plaintext-only');
  6048. var convertEnumeratedValue = function (key, value) {
  6049. return isFalsyAttrValue(value) || value === 'false'
  6050. ? 'false'
  6051. : // allow arbitrary string value for contenteditable
  6052. key === 'contenteditable' && isValidContentEditableValue(value)
  6053. ? value
  6054. : 'true';
  6055. };
  6056. var isBooleanAttr = makeMap('allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +
  6057. 'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +
  6058. 'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +
  6059. 'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +
  6060. 'required,reversed,scoped,seamless,selected,sortable,' +
  6061. 'truespeed,typemustmatch,visible');
  6062. var xlinkNS = 'http://www.w3.org/1999/xlink';
  6063. var isXlink = function (name) {
  6064. return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink';
  6065. };
  6066. var getXlinkProp = function (name) {
  6067. return isXlink(name) ? name.slice(6, name.length) : '';
  6068. };
  6069. var isFalsyAttrValue = function (val) {
  6070. return val == null || val === false;
  6071. };
  6072. function genClassForVnode(vnode) {
  6073. var data = vnode.data;
  6074. var parentNode = vnode;
  6075. var childNode = vnode;
  6076. while (isDef(childNode.componentInstance)) {
  6077. childNode = childNode.componentInstance._vnode;
  6078. if (childNode && childNode.data) {
  6079. data = mergeClassData(childNode.data, data);
  6080. }
  6081. }
  6082. // @ts-expect-error parentNode.parent not VNodeWithData
  6083. while (isDef((parentNode = parentNode.parent))) {
  6084. if (parentNode && parentNode.data) {
  6085. data = mergeClassData(data, parentNode.data);
  6086. }
  6087. }
  6088. return renderClass(data.staticClass, data.class);
  6089. }
  6090. function mergeClassData(child, parent) {
  6091. return {
  6092. staticClass: concat(child.staticClass, parent.staticClass),
  6093. class: isDef(child.class) ? [child.class, parent.class] : parent.class
  6094. };
  6095. }
  6096. function renderClass(staticClass, dynamicClass) {
  6097. if (isDef(staticClass) || isDef(dynamicClass)) {
  6098. return concat(staticClass, stringifyClass(dynamicClass));
  6099. }
  6100. /* istanbul ignore next */
  6101. return '';
  6102. }
  6103. function concat(a, b) {
  6104. return a ? (b ? a + ' ' + b : a) : b || '';
  6105. }
  6106. function stringifyClass(value) {
  6107. if (Array.isArray(value)) {
  6108. return stringifyArray(value);
  6109. }
  6110. if (isObject(value)) {
  6111. return stringifyObject(value);
  6112. }
  6113. if (typeof value === 'string') {
  6114. return value;
  6115. }
  6116. /* istanbul ignore next */
  6117. return '';
  6118. }
  6119. function stringifyArray(value) {
  6120. var res = '';
  6121. var stringified;
  6122. for (var i = 0, l = value.length; i < l; i++) {
  6123. if (isDef((stringified = stringifyClass(value[i]))) && stringified !== '') {
  6124. if (res)
  6125. res += ' ';
  6126. res += stringified;
  6127. }
  6128. }
  6129. return res;
  6130. }
  6131. function stringifyObject(value) {
  6132. var res = '';
  6133. for (var key in value) {
  6134. if (value[key]) {
  6135. if (res)
  6136. res += ' ';
  6137. res += key;
  6138. }
  6139. }
  6140. return res;
  6141. }
  6142. var namespaceMap = {
  6143. svg: 'http://www.w3.org/2000/svg',
  6144. math: 'http://www.w3.org/1998/Math/MathML'
  6145. };
  6146. var isHTMLTag = makeMap('html,body,base,head,link,meta,style,title,' +
  6147. 'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +
  6148. 'div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,' +
  6149. 'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +
  6150. 's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +
  6151. 'embed,object,param,source,canvas,script,noscript,del,ins,' +
  6152. 'caption,col,colgroup,table,thead,tbody,td,th,tr,' +
  6153. 'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' +
  6154. 'output,progress,select,textarea,' +
  6155. 'details,dialog,menu,menuitem,summary,' +
  6156. 'content,element,shadow,template,blockquote,iframe,tfoot');
  6157. // this map is intentionally selective, only covering SVG elements that may
  6158. // contain child elements.
  6159. var isSVG = makeMap('svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' +
  6160. 'foreignobject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +
  6161. 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view', true);
  6162. var isPreTag = function (tag) { return tag === 'pre'; };
  6163. var isReservedTag = function (tag) {
  6164. return isHTMLTag(tag) || isSVG(tag);
  6165. };
  6166. function getTagNamespace(tag) {
  6167. if (isSVG(tag)) {
  6168. return 'svg';
  6169. }
  6170. // basic support for MathML
  6171. // note it doesn't support other MathML elements being component roots
  6172. if (tag === 'math') {
  6173. return 'math';
  6174. }
  6175. }
  6176. var unknownElementCache = Object.create(null);
  6177. function isUnknownElement(tag) {
  6178. /* istanbul ignore if */
  6179. if (!inBrowser) {
  6180. return true;
  6181. }
  6182. if (isReservedTag(tag)) {
  6183. return false;
  6184. }
  6185. tag = tag.toLowerCase();
  6186. /* istanbul ignore if */
  6187. if (unknownElementCache[tag] != null) {
  6188. return unknownElementCache[tag];
  6189. }
  6190. var el = document.createElement(tag);
  6191. if (tag.indexOf('-') > -1) {
  6192. // https://stackoverflow.com/a/28210364/1070244
  6193. return (unknownElementCache[tag] =
  6194. el.constructor === window.HTMLUnknownElement ||
  6195. el.constructor === window.HTMLElement);
  6196. }
  6197. else {
  6198. return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()));
  6199. }
  6200. }
  6201. var isTextInputType = makeMap('text,number,password,search,email,tel,url');
  6202. /**
  6203. * Query an element selector if it's not an element already.
  6204. */
  6205. function query(el) {
  6206. if (typeof el === 'string') {
  6207. var selected = document.querySelector(el);
  6208. if (!selected) {
  6209. warn$2('Cannot find element: ' + el);
  6210. return document.createElement('div');
  6211. }
  6212. return selected;
  6213. }
  6214. else {
  6215. return el;
  6216. }
  6217. }
  6218. function createElement(tagName, vnode) {
  6219. var elm = document.createElement(tagName);
  6220. if (tagName !== 'select') {
  6221. return elm;
  6222. }
  6223. // false or null will remove the attribute but undefined will not
  6224. if (vnode.data &&
  6225. vnode.data.attrs &&
  6226. vnode.data.attrs.multiple !== undefined) {
  6227. elm.setAttribute('multiple', 'multiple');
  6228. }
  6229. return elm;
  6230. }
  6231. function createElementNS(namespace, tagName) {
  6232. return document.createElementNS(namespaceMap[namespace], tagName);
  6233. }
  6234. function createTextNode(text) {
  6235. return document.createTextNode(text);
  6236. }
  6237. function createComment(text) {
  6238. return document.createComment(text);
  6239. }
  6240. function insertBefore(parentNode, newNode, referenceNode) {
  6241. parentNode.insertBefore(newNode, referenceNode);
  6242. }
  6243. function removeChild(node, child) {
  6244. node.removeChild(child);
  6245. }
  6246. function appendChild(node, child) {
  6247. node.appendChild(child);
  6248. }
  6249. function parentNode(node) {
  6250. return node.parentNode;
  6251. }
  6252. function nextSibling(node) {
  6253. return node.nextSibling;
  6254. }
  6255. function tagName(node) {
  6256. return node.tagName;
  6257. }
  6258. function setTextContent(node, text) {
  6259. node.textContent = text;
  6260. }
  6261. function setStyleScope(node, scopeId) {
  6262. node.setAttribute(scopeId, '');
  6263. }
  6264. var nodeOps = /*#__PURE__*/Object.freeze({
  6265. __proto__: null,
  6266. createElement: createElement,
  6267. createElementNS: createElementNS,
  6268. createTextNode: createTextNode,
  6269. createComment: createComment,
  6270. insertBefore: insertBefore,
  6271. removeChild: removeChild,
  6272. appendChild: appendChild,
  6273. parentNode: parentNode,
  6274. nextSibling: nextSibling,
  6275. tagName: tagName,
  6276. setTextContent: setTextContent,
  6277. setStyleScope: setStyleScope
  6278. });
  6279. var ref = {
  6280. create: function (_, vnode) {
  6281. registerRef(vnode);
  6282. },
  6283. update: function (oldVnode, vnode) {
  6284. if (oldVnode.data.ref !== vnode.data.ref) {
  6285. registerRef(oldVnode, true);
  6286. registerRef(vnode);
  6287. }
  6288. },
  6289. destroy: function (vnode) {
  6290. registerRef(vnode, true);
  6291. }
  6292. };
  6293. function registerRef(vnode, isRemoval) {
  6294. var ref = vnode.data.ref;
  6295. if (!isDef(ref))
  6296. return;
  6297. var vm = vnode.context;
  6298. var refValue = vnode.componentInstance || vnode.elm;
  6299. var value = isRemoval ? null : refValue;
  6300. var $refsValue = isRemoval ? undefined : refValue;
  6301. if (isFunction(ref)) {
  6302. invokeWithErrorHandling(ref, vm, [value], vm, "template ref function");
  6303. return;
  6304. }
  6305. var isFor = vnode.data.refInFor;
  6306. var _isString = typeof ref === 'string' || typeof ref === 'number';
  6307. var _isRef = isRef(ref);
  6308. var refs = vm.$refs;
  6309. if (_isString || _isRef) {
  6310. if (isFor) {
  6311. var existing = _isString ? refs[ref] : ref.value;
  6312. if (isRemoval) {
  6313. isArray(existing) && remove$2(existing, refValue);
  6314. }
  6315. else {
  6316. if (!isArray(existing)) {
  6317. if (_isString) {
  6318. refs[ref] = [refValue];
  6319. setSetupRef(vm, ref, refs[ref]);
  6320. }
  6321. else {
  6322. ref.value = [refValue];
  6323. }
  6324. }
  6325. else if (!existing.includes(refValue)) {
  6326. existing.push(refValue);
  6327. }
  6328. }
  6329. }
  6330. else if (_isString) {
  6331. if (isRemoval && refs[ref] !== refValue) {
  6332. return;
  6333. }
  6334. refs[ref] = $refsValue;
  6335. setSetupRef(vm, ref, value);
  6336. }
  6337. else if (_isRef) {
  6338. if (isRemoval && ref.value !== refValue) {
  6339. return;
  6340. }
  6341. ref.value = value;
  6342. }
  6343. else {
  6344. warn$2("Invalid template ref type: ".concat(typeof ref));
  6345. }
  6346. }
  6347. }
  6348. function setSetupRef(_a, key, val) {
  6349. var _setupState = _a._setupState;
  6350. if (_setupState && hasOwn(_setupState, key)) {
  6351. if (isRef(_setupState[key])) {
  6352. _setupState[key].value = val;
  6353. }
  6354. else {
  6355. _setupState[key] = val;
  6356. }
  6357. }
  6358. }
  6359. /**
  6360. * Virtual DOM patching algorithm based on Snabbdom by
  6361. * Simon Friis Vindum (@paldepind)
  6362. * Licensed under the MIT License
  6363. * https://github.com/paldepind/snabbdom/blob/master/LICENSE
  6364. *
  6365. * modified by Evan You (@yyx990803)
  6366. *
  6367. * Not type-checking this because this file is perf-critical and the cost
  6368. * of making flow understand it is not worth it.
  6369. */
  6370. var emptyNode = new VNode('', {}, []);
  6371. var hooks = ['create', 'activate', 'update', 'remove', 'destroy'];
  6372. function sameVnode(a, b) {
  6373. return (a.key === b.key &&
  6374. a.asyncFactory === b.asyncFactory &&
  6375. ((a.tag === b.tag &&
  6376. a.isComment === b.isComment &&
  6377. isDef(a.data) === isDef(b.data) &&
  6378. sameInputType(a, b)) ||
  6379. (isTrue(a.isAsyncPlaceholder) && isUndef(b.asyncFactory.error))));
  6380. }
  6381. function sameInputType(a, b) {
  6382. if (a.tag !== 'input')
  6383. return true;
  6384. var i;
  6385. var typeA = isDef((i = a.data)) && isDef((i = i.attrs)) && i.type;
  6386. var typeB = isDef((i = b.data)) && isDef((i = i.attrs)) && i.type;
  6387. return typeA === typeB || (isTextInputType(typeA) && isTextInputType(typeB));
  6388. }
  6389. function createKeyToOldIdx(children, beginIdx, endIdx) {
  6390. var i, key;
  6391. var map = {};
  6392. for (i = beginIdx; i <= endIdx; ++i) {
  6393. key = children[i].key;
  6394. if (isDef(key))
  6395. map[key] = i;
  6396. }
  6397. return map;
  6398. }
  6399. function createPatchFunction(backend) {
  6400. var i, j;
  6401. var cbs = {};
  6402. var modules = backend.modules, nodeOps = backend.nodeOps;
  6403. for (i = 0; i < hooks.length; ++i) {
  6404. cbs[hooks[i]] = [];
  6405. for (j = 0; j < modules.length; ++j) {
  6406. if (isDef(modules[j][hooks[i]])) {
  6407. cbs[hooks[i]].push(modules[j][hooks[i]]);
  6408. }
  6409. }
  6410. }
  6411. function emptyNodeAt(elm) {
  6412. return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm);
  6413. }
  6414. function createRmCb(childElm, listeners) {
  6415. function remove() {
  6416. if (--remove.listeners === 0) {
  6417. removeNode(childElm);
  6418. }
  6419. }
  6420. remove.listeners = listeners;
  6421. return remove;
  6422. }
  6423. function removeNode(el) {
  6424. var parent = nodeOps.parentNode(el);
  6425. // element may have already been removed due to v-html / v-text
  6426. if (isDef(parent)) {
  6427. nodeOps.removeChild(parent, el);
  6428. }
  6429. }
  6430. function isUnknownElement(vnode, inVPre) {
  6431. return (!inVPre &&
  6432. !vnode.ns &&
  6433. !(config.ignoredElements.length &&
  6434. config.ignoredElements.some(function (ignore) {
  6435. return isRegExp(ignore)
  6436. ? ignore.test(vnode.tag)
  6437. : ignore === vnode.tag;
  6438. })) &&
  6439. config.isUnknownElement(vnode.tag));
  6440. }
  6441. var creatingElmInVPre = 0;
  6442. function createElm(vnode, insertedVnodeQueue, parentElm, refElm, nested, ownerArray, index) {
  6443. if (isDef(vnode.elm) && isDef(ownerArray)) {
  6444. // This vnode was used in a previous render!
  6445. // now it's used as a new node, overwriting its elm would cause
  6446. // potential patch errors down the road when it's used as an insertion
  6447. // reference node. Instead, we clone the node on-demand before creating
  6448. // associated DOM element for it.
  6449. vnode = ownerArray[index] = cloneVNode(vnode);
  6450. }
  6451. vnode.isRootInsert = !nested; // for transition enter check
  6452. if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) {
  6453. return;
  6454. }
  6455. var data = vnode.data;
  6456. var children = vnode.children;
  6457. var tag = vnode.tag;
  6458. if (isDef(tag)) {
  6459. {
  6460. if (data && data.pre) {
  6461. creatingElmInVPre++;
  6462. }
  6463. if (isUnknownElement(vnode, creatingElmInVPre)) {
  6464. warn$2('Unknown custom element: <' +
  6465. tag +
  6466. '> - did you ' +
  6467. 'register the component correctly? For recursive components, ' +
  6468. 'make sure to provide the "name" option.', vnode.context);
  6469. }
  6470. }
  6471. vnode.elm = vnode.ns
  6472. ? nodeOps.createElementNS(vnode.ns, tag)
  6473. : nodeOps.createElement(tag, vnode);
  6474. setScope(vnode);
  6475. createChildren(vnode, children, insertedVnodeQueue);
  6476. if (isDef(data)) {
  6477. invokeCreateHooks(vnode, insertedVnodeQueue);
  6478. }
  6479. insert(parentElm, vnode.elm, refElm);
  6480. if (data && data.pre) {
  6481. creatingElmInVPre--;
  6482. }
  6483. }
  6484. else if (isTrue(vnode.isComment)) {
  6485. vnode.elm = nodeOps.createComment(vnode.text);
  6486. insert(parentElm, vnode.elm, refElm);
  6487. }
  6488. else {
  6489. vnode.elm = nodeOps.createTextNode(vnode.text);
  6490. insert(parentElm, vnode.elm, refElm);
  6491. }
  6492. }
  6493. function createComponent(vnode, insertedVnodeQueue, parentElm, refElm) {
  6494. var i = vnode.data;
  6495. if (isDef(i)) {
  6496. var isReactivated = isDef(vnode.componentInstance) && i.keepAlive;
  6497. if (isDef((i = i.hook)) && isDef((i = i.init))) {
  6498. i(vnode, false /* hydrating */);
  6499. }
  6500. // after calling the init hook, if the vnode is a child component
  6501. // it should've created a child instance and mounted it. the child
  6502. // component also has set the placeholder vnode's elm.
  6503. // in that case we can just return the element and be done.
  6504. if (isDef(vnode.componentInstance)) {
  6505. initComponent(vnode, insertedVnodeQueue);
  6506. insert(parentElm, vnode.elm, refElm);
  6507. if (isTrue(isReactivated)) {
  6508. reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm);
  6509. }
  6510. return true;
  6511. }
  6512. }
  6513. }
  6514. function initComponent(vnode, insertedVnodeQueue) {
  6515. if (isDef(vnode.data.pendingInsert)) {
  6516. insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert);
  6517. vnode.data.pendingInsert = null;
  6518. }
  6519. vnode.elm = vnode.componentInstance.$el;
  6520. if (isPatchable(vnode)) {
  6521. invokeCreateHooks(vnode, insertedVnodeQueue);
  6522. setScope(vnode);
  6523. }
  6524. else {
  6525. // empty component root.
  6526. // skip all element-related modules except for ref (#3455)
  6527. registerRef(vnode);
  6528. // make sure to invoke the insert hook
  6529. insertedVnodeQueue.push(vnode);
  6530. }
  6531. }
  6532. function reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm) {
  6533. var i;
  6534. // hack for #4339: a reactivated component with inner transition
  6535. // does not trigger because the inner node's created hooks are not called
  6536. // again. It's not ideal to involve module-specific logic in here but
  6537. // there doesn't seem to be a better way to do it.
  6538. var innerNode = vnode;
  6539. while (innerNode.componentInstance) {
  6540. innerNode = innerNode.componentInstance._vnode;
  6541. if (isDef((i = innerNode.data)) && isDef((i = i.transition))) {
  6542. for (i = 0; i < cbs.activate.length; ++i) {
  6543. cbs.activate[i](emptyNode, innerNode);
  6544. }
  6545. insertedVnodeQueue.push(innerNode);
  6546. break;
  6547. }
  6548. }
  6549. // unlike a newly created component,
  6550. // a reactivated keep-alive component doesn't insert itself
  6551. insert(parentElm, vnode.elm, refElm);
  6552. }
  6553. function insert(parent, elm, ref) {
  6554. if (isDef(parent)) {
  6555. if (isDef(ref)) {
  6556. if (nodeOps.parentNode(ref) === parent) {
  6557. nodeOps.insertBefore(parent, elm, ref);
  6558. }
  6559. }
  6560. else {
  6561. nodeOps.appendChild(parent, elm);
  6562. }
  6563. }
  6564. }
  6565. function createChildren(vnode, children, insertedVnodeQueue) {
  6566. if (isArray(children)) {
  6567. {
  6568. checkDuplicateKeys(children);
  6569. }
  6570. for (var i_1 = 0; i_1 < children.length; ++i_1) {
  6571. createElm(children[i_1], insertedVnodeQueue, vnode.elm, null, true, children, i_1);
  6572. }
  6573. }
  6574. else if (isPrimitive(vnode.text)) {
  6575. nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(String(vnode.text)));
  6576. }
  6577. }
  6578. function isPatchable(vnode) {
  6579. while (vnode.componentInstance) {
  6580. vnode = vnode.componentInstance._vnode;
  6581. }
  6582. return isDef(vnode.tag);
  6583. }
  6584. function invokeCreateHooks(vnode, insertedVnodeQueue) {
  6585. for (var i_2 = 0; i_2 < cbs.create.length; ++i_2) {
  6586. cbs.create[i_2](emptyNode, vnode);
  6587. }
  6588. i = vnode.data.hook; // Reuse variable
  6589. if (isDef(i)) {
  6590. if (isDef(i.create))
  6591. i.create(emptyNode, vnode);
  6592. if (isDef(i.insert))
  6593. insertedVnodeQueue.push(vnode);
  6594. }
  6595. }
  6596. // set scope id attribute for scoped CSS.
  6597. // this is implemented as a special case to avoid the overhead
  6598. // of going through the normal attribute patching process.
  6599. function setScope(vnode) {
  6600. var i;
  6601. if (isDef((i = vnode.fnScopeId))) {
  6602. nodeOps.setStyleScope(vnode.elm, i);
  6603. }
  6604. else {
  6605. var ancestor = vnode;
  6606. while (ancestor) {
  6607. if (isDef((i = ancestor.context)) && isDef((i = i.$options._scopeId))) {
  6608. nodeOps.setStyleScope(vnode.elm, i);
  6609. }
  6610. ancestor = ancestor.parent;
  6611. }
  6612. }
  6613. // for slot content they should also get the scopeId from the host instance.
  6614. if (isDef((i = activeInstance)) &&
  6615. i !== vnode.context &&
  6616. i !== vnode.fnContext &&
  6617. isDef((i = i.$options._scopeId))) {
  6618. nodeOps.setStyleScope(vnode.elm, i);
  6619. }
  6620. }
  6621. function addVnodes(parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) {
  6622. for (; startIdx <= endIdx; ++startIdx) {
  6623. createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm, false, vnodes, startIdx);
  6624. }
  6625. }
  6626. function invokeDestroyHook(vnode) {
  6627. var i, j;
  6628. var data = vnode.data;
  6629. if (isDef(data)) {
  6630. if (isDef((i = data.hook)) && isDef((i = i.destroy)))
  6631. i(vnode);
  6632. for (i = 0; i < cbs.destroy.length; ++i)
  6633. cbs.destroy[i](vnode);
  6634. }
  6635. if (isDef((i = vnode.children))) {
  6636. for (j = 0; j < vnode.children.length; ++j) {
  6637. invokeDestroyHook(vnode.children[j]);
  6638. }
  6639. }
  6640. }
  6641. function removeVnodes(vnodes, startIdx, endIdx) {
  6642. for (; startIdx <= endIdx; ++startIdx) {
  6643. var ch = vnodes[startIdx];
  6644. if (isDef(ch)) {
  6645. if (isDef(ch.tag)) {
  6646. removeAndInvokeRemoveHook(ch);
  6647. invokeDestroyHook(ch);
  6648. }
  6649. else {
  6650. // Text node
  6651. removeNode(ch.elm);
  6652. }
  6653. }
  6654. }
  6655. }
  6656. function removeAndInvokeRemoveHook(vnode, rm) {
  6657. if (isDef(rm) || isDef(vnode.data)) {
  6658. var i_3;
  6659. var listeners = cbs.remove.length + 1;
  6660. if (isDef(rm)) {
  6661. // we have a recursively passed down rm callback
  6662. // increase the listeners count
  6663. rm.listeners += listeners;
  6664. }
  6665. else {
  6666. // directly removing
  6667. rm = createRmCb(vnode.elm, listeners);
  6668. }
  6669. // recursively invoke hooks on child component root node
  6670. if (isDef((i_3 = vnode.componentInstance)) &&
  6671. isDef((i_3 = i_3._vnode)) &&
  6672. isDef(i_3.data)) {
  6673. removeAndInvokeRemoveHook(i_3, rm);
  6674. }
  6675. for (i_3 = 0; i_3 < cbs.remove.length; ++i_3) {
  6676. cbs.remove[i_3](vnode, rm);
  6677. }
  6678. if (isDef((i_3 = vnode.data.hook)) && isDef((i_3 = i_3.remove))) {
  6679. i_3(vnode, rm);
  6680. }
  6681. else {
  6682. rm();
  6683. }
  6684. }
  6685. else {
  6686. removeNode(vnode.elm);
  6687. }
  6688. }
  6689. function updateChildren(parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) {
  6690. var oldStartIdx = 0;
  6691. var newStartIdx = 0;
  6692. var oldEndIdx = oldCh.length - 1;
  6693. var oldStartVnode = oldCh[0];
  6694. var oldEndVnode = oldCh[oldEndIdx];
  6695. var newEndIdx = newCh.length - 1;
  6696. var newStartVnode = newCh[0];
  6697. var newEndVnode = newCh[newEndIdx];
  6698. var oldKeyToIdx, idxInOld, vnodeToMove, refElm;
  6699. // removeOnly is a special flag used only by <transition-group>
  6700. // to ensure removed elements stay in correct relative positions
  6701. // during leaving transitions
  6702. var canMove = !removeOnly;
  6703. {
  6704. checkDuplicateKeys(newCh);
  6705. }
  6706. while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
  6707. if (isUndef(oldStartVnode)) {
  6708. oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left
  6709. }
  6710. else if (isUndef(oldEndVnode)) {
  6711. oldEndVnode = oldCh[--oldEndIdx];
  6712. }
  6713. else if (sameVnode(oldStartVnode, newStartVnode)) {
  6714. patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
  6715. oldStartVnode = oldCh[++oldStartIdx];
  6716. newStartVnode = newCh[++newStartIdx];
  6717. }
  6718. else if (sameVnode(oldEndVnode, newEndVnode)) {
  6719. patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);
  6720. oldEndVnode = oldCh[--oldEndIdx];
  6721. newEndVnode = newCh[--newEndIdx];
  6722. }
  6723. else if (sameVnode(oldStartVnode, newEndVnode)) {
  6724. // Vnode moved right
  6725. patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);
  6726. canMove &&
  6727. nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm));
  6728. oldStartVnode = oldCh[++oldStartIdx];
  6729. newEndVnode = newCh[--newEndIdx];
  6730. }
  6731. else if (sameVnode(oldEndVnode, newStartVnode)) {
  6732. // Vnode moved left
  6733. patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
  6734. canMove &&
  6735. nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);
  6736. oldEndVnode = oldCh[--oldEndIdx];
  6737. newStartVnode = newCh[++newStartIdx];
  6738. }
  6739. else {
  6740. if (isUndef(oldKeyToIdx))
  6741. oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx);
  6742. idxInOld = isDef(newStartVnode.key)
  6743. ? oldKeyToIdx[newStartVnode.key]
  6744. : findIdxInOld(newStartVnode, oldCh, oldStartIdx, oldEndIdx);
  6745. if (isUndef(idxInOld)) {
  6746. // New element
  6747. createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);
  6748. }
  6749. else {
  6750. vnodeToMove = oldCh[idxInOld];
  6751. if (sameVnode(vnodeToMove, newStartVnode)) {
  6752. patchVnode(vnodeToMove, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
  6753. oldCh[idxInOld] = undefined;
  6754. canMove &&
  6755. nodeOps.insertBefore(parentElm, vnodeToMove.elm, oldStartVnode.elm);
  6756. }
  6757. else {
  6758. // same key but different element. treat as new element
  6759. createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);
  6760. }
  6761. }
  6762. newStartVnode = newCh[++newStartIdx];
  6763. }
  6764. }
  6765. if (oldStartIdx > oldEndIdx) {
  6766. refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;
  6767. addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
  6768. }
  6769. else if (newStartIdx > newEndIdx) {
  6770. removeVnodes(oldCh, oldStartIdx, oldEndIdx);
  6771. }
  6772. }
  6773. function checkDuplicateKeys(children) {
  6774. var seenKeys = {};
  6775. for (var i_4 = 0; i_4 < children.length; i_4++) {
  6776. var vnode = children[i_4];
  6777. var key = vnode.key;
  6778. if (isDef(key)) {
  6779. if (seenKeys[key]) {
  6780. warn$2("Duplicate keys detected: '".concat(key, "'. This may cause an update error."), vnode.context);
  6781. }
  6782. else {
  6783. seenKeys[key] = true;
  6784. }
  6785. }
  6786. }
  6787. }
  6788. function findIdxInOld(node, oldCh, start, end) {
  6789. for (var i_5 = start; i_5 < end; i_5++) {
  6790. var c = oldCh[i_5];
  6791. if (isDef(c) && sameVnode(node, c))
  6792. return i_5;
  6793. }
  6794. }
  6795. function patchVnode(oldVnode, vnode, insertedVnodeQueue, ownerArray, index, removeOnly) {
  6796. if (oldVnode === vnode) {
  6797. return;
  6798. }
  6799. if (isDef(vnode.elm) && isDef(ownerArray)) {
  6800. // clone reused vnode
  6801. vnode = ownerArray[index] = cloneVNode(vnode);
  6802. }
  6803. var elm = (vnode.elm = oldVnode.elm);
  6804. if (isTrue(oldVnode.isAsyncPlaceholder)) {
  6805. if (isDef(vnode.asyncFactory.resolved)) {
  6806. hydrate(oldVnode.elm, vnode, insertedVnodeQueue);
  6807. }
  6808. else {
  6809. vnode.isAsyncPlaceholder = true;
  6810. }
  6811. return;
  6812. }
  6813. // reuse element for static trees.
  6814. // note we only do this if the vnode is cloned -
  6815. // if the new node is not cloned it means the render functions have been
  6816. // reset by the hot-reload-api and we need to do a proper re-render.
  6817. if (isTrue(vnode.isStatic) &&
  6818. isTrue(oldVnode.isStatic) &&
  6819. vnode.key === oldVnode.key &&
  6820. (isTrue(vnode.isCloned) || isTrue(vnode.isOnce))) {
  6821. vnode.componentInstance = oldVnode.componentInstance;
  6822. return;
  6823. }
  6824. var i;
  6825. var data = vnode.data;
  6826. if (isDef(data) && isDef((i = data.hook)) && isDef((i = i.prepatch))) {
  6827. i(oldVnode, vnode);
  6828. }
  6829. var oldCh = oldVnode.children;
  6830. var ch = vnode.children;
  6831. if (isDef(data) && isPatchable(vnode)) {
  6832. for (i = 0; i < cbs.update.length; ++i)
  6833. cbs.update[i](oldVnode, vnode);
  6834. if (isDef((i = data.hook)) && isDef((i = i.update)))
  6835. i(oldVnode, vnode);
  6836. }
  6837. if (isUndef(vnode.text)) {
  6838. if (isDef(oldCh) && isDef(ch)) {
  6839. if (oldCh !== ch)
  6840. updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly);
  6841. }
  6842. else if (isDef(ch)) {
  6843. {
  6844. checkDuplicateKeys(ch);
  6845. }
  6846. if (isDef(oldVnode.text))
  6847. nodeOps.setTextContent(elm, '');
  6848. addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
  6849. }
  6850. else if (isDef(oldCh)) {
  6851. removeVnodes(oldCh, 0, oldCh.length - 1);
  6852. }
  6853. else if (isDef(oldVnode.text)) {
  6854. nodeOps.setTextContent(elm, '');
  6855. }
  6856. }
  6857. else if (oldVnode.text !== vnode.text) {
  6858. nodeOps.setTextContent(elm, vnode.text);
  6859. }
  6860. if (isDef(data)) {
  6861. if (isDef((i = data.hook)) && isDef((i = i.postpatch)))
  6862. i(oldVnode, vnode);
  6863. }
  6864. }
  6865. function invokeInsertHook(vnode, queue, initial) {
  6866. // delay insert hooks for component root nodes, invoke them after the
  6867. // element is really inserted
  6868. if (isTrue(initial) && isDef(vnode.parent)) {
  6869. vnode.parent.data.pendingInsert = queue;
  6870. }
  6871. else {
  6872. for (var i_6 = 0; i_6 < queue.length; ++i_6) {
  6873. queue[i_6].data.hook.insert(queue[i_6]);
  6874. }
  6875. }
  6876. }
  6877. var hydrationBailed = false;
  6878. // list of modules that can skip create hook during hydration because they
  6879. // are already rendered on the client or has no need for initialization
  6880. // Note: style is excluded because it relies on initial clone for future
  6881. // deep updates (#7063).
  6882. var isRenderedModule = makeMap('attrs,class,staticClass,staticStyle,key');
  6883. // Note: this is a browser-only function so we can assume elms are DOM nodes.
  6884. function hydrate(elm, vnode, insertedVnodeQueue, inVPre) {
  6885. var i;
  6886. var tag = vnode.tag, data = vnode.data, children = vnode.children;
  6887. inVPre = inVPre || (data && data.pre);
  6888. vnode.elm = elm;
  6889. if (isTrue(vnode.isComment) && isDef(vnode.asyncFactory)) {
  6890. vnode.isAsyncPlaceholder = true;
  6891. return true;
  6892. }
  6893. // assert node match
  6894. {
  6895. if (!assertNodeMatch(elm, vnode, inVPre)) {
  6896. return false;
  6897. }
  6898. }
  6899. if (isDef(data)) {
  6900. if (isDef((i = data.hook)) && isDef((i = i.init)))
  6901. i(vnode, true /* hydrating */);
  6902. if (isDef((i = vnode.componentInstance))) {
  6903. // child component. it should have hydrated its own tree.
  6904. initComponent(vnode, insertedVnodeQueue);
  6905. return true;
  6906. }
  6907. }
  6908. if (isDef(tag)) {
  6909. if (isDef(children)) {
  6910. // empty element, allow client to pick up and populate children
  6911. if (!elm.hasChildNodes()) {
  6912. createChildren(vnode, children, insertedVnodeQueue);
  6913. }
  6914. else {
  6915. // v-html and domProps: innerHTML
  6916. if (isDef((i = data)) &&
  6917. isDef((i = i.domProps)) &&
  6918. isDef((i = i.innerHTML))) {
  6919. if (i !== elm.innerHTML) {
  6920. /* istanbul ignore if */
  6921. if (typeof console !== 'undefined' &&
  6922. !hydrationBailed) {
  6923. hydrationBailed = true;
  6924. console.warn('Parent: ', elm);
  6925. console.warn('server innerHTML: ', i);
  6926. console.warn('client innerHTML: ', elm.innerHTML);
  6927. }
  6928. return false;
  6929. }
  6930. }
  6931. else {
  6932. // iterate and compare children lists
  6933. var childrenMatch = true;
  6934. var childNode = elm.firstChild;
  6935. for (var i_7 = 0; i_7 < children.length; i_7++) {
  6936. if (!childNode ||
  6937. !hydrate(childNode, children[i_7], insertedVnodeQueue, inVPre)) {
  6938. childrenMatch = false;
  6939. break;
  6940. }
  6941. childNode = childNode.nextSibling;
  6942. }
  6943. // if childNode is not null, it means the actual childNodes list is
  6944. // longer than the virtual children list.
  6945. if (!childrenMatch || childNode) {
  6946. /* istanbul ignore if */
  6947. if (typeof console !== 'undefined' &&
  6948. !hydrationBailed) {
  6949. hydrationBailed = true;
  6950. console.warn('Parent: ', elm);
  6951. console.warn('Mismatching childNodes vs. VNodes: ', elm.childNodes, children);
  6952. }
  6953. return false;
  6954. }
  6955. }
  6956. }
  6957. }
  6958. if (isDef(data)) {
  6959. var fullInvoke = false;
  6960. for (var key in data) {
  6961. if (!isRenderedModule(key)) {
  6962. fullInvoke = true;
  6963. invokeCreateHooks(vnode, insertedVnodeQueue);
  6964. break;
  6965. }
  6966. }
  6967. if (!fullInvoke && data['class']) {
  6968. // ensure collecting deps for deep class bindings for future updates
  6969. traverse(data['class']);
  6970. }
  6971. }
  6972. }
  6973. else if (elm.data !== vnode.text) {
  6974. elm.data = vnode.text;
  6975. }
  6976. return true;
  6977. }
  6978. function assertNodeMatch(node, vnode, inVPre) {
  6979. if (isDef(vnode.tag)) {
  6980. return (vnode.tag.indexOf('vue-component') === 0 ||
  6981. (!isUnknownElement(vnode, inVPre) &&
  6982. vnode.tag.toLowerCase() ===
  6983. (node.tagName && node.tagName.toLowerCase())));
  6984. }
  6985. else {
  6986. return node.nodeType === (vnode.isComment ? 8 : 3);
  6987. }
  6988. }
  6989. return function patch(oldVnode, vnode, hydrating, removeOnly) {
  6990. if (isUndef(vnode)) {
  6991. if (isDef(oldVnode))
  6992. invokeDestroyHook(oldVnode);
  6993. return;
  6994. }
  6995. var isInitialPatch = false;
  6996. var insertedVnodeQueue = [];
  6997. if (isUndef(oldVnode)) {
  6998. // empty mount (likely as component), create new root element
  6999. isInitialPatch = true;
  7000. createElm(vnode, insertedVnodeQueue);
  7001. }
  7002. else {
  7003. var isRealElement = isDef(oldVnode.nodeType);
  7004. if (!isRealElement && sameVnode(oldVnode, vnode)) {
  7005. // patch existing root node
  7006. patchVnode(oldVnode, vnode, insertedVnodeQueue, null, null, removeOnly);
  7007. }
  7008. else {
  7009. if (isRealElement) {
  7010. // mounting to a real element
  7011. // check if this is server-rendered content and if we can perform
  7012. // a successful hydration.
  7013. if (oldVnode.nodeType === 1 && oldVnode.hasAttribute(SSR_ATTR)) {
  7014. oldVnode.removeAttribute(SSR_ATTR);
  7015. hydrating = true;
  7016. }
  7017. if (isTrue(hydrating)) {
  7018. if (hydrate(oldVnode, vnode, insertedVnodeQueue)) {
  7019. invokeInsertHook(vnode, insertedVnodeQueue, true);
  7020. return oldVnode;
  7021. }
  7022. else {
  7023. warn$2('The client-side rendered virtual DOM tree is not matching ' +
  7024. 'server-rendered content. This is likely caused by incorrect ' +
  7025. 'HTML markup, for example nesting block-level elements inside ' +
  7026. '<p>, or missing <tbody>. Bailing hydration and performing ' +
  7027. 'full client-side render.');
  7028. }
  7029. }
  7030. // either not server-rendered, or hydration failed.
  7031. // create an empty node and replace it
  7032. oldVnode = emptyNodeAt(oldVnode);
  7033. }
  7034. // replacing existing element
  7035. var oldElm = oldVnode.elm;
  7036. var parentElm = nodeOps.parentNode(oldElm);
  7037. // create new node
  7038. createElm(vnode, insertedVnodeQueue,
  7039. // extremely rare edge case: do not insert if old element is in a
  7040. // leaving transition. Only happens when combining transition +
  7041. // keep-alive + HOCs. (#4590)
  7042. oldElm._leaveCb ? null : parentElm, nodeOps.nextSibling(oldElm));
  7043. // update parent placeholder node element, recursively
  7044. if (isDef(vnode.parent)) {
  7045. var ancestor = vnode.parent;
  7046. var patchable = isPatchable(vnode);
  7047. while (ancestor) {
  7048. for (var i_8 = 0; i_8 < cbs.destroy.length; ++i_8) {
  7049. cbs.destroy[i_8](ancestor);
  7050. }
  7051. ancestor.elm = vnode.elm;
  7052. if (patchable) {
  7053. for (var i_9 = 0; i_9 < cbs.create.length; ++i_9) {
  7054. cbs.create[i_9](emptyNode, ancestor);
  7055. }
  7056. // #6513
  7057. // invoke insert hooks that may have been merged by create hooks.
  7058. // e.g. for directives that uses the "inserted" hook.
  7059. var insert_1 = ancestor.data.hook.insert;
  7060. if (insert_1.merged) {
  7061. // start at index 1 to avoid re-invoking component mounted hook
  7062. // clone insert hooks to avoid being mutated during iteration.
  7063. // e.g. for customed directives under transition group.
  7064. var cloned = insert_1.fns.slice(1);
  7065. for (var i_10 = 0; i_10 < cloned.length; i_10++) {
  7066. cloned[i_10]();
  7067. }
  7068. }
  7069. }
  7070. else {
  7071. registerRef(ancestor);
  7072. }
  7073. ancestor = ancestor.parent;
  7074. }
  7075. }
  7076. // destroy old node
  7077. if (isDef(parentElm)) {
  7078. removeVnodes([oldVnode], 0, 0);
  7079. }
  7080. else if (isDef(oldVnode.tag)) {
  7081. invokeDestroyHook(oldVnode);
  7082. }
  7083. }
  7084. }
  7085. invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch);
  7086. return vnode.elm;
  7087. };
  7088. }
  7089. var directives$1 = {
  7090. create: updateDirectives,
  7091. update: updateDirectives,
  7092. destroy: function unbindDirectives(vnode) {
  7093. // @ts-expect-error emptyNode is not VNodeWithData
  7094. updateDirectives(vnode, emptyNode);
  7095. }
  7096. };
  7097. function updateDirectives(oldVnode, vnode) {
  7098. if (oldVnode.data.directives || vnode.data.directives) {
  7099. _update(oldVnode, vnode);
  7100. }
  7101. }
  7102. function _update(oldVnode, vnode) {
  7103. var isCreate = oldVnode === emptyNode;
  7104. var isDestroy = vnode === emptyNode;
  7105. var oldDirs = normalizeDirectives(oldVnode.data.directives, oldVnode.context);
  7106. var newDirs = normalizeDirectives(vnode.data.directives, vnode.context);
  7107. var dirsWithInsert = [];
  7108. var dirsWithPostpatch = [];
  7109. var key, oldDir, dir;
  7110. for (key in newDirs) {
  7111. oldDir = oldDirs[key];
  7112. dir = newDirs[key];
  7113. if (!oldDir) {
  7114. // new directive, bind
  7115. callHook(dir, 'bind', vnode, oldVnode);
  7116. if (dir.def && dir.def.inserted) {
  7117. dirsWithInsert.push(dir);
  7118. }
  7119. }
  7120. else {
  7121. // existing directive, update
  7122. dir.oldValue = oldDir.value;
  7123. dir.oldArg = oldDir.arg;
  7124. callHook(dir, 'update', vnode, oldVnode);
  7125. if (dir.def && dir.def.componentUpdated) {
  7126. dirsWithPostpatch.push(dir);
  7127. }
  7128. }
  7129. }
  7130. if (dirsWithInsert.length) {
  7131. var callInsert = function () {
  7132. for (var i = 0; i < dirsWithInsert.length; i++) {
  7133. callHook(dirsWithInsert[i], 'inserted', vnode, oldVnode);
  7134. }
  7135. };
  7136. if (isCreate) {
  7137. mergeVNodeHook(vnode, 'insert', callInsert);
  7138. }
  7139. else {
  7140. callInsert();
  7141. }
  7142. }
  7143. if (dirsWithPostpatch.length) {
  7144. mergeVNodeHook(vnode, 'postpatch', function () {
  7145. for (var i = 0; i < dirsWithPostpatch.length; i++) {
  7146. callHook(dirsWithPostpatch[i], 'componentUpdated', vnode, oldVnode);
  7147. }
  7148. });
  7149. }
  7150. if (!isCreate) {
  7151. for (key in oldDirs) {
  7152. if (!newDirs[key]) {
  7153. // no longer present, unbind
  7154. callHook(oldDirs[key], 'unbind', oldVnode, oldVnode, isDestroy);
  7155. }
  7156. }
  7157. }
  7158. }
  7159. var emptyModifiers = Object.create(null);
  7160. function normalizeDirectives(dirs, vm) {
  7161. var res = Object.create(null);
  7162. if (!dirs) {
  7163. // $flow-disable-line
  7164. return res;
  7165. }
  7166. var i, dir;
  7167. for (i = 0; i < dirs.length; i++) {
  7168. dir = dirs[i];
  7169. if (!dir.modifiers) {
  7170. // $flow-disable-line
  7171. dir.modifiers = emptyModifiers;
  7172. }
  7173. res[getRawDirName(dir)] = dir;
  7174. if (vm._setupState && vm._setupState.__sfc) {
  7175. var setupDef = dir.def || resolveAsset(vm, '_setupState', 'v-' + dir.name);
  7176. if (typeof setupDef === 'function') {
  7177. dir.def = {
  7178. bind: setupDef,
  7179. update: setupDef,
  7180. };
  7181. }
  7182. else {
  7183. dir.def = setupDef;
  7184. }
  7185. }
  7186. dir.def = dir.def || resolveAsset(vm.$options, 'directives', dir.name, true);
  7187. }
  7188. // $flow-disable-line
  7189. return res;
  7190. }
  7191. function getRawDirName(dir) {
  7192. return (dir.rawName || "".concat(dir.name, ".").concat(Object.keys(dir.modifiers || {}).join('.')));
  7193. }
  7194. function callHook(dir, hook, vnode, oldVnode, isDestroy) {
  7195. var fn = dir.def && dir.def[hook];
  7196. if (fn) {
  7197. try {
  7198. fn(vnode.elm, dir, vnode, oldVnode, isDestroy);
  7199. }
  7200. catch (e) {
  7201. handleError(e, vnode.context, "directive ".concat(dir.name, " ").concat(hook, " hook"));
  7202. }
  7203. }
  7204. }
  7205. var baseModules = [ref, directives$1];
  7206. function updateAttrs(oldVnode, vnode) {
  7207. var opts = vnode.componentOptions;
  7208. if (isDef(opts) && opts.Ctor.options.inheritAttrs === false) {
  7209. return;
  7210. }
  7211. if (isUndef(oldVnode.data.attrs) && isUndef(vnode.data.attrs)) {
  7212. return;
  7213. }
  7214. var key, cur, old;
  7215. var elm = vnode.elm;
  7216. var oldAttrs = oldVnode.data.attrs || {};
  7217. var attrs = vnode.data.attrs || {};
  7218. // clone observed objects, as the user probably wants to mutate it
  7219. if (isDef(attrs.__ob__) || isTrue(attrs._v_attr_proxy)) {
  7220. attrs = vnode.data.attrs = extend({}, attrs);
  7221. }
  7222. for (key in attrs) {
  7223. cur = attrs[key];
  7224. old = oldAttrs[key];
  7225. if (old !== cur) {
  7226. setAttr(elm, key, cur, vnode.data.pre);
  7227. }
  7228. }
  7229. // #4391: in IE9, setting type can reset value for input[type=radio]
  7230. // #6666: IE/Edge forces progress value down to 1 before setting a max
  7231. /* istanbul ignore if */
  7232. if ((isIE || isEdge) && attrs.value !== oldAttrs.value) {
  7233. setAttr(elm, 'value', attrs.value);
  7234. }
  7235. for (key in oldAttrs) {
  7236. if (isUndef(attrs[key])) {
  7237. if (isXlink(key)) {
  7238. elm.removeAttributeNS(xlinkNS, getXlinkProp(key));
  7239. }
  7240. else if (!isEnumeratedAttr(key)) {
  7241. elm.removeAttribute(key);
  7242. }
  7243. }
  7244. }
  7245. }
  7246. function setAttr(el, key, value, isInPre) {
  7247. if (isInPre || el.tagName.indexOf('-') > -1) {
  7248. baseSetAttr(el, key, value);
  7249. }
  7250. else if (isBooleanAttr(key)) {
  7251. // set attribute for blank value
  7252. // e.g. <option disabled>Select one</option>
  7253. if (isFalsyAttrValue(value)) {
  7254. el.removeAttribute(key);
  7255. }
  7256. else {
  7257. // technically allowfullscreen is a boolean attribute for <iframe>,
  7258. // but Flash expects a value of "true" when used on <embed> tag
  7259. value = key === 'allowfullscreen' && el.tagName === 'EMBED' ? 'true' : key;
  7260. el.setAttribute(key, value);
  7261. }
  7262. }
  7263. else if (isEnumeratedAttr(key)) {
  7264. el.setAttribute(key, convertEnumeratedValue(key, value));
  7265. }
  7266. else if (isXlink(key)) {
  7267. if (isFalsyAttrValue(value)) {
  7268. el.removeAttributeNS(xlinkNS, getXlinkProp(key));
  7269. }
  7270. else {
  7271. el.setAttributeNS(xlinkNS, key, value);
  7272. }
  7273. }
  7274. else {
  7275. baseSetAttr(el, key, value);
  7276. }
  7277. }
  7278. function baseSetAttr(el, key, value) {
  7279. if (isFalsyAttrValue(value)) {
  7280. el.removeAttribute(key);
  7281. }
  7282. else {
  7283. // #7138: IE10 & 11 fires input event when setting placeholder on
  7284. // <textarea>... block the first input event and remove the blocker
  7285. // immediately.
  7286. /* istanbul ignore if */
  7287. if (isIE &&
  7288. !isIE9 &&
  7289. el.tagName === 'TEXTAREA' &&
  7290. key === 'placeholder' &&
  7291. value !== '' &&
  7292. !el.__ieph) {
  7293. var blocker_1 = function (e) {
  7294. e.stopImmediatePropagation();
  7295. el.removeEventListener('input', blocker_1);
  7296. };
  7297. el.addEventListener('input', blocker_1);
  7298. // $flow-disable-line
  7299. el.__ieph = true; /* IE placeholder patched */
  7300. }
  7301. el.setAttribute(key, value);
  7302. }
  7303. }
  7304. var attrs = {
  7305. create: updateAttrs,
  7306. update: updateAttrs
  7307. };
  7308. function updateClass(oldVnode, vnode) {
  7309. var el = vnode.elm;
  7310. var data = vnode.data;
  7311. var oldData = oldVnode.data;
  7312. if (isUndef(data.staticClass) &&
  7313. isUndef(data.class) &&
  7314. (isUndef(oldData) ||
  7315. (isUndef(oldData.staticClass) && isUndef(oldData.class)))) {
  7316. return;
  7317. }
  7318. var cls = genClassForVnode(vnode);
  7319. // handle transition classes
  7320. var transitionClass = el._transitionClasses;
  7321. if (isDef(transitionClass)) {
  7322. cls = concat(cls, stringifyClass(transitionClass));
  7323. }
  7324. // set the class
  7325. if (cls !== el._prevClass) {
  7326. el.setAttribute('class', cls);
  7327. el._prevClass = cls;
  7328. }
  7329. }
  7330. var klass$1 = {
  7331. create: updateClass,
  7332. update: updateClass
  7333. };
  7334. var validDivisionCharRE = /[\w).+\-_$\]]/;
  7335. function parseFilters(exp) {
  7336. var inSingle = false;
  7337. var inDouble = false;
  7338. var inTemplateString = false;
  7339. var inRegex = false;
  7340. var curly = 0;
  7341. var square = 0;
  7342. var paren = 0;
  7343. var lastFilterIndex = 0;
  7344. var c, prev, i, expression, filters;
  7345. for (i = 0; i < exp.length; i++) {
  7346. prev = c;
  7347. c = exp.charCodeAt(i);
  7348. if (inSingle) {
  7349. if (c === 0x27 && prev !== 0x5c)
  7350. inSingle = false;
  7351. }
  7352. else if (inDouble) {
  7353. if (c === 0x22 && prev !== 0x5c)
  7354. inDouble = false;
  7355. }
  7356. else if (inTemplateString) {
  7357. if (c === 0x60 && prev !== 0x5c)
  7358. inTemplateString = false;
  7359. }
  7360. else if (inRegex) {
  7361. if (c === 0x2f && prev !== 0x5c)
  7362. inRegex = false;
  7363. }
  7364. else if (c === 0x7c && // pipe
  7365. exp.charCodeAt(i + 1) !== 0x7c &&
  7366. exp.charCodeAt(i - 1) !== 0x7c &&
  7367. !curly &&
  7368. !square &&
  7369. !paren) {
  7370. if (expression === undefined) {
  7371. // first filter, end of expression
  7372. lastFilterIndex = i + 1;
  7373. expression = exp.slice(0, i).trim();
  7374. }
  7375. else {
  7376. pushFilter();
  7377. }
  7378. }
  7379. else {
  7380. switch (c) {
  7381. case 0x22:
  7382. inDouble = true;
  7383. break; // "
  7384. case 0x27:
  7385. inSingle = true;
  7386. break; // '
  7387. case 0x60:
  7388. inTemplateString = true;
  7389. break; // `
  7390. case 0x28:
  7391. paren++;
  7392. break; // (
  7393. case 0x29:
  7394. paren--;
  7395. break; // )
  7396. case 0x5b:
  7397. square++;
  7398. break; // [
  7399. case 0x5d:
  7400. square--;
  7401. break; // ]
  7402. case 0x7b:
  7403. curly++;
  7404. break; // {
  7405. case 0x7d:
  7406. curly--;
  7407. break; // }
  7408. }
  7409. if (c === 0x2f) {
  7410. // /
  7411. var j = i - 1;
  7412. var p
  7413. // find first non-whitespace prev char
  7414. = void 0;
  7415. // find first non-whitespace prev char
  7416. for (; j >= 0; j--) {
  7417. p = exp.charAt(j);
  7418. if (p !== ' ')
  7419. break;
  7420. }
  7421. if (!p || !validDivisionCharRE.test(p)) {
  7422. inRegex = true;
  7423. }
  7424. }
  7425. }
  7426. }
  7427. if (expression === undefined) {
  7428. expression = exp.slice(0, i).trim();
  7429. }
  7430. else if (lastFilterIndex !== 0) {
  7431. pushFilter();
  7432. }
  7433. function pushFilter() {
  7434. (filters || (filters = [])).push(exp.slice(lastFilterIndex, i).trim());
  7435. lastFilterIndex = i + 1;
  7436. }
  7437. if (filters) {
  7438. for (i = 0; i < filters.length; i++) {
  7439. expression = wrapFilter(expression, filters[i]);
  7440. }
  7441. }
  7442. return expression;
  7443. }
  7444. function wrapFilter(exp, filter) {
  7445. var i = filter.indexOf('(');
  7446. if (i < 0) {
  7447. // _f: resolveFilter
  7448. return "_f(\"".concat(filter, "\")(").concat(exp, ")");
  7449. }
  7450. else {
  7451. var name_1 = filter.slice(0, i);
  7452. var args = filter.slice(i + 1);
  7453. return "_f(\"".concat(name_1, "\")(").concat(exp).concat(args !== ')' ? ',' + args : args);
  7454. }
  7455. }
  7456. /* eslint-disable no-unused-vars */
  7457. function baseWarn(msg, range) {
  7458. console.error("[Vue compiler]: ".concat(msg));
  7459. }
  7460. /* eslint-enable no-unused-vars */
  7461. function pluckModuleFunction(modules, key) {
  7462. return modules ? modules.map(function (m) { return m[key]; }).filter(function (_) { return _; }) : [];
  7463. }
  7464. function addProp(el, name, value, range, dynamic) {
  7465. (el.props || (el.props = [])).push(rangeSetItem({ name: name, value: value, dynamic: dynamic }, range));
  7466. el.plain = false;
  7467. }
  7468. function addAttr(el, name, value, range, dynamic) {
  7469. var attrs = dynamic
  7470. ? el.dynamicAttrs || (el.dynamicAttrs = [])
  7471. : el.attrs || (el.attrs = []);
  7472. attrs.push(rangeSetItem({ name: name, value: value, dynamic: dynamic }, range));
  7473. el.plain = false;
  7474. }
  7475. // add a raw attr (use this in preTransforms)
  7476. function addRawAttr(el, name, value, range) {
  7477. el.attrsMap[name] = value;
  7478. el.attrsList.push(rangeSetItem({ name: name, value: value }, range));
  7479. }
  7480. function addDirective(el, name, rawName, value, arg, isDynamicArg, modifiers, range) {
  7481. (el.directives || (el.directives = [])).push(rangeSetItem({
  7482. name: name,
  7483. rawName: rawName,
  7484. value: value,
  7485. arg: arg,
  7486. isDynamicArg: isDynamicArg,
  7487. modifiers: modifiers
  7488. }, range));
  7489. el.plain = false;
  7490. }
  7491. function prependModifierMarker(symbol, name, dynamic) {
  7492. return dynamic ? "_p(".concat(name, ",\"").concat(symbol, "\")") : symbol + name; // mark the event as captured
  7493. }
  7494. function addHandler(el, name, value, modifiers, important, warn, range, dynamic) {
  7495. modifiers = modifiers || emptyObject;
  7496. // warn prevent and passive modifier
  7497. /* istanbul ignore if */
  7498. if (warn && modifiers.prevent && modifiers.passive) {
  7499. warn("passive and prevent can't be used together. " +
  7500. "Passive handler can't prevent default event.", range);
  7501. }
  7502. // normalize click.right and click.middle since they don't actually fire
  7503. // this is technically browser-specific, but at least for now browsers are
  7504. // the only target envs that have right/middle clicks.
  7505. if (modifiers.right) {
  7506. if (dynamic) {
  7507. name = "(".concat(name, ")==='click'?'contextmenu':(").concat(name, ")");
  7508. }
  7509. else if (name === 'click') {
  7510. name = 'contextmenu';
  7511. delete modifiers.right;
  7512. }
  7513. }
  7514. else if (modifiers.middle) {
  7515. if (dynamic) {
  7516. name = "(".concat(name, ")==='click'?'mouseup':(").concat(name, ")");
  7517. }
  7518. else if (name === 'click') {
  7519. name = 'mouseup';
  7520. }
  7521. }
  7522. // check capture modifier
  7523. if (modifiers.capture) {
  7524. delete modifiers.capture;
  7525. name = prependModifierMarker('!', name, dynamic);
  7526. }
  7527. if (modifiers.once) {
  7528. delete modifiers.once;
  7529. name = prependModifierMarker('~', name, dynamic);
  7530. }
  7531. /* istanbul ignore if */
  7532. if (modifiers.passive) {
  7533. delete modifiers.passive;
  7534. name = prependModifierMarker('&', name, dynamic);
  7535. }
  7536. var events;
  7537. if (modifiers.native) {
  7538. delete modifiers.native;
  7539. events = el.nativeEvents || (el.nativeEvents = {});
  7540. }
  7541. else {
  7542. events = el.events || (el.events = {});
  7543. }
  7544. var newHandler = rangeSetItem({ value: value.trim(), dynamic: dynamic }, range);
  7545. if (modifiers !== emptyObject) {
  7546. newHandler.modifiers = modifiers;
  7547. }
  7548. var handlers = events[name];
  7549. /* istanbul ignore if */
  7550. if (Array.isArray(handlers)) {
  7551. important ? handlers.unshift(newHandler) : handlers.push(newHandler);
  7552. }
  7553. else if (handlers) {
  7554. events[name] = important ? [newHandler, handlers] : [handlers, newHandler];
  7555. }
  7556. else {
  7557. events[name] = newHandler;
  7558. }
  7559. el.plain = false;
  7560. }
  7561. function getRawBindingAttr(el, name) {
  7562. return (el.rawAttrsMap[':' + name] ||
  7563. el.rawAttrsMap['v-bind:' + name] ||
  7564. el.rawAttrsMap[name]);
  7565. }
  7566. function getBindingAttr(el, name, getStatic) {
  7567. var dynamicValue = getAndRemoveAttr(el, ':' + name) || getAndRemoveAttr(el, 'v-bind:' + name);
  7568. if (dynamicValue != null) {
  7569. return parseFilters(dynamicValue);
  7570. }
  7571. else if (getStatic !== false) {
  7572. var staticValue = getAndRemoveAttr(el, name);
  7573. if (staticValue != null) {
  7574. return JSON.stringify(staticValue);
  7575. }
  7576. }
  7577. }
  7578. // note: this only removes the attr from the Array (attrsList) so that it
  7579. // doesn't get processed by processAttrs.
  7580. // By default it does NOT remove it from the map (attrsMap) because the map is
  7581. // needed during codegen.
  7582. function getAndRemoveAttr(el, name, removeFromMap) {
  7583. var val;
  7584. if ((val = el.attrsMap[name]) != null) {
  7585. var list = el.attrsList;
  7586. for (var i = 0, l = list.length; i < l; i++) {
  7587. if (list[i].name === name) {
  7588. list.splice(i, 1);
  7589. break;
  7590. }
  7591. }
  7592. }
  7593. if (removeFromMap) {
  7594. delete el.attrsMap[name];
  7595. }
  7596. return val;
  7597. }
  7598. function getAndRemoveAttrByRegex(el, name) {
  7599. var list = el.attrsList;
  7600. for (var i = 0, l = list.length; i < l; i++) {
  7601. var attr = list[i];
  7602. if (name.test(attr.name)) {
  7603. list.splice(i, 1);
  7604. return attr;
  7605. }
  7606. }
  7607. }
  7608. function rangeSetItem(item, range) {
  7609. if (range) {
  7610. if (range.start != null) {
  7611. item.start = range.start;
  7612. }
  7613. if (range.end != null) {
  7614. item.end = range.end;
  7615. }
  7616. }
  7617. return item;
  7618. }
  7619. /**
  7620. * Cross-platform code generation for component v-model
  7621. */
  7622. function genComponentModel(el, value, modifiers) {
  7623. var _a = modifiers || {}, number = _a.number, trim = _a.trim;
  7624. var baseValueExpression = '$$v';
  7625. var valueExpression = baseValueExpression;
  7626. if (trim) {
  7627. valueExpression =
  7628. "(typeof ".concat(baseValueExpression, " === 'string'") +
  7629. "? ".concat(baseValueExpression, ".trim()") +
  7630. ": ".concat(baseValueExpression, ")");
  7631. }
  7632. if (number) {
  7633. valueExpression = "_n(".concat(valueExpression, ")");
  7634. }
  7635. var assignment = genAssignmentCode(value, valueExpression);
  7636. el.model = {
  7637. value: "(".concat(value, ")"),
  7638. expression: JSON.stringify(value),
  7639. callback: "function (".concat(baseValueExpression, ") {").concat(assignment, "}")
  7640. };
  7641. }
  7642. /**
  7643. * Cross-platform codegen helper for generating v-model value assignment code.
  7644. */
  7645. function genAssignmentCode(value, assignment) {
  7646. var res = parseModel(value);
  7647. if (res.key === null) {
  7648. return "".concat(value, "=").concat(assignment);
  7649. }
  7650. else {
  7651. return "$set(".concat(res.exp, ", ").concat(res.key, ", ").concat(assignment, ")");
  7652. }
  7653. }
  7654. /**
  7655. * Parse a v-model expression into a base path and a final key segment.
  7656. * Handles both dot-path and possible square brackets.
  7657. *
  7658. * Possible cases:
  7659. *
  7660. * - test
  7661. * - test[key]
  7662. * - test[test1[key]]
  7663. * - test["a"][key]
  7664. * - xxx.test[a[a].test1[key]]
  7665. * - test.xxx.a["asa"][test1[key]]
  7666. *
  7667. */
  7668. var len, str, chr, index, expressionPos, expressionEndPos;
  7669. function parseModel(val) {
  7670. // Fix https://github.com/vuejs/vue/pull/7730
  7671. // allow v-model="obj.val " (trailing whitespace)
  7672. val = val.trim();
  7673. len = val.length;
  7674. if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) {
  7675. index = val.lastIndexOf('.');
  7676. if (index > -1) {
  7677. return {
  7678. exp: val.slice(0, index),
  7679. key: '"' + val.slice(index + 1) + '"'
  7680. };
  7681. }
  7682. else {
  7683. return {
  7684. exp: val,
  7685. key: null
  7686. };
  7687. }
  7688. }
  7689. str = val;
  7690. index = expressionPos = expressionEndPos = 0;
  7691. while (!eof()) {
  7692. chr = next();
  7693. /* istanbul ignore if */
  7694. if (isStringStart(chr)) {
  7695. parseString(chr);
  7696. }
  7697. else if (chr === 0x5b) {
  7698. parseBracket(chr);
  7699. }
  7700. }
  7701. return {
  7702. exp: val.slice(0, expressionPos),
  7703. key: val.slice(expressionPos + 1, expressionEndPos)
  7704. };
  7705. }
  7706. function next() {
  7707. return str.charCodeAt(++index);
  7708. }
  7709. function eof() {
  7710. return index >= len;
  7711. }
  7712. function isStringStart(chr) {
  7713. return chr === 0x22 || chr === 0x27;
  7714. }
  7715. function parseBracket(chr) {
  7716. var inBracket = 1;
  7717. expressionPos = index;
  7718. while (!eof()) {
  7719. chr = next();
  7720. if (isStringStart(chr)) {
  7721. parseString(chr);
  7722. continue;
  7723. }
  7724. if (chr === 0x5b)
  7725. inBracket++;
  7726. if (chr === 0x5d)
  7727. inBracket--;
  7728. if (inBracket === 0) {
  7729. expressionEndPos = index;
  7730. break;
  7731. }
  7732. }
  7733. }
  7734. function parseString(chr) {
  7735. var stringQuote = chr;
  7736. while (!eof()) {
  7737. chr = next();
  7738. if (chr === stringQuote) {
  7739. break;
  7740. }
  7741. }
  7742. }
  7743. var warn$1;
  7744. // in some cases, the event used has to be determined at runtime
  7745. // so we used some reserved tokens during compile.
  7746. var RANGE_TOKEN = '__r';
  7747. var CHECKBOX_RADIO_TOKEN = '__c';
  7748. function model$1(el, dir, _warn) {
  7749. warn$1 = _warn;
  7750. var value = dir.value;
  7751. var modifiers = dir.modifiers;
  7752. var tag = el.tag;
  7753. var type = el.attrsMap.type;
  7754. {
  7755. // inputs with type="file" are read only and setting the input's
  7756. // value will throw an error.
  7757. if (tag === 'input' && type === 'file') {
  7758. warn$1("<".concat(el.tag, " v-model=\"").concat(value, "\" type=\"file\">:\n") +
  7759. "File inputs are read only. Use a v-on:change listener instead.", el.rawAttrsMap['v-model']);
  7760. }
  7761. }
  7762. if (el.component) {
  7763. genComponentModel(el, value, modifiers);
  7764. // component v-model doesn't need extra runtime
  7765. return false;
  7766. }
  7767. else if (tag === 'select') {
  7768. genSelect(el, value, modifiers);
  7769. }
  7770. else if (tag === 'input' && type === 'checkbox') {
  7771. genCheckboxModel(el, value, modifiers);
  7772. }
  7773. else if (tag === 'input' && type === 'radio') {
  7774. genRadioModel(el, value, modifiers);
  7775. }
  7776. else if (tag === 'input' || tag === 'textarea') {
  7777. genDefaultModel(el, value, modifiers);
  7778. }
  7779. else if (!config.isReservedTag(tag)) {
  7780. genComponentModel(el, value, modifiers);
  7781. // component v-model doesn't need extra runtime
  7782. return false;
  7783. }
  7784. else {
  7785. warn$1("<".concat(el.tag, " v-model=\"").concat(value, "\">: ") +
  7786. "v-model is not supported on this element type. " +
  7787. "If you are working with contenteditable, it's recommended to " +
  7788. 'wrap a library dedicated for that purpose inside a custom component.', el.rawAttrsMap['v-model']);
  7789. }
  7790. // ensure runtime directive metadata
  7791. return true;
  7792. }
  7793. function genCheckboxModel(el, value, modifiers) {
  7794. var number = modifiers && modifiers.number;
  7795. var valueBinding = getBindingAttr(el, 'value') || 'null';
  7796. var trueValueBinding = getBindingAttr(el, 'true-value') || 'true';
  7797. var falseValueBinding = getBindingAttr(el, 'false-value') || 'false';
  7798. addProp(el, 'checked', "Array.isArray(".concat(value, ")") +
  7799. "?_i(".concat(value, ",").concat(valueBinding, ")>-1") +
  7800. (trueValueBinding === 'true'
  7801. ? ":(".concat(value, ")")
  7802. : ":_q(".concat(value, ",").concat(trueValueBinding, ")")));
  7803. addHandler(el, 'change', "var $$a=".concat(value, ",") +
  7804. '$$el=$event.target,' +
  7805. "$$c=$$el.checked?(".concat(trueValueBinding, "):(").concat(falseValueBinding, ");") +
  7806. 'if(Array.isArray($$a)){' +
  7807. "var $$v=".concat(number ? '_n(' + valueBinding + ')' : valueBinding, ",") +
  7808. '$$i=_i($$a,$$v);' +
  7809. "if($$el.checked){$$i<0&&(".concat(genAssignmentCode(value, '$$a.concat([$$v])'), ")}") +
  7810. "else{$$i>-1&&(".concat(genAssignmentCode(value, '$$a.slice(0,$$i).concat($$a.slice($$i+1))'), ")}") +
  7811. "}else{".concat(genAssignmentCode(value, '$$c'), "}"), null, true);
  7812. }
  7813. function genRadioModel(el, value, modifiers) {
  7814. var number = modifiers && modifiers.number;
  7815. var valueBinding = getBindingAttr(el, 'value') || 'null';
  7816. valueBinding = number ? "_n(".concat(valueBinding, ")") : valueBinding;
  7817. addProp(el, 'checked', "_q(".concat(value, ",").concat(valueBinding, ")"));
  7818. addHandler(el, 'change', genAssignmentCode(value, valueBinding), null, true);
  7819. }
  7820. function genSelect(el, value, modifiers) {
  7821. var number = modifiers && modifiers.number;
  7822. var selectedVal = "Array.prototype.filter" +
  7823. ".call($event.target.options,function(o){return o.selected})" +
  7824. ".map(function(o){var val = \"_value\" in o ? o._value : o.value;" +
  7825. "return ".concat(number ? '_n(val)' : 'val', "})");
  7826. var assignment = '$event.target.multiple ? $$selectedVal : $$selectedVal[0]';
  7827. var code = "var $$selectedVal = ".concat(selectedVal, ";");
  7828. code = "".concat(code, " ").concat(genAssignmentCode(value, assignment));
  7829. addHandler(el, 'change', code, null, true);
  7830. }
  7831. function genDefaultModel(el, value, modifiers) {
  7832. var type = el.attrsMap.type;
  7833. // warn if v-bind:value conflicts with v-model
  7834. // except for inputs with v-bind:type
  7835. {
  7836. var value_1 = el.attrsMap['v-bind:value'] || el.attrsMap[':value'];
  7837. var typeBinding = el.attrsMap['v-bind:type'] || el.attrsMap[':type'];
  7838. if (value_1 && !typeBinding) {
  7839. var binding = el.attrsMap['v-bind:value'] ? 'v-bind:value' : ':value';
  7840. warn$1("".concat(binding, "=\"").concat(value_1, "\" conflicts with v-model on the same element ") +
  7841. 'because the latter already expands to a value binding internally', el.rawAttrsMap[binding]);
  7842. }
  7843. }
  7844. var _a = modifiers || {}, lazy = _a.lazy, number = _a.number, trim = _a.trim;
  7845. var needCompositionGuard = !lazy && type !== 'range';
  7846. var event = lazy ? 'change' : type === 'range' ? RANGE_TOKEN : 'input';
  7847. var valueExpression = '$event.target.value';
  7848. if (trim) {
  7849. valueExpression = "$event.target.value.trim()";
  7850. }
  7851. if (number) {
  7852. valueExpression = "_n(".concat(valueExpression, ")");
  7853. }
  7854. var code = genAssignmentCode(value, valueExpression);
  7855. if (needCompositionGuard) {
  7856. code = "if($event.target.composing)return;".concat(code);
  7857. }
  7858. addProp(el, 'value', "(".concat(value, ")"));
  7859. addHandler(el, event, code, null, true);
  7860. if (trim || number) {
  7861. addHandler(el, 'blur', '$forceUpdate()');
  7862. }
  7863. }
  7864. // normalize v-model event tokens that can only be determined at runtime.
  7865. // it's important to place the event as the first in the array because
  7866. // the whole point is ensuring the v-model callback gets called before
  7867. // user-attached handlers.
  7868. function normalizeEvents(on) {
  7869. /* istanbul ignore if */
  7870. if (isDef(on[RANGE_TOKEN])) {
  7871. // IE input[type=range] only supports `change` event
  7872. var event_1 = isIE ? 'change' : 'input';
  7873. on[event_1] = [].concat(on[RANGE_TOKEN], on[event_1] || []);
  7874. delete on[RANGE_TOKEN];
  7875. }
  7876. // This was originally intended to fix #4521 but no longer necessary
  7877. // after 2.5. Keeping it for backwards compat with generated code from < 2.4
  7878. /* istanbul ignore if */
  7879. if (isDef(on[CHECKBOX_RADIO_TOKEN])) {
  7880. on.change = [].concat(on[CHECKBOX_RADIO_TOKEN], on.change || []);
  7881. delete on[CHECKBOX_RADIO_TOKEN];
  7882. }
  7883. }
  7884. var target;
  7885. function createOnceHandler(event, handler, capture) {
  7886. var _target = target; // save current target element in closure
  7887. return function onceHandler() {
  7888. var res = handler.apply(null, arguments);
  7889. if (res !== null) {
  7890. remove(event, onceHandler, capture, _target);
  7891. }
  7892. };
  7893. }
  7894. // #9446: Firefox <= 53 (in particular, ESR 52) has incorrect Event.timeStamp
  7895. // implementation and does not fire microtasks in between event propagation, so
  7896. // safe to exclude.
  7897. var useMicrotaskFix = isUsingMicroTask && !(isFF && Number(isFF[1]) <= 53);
  7898. function add(name, handler, capture, passive) {
  7899. // async edge case #6566: inner click event triggers patch, event handler
  7900. // attached to outer element during patch, and triggered again. This
  7901. // happens because browsers fire microtask ticks between event propagation.
  7902. // the solution is simple: we save the timestamp when a handler is attached,
  7903. // and the handler would only fire if the event passed to it was fired
  7904. // AFTER it was attached.
  7905. if (useMicrotaskFix) {
  7906. var attachedTimestamp_1 = currentFlushTimestamp;
  7907. var original_1 = handler;
  7908. //@ts-expect-error
  7909. handler = original_1._wrapper = function (e) {
  7910. if (
  7911. // no bubbling, should always fire.
  7912. // this is just a safety net in case event.timeStamp is unreliable in
  7913. // certain weird environments...
  7914. e.target === e.currentTarget ||
  7915. // event is fired after handler attachment
  7916. e.timeStamp >= attachedTimestamp_1 ||
  7917. // bail for environments that have buggy event.timeStamp implementations
  7918. // #9462 iOS 9 bug: event.timeStamp is 0 after history.pushState
  7919. // #9681 QtWebEngine event.timeStamp is negative value
  7920. e.timeStamp <= 0 ||
  7921. // #9448 bail if event is fired in another document in a multi-page
  7922. // electron/nw.js app, since event.timeStamp will be using a different
  7923. // starting reference
  7924. e.target.ownerDocument !== document) {
  7925. return original_1.apply(this, arguments);
  7926. }
  7927. };
  7928. }
  7929. target.addEventListener(name, handler, supportsPassive ? { capture: capture, passive: passive } : capture);
  7930. }
  7931. function remove(name, handler, capture, _target) {
  7932. (_target || target).removeEventListener(name,
  7933. //@ts-expect-error
  7934. handler._wrapper || handler, capture);
  7935. }
  7936. function updateDOMListeners(oldVnode, vnode) {
  7937. if (isUndef(oldVnode.data.on) && isUndef(vnode.data.on)) {
  7938. return;
  7939. }
  7940. var on = vnode.data.on || {};
  7941. var oldOn = oldVnode.data.on || {};
  7942. // vnode is empty when removing all listeners,
  7943. // and use old vnode dom element
  7944. target = vnode.elm || oldVnode.elm;
  7945. normalizeEvents(on);
  7946. updateListeners(on, oldOn, add, remove, createOnceHandler, vnode.context);
  7947. target = undefined;
  7948. }
  7949. var events = {
  7950. create: updateDOMListeners,
  7951. update: updateDOMListeners,
  7952. // @ts-expect-error emptyNode has actually data
  7953. destroy: function (vnode) { return updateDOMListeners(vnode, emptyNode); }
  7954. };
  7955. var svgContainer;
  7956. function updateDOMProps(oldVnode, vnode) {
  7957. if (isUndef(oldVnode.data.domProps) && isUndef(vnode.data.domProps)) {
  7958. return;
  7959. }
  7960. var key, cur;
  7961. var elm = vnode.elm;
  7962. var oldProps = oldVnode.data.domProps || {};
  7963. var props = vnode.data.domProps || {};
  7964. // clone observed objects, as the user probably wants to mutate it
  7965. if (isDef(props.__ob__) || isTrue(props._v_attr_proxy)) {
  7966. props = vnode.data.domProps = extend({}, props);
  7967. }
  7968. for (key in oldProps) {
  7969. if (!(key in props)) {
  7970. elm[key] = '';
  7971. }
  7972. }
  7973. for (key in props) {
  7974. cur = props[key];
  7975. // ignore children if the node has textContent or innerHTML,
  7976. // as these will throw away existing DOM nodes and cause removal errors
  7977. // on subsequent patches (#3360)
  7978. if (key === 'textContent' || key === 'innerHTML') {
  7979. if (vnode.children)
  7980. vnode.children.length = 0;
  7981. if (cur === oldProps[key])
  7982. continue;
  7983. // #6601 work around Chrome version <= 55 bug where single textNode
  7984. // replaced by innerHTML/textContent retains its parentNode property
  7985. if (elm.childNodes.length === 1) {
  7986. elm.removeChild(elm.childNodes[0]);
  7987. }
  7988. }
  7989. if (key === 'value' && elm.tagName !== 'PROGRESS') {
  7990. // store value as _value as well since
  7991. // non-string values will be stringified
  7992. elm._value = cur;
  7993. // avoid resetting cursor position when value is the same
  7994. var strCur = isUndef(cur) ? '' : String(cur);
  7995. if (shouldUpdateValue(elm, strCur)) {
  7996. elm.value = strCur;
  7997. }
  7998. }
  7999. else if (key === 'innerHTML' &&
  8000. isSVG(elm.tagName) &&
  8001. isUndef(elm.innerHTML)) {
  8002. // IE doesn't support innerHTML for SVG elements
  8003. svgContainer = svgContainer || document.createElement('div');
  8004. svgContainer.innerHTML = "<svg>".concat(cur, "</svg>");
  8005. var svg = svgContainer.firstChild;
  8006. while (elm.firstChild) {
  8007. elm.removeChild(elm.firstChild);
  8008. }
  8009. while (svg.firstChild) {
  8010. elm.appendChild(svg.firstChild);
  8011. }
  8012. }
  8013. else if (
  8014. // skip the update if old and new VDOM state is the same.
  8015. // `value` is handled separately because the DOM value may be temporarily
  8016. // out of sync with VDOM state due to focus, composition and modifiers.
  8017. // This #4521 by skipping the unnecessary `checked` update.
  8018. cur !== oldProps[key]) {
  8019. // some property updates can throw
  8020. // e.g. `value` on <progress> w/ non-finite value
  8021. try {
  8022. elm[key] = cur;
  8023. }
  8024. catch (e) { }
  8025. }
  8026. }
  8027. }
  8028. function shouldUpdateValue(elm, checkVal) {
  8029. return (
  8030. //@ts-expect-error
  8031. !elm.composing &&
  8032. (elm.tagName === 'OPTION' ||
  8033. isNotInFocusAndDirty(elm, checkVal) ||
  8034. isDirtyWithModifiers(elm, checkVal)));
  8035. }
  8036. function isNotInFocusAndDirty(elm, checkVal) {
  8037. // return true when textbox (.number and .trim) loses focus and its value is
  8038. // not equal to the updated value
  8039. var notInFocus = true;
  8040. // #6157
  8041. // work around IE bug when accessing document.activeElement in an iframe
  8042. try {
  8043. notInFocus = document.activeElement !== elm;
  8044. }
  8045. catch (e) { }
  8046. return notInFocus && elm.value !== checkVal;
  8047. }
  8048. function isDirtyWithModifiers(elm, newVal) {
  8049. var value = elm.value;
  8050. var modifiers = elm._vModifiers; // injected by v-model runtime
  8051. if (isDef(modifiers)) {
  8052. if (modifiers.number) {
  8053. return toNumber(value) !== toNumber(newVal);
  8054. }
  8055. if (modifiers.trim) {
  8056. return value.trim() !== newVal.trim();
  8057. }
  8058. }
  8059. return value !== newVal;
  8060. }
  8061. var domProps = {
  8062. create: updateDOMProps,
  8063. update: updateDOMProps
  8064. };
  8065. var parseStyleText = cached(function (cssText) {
  8066. var res = {};
  8067. var listDelimiter = /;(?![^(]*\))/g;
  8068. var propertyDelimiter = /:(.+)/;
  8069. cssText.split(listDelimiter).forEach(function (item) {
  8070. if (item) {
  8071. var tmp = item.split(propertyDelimiter);
  8072. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  8073. }
  8074. });
  8075. return res;
  8076. });
  8077. // merge static and dynamic style data on the same vnode
  8078. function normalizeStyleData(data) {
  8079. var style = normalizeStyleBinding(data.style);
  8080. // static style is pre-processed into an object during compilation
  8081. // and is always a fresh object, so it's safe to merge into it
  8082. return data.staticStyle ? extend(data.staticStyle, style) : style;
  8083. }
  8084. // normalize possible array / string values into Object
  8085. function normalizeStyleBinding(bindingStyle) {
  8086. if (Array.isArray(bindingStyle)) {
  8087. return toObject(bindingStyle);
  8088. }
  8089. if (typeof bindingStyle === 'string') {
  8090. return parseStyleText(bindingStyle);
  8091. }
  8092. return bindingStyle;
  8093. }
  8094. /**
  8095. * parent component style should be after child's
  8096. * so that parent component's style could override it
  8097. */
  8098. function getStyle(vnode, checkChild) {
  8099. var res = {};
  8100. var styleData;
  8101. if (checkChild) {
  8102. var childNode = vnode;
  8103. while (childNode.componentInstance) {
  8104. childNode = childNode.componentInstance._vnode;
  8105. if (childNode &&
  8106. childNode.data &&
  8107. (styleData = normalizeStyleData(childNode.data))) {
  8108. extend(res, styleData);
  8109. }
  8110. }
  8111. }
  8112. if ((styleData = normalizeStyleData(vnode.data))) {
  8113. extend(res, styleData);
  8114. }
  8115. var parentNode = vnode;
  8116. // @ts-expect-error parentNode.parent not VNodeWithData
  8117. while ((parentNode = parentNode.parent)) {
  8118. if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {
  8119. extend(res, styleData);
  8120. }
  8121. }
  8122. return res;
  8123. }
  8124. var cssVarRE = /^--/;
  8125. var importantRE = /\s*!important$/;
  8126. var setProp = function (el, name, val) {
  8127. /* istanbul ignore if */
  8128. if (cssVarRE.test(name)) {
  8129. el.style.setProperty(name, val);
  8130. }
  8131. else if (importantRE.test(val)) {
  8132. el.style.setProperty(hyphenate(name), val.replace(importantRE, ''), 'important');
  8133. }
  8134. else {
  8135. var normalizedName = normalize(name);
  8136. if (Array.isArray(val)) {
  8137. // Support values array created by autoprefixer, e.g.
  8138. // {display: ["-webkit-box", "-ms-flexbox", "flex"]}
  8139. // Set them one by one, and the browser will only set those it can recognize
  8140. for (var i = 0, len = val.length; i < len; i++) {
  8141. el.style[normalizedName] = val[i];
  8142. }
  8143. }
  8144. else {
  8145. el.style[normalizedName] = val;
  8146. }
  8147. }
  8148. };
  8149. var vendorNames = ['Webkit', 'Moz', 'ms'];
  8150. var emptyStyle;
  8151. var normalize = cached(function (prop) {
  8152. emptyStyle = emptyStyle || document.createElement('div').style;
  8153. prop = camelize(prop);
  8154. if (prop !== 'filter' && prop in emptyStyle) {
  8155. return prop;
  8156. }
  8157. var capName = prop.charAt(0).toUpperCase() + prop.slice(1);
  8158. for (var i = 0; i < vendorNames.length; i++) {
  8159. var name_1 = vendorNames[i] + capName;
  8160. if (name_1 in emptyStyle) {
  8161. return name_1;
  8162. }
  8163. }
  8164. });
  8165. function updateStyle(oldVnode, vnode) {
  8166. var data = vnode.data;
  8167. var oldData = oldVnode.data;
  8168. if (isUndef(data.staticStyle) &&
  8169. isUndef(data.style) &&
  8170. isUndef(oldData.staticStyle) &&
  8171. isUndef(oldData.style)) {
  8172. return;
  8173. }
  8174. var cur, name;
  8175. var el = vnode.elm;
  8176. var oldStaticStyle = oldData.staticStyle;
  8177. var oldStyleBinding = oldData.normalizedStyle || oldData.style || {};
  8178. // if static style exists, stylebinding already merged into it when doing normalizeStyleData
  8179. var oldStyle = oldStaticStyle || oldStyleBinding;
  8180. var style = normalizeStyleBinding(vnode.data.style) || {};
  8181. // store normalized style under a different key for next diff
  8182. // make sure to clone it if it's reactive, since the user likely wants
  8183. // to mutate it.
  8184. vnode.data.normalizedStyle = isDef(style.__ob__) ? extend({}, style) : style;
  8185. var newStyle = getStyle(vnode, true);
  8186. for (name in oldStyle) {
  8187. if (isUndef(newStyle[name])) {
  8188. setProp(el, name, '');
  8189. }
  8190. }
  8191. for (name in newStyle) {
  8192. cur = newStyle[name];
  8193. if (cur !== oldStyle[name]) {
  8194. // ie9 setting to null has no effect, must use empty string
  8195. setProp(el, name, cur == null ? '' : cur);
  8196. }
  8197. }
  8198. }
  8199. var style$1 = {
  8200. create: updateStyle,
  8201. update: updateStyle
  8202. };
  8203. var whitespaceRE$1 = /\s+/;
  8204. /**
  8205. * Add class with compatibility for SVG since classList is not supported on
  8206. * SVG elements in IE
  8207. */
  8208. function addClass(el, cls) {
  8209. /* istanbul ignore if */
  8210. if (!cls || !(cls = cls.trim())) {
  8211. return;
  8212. }
  8213. /* istanbul ignore else */
  8214. if (el.classList) {
  8215. if (cls.indexOf(' ') > -1) {
  8216. cls.split(whitespaceRE$1).forEach(function (c) { return el.classList.add(c); });
  8217. }
  8218. else {
  8219. el.classList.add(cls);
  8220. }
  8221. }
  8222. else {
  8223. var cur = " ".concat(el.getAttribute('class') || '', " ");
  8224. if (cur.indexOf(' ' + cls + ' ') < 0) {
  8225. el.setAttribute('class', (cur + cls).trim());
  8226. }
  8227. }
  8228. }
  8229. /**
  8230. * Remove class with compatibility for SVG since classList is not supported on
  8231. * SVG elements in IE
  8232. */
  8233. function removeClass(el, cls) {
  8234. /* istanbul ignore if */
  8235. if (!cls || !(cls = cls.trim())) {
  8236. return;
  8237. }
  8238. /* istanbul ignore else */
  8239. if (el.classList) {
  8240. if (cls.indexOf(' ') > -1) {
  8241. cls.split(whitespaceRE$1).forEach(function (c) { return el.classList.remove(c); });
  8242. }
  8243. else {
  8244. el.classList.remove(cls);
  8245. }
  8246. if (!el.classList.length) {
  8247. el.removeAttribute('class');
  8248. }
  8249. }
  8250. else {
  8251. var cur = " ".concat(el.getAttribute('class') || '', " ");
  8252. var tar = ' ' + cls + ' ';
  8253. while (cur.indexOf(tar) >= 0) {
  8254. cur = cur.replace(tar, ' ');
  8255. }
  8256. cur = cur.trim();
  8257. if (cur) {
  8258. el.setAttribute('class', cur);
  8259. }
  8260. else {
  8261. el.removeAttribute('class');
  8262. }
  8263. }
  8264. }
  8265. function resolveTransition(def) {
  8266. if (!def) {
  8267. return;
  8268. }
  8269. /* istanbul ignore else */
  8270. if (typeof def === 'object') {
  8271. var res = {};
  8272. if (def.css !== false) {
  8273. extend(res, autoCssTransition(def.name || 'v'));
  8274. }
  8275. extend(res, def);
  8276. return res;
  8277. }
  8278. else if (typeof def === 'string') {
  8279. return autoCssTransition(def);
  8280. }
  8281. }
  8282. var autoCssTransition = cached(function (name) {
  8283. return {
  8284. enterClass: "".concat(name, "-enter"),
  8285. enterToClass: "".concat(name, "-enter-to"),
  8286. enterActiveClass: "".concat(name, "-enter-active"),
  8287. leaveClass: "".concat(name, "-leave"),
  8288. leaveToClass: "".concat(name, "-leave-to"),
  8289. leaveActiveClass: "".concat(name, "-leave-active")
  8290. };
  8291. });
  8292. var hasTransition = inBrowser && !isIE9;
  8293. var TRANSITION = 'transition';
  8294. var ANIMATION = 'animation';
  8295. // Transition property/event sniffing
  8296. var transitionProp = 'transition';
  8297. var transitionEndEvent = 'transitionend';
  8298. var animationProp = 'animation';
  8299. var animationEndEvent = 'animationend';
  8300. if (hasTransition) {
  8301. /* istanbul ignore if */
  8302. if (window.ontransitionend === undefined &&
  8303. window.onwebkittransitionend !== undefined) {
  8304. transitionProp = 'WebkitTransition';
  8305. transitionEndEvent = 'webkitTransitionEnd';
  8306. }
  8307. if (window.onanimationend === undefined &&
  8308. window.onwebkitanimationend !== undefined) {
  8309. animationProp = 'WebkitAnimation';
  8310. animationEndEvent = 'webkitAnimationEnd';
  8311. }
  8312. }
  8313. // binding to window is necessary to make hot reload work in IE in strict mode
  8314. var raf = inBrowser
  8315. ? window.requestAnimationFrame
  8316. ? window.requestAnimationFrame.bind(window)
  8317. : setTimeout
  8318. : /* istanbul ignore next */ function (/* istanbul ignore next */ fn) { return fn(); };
  8319. function nextFrame(fn) {
  8320. raf(function () {
  8321. // @ts-expect-error
  8322. raf(fn);
  8323. });
  8324. }
  8325. function addTransitionClass(el, cls) {
  8326. var transitionClasses = el._transitionClasses || (el._transitionClasses = []);
  8327. if (transitionClasses.indexOf(cls) < 0) {
  8328. transitionClasses.push(cls);
  8329. addClass(el, cls);
  8330. }
  8331. }
  8332. function removeTransitionClass(el, cls) {
  8333. if (el._transitionClasses) {
  8334. remove$2(el._transitionClasses, cls);
  8335. }
  8336. removeClass(el, cls);
  8337. }
  8338. function whenTransitionEnds(el, expectedType, cb) {
  8339. var _a = getTransitionInfo(el, expectedType), type = _a.type, timeout = _a.timeout, propCount = _a.propCount;
  8340. if (!type)
  8341. return cb();
  8342. var event = type === TRANSITION ? transitionEndEvent : animationEndEvent;
  8343. var ended = 0;
  8344. var end = function () {
  8345. el.removeEventListener(event, onEnd);
  8346. cb();
  8347. };
  8348. var onEnd = function (e) {
  8349. if (e.target === el) {
  8350. if (++ended >= propCount) {
  8351. end();
  8352. }
  8353. }
  8354. };
  8355. setTimeout(function () {
  8356. if (ended < propCount) {
  8357. end();
  8358. }
  8359. }, timeout + 1);
  8360. el.addEventListener(event, onEnd);
  8361. }
  8362. var transformRE = /\b(transform|all)(,|$)/;
  8363. function getTransitionInfo(el, expectedType) {
  8364. var styles = window.getComputedStyle(el);
  8365. // JSDOM may return undefined for transition properties
  8366. var transitionDelays = (styles[transitionProp + 'Delay'] || '').split(', ');
  8367. var transitionDurations = (styles[transitionProp + 'Duration'] || '').split(', ');
  8368. var transitionTimeout = getTimeout(transitionDelays, transitionDurations);
  8369. var animationDelays = (styles[animationProp + 'Delay'] || '').split(', ');
  8370. var animationDurations = (styles[animationProp + 'Duration'] || '').split(', ');
  8371. var animationTimeout = getTimeout(animationDelays, animationDurations);
  8372. var type;
  8373. var timeout = 0;
  8374. var propCount = 0;
  8375. /* istanbul ignore if */
  8376. if (expectedType === TRANSITION) {
  8377. if (transitionTimeout > 0) {
  8378. type = TRANSITION;
  8379. timeout = transitionTimeout;
  8380. propCount = transitionDurations.length;
  8381. }
  8382. }
  8383. else if (expectedType === ANIMATION) {
  8384. if (animationTimeout > 0) {
  8385. type = ANIMATION;
  8386. timeout = animationTimeout;
  8387. propCount = animationDurations.length;
  8388. }
  8389. }
  8390. else {
  8391. timeout = Math.max(transitionTimeout, animationTimeout);
  8392. type =
  8393. timeout > 0
  8394. ? transitionTimeout > animationTimeout
  8395. ? TRANSITION
  8396. : ANIMATION
  8397. : null;
  8398. propCount = type
  8399. ? type === TRANSITION
  8400. ? transitionDurations.length
  8401. : animationDurations.length
  8402. : 0;
  8403. }
  8404. var hasTransform = type === TRANSITION && transformRE.test(styles[transitionProp + 'Property']);
  8405. return {
  8406. type: type,
  8407. timeout: timeout,
  8408. propCount: propCount,
  8409. hasTransform: hasTransform
  8410. };
  8411. }
  8412. function getTimeout(delays, durations) {
  8413. /* istanbul ignore next */
  8414. while (delays.length < durations.length) {
  8415. delays = delays.concat(delays);
  8416. }
  8417. return Math.max.apply(null, durations.map(function (d, i) {
  8418. return toMs(d) + toMs(delays[i]);
  8419. }));
  8420. }
  8421. // Old versions of Chromium (below 61.0.3163.100) formats floating pointer numbers
  8422. // in a locale-dependent way, using a comma instead of a dot.
  8423. // If comma is not replaced with a dot, the input will be rounded down (i.e. acting
  8424. // as a floor function) causing unexpected behaviors
  8425. function toMs(s) {
  8426. return Number(s.slice(0, -1).replace(',', '.')) * 1000;
  8427. }
  8428. function enter(vnode, toggleDisplay) {
  8429. var el = vnode.elm;
  8430. // call leave callback now
  8431. if (isDef(el._leaveCb)) {
  8432. el._leaveCb.cancelled = true;
  8433. el._leaveCb();
  8434. }
  8435. var data = resolveTransition(vnode.data.transition);
  8436. if (isUndef(data)) {
  8437. return;
  8438. }
  8439. /* istanbul ignore if */
  8440. if (isDef(el._enterCb) || el.nodeType !== 1) {
  8441. return;
  8442. }
  8443. 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;
  8444. // activeInstance will always be the <transition> component managing this
  8445. // transition. One edge case to check is when the <transition> is placed
  8446. // as the root node of a child component. In that case we need to check
  8447. // <transition>'s parent for appear check.
  8448. var context = activeInstance;
  8449. var transitionNode = activeInstance.$vnode;
  8450. while (transitionNode && transitionNode.parent) {
  8451. context = transitionNode.context;
  8452. transitionNode = transitionNode.parent;
  8453. }
  8454. var isAppear = !context._isMounted || !vnode.isRootInsert;
  8455. if (isAppear && !appear && appear !== '') {
  8456. return;
  8457. }
  8458. var startClass = isAppear && appearClass ? appearClass : enterClass;
  8459. var activeClass = isAppear && appearActiveClass ? appearActiveClass : enterActiveClass;
  8460. var toClass = isAppear && appearToClass ? appearToClass : enterToClass;
  8461. var beforeEnterHook = isAppear ? beforeAppear || beforeEnter : beforeEnter;
  8462. var enterHook = isAppear ? (isFunction(appear) ? appear : enter) : enter;
  8463. var afterEnterHook = isAppear ? afterAppear || afterEnter : afterEnter;
  8464. var enterCancelledHook = isAppear
  8465. ? appearCancelled || enterCancelled
  8466. : enterCancelled;
  8467. var explicitEnterDuration = toNumber(isObject(duration) ? duration.enter : duration);
  8468. if (explicitEnterDuration != null) {
  8469. checkDuration(explicitEnterDuration, 'enter', vnode);
  8470. }
  8471. var expectsCSS = css !== false && !isIE9;
  8472. var userWantsControl = getHookArgumentsLength(enterHook);
  8473. var cb = (el._enterCb = once(function () {
  8474. if (expectsCSS) {
  8475. removeTransitionClass(el, toClass);
  8476. removeTransitionClass(el, activeClass);
  8477. }
  8478. // @ts-expect-error
  8479. if (cb.cancelled) {
  8480. if (expectsCSS) {
  8481. removeTransitionClass(el, startClass);
  8482. }
  8483. enterCancelledHook && enterCancelledHook(el);
  8484. }
  8485. else {
  8486. afterEnterHook && afterEnterHook(el);
  8487. }
  8488. el._enterCb = null;
  8489. }));
  8490. if (!vnode.data.show) {
  8491. // remove pending leave element on enter by injecting an insert hook
  8492. mergeVNodeHook(vnode, 'insert', function () {
  8493. var parent = el.parentNode;
  8494. var pendingNode = parent && parent._pending && parent._pending[vnode.key];
  8495. if (pendingNode &&
  8496. pendingNode.tag === vnode.tag &&
  8497. pendingNode.elm._leaveCb) {
  8498. pendingNode.elm._leaveCb();
  8499. }
  8500. enterHook && enterHook(el, cb);
  8501. });
  8502. }
  8503. // start enter transition
  8504. beforeEnterHook && beforeEnterHook(el);
  8505. if (expectsCSS) {
  8506. addTransitionClass(el, startClass);
  8507. addTransitionClass(el, activeClass);
  8508. nextFrame(function () {
  8509. removeTransitionClass(el, startClass);
  8510. // @ts-expect-error
  8511. if (!cb.cancelled) {
  8512. addTransitionClass(el, toClass);
  8513. if (!userWantsControl) {
  8514. if (isValidDuration(explicitEnterDuration)) {
  8515. setTimeout(cb, explicitEnterDuration);
  8516. }
  8517. else {
  8518. whenTransitionEnds(el, type, cb);
  8519. }
  8520. }
  8521. }
  8522. });
  8523. }
  8524. if (vnode.data.show) {
  8525. toggleDisplay && toggleDisplay();
  8526. enterHook && enterHook(el, cb);
  8527. }
  8528. if (!expectsCSS && !userWantsControl) {
  8529. cb();
  8530. }
  8531. }
  8532. function leave(vnode, rm) {
  8533. var el = vnode.elm;
  8534. // call enter callback now
  8535. if (isDef(el._enterCb)) {
  8536. el._enterCb.cancelled = true;
  8537. el._enterCb();
  8538. }
  8539. var data = resolveTransition(vnode.data.transition);
  8540. if (isUndef(data) || el.nodeType !== 1) {
  8541. return rm();
  8542. }
  8543. /* istanbul ignore if */
  8544. if (isDef(el._leaveCb)) {
  8545. return;
  8546. }
  8547. 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;
  8548. var expectsCSS = css !== false && !isIE9;
  8549. var userWantsControl = getHookArgumentsLength(leave);
  8550. var explicitLeaveDuration = toNumber(isObject(duration) ? duration.leave : duration);
  8551. if (isDef(explicitLeaveDuration)) {
  8552. checkDuration(explicitLeaveDuration, 'leave', vnode);
  8553. }
  8554. var cb = (el._leaveCb = once(function () {
  8555. if (el.parentNode && el.parentNode._pending) {
  8556. el.parentNode._pending[vnode.key] = null;
  8557. }
  8558. if (expectsCSS) {
  8559. removeTransitionClass(el, leaveToClass);
  8560. removeTransitionClass(el, leaveActiveClass);
  8561. }
  8562. // @ts-expect-error
  8563. if (cb.cancelled) {
  8564. if (expectsCSS) {
  8565. removeTransitionClass(el, leaveClass);
  8566. }
  8567. leaveCancelled && leaveCancelled(el);
  8568. }
  8569. else {
  8570. rm();
  8571. afterLeave && afterLeave(el);
  8572. }
  8573. el._leaveCb = null;
  8574. }));
  8575. if (delayLeave) {
  8576. delayLeave(performLeave);
  8577. }
  8578. else {
  8579. performLeave();
  8580. }
  8581. function performLeave() {
  8582. // the delayed leave may have already been cancelled
  8583. // @ts-expect-error
  8584. if (cb.cancelled) {
  8585. return;
  8586. }
  8587. // record leaving element
  8588. if (!vnode.data.show && el.parentNode) {
  8589. (el.parentNode._pending || (el.parentNode._pending = {}))[vnode.key] =
  8590. vnode;
  8591. }
  8592. beforeLeave && beforeLeave(el);
  8593. if (expectsCSS) {
  8594. addTransitionClass(el, leaveClass);
  8595. addTransitionClass(el, leaveActiveClass);
  8596. nextFrame(function () {
  8597. removeTransitionClass(el, leaveClass);
  8598. // @ts-expect-error
  8599. if (!cb.cancelled) {
  8600. addTransitionClass(el, leaveToClass);
  8601. if (!userWantsControl) {
  8602. if (isValidDuration(explicitLeaveDuration)) {
  8603. setTimeout(cb, explicitLeaveDuration);
  8604. }
  8605. else {
  8606. whenTransitionEnds(el, type, cb);
  8607. }
  8608. }
  8609. }
  8610. });
  8611. }
  8612. leave && leave(el, cb);
  8613. if (!expectsCSS && !userWantsControl) {
  8614. cb();
  8615. }
  8616. }
  8617. }
  8618. // only used in dev mode
  8619. function checkDuration(val, name, vnode) {
  8620. if (typeof val !== 'number') {
  8621. warn$2("<transition> explicit ".concat(name, " duration is not a valid number - ") +
  8622. "got ".concat(JSON.stringify(val), "."), vnode.context);
  8623. }
  8624. else if (isNaN(val)) {
  8625. warn$2("<transition> explicit ".concat(name, " duration is NaN - ") +
  8626. 'the duration expression might be incorrect.', vnode.context);
  8627. }
  8628. }
  8629. function isValidDuration(val) {
  8630. return typeof val === 'number' && !isNaN(val);
  8631. }
  8632. /**
  8633. * Normalize a transition hook's argument length. The hook may be:
  8634. * - a merged hook (invoker) with the original in .fns
  8635. * - a wrapped component method (check ._length)
  8636. * - a plain function (.length)
  8637. */
  8638. function getHookArgumentsLength(fn) {
  8639. if (isUndef(fn)) {
  8640. return false;
  8641. }
  8642. // @ts-expect-error
  8643. var invokerFns = fn.fns;
  8644. if (isDef(invokerFns)) {
  8645. // invoker
  8646. return getHookArgumentsLength(Array.isArray(invokerFns) ? invokerFns[0] : invokerFns);
  8647. }
  8648. else {
  8649. // @ts-expect-error
  8650. return (fn._length || fn.length) > 1;
  8651. }
  8652. }
  8653. function _enter(_, vnode) {
  8654. if (vnode.data.show !== true) {
  8655. enter(vnode);
  8656. }
  8657. }
  8658. var transition = inBrowser
  8659. ? {
  8660. create: _enter,
  8661. activate: _enter,
  8662. remove: function (vnode, rm) {
  8663. /* istanbul ignore else */
  8664. if (vnode.data.show !== true) {
  8665. // @ts-expect-error
  8666. leave(vnode, rm);
  8667. }
  8668. else {
  8669. rm();
  8670. }
  8671. }
  8672. }
  8673. : {};
  8674. var platformModules = [attrs, klass$1, events, domProps, style$1, transition];
  8675. // the directive module should be applied last, after all
  8676. // built-in modules have been applied.
  8677. var modules$1 = platformModules.concat(baseModules);
  8678. var patch = createPatchFunction({ nodeOps: nodeOps, modules: modules$1 });
  8679. /**
  8680. * Not type checking this file because flow doesn't like attaching
  8681. * properties to Elements.
  8682. */
  8683. /* istanbul ignore if */
  8684. if (isIE9) {
  8685. // http://www.matts411.com/post/internet-explorer-9-oninput/
  8686. document.addEventListener('selectionchange', function () {
  8687. var el = document.activeElement;
  8688. // @ts-expect-error
  8689. if (el && el.vmodel) {
  8690. trigger(el, 'input');
  8691. }
  8692. });
  8693. }
  8694. var directive = {
  8695. inserted: function (el, binding, vnode, oldVnode) {
  8696. if (vnode.tag === 'select') {
  8697. // #6903
  8698. if (oldVnode.elm && !oldVnode.elm._vOptions) {
  8699. mergeVNodeHook(vnode, 'postpatch', function () {
  8700. directive.componentUpdated(el, binding, vnode);
  8701. });
  8702. }
  8703. else {
  8704. setSelected(el, binding, vnode.context);
  8705. }
  8706. el._vOptions = [].map.call(el.options, getValue);
  8707. }
  8708. else if (vnode.tag === 'textarea' || isTextInputType(el.type)) {
  8709. el._vModifiers = binding.modifiers;
  8710. if (!binding.modifiers.lazy) {
  8711. el.addEventListener('compositionstart', onCompositionStart);
  8712. el.addEventListener('compositionend', onCompositionEnd);
  8713. // Safari < 10.2 & UIWebView doesn't fire compositionend when
  8714. // switching focus before confirming composition choice
  8715. // this also fixes the issue where some browsers e.g. iOS Chrome
  8716. // fires "change" instead of "input" on autocomplete.
  8717. el.addEventListener('change', onCompositionEnd);
  8718. /* istanbul ignore if */
  8719. if (isIE9) {
  8720. el.vmodel = true;
  8721. }
  8722. }
  8723. }
  8724. },
  8725. componentUpdated: function (el, binding, vnode) {
  8726. if (vnode.tag === 'select') {
  8727. setSelected(el, binding, vnode.context);
  8728. // in case the options rendered by v-for have changed,
  8729. // it's possible that the value is out-of-sync with the rendered options.
  8730. // detect such cases and filter out values that no longer has a matching
  8731. // option in the DOM.
  8732. var prevOptions_1 = el._vOptions;
  8733. var curOptions_1 = (el._vOptions = [].map.call(el.options, getValue));
  8734. if (curOptions_1.some(function (o, i) { return !looseEqual(o, prevOptions_1[i]); })) {
  8735. // trigger change event if
  8736. // no matching option found for at least one value
  8737. var needReset = el.multiple
  8738. ? binding.value.some(function (v) { return hasNoMatchingOption(v, curOptions_1); })
  8739. : binding.value !== binding.oldValue &&
  8740. hasNoMatchingOption(binding.value, curOptions_1);
  8741. if (needReset) {
  8742. trigger(el, 'change');
  8743. }
  8744. }
  8745. }
  8746. }
  8747. };
  8748. function setSelected(el, binding, vm) {
  8749. actuallySetSelected(el, binding, vm);
  8750. /* istanbul ignore if */
  8751. if (isIE || isEdge) {
  8752. setTimeout(function () {
  8753. actuallySetSelected(el, binding, vm);
  8754. }, 0);
  8755. }
  8756. }
  8757. function actuallySetSelected(el, binding, vm) {
  8758. var value = binding.value;
  8759. var isMultiple = el.multiple;
  8760. if (isMultiple && !Array.isArray(value)) {
  8761. warn$2("<select multiple v-model=\"".concat(binding.expression, "\"> ") +
  8762. "expects an Array value for its binding, but got ".concat(Object.prototype.toString
  8763. .call(value)
  8764. .slice(8, -1)), vm);
  8765. return;
  8766. }
  8767. var selected, option;
  8768. for (var i = 0, l = el.options.length; i < l; i++) {
  8769. option = el.options[i];
  8770. if (isMultiple) {
  8771. selected = looseIndexOf(value, getValue(option)) > -1;
  8772. if (option.selected !== selected) {
  8773. option.selected = selected;
  8774. }
  8775. }
  8776. else {
  8777. if (looseEqual(getValue(option), value)) {
  8778. if (el.selectedIndex !== i) {
  8779. el.selectedIndex = i;
  8780. }
  8781. return;
  8782. }
  8783. }
  8784. }
  8785. if (!isMultiple) {
  8786. el.selectedIndex = -1;
  8787. }
  8788. }
  8789. function hasNoMatchingOption(value, options) {
  8790. return options.every(function (o) { return !looseEqual(o, value); });
  8791. }
  8792. function getValue(option) {
  8793. return '_value' in option ? option._value : option.value;
  8794. }
  8795. function onCompositionStart(e) {
  8796. e.target.composing = true;
  8797. }
  8798. function onCompositionEnd(e) {
  8799. // prevent triggering an input event for no reason
  8800. if (!e.target.composing)
  8801. return;
  8802. e.target.composing = false;
  8803. trigger(e.target, 'input');
  8804. }
  8805. function trigger(el, type) {
  8806. var e = document.createEvent('HTMLEvents');
  8807. e.initEvent(type, true, true);
  8808. el.dispatchEvent(e);
  8809. }
  8810. // recursively search for possible transition defined inside the component root
  8811. function locateNode(vnode) {
  8812. // @ts-expect-error
  8813. return vnode.componentInstance && (!vnode.data || !vnode.data.transition)
  8814. ? locateNode(vnode.componentInstance._vnode)
  8815. : vnode;
  8816. }
  8817. var show = {
  8818. bind: function (el, _a, vnode) {
  8819. var value = _a.value;
  8820. vnode = locateNode(vnode);
  8821. var transition = vnode.data && vnode.data.transition;
  8822. var originalDisplay = (el.__vOriginalDisplay =
  8823. el.style.display === 'none' ? '' : el.style.display);
  8824. if (value && transition) {
  8825. vnode.data.show = true;
  8826. enter(vnode, function () {
  8827. el.style.display = originalDisplay;
  8828. });
  8829. }
  8830. else {
  8831. el.style.display = value ? originalDisplay : 'none';
  8832. }
  8833. },
  8834. update: function (el, _a, vnode) {
  8835. var value = _a.value, oldValue = _a.oldValue;
  8836. /* istanbul ignore if */
  8837. if (!value === !oldValue)
  8838. return;
  8839. vnode = locateNode(vnode);
  8840. var transition = vnode.data && vnode.data.transition;
  8841. if (transition) {
  8842. vnode.data.show = true;
  8843. if (value) {
  8844. enter(vnode, function () {
  8845. el.style.display = el.__vOriginalDisplay;
  8846. });
  8847. }
  8848. else {
  8849. leave(vnode, function () {
  8850. el.style.display = 'none';
  8851. });
  8852. }
  8853. }
  8854. else {
  8855. el.style.display = value ? el.__vOriginalDisplay : 'none';
  8856. }
  8857. },
  8858. unbind: function (el, binding, vnode, oldVnode, isDestroy) {
  8859. if (!isDestroy) {
  8860. el.style.display = el.__vOriginalDisplay;
  8861. }
  8862. }
  8863. };
  8864. var platformDirectives = {
  8865. model: directive,
  8866. show: show
  8867. };
  8868. // Provides transition support for a single element/component.
  8869. var transitionProps = {
  8870. name: String,
  8871. appear: Boolean,
  8872. css: Boolean,
  8873. mode: String,
  8874. type: String,
  8875. enterClass: String,
  8876. leaveClass: String,
  8877. enterToClass: String,
  8878. leaveToClass: String,
  8879. enterActiveClass: String,
  8880. leaveActiveClass: String,
  8881. appearClass: String,
  8882. appearActiveClass: String,
  8883. appearToClass: String,
  8884. duration: [Number, String, Object]
  8885. };
  8886. // in case the child is also an abstract component, e.g. <keep-alive>
  8887. // we want to recursively retrieve the real component to be rendered
  8888. function getRealChild(vnode) {
  8889. var compOptions = vnode && vnode.componentOptions;
  8890. if (compOptions && compOptions.Ctor.options.abstract) {
  8891. return getRealChild(getFirstComponentChild(compOptions.children));
  8892. }
  8893. else {
  8894. return vnode;
  8895. }
  8896. }
  8897. function extractTransitionData(comp) {
  8898. var data = {};
  8899. var options = comp.$options;
  8900. // props
  8901. for (var key in options.propsData) {
  8902. data[key] = comp[key];
  8903. }
  8904. // events.
  8905. // extract listeners and pass them directly to the transition methods
  8906. var listeners = options._parentListeners;
  8907. for (var key in listeners) {
  8908. data[camelize(key)] = listeners[key];
  8909. }
  8910. return data;
  8911. }
  8912. function placeholder(h, rawChild) {
  8913. // @ts-expect-error
  8914. if (/\d-keep-alive$/.test(rawChild.tag)) {
  8915. return h('keep-alive', {
  8916. props: rawChild.componentOptions.propsData
  8917. });
  8918. }
  8919. }
  8920. function hasParentTransition(vnode) {
  8921. while ((vnode = vnode.parent)) {
  8922. if (vnode.data.transition) {
  8923. return true;
  8924. }
  8925. }
  8926. }
  8927. function isSameChild(child, oldChild) {
  8928. return oldChild.key === child.key && oldChild.tag === child.tag;
  8929. }
  8930. var isNotTextNode = function (c) { return c.tag || isAsyncPlaceholder(c); };
  8931. var isVShowDirective = function (d) { return d.name === 'show'; };
  8932. var Transition = {
  8933. name: 'transition',
  8934. props: transitionProps,
  8935. abstract: true,
  8936. render: function (h) {
  8937. var _this = this;
  8938. var children = this.$slots.default;
  8939. if (!children) {
  8940. return;
  8941. }
  8942. // filter out text nodes (possible whitespaces)
  8943. children = children.filter(isNotTextNode);
  8944. /* istanbul ignore if */
  8945. if (!children.length) {
  8946. return;
  8947. }
  8948. // warn multiple elements
  8949. if (children.length > 1) {
  8950. warn$2('<transition> can only be used on a single element. Use ' +
  8951. '<transition-group> for lists.', this.$parent);
  8952. }
  8953. var mode = this.mode;
  8954. // warn invalid mode
  8955. if (mode && mode !== 'in-out' && mode !== 'out-in') {
  8956. warn$2('invalid <transition> mode: ' + mode, this.$parent);
  8957. }
  8958. var rawChild = children[0];
  8959. // if this is a component root node and the component's
  8960. // parent container node also has transition, skip.
  8961. if (hasParentTransition(this.$vnode)) {
  8962. return rawChild;
  8963. }
  8964. // apply transition data to child
  8965. // use getRealChild() to ignore abstract components e.g. keep-alive
  8966. var child = getRealChild(rawChild);
  8967. /* istanbul ignore if */
  8968. if (!child) {
  8969. return rawChild;
  8970. }
  8971. if (this._leaving) {
  8972. return placeholder(h, rawChild);
  8973. }
  8974. // ensure a key that is unique to the vnode type and to this transition
  8975. // component instance. This key will be used to remove pending leaving nodes
  8976. // during entering.
  8977. var id = "__transition-".concat(this._uid, "-");
  8978. child.key =
  8979. child.key == null
  8980. ? child.isComment
  8981. ? id + 'comment'
  8982. : id + child.tag
  8983. : isPrimitive(child.key)
  8984. ? String(child.key).indexOf(id) === 0
  8985. ? child.key
  8986. : id + child.key
  8987. : child.key;
  8988. var data = ((child.data || (child.data = {})).transition =
  8989. extractTransitionData(this));
  8990. var oldRawChild = this._vnode;
  8991. var oldChild = getRealChild(oldRawChild);
  8992. // mark v-show
  8993. // so that the transition module can hand over the control to the directive
  8994. if (child.data.directives && child.data.directives.some(isVShowDirective)) {
  8995. child.data.show = true;
  8996. }
  8997. if (oldChild &&
  8998. oldChild.data &&
  8999. !isSameChild(child, oldChild) &&
  9000. !isAsyncPlaceholder(oldChild) &&
  9001. // #6687 component root is a comment node
  9002. !(oldChild.componentInstance &&
  9003. oldChild.componentInstance._vnode.isComment)) {
  9004. // replace old child transition data with fresh one
  9005. // important for dynamic transitions!
  9006. var oldData = (oldChild.data.transition = extend({}, data));
  9007. // handle transition mode
  9008. if (mode === 'out-in') {
  9009. // return placeholder node and queue update when leave finishes
  9010. this._leaving = true;
  9011. mergeVNodeHook(oldData, 'afterLeave', function () {
  9012. _this._leaving = false;
  9013. _this.$forceUpdate();
  9014. });
  9015. return placeholder(h, rawChild);
  9016. }
  9017. else if (mode === 'in-out') {
  9018. if (isAsyncPlaceholder(child)) {
  9019. return oldRawChild;
  9020. }
  9021. var delayedLeave_1;
  9022. var performLeave = function () {
  9023. delayedLeave_1();
  9024. };
  9025. mergeVNodeHook(data, 'afterEnter', performLeave);
  9026. mergeVNodeHook(data, 'enterCancelled', performLeave);
  9027. mergeVNodeHook(oldData, 'delayLeave', function (leave) {
  9028. delayedLeave_1 = leave;
  9029. });
  9030. }
  9031. }
  9032. return rawChild;
  9033. }
  9034. };
  9035. // Provides transition support for list items.
  9036. var props = extend({
  9037. tag: String,
  9038. moveClass: String
  9039. }, transitionProps);
  9040. delete props.mode;
  9041. var TransitionGroup = {
  9042. props: props,
  9043. beforeMount: function () {
  9044. var _this = this;
  9045. var update = this._update;
  9046. this._update = function (vnode, hydrating) {
  9047. var restoreActiveInstance = setActiveInstance(_this);
  9048. // force removing pass
  9049. _this.__patch__(_this._vnode, _this.kept, false, // hydrating
  9050. true // removeOnly (!important, avoids unnecessary moves)
  9051. );
  9052. _this._vnode = _this.kept;
  9053. restoreActiveInstance();
  9054. update.call(_this, vnode, hydrating);
  9055. };
  9056. },
  9057. render: function (h) {
  9058. var tag = this.tag || this.$vnode.data.tag || 'span';
  9059. var map = Object.create(null);
  9060. var prevChildren = (this.prevChildren = this.children);
  9061. var rawChildren = this.$slots.default || [];
  9062. var children = (this.children = []);
  9063. var transitionData = extractTransitionData(this);
  9064. for (var i = 0; i < rawChildren.length; i++) {
  9065. var c = rawChildren[i];
  9066. if (c.tag) {
  9067. if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {
  9068. children.push(c);
  9069. map[c.key] = c;
  9070. (c.data || (c.data = {})).transition = transitionData;
  9071. }
  9072. else {
  9073. var opts = c.componentOptions;
  9074. var name_1 = opts
  9075. ? getComponentName(opts.Ctor.options) || opts.tag || ''
  9076. : c.tag;
  9077. warn$2("<transition-group> children must be keyed: <".concat(name_1, ">"));
  9078. }
  9079. }
  9080. }
  9081. if (prevChildren) {
  9082. var kept = [];
  9083. var removed = [];
  9084. for (var i = 0; i < prevChildren.length; i++) {
  9085. var c = prevChildren[i];
  9086. c.data.transition = transitionData;
  9087. // @ts-expect-error .getBoundingClientRect is not typed in Node
  9088. c.data.pos = c.elm.getBoundingClientRect();
  9089. if (map[c.key]) {
  9090. kept.push(c);
  9091. }
  9092. else {
  9093. removed.push(c);
  9094. }
  9095. }
  9096. this.kept = h(tag, null, kept);
  9097. this.removed = removed;
  9098. }
  9099. return h(tag, null, children);
  9100. },
  9101. updated: function () {
  9102. var children = this.prevChildren;
  9103. var moveClass = this.moveClass || (this.name || 'v') + '-move';
  9104. if (!children.length || !this.hasMove(children[0].elm, moveClass)) {
  9105. return;
  9106. }
  9107. // we divide the work into three loops to avoid mixing DOM reads and writes
  9108. // in each iteration - which helps prevent layout thrashing.
  9109. children.forEach(callPendingCbs);
  9110. children.forEach(recordPosition);
  9111. children.forEach(applyTranslation);
  9112. // force reflow to put everything in position
  9113. // assign to this to avoid being removed in tree-shaking
  9114. // $flow-disable-line
  9115. this._reflow = document.body.offsetHeight;
  9116. children.forEach(function (c) {
  9117. if (c.data.moved) {
  9118. var el_1 = c.elm;
  9119. var s = el_1.style;
  9120. addTransitionClass(el_1, moveClass);
  9121. s.transform = s.WebkitTransform = s.transitionDuration = '';
  9122. el_1.addEventListener(transitionEndEvent, (el_1._moveCb = function cb(e) {
  9123. if (e && e.target !== el_1) {
  9124. return;
  9125. }
  9126. if (!e || /transform$/.test(e.propertyName)) {
  9127. el_1.removeEventListener(transitionEndEvent, cb);
  9128. el_1._moveCb = null;
  9129. removeTransitionClass(el_1, moveClass);
  9130. }
  9131. }));
  9132. }
  9133. });
  9134. },
  9135. methods: {
  9136. hasMove: function (el, moveClass) {
  9137. /* istanbul ignore if */
  9138. if (!hasTransition) {
  9139. return false;
  9140. }
  9141. /* istanbul ignore if */
  9142. if (this._hasMove) {
  9143. return this._hasMove;
  9144. }
  9145. // Detect whether an element with the move class applied has
  9146. // CSS transitions. Since the element may be inside an entering
  9147. // transition at this very moment, we make a clone of it and remove
  9148. // all other transition classes applied to ensure only the move class
  9149. // is applied.
  9150. var clone = el.cloneNode();
  9151. if (el._transitionClasses) {
  9152. el._transitionClasses.forEach(function (cls) {
  9153. removeClass(clone, cls);
  9154. });
  9155. }
  9156. addClass(clone, moveClass);
  9157. clone.style.display = 'none';
  9158. this.$el.appendChild(clone);
  9159. var info = getTransitionInfo(clone);
  9160. this.$el.removeChild(clone);
  9161. return (this._hasMove = info.hasTransform);
  9162. }
  9163. }
  9164. };
  9165. function callPendingCbs(c) {
  9166. /* istanbul ignore if */
  9167. if (c.elm._moveCb) {
  9168. c.elm._moveCb();
  9169. }
  9170. /* istanbul ignore if */
  9171. if (c.elm._enterCb) {
  9172. c.elm._enterCb();
  9173. }
  9174. }
  9175. function recordPosition(c) {
  9176. c.data.newPos = c.elm.getBoundingClientRect();
  9177. }
  9178. function applyTranslation(c) {
  9179. var oldPos = c.data.pos;
  9180. var newPos = c.data.newPos;
  9181. var dx = oldPos.left - newPos.left;
  9182. var dy = oldPos.top - newPos.top;
  9183. if (dx || dy) {
  9184. c.data.moved = true;
  9185. var s = c.elm.style;
  9186. s.transform = s.WebkitTransform = "translate(".concat(dx, "px,").concat(dy, "px)");
  9187. s.transitionDuration = '0s';
  9188. }
  9189. }
  9190. var platformComponents = {
  9191. Transition: Transition,
  9192. TransitionGroup: TransitionGroup
  9193. };
  9194. // install platform specific utils
  9195. Vue.config.mustUseProp = mustUseProp;
  9196. Vue.config.isReservedTag = isReservedTag;
  9197. Vue.config.isReservedAttr = isReservedAttr;
  9198. Vue.config.getTagNamespace = getTagNamespace;
  9199. Vue.config.isUnknownElement = isUnknownElement;
  9200. // install platform runtime directives & components
  9201. extend(Vue.options.directives, platformDirectives);
  9202. extend(Vue.options.components, platformComponents);
  9203. // install platform patch function
  9204. Vue.prototype.__patch__ = inBrowser ? patch : noop;
  9205. // public mount method
  9206. Vue.prototype.$mount = function (el, hydrating) {
  9207. el = el && inBrowser ? query(el) : undefined;
  9208. return mountComponent(this, el, hydrating);
  9209. };
  9210. // devtools global hook
  9211. /* istanbul ignore next */
  9212. if (inBrowser) {
  9213. setTimeout(function () {
  9214. if (config.devtools) {
  9215. if (devtools) {
  9216. devtools.emit('init', Vue);
  9217. }
  9218. else {
  9219. // @ts-expect-error
  9220. console[console.info ? 'info' : 'log']('Download the Vue Devtools extension for a better development experience:\n' +
  9221. 'https://github.com/vuejs/vue-devtools');
  9222. }
  9223. }
  9224. if (config.productionTip !== false &&
  9225. typeof console !== 'undefined') {
  9226. // @ts-expect-error
  9227. console[console.info ? 'info' : 'log']("You are running Vue in development mode.\n" +
  9228. "Make sure to turn on production mode when deploying for production.\n" +
  9229. "See more tips at https://vuejs.org/guide/deployment.html");
  9230. }
  9231. }, 0);
  9232. }
  9233. var defaultTagRE = /\{\{((?:.|\r?\n)+?)\}\}/g;
  9234. var regexEscapeRE = /[-.*+?^${}()|[\]\/\\]/g;
  9235. var buildRegex = cached(function (delimiters) {
  9236. var open = delimiters[0].replace(regexEscapeRE, '\\$&');
  9237. var close = delimiters[1].replace(regexEscapeRE, '\\$&');
  9238. return new RegExp(open + '((?:.|\\n)+?)' + close, 'g');
  9239. });
  9240. function parseText(text, delimiters) {
  9241. //@ts-expect-error
  9242. var tagRE = delimiters ? buildRegex(delimiters) : defaultTagRE;
  9243. if (!tagRE.test(text)) {
  9244. return;
  9245. }
  9246. var tokens = [];
  9247. var rawTokens = [];
  9248. var lastIndex = (tagRE.lastIndex = 0);
  9249. var match, index, tokenValue;
  9250. while ((match = tagRE.exec(text))) {
  9251. index = match.index;
  9252. // push text token
  9253. if (index > lastIndex) {
  9254. rawTokens.push((tokenValue = text.slice(lastIndex, index)));
  9255. tokens.push(JSON.stringify(tokenValue));
  9256. }
  9257. // tag token
  9258. var exp = parseFilters(match[1].trim());
  9259. tokens.push("_s(".concat(exp, ")"));
  9260. rawTokens.push({ '@binding': exp });
  9261. lastIndex = index + match[0].length;
  9262. }
  9263. if (lastIndex < text.length) {
  9264. rawTokens.push((tokenValue = text.slice(lastIndex)));
  9265. tokens.push(JSON.stringify(tokenValue));
  9266. }
  9267. return {
  9268. expression: tokens.join('+'),
  9269. tokens: rawTokens
  9270. };
  9271. }
  9272. function transformNode$1(el, options) {
  9273. var warn = options.warn || baseWarn;
  9274. var staticClass = getAndRemoveAttr(el, 'class');
  9275. if (staticClass) {
  9276. var res = parseText(staticClass, options.delimiters);
  9277. if (res) {
  9278. warn("class=\"".concat(staticClass, "\": ") +
  9279. 'Interpolation inside attributes has been removed. ' +
  9280. 'Use v-bind or the colon shorthand instead. For example, ' +
  9281. 'instead of <div class="{{ val }}">, use <div :class="val">.', el.rawAttrsMap['class']);
  9282. }
  9283. }
  9284. if (staticClass) {
  9285. el.staticClass = JSON.stringify(staticClass.replace(/\s+/g, ' ').trim());
  9286. }
  9287. var classBinding = getBindingAttr(el, 'class', false /* getStatic */);
  9288. if (classBinding) {
  9289. el.classBinding = classBinding;
  9290. }
  9291. }
  9292. function genData$2(el) {
  9293. var data = '';
  9294. if (el.staticClass) {
  9295. data += "staticClass:".concat(el.staticClass, ",");
  9296. }
  9297. if (el.classBinding) {
  9298. data += "class:".concat(el.classBinding, ",");
  9299. }
  9300. return data;
  9301. }
  9302. var klass = {
  9303. staticKeys: ['staticClass'],
  9304. transformNode: transformNode$1,
  9305. genData: genData$2
  9306. };
  9307. function transformNode(el, options) {
  9308. var warn = options.warn || baseWarn;
  9309. var staticStyle = getAndRemoveAttr(el, 'style');
  9310. if (staticStyle) {
  9311. /* istanbul ignore if */
  9312. {
  9313. var res = parseText(staticStyle, options.delimiters);
  9314. if (res) {
  9315. warn("style=\"".concat(staticStyle, "\": ") +
  9316. 'Interpolation inside attributes has been removed. ' +
  9317. 'Use v-bind or the colon shorthand instead. For example, ' +
  9318. 'instead of <div style="{{ val }}">, use <div :style="val">.', el.rawAttrsMap['style']);
  9319. }
  9320. }
  9321. el.staticStyle = JSON.stringify(parseStyleText(staticStyle));
  9322. }
  9323. var styleBinding = getBindingAttr(el, 'style', false /* getStatic */);
  9324. if (styleBinding) {
  9325. el.styleBinding = styleBinding;
  9326. }
  9327. }
  9328. function genData$1(el) {
  9329. var data = '';
  9330. if (el.staticStyle) {
  9331. data += "staticStyle:".concat(el.staticStyle, ",");
  9332. }
  9333. if (el.styleBinding) {
  9334. data += "style:(".concat(el.styleBinding, "),");
  9335. }
  9336. return data;
  9337. }
  9338. var style = {
  9339. staticKeys: ['staticStyle'],
  9340. transformNode: transformNode,
  9341. genData: genData$1
  9342. };
  9343. var decoder;
  9344. var he = {
  9345. decode: function (html) {
  9346. decoder = decoder || document.createElement('div');
  9347. decoder.innerHTML = html;
  9348. return decoder.textContent;
  9349. }
  9350. };
  9351. var isUnaryTag = makeMap('area,base,br,col,embed,frame,hr,img,input,isindex,keygen,' +
  9352. 'link,meta,param,source,track,wbr');
  9353. // Elements that you can, intentionally, leave open
  9354. // (and which close themselves)
  9355. var canBeLeftOpenTag = makeMap('colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source');
  9356. // HTML5 tags https://html.spec.whatwg.org/multipage/indices.html#elements-3
  9357. // Phrasing Content https://html.spec.whatwg.org/multipage/dom.html#phrasing-content
  9358. var isNonPhrasingTag = makeMap('address,article,aside,base,blockquote,body,caption,col,colgroup,dd,' +
  9359. 'details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,' +
  9360. 'h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,' +
  9361. 'optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,' +
  9362. 'title,tr,track');
  9363. /**
  9364. * Not type-checking this file because it's mostly vendor code.
  9365. */
  9366. // Regular Expressions for parsing tags and attributes
  9367. var attribute = /^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/;
  9368. var dynamicArgAttribute = /^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+?\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/;
  9369. var ncname = "[a-zA-Z_][\\-\\.0-9_a-zA-Z".concat(unicodeRegExp.source, "]*");
  9370. var qnameCapture = "((?:".concat(ncname, "\\:)?").concat(ncname, ")");
  9371. var startTagOpen = new RegExp("^<".concat(qnameCapture));
  9372. var startTagClose = /^\s*(\/?)>/;
  9373. var endTag = new RegExp("^<\\/".concat(qnameCapture, "[^>]*>"));
  9374. var doctype = /^<!DOCTYPE [^>]+>/i;
  9375. // #7298: escape - to avoid being passed as HTML comment when inlined in page
  9376. var comment = /^<!\--/;
  9377. var conditionalComment = /^<!\[/;
  9378. // Special Elements (can contain anything)
  9379. var isPlainTextElement = makeMap('script,style,textarea', true);
  9380. var reCache = {};
  9381. var decodingMap = {
  9382. '&lt;': '<',
  9383. '&gt;': '>',
  9384. '&quot;': '"',
  9385. '&amp;': '&',
  9386. '&#10;': '\n',
  9387. '&#9;': '\t',
  9388. '&#39;': "'"
  9389. };
  9390. var encodedAttr = /&(?:lt|gt|quot|amp|#39);/g;
  9391. var encodedAttrWithNewLines = /&(?:lt|gt|quot|amp|#39|#10|#9);/g;
  9392. // #5992
  9393. var isIgnoreNewlineTag = makeMap('pre,textarea', true);
  9394. var shouldIgnoreFirstNewline = function (tag, html) {
  9395. return tag && isIgnoreNewlineTag(tag) && html[0] === '\n';
  9396. };
  9397. function decodeAttr(value, shouldDecodeNewlines) {
  9398. var re = shouldDecodeNewlines ? encodedAttrWithNewLines : encodedAttr;
  9399. return value.replace(re, function (match) { return decodingMap[match]; });
  9400. }
  9401. function parseHTML(html, options) {
  9402. var stack = [];
  9403. var expectHTML = options.expectHTML;
  9404. var isUnaryTag = options.isUnaryTag || no;
  9405. var canBeLeftOpenTag = options.canBeLeftOpenTag || no;
  9406. var index = 0;
  9407. var last, lastTag;
  9408. var _loop_1 = function () {
  9409. last = html;
  9410. // Make sure we're not in a plaintext content element like script/style
  9411. if (!lastTag || !isPlainTextElement(lastTag)) {
  9412. var textEnd = html.indexOf('<');
  9413. if (textEnd === 0) {
  9414. // Comment:
  9415. if (comment.test(html)) {
  9416. var commentEnd = html.indexOf('-->');
  9417. if (commentEnd >= 0) {
  9418. if (options.shouldKeepComment && options.comment) {
  9419. options.comment(html.substring(4, commentEnd), index, index + commentEnd + 3);
  9420. }
  9421. advance(commentEnd + 3);
  9422. return "continue";
  9423. }
  9424. }
  9425. // https://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment
  9426. if (conditionalComment.test(html)) {
  9427. var conditionalEnd = html.indexOf(']>');
  9428. if (conditionalEnd >= 0) {
  9429. advance(conditionalEnd + 2);
  9430. return "continue";
  9431. }
  9432. }
  9433. // Doctype:
  9434. var doctypeMatch = html.match(doctype);
  9435. if (doctypeMatch) {
  9436. advance(doctypeMatch[0].length);
  9437. return "continue";
  9438. }
  9439. // End tag:
  9440. var endTagMatch = html.match(endTag);
  9441. if (endTagMatch) {
  9442. var curIndex = index;
  9443. advance(endTagMatch[0].length);
  9444. parseEndTag(endTagMatch[1], curIndex, index);
  9445. return "continue";
  9446. }
  9447. // Start tag:
  9448. var startTagMatch = parseStartTag();
  9449. if (startTagMatch) {
  9450. handleStartTag(startTagMatch);
  9451. if (shouldIgnoreFirstNewline(startTagMatch.tagName, html)) {
  9452. advance(1);
  9453. }
  9454. return "continue";
  9455. }
  9456. }
  9457. var text = void 0, rest = void 0, next = void 0;
  9458. if (textEnd >= 0) {
  9459. rest = html.slice(textEnd);
  9460. while (!endTag.test(rest) &&
  9461. !startTagOpen.test(rest) &&
  9462. !comment.test(rest) &&
  9463. !conditionalComment.test(rest)) {
  9464. // < in plain text, be forgiving and treat it as text
  9465. next = rest.indexOf('<', 1);
  9466. if (next < 0)
  9467. break;
  9468. textEnd += next;
  9469. rest = html.slice(textEnd);
  9470. }
  9471. text = html.substring(0, textEnd);
  9472. }
  9473. if (textEnd < 0) {
  9474. text = html;
  9475. }
  9476. if (text) {
  9477. advance(text.length);
  9478. }
  9479. if (options.chars && text) {
  9480. options.chars(text, index - text.length, index);
  9481. }
  9482. }
  9483. else {
  9484. var endTagLength_1 = 0;
  9485. var stackedTag_1 = lastTag.toLowerCase();
  9486. var reStackedTag = reCache[stackedTag_1] ||
  9487. (reCache[stackedTag_1] = new RegExp('([\\s\\S]*?)(</' + stackedTag_1 + '[^>]*>)', 'i'));
  9488. var rest = html.replace(reStackedTag, function (all, text, endTag) {
  9489. endTagLength_1 = endTag.length;
  9490. if (!isPlainTextElement(stackedTag_1) && stackedTag_1 !== 'noscript') {
  9491. text = text
  9492. .replace(/<!\--([\s\S]*?)-->/g, '$1') // #7298
  9493. .replace(/<!\[CDATA\[([\s\S]*?)]]>/g, '$1');
  9494. }
  9495. if (shouldIgnoreFirstNewline(stackedTag_1, text)) {
  9496. text = text.slice(1);
  9497. }
  9498. if (options.chars) {
  9499. options.chars(text);
  9500. }
  9501. return '';
  9502. });
  9503. index += html.length - rest.length;
  9504. html = rest;
  9505. parseEndTag(stackedTag_1, index - endTagLength_1, index);
  9506. }
  9507. if (html === last) {
  9508. options.chars && options.chars(html);
  9509. if (!stack.length && options.warn) {
  9510. options.warn("Mal-formatted tag at end of template: \"".concat(html, "\""), {
  9511. start: index + html.length
  9512. });
  9513. }
  9514. return "break";
  9515. }
  9516. };
  9517. while (html) {
  9518. var state_1 = _loop_1();
  9519. if (state_1 === "break")
  9520. break;
  9521. }
  9522. // Clean up any remaining tags
  9523. parseEndTag();
  9524. function advance(n) {
  9525. index += n;
  9526. html = html.substring(n);
  9527. }
  9528. function parseStartTag() {
  9529. var start = html.match(startTagOpen);
  9530. if (start) {
  9531. var match = {
  9532. tagName: start[1],
  9533. attrs: [],
  9534. start: index
  9535. };
  9536. advance(start[0].length);
  9537. var end = void 0, attr = void 0;
  9538. while (!(end = html.match(startTagClose)) &&
  9539. (attr = html.match(dynamicArgAttribute) || html.match(attribute))) {
  9540. attr.start = index;
  9541. advance(attr[0].length);
  9542. attr.end = index;
  9543. match.attrs.push(attr);
  9544. }
  9545. if (end) {
  9546. match.unarySlash = end[1];
  9547. advance(end[0].length);
  9548. match.end = index;
  9549. return match;
  9550. }
  9551. }
  9552. }
  9553. function handleStartTag(match) {
  9554. var tagName = match.tagName;
  9555. var unarySlash = match.unarySlash;
  9556. if (expectHTML) {
  9557. if (lastTag === 'p' && isNonPhrasingTag(tagName)) {
  9558. parseEndTag(lastTag);
  9559. }
  9560. if (canBeLeftOpenTag(tagName) && lastTag === tagName) {
  9561. parseEndTag(tagName);
  9562. }
  9563. }
  9564. var unary = isUnaryTag(tagName) || !!unarySlash;
  9565. var l = match.attrs.length;
  9566. var attrs = new Array(l);
  9567. for (var i = 0; i < l; i++) {
  9568. var args = match.attrs[i];
  9569. var value = args[3] || args[4] || args[5] || '';
  9570. var shouldDecodeNewlines = tagName === 'a' && args[1] === 'href'
  9571. ? options.shouldDecodeNewlinesForHref
  9572. : options.shouldDecodeNewlines;
  9573. attrs[i] = {
  9574. name: args[1],
  9575. value: decodeAttr(value, shouldDecodeNewlines)
  9576. };
  9577. if (options.outputSourceRange) {
  9578. attrs[i].start = args.start + args[0].match(/^\s*/).length;
  9579. attrs[i].end = args.end;
  9580. }
  9581. }
  9582. if (!unary) {
  9583. stack.push({
  9584. tag: tagName,
  9585. lowerCasedTag: tagName.toLowerCase(),
  9586. attrs: attrs,
  9587. start: match.start,
  9588. end: match.end
  9589. });
  9590. lastTag = tagName;
  9591. }
  9592. if (options.start) {
  9593. options.start(tagName, attrs, unary, match.start, match.end);
  9594. }
  9595. }
  9596. function parseEndTag(tagName, start, end) {
  9597. var pos, lowerCasedTagName;
  9598. if (start == null)
  9599. start = index;
  9600. if (end == null)
  9601. end = index;
  9602. // Find the closest opened tag of the same type
  9603. if (tagName) {
  9604. lowerCasedTagName = tagName.toLowerCase();
  9605. for (pos = stack.length - 1; pos >= 0; pos--) {
  9606. if (stack[pos].lowerCasedTag === lowerCasedTagName) {
  9607. break;
  9608. }
  9609. }
  9610. }
  9611. else {
  9612. // If no tag name is provided, clean shop
  9613. pos = 0;
  9614. }
  9615. if (pos >= 0) {
  9616. // Close all the open elements, up the stack
  9617. for (var i = stack.length - 1; i >= pos; i--) {
  9618. if ((i > pos || !tagName) && options.warn) {
  9619. options.warn("tag <".concat(stack[i].tag, "> has no matching end tag."), {
  9620. start: stack[i].start,
  9621. end: stack[i].end
  9622. });
  9623. }
  9624. if (options.end) {
  9625. options.end(stack[i].tag, start, end);
  9626. }
  9627. }
  9628. // Remove the open elements from the stack
  9629. stack.length = pos;
  9630. lastTag = pos && stack[pos - 1].tag;
  9631. }
  9632. else if (lowerCasedTagName === 'br') {
  9633. if (options.start) {
  9634. options.start(tagName, [], true, start, end);
  9635. }
  9636. }
  9637. else if (lowerCasedTagName === 'p') {
  9638. if (options.start) {
  9639. options.start(tagName, [], false, start, end);
  9640. }
  9641. if (options.end) {
  9642. options.end(tagName, start, end);
  9643. }
  9644. }
  9645. }
  9646. }
  9647. var onRE = /^@|^v-on:/;
  9648. var dirRE = /^v-|^@|^:|^#/;
  9649. var forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;
  9650. var forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
  9651. var stripParensRE = /^\(|\)$/g;
  9652. var dynamicArgRE = /^\[.*\]$/;
  9653. var argRE = /:(.*)$/;
  9654. var bindRE = /^:|^\.|^v-bind:/;
  9655. var modifierRE = /\.[^.\]]+(?=[^\]]*$)/g;
  9656. var slotRE = /^v-slot(:|$)|^#/;
  9657. var lineBreakRE = /[\r\n]/;
  9658. var whitespaceRE = /[ \f\t\r\n]+/g;
  9659. var invalidAttributeRE = /[\s"'<>\/=]/;
  9660. var decodeHTMLCached = cached(he.decode);
  9661. var emptySlotScopeToken = "_empty_";
  9662. // configurable state
  9663. var warn;
  9664. var delimiters;
  9665. var transforms;
  9666. var preTransforms;
  9667. var postTransforms;
  9668. var platformIsPreTag;
  9669. var platformMustUseProp;
  9670. var platformGetTagNamespace;
  9671. var maybeComponent;
  9672. function createASTElement(tag, attrs, parent) {
  9673. return {
  9674. type: 1,
  9675. tag: tag,
  9676. attrsList: attrs,
  9677. attrsMap: makeAttrsMap(attrs),
  9678. rawAttrsMap: {},
  9679. parent: parent,
  9680. children: []
  9681. };
  9682. }
  9683. /**
  9684. * Convert HTML string to AST.
  9685. */
  9686. function parse(template, options) {
  9687. warn = options.warn || baseWarn;
  9688. platformIsPreTag = options.isPreTag || no;
  9689. platformMustUseProp = options.mustUseProp || no;
  9690. platformGetTagNamespace = options.getTagNamespace || no;
  9691. var isReservedTag = options.isReservedTag || no;
  9692. maybeComponent = function (el) {
  9693. return !!(el.component ||
  9694. el.attrsMap[':is'] ||
  9695. el.attrsMap['v-bind:is'] ||
  9696. !(el.attrsMap.is ? isReservedTag(el.attrsMap.is) : isReservedTag(el.tag)));
  9697. };
  9698. transforms = pluckModuleFunction(options.modules, 'transformNode');
  9699. preTransforms = pluckModuleFunction(options.modules, 'preTransformNode');
  9700. postTransforms = pluckModuleFunction(options.modules, 'postTransformNode');
  9701. delimiters = options.delimiters;
  9702. var stack = [];
  9703. var preserveWhitespace = options.preserveWhitespace !== false;
  9704. var whitespaceOption = options.whitespace;
  9705. var root;
  9706. var currentParent;
  9707. var inVPre = false;
  9708. var inPre = false;
  9709. var warned = false;
  9710. function warnOnce(msg, range) {
  9711. if (!warned) {
  9712. warned = true;
  9713. warn(msg, range);
  9714. }
  9715. }
  9716. function closeElement(element) {
  9717. trimEndingWhitespace(element);
  9718. if (!inVPre && !element.processed) {
  9719. element = processElement(element, options);
  9720. }
  9721. // tree management
  9722. if (!stack.length && element !== root) {
  9723. // allow root elements with v-if, v-else-if and v-else
  9724. if (root.if && (element.elseif || element.else)) {
  9725. {
  9726. checkRootConstraints(element);
  9727. }
  9728. addIfCondition(root, {
  9729. exp: element.elseif,
  9730. block: element
  9731. });
  9732. }
  9733. else {
  9734. warnOnce("Component template should contain exactly one root element. " +
  9735. "If you are using v-if on multiple elements, " +
  9736. "use v-else-if to chain them instead.", { start: element.start });
  9737. }
  9738. }
  9739. if (currentParent && !element.forbidden) {
  9740. if (element.elseif || element.else) {
  9741. processIfConditions(element, currentParent);
  9742. }
  9743. else {
  9744. if (element.slotScope) {
  9745. // scoped slot
  9746. // keep it in the children list so that v-else(-if) conditions can
  9747. // find it as the prev node.
  9748. var name_1 = element.slotTarget || '"default"';
  9749. (currentParent.scopedSlots || (currentParent.scopedSlots = {}))[name_1] = element;
  9750. }
  9751. currentParent.children.push(element);
  9752. element.parent = currentParent;
  9753. }
  9754. }
  9755. // final children cleanup
  9756. // filter out scoped slots
  9757. element.children = element.children.filter(function (c) { return !c.slotScope; });
  9758. // remove trailing whitespace node again
  9759. trimEndingWhitespace(element);
  9760. // check pre state
  9761. if (element.pre) {
  9762. inVPre = false;
  9763. }
  9764. if (platformIsPreTag(element.tag)) {
  9765. inPre = false;
  9766. }
  9767. // apply post-transforms
  9768. for (var i = 0; i < postTransforms.length; i++) {
  9769. postTransforms[i](element, options);
  9770. }
  9771. }
  9772. function trimEndingWhitespace(el) {
  9773. // remove trailing whitespace node
  9774. if (!inPre) {
  9775. var lastNode = void 0;
  9776. while ((lastNode = el.children[el.children.length - 1]) &&
  9777. lastNode.type === 3 &&
  9778. lastNode.text === ' ') {
  9779. el.children.pop();
  9780. }
  9781. }
  9782. }
  9783. function checkRootConstraints(el) {
  9784. if (el.tag === 'slot' || el.tag === 'template') {
  9785. warnOnce("Cannot use <".concat(el.tag, "> as component root element because it may ") +
  9786. 'contain multiple nodes.', { start: el.start });
  9787. }
  9788. if (el.attrsMap.hasOwnProperty('v-for')) {
  9789. warnOnce('Cannot use v-for on stateful component root element because ' +
  9790. 'it renders multiple elements.', el.rawAttrsMap['v-for']);
  9791. }
  9792. }
  9793. parseHTML(template, {
  9794. warn: warn,
  9795. expectHTML: options.expectHTML,
  9796. isUnaryTag: options.isUnaryTag,
  9797. canBeLeftOpenTag: options.canBeLeftOpenTag,
  9798. shouldDecodeNewlines: options.shouldDecodeNewlines,
  9799. shouldDecodeNewlinesForHref: options.shouldDecodeNewlinesForHref,
  9800. shouldKeepComment: options.comments,
  9801. outputSourceRange: options.outputSourceRange,
  9802. start: function (tag, attrs, unary, start, end) {
  9803. // check namespace.
  9804. // inherit parent ns if there is one
  9805. var ns = (currentParent && currentParent.ns) || platformGetTagNamespace(tag);
  9806. // handle IE svg bug
  9807. /* istanbul ignore if */
  9808. if (isIE && ns === 'svg') {
  9809. attrs = guardIESVGBug(attrs);
  9810. }
  9811. var element = createASTElement(tag, attrs, currentParent);
  9812. if (ns) {
  9813. element.ns = ns;
  9814. }
  9815. {
  9816. if (options.outputSourceRange) {
  9817. element.start = start;
  9818. element.end = end;
  9819. element.rawAttrsMap = element.attrsList.reduce(function (cumulated, attr) {
  9820. cumulated[attr.name] = attr;
  9821. return cumulated;
  9822. }, {});
  9823. }
  9824. attrs.forEach(function (attr) {
  9825. if (invalidAttributeRE.test(attr.name)) {
  9826. warn("Invalid dynamic argument expression: attribute names cannot contain " +
  9827. "spaces, quotes, <, >, / or =.", options.outputSourceRange
  9828. ? {
  9829. start: attr.start + attr.name.indexOf("["),
  9830. end: attr.start + attr.name.length
  9831. }
  9832. : undefined);
  9833. }
  9834. });
  9835. }
  9836. if (isForbiddenTag(element) && !isServerRendering()) {
  9837. element.forbidden = true;
  9838. warn('Templates should only be responsible for mapping the state to the ' +
  9839. 'UI. Avoid placing tags with side-effects in your templates, such as ' +
  9840. "<".concat(tag, ">") +
  9841. ', as they will not be parsed.', { start: element.start });
  9842. }
  9843. // apply pre-transforms
  9844. for (var i = 0; i < preTransforms.length; i++) {
  9845. element = preTransforms[i](element, options) || element;
  9846. }
  9847. if (!inVPre) {
  9848. processPre(element);
  9849. if (element.pre) {
  9850. inVPre = true;
  9851. }
  9852. }
  9853. if (platformIsPreTag(element.tag)) {
  9854. inPre = true;
  9855. }
  9856. if (inVPre) {
  9857. processRawAttrs(element);
  9858. }
  9859. else if (!element.processed) {
  9860. // structural directives
  9861. processFor(element);
  9862. processIf(element);
  9863. processOnce(element);
  9864. }
  9865. if (!root) {
  9866. root = element;
  9867. {
  9868. checkRootConstraints(root);
  9869. }
  9870. }
  9871. if (!unary) {
  9872. currentParent = element;
  9873. stack.push(element);
  9874. }
  9875. else {
  9876. closeElement(element);
  9877. }
  9878. },
  9879. end: function (tag, start, end) {
  9880. var element = stack[stack.length - 1];
  9881. // pop stack
  9882. stack.length -= 1;
  9883. currentParent = stack[stack.length - 1];
  9884. if (options.outputSourceRange) {
  9885. element.end = end;
  9886. }
  9887. closeElement(element);
  9888. },
  9889. chars: function (text, start, end) {
  9890. if (!currentParent) {
  9891. {
  9892. if (text === template) {
  9893. warnOnce('Component template requires a root element, rather than just text.', { start: start });
  9894. }
  9895. else if ((text = text.trim())) {
  9896. warnOnce("text \"".concat(text, "\" outside root element will be ignored."), {
  9897. start: start
  9898. });
  9899. }
  9900. }
  9901. return;
  9902. }
  9903. // IE textarea placeholder bug
  9904. /* istanbul ignore if */
  9905. if (isIE &&
  9906. currentParent.tag === 'textarea' &&
  9907. currentParent.attrsMap.placeholder === text) {
  9908. return;
  9909. }
  9910. var children = currentParent.children;
  9911. if (inPre || text.trim()) {
  9912. text = isTextTag(currentParent)
  9913. ? text
  9914. : decodeHTMLCached(text);
  9915. }
  9916. else if (!children.length) {
  9917. // remove the whitespace-only node right after an opening tag
  9918. text = '';
  9919. }
  9920. else if (whitespaceOption) {
  9921. if (whitespaceOption === 'condense') {
  9922. // in condense mode, remove the whitespace node if it contains
  9923. // line break, otherwise condense to a single space
  9924. text = lineBreakRE.test(text) ? '' : ' ';
  9925. }
  9926. else {
  9927. text = ' ';
  9928. }
  9929. }
  9930. else {
  9931. text = preserveWhitespace ? ' ' : '';
  9932. }
  9933. if (text) {
  9934. if (!inPre && whitespaceOption === 'condense') {
  9935. // condense consecutive whitespaces into single space
  9936. text = text.replace(whitespaceRE, ' ');
  9937. }
  9938. var res = void 0;
  9939. var child = void 0;
  9940. if (!inVPre && text !== ' ' && (res = parseText(text, delimiters))) {
  9941. child = {
  9942. type: 2,
  9943. expression: res.expression,
  9944. tokens: res.tokens,
  9945. text: text
  9946. };
  9947. }
  9948. else if (text !== ' ' ||
  9949. !children.length ||
  9950. children[children.length - 1].text !== ' ') {
  9951. child = {
  9952. type: 3,
  9953. text: text
  9954. };
  9955. }
  9956. if (child) {
  9957. if (options.outputSourceRange) {
  9958. child.start = start;
  9959. child.end = end;
  9960. }
  9961. children.push(child);
  9962. }
  9963. }
  9964. },
  9965. comment: function (text, start, end) {
  9966. // adding anything as a sibling to the root node is forbidden
  9967. // comments should still be allowed, but ignored
  9968. if (currentParent) {
  9969. var child = {
  9970. type: 3,
  9971. text: text,
  9972. isComment: true
  9973. };
  9974. if (options.outputSourceRange) {
  9975. child.start = start;
  9976. child.end = end;
  9977. }
  9978. currentParent.children.push(child);
  9979. }
  9980. }
  9981. });
  9982. return root;
  9983. }
  9984. function processPre(el) {
  9985. if (getAndRemoveAttr(el, 'v-pre') != null) {
  9986. el.pre = true;
  9987. }
  9988. }
  9989. function processRawAttrs(el) {
  9990. var list = el.attrsList;
  9991. var len = list.length;
  9992. if (len) {
  9993. var attrs = (el.attrs = new Array(len));
  9994. for (var i = 0; i < len; i++) {
  9995. attrs[i] = {
  9996. name: list[i].name,
  9997. value: JSON.stringify(list[i].value)
  9998. };
  9999. if (list[i].start != null) {
  10000. attrs[i].start = list[i].start;
  10001. attrs[i].end = list[i].end;
  10002. }
  10003. }
  10004. }
  10005. else if (!el.pre) {
  10006. // non root node in pre blocks with no attributes
  10007. el.plain = true;
  10008. }
  10009. }
  10010. function processElement(element, options) {
  10011. processKey(element);
  10012. // determine whether this is a plain element after
  10013. // removing structural attributes
  10014. element.plain =
  10015. !element.key && !element.scopedSlots && !element.attrsList.length;
  10016. processRef(element);
  10017. processSlotContent(element);
  10018. processSlotOutlet(element);
  10019. processComponent(element);
  10020. for (var i = 0; i < transforms.length; i++) {
  10021. element = transforms[i](element, options) || element;
  10022. }
  10023. processAttrs(element);
  10024. return element;
  10025. }
  10026. function processKey(el) {
  10027. var exp = getBindingAttr(el, 'key');
  10028. if (exp) {
  10029. {
  10030. if (el.tag === 'template') {
  10031. warn("<template> cannot be keyed. Place the key on real elements instead.", getRawBindingAttr(el, 'key'));
  10032. }
  10033. if (el.for) {
  10034. var iterator = el.iterator2 || el.iterator1;
  10035. var parent_1 = el.parent;
  10036. if (iterator &&
  10037. iterator === exp &&
  10038. parent_1 &&
  10039. parent_1.tag === 'transition-group') {
  10040. warn("Do not use v-for index as key on <transition-group> children, " +
  10041. "this is the same as not using keys.", getRawBindingAttr(el, 'key'), true /* tip */);
  10042. }
  10043. }
  10044. }
  10045. el.key = exp;
  10046. }
  10047. }
  10048. function processRef(el) {
  10049. var ref = getBindingAttr(el, 'ref');
  10050. if (ref) {
  10051. el.ref = ref;
  10052. el.refInFor = checkInFor(el);
  10053. }
  10054. }
  10055. function processFor(el) {
  10056. var exp;
  10057. if ((exp = getAndRemoveAttr(el, 'v-for'))) {
  10058. var res = parseFor(exp);
  10059. if (res) {
  10060. extend(el, res);
  10061. }
  10062. else {
  10063. warn("Invalid v-for expression: ".concat(exp), el.rawAttrsMap['v-for']);
  10064. }
  10065. }
  10066. }
  10067. function parseFor(exp) {
  10068. var inMatch = exp.match(forAliasRE);
  10069. if (!inMatch)
  10070. return;
  10071. var res = {};
  10072. res.for = inMatch[2].trim();
  10073. var alias = inMatch[1].trim().replace(stripParensRE, '');
  10074. var iteratorMatch = alias.match(forIteratorRE);
  10075. if (iteratorMatch) {
  10076. res.alias = alias.replace(forIteratorRE, '').trim();
  10077. res.iterator1 = iteratorMatch[1].trim();
  10078. if (iteratorMatch[2]) {
  10079. res.iterator2 = iteratorMatch[2].trim();
  10080. }
  10081. }
  10082. else {
  10083. res.alias = alias;
  10084. }
  10085. return res;
  10086. }
  10087. function processIf(el) {
  10088. var exp = getAndRemoveAttr(el, 'v-if');
  10089. if (exp) {
  10090. el.if = exp;
  10091. addIfCondition(el, {
  10092. exp: exp,
  10093. block: el
  10094. });
  10095. }
  10096. else {
  10097. if (getAndRemoveAttr(el, 'v-else') != null) {
  10098. el.else = true;
  10099. }
  10100. var elseif = getAndRemoveAttr(el, 'v-else-if');
  10101. if (elseif) {
  10102. el.elseif = elseif;
  10103. }
  10104. }
  10105. }
  10106. function processIfConditions(el, parent) {
  10107. var prev = findPrevElement(parent.children);
  10108. if (prev && prev.if) {
  10109. addIfCondition(prev, {
  10110. exp: el.elseif,
  10111. block: el
  10112. });
  10113. }
  10114. else {
  10115. warn("v-".concat(el.elseif ? 'else-if="' + el.elseif + '"' : 'else', " ") +
  10116. "used on element <".concat(el.tag, "> without corresponding v-if."), el.rawAttrsMap[el.elseif ? 'v-else-if' : 'v-else']);
  10117. }
  10118. }
  10119. function findPrevElement(children) {
  10120. var i = children.length;
  10121. while (i--) {
  10122. if (children[i].type === 1) {
  10123. return children[i];
  10124. }
  10125. else {
  10126. if (children[i].text !== ' ') {
  10127. warn("text \"".concat(children[i].text.trim(), "\" between v-if and v-else(-if) ") +
  10128. "will be ignored.", children[i]);
  10129. }
  10130. children.pop();
  10131. }
  10132. }
  10133. }
  10134. function addIfCondition(el, condition) {
  10135. if (!el.ifConditions) {
  10136. el.ifConditions = [];
  10137. }
  10138. el.ifConditions.push(condition);
  10139. }
  10140. function processOnce(el) {
  10141. var once = getAndRemoveAttr(el, 'v-once');
  10142. if (once != null) {
  10143. el.once = true;
  10144. }
  10145. }
  10146. // handle content being passed to a component as slot,
  10147. // e.g. <template slot="xxx">, <div slot-scope="xxx">
  10148. function processSlotContent(el) {
  10149. var slotScope;
  10150. if (el.tag === 'template') {
  10151. slotScope = getAndRemoveAttr(el, 'scope');
  10152. /* istanbul ignore if */
  10153. if (slotScope) {
  10154. warn("the \"scope\" attribute for scoped slots have been deprecated and " +
  10155. "replaced by \"slot-scope\" since 2.5. The new \"slot-scope\" attribute " +
  10156. "can also be used on plain elements in addition to <template> to " +
  10157. "denote scoped slots.", el.rawAttrsMap['scope'], true);
  10158. }
  10159. el.slotScope = slotScope || getAndRemoveAttr(el, 'slot-scope');
  10160. }
  10161. else if ((slotScope = getAndRemoveAttr(el, 'slot-scope'))) {
  10162. /* istanbul ignore if */
  10163. if (el.attrsMap['v-for']) {
  10164. warn("Ambiguous combined usage of slot-scope and v-for on <".concat(el.tag, "> ") +
  10165. "(v-for takes higher priority). Use a wrapper <template> for the " +
  10166. "scoped slot to make it clearer.", el.rawAttrsMap['slot-scope'], true);
  10167. }
  10168. el.slotScope = slotScope;
  10169. }
  10170. // slot="xxx"
  10171. var slotTarget = getBindingAttr(el, 'slot');
  10172. if (slotTarget) {
  10173. el.slotTarget = slotTarget === '""' ? '"default"' : slotTarget;
  10174. el.slotTargetDynamic = !!(el.attrsMap[':slot'] || el.attrsMap['v-bind:slot']);
  10175. // preserve slot as an attribute for native shadow DOM compat
  10176. // only for non-scoped slots.
  10177. if (el.tag !== 'template' && !el.slotScope) {
  10178. addAttr(el, 'slot', slotTarget, getRawBindingAttr(el, 'slot'));
  10179. }
  10180. }
  10181. // 2.6 v-slot syntax
  10182. {
  10183. if (el.tag === 'template') {
  10184. // v-slot on <template>
  10185. var slotBinding = getAndRemoveAttrByRegex(el, slotRE);
  10186. if (slotBinding) {
  10187. {
  10188. if (el.slotTarget || el.slotScope) {
  10189. warn("Unexpected mixed usage of different slot syntaxes.", el);
  10190. }
  10191. if (el.parent && !maybeComponent(el.parent)) {
  10192. warn("<template v-slot> can only appear at the root level inside " +
  10193. "the receiving component", el);
  10194. }
  10195. }
  10196. var _a = getSlotName(slotBinding), name_2 = _a.name, dynamic = _a.dynamic;
  10197. el.slotTarget = name_2;
  10198. el.slotTargetDynamic = dynamic;
  10199. el.slotScope = slotBinding.value || emptySlotScopeToken; // force it into a scoped slot for perf
  10200. }
  10201. }
  10202. else {
  10203. // v-slot on component, denotes default slot
  10204. var slotBinding = getAndRemoveAttrByRegex(el, slotRE);
  10205. if (slotBinding) {
  10206. {
  10207. if (!maybeComponent(el)) {
  10208. warn("v-slot can only be used on components or <template>.", slotBinding);
  10209. }
  10210. if (el.slotScope || el.slotTarget) {
  10211. warn("Unexpected mixed usage of different slot syntaxes.", el);
  10212. }
  10213. if (el.scopedSlots) {
  10214. warn("To avoid scope ambiguity, the default slot should also use " +
  10215. "<template> syntax when there are other named slots.", slotBinding);
  10216. }
  10217. }
  10218. // add the component's children to its default slot
  10219. var slots = el.scopedSlots || (el.scopedSlots = {});
  10220. var _b = getSlotName(slotBinding), name_3 = _b.name, dynamic = _b.dynamic;
  10221. var slotContainer_1 = (slots[name_3] = createASTElement('template', [], el));
  10222. slotContainer_1.slotTarget = name_3;
  10223. slotContainer_1.slotTargetDynamic = dynamic;
  10224. slotContainer_1.children = el.children.filter(function (c) {
  10225. if (!c.slotScope) {
  10226. c.parent = slotContainer_1;
  10227. return true;
  10228. }
  10229. });
  10230. slotContainer_1.slotScope = slotBinding.value || emptySlotScopeToken;
  10231. // remove children as they are returned from scopedSlots now
  10232. el.children = [];
  10233. // mark el non-plain so data gets generated
  10234. el.plain = false;
  10235. }
  10236. }
  10237. }
  10238. }
  10239. function getSlotName(binding) {
  10240. var name = binding.name.replace(slotRE, '');
  10241. if (!name) {
  10242. if (binding.name[0] !== '#') {
  10243. name = 'default';
  10244. }
  10245. else {
  10246. warn("v-slot shorthand syntax requires a slot name.", binding);
  10247. }
  10248. }
  10249. return dynamicArgRE.test(name)
  10250. ? // dynamic [name]
  10251. { name: name.slice(1, -1), dynamic: true }
  10252. : // static name
  10253. { name: "\"".concat(name, "\""), dynamic: false };
  10254. }
  10255. // handle <slot/> outlets
  10256. function processSlotOutlet(el) {
  10257. if (el.tag === 'slot') {
  10258. el.slotName = getBindingAttr(el, 'name');
  10259. if (el.key) {
  10260. warn("`key` does not work on <slot> because slots are abstract outlets " +
  10261. "and can possibly expand into multiple elements. " +
  10262. "Use the key on a wrapping element instead.", getRawBindingAttr(el, 'key'));
  10263. }
  10264. }
  10265. }
  10266. function processComponent(el) {
  10267. var binding;
  10268. if ((binding = getBindingAttr(el, 'is'))) {
  10269. el.component = binding;
  10270. }
  10271. if (getAndRemoveAttr(el, 'inline-template') != null) {
  10272. el.inlineTemplate = true;
  10273. }
  10274. }
  10275. function processAttrs(el) {
  10276. var list = el.attrsList;
  10277. var i, l, name, rawName, value, modifiers, syncGen, isDynamic;
  10278. for (i = 0, l = list.length; i < l; i++) {
  10279. name = rawName = list[i].name;
  10280. value = list[i].value;
  10281. if (dirRE.test(name)) {
  10282. // mark element as dynamic
  10283. el.hasBindings = true;
  10284. // modifiers
  10285. modifiers = parseModifiers(name.replace(dirRE, ''));
  10286. // support .foo shorthand syntax for the .prop modifier
  10287. if (modifiers) {
  10288. name = name.replace(modifierRE, '');
  10289. }
  10290. if (bindRE.test(name)) {
  10291. // v-bind
  10292. name = name.replace(bindRE, '');
  10293. value = parseFilters(value);
  10294. isDynamic = dynamicArgRE.test(name);
  10295. if (isDynamic) {
  10296. name = name.slice(1, -1);
  10297. }
  10298. if (value.trim().length === 0) {
  10299. warn("The value for a v-bind expression cannot be empty. Found in \"v-bind:".concat(name, "\""));
  10300. }
  10301. if (modifiers) {
  10302. if (modifiers.prop && !isDynamic) {
  10303. name = camelize(name);
  10304. if (name === 'innerHtml')
  10305. name = 'innerHTML';
  10306. }
  10307. if (modifiers.camel && !isDynamic) {
  10308. name = camelize(name);
  10309. }
  10310. if (modifiers.sync) {
  10311. syncGen = genAssignmentCode(value, "$event");
  10312. if (!isDynamic) {
  10313. addHandler(el, "update:".concat(camelize(name)), syncGen, null, false, warn, list[i]);
  10314. if (hyphenate(name) !== camelize(name)) {
  10315. addHandler(el, "update:".concat(hyphenate(name)), syncGen, null, false, warn, list[i]);
  10316. }
  10317. }
  10318. else {
  10319. // handler w/ dynamic event name
  10320. addHandler(el, "\"update:\"+(".concat(name, ")"), syncGen, null, false, warn, list[i], true // dynamic
  10321. );
  10322. }
  10323. }
  10324. }
  10325. if ((modifiers && modifiers.prop) ||
  10326. (!el.component && platformMustUseProp(el.tag, el.attrsMap.type, name))) {
  10327. addProp(el, name, value, list[i], isDynamic);
  10328. }
  10329. else {
  10330. addAttr(el, name, value, list[i], isDynamic);
  10331. }
  10332. }
  10333. else if (onRE.test(name)) {
  10334. // v-on
  10335. name = name.replace(onRE, '');
  10336. isDynamic = dynamicArgRE.test(name);
  10337. if (isDynamic) {
  10338. name = name.slice(1, -1);
  10339. }
  10340. addHandler(el, name, value, modifiers, false, warn, list[i], isDynamic);
  10341. }
  10342. else {
  10343. // normal directives
  10344. name = name.replace(dirRE, '');
  10345. // parse arg
  10346. var argMatch = name.match(argRE);
  10347. var arg = argMatch && argMatch[1];
  10348. isDynamic = false;
  10349. if (arg) {
  10350. name = name.slice(0, -(arg.length + 1));
  10351. if (dynamicArgRE.test(arg)) {
  10352. arg = arg.slice(1, -1);
  10353. isDynamic = true;
  10354. }
  10355. }
  10356. addDirective(el, name, rawName, value, arg, isDynamic, modifiers, list[i]);
  10357. if (name === 'model') {
  10358. checkForAliasModel(el, value);
  10359. }
  10360. }
  10361. }
  10362. else {
  10363. // literal attribute
  10364. {
  10365. var res = parseText(value, delimiters);
  10366. if (res) {
  10367. warn("".concat(name, "=\"").concat(value, "\": ") +
  10368. 'Interpolation inside attributes has been removed. ' +
  10369. 'Use v-bind or the colon shorthand instead. For example, ' +
  10370. 'instead of <div id="{{ val }}">, use <div :id="val">.', list[i]);
  10371. }
  10372. }
  10373. addAttr(el, name, JSON.stringify(value), list[i]);
  10374. // #6887 firefox doesn't update muted state if set via attribute
  10375. // even immediately after element creation
  10376. if (!el.component &&
  10377. name === 'muted' &&
  10378. platformMustUseProp(el.tag, el.attrsMap.type, name)) {
  10379. addProp(el, name, 'true', list[i]);
  10380. }
  10381. }
  10382. }
  10383. }
  10384. function checkInFor(el) {
  10385. var parent = el;
  10386. while (parent) {
  10387. if (parent.for !== undefined) {
  10388. return true;
  10389. }
  10390. parent = parent.parent;
  10391. }
  10392. return false;
  10393. }
  10394. function parseModifiers(name) {
  10395. var match = name.match(modifierRE);
  10396. if (match) {
  10397. var ret_1 = {};
  10398. match.forEach(function (m) {
  10399. ret_1[m.slice(1)] = true;
  10400. });
  10401. return ret_1;
  10402. }
  10403. }
  10404. function makeAttrsMap(attrs) {
  10405. var map = {};
  10406. for (var i = 0, l = attrs.length; i < l; i++) {
  10407. if (map[attrs[i].name] && !isIE && !isEdge) {
  10408. warn('duplicate attribute: ' + attrs[i].name, attrs[i]);
  10409. }
  10410. map[attrs[i].name] = attrs[i].value;
  10411. }
  10412. return map;
  10413. }
  10414. // for script (e.g. type="x/template") or style, do not decode content
  10415. function isTextTag(el) {
  10416. return el.tag === 'script' || el.tag === 'style';
  10417. }
  10418. function isForbiddenTag(el) {
  10419. return (el.tag === 'style' ||
  10420. (el.tag === 'script' &&
  10421. (!el.attrsMap.type || el.attrsMap.type === 'text/javascript')));
  10422. }
  10423. var ieNSBug = /^xmlns:NS\d+/;
  10424. var ieNSPrefix = /^NS\d+:/;
  10425. /* istanbul ignore next */
  10426. function guardIESVGBug(attrs) {
  10427. var res = [];
  10428. for (var i = 0; i < attrs.length; i++) {
  10429. var attr = attrs[i];
  10430. if (!ieNSBug.test(attr.name)) {
  10431. attr.name = attr.name.replace(ieNSPrefix, '');
  10432. res.push(attr);
  10433. }
  10434. }
  10435. return res;
  10436. }
  10437. function checkForAliasModel(el, value) {
  10438. var _el = el;
  10439. while (_el) {
  10440. if (_el.for && _el.alias === value) {
  10441. warn("<".concat(el.tag, " v-model=\"").concat(value, "\">: ") +
  10442. "You are binding v-model directly to a v-for iteration alias. " +
  10443. "This will not be able to modify the v-for source array because " +
  10444. "writing to the alias is like modifying a function local variable. " +
  10445. "Consider using an array of objects and use v-model on an object property instead.", el.rawAttrsMap['v-model']);
  10446. }
  10447. _el = _el.parent;
  10448. }
  10449. }
  10450. /**
  10451. * Expand input[v-model] with dynamic type bindings into v-if-else chains
  10452. * Turn this:
  10453. * <input v-model="data[type]" :type="type">
  10454. * into this:
  10455. * <input v-if="type === 'checkbox'" type="checkbox" v-model="data[type]">
  10456. * <input v-else-if="type === 'radio'" type="radio" v-model="data[type]">
  10457. * <input v-else :type="type" v-model="data[type]">
  10458. */
  10459. function preTransformNode(el, options) {
  10460. if (el.tag === 'input') {
  10461. var map = el.attrsMap;
  10462. if (!map['v-model']) {
  10463. return;
  10464. }
  10465. var typeBinding = void 0;
  10466. if (map[':type'] || map['v-bind:type']) {
  10467. typeBinding = getBindingAttr(el, 'type');
  10468. }
  10469. if (!map.type && !typeBinding && map['v-bind']) {
  10470. typeBinding = "(".concat(map['v-bind'], ").type");
  10471. }
  10472. if (typeBinding) {
  10473. var ifCondition = getAndRemoveAttr(el, 'v-if', true);
  10474. var ifConditionExtra = ifCondition ? "&&(".concat(ifCondition, ")") : "";
  10475. var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;
  10476. var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);
  10477. // 1. checkbox
  10478. var branch0 = cloneASTElement(el);
  10479. // process for on the main node
  10480. processFor(branch0);
  10481. addRawAttr(branch0, 'type', 'checkbox');
  10482. processElement(branch0, options);
  10483. branch0.processed = true; // prevent it from double-processed
  10484. branch0.if = "(".concat(typeBinding, ")==='checkbox'") + ifConditionExtra;
  10485. addIfCondition(branch0, {
  10486. exp: branch0.if,
  10487. block: branch0
  10488. });
  10489. // 2. add radio else-if condition
  10490. var branch1 = cloneASTElement(el);
  10491. getAndRemoveAttr(branch1, 'v-for', true);
  10492. addRawAttr(branch1, 'type', 'radio');
  10493. processElement(branch1, options);
  10494. addIfCondition(branch0, {
  10495. exp: "(".concat(typeBinding, ")==='radio'") + ifConditionExtra,
  10496. block: branch1
  10497. });
  10498. // 3. other
  10499. var branch2 = cloneASTElement(el);
  10500. getAndRemoveAttr(branch2, 'v-for', true);
  10501. addRawAttr(branch2, ':type', typeBinding);
  10502. processElement(branch2, options);
  10503. addIfCondition(branch0, {
  10504. exp: ifCondition,
  10505. block: branch2
  10506. });
  10507. if (hasElse) {
  10508. branch0.else = true;
  10509. }
  10510. else if (elseIfCondition) {
  10511. branch0.elseif = elseIfCondition;
  10512. }
  10513. return branch0;
  10514. }
  10515. }
  10516. }
  10517. function cloneASTElement(el) {
  10518. return createASTElement(el.tag, el.attrsList.slice(), el.parent);
  10519. }
  10520. var model = {
  10521. preTransformNode: preTransformNode
  10522. };
  10523. var modules = [klass, style, model];
  10524. function text(el, dir) {
  10525. if (dir.value) {
  10526. addProp(el, 'textContent', "_s(".concat(dir.value, ")"), dir);
  10527. }
  10528. }
  10529. function html(el, dir) {
  10530. if (dir.value) {
  10531. addProp(el, 'innerHTML', "_s(".concat(dir.value, ")"), dir);
  10532. }
  10533. }
  10534. var directives = {
  10535. model: model$1,
  10536. text: text,
  10537. html: html
  10538. };
  10539. var baseOptions = {
  10540. expectHTML: true,
  10541. modules: modules,
  10542. directives: directives,
  10543. isPreTag: isPreTag,
  10544. isUnaryTag: isUnaryTag,
  10545. mustUseProp: mustUseProp,
  10546. canBeLeftOpenTag: canBeLeftOpenTag,
  10547. isReservedTag: isReservedTag,
  10548. getTagNamespace: getTagNamespace,
  10549. staticKeys: genStaticKeys$1(modules)
  10550. };
  10551. var isStaticKey;
  10552. var isPlatformReservedTag;
  10553. var genStaticKeysCached = cached(genStaticKeys);
  10554. /**
  10555. * Goal of the optimizer: walk the generated template AST tree
  10556. * and detect sub-trees that are purely static, i.e. parts of
  10557. * the DOM that never needs to change.
  10558. *
  10559. * Once we detect these sub-trees, we can:
  10560. *
  10561. * 1. Hoist them into constants, so that we no longer need to
  10562. * create fresh nodes for them on each re-render;
  10563. * 2. Completely skip them in the patching process.
  10564. */
  10565. function optimize(root, options) {
  10566. if (!root)
  10567. return;
  10568. isStaticKey = genStaticKeysCached(options.staticKeys || '');
  10569. isPlatformReservedTag = options.isReservedTag || no;
  10570. // first pass: mark all non-static nodes.
  10571. markStatic(root);
  10572. // second pass: mark static roots.
  10573. markStaticRoots(root, false);
  10574. }
  10575. function genStaticKeys(keys) {
  10576. return makeMap('type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap' +
  10577. (keys ? ',' + keys : ''));
  10578. }
  10579. function markStatic(node) {
  10580. node.static = isStatic(node);
  10581. if (node.type === 1) {
  10582. // do not make component slot content static. this avoids
  10583. // 1. components not able to mutate slot nodes
  10584. // 2. static slot content fails for hot-reloading
  10585. if (!isPlatformReservedTag(node.tag) &&
  10586. node.tag !== 'slot' &&
  10587. node.attrsMap['inline-template'] == null) {
  10588. return;
  10589. }
  10590. for (var i = 0, l = node.children.length; i < l; i++) {
  10591. var child = node.children[i];
  10592. markStatic(child);
  10593. if (!child.static) {
  10594. node.static = false;
  10595. }
  10596. }
  10597. if (node.ifConditions) {
  10598. for (var i = 1, l = node.ifConditions.length; i < l; i++) {
  10599. var block = node.ifConditions[i].block;
  10600. markStatic(block);
  10601. if (!block.static) {
  10602. node.static = false;
  10603. }
  10604. }
  10605. }
  10606. }
  10607. }
  10608. function markStaticRoots(node, isInFor) {
  10609. if (node.type === 1) {
  10610. if (node.static || node.once) {
  10611. node.staticInFor = isInFor;
  10612. }
  10613. // For a node to qualify as a static root, it should have children that
  10614. // are not just static text. Otherwise the cost of hoisting out will
  10615. // outweigh the benefits and it's better off to just always render it fresh.
  10616. if (node.static &&
  10617. node.children.length &&
  10618. !(node.children.length === 1 && node.children[0].type === 3)) {
  10619. node.staticRoot = true;
  10620. return;
  10621. }
  10622. else {
  10623. node.staticRoot = false;
  10624. }
  10625. if (node.children) {
  10626. for (var i = 0, l = node.children.length; i < l; i++) {
  10627. markStaticRoots(node.children[i], isInFor || !!node.for);
  10628. }
  10629. }
  10630. if (node.ifConditions) {
  10631. for (var i = 1, l = node.ifConditions.length; i < l; i++) {
  10632. markStaticRoots(node.ifConditions[i].block, isInFor);
  10633. }
  10634. }
  10635. }
  10636. }
  10637. function isStatic(node) {
  10638. if (node.type === 2) {
  10639. // expression
  10640. return false;
  10641. }
  10642. if (node.type === 3) {
  10643. // text
  10644. return true;
  10645. }
  10646. return !!(node.pre ||
  10647. (!node.hasBindings && // no dynamic bindings
  10648. !node.if &&
  10649. !node.for && // not v-if or v-for or v-else
  10650. !isBuiltInTag(node.tag) && // not a built-in
  10651. isPlatformReservedTag(node.tag) && // not a component
  10652. !isDirectChildOfTemplateFor(node) &&
  10653. Object.keys(node).every(isStaticKey)));
  10654. }
  10655. function isDirectChildOfTemplateFor(node) {
  10656. while (node.parent) {
  10657. node = node.parent;
  10658. if (node.tag !== 'template') {
  10659. return false;
  10660. }
  10661. if (node.for) {
  10662. return true;
  10663. }
  10664. }
  10665. return false;
  10666. }
  10667. var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function(?:\s+[\w$]+)?\s*\(/;
  10668. var fnInvokeRE = /\([^)]*?\);*$/;
  10669. var simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/;
  10670. // KeyboardEvent.keyCode aliases
  10671. var keyCodes = {
  10672. esc: 27,
  10673. tab: 9,
  10674. enter: 13,
  10675. space: 32,
  10676. up: 38,
  10677. left: 37,
  10678. right: 39,
  10679. down: 40,
  10680. delete: [8, 46]
  10681. };
  10682. // KeyboardEvent.key aliases
  10683. var keyNames = {
  10684. // #7880: IE11 and Edge use `Esc` for Escape key name.
  10685. esc: ['Esc', 'Escape'],
  10686. tab: 'Tab',
  10687. enter: 'Enter',
  10688. // #9112: IE11 uses `Spacebar` for Space key name.
  10689. space: [' ', 'Spacebar'],
  10690. // #7806: IE11 uses key names without `Arrow` prefix for arrow keys.
  10691. up: ['Up', 'ArrowUp'],
  10692. left: ['Left', 'ArrowLeft'],
  10693. right: ['Right', 'ArrowRight'],
  10694. down: ['Down', 'ArrowDown'],
  10695. // #9112: IE11 uses `Del` for Delete key name.
  10696. delete: ['Backspace', 'Delete', 'Del']
  10697. };
  10698. // #4868: modifiers that prevent the execution of the listener
  10699. // need to explicitly return null so that we can determine whether to remove
  10700. // the listener for .once
  10701. var genGuard = function (condition) { return "if(".concat(condition, ")return null;"); };
  10702. var modifierCode = {
  10703. stop: '$event.stopPropagation();',
  10704. prevent: '$event.preventDefault();',
  10705. self: genGuard("$event.target !== $event.currentTarget"),
  10706. ctrl: genGuard("!$event.ctrlKey"),
  10707. shift: genGuard("!$event.shiftKey"),
  10708. alt: genGuard("!$event.altKey"),
  10709. meta: genGuard("!$event.metaKey"),
  10710. left: genGuard("'button' in $event && $event.button !== 0"),
  10711. middle: genGuard("'button' in $event && $event.button !== 1"),
  10712. right: genGuard("'button' in $event && $event.button !== 2")
  10713. };
  10714. function genHandlers(events, isNative) {
  10715. var prefix = isNative ? 'nativeOn:' : 'on:';
  10716. var staticHandlers = "";
  10717. var dynamicHandlers = "";
  10718. for (var name_1 in events) {
  10719. var handlerCode = genHandler(events[name_1]);
  10720. //@ts-expect-error
  10721. if (events[name_1] && events[name_1].dynamic) {
  10722. dynamicHandlers += "".concat(name_1, ",").concat(handlerCode, ",");
  10723. }
  10724. else {
  10725. staticHandlers += "\"".concat(name_1, "\":").concat(handlerCode, ",");
  10726. }
  10727. }
  10728. staticHandlers = "{".concat(staticHandlers.slice(0, -1), "}");
  10729. if (dynamicHandlers) {
  10730. return prefix + "_d(".concat(staticHandlers, ",[").concat(dynamicHandlers.slice(0, -1), "])");
  10731. }
  10732. else {
  10733. return prefix + staticHandlers;
  10734. }
  10735. }
  10736. function genHandler(handler) {
  10737. if (!handler) {
  10738. return 'function(){}';
  10739. }
  10740. if (Array.isArray(handler)) {
  10741. return "[".concat(handler.map(function (handler) { return genHandler(handler); }).join(','), "]");
  10742. }
  10743. var isMethodPath = simplePathRE.test(handler.value);
  10744. var isFunctionExpression = fnExpRE.test(handler.value);
  10745. var isFunctionInvocation = simplePathRE.test(handler.value.replace(fnInvokeRE, ''));
  10746. if (!handler.modifiers) {
  10747. if (isMethodPath || isFunctionExpression) {
  10748. return handler.value;
  10749. }
  10750. return "function($event){".concat(isFunctionInvocation ? "return ".concat(handler.value) : handler.value, "}"); // inline statement
  10751. }
  10752. else {
  10753. var code = '';
  10754. var genModifierCode = '';
  10755. var keys = [];
  10756. var _loop_1 = function (key) {
  10757. if (modifierCode[key]) {
  10758. genModifierCode += modifierCode[key];
  10759. // left/right
  10760. if (keyCodes[key]) {
  10761. keys.push(key);
  10762. }
  10763. }
  10764. else if (key === 'exact') {
  10765. var modifiers_1 = handler.modifiers;
  10766. genModifierCode += genGuard(['ctrl', 'shift', 'alt', 'meta']
  10767. .filter(function (keyModifier) { return !modifiers_1[keyModifier]; })
  10768. .map(function (keyModifier) { return "$event.".concat(keyModifier, "Key"); })
  10769. .join('||'));
  10770. }
  10771. else {
  10772. keys.push(key);
  10773. }
  10774. };
  10775. for (var key in handler.modifiers) {
  10776. _loop_1(key);
  10777. }
  10778. if (keys.length) {
  10779. code += genKeyFilter(keys);
  10780. }
  10781. // Make sure modifiers like prevent and stop get executed after key filtering
  10782. if (genModifierCode) {
  10783. code += genModifierCode;
  10784. }
  10785. var handlerCode = isMethodPath
  10786. ? "return ".concat(handler.value, ".apply(null, arguments)")
  10787. : isFunctionExpression
  10788. ? "return (".concat(handler.value, ").apply(null, arguments)")
  10789. : isFunctionInvocation
  10790. ? "return ".concat(handler.value)
  10791. : handler.value;
  10792. return "function($event){".concat(code).concat(handlerCode, "}");
  10793. }
  10794. }
  10795. function genKeyFilter(keys) {
  10796. return (
  10797. // make sure the key filters only apply to KeyboardEvents
  10798. // #9441: can't use 'keyCode' in $event because Chrome autofill fires fake
  10799. // key events that do not have keyCode property...
  10800. "if(!$event.type.indexOf('key')&&" +
  10801. "".concat(keys.map(genFilterCode).join('&&'), ")return null;"));
  10802. }
  10803. function genFilterCode(key) {
  10804. var keyVal = parseInt(key, 10);
  10805. if (keyVal) {
  10806. return "$event.keyCode!==".concat(keyVal);
  10807. }
  10808. var keyCode = keyCodes[key];
  10809. var keyName = keyNames[key];
  10810. return ("_k($event.keyCode," +
  10811. "".concat(JSON.stringify(key), ",") +
  10812. "".concat(JSON.stringify(keyCode), ",") +
  10813. "$event.key," +
  10814. "".concat(JSON.stringify(keyName)) +
  10815. ")");
  10816. }
  10817. function on(el, dir) {
  10818. if (dir.modifiers) {
  10819. warn$2("v-on without argument does not support modifiers.");
  10820. }
  10821. el.wrapListeners = function (code) { return "_g(".concat(code, ",").concat(dir.value, ")"); };
  10822. }
  10823. function bind(el, dir) {
  10824. el.wrapData = function (code) {
  10825. return "_b(".concat(code, ",'").concat(el.tag, "',").concat(dir.value, ",").concat(dir.modifiers && dir.modifiers.prop ? 'true' : 'false').concat(dir.modifiers && dir.modifiers.sync ? ',true' : '', ")");
  10826. };
  10827. }
  10828. var baseDirectives = {
  10829. on: on,
  10830. bind: bind,
  10831. cloak: noop
  10832. };
  10833. var CodegenState = /** @class */ (function () {
  10834. function CodegenState(options) {
  10835. this.options = options;
  10836. this.warn = options.warn || baseWarn;
  10837. this.transforms = pluckModuleFunction(options.modules, 'transformCode');
  10838. this.dataGenFns = pluckModuleFunction(options.modules, 'genData');
  10839. this.directives = extend(extend({}, baseDirectives), options.directives);
  10840. var isReservedTag = options.isReservedTag || no;
  10841. this.maybeComponent = function (el) {
  10842. return !!el.component || !isReservedTag(el.tag);
  10843. };
  10844. this.onceId = 0;
  10845. this.staticRenderFns = [];
  10846. this.pre = false;
  10847. }
  10848. return CodegenState;
  10849. }());
  10850. function generate(ast, options) {
  10851. var state = new CodegenState(options);
  10852. // fix #11483, Root level <script> tags should not be rendered.
  10853. var code = ast
  10854. ? ast.tag === 'script'
  10855. ? 'null'
  10856. : genElement(ast, state)
  10857. : '_c("div")';
  10858. return {
  10859. render: "with(this){return ".concat(code, "}"),
  10860. staticRenderFns: state.staticRenderFns
  10861. };
  10862. }
  10863. function genElement(el, state) {
  10864. if (el.parent) {
  10865. el.pre = el.pre || el.parent.pre;
  10866. }
  10867. if (el.staticRoot && !el.staticProcessed) {
  10868. return genStatic(el, state);
  10869. }
  10870. else if (el.once && !el.onceProcessed) {
  10871. return genOnce(el, state);
  10872. }
  10873. else if (el.for && !el.forProcessed) {
  10874. return genFor(el, state);
  10875. }
  10876. else if (el.if && !el.ifProcessed) {
  10877. return genIf(el, state);
  10878. }
  10879. else if (el.tag === 'template' && !el.slotTarget && !state.pre) {
  10880. return genChildren(el, state) || 'void 0';
  10881. }
  10882. else if (el.tag === 'slot') {
  10883. return genSlot(el, state);
  10884. }
  10885. else {
  10886. // component or element
  10887. var code = void 0;
  10888. if (el.component) {
  10889. code = genComponent(el.component, el, state);
  10890. }
  10891. else {
  10892. var data = void 0;
  10893. var maybeComponent = state.maybeComponent(el);
  10894. if (!el.plain || (el.pre && maybeComponent)) {
  10895. data = genData(el, state);
  10896. }
  10897. var tag
  10898. // check if this is a component in <script setup>
  10899. = void 0;
  10900. // check if this is a component in <script setup>
  10901. var bindings = state.options.bindings;
  10902. if (maybeComponent && bindings && bindings.__isScriptSetup !== false) {
  10903. tag = checkBindingType(bindings, el.tag);
  10904. }
  10905. if (!tag)
  10906. tag = "'".concat(el.tag, "'");
  10907. var children = el.inlineTemplate ? null : genChildren(el, state, true);
  10908. code = "_c(".concat(tag).concat(data ? ",".concat(data) : '' // data
  10909. ).concat(children ? ",".concat(children) : '' // children
  10910. , ")");
  10911. }
  10912. // module transforms
  10913. for (var i = 0; i < state.transforms.length; i++) {
  10914. code = state.transforms[i](el, code);
  10915. }
  10916. return code;
  10917. }
  10918. }
  10919. function checkBindingType(bindings, key) {
  10920. var camelName = camelize(key);
  10921. var PascalName = capitalize(camelName);
  10922. var checkType = function (type) {
  10923. if (bindings[key] === type) {
  10924. return key;
  10925. }
  10926. if (bindings[camelName] === type) {
  10927. return camelName;
  10928. }
  10929. if (bindings[PascalName] === type) {
  10930. return PascalName;
  10931. }
  10932. };
  10933. var fromConst = checkType("setup-const" /* BindingTypes.SETUP_CONST */) ||
  10934. checkType("setup-reactive-const" /* BindingTypes.SETUP_REACTIVE_CONST */);
  10935. if (fromConst) {
  10936. return fromConst;
  10937. }
  10938. var fromMaybeRef = checkType("setup-let" /* BindingTypes.SETUP_LET */) ||
  10939. checkType("setup-ref" /* BindingTypes.SETUP_REF */) ||
  10940. checkType("setup-maybe-ref" /* BindingTypes.SETUP_MAYBE_REF */);
  10941. if (fromMaybeRef) {
  10942. return fromMaybeRef;
  10943. }
  10944. }
  10945. // hoist static sub-trees out
  10946. function genStatic(el, state) {
  10947. el.staticProcessed = true;
  10948. // Some elements (templates) need to behave differently inside of a v-pre
  10949. // node. All pre nodes are static roots, so we can use this as a location to
  10950. // wrap a state change and reset it upon exiting the pre node.
  10951. var originalPreState = state.pre;
  10952. if (el.pre) {
  10953. state.pre = el.pre;
  10954. }
  10955. state.staticRenderFns.push("with(this){return ".concat(genElement(el, state), "}"));
  10956. state.pre = originalPreState;
  10957. return "_m(".concat(state.staticRenderFns.length - 1).concat(el.staticInFor ? ',true' : '', ")");
  10958. }
  10959. // v-once
  10960. function genOnce(el, state) {
  10961. el.onceProcessed = true;
  10962. if (el.if && !el.ifProcessed) {
  10963. return genIf(el, state);
  10964. }
  10965. else if (el.staticInFor) {
  10966. var key = '';
  10967. var parent_1 = el.parent;
  10968. while (parent_1) {
  10969. if (parent_1.for) {
  10970. key = parent_1.key;
  10971. break;
  10972. }
  10973. parent_1 = parent_1.parent;
  10974. }
  10975. if (!key) {
  10976. state.warn("v-once can only be used inside v-for that is keyed. ", el.rawAttrsMap['v-once']);
  10977. return genElement(el, state);
  10978. }
  10979. return "_o(".concat(genElement(el, state), ",").concat(state.onceId++, ",").concat(key, ")");
  10980. }
  10981. else {
  10982. return genStatic(el, state);
  10983. }
  10984. }
  10985. function genIf(el, state, altGen, altEmpty) {
  10986. el.ifProcessed = true; // avoid recursion
  10987. return genIfConditions(el.ifConditions.slice(), state, altGen, altEmpty);
  10988. }
  10989. function genIfConditions(conditions, state, altGen, altEmpty) {
  10990. if (!conditions.length) {
  10991. return altEmpty || '_e()';
  10992. }
  10993. var condition = conditions.shift();
  10994. if (condition.exp) {
  10995. return "(".concat(condition.exp, ")?").concat(genTernaryExp(condition.block), ":").concat(genIfConditions(conditions, state, altGen, altEmpty));
  10996. }
  10997. else {
  10998. return "".concat(genTernaryExp(condition.block));
  10999. }
  11000. // v-if with v-once should generate code like (a)?_m(0):_m(1)
  11001. function genTernaryExp(el) {
  11002. return altGen
  11003. ? altGen(el, state)
  11004. : el.once
  11005. ? genOnce(el, state)
  11006. : genElement(el, state);
  11007. }
  11008. }
  11009. function genFor(el, state, altGen, altHelper) {
  11010. var exp = el.for;
  11011. var alias = el.alias;
  11012. var iterator1 = el.iterator1 ? ",".concat(el.iterator1) : '';
  11013. var iterator2 = el.iterator2 ? ",".concat(el.iterator2) : '';
  11014. if (state.maybeComponent(el) &&
  11015. el.tag !== 'slot' &&
  11016. el.tag !== 'template' &&
  11017. !el.key) {
  11018. state.warn("<".concat(el.tag, " v-for=\"").concat(alias, " in ").concat(exp, "\">: component lists rendered with ") +
  11019. "v-for should have explicit keys. " +
  11020. "See https://v2.vuejs.org/v2/guide/list.html#key for more info.", el.rawAttrsMap['v-for'], true /* tip */);
  11021. }
  11022. el.forProcessed = true; // avoid recursion
  11023. return ("".concat(altHelper || '_l', "((").concat(exp, "),") +
  11024. "function(".concat(alias).concat(iterator1).concat(iterator2, "){") +
  11025. "return ".concat((altGen || genElement)(el, state)) +
  11026. '})');
  11027. }
  11028. function genData(el, state) {
  11029. var data = '{';
  11030. // directives first.
  11031. // directives may mutate the el's other properties before they are generated.
  11032. var dirs = genDirectives(el, state);
  11033. if (dirs)
  11034. data += dirs + ',';
  11035. // key
  11036. if (el.key) {
  11037. data += "key:".concat(el.key, ",");
  11038. }
  11039. // ref
  11040. if (el.ref) {
  11041. data += "ref:".concat(el.ref, ",");
  11042. }
  11043. if (el.refInFor) {
  11044. data += "refInFor:true,";
  11045. }
  11046. // pre
  11047. if (el.pre) {
  11048. data += "pre:true,";
  11049. }
  11050. // record original tag name for components using "is" attribute
  11051. if (el.component) {
  11052. data += "tag:\"".concat(el.tag, "\",");
  11053. }
  11054. // module data generation functions
  11055. for (var i = 0; i < state.dataGenFns.length; i++) {
  11056. data += state.dataGenFns[i](el);
  11057. }
  11058. // attributes
  11059. if (el.attrs) {
  11060. data += "attrs:".concat(genProps(el.attrs), ",");
  11061. }
  11062. // DOM props
  11063. if (el.props) {
  11064. data += "domProps:".concat(genProps(el.props), ",");
  11065. }
  11066. // event handlers
  11067. if (el.events) {
  11068. data += "".concat(genHandlers(el.events, false), ",");
  11069. }
  11070. if (el.nativeEvents) {
  11071. data += "".concat(genHandlers(el.nativeEvents, true), ",");
  11072. }
  11073. // slot target
  11074. // only for non-scoped slots
  11075. if (el.slotTarget && !el.slotScope) {
  11076. data += "slot:".concat(el.slotTarget, ",");
  11077. }
  11078. // scoped slots
  11079. if (el.scopedSlots) {
  11080. data += "".concat(genScopedSlots(el, el.scopedSlots, state), ",");
  11081. }
  11082. // component v-model
  11083. if (el.model) {
  11084. data += "model:{value:".concat(el.model.value, ",callback:").concat(el.model.callback, ",expression:").concat(el.model.expression, "},");
  11085. }
  11086. // inline-template
  11087. if (el.inlineTemplate) {
  11088. var inlineTemplate = genInlineTemplate(el, state);
  11089. if (inlineTemplate) {
  11090. data += "".concat(inlineTemplate, ",");
  11091. }
  11092. }
  11093. data = data.replace(/,$/, '') + '}';
  11094. // v-bind dynamic argument wrap
  11095. // v-bind with dynamic arguments must be applied using the same v-bind object
  11096. // merge helper so that class/style/mustUseProp attrs are handled correctly.
  11097. if (el.dynamicAttrs) {
  11098. data = "_b(".concat(data, ",\"").concat(el.tag, "\",").concat(genProps(el.dynamicAttrs), ")");
  11099. }
  11100. // v-bind data wrap
  11101. if (el.wrapData) {
  11102. data = el.wrapData(data);
  11103. }
  11104. // v-on data wrap
  11105. if (el.wrapListeners) {
  11106. data = el.wrapListeners(data);
  11107. }
  11108. return data;
  11109. }
  11110. function genDirectives(el, state) {
  11111. var dirs = el.directives;
  11112. if (!dirs)
  11113. return;
  11114. var res = 'directives:[';
  11115. var hasRuntime = false;
  11116. var i, l, dir, needRuntime;
  11117. for (i = 0, l = dirs.length; i < l; i++) {
  11118. dir = dirs[i];
  11119. needRuntime = true;
  11120. var gen = state.directives[dir.name];
  11121. if (gen) {
  11122. // compile-time directive that manipulates AST.
  11123. // returns true if it also needs a runtime counterpart.
  11124. needRuntime = !!gen(el, dir, state.warn);
  11125. }
  11126. if (needRuntime) {
  11127. hasRuntime = true;
  11128. res += "{name:\"".concat(dir.name, "\",rawName:\"").concat(dir.rawName, "\"").concat(dir.value
  11129. ? ",value:(".concat(dir.value, "),expression:").concat(JSON.stringify(dir.value))
  11130. : '').concat(dir.arg ? ",arg:".concat(dir.isDynamicArg ? dir.arg : "\"".concat(dir.arg, "\"")) : '').concat(dir.modifiers ? ",modifiers:".concat(JSON.stringify(dir.modifiers)) : '', "},");
  11131. }
  11132. }
  11133. if (hasRuntime) {
  11134. return res.slice(0, -1) + ']';
  11135. }
  11136. }
  11137. function genInlineTemplate(el, state) {
  11138. var ast = el.children[0];
  11139. if ((el.children.length !== 1 || ast.type !== 1)) {
  11140. state.warn('Inline-template components must have exactly one child element.', { start: el.start });
  11141. }
  11142. if (ast && ast.type === 1) {
  11143. var inlineRenderFns = generate(ast, state.options);
  11144. return "inlineTemplate:{render:function(){".concat(inlineRenderFns.render, "},staticRenderFns:[").concat(inlineRenderFns.staticRenderFns
  11145. .map(function (code) { return "function(){".concat(code, "}"); })
  11146. .join(','), "]}");
  11147. }
  11148. }
  11149. function genScopedSlots(el, slots, state) {
  11150. // by default scoped slots are considered "stable", this allows child
  11151. // components with only scoped slots to skip forced updates from parent.
  11152. // but in some cases we have to bail-out of this optimization
  11153. // for example if the slot contains dynamic names, has v-if or v-for on them...
  11154. var needsForceUpdate = el.for ||
  11155. Object.keys(slots).some(function (key) {
  11156. var slot = slots[key];
  11157. return (slot.slotTargetDynamic || slot.if || slot.for || containsSlotChild(slot) // is passing down slot from parent which may be dynamic
  11158. );
  11159. });
  11160. // #9534: if a component with scoped slots is inside a conditional branch,
  11161. // it's possible for the same component to be reused but with different
  11162. // compiled slot content. To avoid that, we generate a unique key based on
  11163. // the generated code of all the slot contents.
  11164. var needsKey = !!el.if;
  11165. // OR when it is inside another scoped slot or v-for (the reactivity may be
  11166. // disconnected due to the intermediate scope variable)
  11167. // #9438, #9506
  11168. // TODO: this can be further optimized by properly analyzing in-scope bindings
  11169. // and skip force updating ones that do not actually use scope variables.
  11170. if (!needsForceUpdate) {
  11171. var parent_2 = el.parent;
  11172. while (parent_2) {
  11173. if ((parent_2.slotScope && parent_2.slotScope !== emptySlotScopeToken) ||
  11174. parent_2.for) {
  11175. needsForceUpdate = true;
  11176. break;
  11177. }
  11178. if (parent_2.if) {
  11179. needsKey = true;
  11180. }
  11181. parent_2 = parent_2.parent;
  11182. }
  11183. }
  11184. var generatedSlots = Object.keys(slots)
  11185. .map(function (key) { return genScopedSlot(slots[key], state); })
  11186. .join(',');
  11187. return "scopedSlots:_u([".concat(generatedSlots, "]").concat(needsForceUpdate ? ",null,true" : "").concat(!needsForceUpdate && needsKey ? ",null,false,".concat(hash(generatedSlots)) : "", ")");
  11188. }
  11189. function hash(str) {
  11190. var hash = 5381;
  11191. var i = str.length;
  11192. while (i) {
  11193. hash = (hash * 33) ^ str.charCodeAt(--i);
  11194. }
  11195. return hash >>> 0;
  11196. }
  11197. function containsSlotChild(el) {
  11198. if (el.type === 1) {
  11199. if (el.tag === 'slot') {
  11200. return true;
  11201. }
  11202. return el.children.some(containsSlotChild);
  11203. }
  11204. return false;
  11205. }
  11206. function genScopedSlot(el, state) {
  11207. var isLegacySyntax = el.attrsMap['slot-scope'];
  11208. if (el.if && !el.ifProcessed && !isLegacySyntax) {
  11209. return genIf(el, state, genScopedSlot, "null");
  11210. }
  11211. if (el.for && !el.forProcessed) {
  11212. return genFor(el, state, genScopedSlot);
  11213. }
  11214. var slotScope = el.slotScope === emptySlotScopeToken ? "" : String(el.slotScope);
  11215. var fn = "function(".concat(slotScope, "){") +
  11216. "return ".concat(el.tag === 'template'
  11217. ? el.if && isLegacySyntax
  11218. ? "(".concat(el.if, ")?").concat(genChildren(el, state) || 'undefined', ":undefined")
  11219. : genChildren(el, state) || 'undefined'
  11220. : genElement(el, state), "}");
  11221. // reverse proxy v-slot without scope on this.$slots
  11222. var reverseProxy = slotScope ? "" : ",proxy:true";
  11223. return "{key:".concat(el.slotTarget || "\"default\"", ",fn:").concat(fn).concat(reverseProxy, "}");
  11224. }
  11225. function genChildren(el, state, checkSkip, altGenElement, altGenNode) {
  11226. var children = el.children;
  11227. if (children.length) {
  11228. var el_1 = children[0];
  11229. // optimize single v-for
  11230. if (children.length === 1 &&
  11231. el_1.for &&
  11232. el_1.tag !== 'template' &&
  11233. el_1.tag !== 'slot') {
  11234. var normalizationType_1 = checkSkip
  11235. ? state.maybeComponent(el_1)
  11236. ? ",1"
  11237. : ",0"
  11238. : "";
  11239. return "".concat((altGenElement || genElement)(el_1, state)).concat(normalizationType_1);
  11240. }
  11241. var normalizationType = checkSkip
  11242. ? getNormalizationType(children, state.maybeComponent)
  11243. : 0;
  11244. var gen_1 = altGenNode || genNode;
  11245. return "[".concat(children.map(function (c) { return gen_1(c, state); }).join(','), "]").concat(normalizationType ? ",".concat(normalizationType) : '');
  11246. }
  11247. }
  11248. // determine the normalization needed for the children array.
  11249. // 0: no normalization needed
  11250. // 1: simple normalization needed (possible 1-level deep nested array)
  11251. // 2: full normalization needed
  11252. function getNormalizationType(children, maybeComponent) {
  11253. var res = 0;
  11254. for (var i = 0; i < children.length; i++) {
  11255. var el = children[i];
  11256. if (el.type !== 1) {
  11257. continue;
  11258. }
  11259. if (needsNormalization(el) ||
  11260. (el.ifConditions &&
  11261. el.ifConditions.some(function (c) { return needsNormalization(c.block); }))) {
  11262. res = 2;
  11263. break;
  11264. }
  11265. if (maybeComponent(el) ||
  11266. (el.ifConditions && el.ifConditions.some(function (c) { return maybeComponent(c.block); }))) {
  11267. res = 1;
  11268. }
  11269. }
  11270. return res;
  11271. }
  11272. function needsNormalization(el) {
  11273. return el.for !== undefined || el.tag === 'template' || el.tag === 'slot';
  11274. }
  11275. function genNode(node, state) {
  11276. if (node.type === 1) {
  11277. return genElement(node, state);
  11278. }
  11279. else if (node.type === 3 && node.isComment) {
  11280. return genComment(node);
  11281. }
  11282. else {
  11283. return genText(node);
  11284. }
  11285. }
  11286. function genText(text) {
  11287. return "_v(".concat(text.type === 2
  11288. ? text.expression // no need for () because already wrapped in _s()
  11289. : transformSpecialNewlines(JSON.stringify(text.text)), ")");
  11290. }
  11291. function genComment(comment) {
  11292. return "_e(".concat(JSON.stringify(comment.text), ")");
  11293. }
  11294. function genSlot(el, state) {
  11295. var slotName = el.slotName || '"default"';
  11296. var children = genChildren(el, state);
  11297. var res = "_t(".concat(slotName).concat(children ? ",function(){return ".concat(children, "}") : '');
  11298. var attrs = el.attrs || el.dynamicAttrs
  11299. ? genProps((el.attrs || []).concat(el.dynamicAttrs || []).map(function (attr) { return ({
  11300. // slot props are camelized
  11301. name: camelize(attr.name),
  11302. value: attr.value,
  11303. dynamic: attr.dynamic
  11304. }); }))
  11305. : null;
  11306. var bind = el.attrsMap['v-bind'];
  11307. if ((attrs || bind) && !children) {
  11308. res += ",null";
  11309. }
  11310. if (attrs) {
  11311. res += ",".concat(attrs);
  11312. }
  11313. if (bind) {
  11314. res += "".concat(attrs ? '' : ',null', ",").concat(bind);
  11315. }
  11316. return res + ')';
  11317. }
  11318. // componentName is el.component, take it as argument to shun flow's pessimistic refinement
  11319. function genComponent(componentName, el, state) {
  11320. var children = el.inlineTemplate ? null : genChildren(el, state, true);
  11321. return "_c(".concat(componentName, ",").concat(genData(el, state)).concat(children ? ",".concat(children) : '', ")");
  11322. }
  11323. function genProps(props) {
  11324. var staticProps = "";
  11325. var dynamicProps = "";
  11326. for (var i = 0; i < props.length; i++) {
  11327. var prop = props[i];
  11328. var value = transformSpecialNewlines(prop.value);
  11329. if (prop.dynamic) {
  11330. dynamicProps += "".concat(prop.name, ",").concat(value, ",");
  11331. }
  11332. else {
  11333. staticProps += "\"".concat(prop.name, "\":").concat(value, ",");
  11334. }
  11335. }
  11336. staticProps = "{".concat(staticProps.slice(0, -1), "}");
  11337. if (dynamicProps) {
  11338. return "_d(".concat(staticProps, ",[").concat(dynamicProps.slice(0, -1), "])");
  11339. }
  11340. else {
  11341. return staticProps;
  11342. }
  11343. }
  11344. // #3895, #4268
  11345. function transformSpecialNewlines(text) {
  11346. return text.replace(/\u2028/g, '\\u2028').replace(/\u2029/g, '\\u2029');
  11347. }
  11348. // these keywords should not appear inside expressions, but operators like
  11349. // typeof, instanceof and in are allowed
  11350. var prohibitedKeywordRE = new RegExp('\\b' +
  11351. ('do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' +
  11352. 'super,throw,while,yield,delete,export,import,return,switch,default,' +
  11353. 'extends,finally,continue,debugger,function,arguments')
  11354. .split(',')
  11355. .join('\\b|\\b') +
  11356. '\\b');
  11357. // these unary operators should not be used as property/method names
  11358. var unaryOperatorsRE = new RegExp('\\b' +
  11359. 'delete,typeof,void'.split(',').join('\\s*\\([^\\)]*\\)|\\b') +
  11360. '\\s*\\([^\\)]*\\)');
  11361. // strip strings in expressions
  11362. var stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;
  11363. // detect problematic expressions in a template
  11364. function detectErrors(ast, warn) {
  11365. if (ast) {
  11366. checkNode(ast, warn);
  11367. }
  11368. }
  11369. function checkNode(node, warn) {
  11370. if (node.type === 1) {
  11371. for (var name_1 in node.attrsMap) {
  11372. if (dirRE.test(name_1)) {
  11373. var value = node.attrsMap[name_1];
  11374. if (value) {
  11375. var range = node.rawAttrsMap[name_1];
  11376. if (name_1 === 'v-for') {
  11377. checkFor(node, "v-for=\"".concat(value, "\""), warn, range);
  11378. }
  11379. else if (name_1 === 'v-slot' || name_1[0] === '#') {
  11380. checkFunctionParameterExpression(value, "".concat(name_1, "=\"").concat(value, "\""), warn, range);
  11381. }
  11382. else if (onRE.test(name_1)) {
  11383. checkEvent(value, "".concat(name_1, "=\"").concat(value, "\""), warn, range);
  11384. }
  11385. else {
  11386. checkExpression(value, "".concat(name_1, "=\"").concat(value, "\""), warn, range);
  11387. }
  11388. }
  11389. }
  11390. }
  11391. if (node.children) {
  11392. for (var i = 0; i < node.children.length; i++) {
  11393. checkNode(node.children[i], warn);
  11394. }
  11395. }
  11396. }
  11397. else if (node.type === 2) {
  11398. checkExpression(node.expression, node.text, warn, node);
  11399. }
  11400. }
  11401. function checkEvent(exp, text, warn, range) {
  11402. var stripped = exp.replace(stripStringRE, '');
  11403. var keywordMatch = stripped.match(unaryOperatorsRE);
  11404. if (keywordMatch && stripped.charAt(keywordMatch.index - 1) !== '$') {
  11405. warn("avoid using JavaScript unary operator as property name: " +
  11406. "\"".concat(keywordMatch[0], "\" in expression ").concat(text.trim()), range);
  11407. }
  11408. checkExpression(exp, text, warn, range);
  11409. }
  11410. function checkFor(node, text, warn, range) {
  11411. checkExpression(node.for || '', text, warn, range);
  11412. checkIdentifier(node.alias, 'v-for alias', text, warn, range);
  11413. checkIdentifier(node.iterator1, 'v-for iterator', text, warn, range);
  11414. checkIdentifier(node.iterator2, 'v-for iterator', text, warn, range);
  11415. }
  11416. function checkIdentifier(ident, type, text, warn, range) {
  11417. if (typeof ident === 'string') {
  11418. try {
  11419. new Function("var ".concat(ident, "=_"));
  11420. }
  11421. catch (e) {
  11422. warn("invalid ".concat(type, " \"").concat(ident, "\" in expression: ").concat(text.trim()), range);
  11423. }
  11424. }
  11425. }
  11426. function checkExpression(exp, text, warn, range) {
  11427. try {
  11428. new Function("return ".concat(exp));
  11429. }
  11430. catch (e) {
  11431. var keywordMatch = exp
  11432. .replace(stripStringRE, '')
  11433. .match(prohibitedKeywordRE);
  11434. if (keywordMatch) {
  11435. warn("avoid using JavaScript keyword as property name: " +
  11436. "\"".concat(keywordMatch[0], "\"\n Raw expression: ").concat(text.trim()), range);
  11437. }
  11438. else {
  11439. warn("invalid expression: ".concat(e.message, " in\n\n") +
  11440. " ".concat(exp, "\n\n") +
  11441. " Raw expression: ".concat(text.trim(), "\n"), range);
  11442. }
  11443. }
  11444. }
  11445. function checkFunctionParameterExpression(exp, text, warn, range) {
  11446. try {
  11447. new Function(exp, '');
  11448. }
  11449. catch (e) {
  11450. warn("invalid function parameter expression: ".concat(e.message, " in\n\n") +
  11451. " ".concat(exp, "\n\n") +
  11452. " Raw expression: ".concat(text.trim(), "\n"), range);
  11453. }
  11454. }
  11455. var range = 2;
  11456. function generateCodeFrame(source, start, end) {
  11457. if (start === void 0) { start = 0; }
  11458. if (end === void 0) { end = source.length; }
  11459. var lines = source.split(/\r?\n/);
  11460. var count = 0;
  11461. var res = [];
  11462. for (var i = 0; i < lines.length; i++) {
  11463. count += lines[i].length + 1;
  11464. if (count >= start) {
  11465. for (var j = i - range; j <= i + range || end > count; j++) {
  11466. if (j < 0 || j >= lines.length)
  11467. continue;
  11468. res.push("".concat(j + 1).concat(repeat(" ", 3 - String(j + 1).length), "| ").concat(lines[j]));
  11469. var lineLength = lines[j].length;
  11470. if (j === i) {
  11471. // push underline
  11472. var pad = start - (count - lineLength) + 1;
  11473. var length_1 = end > count ? lineLength - pad : end - start;
  11474. res.push(" | " + repeat(" ", pad) + repeat("^", length_1));
  11475. }
  11476. else if (j > i) {
  11477. if (end > count) {
  11478. var length_2 = Math.min(end - count, lineLength);
  11479. res.push(" | " + repeat("^", length_2));
  11480. }
  11481. count += lineLength + 1;
  11482. }
  11483. }
  11484. break;
  11485. }
  11486. }
  11487. return res.join('\n');
  11488. }
  11489. function repeat(str, n) {
  11490. var result = '';
  11491. if (n > 0) {
  11492. // eslint-disable-next-line no-constant-condition
  11493. while (true) {
  11494. // eslint-disable-line
  11495. if (n & 1)
  11496. result += str;
  11497. n >>>= 1;
  11498. if (n <= 0)
  11499. break;
  11500. str += str;
  11501. }
  11502. }
  11503. return result;
  11504. }
  11505. function createFunction(code, errors) {
  11506. try {
  11507. return new Function(code);
  11508. }
  11509. catch (err) {
  11510. errors.push({ err: err, code: code });
  11511. return noop;
  11512. }
  11513. }
  11514. function createCompileToFunctionFn(compile) {
  11515. var cache = Object.create(null);
  11516. return function compileToFunctions(template, options, vm) {
  11517. options = extend({}, options);
  11518. var warn = options.warn || warn$2;
  11519. delete options.warn;
  11520. /* istanbul ignore if */
  11521. {
  11522. // detect possible CSP restriction
  11523. try {
  11524. new Function('return 1');
  11525. }
  11526. catch (e) {
  11527. if (e.toString().match(/unsafe-eval|CSP/)) {
  11528. warn('It seems you are using the standalone build of Vue.js in an ' +
  11529. 'environment with Content Security Policy that prohibits unsafe-eval. ' +
  11530. 'The template compiler cannot work in this environment. Consider ' +
  11531. 'relaxing the policy to allow unsafe-eval or pre-compiling your ' +
  11532. 'templates into render functions.');
  11533. }
  11534. }
  11535. }
  11536. // check cache
  11537. var key = options.delimiters
  11538. ? String(options.delimiters) + template
  11539. : template;
  11540. if (cache[key]) {
  11541. return cache[key];
  11542. }
  11543. // compile
  11544. var compiled = compile(template, options);
  11545. // check compilation errors/tips
  11546. {
  11547. if (compiled.errors && compiled.errors.length) {
  11548. if (options.outputSourceRange) {
  11549. compiled.errors.forEach(function (e) {
  11550. warn("Error compiling template:\n\n".concat(e.msg, "\n\n") +
  11551. generateCodeFrame(template, e.start, e.end), vm);
  11552. });
  11553. }
  11554. else {
  11555. warn("Error compiling template:\n\n".concat(template, "\n\n") +
  11556. compiled.errors.map(function (e) { return "- ".concat(e); }).join('\n') +
  11557. '\n', vm);
  11558. }
  11559. }
  11560. if (compiled.tips && compiled.tips.length) {
  11561. if (options.outputSourceRange) {
  11562. compiled.tips.forEach(function (e) { return tip(e.msg, vm); });
  11563. }
  11564. else {
  11565. compiled.tips.forEach(function (msg) { return tip(msg, vm); });
  11566. }
  11567. }
  11568. }
  11569. // turn code into functions
  11570. var res = {};
  11571. var fnGenErrors = [];
  11572. res.render = createFunction(compiled.render, fnGenErrors);
  11573. res.staticRenderFns = compiled.staticRenderFns.map(function (code) {
  11574. return createFunction(code, fnGenErrors);
  11575. });
  11576. // check function generation errors.
  11577. // this should only happen if there is a bug in the compiler itself.
  11578. // mostly for codegen development use
  11579. /* istanbul ignore if */
  11580. {
  11581. if ((!compiled.errors || !compiled.errors.length) && fnGenErrors.length) {
  11582. warn("Failed to generate render function:\n\n" +
  11583. fnGenErrors
  11584. .map(function (_a) {
  11585. var err = _a.err, code = _a.code;
  11586. return "".concat(err.toString(), " in\n\n").concat(code, "\n");
  11587. })
  11588. .join('\n'), vm);
  11589. }
  11590. }
  11591. return (cache[key] = res);
  11592. };
  11593. }
  11594. function createCompilerCreator(baseCompile) {
  11595. return function createCompiler(baseOptions) {
  11596. function compile(template, options) {
  11597. var finalOptions = Object.create(baseOptions);
  11598. var errors = [];
  11599. var tips = [];
  11600. var warn = function (msg, range, tip) {
  11601. (tip ? tips : errors).push(msg);
  11602. };
  11603. if (options) {
  11604. if (options.outputSourceRange) {
  11605. // $flow-disable-line
  11606. var leadingSpaceLength_1 = template.match(/^\s*/)[0].length;
  11607. warn = function (msg, range, tip) {
  11608. var data = typeof msg === 'string' ? { msg: msg } : msg;
  11609. if (range) {
  11610. if (range.start != null) {
  11611. data.start = range.start + leadingSpaceLength_1;
  11612. }
  11613. if (range.end != null) {
  11614. data.end = range.end + leadingSpaceLength_1;
  11615. }
  11616. }
  11617. (tip ? tips : errors).push(data);
  11618. };
  11619. }
  11620. // merge custom modules
  11621. if (options.modules) {
  11622. finalOptions.modules = (baseOptions.modules || []).concat(options.modules);
  11623. }
  11624. // merge custom directives
  11625. if (options.directives) {
  11626. finalOptions.directives = extend(Object.create(baseOptions.directives || null), options.directives);
  11627. }
  11628. // copy other options
  11629. for (var key in options) {
  11630. if (key !== 'modules' && key !== 'directives') {
  11631. finalOptions[key] = options[key];
  11632. }
  11633. }
  11634. }
  11635. finalOptions.warn = warn;
  11636. var compiled = baseCompile(template.trim(), finalOptions);
  11637. {
  11638. detectErrors(compiled.ast, warn);
  11639. }
  11640. compiled.errors = errors;
  11641. compiled.tips = tips;
  11642. return compiled;
  11643. }
  11644. return {
  11645. compile: compile,
  11646. compileToFunctions: createCompileToFunctionFn(compile)
  11647. };
  11648. };
  11649. }
  11650. // `createCompilerCreator` allows creating compilers that use alternative
  11651. // parser/optimizer/codegen, e.g the SSR optimizing compiler.
  11652. // Here we just export a default compiler using the default parts.
  11653. var createCompiler = createCompilerCreator(function baseCompile(template, options) {
  11654. var ast = parse(template.trim(), options);
  11655. if (options.optimize !== false) {
  11656. optimize(ast, options);
  11657. }
  11658. var code = generate(ast, options);
  11659. return {
  11660. ast: ast,
  11661. render: code.render,
  11662. staticRenderFns: code.staticRenderFns
  11663. };
  11664. });
  11665. var _a = createCompiler(baseOptions), compileToFunctions = _a.compileToFunctions;
  11666. // check whether current browser encodes a char inside attribute values
  11667. var div;
  11668. function getShouldDecode(href) {
  11669. div = div || document.createElement('div');
  11670. div.innerHTML = href ? "<a href=\"\n\"/>" : "<div a=\"\n\"/>";
  11671. return div.innerHTML.indexOf('&#10;') > 0;
  11672. }
  11673. // #3663: IE encodes newlines inside attribute values while other browsers don't
  11674. var shouldDecodeNewlines = inBrowser ? getShouldDecode(false) : false;
  11675. // #6828: chrome encodes content in a[href]
  11676. var shouldDecodeNewlinesForHref = inBrowser
  11677. ? getShouldDecode(true)
  11678. : false;
  11679. var idToTemplate = cached(function (id) {
  11680. var el = query(id);
  11681. return el && el.innerHTML;
  11682. });
  11683. var mount = Vue.prototype.$mount;
  11684. Vue.prototype.$mount = function (el, hydrating) {
  11685. el = el && query(el);
  11686. /* istanbul ignore if */
  11687. if (el === document.body || el === document.documentElement) {
  11688. warn$2("Do not mount Vue to <html> or <body> - mount to normal elements instead.");
  11689. return this;
  11690. }
  11691. var options = this.$options;
  11692. // resolve template/el and convert to render function
  11693. if (!options.render) {
  11694. var template = options.template;
  11695. if (template) {
  11696. if (typeof template === 'string') {
  11697. if (template.charAt(0) === '#') {
  11698. template = idToTemplate(template);
  11699. /* istanbul ignore if */
  11700. if (!template) {
  11701. warn$2("Template element not found or is empty: ".concat(options.template), this);
  11702. }
  11703. }
  11704. }
  11705. else if (template.nodeType) {
  11706. template = template.innerHTML;
  11707. }
  11708. else {
  11709. {
  11710. warn$2('invalid template option:' + template, this);
  11711. }
  11712. return this;
  11713. }
  11714. }
  11715. else if (el) {
  11716. // @ts-expect-error
  11717. template = getOuterHTML(el);
  11718. }
  11719. if (template) {
  11720. /* istanbul ignore if */
  11721. if (config.performance && mark) {
  11722. mark('compile');
  11723. }
  11724. var _a = compileToFunctions(template, {
  11725. outputSourceRange: true,
  11726. shouldDecodeNewlines: shouldDecodeNewlines,
  11727. shouldDecodeNewlinesForHref: shouldDecodeNewlinesForHref,
  11728. delimiters: options.delimiters,
  11729. comments: options.comments
  11730. }, this), render = _a.render, staticRenderFns = _a.staticRenderFns;
  11731. options.render = render;
  11732. options.staticRenderFns = staticRenderFns;
  11733. /* istanbul ignore if */
  11734. if (config.performance && mark) {
  11735. mark('compile end');
  11736. measure("vue ".concat(this._name, " compile"), 'compile', 'compile end');
  11737. }
  11738. }
  11739. }
  11740. return mount.call(this, el, hydrating);
  11741. };
  11742. /**
  11743. * Get outerHTML of elements, taking care
  11744. * of SVG elements in IE as well.
  11745. */
  11746. function getOuterHTML(el) {
  11747. if (el.outerHTML) {
  11748. return el.outerHTML;
  11749. }
  11750. else {
  11751. var container = document.createElement('div');
  11752. container.appendChild(el.cloneNode(true));
  11753. return container.innerHTML;
  11754. }
  11755. }
  11756. Vue.compile = compileToFunctions;
  11757. // export type EffectScheduler = (...args: any[]) => any
  11758. /**
  11759. * @internal since we are not exposing this in Vue 2, it's used only for
  11760. * internal testing.
  11761. */
  11762. function effect(fn, scheduler) {
  11763. var watcher = new Watcher(currentInstance, fn, noop, {
  11764. sync: true
  11765. });
  11766. if (scheduler) {
  11767. watcher.update = function () {
  11768. scheduler(function () { return watcher.run(); });
  11769. };
  11770. }
  11771. }
  11772. extend(Vue, vca);
  11773. Vue.effect = effect;
  11774. return Vue;
  11775. }));