specs.js 247 KB

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