vue.js 263 KB

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