vendor.js 324 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],[
  2. /* 0 */,
  3. /* 1 */
  4. /*!************************************************************!*\
  5. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  6. \************************************************************/
  7. /*! no static exports found */
  8. /***/ (function(module, exports, __webpack_require__) {
  9. "use strict";
  10. Object.defineProperty(exports, "__esModule", { value: true });exports.createApp = createApp;exports.createComponent = createComponent;exports.createPage = createPage;exports.default = void 0;var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 2));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};var ownKeys = Object.keys(source);if (typeof Object.getOwnPropertySymbols === 'function') {ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {return Object.getOwnPropertyDescriptor(source, sym).enumerable;}));}ownKeys.forEach(function (key) {_defineProperty(target, key, source[key]);});}return target;}function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance");}function _iterableToArrayLimit(arr, i) {var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"] != null) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _toConsumableArray(arr) {return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();}function _nonIterableSpread() {throw new TypeError("Invalid attempt to spread non-iterable instance");}function _iterableToArray(iter) {if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);}function _arrayWithoutHoles(arr) {if (Array.isArray(arr)) {for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {arr2[i] = arr[i];}return arr2;}}
  11. var _toString = Object.prototype.toString;
  12. var hasOwnProperty = Object.prototype.hasOwnProperty;
  13. function isFn(fn) {
  14. return typeof fn === 'function';
  15. }
  16. function isStr(str) {
  17. return typeof str === 'string';
  18. }
  19. function isPlainObject(obj) {
  20. return _toString.call(obj) === '[object Object]';
  21. }
  22. function hasOwn(obj, key) {
  23. return hasOwnProperty.call(obj, key);
  24. }
  25. function noop() {}
  26. /**
  27. * Create a cached version of a pure function.
  28. */
  29. function cached(fn) {
  30. var cache = Object.create(null);
  31. return function cachedFn(str) {
  32. var hit = cache[str];
  33. return hit || (cache[str] = fn(str));
  34. };
  35. }
  36. /**
  37. * Camelize a hyphen-delimited string.
  38. */
  39. var camelizeRE = /-(\w)/g;
  40. var camelize = cached(function (str) {
  41. return str.replace(camelizeRE, function (_, c) {return c ? c.toUpperCase() : '';});
  42. });
  43. var HOOKS = [
  44. 'invoke',
  45. 'success',
  46. 'fail',
  47. 'complete',
  48. 'returnValue'];
  49. var globalInterceptors = {};
  50. var scopedInterceptors = {};
  51. function mergeHook(parentVal, childVal) {
  52. var res = childVal ?
  53. parentVal ?
  54. parentVal.concat(childVal) :
  55. Array.isArray(childVal) ?
  56. childVal : [childVal] :
  57. parentVal;
  58. return res ?
  59. dedupeHooks(res) :
  60. res;
  61. }
  62. function dedupeHooks(hooks) {
  63. var res = [];
  64. for (var i = 0; i < hooks.length; i++) {
  65. if (res.indexOf(hooks[i]) === -1) {
  66. res.push(hooks[i]);
  67. }
  68. }
  69. return res;
  70. }
  71. function removeHook(hooks, hook) {
  72. var index = hooks.indexOf(hook);
  73. if (index !== -1) {
  74. hooks.splice(index, 1);
  75. }
  76. }
  77. function mergeInterceptorHook(interceptor, option) {
  78. Object.keys(option).forEach(function (hook) {
  79. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  80. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  81. }
  82. });
  83. }
  84. function removeInterceptorHook(interceptor, option) {
  85. if (!interceptor || !option) {
  86. return;
  87. }
  88. Object.keys(option).forEach(function (hook) {
  89. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  90. removeHook(interceptor[hook], option[hook]);
  91. }
  92. });
  93. }
  94. function addInterceptor(method, option) {
  95. if (typeof method === 'string' && isPlainObject(option)) {
  96. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  97. } else if (isPlainObject(method)) {
  98. mergeInterceptorHook(globalInterceptors, method);
  99. }
  100. }
  101. function removeInterceptor(method, option) {
  102. if (typeof method === 'string') {
  103. if (isPlainObject(option)) {
  104. removeInterceptorHook(scopedInterceptors[method], option);
  105. } else {
  106. delete scopedInterceptors[method];
  107. }
  108. } else if (isPlainObject(method)) {
  109. removeInterceptorHook(globalInterceptors, method);
  110. }
  111. }
  112. function wrapperHook(hook) {
  113. return function (data) {
  114. return hook(data) || data;
  115. };
  116. }
  117. function isPromise(obj) {
  118. return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  119. }
  120. function queue(hooks, data) {
  121. var promise = false;
  122. for (var i = 0; i < hooks.length; i++) {
  123. var hook = hooks[i];
  124. if (promise) {
  125. promise = Promise.then(wrapperHook(hook));
  126. } else {
  127. var res = hook(data);
  128. if (isPromise(res)) {
  129. promise = Promise.resolve(res);
  130. }
  131. if (res === false) {
  132. return {
  133. then: function then() {} };
  134. }
  135. }
  136. }
  137. return promise || {
  138. then: function then(callback) {
  139. return callback(data);
  140. } };
  141. }
  142. function wrapperOptions(interceptor) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  143. ['success', 'fail', 'complete'].forEach(function (name) {
  144. if (Array.isArray(interceptor[name])) {
  145. var oldCallback = options[name];
  146. options[name] = function callbackInterceptor(res) {
  147. queue(interceptor[name], res).then(function (res) {
  148. /* eslint-disable no-mixed-operators */
  149. return isFn(oldCallback) && oldCallback(res) || res;
  150. });
  151. };
  152. }
  153. });
  154. return options;
  155. }
  156. function wrapperReturnValue(method, returnValue) {
  157. var returnValueHooks = [];
  158. if (Array.isArray(globalInterceptors.returnValue)) {
  159. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(globalInterceptors.returnValue));
  160. }
  161. var interceptor = scopedInterceptors[method];
  162. if (interceptor && Array.isArray(interceptor.returnValue)) {
  163. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(interceptor.returnValue));
  164. }
  165. returnValueHooks.forEach(function (hook) {
  166. returnValue = hook(returnValue) || returnValue;
  167. });
  168. return returnValue;
  169. }
  170. function getApiInterceptorHooks(method) {
  171. var interceptor = Object.create(null);
  172. Object.keys(globalInterceptors).forEach(function (hook) {
  173. if (hook !== 'returnValue') {
  174. interceptor[hook] = globalInterceptors[hook].slice();
  175. }
  176. });
  177. var scopedInterceptor = scopedInterceptors[method];
  178. if (scopedInterceptor) {
  179. Object.keys(scopedInterceptor).forEach(function (hook) {
  180. if (hook !== 'returnValue') {
  181. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  182. }
  183. });
  184. }
  185. return interceptor;
  186. }
  187. function invokeApi(method, api, options) {for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {params[_key - 3] = arguments[_key];}
  188. var interceptor = getApiInterceptorHooks(method);
  189. if (interceptor && Object.keys(interceptor).length) {
  190. if (Array.isArray(interceptor.invoke)) {
  191. var res = queue(interceptor.invoke, options);
  192. return res.then(function (options) {
  193. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  194. });
  195. } else {
  196. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  197. }
  198. }
  199. return api.apply(void 0, [options].concat(params));
  200. }
  201. var promiseInterceptor = {
  202. returnValue: function returnValue(res) {
  203. if (!isPromise(res)) {
  204. return res;
  205. }
  206. return res.then(function (res) {
  207. return res[1];
  208. }).catch(function (res) {
  209. return res[0];
  210. });
  211. } };
  212. var SYNC_API_RE =
  213. /^\$|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/;
  214. var CONTEXT_API_RE = /^create|Manager$/;
  215. var CALLBACK_API_RE = /^on/;
  216. function isContextApi(name) {
  217. return CONTEXT_API_RE.test(name);
  218. }
  219. function isSyncApi(name) {
  220. return SYNC_API_RE.test(name);
  221. }
  222. function isCallbackApi(name) {
  223. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  224. }
  225. function handlePromise(promise) {
  226. return promise.then(function (data) {
  227. return [null, data];
  228. }).
  229. catch(function (err) {return [err];});
  230. }
  231. function shouldPromise(name) {
  232. if (
  233. isContextApi(name) ||
  234. isSyncApi(name) ||
  235. isCallbackApi(name))
  236. {
  237. return false;
  238. }
  239. return true;
  240. }
  241. function promisify(name, api) {
  242. if (!shouldPromise(name)) {
  243. return api;
  244. }
  245. return function promiseApi() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {params[_key2 - 1] = arguments[_key2];}
  246. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  247. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  248. }
  249. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  250. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  251. success: resolve,
  252. fail: reject })].concat(
  253. params));
  254. /* eslint-disable no-extend-native */
  255. if (!Promise.prototype.finally) {
  256. Promise.prototype.finally = function (callback) {
  257. var promise = this.constructor;
  258. return this.then(
  259. function (value) {return promise.resolve(callback()).then(function () {return value;});},
  260. function (reason) {return promise.resolve(callback()).then(function () {
  261. throw reason;
  262. });});
  263. };
  264. }
  265. })));
  266. };
  267. }
  268. var EPS = 1e-4;
  269. var BASE_DEVICE_WIDTH = 750;
  270. var isIOS = false;
  271. var deviceWidth = 0;
  272. var deviceDPR = 0;
  273. function checkDeviceWidth() {var _wx$getSystemInfoSync =
  274. wx.getSystemInfoSync(),platform = _wx$getSystemInfoSync.platform,pixelRatio = _wx$getSystemInfoSync.pixelRatio,windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  275. deviceWidth = windowWidth;
  276. deviceDPR = pixelRatio;
  277. isIOS = platform === 'ios';
  278. }
  279. function upx2px(number, newDeviceWidth) {
  280. if (deviceWidth === 0) {
  281. checkDeviceWidth();
  282. }
  283. number = Number(number);
  284. if (number === 0) {
  285. return 0;
  286. }
  287. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  288. if (result < 0) {
  289. result = -result;
  290. }
  291. result = Math.floor(result + EPS);
  292. if (result === 0) {
  293. if (deviceDPR === 1 || !isIOS) {
  294. return 1;
  295. } else {
  296. return 0.5;
  297. }
  298. }
  299. return number < 0 ? -result : result;
  300. }
  301. var interceptors = {
  302. promiseInterceptor: promiseInterceptor };
  303. var baseApi = /*#__PURE__*/Object.freeze({
  304. __proto__: null,
  305. upx2px: upx2px,
  306. interceptors: interceptors,
  307. addInterceptor: addInterceptor,
  308. removeInterceptor: removeInterceptor });
  309. var previewImage = {
  310. args: function args(fromArgs) {
  311. var currentIndex = parseInt(fromArgs.current);
  312. if (isNaN(currentIndex)) {
  313. return;
  314. }
  315. var urls = fromArgs.urls;
  316. if (!Array.isArray(urls)) {
  317. return;
  318. }
  319. var len = urls.length;
  320. if (!len) {
  321. return;
  322. }
  323. if (currentIndex < 0) {
  324. currentIndex = 0;
  325. } else if (currentIndex >= len) {
  326. currentIndex = len - 1;
  327. }
  328. if (currentIndex > 0) {
  329. fromArgs.current = urls[currentIndex];
  330. fromArgs.urls = urls.filter(
  331. function (item, index) {return index < currentIndex ? item !== urls[currentIndex] : true;});
  332. } else {
  333. fromArgs.current = urls[0];
  334. }
  335. return {
  336. indicator: false,
  337. loop: false };
  338. } };
  339. function addSafeAreaInsets(result) {
  340. if (result.safeArea) {
  341. var safeArea = result.safeArea;
  342. result.safeAreaInsets = {
  343. top: safeArea.top,
  344. left: safeArea.left,
  345. right: result.windowWidth - safeArea.right,
  346. bottom: result.windowHeight - safeArea.bottom };
  347. }
  348. }
  349. var protocols = {
  350. previewImage: previewImage,
  351. getSystemInfo: {
  352. returnValue: addSafeAreaInsets },
  353. getSystemInfoSync: {
  354. returnValue: addSafeAreaInsets } };
  355. var todos = [
  356. 'vibrate'];
  357. var canIUses = [];
  358. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  359. function processCallback(methodName, method, returnValue) {
  360. return function (res) {
  361. return method(processReturnValue(methodName, res, returnValue));
  362. };
  363. }
  364. function processArgs(methodName, fromArgs) {var argsOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};var returnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};var keepFromArgs = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  365. if (isPlainObject(fromArgs)) {// 一般 api 的参数解析
  366. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  367. if (isFn(argsOption)) {
  368. argsOption = argsOption(fromArgs, toArgs) || {};
  369. }
  370. for (var key in fromArgs) {
  371. if (hasOwn(argsOption, key)) {
  372. var keyOption = argsOption[key];
  373. if (isFn(keyOption)) {
  374. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  375. }
  376. if (!keyOption) {// 不支持的参数
  377. console.warn("\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F ".concat(methodName, "\u6682\u4E0D\u652F\u6301").concat(key));
  378. } else if (isStr(keyOption)) {// 重写参数 key
  379. toArgs[keyOption] = fromArgs[key];
  380. } else if (isPlainObject(keyOption)) {// {name:newName,value:value}可重新指定参数 key:value
  381. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  382. }
  383. } else if (CALLBACKS.indexOf(key) !== -1) {
  384. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  385. } else {
  386. if (!keepFromArgs) {
  387. toArgs[key] = fromArgs[key];
  388. }
  389. }
  390. }
  391. return toArgs;
  392. } else if (isFn(fromArgs)) {
  393. fromArgs = processCallback(methodName, fromArgs, returnValue);
  394. }
  395. return fromArgs;
  396. }
  397. function processReturnValue(methodName, res, returnValue) {var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  398. if (isFn(protocols.returnValue)) {// 处理通用 returnValue
  399. res = protocols.returnValue(methodName, res);
  400. }
  401. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  402. }
  403. function wrapper(methodName, method) {
  404. if (hasOwn(protocols, methodName)) {
  405. var protocol = protocols[methodName];
  406. if (!protocol) {// 暂不支持的 api
  407. return function () {
  408. console.error("\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F \u6682\u4E0D\u652F\u6301".concat(methodName));
  409. };
  410. }
  411. return function (arg1, arg2) {// 目前 api 最多两个参数
  412. var options = protocol;
  413. if (isFn(protocol)) {
  414. options = protocol(arg1);
  415. }
  416. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  417. var args = [arg1];
  418. if (typeof arg2 !== 'undefined') {
  419. args.push(arg2);
  420. }
  421. var returnValue = wx[options.name || methodName].apply(wx, args);
  422. if (isSyncApi(methodName)) {// 同步 api
  423. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  424. }
  425. return returnValue;
  426. };
  427. }
  428. return method;
  429. }
  430. var todoApis = Object.create(null);
  431. var TODOS = [
  432. 'onTabBarMidButtonTap',
  433. 'subscribePush',
  434. 'unsubscribePush',
  435. 'onPush',
  436. 'offPush',
  437. 'share'];
  438. function createTodoApi(name) {
  439. return function todoApi(_ref)
  440. {var fail = _ref.fail,complete = _ref.complete;
  441. var res = {
  442. errMsg: "".concat(name, ":fail:\u6682\u4E0D\u652F\u6301 ").concat(name, " \u65B9\u6CD5") };
  443. isFn(fail) && fail(res);
  444. isFn(complete) && complete(res);
  445. };
  446. }
  447. TODOS.forEach(function (name) {
  448. todoApis[name] = createTodoApi(name);
  449. });
  450. var providers = {
  451. oauth: ['weixin'],
  452. share: ['weixin'],
  453. payment: ['wxpay'],
  454. push: ['weixin'] };
  455. function getProvider(_ref2)
  456. {var service = _ref2.service,success = _ref2.success,fail = _ref2.fail,complete = _ref2.complete;
  457. var res = false;
  458. if (providers[service]) {
  459. res = {
  460. errMsg: 'getProvider:ok',
  461. service: service,
  462. provider: providers[service] };
  463. isFn(success) && success(res);
  464. } else {
  465. res = {
  466. errMsg: 'getProvider:fail:服务[' + service + ']不存在' };
  467. isFn(fail) && fail(res);
  468. }
  469. isFn(complete) && complete(res);
  470. }
  471. var extraApi = /*#__PURE__*/Object.freeze({
  472. __proto__: null,
  473. getProvider: getProvider });
  474. var getEmitter = function () {
  475. if (typeof getUniEmitter === 'function') {
  476. /* eslint-disable no-undef */
  477. return getUniEmitter;
  478. }
  479. var Emitter;
  480. return function getUniEmitter() {
  481. if (!Emitter) {
  482. Emitter = new _vue.default();
  483. }
  484. return Emitter;
  485. };
  486. }();
  487. function apply(ctx, method, args) {
  488. return ctx[method].apply(ctx, args);
  489. }
  490. function $on() {
  491. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  492. }
  493. function $off() {
  494. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  495. }
  496. function $once() {
  497. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  498. }
  499. function $emit() {
  500. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  501. }
  502. var eventApi = /*#__PURE__*/Object.freeze({
  503. __proto__: null,
  504. $on: $on,
  505. $off: $off,
  506. $once: $once,
  507. $emit: $emit });
  508. var api = /*#__PURE__*/Object.freeze({
  509. __proto__: null });
  510. var MPPage = Page;
  511. var MPComponent = Component;
  512. var customizeRE = /:/g;
  513. var customize = cached(function (str) {
  514. return camelize(str.replace(customizeRE, '-'));
  515. });
  516. function initTriggerEvent(mpInstance) {
  517. {
  518. if (!wx.canIUse('nextTick')) {
  519. return;
  520. }
  521. }
  522. var oldTriggerEvent = mpInstance.triggerEvent;
  523. mpInstance.triggerEvent = function (event) {for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {args[_key3 - 1] = arguments[_key3];}
  524. return oldTriggerEvent.apply(mpInstance, [customize(event)].concat(args));
  525. };
  526. }
  527. function initHook(name, options) {
  528. var oldHook = options[name];
  529. if (!oldHook) {
  530. options[name] = function () {
  531. initTriggerEvent(this);
  532. };
  533. } else {
  534. options[name] = function () {
  535. initTriggerEvent(this);for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {args[_key4] = arguments[_key4];}
  536. return oldHook.apply(this, args);
  537. };
  538. }
  539. }
  540. Page = function Page() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  541. initHook('onLoad', options);
  542. return MPPage(options);
  543. };
  544. Component = function Component() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  545. initHook('created', options);
  546. return MPComponent(options);
  547. };
  548. var PAGE_EVENT_HOOKS = [
  549. 'onPullDownRefresh',
  550. 'onReachBottom',
  551. 'onShareAppMessage',
  552. 'onPageScroll',
  553. 'onResize',
  554. 'onTabItemTap'];
  555. function initMocks(vm, mocks) {
  556. var mpInstance = vm.$mp[vm.mpType];
  557. mocks.forEach(function (mock) {
  558. if (hasOwn(mpInstance, mock)) {
  559. vm[mock] = mpInstance[mock];
  560. }
  561. });
  562. }
  563. function hasHook(hook, vueOptions) {
  564. if (!vueOptions) {
  565. return true;
  566. }
  567. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  568. return true;
  569. }
  570. vueOptions = vueOptions.default || vueOptions;
  571. if (isFn(vueOptions)) {
  572. if (isFn(vueOptions.extendOptions[hook])) {
  573. return true;
  574. }
  575. if (vueOptions.super &&
  576. vueOptions.super.options &&
  577. Array.isArray(vueOptions.super.options[hook])) {
  578. return true;
  579. }
  580. return false;
  581. }
  582. if (isFn(vueOptions[hook])) {
  583. return true;
  584. }
  585. var mixins = vueOptions.mixins;
  586. if (Array.isArray(mixins)) {
  587. return !!mixins.find(function (mixin) {return hasHook(hook, mixin);});
  588. }
  589. }
  590. function initHooks(mpOptions, hooks, vueOptions) {
  591. hooks.forEach(function (hook) {
  592. if (hasHook(hook, vueOptions)) {
  593. mpOptions[hook] = function (args) {
  594. return this.$vm && this.$vm.__call_hook(hook, args);
  595. };
  596. }
  597. });
  598. }
  599. function initVueComponent(Vue, vueOptions) {
  600. vueOptions = vueOptions.default || vueOptions;
  601. var VueComponent;
  602. if (isFn(vueOptions)) {
  603. VueComponent = vueOptions;
  604. vueOptions = VueComponent.extendOptions;
  605. } else {
  606. VueComponent = Vue.extend(vueOptions);
  607. }
  608. return [VueComponent, vueOptions];
  609. }
  610. function initSlots(vm, vueSlots) {
  611. if (Array.isArray(vueSlots) && vueSlots.length) {
  612. var $slots = Object.create(null);
  613. vueSlots.forEach(function (slotName) {
  614. $slots[slotName] = true;
  615. });
  616. vm.$scopedSlots = vm.$slots = $slots;
  617. }
  618. }
  619. function initVueIds(vueIds, mpInstance) {
  620. vueIds = (vueIds || '').split(',');
  621. var len = vueIds.length;
  622. if (len === 1) {
  623. mpInstance._$vueId = vueIds[0];
  624. } else if (len === 2) {
  625. mpInstance._$vueId = vueIds[0];
  626. mpInstance._$vuePid = vueIds[1];
  627. }
  628. }
  629. function initData(vueOptions, context) {
  630. var data = vueOptions.data || {};
  631. var methods = vueOptions.methods || {};
  632. if (typeof data === 'function') {
  633. try {
  634. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  635. } catch (e) {
  636. if (Object({"VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  637. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  638. }
  639. }
  640. } else {
  641. try {
  642. // 对 data 格式化
  643. data = JSON.parse(JSON.stringify(data));
  644. } catch (e) {}
  645. }
  646. if (!isPlainObject(data)) {
  647. data = {};
  648. }
  649. Object.keys(methods).forEach(function (methodName) {
  650. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  651. data[methodName] = methods[methodName];
  652. }
  653. });
  654. return data;
  655. }
  656. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  657. function createObserver(name) {
  658. return function observer(newVal, oldVal) {
  659. if (this.$vm) {
  660. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  661. }
  662. };
  663. }
  664. function initBehaviors(vueOptions, initBehavior) {
  665. var vueBehaviors = vueOptions['behaviors'];
  666. var vueExtends = vueOptions['extends'];
  667. var vueMixins = vueOptions['mixins'];
  668. var vueProps = vueOptions['props'];
  669. if (!vueProps) {
  670. vueOptions['props'] = vueProps = [];
  671. }
  672. var behaviors = [];
  673. if (Array.isArray(vueBehaviors)) {
  674. vueBehaviors.forEach(function (behavior) {
  675. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  676. if (behavior === 'uni://form-field') {
  677. if (Array.isArray(vueProps)) {
  678. vueProps.push('name');
  679. vueProps.push('value');
  680. } else {
  681. vueProps['name'] = {
  682. type: String,
  683. default: '' };
  684. vueProps['value'] = {
  685. type: [String, Number, Boolean, Array, Object, Date],
  686. default: '' };
  687. }
  688. }
  689. });
  690. }
  691. if (isPlainObject(vueExtends) && vueExtends.props) {
  692. behaviors.push(
  693. initBehavior({
  694. properties: initProperties(vueExtends.props, true) }));
  695. }
  696. if (Array.isArray(vueMixins)) {
  697. vueMixins.forEach(function (vueMixin) {
  698. if (isPlainObject(vueMixin) && vueMixin.props) {
  699. behaviors.push(
  700. initBehavior({
  701. properties: initProperties(vueMixin.props, true) }));
  702. }
  703. });
  704. }
  705. return behaviors;
  706. }
  707. function parsePropType(key, type, defaultValue, file) {
  708. // [String]=>String
  709. if (Array.isArray(type) && type.length === 1) {
  710. return type[0];
  711. }
  712. return type;
  713. }
  714. function initProperties(props) {var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  715. var properties = {};
  716. if (!isBehavior) {
  717. properties.vueId = {
  718. type: String,
  719. value: '' };
  720. properties.vueSlots = { // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  721. type: null,
  722. value: [],
  723. observer: function observer(newVal, oldVal) {
  724. var $slots = Object.create(null);
  725. newVal.forEach(function (slotName) {
  726. $slots[slotName] = true;
  727. });
  728. this.setData({
  729. $slots: $slots });
  730. } };
  731. }
  732. if (Array.isArray(props)) {// ['title']
  733. props.forEach(function (key) {
  734. properties[key] = {
  735. type: null,
  736. observer: createObserver(key) };
  737. });
  738. } else if (isPlainObject(props)) {// {title:{type:String,default:''},content:String}
  739. Object.keys(props).forEach(function (key) {
  740. var opts = props[key];
  741. if (isPlainObject(opts)) {// title:{type:String,default:''}
  742. var value = opts['default'];
  743. if (isFn(value)) {
  744. value = value();
  745. }
  746. opts.type = parsePropType(key, opts.type);
  747. properties[key] = {
  748. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  749. value: value,
  750. observer: createObserver(key) };
  751. } else {// content:String
  752. var type = parsePropType(key, opts);
  753. properties[key] = {
  754. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  755. observer: createObserver(key) };
  756. }
  757. });
  758. }
  759. return properties;
  760. }
  761. function wrapper$1(event) {
  762. // TODO 又得兼容 mpvue 的 mp 对象
  763. try {
  764. event.mp = JSON.parse(JSON.stringify(event));
  765. } catch (e) {}
  766. event.stopPropagation = noop;
  767. event.preventDefault = noop;
  768. event.target = event.target || {};
  769. if (!hasOwn(event, 'detail')) {
  770. event.detail = {};
  771. }
  772. if (isPlainObject(event.detail)) {
  773. event.target = Object.assign({}, event.target, event.detail);
  774. }
  775. return event;
  776. }
  777. function getExtraValue(vm, dataPathsArray) {
  778. var context = vm;
  779. dataPathsArray.forEach(function (dataPathArray) {
  780. var dataPath = dataPathArray[0];
  781. var value = dataPathArray[2];
  782. if (dataPath || typeof value !== 'undefined') {// ['','',index,'disable']
  783. var propPath = dataPathArray[1];
  784. var valuePath = dataPathArray[3];
  785. var vFor = dataPath ? vm.__get_value(dataPath, context) : context;
  786. if (Number.isInteger(vFor)) {
  787. context = value;
  788. } else if (!propPath) {
  789. context = vFor[value];
  790. } else {
  791. if (Array.isArray(vFor)) {
  792. context = vFor.find(function (vForItem) {
  793. return vm.__get_value(propPath, vForItem) === value;
  794. });
  795. } else if (isPlainObject(vFor)) {
  796. context = Object.keys(vFor).find(function (vForKey) {
  797. return vm.__get_value(propPath, vFor[vForKey]) === value;
  798. });
  799. } else {
  800. console.error('v-for 暂不支持循环数据:', vFor);
  801. }
  802. }
  803. if (valuePath) {
  804. context = vm.__get_value(valuePath, context);
  805. }
  806. }
  807. });
  808. return context;
  809. }
  810. function processEventExtra(vm, extra, event) {
  811. var extraObj = {};
  812. if (Array.isArray(extra) && extra.length) {
  813. /**
  814. *[
  815. * ['data.items', 'data.id', item.data.id],
  816. * ['metas', 'id', meta.id]
  817. *],
  818. *[
  819. * ['data.items', 'data.id', item.data.id],
  820. * ['metas', 'id', meta.id]
  821. *],
  822. *'test'
  823. */
  824. extra.forEach(function (dataPath, index) {
  825. if (typeof dataPath === 'string') {
  826. if (!dataPath) {// model,prop.sync
  827. extraObj['$' + index] = vm;
  828. } else {
  829. if (dataPath === '$event') {// $event
  830. extraObj['$' + index] = event;
  831. } else if (dataPath.indexOf('$event.') === 0) {// $event.target.value
  832. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  833. } else {
  834. extraObj['$' + index] = vm.__get_value(dataPath);
  835. }
  836. }
  837. } else {
  838. extraObj['$' + index] = getExtraValue(vm, dataPath);
  839. }
  840. });
  841. }
  842. return extraObj;
  843. }
  844. function getObjByArray(arr) {
  845. var obj = {};
  846. for (var i = 1; i < arr.length; i++) {
  847. var element = arr[i];
  848. obj[element[0]] = element[1];
  849. }
  850. return obj;
  851. }
  852. function processEventArgs(vm, event) {var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];var extra = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];var isCustom = arguments.length > 4 ? arguments[4] : undefined;var methodName = arguments.length > 5 ? arguments[5] : undefined;
  853. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  854. if (isCustom) {// 自定义事件
  855. isCustomMPEvent = event.currentTarget &&
  856. event.currentTarget.dataset &&
  857. event.currentTarget.dataset.comType === 'wx';
  858. if (!args.length) {// 无参数,直接传入 event 或 detail 数组
  859. if (isCustomMPEvent) {
  860. return [event];
  861. }
  862. return event.detail.__args__ || event.detail;
  863. }
  864. }
  865. var extraObj = processEventExtra(vm, extra, event);
  866. var ret = [];
  867. args.forEach(function (arg) {
  868. if (arg === '$event') {
  869. if (methodName === '__set_model' && !isCustom) {// input v-model value
  870. ret.push(event.target.value);
  871. } else {
  872. if (isCustom && !isCustomMPEvent) {
  873. ret.push(event.detail.__args__[0]);
  874. } else {// wxcomponent 组件或内置组件
  875. ret.push(event);
  876. }
  877. }
  878. } else {
  879. if (Array.isArray(arg) && arg[0] === 'o') {
  880. ret.push(getObjByArray(arg));
  881. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  882. ret.push(extraObj[arg]);
  883. } else {
  884. ret.push(arg);
  885. }
  886. }
  887. });
  888. return ret;
  889. }
  890. var ONCE = '~';
  891. var CUSTOM = '^';
  892. function isMatchEventType(eventType, optType) {
  893. return eventType === optType ||
  894. optType === 'regionchange' && (
  895. eventType === 'begin' ||
  896. eventType === 'end');
  897. }
  898. function handleEvent(event) {var _this = this;
  899. event = wrapper$1(event);
  900. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  901. var dataset = (event.currentTarget || event.target).dataset;
  902. if (!dataset) {
  903. return console.warn("\u4E8B\u4EF6\u4FE1\u606F\u4E0D\u5B58\u5728");
  904. }
  905. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  906. if (!eventOpts) {
  907. return console.warn("\u4E8B\u4EF6\u4FE1\u606F\u4E0D\u5B58\u5728");
  908. }
  909. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  910. var eventType = event.type;
  911. var ret = [];
  912. eventOpts.forEach(function (eventOpt) {
  913. var type = eventOpt[0];
  914. var eventsArray = eventOpt[1];
  915. var isCustom = type.charAt(0) === CUSTOM;
  916. type = isCustom ? type.slice(1) : type;
  917. var isOnce = type.charAt(0) === ONCE;
  918. type = isOnce ? type.slice(1) : type;
  919. if (eventsArray && isMatchEventType(eventType, type)) {
  920. eventsArray.forEach(function (eventArray) {
  921. var methodName = eventArray[0];
  922. if (methodName) {
  923. var handlerCtx = _this.$vm;
  924. if (
  925. handlerCtx.$options.generic &&
  926. handlerCtx.$parent &&
  927. handlerCtx.$parent.$parent)
  928. {// mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  929. handlerCtx = handlerCtx.$parent.$parent;
  930. }
  931. if (methodName === '$emit') {
  932. handlerCtx.$emit.apply(handlerCtx,
  933. processEventArgs(
  934. _this.$vm,
  935. event,
  936. eventArray[1],
  937. eventArray[2],
  938. isCustom,
  939. methodName));
  940. return;
  941. }
  942. var handler = handlerCtx[methodName];
  943. if (!isFn(handler)) {
  944. throw new Error(" _vm.".concat(methodName, " is not a function"));
  945. }
  946. if (isOnce) {
  947. if (handler.once) {
  948. return;
  949. }
  950. handler.once = true;
  951. }
  952. ret.push(handler.apply(handlerCtx, processEventArgs(
  953. _this.$vm,
  954. event,
  955. eventArray[1],
  956. eventArray[2],
  957. isCustom,
  958. methodName)));
  959. }
  960. });
  961. }
  962. });
  963. if (
  964. eventType === 'input' &&
  965. ret.length === 1 &&
  966. typeof ret[0] !== 'undefined')
  967. {
  968. return ret[0];
  969. }
  970. }
  971. var hooks = [
  972. 'onShow',
  973. 'onHide',
  974. 'onError',
  975. 'onPageNotFound'];
  976. function parseBaseApp(vm, _ref3)
  977. {var mocks = _ref3.mocks,initRefs = _ref3.initRefs;
  978. if (vm.$options.store) {
  979. _vue.default.prototype.$store = vm.$options.store;
  980. }
  981. _vue.default.prototype.mpHost = "mp-weixin";
  982. _vue.default.mixin({
  983. beforeCreate: function beforeCreate() {
  984. if (!this.$options.mpType) {
  985. return;
  986. }
  987. this.mpType = this.$options.mpType;
  988. this.$mp = _defineProperty({
  989. data: {} },
  990. this.mpType, this.$options.mpInstance);
  991. this.$scope = this.$options.mpInstance;
  992. delete this.$options.mpType;
  993. delete this.$options.mpInstance;
  994. if (this.mpType !== 'app') {
  995. initRefs(this);
  996. initMocks(this, mocks);
  997. }
  998. } });
  999. var appOptions = {
  1000. onLaunch: function onLaunch(args) {
  1001. if (this.$vm) {// 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  1002. return;
  1003. }
  1004. {
  1005. if (!wx.canIUse('nextTick')) {// 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  1006. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  1007. }
  1008. }
  1009. this.$vm = vm;
  1010. this.$vm.$mp = {
  1011. app: this };
  1012. this.$vm.$scope = this;
  1013. // vm 上也挂载 globalData
  1014. this.$vm.globalData = this.globalData;
  1015. this.$vm._isMounted = true;
  1016. this.$vm.__call_hook('mounted', args);
  1017. this.$vm.__call_hook('onLaunch', args);
  1018. } };
  1019. // 兼容旧版本 globalData
  1020. appOptions.globalData = vm.$options.globalData || {};
  1021. // 将 methods 中的方法挂在 getApp() 中
  1022. var methods = vm.$options.methods;
  1023. if (methods) {
  1024. Object.keys(methods).forEach(function (name) {
  1025. appOptions[name] = methods[name];
  1026. });
  1027. }
  1028. initHooks(appOptions, hooks);
  1029. return appOptions;
  1030. }
  1031. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1032. function findVmByVueId(vm, vuePid) {
  1033. var $children = vm.$children;
  1034. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1035. for (var i = $children.length - 1; i >= 0; i--) {
  1036. var childVm = $children[i];
  1037. if (childVm.$scope._$vueId === vuePid) {
  1038. return childVm;
  1039. }
  1040. }
  1041. // 反向递归查找
  1042. var parentVm;
  1043. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1044. parentVm = findVmByVueId($children[_i], vuePid);
  1045. if (parentVm) {
  1046. return parentVm;
  1047. }
  1048. }
  1049. }
  1050. function initBehavior(options) {
  1051. return Behavior(options);
  1052. }
  1053. function isPage() {
  1054. return !!this.route;
  1055. }
  1056. function initRelation(detail) {
  1057. this.triggerEvent('__l', detail);
  1058. }
  1059. function initRefs(vm) {
  1060. var mpInstance = vm.$scope;
  1061. Object.defineProperty(vm, '$refs', {
  1062. get: function get() {
  1063. var $refs = {};
  1064. var components = mpInstance.selectAllComponents('.vue-ref');
  1065. components.forEach(function (component) {
  1066. var ref = component.dataset.ref;
  1067. $refs[ref] = component.$vm || component;
  1068. });
  1069. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for');
  1070. forComponents.forEach(function (component) {
  1071. var ref = component.dataset.ref;
  1072. if (!$refs[ref]) {
  1073. $refs[ref] = [];
  1074. }
  1075. $refs[ref].push(component.$vm || component);
  1076. });
  1077. return $refs;
  1078. } });
  1079. }
  1080. function handleLink(event) {var _ref4 =
  1081. event.detail || event.value,vuePid = _ref4.vuePid,vueOptions = _ref4.vueOptions; // detail 是微信,value 是百度(dipatch)
  1082. var parentVm;
  1083. if (vuePid) {
  1084. parentVm = findVmByVueId(this.$vm, vuePid);
  1085. }
  1086. if (!parentVm) {
  1087. parentVm = this.$vm;
  1088. }
  1089. vueOptions.parent = parentVm;
  1090. }
  1091. function parseApp(vm) {
  1092. return parseBaseApp(vm, {
  1093. mocks: mocks,
  1094. initRefs: initRefs });
  1095. }
  1096. function createApp(vm) {
  1097. App(parseApp(vm));
  1098. return vm;
  1099. }
  1100. function parseBaseComponent(vueComponentOptions)
  1101. {var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},isPage = _ref5.isPage,initRelation = _ref5.initRelation;var _initVueComponent =
  1102. initVueComponent(_vue.default, vueComponentOptions),_initVueComponent2 = _slicedToArray(_initVueComponent, 2),VueComponent = _initVueComponent2[0],vueOptions = _initVueComponent2[1];
  1103. var options = _objectSpread({
  1104. multipleSlots: true,
  1105. addGlobalClass: true },
  1106. vueOptions.options || {});
  1107. {
  1108. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  1109. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin']['options']) {
  1110. Object.assign(options, vueOptions['mp-weixin']['options']);
  1111. }
  1112. }
  1113. var componentOptions = {
  1114. options: options,
  1115. data: initData(vueOptions, _vue.default.prototype),
  1116. behaviors: initBehaviors(vueOptions, initBehavior),
  1117. properties: initProperties(vueOptions.props, false, vueOptions.__file),
  1118. lifetimes: {
  1119. attached: function attached() {
  1120. var properties = this.properties;
  1121. var options = {
  1122. mpType: isPage.call(this) ? 'page' : 'component',
  1123. mpInstance: this,
  1124. propsData: properties };
  1125. initVueIds(properties.vueId, this);
  1126. // 处理父子关系
  1127. initRelation.call(this, {
  1128. vuePid: this._$vuePid,
  1129. vueOptions: options });
  1130. // 初始化 vue 实例
  1131. this.$vm = new VueComponent(options);
  1132. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  1133. initSlots(this.$vm, properties.vueSlots);
  1134. // 触发首次 setData
  1135. this.$vm.$mount();
  1136. },
  1137. ready: function ready() {
  1138. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  1139. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  1140. if (this.$vm) {
  1141. this.$vm._isMounted = true;
  1142. this.$vm.__call_hook('mounted');
  1143. this.$vm.__call_hook('onReady');
  1144. }
  1145. },
  1146. detached: function detached() {
  1147. this.$vm && this.$vm.$destroy();
  1148. } },
  1149. pageLifetimes: {
  1150. show: function show(args) {
  1151. this.$vm && this.$vm.__call_hook('onPageShow', args);
  1152. },
  1153. hide: function hide() {
  1154. this.$vm && this.$vm.__call_hook('onPageHide');
  1155. },
  1156. resize: function resize(size) {
  1157. this.$vm && this.$vm.__call_hook('onPageResize', size);
  1158. } },
  1159. methods: {
  1160. __l: handleLink,
  1161. __e: handleEvent } };
  1162. if (Array.isArray(vueOptions.wxsCallMethods)) {
  1163. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  1164. componentOptions.methods[callMethod] = function (args) {
  1165. return this.$vm[callMethod](args);
  1166. };
  1167. });
  1168. }
  1169. if (isPage) {
  1170. return componentOptions;
  1171. }
  1172. return [componentOptions, VueComponent];
  1173. }
  1174. function parseComponent(vueComponentOptions) {
  1175. return parseBaseComponent(vueComponentOptions, {
  1176. isPage: isPage,
  1177. initRelation: initRelation });
  1178. }
  1179. var hooks$1 = [
  1180. 'onShow',
  1181. 'onHide',
  1182. 'onUnload'];
  1183. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  1184. function parseBasePage(vuePageOptions, _ref6)
  1185. {var isPage = _ref6.isPage,initRelation = _ref6.initRelation;
  1186. var pageOptions = parseComponent(vuePageOptions);
  1187. initHooks(pageOptions.methods, hooks$1, vuePageOptions);
  1188. pageOptions.methods.onLoad = function (args) {
  1189. this.$vm.$mp.query = args; // 兼容 mpvue
  1190. this.$vm.__call_hook('onLoad', args);
  1191. };
  1192. return pageOptions;
  1193. }
  1194. function parsePage(vuePageOptions) {
  1195. return parseBasePage(vuePageOptions, {
  1196. isPage: isPage,
  1197. initRelation: initRelation });
  1198. }
  1199. function createPage(vuePageOptions) {
  1200. {
  1201. return Component(parsePage(vuePageOptions));
  1202. }
  1203. }
  1204. function createComponent(vueOptions) {
  1205. {
  1206. return Component(parseComponent(vueOptions));
  1207. }
  1208. }
  1209. todos.forEach(function (todoApi) {
  1210. protocols[todoApi] = false;
  1211. });
  1212. canIUses.forEach(function (canIUseApi) {
  1213. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name :
  1214. canIUseApi;
  1215. if (!wx.canIUse(apiName)) {
  1216. protocols[canIUseApi] = false;
  1217. }
  1218. });
  1219. var uni = {};
  1220. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  1221. uni = new Proxy({}, {
  1222. get: function get(target, name) {
  1223. if (target[name]) {
  1224. return target[name];
  1225. }
  1226. if (baseApi[name]) {
  1227. return baseApi[name];
  1228. }
  1229. if (api[name]) {
  1230. return promisify(name, api[name]);
  1231. }
  1232. {
  1233. if (extraApi[name]) {
  1234. return promisify(name, extraApi[name]);
  1235. }
  1236. if (todoApis[name]) {
  1237. return promisify(name, todoApis[name]);
  1238. }
  1239. }
  1240. if (eventApi[name]) {
  1241. return eventApi[name];
  1242. }
  1243. if (!hasOwn(wx, name) && !hasOwn(protocols, name)) {
  1244. return;
  1245. }
  1246. return promisify(name, wrapper(name, wx[name]));
  1247. },
  1248. set: function set(target, name, value) {
  1249. target[name] = value;
  1250. return true;
  1251. } });
  1252. } else {
  1253. Object.keys(baseApi).forEach(function (name) {
  1254. uni[name] = baseApi[name];
  1255. });
  1256. {
  1257. Object.keys(todoApis).forEach(function (name) {
  1258. uni[name] = promisify(name, todoApis[name]);
  1259. });
  1260. Object.keys(extraApi).forEach(function (name) {
  1261. uni[name] = promisify(name, todoApis[name]);
  1262. });
  1263. }
  1264. Object.keys(eventApi).forEach(function (name) {
  1265. uni[name] = eventApi[name];
  1266. });
  1267. Object.keys(api).forEach(function (name) {
  1268. uni[name] = promisify(name, api[name]);
  1269. });
  1270. Object.keys(wx).forEach(function (name) {
  1271. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  1272. uni[name] = promisify(name, wrapper(name, wx[name]));
  1273. }
  1274. });
  1275. }
  1276. wx.createApp = createApp;
  1277. wx.createPage = createPage;
  1278. wx.createComponent = createComponent;
  1279. var uni$1 = uni;var _default =
  1280. uni$1;exports.default = _default;
  1281. /***/ }),
  1282. /* 2 */
  1283. /*!******************************************************************************************!*\
  1284. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  1285. \******************************************************************************************/
  1286. /*! exports provided: default */
  1287. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1288. "use strict";
  1289. __webpack_require__.r(__webpack_exports__);
  1290. /* WEBPACK VAR INJECTION */(function(global) {/*!
  1291. * Vue.js v2.6.11
  1292. * (c) 2014-2020 Evan You
  1293. * Released under the MIT License.
  1294. */
  1295. /* */
  1296. var emptyObject = Object.freeze({});
  1297. // These helpers produce better VM code in JS engines due to their
  1298. // explicitness and function inlining.
  1299. function isUndef (v) {
  1300. return v === undefined || v === null
  1301. }
  1302. function isDef (v) {
  1303. return v !== undefined && v !== null
  1304. }
  1305. function isTrue (v) {
  1306. return v === true
  1307. }
  1308. function isFalse (v) {
  1309. return v === false
  1310. }
  1311. /**
  1312. * Check if value is primitive.
  1313. */
  1314. function isPrimitive (value) {
  1315. return (
  1316. typeof value === 'string' ||
  1317. typeof value === 'number' ||
  1318. // $flow-disable-line
  1319. typeof value === 'symbol' ||
  1320. typeof value === 'boolean'
  1321. )
  1322. }
  1323. /**
  1324. * Quick object check - this is primarily used to tell
  1325. * Objects from primitive values when we know the value
  1326. * is a JSON-compliant type.
  1327. */
  1328. function isObject (obj) {
  1329. return obj !== null && typeof obj === 'object'
  1330. }
  1331. /**
  1332. * Get the raw type string of a value, e.g., [object Object].
  1333. */
  1334. var _toString = Object.prototype.toString;
  1335. function toRawType (value) {
  1336. return _toString.call(value).slice(8, -1)
  1337. }
  1338. /**
  1339. * Strict object type check. Only returns true
  1340. * for plain JavaScript objects.
  1341. */
  1342. function isPlainObject (obj) {
  1343. return _toString.call(obj) === '[object Object]'
  1344. }
  1345. function isRegExp (v) {
  1346. return _toString.call(v) === '[object RegExp]'
  1347. }
  1348. /**
  1349. * Check if val is a valid array index.
  1350. */
  1351. function isValidArrayIndex (val) {
  1352. var n = parseFloat(String(val));
  1353. return n >= 0 && Math.floor(n) === n && isFinite(val)
  1354. }
  1355. function isPromise (val) {
  1356. return (
  1357. isDef(val) &&
  1358. typeof val.then === 'function' &&
  1359. typeof val.catch === 'function'
  1360. )
  1361. }
  1362. /**
  1363. * Convert a value to a string that is actually rendered.
  1364. */
  1365. function toString (val) {
  1366. return val == null
  1367. ? ''
  1368. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  1369. ? JSON.stringify(val, null, 2)
  1370. : String(val)
  1371. }
  1372. /**
  1373. * Convert an input value to a number for persistence.
  1374. * If the conversion fails, return original string.
  1375. */
  1376. function toNumber (val) {
  1377. var n = parseFloat(val);
  1378. return isNaN(n) ? val : n
  1379. }
  1380. /**
  1381. * Make a map and return a function for checking if a key
  1382. * is in that map.
  1383. */
  1384. function makeMap (
  1385. str,
  1386. expectsLowerCase
  1387. ) {
  1388. var map = Object.create(null);
  1389. var list = str.split(',');
  1390. for (var i = 0; i < list.length; i++) {
  1391. map[list[i]] = true;
  1392. }
  1393. return expectsLowerCase
  1394. ? function (val) { return map[val.toLowerCase()]; }
  1395. : function (val) { return map[val]; }
  1396. }
  1397. /**
  1398. * Check if a tag is a built-in tag.
  1399. */
  1400. var isBuiltInTag = makeMap('slot,component', true);
  1401. /**
  1402. * Check if an attribute is a reserved attribute.
  1403. */
  1404. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  1405. /**
  1406. * Remove an item from an array.
  1407. */
  1408. function remove (arr, item) {
  1409. if (arr.length) {
  1410. var index = arr.indexOf(item);
  1411. if (index > -1) {
  1412. return arr.splice(index, 1)
  1413. }
  1414. }
  1415. }
  1416. /**
  1417. * Check whether an object has the property.
  1418. */
  1419. var hasOwnProperty = Object.prototype.hasOwnProperty;
  1420. function hasOwn (obj, key) {
  1421. return hasOwnProperty.call(obj, key)
  1422. }
  1423. /**
  1424. * Create a cached version of a pure function.
  1425. */
  1426. function cached (fn) {
  1427. var cache = Object.create(null);
  1428. return (function cachedFn (str) {
  1429. var hit = cache[str];
  1430. return hit || (cache[str] = fn(str))
  1431. })
  1432. }
  1433. /**
  1434. * Camelize a hyphen-delimited string.
  1435. */
  1436. var camelizeRE = /-(\w)/g;
  1437. var camelize = cached(function (str) {
  1438. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  1439. });
  1440. /**
  1441. * Capitalize a string.
  1442. */
  1443. var capitalize = cached(function (str) {
  1444. return str.charAt(0).toUpperCase() + str.slice(1)
  1445. });
  1446. /**
  1447. * Hyphenate a camelCase string.
  1448. */
  1449. var hyphenateRE = /\B([A-Z])/g;
  1450. var hyphenate = cached(function (str) {
  1451. return str.replace(hyphenateRE, '-$1').toLowerCase()
  1452. });
  1453. /**
  1454. * Simple bind polyfill for environments that do not support it,
  1455. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  1456. * since native bind is now performant enough in most browsers.
  1457. * But removing it would mean breaking code that was able to run in
  1458. * PhantomJS 1.x, so this must be kept for backward compatibility.
  1459. */
  1460. /* istanbul ignore next */
  1461. function polyfillBind (fn, ctx) {
  1462. function boundFn (a) {
  1463. var l = arguments.length;
  1464. return l
  1465. ? l > 1
  1466. ? fn.apply(ctx, arguments)
  1467. : fn.call(ctx, a)
  1468. : fn.call(ctx)
  1469. }
  1470. boundFn._length = fn.length;
  1471. return boundFn
  1472. }
  1473. function nativeBind (fn, ctx) {
  1474. return fn.bind(ctx)
  1475. }
  1476. var bind = Function.prototype.bind
  1477. ? nativeBind
  1478. : polyfillBind;
  1479. /**
  1480. * Convert an Array-like object to a real Array.
  1481. */
  1482. function toArray (list, start) {
  1483. start = start || 0;
  1484. var i = list.length - start;
  1485. var ret = new Array(i);
  1486. while (i--) {
  1487. ret[i] = list[i + start];
  1488. }
  1489. return ret
  1490. }
  1491. /**
  1492. * Mix properties into target object.
  1493. */
  1494. function extend (to, _from) {
  1495. for (var key in _from) {
  1496. to[key] = _from[key];
  1497. }
  1498. return to
  1499. }
  1500. /**
  1501. * Merge an Array of Objects into a single Object.
  1502. */
  1503. function toObject (arr) {
  1504. var res = {};
  1505. for (var i = 0; i < arr.length; i++) {
  1506. if (arr[i]) {
  1507. extend(res, arr[i]);
  1508. }
  1509. }
  1510. return res
  1511. }
  1512. /* eslint-disable no-unused-vars */
  1513. /**
  1514. * Perform no operation.
  1515. * Stubbing args to make Flow happy without leaving useless transpiled code
  1516. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  1517. */
  1518. function noop (a, b, c) {}
  1519. /**
  1520. * Always return false.
  1521. */
  1522. var no = function (a, b, c) { return false; };
  1523. /* eslint-enable no-unused-vars */
  1524. /**
  1525. * Return the same value.
  1526. */
  1527. var identity = function (_) { return _; };
  1528. /**
  1529. * Check if two values are loosely equal - that is,
  1530. * if they are plain objects, do they have the same shape?
  1531. */
  1532. function looseEqual (a, b) {
  1533. if (a === b) { return true }
  1534. var isObjectA = isObject(a);
  1535. var isObjectB = isObject(b);
  1536. if (isObjectA && isObjectB) {
  1537. try {
  1538. var isArrayA = Array.isArray(a);
  1539. var isArrayB = Array.isArray(b);
  1540. if (isArrayA && isArrayB) {
  1541. return a.length === b.length && a.every(function (e, i) {
  1542. return looseEqual(e, b[i])
  1543. })
  1544. } else if (a instanceof Date && b instanceof Date) {
  1545. return a.getTime() === b.getTime()
  1546. } else if (!isArrayA && !isArrayB) {
  1547. var keysA = Object.keys(a);
  1548. var keysB = Object.keys(b);
  1549. return keysA.length === keysB.length && keysA.every(function (key) {
  1550. return looseEqual(a[key], b[key])
  1551. })
  1552. } else {
  1553. /* istanbul ignore next */
  1554. return false
  1555. }
  1556. } catch (e) {
  1557. /* istanbul ignore next */
  1558. return false
  1559. }
  1560. } else if (!isObjectA && !isObjectB) {
  1561. return String(a) === String(b)
  1562. } else {
  1563. return false
  1564. }
  1565. }
  1566. /**
  1567. * Return the first index at which a loosely equal value can be
  1568. * found in the array (if value is a plain object, the array must
  1569. * contain an object of the same shape), or -1 if it is not present.
  1570. */
  1571. function looseIndexOf (arr, val) {
  1572. for (var i = 0; i < arr.length; i++) {
  1573. if (looseEqual(arr[i], val)) { return i }
  1574. }
  1575. return -1
  1576. }
  1577. /**
  1578. * Ensure a function is called only once.
  1579. */
  1580. function once (fn) {
  1581. var called = false;
  1582. return function () {
  1583. if (!called) {
  1584. called = true;
  1585. fn.apply(this, arguments);
  1586. }
  1587. }
  1588. }
  1589. var ASSET_TYPES = [
  1590. 'component',
  1591. 'directive',
  1592. 'filter'
  1593. ];
  1594. var LIFECYCLE_HOOKS = [
  1595. 'beforeCreate',
  1596. 'created',
  1597. 'beforeMount',
  1598. 'mounted',
  1599. 'beforeUpdate',
  1600. 'updated',
  1601. 'beforeDestroy',
  1602. 'destroyed',
  1603. 'activated',
  1604. 'deactivated',
  1605. 'errorCaptured',
  1606. 'serverPrefetch'
  1607. ];
  1608. /* */
  1609. var config = ({
  1610. /**
  1611. * Option merge strategies (used in core/util/options)
  1612. */
  1613. // $flow-disable-line
  1614. optionMergeStrategies: Object.create(null),
  1615. /**
  1616. * Whether to suppress warnings.
  1617. */
  1618. silent: false,
  1619. /**
  1620. * Show production mode tip message on boot?
  1621. */
  1622. productionTip: "development" !== 'production',
  1623. /**
  1624. * Whether to enable devtools
  1625. */
  1626. devtools: "development" !== 'production',
  1627. /**
  1628. * Whether to record perf
  1629. */
  1630. performance: false,
  1631. /**
  1632. * Error handler for watcher errors
  1633. */
  1634. errorHandler: null,
  1635. /**
  1636. * Warn handler for watcher warns
  1637. */
  1638. warnHandler: null,
  1639. /**
  1640. * Ignore certain custom elements
  1641. */
  1642. ignoredElements: [],
  1643. /**
  1644. * Custom user key aliases for v-on
  1645. */
  1646. // $flow-disable-line
  1647. keyCodes: Object.create(null),
  1648. /**
  1649. * Check if a tag is reserved so that it cannot be registered as a
  1650. * component. This is platform-dependent and may be overwritten.
  1651. */
  1652. isReservedTag: no,
  1653. /**
  1654. * Check if an attribute is reserved so that it cannot be used as a component
  1655. * prop. This is platform-dependent and may be overwritten.
  1656. */
  1657. isReservedAttr: no,
  1658. /**
  1659. * Check if a tag is an unknown element.
  1660. * Platform-dependent.
  1661. */
  1662. isUnknownElement: no,
  1663. /**
  1664. * Get the namespace of an element
  1665. */
  1666. getTagNamespace: noop,
  1667. /**
  1668. * Parse the real tag name for the specific platform.
  1669. */
  1670. parsePlatformTagName: identity,
  1671. /**
  1672. * Check if an attribute must be bound using property, e.g. value
  1673. * Platform-dependent.
  1674. */
  1675. mustUseProp: no,
  1676. /**
  1677. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  1678. * This will significantly reduce performance if set to false.
  1679. */
  1680. async: true,
  1681. /**
  1682. * Exposed for legacy reasons
  1683. */
  1684. _lifecycleHooks: LIFECYCLE_HOOKS
  1685. });
  1686. /* */
  1687. /**
  1688. * unicode letters used for parsing html tags, component names and property paths.
  1689. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  1690. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  1691. */
  1692. var unicodeRegExp = /a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;
  1693. /**
  1694. * Check if a string starts with $ or _
  1695. */
  1696. function isReserved (str) {
  1697. var c = (str + '').charCodeAt(0);
  1698. return c === 0x24 || c === 0x5F
  1699. }
  1700. /**
  1701. * Define a property.
  1702. */
  1703. function def (obj, key, val, enumerable) {
  1704. Object.defineProperty(obj, key, {
  1705. value: val,
  1706. enumerable: !!enumerable,
  1707. writable: true,
  1708. configurable: true
  1709. });
  1710. }
  1711. /**
  1712. * Parse simple path.
  1713. */
  1714. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  1715. function parsePath (path) {
  1716. if (bailRE.test(path)) {
  1717. return
  1718. }
  1719. var segments = path.split('.');
  1720. return function (obj) {
  1721. for (var i = 0; i < segments.length; i++) {
  1722. if (!obj) { return }
  1723. obj = obj[segments[i]];
  1724. }
  1725. return obj
  1726. }
  1727. }
  1728. /* */
  1729. // can we use __proto__?
  1730. var hasProto = '__proto__' in {};
  1731. // Browser environment sniffing
  1732. var inBrowser = typeof window !== 'undefined';
  1733. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  1734. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  1735. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  1736. var isIE = UA && /msie|trident/.test(UA);
  1737. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  1738. var isEdge = UA && UA.indexOf('edge/') > 0;
  1739. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  1740. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  1741. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  1742. var isPhantomJS = UA && /phantomjs/.test(UA);
  1743. var isFF = UA && UA.match(/firefox\/(\d+)/);
  1744. // Firefox has a "watch" function on Object.prototype...
  1745. var nativeWatch = ({}).watch;
  1746. if (inBrowser) {
  1747. try {
  1748. var opts = {};
  1749. Object.defineProperty(opts, 'passive', ({
  1750. get: function get () {
  1751. }
  1752. })); // https://github.com/facebook/flow/issues/285
  1753. window.addEventListener('test-passive', null, opts);
  1754. } catch (e) {}
  1755. }
  1756. // this needs to be lazy-evaled because vue may be required before
  1757. // vue-server-renderer can set VUE_ENV
  1758. var _isServer;
  1759. var isServerRendering = function () {
  1760. if (_isServer === undefined) {
  1761. /* istanbul ignore if */
  1762. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  1763. // detect presence of vue-server-renderer and avoid
  1764. // Webpack shimming the process
  1765. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  1766. } else {
  1767. _isServer = false;
  1768. }
  1769. }
  1770. return _isServer
  1771. };
  1772. // detect devtools
  1773. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  1774. /* istanbul ignore next */
  1775. function isNative (Ctor) {
  1776. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  1777. }
  1778. var hasSymbol =
  1779. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  1780. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  1781. var _Set;
  1782. /* istanbul ignore if */ // $flow-disable-line
  1783. if (typeof Set !== 'undefined' && isNative(Set)) {
  1784. // use native Set when available.
  1785. _Set = Set;
  1786. } else {
  1787. // a non-standard Set polyfill that only works with primitive keys.
  1788. _Set = /*@__PURE__*/(function () {
  1789. function Set () {
  1790. this.set = Object.create(null);
  1791. }
  1792. Set.prototype.has = function has (key) {
  1793. return this.set[key] === true
  1794. };
  1795. Set.prototype.add = function add (key) {
  1796. this.set[key] = true;
  1797. };
  1798. Set.prototype.clear = function clear () {
  1799. this.set = Object.create(null);
  1800. };
  1801. return Set;
  1802. }());
  1803. }
  1804. /* */
  1805. var warn = noop;
  1806. var tip = noop;
  1807. var generateComponentTrace = (noop); // work around flow check
  1808. var formatComponentName = (noop);
  1809. if (true) {
  1810. var hasConsole = typeof console !== 'undefined';
  1811. var classifyRE = /(?:^|[-_])(\w)/g;
  1812. var classify = function (str) { return str
  1813. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  1814. .replace(/[-_]/g, ''); };
  1815. warn = function (msg, vm) {
  1816. var trace = vm ? generateComponentTrace(vm) : '';
  1817. if (config.warnHandler) {
  1818. config.warnHandler.call(null, msg, vm, trace);
  1819. } else if (hasConsole && (!config.silent)) {
  1820. console.error(("[Vue warn]: " + msg + trace));
  1821. }
  1822. };
  1823. tip = function (msg, vm) {
  1824. if (hasConsole && (!config.silent)) {
  1825. console.warn("[Vue tip]: " + msg + (
  1826. vm ? generateComponentTrace(vm) : ''
  1827. ));
  1828. }
  1829. };
  1830. formatComponentName = function (vm, includeFile) {
  1831. {
  1832. if(vm.$scope && vm.$scope.is){
  1833. return vm.$scope.is
  1834. }
  1835. }
  1836. if (vm.$root === vm) {
  1837. return '<Root>'
  1838. }
  1839. var options = typeof vm === 'function' && vm.cid != null
  1840. ? vm.options
  1841. : vm._isVue
  1842. ? vm.$options || vm.constructor.options
  1843. : vm;
  1844. var name = options.name || options._componentTag;
  1845. var file = options.__file;
  1846. if (!name && file) {
  1847. var match = file.match(/([^/\\]+)\.vue$/);
  1848. name = match && match[1];
  1849. }
  1850. return (
  1851. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  1852. (file && includeFile !== false ? (" at " + file) : '')
  1853. )
  1854. };
  1855. var repeat = function (str, n) {
  1856. var res = '';
  1857. while (n) {
  1858. if (n % 2 === 1) { res += str; }
  1859. if (n > 1) { str += str; }
  1860. n >>= 1;
  1861. }
  1862. return res
  1863. };
  1864. generateComponentTrace = function (vm) {
  1865. if (vm._isVue && vm.$parent) {
  1866. var tree = [];
  1867. var currentRecursiveSequence = 0;
  1868. while (vm) {
  1869. if (tree.length > 0) {
  1870. var last = tree[tree.length - 1];
  1871. if (last.constructor === vm.constructor) {
  1872. currentRecursiveSequence++;
  1873. vm = vm.$parent;
  1874. continue
  1875. } else if (currentRecursiveSequence > 0) {
  1876. tree[tree.length - 1] = [last, currentRecursiveSequence];
  1877. currentRecursiveSequence = 0;
  1878. }
  1879. }
  1880. tree.push(vm);
  1881. vm = vm.$parent;
  1882. }
  1883. return '\n\nfound in\n\n' + tree
  1884. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  1885. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  1886. : formatComponentName(vm))); })
  1887. .join('\n')
  1888. } else {
  1889. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  1890. }
  1891. };
  1892. }
  1893. /* */
  1894. var uid = 0;
  1895. /**
  1896. * A dep is an observable that can have multiple
  1897. * directives subscribing to it.
  1898. */
  1899. var Dep = function Dep () {
  1900. // fixed by xxxxxx (nvue vuex)
  1901. /* eslint-disable no-undef */
  1902. if(typeof SharedObject !== 'undefined'){
  1903. this.id = SharedObject.uid++;
  1904. } else {
  1905. this.id = uid++;
  1906. }
  1907. this.subs = [];
  1908. };
  1909. Dep.prototype.addSub = function addSub (sub) {
  1910. this.subs.push(sub);
  1911. };
  1912. Dep.prototype.removeSub = function removeSub (sub) {
  1913. remove(this.subs, sub);
  1914. };
  1915. Dep.prototype.depend = function depend () {
  1916. if (Dep.SharedObject.target) {
  1917. Dep.SharedObject.target.addDep(this);
  1918. }
  1919. };
  1920. Dep.prototype.notify = function notify () {
  1921. // stabilize the subscriber list first
  1922. var subs = this.subs.slice();
  1923. if ( true && !config.async) {
  1924. // subs aren't sorted in scheduler if not running async
  1925. // we need to sort them now to make sure they fire in correct
  1926. // order
  1927. subs.sort(function (a, b) { return a.id - b.id; });
  1928. }
  1929. for (var i = 0, l = subs.length; i < l; i++) {
  1930. subs[i].update();
  1931. }
  1932. };
  1933. // The current target watcher being evaluated.
  1934. // This is globally unique because only one watcher
  1935. // can be evaluated at a time.
  1936. // fixed by xxxxxx (nvue shared vuex)
  1937. /* eslint-disable no-undef */
  1938. Dep.SharedObject = typeof SharedObject !== 'undefined' ? SharedObject : {};
  1939. Dep.SharedObject.target = null;
  1940. Dep.SharedObject.targetStack = [];
  1941. function pushTarget (target) {
  1942. Dep.SharedObject.targetStack.push(target);
  1943. Dep.SharedObject.target = target;
  1944. }
  1945. function popTarget () {
  1946. Dep.SharedObject.targetStack.pop();
  1947. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  1948. }
  1949. /* */
  1950. var VNode = function VNode (
  1951. tag,
  1952. data,
  1953. children,
  1954. text,
  1955. elm,
  1956. context,
  1957. componentOptions,
  1958. asyncFactory
  1959. ) {
  1960. this.tag = tag;
  1961. this.data = data;
  1962. this.children = children;
  1963. this.text = text;
  1964. this.elm = elm;
  1965. this.ns = undefined;
  1966. this.context = context;
  1967. this.fnContext = undefined;
  1968. this.fnOptions = undefined;
  1969. this.fnScopeId = undefined;
  1970. this.key = data && data.key;
  1971. this.componentOptions = componentOptions;
  1972. this.componentInstance = undefined;
  1973. this.parent = undefined;
  1974. this.raw = false;
  1975. this.isStatic = false;
  1976. this.isRootInsert = true;
  1977. this.isComment = false;
  1978. this.isCloned = false;
  1979. this.isOnce = false;
  1980. this.asyncFactory = asyncFactory;
  1981. this.asyncMeta = undefined;
  1982. this.isAsyncPlaceholder = false;
  1983. };
  1984. var prototypeAccessors = { child: { configurable: true } };
  1985. // DEPRECATED: alias for componentInstance for backwards compat.
  1986. /* istanbul ignore next */
  1987. prototypeAccessors.child.get = function () {
  1988. return this.componentInstance
  1989. };
  1990. Object.defineProperties( VNode.prototype, prototypeAccessors );
  1991. var createEmptyVNode = function (text) {
  1992. if ( text === void 0 ) text = '';
  1993. var node = new VNode();
  1994. node.text = text;
  1995. node.isComment = true;
  1996. return node
  1997. };
  1998. function createTextVNode (val) {
  1999. return new VNode(undefined, undefined, undefined, String(val))
  2000. }
  2001. // optimized shallow clone
  2002. // used for static nodes and slot nodes because they may be reused across
  2003. // multiple renders, cloning them avoids errors when DOM manipulations rely
  2004. // on their elm reference.
  2005. function cloneVNode (vnode) {
  2006. var cloned = new VNode(
  2007. vnode.tag,
  2008. vnode.data,
  2009. // #7975
  2010. // clone children array to avoid mutating original in case of cloning
  2011. // a child.
  2012. vnode.children && vnode.children.slice(),
  2013. vnode.text,
  2014. vnode.elm,
  2015. vnode.context,
  2016. vnode.componentOptions,
  2017. vnode.asyncFactory
  2018. );
  2019. cloned.ns = vnode.ns;
  2020. cloned.isStatic = vnode.isStatic;
  2021. cloned.key = vnode.key;
  2022. cloned.isComment = vnode.isComment;
  2023. cloned.fnContext = vnode.fnContext;
  2024. cloned.fnOptions = vnode.fnOptions;
  2025. cloned.fnScopeId = vnode.fnScopeId;
  2026. cloned.asyncMeta = vnode.asyncMeta;
  2027. cloned.isCloned = true;
  2028. return cloned
  2029. }
  2030. /*
  2031. * not type checking this file because flow doesn't play well with
  2032. * dynamically accessing methods on Array prototype
  2033. */
  2034. var arrayProto = Array.prototype;
  2035. var arrayMethods = Object.create(arrayProto);
  2036. var methodsToPatch = [
  2037. 'push',
  2038. 'pop',
  2039. 'shift',
  2040. 'unshift',
  2041. 'splice',
  2042. 'sort',
  2043. 'reverse'
  2044. ];
  2045. /**
  2046. * Intercept mutating methods and emit events
  2047. */
  2048. methodsToPatch.forEach(function (method) {
  2049. // cache original method
  2050. var original = arrayProto[method];
  2051. def(arrayMethods, method, function mutator () {
  2052. var args = [], len = arguments.length;
  2053. while ( len-- ) args[ len ] = arguments[ len ];
  2054. var result = original.apply(this, args);
  2055. var ob = this.__ob__;
  2056. var inserted;
  2057. switch (method) {
  2058. case 'push':
  2059. case 'unshift':
  2060. inserted = args;
  2061. break
  2062. case 'splice':
  2063. inserted = args.slice(2);
  2064. break
  2065. }
  2066. if (inserted) { ob.observeArray(inserted); }
  2067. // notify change
  2068. ob.dep.notify();
  2069. return result
  2070. });
  2071. });
  2072. /* */
  2073. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  2074. /**
  2075. * In some cases we may want to disable observation inside a component's
  2076. * update computation.
  2077. */
  2078. var shouldObserve = true;
  2079. function toggleObserving (value) {
  2080. shouldObserve = value;
  2081. }
  2082. /**
  2083. * Observer class that is attached to each observed
  2084. * object. Once attached, the observer converts the target
  2085. * object's property keys into getter/setters that
  2086. * collect dependencies and dispatch updates.
  2087. */
  2088. var Observer = function Observer (value) {
  2089. this.value = value;
  2090. this.dep = new Dep();
  2091. this.vmCount = 0;
  2092. def(value, '__ob__', this);
  2093. if (Array.isArray(value)) {
  2094. if (hasProto) {
  2095. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  2096. if(value.push !== value.__proto__.push){
  2097. copyAugment(value, arrayMethods, arrayKeys);
  2098. } else {
  2099. protoAugment(value, arrayMethods);
  2100. }
  2101. }
  2102. } else {
  2103. copyAugment(value, arrayMethods, arrayKeys);
  2104. }
  2105. this.observeArray(value);
  2106. } else {
  2107. this.walk(value);
  2108. }
  2109. };
  2110. /**
  2111. * Walk through all properties and convert them into
  2112. * getter/setters. This method should only be called when
  2113. * value type is Object.
  2114. */
  2115. Observer.prototype.walk = function walk (obj) {
  2116. var keys = Object.keys(obj);
  2117. for (var i = 0; i < keys.length; i++) {
  2118. defineReactive$$1(obj, keys[i]);
  2119. }
  2120. };
  2121. /**
  2122. * Observe a list of Array items.
  2123. */
  2124. Observer.prototype.observeArray = function observeArray (items) {
  2125. for (var i = 0, l = items.length; i < l; i++) {
  2126. observe(items[i]);
  2127. }
  2128. };
  2129. // helpers
  2130. /**
  2131. * Augment a target Object or Array by intercepting
  2132. * the prototype chain using __proto__
  2133. */
  2134. function protoAugment (target, src) {
  2135. /* eslint-disable no-proto */
  2136. target.__proto__ = src;
  2137. /* eslint-enable no-proto */
  2138. }
  2139. /**
  2140. * Augment a target Object or Array by defining
  2141. * hidden properties.
  2142. */
  2143. /* istanbul ignore next */
  2144. function copyAugment (target, src, keys) {
  2145. for (var i = 0, l = keys.length; i < l; i++) {
  2146. var key = keys[i];
  2147. def(target, key, src[key]);
  2148. }
  2149. }
  2150. /**
  2151. * Attempt to create an observer instance for a value,
  2152. * returns the new observer if successfully observed,
  2153. * or the existing observer if the value already has one.
  2154. */
  2155. function observe (value, asRootData) {
  2156. if (!isObject(value) || value instanceof VNode) {
  2157. return
  2158. }
  2159. var ob;
  2160. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  2161. ob = value.__ob__;
  2162. } else if (
  2163. shouldObserve &&
  2164. !isServerRendering() &&
  2165. (Array.isArray(value) || isPlainObject(value)) &&
  2166. Object.isExtensible(value) &&
  2167. !value._isVue
  2168. ) {
  2169. ob = new Observer(value);
  2170. }
  2171. if (asRootData && ob) {
  2172. ob.vmCount++;
  2173. }
  2174. return ob
  2175. }
  2176. /**
  2177. * Define a reactive property on an Object.
  2178. */
  2179. function defineReactive$$1 (
  2180. obj,
  2181. key,
  2182. val,
  2183. customSetter,
  2184. shallow
  2185. ) {
  2186. var dep = new Dep();
  2187. var property = Object.getOwnPropertyDescriptor(obj, key);
  2188. if (property && property.configurable === false) {
  2189. return
  2190. }
  2191. // cater for pre-defined getter/setters
  2192. var getter = property && property.get;
  2193. var setter = property && property.set;
  2194. if ((!getter || setter) && arguments.length === 2) {
  2195. val = obj[key];
  2196. }
  2197. var childOb = !shallow && observe(val);
  2198. Object.defineProperty(obj, key, {
  2199. enumerable: true,
  2200. configurable: true,
  2201. get: function reactiveGetter () {
  2202. var value = getter ? getter.call(obj) : val;
  2203. if (Dep.SharedObject.target) { // fixed by xxxxxx
  2204. dep.depend();
  2205. if (childOb) {
  2206. childOb.dep.depend();
  2207. if (Array.isArray(value)) {
  2208. dependArray(value);
  2209. }
  2210. }
  2211. }
  2212. return value
  2213. },
  2214. set: function reactiveSetter (newVal) {
  2215. var value = getter ? getter.call(obj) : val;
  2216. /* eslint-disable no-self-compare */
  2217. if (newVal === value || (newVal !== newVal && value !== value)) {
  2218. return
  2219. }
  2220. /* eslint-enable no-self-compare */
  2221. if ( true && customSetter) {
  2222. customSetter();
  2223. }
  2224. // #7981: for accessor properties without setter
  2225. if (getter && !setter) { return }
  2226. if (setter) {
  2227. setter.call(obj, newVal);
  2228. } else {
  2229. val = newVal;
  2230. }
  2231. childOb = !shallow && observe(newVal);
  2232. dep.notify();
  2233. }
  2234. });
  2235. }
  2236. /**
  2237. * Set a property on an object. Adds the new property and
  2238. * triggers change notification if the property doesn't
  2239. * already exist.
  2240. */
  2241. function set (target, key, val) {
  2242. if ( true &&
  2243. (isUndef(target) || isPrimitive(target))
  2244. ) {
  2245. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  2246. }
  2247. if (Array.isArray(target) && isValidArrayIndex(key)) {
  2248. target.length = Math.max(target.length, key);
  2249. target.splice(key, 1, val);
  2250. return val
  2251. }
  2252. if (key in target && !(key in Object.prototype)) {
  2253. target[key] = val;
  2254. return val
  2255. }
  2256. var ob = (target).__ob__;
  2257. if (target._isVue || (ob && ob.vmCount)) {
  2258. true && warn(
  2259. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  2260. 'at runtime - declare it upfront in the data option.'
  2261. );
  2262. return val
  2263. }
  2264. if (!ob) {
  2265. target[key] = val;
  2266. return val
  2267. }
  2268. defineReactive$$1(ob.value, key, val);
  2269. ob.dep.notify();
  2270. return val
  2271. }
  2272. /**
  2273. * Delete a property and trigger change if necessary.
  2274. */
  2275. function del (target, key) {
  2276. if ( true &&
  2277. (isUndef(target) || isPrimitive(target))
  2278. ) {
  2279. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  2280. }
  2281. if (Array.isArray(target) && isValidArrayIndex(key)) {
  2282. target.splice(key, 1);
  2283. return
  2284. }
  2285. var ob = (target).__ob__;
  2286. if (target._isVue || (ob && ob.vmCount)) {
  2287. true && warn(
  2288. 'Avoid deleting properties on a Vue instance or its root $data ' +
  2289. '- just set it to null.'
  2290. );
  2291. return
  2292. }
  2293. if (!hasOwn(target, key)) {
  2294. return
  2295. }
  2296. delete target[key];
  2297. if (!ob) {
  2298. return
  2299. }
  2300. ob.dep.notify();
  2301. }
  2302. /**
  2303. * Collect dependencies on array elements when the array is touched, since
  2304. * we cannot intercept array element access like property getters.
  2305. */
  2306. function dependArray (value) {
  2307. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  2308. e = value[i];
  2309. e && e.__ob__ && e.__ob__.dep.depend();
  2310. if (Array.isArray(e)) {
  2311. dependArray(e);
  2312. }
  2313. }
  2314. }
  2315. /* */
  2316. /**
  2317. * Option overwriting strategies are functions that handle
  2318. * how to merge a parent option value and a child option
  2319. * value into the final value.
  2320. */
  2321. var strats = config.optionMergeStrategies;
  2322. /**
  2323. * Options with restrictions
  2324. */
  2325. if (true) {
  2326. strats.el = strats.propsData = function (parent, child, vm, key) {
  2327. if (!vm) {
  2328. warn(
  2329. "option \"" + key + "\" can only be used during instance " +
  2330. 'creation with the `new` keyword.'
  2331. );
  2332. }
  2333. return defaultStrat(parent, child)
  2334. };
  2335. }
  2336. /**
  2337. * Helper that recursively merges two data objects together.
  2338. */
  2339. function mergeData (to, from) {
  2340. if (!from) { return to }
  2341. var key, toVal, fromVal;
  2342. var keys = hasSymbol
  2343. ? Reflect.ownKeys(from)
  2344. : Object.keys(from);
  2345. for (var i = 0; i < keys.length; i++) {
  2346. key = keys[i];
  2347. // in case the object is already observed...
  2348. if (key === '__ob__') { continue }
  2349. toVal = to[key];
  2350. fromVal = from[key];
  2351. if (!hasOwn(to, key)) {
  2352. set(to, key, fromVal);
  2353. } else if (
  2354. toVal !== fromVal &&
  2355. isPlainObject(toVal) &&
  2356. isPlainObject(fromVal)
  2357. ) {
  2358. mergeData(toVal, fromVal);
  2359. }
  2360. }
  2361. return to
  2362. }
  2363. /**
  2364. * Data
  2365. */
  2366. function mergeDataOrFn (
  2367. parentVal,
  2368. childVal,
  2369. vm
  2370. ) {
  2371. if (!vm) {
  2372. // in a Vue.extend merge, both should be functions
  2373. if (!childVal) {
  2374. return parentVal
  2375. }
  2376. if (!parentVal) {
  2377. return childVal
  2378. }
  2379. // when parentVal & childVal are both present,
  2380. // we need to return a function that returns the
  2381. // merged result of both functions... no need to
  2382. // check if parentVal is a function here because
  2383. // it has to be a function to pass previous merges.
  2384. return function mergedDataFn () {
  2385. return mergeData(
  2386. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  2387. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  2388. )
  2389. }
  2390. } else {
  2391. return function mergedInstanceDataFn () {
  2392. // instance merge
  2393. var instanceData = typeof childVal === 'function'
  2394. ? childVal.call(vm, vm)
  2395. : childVal;
  2396. var defaultData = typeof parentVal === 'function'
  2397. ? parentVal.call(vm, vm)
  2398. : parentVal;
  2399. if (instanceData) {
  2400. return mergeData(instanceData, defaultData)
  2401. } else {
  2402. return defaultData
  2403. }
  2404. }
  2405. }
  2406. }
  2407. strats.data = function (
  2408. parentVal,
  2409. childVal,
  2410. vm
  2411. ) {
  2412. if (!vm) {
  2413. if (childVal && typeof childVal !== 'function') {
  2414. true && warn(
  2415. 'The "data" option should be a function ' +
  2416. 'that returns a per-instance value in component ' +
  2417. 'definitions.',
  2418. vm
  2419. );
  2420. return parentVal
  2421. }
  2422. return mergeDataOrFn(parentVal, childVal)
  2423. }
  2424. return mergeDataOrFn(parentVal, childVal, vm)
  2425. };
  2426. /**
  2427. * Hooks and props are merged as arrays.
  2428. */
  2429. function mergeHook (
  2430. parentVal,
  2431. childVal
  2432. ) {
  2433. var res = childVal
  2434. ? parentVal
  2435. ? parentVal.concat(childVal)
  2436. : Array.isArray(childVal)
  2437. ? childVal
  2438. : [childVal]
  2439. : parentVal;
  2440. return res
  2441. ? dedupeHooks(res)
  2442. : res
  2443. }
  2444. function dedupeHooks (hooks) {
  2445. var res = [];
  2446. for (var i = 0; i < hooks.length; i++) {
  2447. if (res.indexOf(hooks[i]) === -1) {
  2448. res.push(hooks[i]);
  2449. }
  2450. }
  2451. return res
  2452. }
  2453. LIFECYCLE_HOOKS.forEach(function (hook) {
  2454. strats[hook] = mergeHook;
  2455. });
  2456. /**
  2457. * Assets
  2458. *
  2459. * When a vm is present (instance creation), we need to do
  2460. * a three-way merge between constructor options, instance
  2461. * options and parent options.
  2462. */
  2463. function mergeAssets (
  2464. parentVal,
  2465. childVal,
  2466. vm,
  2467. key
  2468. ) {
  2469. var res = Object.create(parentVal || null);
  2470. if (childVal) {
  2471. true && assertObjectType(key, childVal, vm);
  2472. return extend(res, childVal)
  2473. } else {
  2474. return res
  2475. }
  2476. }
  2477. ASSET_TYPES.forEach(function (type) {
  2478. strats[type + 's'] = mergeAssets;
  2479. });
  2480. /**
  2481. * Watchers.
  2482. *
  2483. * Watchers hashes should not overwrite one
  2484. * another, so we merge them as arrays.
  2485. */
  2486. strats.watch = function (
  2487. parentVal,
  2488. childVal,
  2489. vm,
  2490. key
  2491. ) {
  2492. // work around Firefox's Object.prototype.watch...
  2493. if (parentVal === nativeWatch) { parentVal = undefined; }
  2494. if (childVal === nativeWatch) { childVal = undefined; }
  2495. /* istanbul ignore if */
  2496. if (!childVal) { return Object.create(parentVal || null) }
  2497. if (true) {
  2498. assertObjectType(key, childVal, vm);
  2499. }
  2500. if (!parentVal) { return childVal }
  2501. var ret = {};
  2502. extend(ret, parentVal);
  2503. for (var key$1 in childVal) {
  2504. var parent = ret[key$1];
  2505. var child = childVal[key$1];
  2506. if (parent && !Array.isArray(parent)) {
  2507. parent = [parent];
  2508. }
  2509. ret[key$1] = parent
  2510. ? parent.concat(child)
  2511. : Array.isArray(child) ? child : [child];
  2512. }
  2513. return ret
  2514. };
  2515. /**
  2516. * Other object hashes.
  2517. */
  2518. strats.props =
  2519. strats.methods =
  2520. strats.inject =
  2521. strats.computed = function (
  2522. parentVal,
  2523. childVal,
  2524. vm,
  2525. key
  2526. ) {
  2527. if (childVal && "development" !== 'production') {
  2528. assertObjectType(key, childVal, vm);
  2529. }
  2530. if (!parentVal) { return childVal }
  2531. var ret = Object.create(null);
  2532. extend(ret, parentVal);
  2533. if (childVal) { extend(ret, childVal); }
  2534. return ret
  2535. };
  2536. strats.provide = mergeDataOrFn;
  2537. /**
  2538. * Default strategy.
  2539. */
  2540. var defaultStrat = function (parentVal, childVal) {
  2541. return childVal === undefined
  2542. ? parentVal
  2543. : childVal
  2544. };
  2545. /**
  2546. * Validate component names
  2547. */
  2548. function checkComponents (options) {
  2549. for (var key in options.components) {
  2550. validateComponentName(key);
  2551. }
  2552. }
  2553. function validateComponentName (name) {
  2554. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  2555. warn(
  2556. 'Invalid component name: "' + name + '". Component names ' +
  2557. 'should conform to valid custom element name in html5 specification.'
  2558. );
  2559. }
  2560. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  2561. warn(
  2562. 'Do not use built-in or reserved HTML elements as component ' +
  2563. 'id: ' + name
  2564. );
  2565. }
  2566. }
  2567. /**
  2568. * Ensure all props option syntax are normalized into the
  2569. * Object-based format.
  2570. */
  2571. function normalizeProps (options, vm) {
  2572. var props = options.props;
  2573. if (!props) { return }
  2574. var res = {};
  2575. var i, val, name;
  2576. if (Array.isArray(props)) {
  2577. i = props.length;
  2578. while (i--) {
  2579. val = props[i];
  2580. if (typeof val === 'string') {
  2581. name = camelize(val);
  2582. res[name] = { type: null };
  2583. } else if (true) {
  2584. warn('props must be strings when using array syntax.');
  2585. }
  2586. }
  2587. } else if (isPlainObject(props)) {
  2588. for (var key in props) {
  2589. val = props[key];
  2590. name = camelize(key);
  2591. res[name] = isPlainObject(val)
  2592. ? val
  2593. : { type: val };
  2594. }
  2595. } else if (true) {
  2596. warn(
  2597. "Invalid value for option \"props\": expected an Array or an Object, " +
  2598. "but got " + (toRawType(props)) + ".",
  2599. vm
  2600. );
  2601. }
  2602. options.props = res;
  2603. }
  2604. /**
  2605. * Normalize all injections into Object-based format
  2606. */
  2607. function normalizeInject (options, vm) {
  2608. var inject = options.inject;
  2609. if (!inject) { return }
  2610. var normalized = options.inject = {};
  2611. if (Array.isArray(inject)) {
  2612. for (var i = 0; i < inject.length; i++) {
  2613. normalized[inject[i]] = { from: inject[i] };
  2614. }
  2615. } else if (isPlainObject(inject)) {
  2616. for (var key in inject) {
  2617. var val = inject[key];
  2618. normalized[key] = isPlainObject(val)
  2619. ? extend({ from: key }, val)
  2620. : { from: val };
  2621. }
  2622. } else if (true) {
  2623. warn(
  2624. "Invalid value for option \"inject\": expected an Array or an Object, " +
  2625. "but got " + (toRawType(inject)) + ".",
  2626. vm
  2627. );
  2628. }
  2629. }
  2630. /**
  2631. * Normalize raw function directives into object format.
  2632. */
  2633. function normalizeDirectives (options) {
  2634. var dirs = options.directives;
  2635. if (dirs) {
  2636. for (var key in dirs) {
  2637. var def$$1 = dirs[key];
  2638. if (typeof def$$1 === 'function') {
  2639. dirs[key] = { bind: def$$1, update: def$$1 };
  2640. }
  2641. }
  2642. }
  2643. }
  2644. function assertObjectType (name, value, vm) {
  2645. if (!isPlainObject(value)) {
  2646. warn(
  2647. "Invalid value for option \"" + name + "\": expected an Object, " +
  2648. "but got " + (toRawType(value)) + ".",
  2649. vm
  2650. );
  2651. }
  2652. }
  2653. /**
  2654. * Merge two option objects into a new one.
  2655. * Core utility used in both instantiation and inheritance.
  2656. */
  2657. function mergeOptions (
  2658. parent,
  2659. child,
  2660. vm
  2661. ) {
  2662. if (true) {
  2663. checkComponents(child);
  2664. }
  2665. if (typeof child === 'function') {
  2666. child = child.options;
  2667. }
  2668. normalizeProps(child, vm);
  2669. normalizeInject(child, vm);
  2670. normalizeDirectives(child);
  2671. // Apply extends and mixins on the child options,
  2672. // but only if it is a raw options object that isn't
  2673. // the result of another mergeOptions call.
  2674. // Only merged options has the _base property.
  2675. if (!child._base) {
  2676. if (child.extends) {
  2677. parent = mergeOptions(parent, child.extends, vm);
  2678. }
  2679. if (child.mixins) {
  2680. for (var i = 0, l = child.mixins.length; i < l; i++) {
  2681. parent = mergeOptions(parent, child.mixins[i], vm);
  2682. }
  2683. }
  2684. }
  2685. var options = {};
  2686. var key;
  2687. for (key in parent) {
  2688. mergeField(key);
  2689. }
  2690. for (key in child) {
  2691. if (!hasOwn(parent, key)) {
  2692. mergeField(key);
  2693. }
  2694. }
  2695. function mergeField (key) {
  2696. var strat = strats[key] || defaultStrat;
  2697. options[key] = strat(parent[key], child[key], vm, key);
  2698. }
  2699. return options
  2700. }
  2701. /**
  2702. * Resolve an asset.
  2703. * This function is used because child instances need access
  2704. * to assets defined in its ancestor chain.
  2705. */
  2706. function resolveAsset (
  2707. options,
  2708. type,
  2709. id,
  2710. warnMissing
  2711. ) {
  2712. /* istanbul ignore if */
  2713. if (typeof id !== 'string') {
  2714. return
  2715. }
  2716. var assets = options[type];
  2717. // check local registration variations first
  2718. if (hasOwn(assets, id)) { return assets[id] }
  2719. var camelizedId = camelize(id);
  2720. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  2721. var PascalCaseId = capitalize(camelizedId);
  2722. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  2723. // fallback to prototype chain
  2724. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  2725. if ( true && warnMissing && !res) {
  2726. warn(
  2727. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  2728. options
  2729. );
  2730. }
  2731. return res
  2732. }
  2733. /* */
  2734. function validateProp (
  2735. key,
  2736. propOptions,
  2737. propsData,
  2738. vm
  2739. ) {
  2740. var prop = propOptions[key];
  2741. var absent = !hasOwn(propsData, key);
  2742. var value = propsData[key];
  2743. // boolean casting
  2744. var booleanIndex = getTypeIndex(Boolean, prop.type);
  2745. if (booleanIndex > -1) {
  2746. if (absent && !hasOwn(prop, 'default')) {
  2747. value = false;
  2748. } else if (value === '' || value === hyphenate(key)) {
  2749. // only cast empty string / same name to boolean if
  2750. // boolean has higher priority
  2751. var stringIndex = getTypeIndex(String, prop.type);
  2752. if (stringIndex < 0 || booleanIndex < stringIndex) {
  2753. value = true;
  2754. }
  2755. }
  2756. }
  2757. // check default value
  2758. if (value === undefined) {
  2759. value = getPropDefaultValue(vm, prop, key);
  2760. // since the default value is a fresh copy,
  2761. // make sure to observe it.
  2762. var prevShouldObserve = shouldObserve;
  2763. toggleObserving(true);
  2764. observe(value);
  2765. toggleObserving(prevShouldObserve);
  2766. }
  2767. if (
  2768. true
  2769. ) {
  2770. assertProp(prop, key, value, vm, absent);
  2771. }
  2772. return value
  2773. }
  2774. /**
  2775. * Get the default value of a prop.
  2776. */
  2777. function getPropDefaultValue (vm, prop, key) {
  2778. // no default, return undefined
  2779. if (!hasOwn(prop, 'default')) {
  2780. return undefined
  2781. }
  2782. var def = prop.default;
  2783. // warn against non-factory defaults for Object & Array
  2784. if ( true && isObject(def)) {
  2785. warn(
  2786. 'Invalid default value for prop "' + key + '": ' +
  2787. 'Props with type Object/Array must use a factory function ' +
  2788. 'to return the default value.',
  2789. vm
  2790. );
  2791. }
  2792. // the raw prop value was also undefined from previous render,
  2793. // return previous default value to avoid unnecessary watcher trigger
  2794. if (vm && vm.$options.propsData &&
  2795. vm.$options.propsData[key] === undefined &&
  2796. vm._props[key] !== undefined
  2797. ) {
  2798. return vm._props[key]
  2799. }
  2800. // call factory function for non-Function types
  2801. // a value is Function if its prototype is function even across different execution context
  2802. return typeof def === 'function' && getType(prop.type) !== 'Function'
  2803. ? def.call(vm)
  2804. : def
  2805. }
  2806. /**
  2807. * Assert whether a prop is valid.
  2808. */
  2809. function assertProp (
  2810. prop,
  2811. name,
  2812. value,
  2813. vm,
  2814. absent
  2815. ) {
  2816. if (prop.required && absent) {
  2817. warn(
  2818. 'Missing required prop: "' + name + '"',
  2819. vm
  2820. );
  2821. return
  2822. }
  2823. if (value == null && !prop.required) {
  2824. return
  2825. }
  2826. var type = prop.type;
  2827. var valid = !type || type === true;
  2828. var expectedTypes = [];
  2829. if (type) {
  2830. if (!Array.isArray(type)) {
  2831. type = [type];
  2832. }
  2833. for (var i = 0; i < type.length && !valid; i++) {
  2834. var assertedType = assertType(value, type[i]);
  2835. expectedTypes.push(assertedType.expectedType || '');
  2836. valid = assertedType.valid;
  2837. }
  2838. }
  2839. if (!valid) {
  2840. warn(
  2841. getInvalidTypeMessage(name, value, expectedTypes),
  2842. vm
  2843. );
  2844. return
  2845. }
  2846. var validator = prop.validator;
  2847. if (validator) {
  2848. if (!validator(value)) {
  2849. warn(
  2850. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  2851. vm
  2852. );
  2853. }
  2854. }
  2855. }
  2856. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  2857. function assertType (value, type) {
  2858. var valid;
  2859. var expectedType = getType(type);
  2860. if (simpleCheckRE.test(expectedType)) {
  2861. var t = typeof value;
  2862. valid = t === expectedType.toLowerCase();
  2863. // for primitive wrapper objects
  2864. if (!valid && t === 'object') {
  2865. valid = value instanceof type;
  2866. }
  2867. } else if (expectedType === 'Object') {
  2868. valid = isPlainObject(value);
  2869. } else if (expectedType === 'Array') {
  2870. valid = Array.isArray(value);
  2871. } else {
  2872. valid = value instanceof type;
  2873. }
  2874. return {
  2875. valid: valid,
  2876. expectedType: expectedType
  2877. }
  2878. }
  2879. /**
  2880. * Use function string name to check built-in types,
  2881. * because a simple equality check will fail when running
  2882. * across different vms / iframes.
  2883. */
  2884. function getType (fn) {
  2885. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  2886. return match ? match[1] : ''
  2887. }
  2888. function isSameType (a, b) {
  2889. return getType(a) === getType(b)
  2890. }
  2891. function getTypeIndex (type, expectedTypes) {
  2892. if (!Array.isArray(expectedTypes)) {
  2893. return isSameType(expectedTypes, type) ? 0 : -1
  2894. }
  2895. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  2896. if (isSameType(expectedTypes[i], type)) {
  2897. return i
  2898. }
  2899. }
  2900. return -1
  2901. }
  2902. function getInvalidTypeMessage (name, value, expectedTypes) {
  2903. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  2904. " Expected " + (expectedTypes.map(capitalize).join(', '));
  2905. var expectedType = expectedTypes[0];
  2906. var receivedType = toRawType(value);
  2907. var expectedValue = styleValue(value, expectedType);
  2908. var receivedValue = styleValue(value, receivedType);
  2909. // check if we need to specify expected value
  2910. if (expectedTypes.length === 1 &&
  2911. isExplicable(expectedType) &&
  2912. !isBoolean(expectedType, receivedType)) {
  2913. message += " with value " + expectedValue;
  2914. }
  2915. message += ", got " + receivedType + " ";
  2916. // check if we need to specify received value
  2917. if (isExplicable(receivedType)) {
  2918. message += "with value " + receivedValue + ".";
  2919. }
  2920. return message
  2921. }
  2922. function styleValue (value, type) {
  2923. if (type === 'String') {
  2924. return ("\"" + value + "\"")
  2925. } else if (type === 'Number') {
  2926. return ("" + (Number(value)))
  2927. } else {
  2928. return ("" + value)
  2929. }
  2930. }
  2931. function isExplicable (value) {
  2932. var explicitTypes = ['string', 'number', 'boolean'];
  2933. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  2934. }
  2935. function isBoolean () {
  2936. var args = [], len = arguments.length;
  2937. while ( len-- ) args[ len ] = arguments[ len ];
  2938. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  2939. }
  2940. /* */
  2941. function handleError (err, vm, info) {
  2942. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  2943. // See: https://github.com/vuejs/vuex/issues/1505
  2944. pushTarget();
  2945. try {
  2946. if (vm) {
  2947. var cur = vm;
  2948. while ((cur = cur.$parent)) {
  2949. var hooks = cur.$options.errorCaptured;
  2950. if (hooks) {
  2951. for (var i = 0; i < hooks.length; i++) {
  2952. try {
  2953. var capture = hooks[i].call(cur, err, vm, info) === false;
  2954. if (capture) { return }
  2955. } catch (e) {
  2956. globalHandleError(e, cur, 'errorCaptured hook');
  2957. }
  2958. }
  2959. }
  2960. }
  2961. }
  2962. globalHandleError(err, vm, info);
  2963. } finally {
  2964. popTarget();
  2965. }
  2966. }
  2967. function invokeWithErrorHandling (
  2968. handler,
  2969. context,
  2970. args,
  2971. vm,
  2972. info
  2973. ) {
  2974. var res;
  2975. try {
  2976. res = args ? handler.apply(context, args) : handler.call(context);
  2977. if (res && !res._isVue && isPromise(res) && !res._handled) {
  2978. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  2979. // issue #9511
  2980. // avoid catch triggering multiple times when nested calls
  2981. res._handled = true;
  2982. }
  2983. } catch (e) {
  2984. handleError(e, vm, info);
  2985. }
  2986. return res
  2987. }
  2988. function globalHandleError (err, vm, info) {
  2989. if (config.errorHandler) {
  2990. try {
  2991. return config.errorHandler.call(null, err, vm, info)
  2992. } catch (e) {
  2993. // if the user intentionally throws the original error in the handler,
  2994. // do not log it twice
  2995. if (e !== err) {
  2996. logError(e, null, 'config.errorHandler');
  2997. }
  2998. }
  2999. }
  3000. logError(err, vm, info);
  3001. }
  3002. function logError (err, vm, info) {
  3003. if (true) {
  3004. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  3005. }
  3006. /* istanbul ignore else */
  3007. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  3008. console.error(err);
  3009. } else {
  3010. throw err
  3011. }
  3012. }
  3013. /* */
  3014. var callbacks = [];
  3015. var pending = false;
  3016. function flushCallbacks () {
  3017. pending = false;
  3018. var copies = callbacks.slice(0);
  3019. callbacks.length = 0;
  3020. for (var i = 0; i < copies.length; i++) {
  3021. copies[i]();
  3022. }
  3023. }
  3024. // Here we have async deferring wrappers using microtasks.
  3025. // In 2.5 we used (macro) tasks (in combination with microtasks).
  3026. // However, it has subtle problems when state is changed right before repaint
  3027. // (e.g. #6813, out-in transitions).
  3028. // Also, using (macro) tasks in event handler would cause some weird behaviors
  3029. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  3030. // So we now use microtasks everywhere, again.
  3031. // A major drawback of this tradeoff is that there are some scenarios
  3032. // where microtasks have too high a priority and fire in between supposedly
  3033. // sequential events (e.g. #4521, #6690, which have workarounds)
  3034. // or even between bubbling of the same event (#6566).
  3035. var timerFunc;
  3036. // The nextTick behavior leverages the microtask queue, which can be accessed
  3037. // via either native Promise.then or MutationObserver.
  3038. // MutationObserver has wider support, however it is seriously bugged in
  3039. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  3040. // completely stops working after triggering a few times... so, if native
  3041. // Promise is available, we will use it:
  3042. /* istanbul ignore next, $flow-disable-line */
  3043. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  3044. var p = Promise.resolve();
  3045. timerFunc = function () {
  3046. p.then(flushCallbacks);
  3047. // In problematic UIWebViews, Promise.then doesn't completely break, but
  3048. // it can get stuck in a weird state where callbacks are pushed into the
  3049. // microtask queue but the queue isn't being flushed, until the browser
  3050. // needs to do some other work, e.g. handle a timer. Therefore we can
  3051. // "force" the microtask queue to be flushed by adding an empty timer.
  3052. if (isIOS) { setTimeout(noop); }
  3053. };
  3054. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  3055. isNative(MutationObserver) ||
  3056. // PhantomJS and iOS 7.x
  3057. MutationObserver.toString() === '[object MutationObserverConstructor]'
  3058. )) {
  3059. // Use MutationObserver where native Promise is not available,
  3060. // e.g. PhantomJS, iOS7, Android 4.4
  3061. // (#6466 MutationObserver is unreliable in IE11)
  3062. var counter = 1;
  3063. var observer = new MutationObserver(flushCallbacks);
  3064. var textNode = document.createTextNode(String(counter));
  3065. observer.observe(textNode, {
  3066. characterData: true
  3067. });
  3068. timerFunc = function () {
  3069. counter = (counter + 1) % 2;
  3070. textNode.data = String(counter);
  3071. };
  3072. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  3073. // Fallback to setImmediate.
  3074. // Technically it leverages the (macro) task queue,
  3075. // but it is still a better choice than setTimeout.
  3076. timerFunc = function () {
  3077. setImmediate(flushCallbacks);
  3078. };
  3079. } else {
  3080. // Fallback to setTimeout.
  3081. timerFunc = function () {
  3082. setTimeout(flushCallbacks, 0);
  3083. };
  3084. }
  3085. function nextTick (cb, ctx) {
  3086. var _resolve;
  3087. callbacks.push(function () {
  3088. if (cb) {
  3089. try {
  3090. cb.call(ctx);
  3091. } catch (e) {
  3092. handleError(e, ctx, 'nextTick');
  3093. }
  3094. } else if (_resolve) {
  3095. _resolve(ctx);
  3096. }
  3097. });
  3098. if (!pending) {
  3099. pending = true;
  3100. timerFunc();
  3101. }
  3102. // $flow-disable-line
  3103. if (!cb && typeof Promise !== 'undefined') {
  3104. return new Promise(function (resolve) {
  3105. _resolve = resolve;
  3106. })
  3107. }
  3108. }
  3109. /* */
  3110. /* not type checking this file because flow doesn't play well with Proxy */
  3111. var initProxy;
  3112. if (true) {
  3113. var allowedGlobals = makeMap(
  3114. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  3115. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  3116. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  3117. 'require' // for Webpack/Browserify
  3118. );
  3119. var warnNonPresent = function (target, key) {
  3120. warn(
  3121. "Property or method \"" + key + "\" is not defined on the instance but " +
  3122. 'referenced during render. Make sure that this property is reactive, ' +
  3123. 'either in the data option, or for class-based components, by ' +
  3124. 'initializing the property. ' +
  3125. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  3126. target
  3127. );
  3128. };
  3129. var warnReservedPrefix = function (target, key) {
  3130. warn(
  3131. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  3132. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  3133. 'prevent conflicts with Vue internals. ' +
  3134. 'See: https://vuejs.org/v2/api/#data',
  3135. target
  3136. );
  3137. };
  3138. var hasProxy =
  3139. typeof Proxy !== 'undefined' && isNative(Proxy);
  3140. if (hasProxy) {
  3141. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  3142. config.keyCodes = new Proxy(config.keyCodes, {
  3143. set: function set (target, key, value) {
  3144. if (isBuiltInModifier(key)) {
  3145. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  3146. return false
  3147. } else {
  3148. target[key] = value;
  3149. return true
  3150. }
  3151. }
  3152. });
  3153. }
  3154. var hasHandler = {
  3155. has: function has (target, key) {
  3156. var has = key in target;
  3157. var isAllowed = allowedGlobals(key) ||
  3158. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  3159. if (!has && !isAllowed) {
  3160. if (key in target.$data) { warnReservedPrefix(target, key); }
  3161. else { warnNonPresent(target, key); }
  3162. }
  3163. return has || !isAllowed
  3164. }
  3165. };
  3166. var getHandler = {
  3167. get: function get (target, key) {
  3168. if (typeof key === 'string' && !(key in target)) {
  3169. if (key in target.$data) { warnReservedPrefix(target, key); }
  3170. else { warnNonPresent(target, key); }
  3171. }
  3172. return target[key]
  3173. }
  3174. };
  3175. initProxy = function initProxy (vm) {
  3176. if (hasProxy) {
  3177. // determine which proxy handler to use
  3178. var options = vm.$options;
  3179. var handlers = options.render && options.render._withStripped
  3180. ? getHandler
  3181. : hasHandler;
  3182. vm._renderProxy = new Proxy(vm, handlers);
  3183. } else {
  3184. vm._renderProxy = vm;
  3185. }
  3186. };
  3187. }
  3188. /* */
  3189. var seenObjects = new _Set();
  3190. /**
  3191. * Recursively traverse an object to evoke all converted
  3192. * getters, so that every nested property inside the object
  3193. * is collected as a "deep" dependency.
  3194. */
  3195. function traverse (val) {
  3196. _traverse(val, seenObjects);
  3197. seenObjects.clear();
  3198. }
  3199. function _traverse (val, seen) {
  3200. var i, keys;
  3201. var isA = Array.isArray(val);
  3202. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  3203. return
  3204. }
  3205. if (val.__ob__) {
  3206. var depId = val.__ob__.dep.id;
  3207. if (seen.has(depId)) {
  3208. return
  3209. }
  3210. seen.add(depId);
  3211. }
  3212. if (isA) {
  3213. i = val.length;
  3214. while (i--) { _traverse(val[i], seen); }
  3215. } else {
  3216. keys = Object.keys(val);
  3217. i = keys.length;
  3218. while (i--) { _traverse(val[keys[i]], seen); }
  3219. }
  3220. }
  3221. var mark;
  3222. var measure;
  3223. if (true) {
  3224. var perf = inBrowser && window.performance;
  3225. /* istanbul ignore if */
  3226. if (
  3227. perf &&
  3228. perf.mark &&
  3229. perf.measure &&
  3230. perf.clearMarks &&
  3231. perf.clearMeasures
  3232. ) {
  3233. mark = function (tag) { return perf.mark(tag); };
  3234. measure = function (name, startTag, endTag) {
  3235. perf.measure(name, startTag, endTag);
  3236. perf.clearMarks(startTag);
  3237. perf.clearMarks(endTag);
  3238. // perf.clearMeasures(name)
  3239. };
  3240. }
  3241. }
  3242. /* */
  3243. var normalizeEvent = cached(function (name) {
  3244. var passive = name.charAt(0) === '&';
  3245. name = passive ? name.slice(1) : name;
  3246. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  3247. name = once$$1 ? name.slice(1) : name;
  3248. var capture = name.charAt(0) === '!';
  3249. name = capture ? name.slice(1) : name;
  3250. return {
  3251. name: name,
  3252. once: once$$1,
  3253. capture: capture,
  3254. passive: passive
  3255. }
  3256. });
  3257. function createFnInvoker (fns, vm) {
  3258. function invoker () {
  3259. var arguments$1 = arguments;
  3260. var fns = invoker.fns;
  3261. if (Array.isArray(fns)) {
  3262. var cloned = fns.slice();
  3263. for (var i = 0; i < cloned.length; i++) {
  3264. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  3265. }
  3266. } else {
  3267. // return handler return value for single handlers
  3268. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  3269. }
  3270. }
  3271. invoker.fns = fns;
  3272. return invoker
  3273. }
  3274. function updateListeners (
  3275. on,
  3276. oldOn,
  3277. add,
  3278. remove$$1,
  3279. createOnceHandler,
  3280. vm
  3281. ) {
  3282. var name, def$$1, cur, old, event;
  3283. for (name in on) {
  3284. def$$1 = cur = on[name];
  3285. old = oldOn[name];
  3286. event = normalizeEvent(name);
  3287. if (isUndef(cur)) {
  3288. true && warn(
  3289. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  3290. vm
  3291. );
  3292. } else if (isUndef(old)) {
  3293. if (isUndef(cur.fns)) {
  3294. cur = on[name] = createFnInvoker(cur, vm);
  3295. }
  3296. if (isTrue(event.once)) {
  3297. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  3298. }
  3299. add(event.name, cur, event.capture, event.passive, event.params);
  3300. } else if (cur !== old) {
  3301. old.fns = cur;
  3302. on[name] = old;
  3303. }
  3304. }
  3305. for (name in oldOn) {
  3306. if (isUndef(on[name])) {
  3307. event = normalizeEvent(name);
  3308. remove$$1(event.name, oldOn[name], event.capture);
  3309. }
  3310. }
  3311. }
  3312. /* */
  3313. /* */
  3314. // fixed by xxxxxx (mp properties)
  3315. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  3316. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  3317. if (isUndef(propOptions)) {
  3318. return res
  3319. }
  3320. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  3321. var attrs = data.attrs;
  3322. var props = data.props;
  3323. if (isDef(attrs) || isDef(props)) {
  3324. for (var key in propOptions) {
  3325. var altKey = hyphenate(key);
  3326. var result = checkProp(res, props, key, altKey, true) ||
  3327. checkProp(res, attrs, key, altKey, false);
  3328. // externalClass
  3329. if (
  3330. result &&
  3331. res[key] &&
  3332. externalClasses.indexOf(altKey) !== -1 &&
  3333. context[camelize(res[key])]
  3334. ) {
  3335. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  3336. res[key] = context[camelize(res[key])];
  3337. }
  3338. }
  3339. }
  3340. return res
  3341. }
  3342. function extractPropsFromVNodeData (
  3343. data,
  3344. Ctor,
  3345. tag,
  3346. context// fixed by xxxxxx
  3347. ) {
  3348. // we are only extracting raw values here.
  3349. // validation and default values are handled in the child
  3350. // component itself.
  3351. var propOptions = Ctor.options.props;
  3352. if (isUndef(propOptions)) {
  3353. // fixed by xxxxxx
  3354. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  3355. }
  3356. var res = {};
  3357. var attrs = data.attrs;
  3358. var props = data.props;
  3359. if (isDef(attrs) || isDef(props)) {
  3360. for (var key in propOptions) {
  3361. var altKey = hyphenate(key);
  3362. if (true) {
  3363. var keyInLowerCase = key.toLowerCase();
  3364. if (
  3365. key !== keyInLowerCase &&
  3366. attrs && hasOwn(attrs, keyInLowerCase)
  3367. ) {
  3368. tip(
  3369. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  3370. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  3371. " \"" + key + "\". " +
  3372. "Note that HTML attributes are case-insensitive and camelCased " +
  3373. "props need to use their kebab-case equivalents when using in-DOM " +
  3374. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  3375. );
  3376. }
  3377. }
  3378. checkProp(res, props, key, altKey, true) ||
  3379. checkProp(res, attrs, key, altKey, false);
  3380. }
  3381. }
  3382. // fixed by xxxxxx
  3383. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  3384. }
  3385. function checkProp (
  3386. res,
  3387. hash,
  3388. key,
  3389. altKey,
  3390. preserve
  3391. ) {
  3392. if (isDef(hash)) {
  3393. if (hasOwn(hash, key)) {
  3394. res[key] = hash[key];
  3395. if (!preserve) {
  3396. delete hash[key];
  3397. }
  3398. return true
  3399. } else if (hasOwn(hash, altKey)) {
  3400. res[key] = hash[altKey];
  3401. if (!preserve) {
  3402. delete hash[altKey];
  3403. }
  3404. return true
  3405. }
  3406. }
  3407. return false
  3408. }
  3409. /* */
  3410. // The template compiler attempts to minimize the need for normalization by
  3411. // statically analyzing the template at compile time.
  3412. //
  3413. // For plain HTML markup, normalization can be completely skipped because the
  3414. // generated render function is guaranteed to return Array<VNode>. There are
  3415. // two cases where extra normalization is needed:
  3416. // 1. When the children contains components - because a functional component
  3417. // may return an Array instead of a single root. In this case, just a simple
  3418. // normalization is needed - if any child is an Array, we flatten the whole
  3419. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  3420. // because functional components already normalize their own children.
  3421. function simpleNormalizeChildren (children) {
  3422. for (var i = 0; i < children.length; i++) {
  3423. if (Array.isArray(children[i])) {
  3424. return Array.prototype.concat.apply([], children)
  3425. }
  3426. }
  3427. return children
  3428. }
  3429. // 2. When the children contains constructs that always generated nested Arrays,
  3430. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  3431. // with hand-written render functions / JSX. In such cases a full normalization
  3432. // is needed to cater to all possible types of children values.
  3433. function normalizeChildren (children) {
  3434. return isPrimitive(children)
  3435. ? [createTextVNode(children)]
  3436. : Array.isArray(children)
  3437. ? normalizeArrayChildren(children)
  3438. : undefined
  3439. }
  3440. function isTextNode (node) {
  3441. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  3442. }
  3443. function normalizeArrayChildren (children, nestedIndex) {
  3444. var res = [];
  3445. var i, c, lastIndex, last;
  3446. for (i = 0; i < children.length; i++) {
  3447. c = children[i];
  3448. if (isUndef(c) || typeof c === 'boolean') { continue }
  3449. lastIndex = res.length - 1;
  3450. last = res[lastIndex];
  3451. // nested
  3452. if (Array.isArray(c)) {
  3453. if (c.length > 0) {
  3454. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  3455. // merge adjacent text nodes
  3456. if (isTextNode(c[0]) && isTextNode(last)) {
  3457. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  3458. c.shift();
  3459. }
  3460. res.push.apply(res, c);
  3461. }
  3462. } else if (isPrimitive(c)) {
  3463. if (isTextNode(last)) {
  3464. // merge adjacent text nodes
  3465. // this is necessary for SSR hydration because text nodes are
  3466. // essentially merged when rendered to HTML strings
  3467. res[lastIndex] = createTextVNode(last.text + c);
  3468. } else if (c !== '') {
  3469. // convert primitive to vnode
  3470. res.push(createTextVNode(c));
  3471. }
  3472. } else {
  3473. if (isTextNode(c) && isTextNode(last)) {
  3474. // merge adjacent text nodes
  3475. res[lastIndex] = createTextVNode(last.text + c.text);
  3476. } else {
  3477. // default key for nested array children (likely generated by v-for)
  3478. if (isTrue(children._isVList) &&
  3479. isDef(c.tag) &&
  3480. isUndef(c.key) &&
  3481. isDef(nestedIndex)) {
  3482. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  3483. }
  3484. res.push(c);
  3485. }
  3486. }
  3487. }
  3488. return res
  3489. }
  3490. /* */
  3491. function initProvide (vm) {
  3492. var provide = vm.$options.provide;
  3493. if (provide) {
  3494. vm._provided = typeof provide === 'function'
  3495. ? provide.call(vm)
  3496. : provide;
  3497. }
  3498. }
  3499. function initInjections (vm) {
  3500. var result = resolveInject(vm.$options.inject, vm);
  3501. if (result) {
  3502. toggleObserving(false);
  3503. Object.keys(result).forEach(function (key) {
  3504. /* istanbul ignore else */
  3505. if (true) {
  3506. defineReactive$$1(vm, key, result[key], function () {
  3507. warn(
  3508. "Avoid mutating an injected value directly since the changes will be " +
  3509. "overwritten whenever the provided component re-renders. " +
  3510. "injection being mutated: \"" + key + "\"",
  3511. vm
  3512. );
  3513. });
  3514. } else {}
  3515. });
  3516. toggleObserving(true);
  3517. }
  3518. }
  3519. function resolveInject (inject, vm) {
  3520. if (inject) {
  3521. // inject is :any because flow is not smart enough to figure out cached
  3522. var result = Object.create(null);
  3523. var keys = hasSymbol
  3524. ? Reflect.ownKeys(inject)
  3525. : Object.keys(inject);
  3526. for (var i = 0; i < keys.length; i++) {
  3527. var key = keys[i];
  3528. // #6574 in case the inject object is observed...
  3529. if (key === '__ob__') { continue }
  3530. var provideKey = inject[key].from;
  3531. var source = vm;
  3532. while (source) {
  3533. if (source._provided && hasOwn(source._provided, provideKey)) {
  3534. result[key] = source._provided[provideKey];
  3535. break
  3536. }
  3537. source = source.$parent;
  3538. }
  3539. if (!source) {
  3540. if ('default' in inject[key]) {
  3541. var provideDefault = inject[key].default;
  3542. result[key] = typeof provideDefault === 'function'
  3543. ? provideDefault.call(vm)
  3544. : provideDefault;
  3545. } else if (true) {
  3546. warn(("Injection \"" + key + "\" not found"), vm);
  3547. }
  3548. }
  3549. }
  3550. return result
  3551. }
  3552. }
  3553. /* */
  3554. /**
  3555. * Runtime helper for resolving raw children VNodes into a slot object.
  3556. */
  3557. function resolveSlots (
  3558. children,
  3559. context
  3560. ) {
  3561. if (!children || !children.length) {
  3562. return {}
  3563. }
  3564. var slots = {};
  3565. for (var i = 0, l = children.length; i < l; i++) {
  3566. var child = children[i];
  3567. var data = child.data;
  3568. // remove slot attribute if the node is resolved as a Vue slot node
  3569. if (data && data.attrs && data.attrs.slot) {
  3570. delete data.attrs.slot;
  3571. }
  3572. // named slots should only be respected if the vnode was rendered in the
  3573. // same context.
  3574. if ((child.context === context || child.fnContext === context) &&
  3575. data && data.slot != null
  3576. ) {
  3577. var name = data.slot;
  3578. var slot = (slots[name] || (slots[name] = []));
  3579. if (child.tag === 'template') {
  3580. slot.push.apply(slot, child.children || []);
  3581. } else {
  3582. slot.push(child);
  3583. }
  3584. } else {
  3585. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  3586. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  3587. (slots['page'] || (slots['page'] = [])).push(child);
  3588. }else{
  3589. (slots.default || (slots.default = [])).push(child);
  3590. }
  3591. }
  3592. }
  3593. // ignore slots that contains only whitespace
  3594. for (var name$1 in slots) {
  3595. if (slots[name$1].every(isWhitespace)) {
  3596. delete slots[name$1];
  3597. }
  3598. }
  3599. return slots
  3600. }
  3601. function isWhitespace (node) {
  3602. return (node.isComment && !node.asyncFactory) || node.text === ' '
  3603. }
  3604. /* */
  3605. function normalizeScopedSlots (
  3606. slots,
  3607. normalSlots,
  3608. prevSlots
  3609. ) {
  3610. var res;
  3611. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  3612. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  3613. var key = slots && slots.$key;
  3614. if (!slots) {
  3615. res = {};
  3616. } else if (slots._normalized) {
  3617. // fast path 1: child component re-render only, parent did not change
  3618. return slots._normalized
  3619. } else if (
  3620. isStable &&
  3621. prevSlots &&
  3622. prevSlots !== emptyObject &&
  3623. key === prevSlots.$key &&
  3624. !hasNormalSlots &&
  3625. !prevSlots.$hasNormal
  3626. ) {
  3627. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  3628. // only need to normalize once
  3629. return prevSlots
  3630. } else {
  3631. res = {};
  3632. for (var key$1 in slots) {
  3633. if (slots[key$1] && key$1[0] !== '$') {
  3634. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  3635. }
  3636. }
  3637. }
  3638. // expose normal slots on scopedSlots
  3639. for (var key$2 in normalSlots) {
  3640. if (!(key$2 in res)) {
  3641. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  3642. }
  3643. }
  3644. // avoriaz seems to mock a non-extensible $scopedSlots object
  3645. // and when that is passed down this would cause an error
  3646. if (slots && Object.isExtensible(slots)) {
  3647. (slots)._normalized = res;
  3648. }
  3649. def(res, '$stable', isStable);
  3650. def(res, '$key', key);
  3651. def(res, '$hasNormal', hasNormalSlots);
  3652. return res
  3653. }
  3654. function normalizeScopedSlot(normalSlots, key, fn) {
  3655. var normalized = function () {
  3656. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  3657. res = res && typeof res === 'object' && !Array.isArray(res)
  3658. ? [res] // single vnode
  3659. : normalizeChildren(res);
  3660. return res && (
  3661. res.length === 0 ||
  3662. (res.length === 1 && res[0].isComment) // #9658
  3663. ) ? undefined
  3664. : res
  3665. };
  3666. // this is a slot using the new v-slot syntax without scope. although it is
  3667. // compiled as a scoped slot, render fn users would expect it to be present
  3668. // on this.$slots because the usage is semantically a normal slot.
  3669. if (fn.proxy) {
  3670. Object.defineProperty(normalSlots, key, {
  3671. get: normalized,
  3672. enumerable: true,
  3673. configurable: true
  3674. });
  3675. }
  3676. return normalized
  3677. }
  3678. function proxyNormalSlot(slots, key) {
  3679. return function () { return slots[key]; }
  3680. }
  3681. /* */
  3682. /**
  3683. * Runtime helper for rendering v-for lists.
  3684. */
  3685. function renderList (
  3686. val,
  3687. render
  3688. ) {
  3689. var ret, i, l, keys, key;
  3690. if (Array.isArray(val) || typeof val === 'string') {
  3691. ret = new Array(val.length);
  3692. for (i = 0, l = val.length; i < l; i++) {
  3693. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  3694. }
  3695. } else if (typeof val === 'number') {
  3696. ret = new Array(val);
  3697. for (i = 0; i < val; i++) {
  3698. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  3699. }
  3700. } else if (isObject(val)) {
  3701. if (hasSymbol && val[Symbol.iterator]) {
  3702. ret = [];
  3703. var iterator = val[Symbol.iterator]();
  3704. var result = iterator.next();
  3705. while (!result.done) {
  3706. ret.push(render(result.value, ret.length, i++, i)); // fixed by xxxxxx
  3707. result = iterator.next();
  3708. }
  3709. } else {
  3710. keys = Object.keys(val);
  3711. ret = new Array(keys.length);
  3712. for (i = 0, l = keys.length; i < l; i++) {
  3713. key = keys[i];
  3714. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  3715. }
  3716. }
  3717. }
  3718. if (!isDef(ret)) {
  3719. ret = [];
  3720. }
  3721. (ret)._isVList = true;
  3722. return ret
  3723. }
  3724. /* */
  3725. /**
  3726. * Runtime helper for rendering <slot>
  3727. */
  3728. function renderSlot (
  3729. name,
  3730. fallback,
  3731. props,
  3732. bindObject
  3733. ) {
  3734. var scopedSlotFn = this.$scopedSlots[name];
  3735. var nodes;
  3736. if (scopedSlotFn) { // scoped slot
  3737. props = props || {};
  3738. if (bindObject) {
  3739. if ( true && !isObject(bindObject)) {
  3740. warn(
  3741. 'slot v-bind without argument expects an Object',
  3742. this
  3743. );
  3744. }
  3745. props = extend(extend({}, bindObject), props);
  3746. }
  3747. // fixed by xxxxxx app-plus scopedSlot
  3748. nodes = scopedSlotFn(props, this, props._i) || fallback;
  3749. } else {
  3750. nodes = this.$slots[name] || fallback;
  3751. }
  3752. var target = props && props.slot;
  3753. if (target) {
  3754. return this.$createElement('template', { slot: target }, nodes)
  3755. } else {
  3756. return nodes
  3757. }
  3758. }
  3759. /* */
  3760. /**
  3761. * Runtime helper for resolving filters
  3762. */
  3763. function resolveFilter (id) {
  3764. return resolveAsset(this.$options, 'filters', id, true) || identity
  3765. }
  3766. /* */
  3767. function isKeyNotMatch (expect, actual) {
  3768. if (Array.isArray(expect)) {
  3769. return expect.indexOf(actual) === -1
  3770. } else {
  3771. return expect !== actual
  3772. }
  3773. }
  3774. /**
  3775. * Runtime helper for checking keyCodes from config.
  3776. * exposed as Vue.prototype._k
  3777. * passing in eventKeyName as last argument separately for backwards compat
  3778. */
  3779. function checkKeyCodes (
  3780. eventKeyCode,
  3781. key,
  3782. builtInKeyCode,
  3783. eventKeyName,
  3784. builtInKeyName
  3785. ) {
  3786. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  3787. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  3788. return isKeyNotMatch(builtInKeyName, eventKeyName)
  3789. } else if (mappedKeyCode) {
  3790. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  3791. } else if (eventKeyName) {
  3792. return hyphenate(eventKeyName) !== key
  3793. }
  3794. }
  3795. /* */
  3796. /**
  3797. * Runtime helper for merging v-bind="object" into a VNode's data.
  3798. */
  3799. function bindObjectProps (
  3800. data,
  3801. tag,
  3802. value,
  3803. asProp,
  3804. isSync
  3805. ) {
  3806. if (value) {
  3807. if (!isObject(value)) {
  3808. true && warn(
  3809. 'v-bind without argument expects an Object or Array value',
  3810. this
  3811. );
  3812. } else {
  3813. if (Array.isArray(value)) {
  3814. value = toObject(value);
  3815. }
  3816. var hash;
  3817. var loop = function ( key ) {
  3818. if (
  3819. key === 'class' ||
  3820. key === 'style' ||
  3821. isReservedAttribute(key)
  3822. ) {
  3823. hash = data;
  3824. } else {
  3825. var type = data.attrs && data.attrs.type;
  3826. hash = asProp || config.mustUseProp(tag, type, key)
  3827. ? data.domProps || (data.domProps = {})
  3828. : data.attrs || (data.attrs = {});
  3829. }
  3830. var camelizedKey = camelize(key);
  3831. var hyphenatedKey = hyphenate(key);
  3832. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  3833. hash[key] = value[key];
  3834. if (isSync) {
  3835. var on = data.on || (data.on = {});
  3836. on[("update:" + key)] = function ($event) {
  3837. value[key] = $event;
  3838. };
  3839. }
  3840. }
  3841. };
  3842. for (var key in value) loop( key );
  3843. }
  3844. }
  3845. return data
  3846. }
  3847. /* */
  3848. /**
  3849. * Runtime helper for rendering static trees.
  3850. */
  3851. function renderStatic (
  3852. index,
  3853. isInFor
  3854. ) {
  3855. var cached = this._staticTrees || (this._staticTrees = []);
  3856. var tree = cached[index];
  3857. // if has already-rendered static tree and not inside v-for,
  3858. // we can reuse the same tree.
  3859. if (tree && !isInFor) {
  3860. return tree
  3861. }
  3862. // otherwise, render a fresh tree.
  3863. tree = cached[index] = this.$options.staticRenderFns[index].call(
  3864. this._renderProxy,
  3865. null,
  3866. this // for render fns generated for functional component templates
  3867. );
  3868. markStatic(tree, ("__static__" + index), false);
  3869. return tree
  3870. }
  3871. /**
  3872. * Runtime helper for v-once.
  3873. * Effectively it means marking the node as static with a unique key.
  3874. */
  3875. function markOnce (
  3876. tree,
  3877. index,
  3878. key
  3879. ) {
  3880. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  3881. return tree
  3882. }
  3883. function markStatic (
  3884. tree,
  3885. key,
  3886. isOnce
  3887. ) {
  3888. if (Array.isArray(tree)) {
  3889. for (var i = 0; i < tree.length; i++) {
  3890. if (tree[i] && typeof tree[i] !== 'string') {
  3891. markStaticNode(tree[i], (key + "_" + i), isOnce);
  3892. }
  3893. }
  3894. } else {
  3895. markStaticNode(tree, key, isOnce);
  3896. }
  3897. }
  3898. function markStaticNode (node, key, isOnce) {
  3899. node.isStatic = true;
  3900. node.key = key;
  3901. node.isOnce = isOnce;
  3902. }
  3903. /* */
  3904. function bindObjectListeners (data, value) {
  3905. if (value) {
  3906. if (!isPlainObject(value)) {
  3907. true && warn(
  3908. 'v-on without argument expects an Object value',
  3909. this
  3910. );
  3911. } else {
  3912. var on = data.on = data.on ? extend({}, data.on) : {};
  3913. for (var key in value) {
  3914. var existing = on[key];
  3915. var ours = value[key];
  3916. on[key] = existing ? [].concat(existing, ours) : ours;
  3917. }
  3918. }
  3919. }
  3920. return data
  3921. }
  3922. /* */
  3923. function resolveScopedSlots (
  3924. fns, // see flow/vnode
  3925. res,
  3926. // the following are added in 2.6
  3927. hasDynamicKeys,
  3928. contentHashKey
  3929. ) {
  3930. res = res || { $stable: !hasDynamicKeys };
  3931. for (var i = 0; i < fns.length; i++) {
  3932. var slot = fns[i];
  3933. if (Array.isArray(slot)) {
  3934. resolveScopedSlots(slot, res, hasDynamicKeys);
  3935. } else if (slot) {
  3936. // marker for reverse proxying v-slot without scope on this.$slots
  3937. if (slot.proxy) {
  3938. slot.fn.proxy = true;
  3939. }
  3940. res[slot.key] = slot.fn;
  3941. }
  3942. }
  3943. if (contentHashKey) {
  3944. (res).$key = contentHashKey;
  3945. }
  3946. return res
  3947. }
  3948. /* */
  3949. function bindDynamicKeys (baseObj, values) {
  3950. for (var i = 0; i < values.length; i += 2) {
  3951. var key = values[i];
  3952. if (typeof key === 'string' && key) {
  3953. baseObj[values[i]] = values[i + 1];
  3954. } else if ( true && key !== '' && key !== null) {
  3955. // null is a special value for explicitly removing a binding
  3956. warn(
  3957. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  3958. this
  3959. );
  3960. }
  3961. }
  3962. return baseObj
  3963. }
  3964. // helper to dynamically append modifier runtime markers to event names.
  3965. // ensure only append when value is already string, otherwise it will be cast
  3966. // to string and cause the type check to miss.
  3967. function prependModifier (value, symbol) {
  3968. return typeof value === 'string' ? symbol + value : value
  3969. }
  3970. /* */
  3971. function installRenderHelpers (target) {
  3972. target._o = markOnce;
  3973. target._n = toNumber;
  3974. target._s = toString;
  3975. target._l = renderList;
  3976. target._t = renderSlot;
  3977. target._q = looseEqual;
  3978. target._i = looseIndexOf;
  3979. target._m = renderStatic;
  3980. target._f = resolveFilter;
  3981. target._k = checkKeyCodes;
  3982. target._b = bindObjectProps;
  3983. target._v = createTextVNode;
  3984. target._e = createEmptyVNode;
  3985. target._u = resolveScopedSlots;
  3986. target._g = bindObjectListeners;
  3987. target._d = bindDynamicKeys;
  3988. target._p = prependModifier;
  3989. }
  3990. /* */
  3991. function FunctionalRenderContext (
  3992. data,
  3993. props,
  3994. children,
  3995. parent,
  3996. Ctor
  3997. ) {
  3998. var this$1 = this;
  3999. var options = Ctor.options;
  4000. // ensure the createElement function in functional components
  4001. // gets a unique context - this is necessary for correct named slot check
  4002. var contextVm;
  4003. if (hasOwn(parent, '_uid')) {
  4004. contextVm = Object.create(parent);
  4005. // $flow-disable-line
  4006. contextVm._original = parent;
  4007. } else {
  4008. // the context vm passed in is a functional context as well.
  4009. // in this case we want to make sure we are able to get a hold to the
  4010. // real context instance.
  4011. contextVm = parent;
  4012. // $flow-disable-line
  4013. parent = parent._original;
  4014. }
  4015. var isCompiled = isTrue(options._compiled);
  4016. var needNormalization = !isCompiled;
  4017. this.data = data;
  4018. this.props = props;
  4019. this.children = children;
  4020. this.parent = parent;
  4021. this.listeners = data.on || emptyObject;
  4022. this.injections = resolveInject(options.inject, parent);
  4023. this.slots = function () {
  4024. if (!this$1.$slots) {
  4025. normalizeScopedSlots(
  4026. data.scopedSlots,
  4027. this$1.$slots = resolveSlots(children, parent)
  4028. );
  4029. }
  4030. return this$1.$slots
  4031. };
  4032. Object.defineProperty(this, 'scopedSlots', ({
  4033. enumerable: true,
  4034. get: function get () {
  4035. return normalizeScopedSlots(data.scopedSlots, this.slots())
  4036. }
  4037. }));
  4038. // support for compiled functional template
  4039. if (isCompiled) {
  4040. // exposing $options for renderStatic()
  4041. this.$options = options;
  4042. // pre-resolve slots for renderSlot()
  4043. this.$slots = this.slots();
  4044. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  4045. }
  4046. if (options._scopeId) {
  4047. this._c = function (a, b, c, d) {
  4048. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  4049. if (vnode && !Array.isArray(vnode)) {
  4050. vnode.fnScopeId = options._scopeId;
  4051. vnode.fnContext = parent;
  4052. }
  4053. return vnode
  4054. };
  4055. } else {
  4056. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  4057. }
  4058. }
  4059. installRenderHelpers(FunctionalRenderContext.prototype);
  4060. function createFunctionalComponent (
  4061. Ctor,
  4062. propsData,
  4063. data,
  4064. contextVm,
  4065. children
  4066. ) {
  4067. var options = Ctor.options;
  4068. var props = {};
  4069. var propOptions = options.props;
  4070. if (isDef(propOptions)) {
  4071. for (var key in propOptions) {
  4072. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  4073. }
  4074. } else {
  4075. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  4076. if (isDef(data.props)) { mergeProps(props, data.props); }
  4077. }
  4078. var renderContext = new FunctionalRenderContext(
  4079. data,
  4080. props,
  4081. children,
  4082. contextVm,
  4083. Ctor
  4084. );
  4085. var vnode = options.render.call(null, renderContext._c, renderContext);
  4086. if (vnode instanceof VNode) {
  4087. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  4088. } else if (Array.isArray(vnode)) {
  4089. var vnodes = normalizeChildren(vnode) || [];
  4090. var res = new Array(vnodes.length);
  4091. for (var i = 0; i < vnodes.length; i++) {
  4092. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  4093. }
  4094. return res
  4095. }
  4096. }
  4097. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  4098. // #7817 clone node before setting fnContext, otherwise if the node is reused
  4099. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  4100. // that should not be matched to match.
  4101. var clone = cloneVNode(vnode);
  4102. clone.fnContext = contextVm;
  4103. clone.fnOptions = options;
  4104. if (true) {
  4105. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  4106. }
  4107. if (data.slot) {
  4108. (clone.data || (clone.data = {})).slot = data.slot;
  4109. }
  4110. return clone
  4111. }
  4112. function mergeProps (to, from) {
  4113. for (var key in from) {
  4114. to[camelize(key)] = from[key];
  4115. }
  4116. }
  4117. /* */
  4118. /* */
  4119. /* */
  4120. /* */
  4121. // inline hooks to be invoked on component VNodes during patch
  4122. var componentVNodeHooks = {
  4123. init: function init (vnode, hydrating) {
  4124. if (
  4125. vnode.componentInstance &&
  4126. !vnode.componentInstance._isDestroyed &&
  4127. vnode.data.keepAlive
  4128. ) {
  4129. // kept-alive components, treat as a patch
  4130. var mountedNode = vnode; // work around flow
  4131. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  4132. } else {
  4133. var child = vnode.componentInstance = createComponentInstanceForVnode(
  4134. vnode,
  4135. activeInstance
  4136. );
  4137. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  4138. }
  4139. },
  4140. prepatch: function prepatch (oldVnode, vnode) {
  4141. var options = vnode.componentOptions;
  4142. var child = vnode.componentInstance = oldVnode.componentInstance;
  4143. updateChildComponent(
  4144. child,
  4145. options.propsData, // updated props
  4146. options.listeners, // updated listeners
  4147. vnode, // new parent vnode
  4148. options.children // new children
  4149. );
  4150. },
  4151. insert: function insert (vnode) {
  4152. var context = vnode.context;
  4153. var componentInstance = vnode.componentInstance;
  4154. if (!componentInstance._isMounted) {
  4155. callHook(componentInstance, 'onServiceCreated');
  4156. callHook(componentInstance, 'onServiceAttached');
  4157. componentInstance._isMounted = true;
  4158. callHook(componentInstance, 'mounted');
  4159. }
  4160. if (vnode.data.keepAlive) {
  4161. if (context._isMounted) {
  4162. // vue-router#1212
  4163. // During updates, a kept-alive component's child components may
  4164. // change, so directly walking the tree here may call activated hooks
  4165. // on incorrect children. Instead we push them into a queue which will
  4166. // be processed after the whole patch process ended.
  4167. queueActivatedComponent(componentInstance);
  4168. } else {
  4169. activateChildComponent(componentInstance, true /* direct */);
  4170. }
  4171. }
  4172. },
  4173. destroy: function destroy (vnode) {
  4174. var componentInstance = vnode.componentInstance;
  4175. if (!componentInstance._isDestroyed) {
  4176. if (!vnode.data.keepAlive) {
  4177. componentInstance.$destroy();
  4178. } else {
  4179. deactivateChildComponent(componentInstance, true /* direct */);
  4180. }
  4181. }
  4182. }
  4183. };
  4184. var hooksToMerge = Object.keys(componentVNodeHooks);
  4185. function createComponent (
  4186. Ctor,
  4187. data,
  4188. context,
  4189. children,
  4190. tag
  4191. ) {
  4192. if (isUndef(Ctor)) {
  4193. return
  4194. }
  4195. var baseCtor = context.$options._base;
  4196. // plain options object: turn it into a constructor
  4197. if (isObject(Ctor)) {
  4198. Ctor = baseCtor.extend(Ctor);
  4199. }
  4200. // if at this stage it's not a constructor or an async component factory,
  4201. // reject.
  4202. if (typeof Ctor !== 'function') {
  4203. if (true) {
  4204. warn(("Invalid Component definition: " + (String(Ctor))), context);
  4205. }
  4206. return
  4207. }
  4208. // async component
  4209. var asyncFactory;
  4210. if (isUndef(Ctor.cid)) {
  4211. asyncFactory = Ctor;
  4212. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  4213. if (Ctor === undefined) {
  4214. // return a placeholder node for async component, which is rendered
  4215. // as a comment node but preserves all the raw information for the node.
  4216. // the information will be used for async server-rendering and hydration.
  4217. return createAsyncPlaceholder(
  4218. asyncFactory,
  4219. data,
  4220. context,
  4221. children,
  4222. tag
  4223. )
  4224. }
  4225. }
  4226. data = data || {};
  4227. // resolve constructor options in case global mixins are applied after
  4228. // component constructor creation
  4229. resolveConstructorOptions(Ctor);
  4230. // transform component v-model data into props & events
  4231. if (isDef(data.model)) {
  4232. transformModel(Ctor.options, data);
  4233. }
  4234. // extract props
  4235. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  4236. // functional component
  4237. if (isTrue(Ctor.options.functional)) {
  4238. return createFunctionalComponent(Ctor, propsData, data, context, children)
  4239. }
  4240. // extract listeners, since these needs to be treated as
  4241. // child component listeners instead of DOM listeners
  4242. var listeners = data.on;
  4243. // replace with listeners with .native modifier
  4244. // so it gets processed during parent component patch.
  4245. data.on = data.nativeOn;
  4246. if (isTrue(Ctor.options.abstract)) {
  4247. // abstract components do not keep anything
  4248. // other than props & listeners & slot
  4249. // work around flow
  4250. var slot = data.slot;
  4251. data = {};
  4252. if (slot) {
  4253. data.slot = slot;
  4254. }
  4255. }
  4256. // install component management hooks onto the placeholder node
  4257. installComponentHooks(data);
  4258. // return a placeholder vnode
  4259. var name = Ctor.options.name || tag;
  4260. var vnode = new VNode(
  4261. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  4262. data, undefined, undefined, undefined, context,
  4263. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  4264. asyncFactory
  4265. );
  4266. return vnode
  4267. }
  4268. function createComponentInstanceForVnode (
  4269. vnode, // we know it's MountedComponentVNode but flow doesn't
  4270. parent // activeInstance in lifecycle state
  4271. ) {
  4272. var options = {
  4273. _isComponent: true,
  4274. _parentVnode: vnode,
  4275. parent: parent
  4276. };
  4277. // check inline-template render functions
  4278. var inlineTemplate = vnode.data.inlineTemplate;
  4279. if (isDef(inlineTemplate)) {
  4280. options.render = inlineTemplate.render;
  4281. options.staticRenderFns = inlineTemplate.staticRenderFns;
  4282. }
  4283. return new vnode.componentOptions.Ctor(options)
  4284. }
  4285. function installComponentHooks (data) {
  4286. var hooks = data.hook || (data.hook = {});
  4287. for (var i = 0; i < hooksToMerge.length; i++) {
  4288. var key = hooksToMerge[i];
  4289. var existing = hooks[key];
  4290. var toMerge = componentVNodeHooks[key];
  4291. if (existing !== toMerge && !(existing && existing._merged)) {
  4292. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  4293. }
  4294. }
  4295. }
  4296. function mergeHook$1 (f1, f2) {
  4297. var merged = function (a, b) {
  4298. // flow complains about extra args which is why we use any
  4299. f1(a, b);
  4300. f2(a, b);
  4301. };
  4302. merged._merged = true;
  4303. return merged
  4304. }
  4305. // transform component v-model info (value and callback) into
  4306. // prop and event handler respectively.
  4307. function transformModel (options, data) {
  4308. var prop = (options.model && options.model.prop) || 'value';
  4309. var event = (options.model && options.model.event) || 'input'
  4310. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  4311. var on = data.on || (data.on = {});
  4312. var existing = on[event];
  4313. var callback = data.model.callback;
  4314. if (isDef(existing)) {
  4315. if (
  4316. Array.isArray(existing)
  4317. ? existing.indexOf(callback) === -1
  4318. : existing !== callback
  4319. ) {
  4320. on[event] = [callback].concat(existing);
  4321. }
  4322. } else {
  4323. on[event] = callback;
  4324. }
  4325. }
  4326. /* */
  4327. var SIMPLE_NORMALIZE = 1;
  4328. var ALWAYS_NORMALIZE = 2;
  4329. // wrapper function for providing a more flexible interface
  4330. // without getting yelled at by flow
  4331. function createElement (
  4332. context,
  4333. tag,
  4334. data,
  4335. children,
  4336. normalizationType,
  4337. alwaysNormalize
  4338. ) {
  4339. if (Array.isArray(data) || isPrimitive(data)) {
  4340. normalizationType = children;
  4341. children = data;
  4342. data = undefined;
  4343. }
  4344. if (isTrue(alwaysNormalize)) {
  4345. normalizationType = ALWAYS_NORMALIZE;
  4346. }
  4347. return _createElement(context, tag, data, children, normalizationType)
  4348. }
  4349. function _createElement (
  4350. context,
  4351. tag,
  4352. data,
  4353. children,
  4354. normalizationType
  4355. ) {
  4356. if (isDef(data) && isDef((data).__ob__)) {
  4357. true && warn(
  4358. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  4359. 'Always create fresh vnode data objects in each render!',
  4360. context
  4361. );
  4362. return createEmptyVNode()
  4363. }
  4364. // object syntax in v-bind
  4365. if (isDef(data) && isDef(data.is)) {
  4366. tag = data.is;
  4367. }
  4368. if (!tag) {
  4369. // in case of component :is set to falsy value
  4370. return createEmptyVNode()
  4371. }
  4372. // warn against non-primitive key
  4373. if ( true &&
  4374. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  4375. ) {
  4376. {
  4377. warn(
  4378. 'Avoid using non-primitive value as key, ' +
  4379. 'use string/number value instead.',
  4380. context
  4381. );
  4382. }
  4383. }
  4384. // support single function children as default scoped slot
  4385. if (Array.isArray(children) &&
  4386. typeof children[0] === 'function'
  4387. ) {
  4388. data = data || {};
  4389. data.scopedSlots = { default: children[0] };
  4390. children.length = 0;
  4391. }
  4392. if (normalizationType === ALWAYS_NORMALIZE) {
  4393. children = normalizeChildren(children);
  4394. } else if (normalizationType === SIMPLE_NORMALIZE) {
  4395. children = simpleNormalizeChildren(children);
  4396. }
  4397. var vnode, ns;
  4398. if (typeof tag === 'string') {
  4399. var Ctor;
  4400. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  4401. if (config.isReservedTag(tag)) {
  4402. // platform built-in elements
  4403. if ( true && isDef(data) && isDef(data.nativeOn)) {
  4404. warn(
  4405. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  4406. context
  4407. );
  4408. }
  4409. vnode = new VNode(
  4410. config.parsePlatformTagName(tag), data, children,
  4411. undefined, undefined, context
  4412. );
  4413. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  4414. // component
  4415. vnode = createComponent(Ctor, data, context, children, tag);
  4416. } else {
  4417. // unknown or unlisted namespaced elements
  4418. // check at runtime because it may get assigned a namespace when its
  4419. // parent normalizes children
  4420. vnode = new VNode(
  4421. tag, data, children,
  4422. undefined, undefined, context
  4423. );
  4424. }
  4425. } else {
  4426. // direct component options / constructor
  4427. vnode = createComponent(tag, data, context, children);
  4428. }
  4429. if (Array.isArray(vnode)) {
  4430. return vnode
  4431. } else if (isDef(vnode)) {
  4432. if (isDef(ns)) { applyNS(vnode, ns); }
  4433. if (isDef(data)) { registerDeepBindings(data); }
  4434. return vnode
  4435. } else {
  4436. return createEmptyVNode()
  4437. }
  4438. }
  4439. function applyNS (vnode, ns, force) {
  4440. vnode.ns = ns;
  4441. if (vnode.tag === 'foreignObject') {
  4442. // use default namespace inside foreignObject
  4443. ns = undefined;
  4444. force = true;
  4445. }
  4446. if (isDef(vnode.children)) {
  4447. for (var i = 0, l = vnode.children.length; i < l; i++) {
  4448. var child = vnode.children[i];
  4449. if (isDef(child.tag) && (
  4450. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  4451. applyNS(child, ns, force);
  4452. }
  4453. }
  4454. }
  4455. }
  4456. // ref #5318
  4457. // necessary to ensure parent re-render when deep bindings like :style and
  4458. // :class are used on slot nodes
  4459. function registerDeepBindings (data) {
  4460. if (isObject(data.style)) {
  4461. traverse(data.style);
  4462. }
  4463. if (isObject(data.class)) {
  4464. traverse(data.class);
  4465. }
  4466. }
  4467. /* */
  4468. function initRender (vm) {
  4469. vm._vnode = null; // the root of the child tree
  4470. vm._staticTrees = null; // v-once cached trees
  4471. var options = vm.$options;
  4472. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  4473. var renderContext = parentVnode && parentVnode.context;
  4474. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  4475. vm.$scopedSlots = emptyObject;
  4476. // bind the createElement fn to this instance
  4477. // so that we get proper render context inside it.
  4478. // args order: tag, data, children, normalizationType, alwaysNormalize
  4479. // internal version is used by render functions compiled from templates
  4480. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  4481. // normalization is always applied for the public version, used in
  4482. // user-written render functions.
  4483. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  4484. // $attrs & $listeners are exposed for easier HOC creation.
  4485. // they need to be reactive so that HOCs using them are always updated
  4486. var parentData = parentVnode && parentVnode.data;
  4487. /* istanbul ignore else */
  4488. if (true) {
  4489. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  4490. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  4491. }, true);
  4492. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  4493. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  4494. }, true);
  4495. } else {}
  4496. }
  4497. var currentRenderingInstance = null;
  4498. function renderMixin (Vue) {
  4499. // install runtime convenience helpers
  4500. installRenderHelpers(Vue.prototype);
  4501. Vue.prototype.$nextTick = function (fn) {
  4502. return nextTick(fn, this)
  4503. };
  4504. Vue.prototype._render = function () {
  4505. var vm = this;
  4506. var ref = vm.$options;
  4507. var render = ref.render;
  4508. var _parentVnode = ref._parentVnode;
  4509. if (_parentVnode) {
  4510. vm.$scopedSlots = normalizeScopedSlots(
  4511. _parentVnode.data.scopedSlots,
  4512. vm.$slots,
  4513. vm.$scopedSlots
  4514. );
  4515. }
  4516. // set parent vnode. this allows render functions to have access
  4517. // to the data on the placeholder node.
  4518. vm.$vnode = _parentVnode;
  4519. // render self
  4520. var vnode;
  4521. try {
  4522. // There's no need to maintain a stack because all render fns are called
  4523. // separately from one another. Nested component's render fns are called
  4524. // when parent component is patched.
  4525. currentRenderingInstance = vm;
  4526. vnode = render.call(vm._renderProxy, vm.$createElement);
  4527. } catch (e) {
  4528. handleError(e, vm, "render");
  4529. // return error render result,
  4530. // or previous vnode to prevent render error causing blank component
  4531. /* istanbul ignore else */
  4532. if ( true && vm.$options.renderError) {
  4533. try {
  4534. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  4535. } catch (e) {
  4536. handleError(e, vm, "renderError");
  4537. vnode = vm._vnode;
  4538. }
  4539. } else {
  4540. vnode = vm._vnode;
  4541. }
  4542. } finally {
  4543. currentRenderingInstance = null;
  4544. }
  4545. // if the returned array contains only a single node, allow it
  4546. if (Array.isArray(vnode) && vnode.length === 1) {
  4547. vnode = vnode[0];
  4548. }
  4549. // return empty vnode in case the render function errored out
  4550. if (!(vnode instanceof VNode)) {
  4551. if ( true && Array.isArray(vnode)) {
  4552. warn(
  4553. 'Multiple root nodes returned from render function. Render function ' +
  4554. 'should return a single root node.',
  4555. vm
  4556. );
  4557. }
  4558. vnode = createEmptyVNode();
  4559. }
  4560. // set parent
  4561. vnode.parent = _parentVnode;
  4562. return vnode
  4563. };
  4564. }
  4565. /* */
  4566. function ensureCtor (comp, base) {
  4567. if (
  4568. comp.__esModule ||
  4569. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  4570. ) {
  4571. comp = comp.default;
  4572. }
  4573. return isObject(comp)
  4574. ? base.extend(comp)
  4575. : comp
  4576. }
  4577. function createAsyncPlaceholder (
  4578. factory,
  4579. data,
  4580. context,
  4581. children,
  4582. tag
  4583. ) {
  4584. var node = createEmptyVNode();
  4585. node.asyncFactory = factory;
  4586. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  4587. return node
  4588. }
  4589. function resolveAsyncComponent (
  4590. factory,
  4591. baseCtor
  4592. ) {
  4593. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  4594. return factory.errorComp
  4595. }
  4596. if (isDef(factory.resolved)) {
  4597. return factory.resolved
  4598. }
  4599. var owner = currentRenderingInstance;
  4600. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  4601. // already pending
  4602. factory.owners.push(owner);
  4603. }
  4604. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  4605. return factory.loadingComp
  4606. }
  4607. if (owner && !isDef(factory.owners)) {
  4608. var owners = factory.owners = [owner];
  4609. var sync = true;
  4610. var timerLoading = null;
  4611. var timerTimeout = null
  4612. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  4613. var forceRender = function (renderCompleted) {
  4614. for (var i = 0, l = owners.length; i < l; i++) {
  4615. (owners[i]).$forceUpdate();
  4616. }
  4617. if (renderCompleted) {
  4618. owners.length = 0;
  4619. if (timerLoading !== null) {
  4620. clearTimeout(timerLoading);
  4621. timerLoading = null;
  4622. }
  4623. if (timerTimeout !== null) {
  4624. clearTimeout(timerTimeout);
  4625. timerTimeout = null;
  4626. }
  4627. }
  4628. };
  4629. var resolve = once(function (res) {
  4630. // cache resolved
  4631. factory.resolved = ensureCtor(res, baseCtor);
  4632. // invoke callbacks only if this is not a synchronous resolve
  4633. // (async resolves are shimmed as synchronous during SSR)
  4634. if (!sync) {
  4635. forceRender(true);
  4636. } else {
  4637. owners.length = 0;
  4638. }
  4639. });
  4640. var reject = once(function (reason) {
  4641. true && warn(
  4642. "Failed to resolve async component: " + (String(factory)) +
  4643. (reason ? ("\nReason: " + reason) : '')
  4644. );
  4645. if (isDef(factory.errorComp)) {
  4646. factory.error = true;
  4647. forceRender(true);
  4648. }
  4649. });
  4650. var res = factory(resolve, reject);
  4651. if (isObject(res)) {
  4652. if (isPromise(res)) {
  4653. // () => Promise
  4654. if (isUndef(factory.resolved)) {
  4655. res.then(resolve, reject);
  4656. }
  4657. } else if (isPromise(res.component)) {
  4658. res.component.then(resolve, reject);
  4659. if (isDef(res.error)) {
  4660. factory.errorComp = ensureCtor(res.error, baseCtor);
  4661. }
  4662. if (isDef(res.loading)) {
  4663. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  4664. if (res.delay === 0) {
  4665. factory.loading = true;
  4666. } else {
  4667. timerLoading = setTimeout(function () {
  4668. timerLoading = null;
  4669. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  4670. factory.loading = true;
  4671. forceRender(false);
  4672. }
  4673. }, res.delay || 200);
  4674. }
  4675. }
  4676. if (isDef(res.timeout)) {
  4677. timerTimeout = setTimeout(function () {
  4678. timerTimeout = null;
  4679. if (isUndef(factory.resolved)) {
  4680. reject(
  4681. true
  4682. ? ("timeout (" + (res.timeout) + "ms)")
  4683. : undefined
  4684. );
  4685. }
  4686. }, res.timeout);
  4687. }
  4688. }
  4689. }
  4690. sync = false;
  4691. // return in case resolved synchronously
  4692. return factory.loading
  4693. ? factory.loadingComp
  4694. : factory.resolved
  4695. }
  4696. }
  4697. /* */
  4698. function isAsyncPlaceholder (node) {
  4699. return node.isComment && node.asyncFactory
  4700. }
  4701. /* */
  4702. function getFirstComponentChild (children) {
  4703. if (Array.isArray(children)) {
  4704. for (var i = 0; i < children.length; i++) {
  4705. var c = children[i];
  4706. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  4707. return c
  4708. }
  4709. }
  4710. }
  4711. }
  4712. /* */
  4713. /* */
  4714. function initEvents (vm) {
  4715. vm._events = Object.create(null);
  4716. vm._hasHookEvent = false;
  4717. // init parent attached events
  4718. var listeners = vm.$options._parentListeners;
  4719. if (listeners) {
  4720. updateComponentListeners(vm, listeners);
  4721. }
  4722. }
  4723. var target;
  4724. function add (event, fn) {
  4725. target.$on(event, fn);
  4726. }
  4727. function remove$1 (event, fn) {
  4728. target.$off(event, fn);
  4729. }
  4730. function createOnceHandler (event, fn) {
  4731. var _target = target;
  4732. return function onceHandler () {
  4733. var res = fn.apply(null, arguments);
  4734. if (res !== null) {
  4735. _target.$off(event, onceHandler);
  4736. }
  4737. }
  4738. }
  4739. function updateComponentListeners (
  4740. vm,
  4741. listeners,
  4742. oldListeners
  4743. ) {
  4744. target = vm;
  4745. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  4746. target = undefined;
  4747. }
  4748. function eventsMixin (Vue) {
  4749. var hookRE = /^hook:/;
  4750. Vue.prototype.$on = function (event, fn) {
  4751. var vm = this;
  4752. if (Array.isArray(event)) {
  4753. for (var i = 0, l = event.length; i < l; i++) {
  4754. vm.$on(event[i], fn);
  4755. }
  4756. } else {
  4757. (vm._events[event] || (vm._events[event] = [])).push(fn);
  4758. // optimize hook:event cost by using a boolean flag marked at registration
  4759. // instead of a hash lookup
  4760. if (hookRE.test(event)) {
  4761. vm._hasHookEvent = true;
  4762. }
  4763. }
  4764. return vm
  4765. };
  4766. Vue.prototype.$once = function (event, fn) {
  4767. var vm = this;
  4768. function on () {
  4769. vm.$off(event, on);
  4770. fn.apply(vm, arguments);
  4771. }
  4772. on.fn = fn;
  4773. vm.$on(event, on);
  4774. return vm
  4775. };
  4776. Vue.prototype.$off = function (event, fn) {
  4777. var vm = this;
  4778. // all
  4779. if (!arguments.length) {
  4780. vm._events = Object.create(null);
  4781. return vm
  4782. }
  4783. // array of events
  4784. if (Array.isArray(event)) {
  4785. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  4786. vm.$off(event[i$1], fn);
  4787. }
  4788. return vm
  4789. }
  4790. // specific event
  4791. var cbs = vm._events[event];
  4792. if (!cbs) {
  4793. return vm
  4794. }
  4795. if (!fn) {
  4796. vm._events[event] = null;
  4797. return vm
  4798. }
  4799. // specific handler
  4800. var cb;
  4801. var i = cbs.length;
  4802. while (i--) {
  4803. cb = cbs[i];
  4804. if (cb === fn || cb.fn === fn) {
  4805. cbs.splice(i, 1);
  4806. break
  4807. }
  4808. }
  4809. return vm
  4810. };
  4811. Vue.prototype.$emit = function (event) {
  4812. var vm = this;
  4813. if (true) {
  4814. var lowerCaseEvent = event.toLowerCase();
  4815. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  4816. tip(
  4817. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  4818. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  4819. "Note that HTML attributes are case-insensitive and you cannot use " +
  4820. "v-on to listen to camelCase events when using in-DOM templates. " +
  4821. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  4822. );
  4823. }
  4824. }
  4825. var cbs = vm._events[event];
  4826. if (cbs) {
  4827. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  4828. var args = toArray(arguments, 1);
  4829. var info = "event handler for \"" + event + "\"";
  4830. for (var i = 0, l = cbs.length; i < l; i++) {
  4831. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  4832. }
  4833. }
  4834. return vm
  4835. };
  4836. }
  4837. /* */
  4838. var activeInstance = null;
  4839. var isUpdatingChildComponent = false;
  4840. function setActiveInstance(vm) {
  4841. var prevActiveInstance = activeInstance;
  4842. activeInstance = vm;
  4843. return function () {
  4844. activeInstance = prevActiveInstance;
  4845. }
  4846. }
  4847. function initLifecycle (vm) {
  4848. var options = vm.$options;
  4849. // locate first non-abstract parent
  4850. var parent = options.parent;
  4851. if (parent && !options.abstract) {
  4852. while (parent.$options.abstract && parent.$parent) {
  4853. parent = parent.$parent;
  4854. }
  4855. parent.$children.push(vm);
  4856. }
  4857. vm.$parent = parent;
  4858. vm.$root = parent ? parent.$root : vm;
  4859. vm.$children = [];
  4860. vm.$refs = {};
  4861. vm._watcher = null;
  4862. vm._inactive = null;
  4863. vm._directInactive = false;
  4864. vm._isMounted = false;
  4865. vm._isDestroyed = false;
  4866. vm._isBeingDestroyed = false;
  4867. }
  4868. function lifecycleMixin (Vue) {
  4869. Vue.prototype._update = function (vnode, hydrating) {
  4870. var vm = this;
  4871. var prevEl = vm.$el;
  4872. var prevVnode = vm._vnode;
  4873. var restoreActiveInstance = setActiveInstance(vm);
  4874. vm._vnode = vnode;
  4875. // Vue.prototype.__patch__ is injected in entry points
  4876. // based on the rendering backend used.
  4877. if (!prevVnode) {
  4878. // initial render
  4879. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  4880. } else {
  4881. // updates
  4882. vm.$el = vm.__patch__(prevVnode, vnode);
  4883. }
  4884. restoreActiveInstance();
  4885. // update __vue__ reference
  4886. if (prevEl) {
  4887. prevEl.__vue__ = null;
  4888. }
  4889. if (vm.$el) {
  4890. vm.$el.__vue__ = vm;
  4891. }
  4892. // if parent is an HOC, update its $el as well
  4893. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  4894. vm.$parent.$el = vm.$el;
  4895. }
  4896. // updated hook is called by the scheduler to ensure that children are
  4897. // updated in a parent's updated hook.
  4898. };
  4899. Vue.prototype.$forceUpdate = function () {
  4900. var vm = this;
  4901. if (vm._watcher) {
  4902. vm._watcher.update();
  4903. }
  4904. };
  4905. Vue.prototype.$destroy = function () {
  4906. var vm = this;
  4907. if (vm._isBeingDestroyed) {
  4908. return
  4909. }
  4910. callHook(vm, 'beforeDestroy');
  4911. vm._isBeingDestroyed = true;
  4912. // remove self from parent
  4913. var parent = vm.$parent;
  4914. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  4915. remove(parent.$children, vm);
  4916. }
  4917. // teardown watchers
  4918. if (vm._watcher) {
  4919. vm._watcher.teardown();
  4920. }
  4921. var i = vm._watchers.length;
  4922. while (i--) {
  4923. vm._watchers[i].teardown();
  4924. }
  4925. // remove reference from data ob
  4926. // frozen object may not have observer.
  4927. if (vm._data.__ob__) {
  4928. vm._data.__ob__.vmCount--;
  4929. }
  4930. // call the last hook...
  4931. vm._isDestroyed = true;
  4932. // invoke destroy hooks on current rendered tree
  4933. vm.__patch__(vm._vnode, null);
  4934. // fire destroyed hook
  4935. callHook(vm, 'destroyed');
  4936. // turn off all instance listeners.
  4937. vm.$off();
  4938. // remove __vue__ reference
  4939. if (vm.$el) {
  4940. vm.$el.__vue__ = null;
  4941. }
  4942. // release circular reference (#6759)
  4943. if (vm.$vnode) {
  4944. vm.$vnode.parent = null;
  4945. }
  4946. };
  4947. }
  4948. function updateChildComponent (
  4949. vm,
  4950. propsData,
  4951. listeners,
  4952. parentVnode,
  4953. renderChildren
  4954. ) {
  4955. if (true) {
  4956. isUpdatingChildComponent = true;
  4957. }
  4958. // determine whether component has slot children
  4959. // we need to do this before overwriting $options._renderChildren.
  4960. // check if there are dynamic scopedSlots (hand-written or compiled but with
  4961. // dynamic slot names). Static scoped slots compiled from template has the
  4962. // "$stable" marker.
  4963. var newScopedSlots = parentVnode.data.scopedSlots;
  4964. var oldScopedSlots = vm.$scopedSlots;
  4965. var hasDynamicScopedSlot = !!(
  4966. (newScopedSlots && !newScopedSlots.$stable) ||
  4967. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  4968. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  4969. );
  4970. // Any static slot children from the parent may have changed during parent's
  4971. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  4972. // update is necessary to ensure correctness.
  4973. var needsForceUpdate = !!(
  4974. renderChildren || // has new static slots
  4975. vm.$options._renderChildren || // has old static slots
  4976. hasDynamicScopedSlot
  4977. );
  4978. vm.$options._parentVnode = parentVnode;
  4979. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  4980. if (vm._vnode) { // update child tree's parent
  4981. vm._vnode.parent = parentVnode;
  4982. }
  4983. vm.$options._renderChildren = renderChildren;
  4984. // update $attrs and $listeners hash
  4985. // these are also reactive so they may trigger child update if the child
  4986. // used them during render
  4987. vm.$attrs = parentVnode.data.attrs || emptyObject;
  4988. vm.$listeners = listeners || emptyObject;
  4989. // update props
  4990. if (propsData && vm.$options.props) {
  4991. toggleObserving(false);
  4992. var props = vm._props;
  4993. var propKeys = vm.$options._propKeys || [];
  4994. for (var i = 0; i < propKeys.length; i++) {
  4995. var key = propKeys[i];
  4996. var propOptions = vm.$options.props; // wtf flow?
  4997. props[key] = validateProp(key, propOptions, propsData, vm);
  4998. }
  4999. toggleObserving(true);
  5000. // keep a copy of raw propsData
  5001. vm.$options.propsData = propsData;
  5002. }
  5003. // fixed by xxxxxx update properties(mp runtime)
  5004. vm._$updateProperties && vm._$updateProperties(vm);
  5005. // update listeners
  5006. listeners = listeners || emptyObject;
  5007. var oldListeners = vm.$options._parentListeners;
  5008. vm.$options._parentListeners = listeners;
  5009. updateComponentListeners(vm, listeners, oldListeners);
  5010. // resolve slots + force update if has children
  5011. if (needsForceUpdate) {
  5012. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  5013. vm.$forceUpdate();
  5014. }
  5015. if (true) {
  5016. isUpdatingChildComponent = false;
  5017. }
  5018. }
  5019. function isInInactiveTree (vm) {
  5020. while (vm && (vm = vm.$parent)) {
  5021. if (vm._inactive) { return true }
  5022. }
  5023. return false
  5024. }
  5025. function activateChildComponent (vm, direct) {
  5026. if (direct) {
  5027. vm._directInactive = false;
  5028. if (isInInactiveTree(vm)) {
  5029. return
  5030. }
  5031. } else if (vm._directInactive) {
  5032. return
  5033. }
  5034. if (vm._inactive || vm._inactive === null) {
  5035. vm._inactive = false;
  5036. for (var i = 0; i < vm.$children.length; i++) {
  5037. activateChildComponent(vm.$children[i]);
  5038. }
  5039. callHook(vm, 'activated');
  5040. }
  5041. }
  5042. function deactivateChildComponent (vm, direct) {
  5043. if (direct) {
  5044. vm._directInactive = true;
  5045. if (isInInactiveTree(vm)) {
  5046. return
  5047. }
  5048. }
  5049. if (!vm._inactive) {
  5050. vm._inactive = true;
  5051. for (var i = 0; i < vm.$children.length; i++) {
  5052. deactivateChildComponent(vm.$children[i]);
  5053. }
  5054. callHook(vm, 'deactivated');
  5055. }
  5056. }
  5057. function callHook (vm, hook) {
  5058. // #7573 disable dep collection when invoking lifecycle hooks
  5059. pushTarget();
  5060. var handlers = vm.$options[hook];
  5061. var info = hook + " hook";
  5062. if (handlers) {
  5063. for (var i = 0, j = handlers.length; i < j; i++) {
  5064. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  5065. }
  5066. }
  5067. if (vm._hasHookEvent) {
  5068. vm.$emit('hook:' + hook);
  5069. }
  5070. popTarget();
  5071. }
  5072. /* */
  5073. var MAX_UPDATE_COUNT = 100;
  5074. var queue = [];
  5075. var activatedChildren = [];
  5076. var has = {};
  5077. var circular = {};
  5078. var waiting = false;
  5079. var flushing = false;
  5080. var index = 0;
  5081. /**
  5082. * Reset the scheduler's state.
  5083. */
  5084. function resetSchedulerState () {
  5085. index = queue.length = activatedChildren.length = 0;
  5086. has = {};
  5087. if (true) {
  5088. circular = {};
  5089. }
  5090. waiting = flushing = false;
  5091. }
  5092. // Async edge case #6566 requires saving the timestamp when event listeners are
  5093. // attached. However, calling performance.now() has a perf overhead especially
  5094. // if the page has thousands of event listeners. Instead, we take a timestamp
  5095. // every time the scheduler flushes and use that for all event listeners
  5096. // attached during that flush.
  5097. var currentFlushTimestamp = 0;
  5098. // Async edge case fix requires storing an event listener's attach timestamp.
  5099. var getNow = Date.now;
  5100. // Determine what event timestamp the browser is using. Annoyingly, the
  5101. // timestamp can either be hi-res (relative to page load) or low-res
  5102. // (relative to UNIX epoch), so in order to compare time we have to use the
  5103. // same timestamp type when saving the flush timestamp.
  5104. // All IE versions use low-res event timestamps, and have problematic clock
  5105. // implementations (#9632)
  5106. if (inBrowser && !isIE) {
  5107. var performance = window.performance;
  5108. if (
  5109. performance &&
  5110. typeof performance.now === 'function' &&
  5111. getNow() > document.createEvent('Event').timeStamp
  5112. ) {
  5113. // if the event timestamp, although evaluated AFTER the Date.now(), is
  5114. // smaller than it, it means the event is using a hi-res timestamp,
  5115. // and we need to use the hi-res version for event listener timestamps as
  5116. // well.
  5117. getNow = function () { return performance.now(); };
  5118. }
  5119. }
  5120. /**
  5121. * Flush both queues and run the watchers.
  5122. */
  5123. function flushSchedulerQueue () {
  5124. currentFlushTimestamp = getNow();
  5125. flushing = true;
  5126. var watcher, id;
  5127. // Sort queue before flush.
  5128. // This ensures that:
  5129. // 1. Components are updated from parent to child. (because parent is always
  5130. // created before the child)
  5131. // 2. A component's user watchers are run before its render watcher (because
  5132. // user watchers are created before the render watcher)
  5133. // 3. If a component is destroyed during a parent component's watcher run,
  5134. // its watchers can be skipped.
  5135. queue.sort(function (a, b) { return a.id - b.id; });
  5136. // do not cache length because more watchers might be pushed
  5137. // as we run existing watchers
  5138. for (index = 0; index < queue.length; index++) {
  5139. watcher = queue[index];
  5140. if (watcher.before) {
  5141. watcher.before();
  5142. }
  5143. id = watcher.id;
  5144. has[id] = null;
  5145. watcher.run();
  5146. // in dev build, check and stop circular updates.
  5147. if ( true && has[id] != null) {
  5148. circular[id] = (circular[id] || 0) + 1;
  5149. if (circular[id] > MAX_UPDATE_COUNT) {
  5150. warn(
  5151. 'You may have an infinite update loop ' + (
  5152. watcher.user
  5153. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  5154. : "in a component render function."
  5155. ),
  5156. watcher.vm
  5157. );
  5158. break
  5159. }
  5160. }
  5161. }
  5162. // keep copies of post queues before resetting state
  5163. var activatedQueue = activatedChildren.slice();
  5164. var updatedQueue = queue.slice();
  5165. resetSchedulerState();
  5166. // call component updated and activated hooks
  5167. callActivatedHooks(activatedQueue);
  5168. callUpdatedHooks(updatedQueue);
  5169. // devtool hook
  5170. /* istanbul ignore if */
  5171. if (devtools && config.devtools) {
  5172. devtools.emit('flush');
  5173. }
  5174. }
  5175. function callUpdatedHooks (queue) {
  5176. var i = queue.length;
  5177. while (i--) {
  5178. var watcher = queue[i];
  5179. var vm = watcher.vm;
  5180. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  5181. callHook(vm, 'updated');
  5182. }
  5183. }
  5184. }
  5185. /**
  5186. * Queue a kept-alive component that was activated during patch.
  5187. * The queue will be processed after the entire tree has been patched.
  5188. */
  5189. function queueActivatedComponent (vm) {
  5190. // setting _inactive to false here so that a render function can
  5191. // rely on checking whether it's in an inactive tree (e.g. router-view)
  5192. vm._inactive = false;
  5193. activatedChildren.push(vm);
  5194. }
  5195. function callActivatedHooks (queue) {
  5196. for (var i = 0; i < queue.length; i++) {
  5197. queue[i]._inactive = true;
  5198. activateChildComponent(queue[i], true /* true */);
  5199. }
  5200. }
  5201. /**
  5202. * Push a watcher into the watcher queue.
  5203. * Jobs with duplicate IDs will be skipped unless it's
  5204. * pushed when the queue is being flushed.
  5205. */
  5206. function queueWatcher (watcher) {
  5207. var id = watcher.id;
  5208. if (has[id] == null) {
  5209. has[id] = true;
  5210. if (!flushing) {
  5211. queue.push(watcher);
  5212. } else {
  5213. // if already flushing, splice the watcher based on its id
  5214. // if already past its id, it will be run next immediately.
  5215. var i = queue.length - 1;
  5216. while (i > index && queue[i].id > watcher.id) {
  5217. i--;
  5218. }
  5219. queue.splice(i + 1, 0, watcher);
  5220. }
  5221. // queue the flush
  5222. if (!waiting) {
  5223. waiting = true;
  5224. if ( true && !config.async) {
  5225. flushSchedulerQueue();
  5226. return
  5227. }
  5228. nextTick(flushSchedulerQueue);
  5229. }
  5230. }
  5231. }
  5232. /* */
  5233. var uid$2 = 0;
  5234. /**
  5235. * A watcher parses an expression, collects dependencies,
  5236. * and fires callback when the expression value changes.
  5237. * This is used for both the $watch() api and directives.
  5238. */
  5239. var Watcher = function Watcher (
  5240. vm,
  5241. expOrFn,
  5242. cb,
  5243. options,
  5244. isRenderWatcher
  5245. ) {
  5246. this.vm = vm;
  5247. if (isRenderWatcher) {
  5248. vm._watcher = this;
  5249. }
  5250. vm._watchers.push(this);
  5251. // options
  5252. if (options) {
  5253. this.deep = !!options.deep;
  5254. this.user = !!options.user;
  5255. this.lazy = !!options.lazy;
  5256. this.sync = !!options.sync;
  5257. this.before = options.before;
  5258. } else {
  5259. this.deep = this.user = this.lazy = this.sync = false;
  5260. }
  5261. this.cb = cb;
  5262. this.id = ++uid$2; // uid for batching
  5263. this.active = true;
  5264. this.dirty = this.lazy; // for lazy watchers
  5265. this.deps = [];
  5266. this.newDeps = [];
  5267. this.depIds = new _Set();
  5268. this.newDepIds = new _Set();
  5269. this.expression = true
  5270. ? expOrFn.toString()
  5271. : undefined;
  5272. // parse expression for getter
  5273. if (typeof expOrFn === 'function') {
  5274. this.getter = expOrFn;
  5275. } else {
  5276. this.getter = parsePath(expOrFn);
  5277. if (!this.getter) {
  5278. this.getter = noop;
  5279. true && warn(
  5280. "Failed watching path: \"" + expOrFn + "\" " +
  5281. 'Watcher only accepts simple dot-delimited paths. ' +
  5282. 'For full control, use a function instead.',
  5283. vm
  5284. );
  5285. }
  5286. }
  5287. this.value = this.lazy
  5288. ? undefined
  5289. : this.get();
  5290. };
  5291. /**
  5292. * Evaluate the getter, and re-collect dependencies.
  5293. */
  5294. Watcher.prototype.get = function get () {
  5295. pushTarget(this);
  5296. var value;
  5297. var vm = this.vm;
  5298. try {
  5299. value = this.getter.call(vm, vm);
  5300. } catch (e) {
  5301. if (this.user) {
  5302. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  5303. } else {
  5304. throw e
  5305. }
  5306. } finally {
  5307. // "touch" every property so they are all tracked as
  5308. // dependencies for deep watching
  5309. if (this.deep) {
  5310. traverse(value);
  5311. }
  5312. popTarget();
  5313. this.cleanupDeps();
  5314. }
  5315. return value
  5316. };
  5317. /**
  5318. * Add a dependency to this directive.
  5319. */
  5320. Watcher.prototype.addDep = function addDep (dep) {
  5321. var id = dep.id;
  5322. if (!this.newDepIds.has(id)) {
  5323. this.newDepIds.add(id);
  5324. this.newDeps.push(dep);
  5325. if (!this.depIds.has(id)) {
  5326. dep.addSub(this);
  5327. }
  5328. }
  5329. };
  5330. /**
  5331. * Clean up for dependency collection.
  5332. */
  5333. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  5334. var i = this.deps.length;
  5335. while (i--) {
  5336. var dep = this.deps[i];
  5337. if (!this.newDepIds.has(dep.id)) {
  5338. dep.removeSub(this);
  5339. }
  5340. }
  5341. var tmp = this.depIds;
  5342. this.depIds = this.newDepIds;
  5343. this.newDepIds = tmp;
  5344. this.newDepIds.clear();
  5345. tmp = this.deps;
  5346. this.deps = this.newDeps;
  5347. this.newDeps = tmp;
  5348. this.newDeps.length = 0;
  5349. };
  5350. /**
  5351. * Subscriber interface.
  5352. * Will be called when a dependency changes.
  5353. */
  5354. Watcher.prototype.update = function update () {
  5355. /* istanbul ignore else */
  5356. if (this.lazy) {
  5357. this.dirty = true;
  5358. } else if (this.sync) {
  5359. this.run();
  5360. } else {
  5361. queueWatcher(this);
  5362. }
  5363. };
  5364. /**
  5365. * Scheduler job interface.
  5366. * Will be called by the scheduler.
  5367. */
  5368. Watcher.prototype.run = function run () {
  5369. if (this.active) {
  5370. var value = this.get();
  5371. if (
  5372. value !== this.value ||
  5373. // Deep watchers and watchers on Object/Arrays should fire even
  5374. // when the value is the same, because the value may
  5375. // have mutated.
  5376. isObject(value) ||
  5377. this.deep
  5378. ) {
  5379. // set new value
  5380. var oldValue = this.value;
  5381. this.value = value;
  5382. if (this.user) {
  5383. try {
  5384. this.cb.call(this.vm, value, oldValue);
  5385. } catch (e) {
  5386. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  5387. }
  5388. } else {
  5389. this.cb.call(this.vm, value, oldValue);
  5390. }
  5391. }
  5392. }
  5393. };
  5394. /**
  5395. * Evaluate the value of the watcher.
  5396. * This only gets called for lazy watchers.
  5397. */
  5398. Watcher.prototype.evaluate = function evaluate () {
  5399. this.value = this.get();
  5400. this.dirty = false;
  5401. };
  5402. /**
  5403. * Depend on all deps collected by this watcher.
  5404. */
  5405. Watcher.prototype.depend = function depend () {
  5406. var i = this.deps.length;
  5407. while (i--) {
  5408. this.deps[i].depend();
  5409. }
  5410. };
  5411. /**
  5412. * Remove self from all dependencies' subscriber list.
  5413. */
  5414. Watcher.prototype.teardown = function teardown () {
  5415. if (this.active) {
  5416. // remove self from vm's watcher list
  5417. // this is a somewhat expensive operation so we skip it
  5418. // if the vm is being destroyed.
  5419. if (!this.vm._isBeingDestroyed) {
  5420. remove(this.vm._watchers, this);
  5421. }
  5422. var i = this.deps.length;
  5423. while (i--) {
  5424. this.deps[i].removeSub(this);
  5425. }
  5426. this.active = false;
  5427. }
  5428. };
  5429. /* */
  5430. var sharedPropertyDefinition = {
  5431. enumerable: true,
  5432. configurable: true,
  5433. get: noop,
  5434. set: noop
  5435. };
  5436. function proxy (target, sourceKey, key) {
  5437. sharedPropertyDefinition.get = function proxyGetter () {
  5438. return this[sourceKey][key]
  5439. };
  5440. sharedPropertyDefinition.set = function proxySetter (val) {
  5441. this[sourceKey][key] = val;
  5442. };
  5443. Object.defineProperty(target, key, sharedPropertyDefinition);
  5444. }
  5445. function initState (vm) {
  5446. vm._watchers = [];
  5447. var opts = vm.$options;
  5448. if (opts.props) { initProps(vm, opts.props); }
  5449. if (opts.methods) { initMethods(vm, opts.methods); }
  5450. if (opts.data) {
  5451. initData(vm);
  5452. } else {
  5453. observe(vm._data = {}, true /* asRootData */);
  5454. }
  5455. if (opts.computed) { initComputed(vm, opts.computed); }
  5456. if (opts.watch && opts.watch !== nativeWatch) {
  5457. initWatch(vm, opts.watch);
  5458. }
  5459. }
  5460. function initProps (vm, propsOptions) {
  5461. var propsData = vm.$options.propsData || {};
  5462. var props = vm._props = {};
  5463. // cache prop keys so that future props updates can iterate using Array
  5464. // instead of dynamic object key enumeration.
  5465. var keys = vm.$options._propKeys = [];
  5466. var isRoot = !vm.$parent;
  5467. // root instance props should be converted
  5468. if (!isRoot) {
  5469. toggleObserving(false);
  5470. }
  5471. var loop = function ( key ) {
  5472. keys.push(key);
  5473. var value = validateProp(key, propsOptions, propsData, vm);
  5474. /* istanbul ignore else */
  5475. if (true) {
  5476. var hyphenatedKey = hyphenate(key);
  5477. if (isReservedAttribute(hyphenatedKey) ||
  5478. config.isReservedAttr(hyphenatedKey)) {
  5479. warn(
  5480. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  5481. vm
  5482. );
  5483. }
  5484. defineReactive$$1(props, key, value, function () {
  5485. if (!isRoot && !isUpdatingChildComponent) {
  5486. {
  5487. if(vm.mpHost === 'mp-baidu'){//百度 observer 在 setData callback 之后触发,直接忽略该 warn
  5488. return
  5489. }
  5490. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  5491. if(
  5492. key === 'value' &&
  5493. Array.isArray(vm.$options.behaviors) &&
  5494. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  5495. ){
  5496. return
  5497. }
  5498. if(vm._getFormData){
  5499. return
  5500. }
  5501. var $parent = vm.$parent;
  5502. while($parent){
  5503. if($parent.__next_tick_pending){
  5504. return
  5505. }
  5506. $parent = $parent.$parent;
  5507. }
  5508. }
  5509. warn(
  5510. "Avoid mutating a prop directly since the value will be " +
  5511. "overwritten whenever the parent component re-renders. " +
  5512. "Instead, use a data or computed property based on the prop's " +
  5513. "value. Prop being mutated: \"" + key + "\"",
  5514. vm
  5515. );
  5516. }
  5517. });
  5518. } else {}
  5519. // static props are already proxied on the component's prototype
  5520. // during Vue.extend(). We only need to proxy props defined at
  5521. // instantiation here.
  5522. if (!(key in vm)) {
  5523. proxy(vm, "_props", key);
  5524. }
  5525. };
  5526. for (var key in propsOptions) loop( key );
  5527. toggleObserving(true);
  5528. }
  5529. function initData (vm) {
  5530. var data = vm.$options.data;
  5531. data = vm._data = typeof data === 'function'
  5532. ? getData(data, vm)
  5533. : data || {};
  5534. if (!isPlainObject(data)) {
  5535. data = {};
  5536. true && warn(
  5537. 'data functions should return an object:\n' +
  5538. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  5539. vm
  5540. );
  5541. }
  5542. // proxy data on instance
  5543. var keys = Object.keys(data);
  5544. var props = vm.$options.props;
  5545. var methods = vm.$options.methods;
  5546. var i = keys.length;
  5547. while (i--) {
  5548. var key = keys[i];
  5549. if (true) {
  5550. if (methods && hasOwn(methods, key)) {
  5551. warn(
  5552. ("Method \"" + key + "\" has already been defined as a data property."),
  5553. vm
  5554. );
  5555. }
  5556. }
  5557. if (props && hasOwn(props, key)) {
  5558. true && warn(
  5559. "The data property \"" + key + "\" is already declared as a prop. " +
  5560. "Use prop default value instead.",
  5561. vm
  5562. );
  5563. } else if (!isReserved(key)) {
  5564. proxy(vm, "_data", key);
  5565. }
  5566. }
  5567. // observe data
  5568. observe(data, true /* asRootData */);
  5569. }
  5570. function getData (data, vm) {
  5571. // #7573 disable dep collection when invoking data getters
  5572. pushTarget();
  5573. try {
  5574. return data.call(vm, vm)
  5575. } catch (e) {
  5576. handleError(e, vm, "data()");
  5577. return {}
  5578. } finally {
  5579. popTarget();
  5580. }
  5581. }
  5582. var computedWatcherOptions = { lazy: true };
  5583. function initComputed (vm, computed) {
  5584. // $flow-disable-line
  5585. var watchers = vm._computedWatchers = Object.create(null);
  5586. // computed properties are just getters during SSR
  5587. var isSSR = isServerRendering();
  5588. for (var key in computed) {
  5589. var userDef = computed[key];
  5590. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  5591. if ( true && getter == null) {
  5592. warn(
  5593. ("Getter is missing for computed property \"" + key + "\"."),
  5594. vm
  5595. );
  5596. }
  5597. if (!isSSR) {
  5598. // create internal watcher for the computed property.
  5599. watchers[key] = new Watcher(
  5600. vm,
  5601. getter || noop,
  5602. noop,
  5603. computedWatcherOptions
  5604. );
  5605. }
  5606. // component-defined computed properties are already defined on the
  5607. // component prototype. We only need to define computed properties defined
  5608. // at instantiation here.
  5609. if (!(key in vm)) {
  5610. defineComputed(vm, key, userDef);
  5611. } else if (true) {
  5612. if (key in vm.$data) {
  5613. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  5614. } else if (vm.$options.props && key in vm.$options.props) {
  5615. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  5616. }
  5617. }
  5618. }
  5619. }
  5620. function defineComputed (
  5621. target,
  5622. key,
  5623. userDef
  5624. ) {
  5625. var shouldCache = !isServerRendering();
  5626. if (typeof userDef === 'function') {
  5627. sharedPropertyDefinition.get = shouldCache
  5628. ? createComputedGetter(key)
  5629. : createGetterInvoker(userDef);
  5630. sharedPropertyDefinition.set = noop;
  5631. } else {
  5632. sharedPropertyDefinition.get = userDef.get
  5633. ? shouldCache && userDef.cache !== false
  5634. ? createComputedGetter(key)
  5635. : createGetterInvoker(userDef.get)
  5636. : noop;
  5637. sharedPropertyDefinition.set = userDef.set || noop;
  5638. }
  5639. if ( true &&
  5640. sharedPropertyDefinition.set === noop) {
  5641. sharedPropertyDefinition.set = function () {
  5642. warn(
  5643. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  5644. this
  5645. );
  5646. };
  5647. }
  5648. Object.defineProperty(target, key, sharedPropertyDefinition);
  5649. }
  5650. function createComputedGetter (key) {
  5651. return function computedGetter () {
  5652. var watcher = this._computedWatchers && this._computedWatchers[key];
  5653. if (watcher) {
  5654. if (watcher.dirty) {
  5655. watcher.evaluate();
  5656. }
  5657. if (Dep.SharedObject.target) {// fixed by xxxxxx
  5658. watcher.depend();
  5659. }
  5660. return watcher.value
  5661. }
  5662. }
  5663. }
  5664. function createGetterInvoker(fn) {
  5665. return function computedGetter () {
  5666. return fn.call(this, this)
  5667. }
  5668. }
  5669. function initMethods (vm, methods) {
  5670. var props = vm.$options.props;
  5671. for (var key in methods) {
  5672. if (true) {
  5673. if (typeof methods[key] !== 'function') {
  5674. warn(
  5675. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  5676. "Did you reference the function correctly?",
  5677. vm
  5678. );
  5679. }
  5680. if (props && hasOwn(props, key)) {
  5681. warn(
  5682. ("Method \"" + key + "\" has already been defined as a prop."),
  5683. vm
  5684. );
  5685. }
  5686. if ((key in vm) && isReserved(key)) {
  5687. warn(
  5688. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  5689. "Avoid defining component methods that start with _ or $."
  5690. );
  5691. }
  5692. }
  5693. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  5694. }
  5695. }
  5696. function initWatch (vm, watch) {
  5697. for (var key in watch) {
  5698. var handler = watch[key];
  5699. if (Array.isArray(handler)) {
  5700. for (var i = 0; i < handler.length; i++) {
  5701. createWatcher(vm, key, handler[i]);
  5702. }
  5703. } else {
  5704. createWatcher(vm, key, handler);
  5705. }
  5706. }
  5707. }
  5708. function createWatcher (
  5709. vm,
  5710. expOrFn,
  5711. handler,
  5712. options
  5713. ) {
  5714. if (isPlainObject(handler)) {
  5715. options = handler;
  5716. handler = handler.handler;
  5717. }
  5718. if (typeof handler === 'string') {
  5719. handler = vm[handler];
  5720. }
  5721. return vm.$watch(expOrFn, handler, options)
  5722. }
  5723. function stateMixin (Vue) {
  5724. // flow somehow has problems with directly declared definition object
  5725. // when using Object.defineProperty, so we have to procedurally build up
  5726. // the object here.
  5727. var dataDef = {};
  5728. dataDef.get = function () { return this._data };
  5729. var propsDef = {};
  5730. propsDef.get = function () { return this._props };
  5731. if (true) {
  5732. dataDef.set = function () {
  5733. warn(
  5734. 'Avoid replacing instance root $data. ' +
  5735. 'Use nested data properties instead.',
  5736. this
  5737. );
  5738. };
  5739. propsDef.set = function () {
  5740. warn("$props is readonly.", this);
  5741. };
  5742. }
  5743. Object.defineProperty(Vue.prototype, '$data', dataDef);
  5744. Object.defineProperty(Vue.prototype, '$props', propsDef);
  5745. Vue.prototype.$set = set;
  5746. Vue.prototype.$delete = del;
  5747. Vue.prototype.$watch = function (
  5748. expOrFn,
  5749. cb,
  5750. options
  5751. ) {
  5752. var vm = this;
  5753. if (isPlainObject(cb)) {
  5754. return createWatcher(vm, expOrFn, cb, options)
  5755. }
  5756. options = options || {};
  5757. options.user = true;
  5758. var watcher = new Watcher(vm, expOrFn, cb, options);
  5759. if (options.immediate) {
  5760. try {
  5761. cb.call(vm, watcher.value);
  5762. } catch (error) {
  5763. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  5764. }
  5765. }
  5766. return function unwatchFn () {
  5767. watcher.teardown();
  5768. }
  5769. };
  5770. }
  5771. /* */
  5772. var uid$3 = 0;
  5773. function initMixin (Vue) {
  5774. Vue.prototype._init = function (options) {
  5775. var vm = this;
  5776. // a uid
  5777. vm._uid = uid$3++;
  5778. var startTag, endTag;
  5779. /* istanbul ignore if */
  5780. if ( true && config.performance && mark) {
  5781. startTag = "vue-perf-start:" + (vm._uid);
  5782. endTag = "vue-perf-end:" + (vm._uid);
  5783. mark(startTag);
  5784. }
  5785. // a flag to avoid this being observed
  5786. vm._isVue = true;
  5787. // merge options
  5788. if (options && options._isComponent) {
  5789. // optimize internal component instantiation
  5790. // since dynamic options merging is pretty slow, and none of the
  5791. // internal component options needs special treatment.
  5792. initInternalComponent(vm, options);
  5793. } else {
  5794. vm.$options = mergeOptions(
  5795. resolveConstructorOptions(vm.constructor),
  5796. options || {},
  5797. vm
  5798. );
  5799. }
  5800. /* istanbul ignore else */
  5801. if (true) {
  5802. initProxy(vm);
  5803. } else {}
  5804. // expose real self
  5805. vm._self = vm;
  5806. initLifecycle(vm);
  5807. initEvents(vm);
  5808. initRender(vm);
  5809. callHook(vm, 'beforeCreate');
  5810. vm.mpHost !== 'mp-toutiao' && initInjections(vm); // resolve injections before data/props
  5811. initState(vm);
  5812. vm.mpHost !== 'mp-toutiao' && initProvide(vm); // resolve provide after data/props
  5813. vm.mpHost !== 'mp-toutiao' && callHook(vm, 'created');
  5814. /* istanbul ignore if */
  5815. if ( true && config.performance && mark) {
  5816. vm._name = formatComponentName(vm, false);
  5817. mark(endTag);
  5818. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  5819. }
  5820. if (vm.$options.el) {
  5821. vm.$mount(vm.$options.el);
  5822. }
  5823. };
  5824. }
  5825. function initInternalComponent (vm, options) {
  5826. var opts = vm.$options = Object.create(vm.constructor.options);
  5827. // doing this because it's faster than dynamic enumeration.
  5828. var parentVnode = options._parentVnode;
  5829. opts.parent = options.parent;
  5830. opts._parentVnode = parentVnode;
  5831. var vnodeComponentOptions = parentVnode.componentOptions;
  5832. opts.propsData = vnodeComponentOptions.propsData;
  5833. opts._parentListeners = vnodeComponentOptions.listeners;
  5834. opts._renderChildren = vnodeComponentOptions.children;
  5835. opts._componentTag = vnodeComponentOptions.tag;
  5836. if (options.render) {
  5837. opts.render = options.render;
  5838. opts.staticRenderFns = options.staticRenderFns;
  5839. }
  5840. }
  5841. function resolveConstructorOptions (Ctor) {
  5842. var options = Ctor.options;
  5843. if (Ctor.super) {
  5844. var superOptions = resolveConstructorOptions(Ctor.super);
  5845. var cachedSuperOptions = Ctor.superOptions;
  5846. if (superOptions !== cachedSuperOptions) {
  5847. // super option changed,
  5848. // need to resolve new options.
  5849. Ctor.superOptions = superOptions;
  5850. // check if there are any late-modified/attached options (#4976)
  5851. var modifiedOptions = resolveModifiedOptions(Ctor);
  5852. // update base extend options
  5853. if (modifiedOptions) {
  5854. extend(Ctor.extendOptions, modifiedOptions);
  5855. }
  5856. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  5857. if (options.name) {
  5858. options.components[options.name] = Ctor;
  5859. }
  5860. }
  5861. }
  5862. return options
  5863. }
  5864. function resolveModifiedOptions (Ctor) {
  5865. var modified;
  5866. var latest = Ctor.options;
  5867. var sealed = Ctor.sealedOptions;
  5868. for (var key in latest) {
  5869. if (latest[key] !== sealed[key]) {
  5870. if (!modified) { modified = {}; }
  5871. modified[key] = latest[key];
  5872. }
  5873. }
  5874. return modified
  5875. }
  5876. function Vue (options) {
  5877. if ( true &&
  5878. !(this instanceof Vue)
  5879. ) {
  5880. warn('Vue is a constructor and should be called with the `new` keyword');
  5881. }
  5882. this._init(options);
  5883. }
  5884. initMixin(Vue);
  5885. stateMixin(Vue);
  5886. eventsMixin(Vue);
  5887. lifecycleMixin(Vue);
  5888. renderMixin(Vue);
  5889. /* */
  5890. function initUse (Vue) {
  5891. Vue.use = function (plugin) {
  5892. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  5893. if (installedPlugins.indexOf(plugin) > -1) {
  5894. return this
  5895. }
  5896. // additional parameters
  5897. var args = toArray(arguments, 1);
  5898. args.unshift(this);
  5899. if (typeof plugin.install === 'function') {
  5900. plugin.install.apply(plugin, args);
  5901. } else if (typeof plugin === 'function') {
  5902. plugin.apply(null, args);
  5903. }
  5904. installedPlugins.push(plugin);
  5905. return this
  5906. };
  5907. }
  5908. /* */
  5909. function initMixin$1 (Vue) {
  5910. Vue.mixin = function (mixin) {
  5911. this.options = mergeOptions(this.options, mixin);
  5912. return this
  5913. };
  5914. }
  5915. /* */
  5916. function initExtend (Vue) {
  5917. /**
  5918. * Each instance constructor, including Vue, has a unique
  5919. * cid. This enables us to create wrapped "child
  5920. * constructors" for prototypal inheritance and cache them.
  5921. */
  5922. Vue.cid = 0;
  5923. var cid = 1;
  5924. /**
  5925. * Class inheritance
  5926. */
  5927. Vue.extend = function (extendOptions) {
  5928. extendOptions = extendOptions || {};
  5929. var Super = this;
  5930. var SuperId = Super.cid;
  5931. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  5932. if (cachedCtors[SuperId]) {
  5933. return cachedCtors[SuperId]
  5934. }
  5935. var name = extendOptions.name || Super.options.name;
  5936. if ( true && name) {
  5937. validateComponentName(name);
  5938. }
  5939. var Sub = function VueComponent (options) {
  5940. this._init(options);
  5941. };
  5942. Sub.prototype = Object.create(Super.prototype);
  5943. Sub.prototype.constructor = Sub;
  5944. Sub.cid = cid++;
  5945. Sub.options = mergeOptions(
  5946. Super.options,
  5947. extendOptions
  5948. );
  5949. Sub['super'] = Super;
  5950. // For props and computed properties, we define the proxy getters on
  5951. // the Vue instances at extension time, on the extended prototype. This
  5952. // avoids Object.defineProperty calls for each instance created.
  5953. if (Sub.options.props) {
  5954. initProps$1(Sub);
  5955. }
  5956. if (Sub.options.computed) {
  5957. initComputed$1(Sub);
  5958. }
  5959. // allow further extension/mixin/plugin usage
  5960. Sub.extend = Super.extend;
  5961. Sub.mixin = Super.mixin;
  5962. Sub.use = Super.use;
  5963. // create asset registers, so extended classes
  5964. // can have their private assets too.
  5965. ASSET_TYPES.forEach(function (type) {
  5966. Sub[type] = Super[type];
  5967. });
  5968. // enable recursive self-lookup
  5969. if (name) {
  5970. Sub.options.components[name] = Sub;
  5971. }
  5972. // keep a reference to the super options at extension time.
  5973. // later at instantiation we can check if Super's options have
  5974. // been updated.
  5975. Sub.superOptions = Super.options;
  5976. Sub.extendOptions = extendOptions;
  5977. Sub.sealedOptions = extend({}, Sub.options);
  5978. // cache constructor
  5979. cachedCtors[SuperId] = Sub;
  5980. return Sub
  5981. };
  5982. }
  5983. function initProps$1 (Comp) {
  5984. var props = Comp.options.props;
  5985. for (var key in props) {
  5986. proxy(Comp.prototype, "_props", key);
  5987. }
  5988. }
  5989. function initComputed$1 (Comp) {
  5990. var computed = Comp.options.computed;
  5991. for (var key in computed) {
  5992. defineComputed(Comp.prototype, key, computed[key]);
  5993. }
  5994. }
  5995. /* */
  5996. function initAssetRegisters (Vue) {
  5997. /**
  5998. * Create asset registration methods.
  5999. */
  6000. ASSET_TYPES.forEach(function (type) {
  6001. Vue[type] = function (
  6002. id,
  6003. definition
  6004. ) {
  6005. if (!definition) {
  6006. return this.options[type + 's'][id]
  6007. } else {
  6008. /* istanbul ignore if */
  6009. if ( true && type === 'component') {
  6010. validateComponentName(id);
  6011. }
  6012. if (type === 'component' && isPlainObject(definition)) {
  6013. definition.name = definition.name || id;
  6014. definition = this.options._base.extend(definition);
  6015. }
  6016. if (type === 'directive' && typeof definition === 'function') {
  6017. definition = { bind: definition, update: definition };
  6018. }
  6019. this.options[type + 's'][id] = definition;
  6020. return definition
  6021. }
  6022. };
  6023. });
  6024. }
  6025. /* */
  6026. function getComponentName (opts) {
  6027. return opts && (opts.Ctor.options.name || opts.tag)
  6028. }
  6029. function matches (pattern, name) {
  6030. if (Array.isArray(pattern)) {
  6031. return pattern.indexOf(name) > -1
  6032. } else if (typeof pattern === 'string') {
  6033. return pattern.split(',').indexOf(name) > -1
  6034. } else if (isRegExp(pattern)) {
  6035. return pattern.test(name)
  6036. }
  6037. /* istanbul ignore next */
  6038. return false
  6039. }
  6040. function pruneCache (keepAliveInstance, filter) {
  6041. var cache = keepAliveInstance.cache;
  6042. var keys = keepAliveInstance.keys;
  6043. var _vnode = keepAliveInstance._vnode;
  6044. for (var key in cache) {
  6045. var cachedNode = cache[key];
  6046. if (cachedNode) {
  6047. var name = getComponentName(cachedNode.componentOptions);
  6048. if (name && !filter(name)) {
  6049. pruneCacheEntry(cache, key, keys, _vnode);
  6050. }
  6051. }
  6052. }
  6053. }
  6054. function pruneCacheEntry (
  6055. cache,
  6056. key,
  6057. keys,
  6058. current
  6059. ) {
  6060. var cached$$1 = cache[key];
  6061. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  6062. cached$$1.componentInstance.$destroy();
  6063. }
  6064. cache[key] = null;
  6065. remove(keys, key);
  6066. }
  6067. var patternTypes = [String, RegExp, Array];
  6068. var KeepAlive = {
  6069. name: 'keep-alive',
  6070. abstract: true,
  6071. props: {
  6072. include: patternTypes,
  6073. exclude: patternTypes,
  6074. max: [String, Number]
  6075. },
  6076. created: function created () {
  6077. this.cache = Object.create(null);
  6078. this.keys = [];
  6079. },
  6080. destroyed: function destroyed () {
  6081. for (var key in this.cache) {
  6082. pruneCacheEntry(this.cache, key, this.keys);
  6083. }
  6084. },
  6085. mounted: function mounted () {
  6086. var this$1 = this;
  6087. this.$watch('include', function (val) {
  6088. pruneCache(this$1, function (name) { return matches(val, name); });
  6089. });
  6090. this.$watch('exclude', function (val) {
  6091. pruneCache(this$1, function (name) { return !matches(val, name); });
  6092. });
  6093. },
  6094. render: function render () {
  6095. var slot = this.$slots.default;
  6096. var vnode = getFirstComponentChild(slot);
  6097. var componentOptions = vnode && vnode.componentOptions;
  6098. if (componentOptions) {
  6099. // check pattern
  6100. var name = getComponentName(componentOptions);
  6101. var ref = this;
  6102. var include = ref.include;
  6103. var exclude = ref.exclude;
  6104. if (
  6105. // not included
  6106. (include && (!name || !matches(include, name))) ||
  6107. // excluded
  6108. (exclude && name && matches(exclude, name))
  6109. ) {
  6110. return vnode
  6111. }
  6112. var ref$1 = this;
  6113. var cache = ref$1.cache;
  6114. var keys = ref$1.keys;
  6115. var key = vnode.key == null
  6116. // same constructor may get registered as different local components
  6117. // so cid alone is not enough (#3269)
  6118. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  6119. : vnode.key;
  6120. if (cache[key]) {
  6121. vnode.componentInstance = cache[key].componentInstance;
  6122. // make current key freshest
  6123. remove(keys, key);
  6124. keys.push(key);
  6125. } else {
  6126. cache[key] = vnode;
  6127. keys.push(key);
  6128. // prune oldest entry
  6129. if (this.max && keys.length > parseInt(this.max)) {
  6130. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  6131. }
  6132. }
  6133. vnode.data.keepAlive = true;
  6134. }
  6135. return vnode || (slot && slot[0])
  6136. }
  6137. };
  6138. var builtInComponents = {
  6139. KeepAlive: KeepAlive
  6140. };
  6141. /* */
  6142. function initGlobalAPI (Vue) {
  6143. // config
  6144. var configDef = {};
  6145. configDef.get = function () { return config; };
  6146. if (true) {
  6147. configDef.set = function () {
  6148. warn(
  6149. 'Do not replace the Vue.config object, set individual fields instead.'
  6150. );
  6151. };
  6152. }
  6153. Object.defineProperty(Vue, 'config', configDef);
  6154. // exposed util methods.
  6155. // NOTE: these are not considered part of the public API - avoid relying on
  6156. // them unless you are aware of the risk.
  6157. Vue.util = {
  6158. warn: warn,
  6159. extend: extend,
  6160. mergeOptions: mergeOptions,
  6161. defineReactive: defineReactive$$1
  6162. };
  6163. Vue.set = set;
  6164. Vue.delete = del;
  6165. Vue.nextTick = nextTick;
  6166. // 2.6 explicit observable API
  6167. Vue.observable = function (obj) {
  6168. observe(obj);
  6169. return obj
  6170. };
  6171. Vue.options = Object.create(null);
  6172. ASSET_TYPES.forEach(function (type) {
  6173. Vue.options[type + 's'] = Object.create(null);
  6174. });
  6175. // this is used to identify the "base" constructor to extend all plain-object
  6176. // components with in Weex's multi-instance scenarios.
  6177. Vue.options._base = Vue;
  6178. extend(Vue.options.components, builtInComponents);
  6179. initUse(Vue);
  6180. initMixin$1(Vue);
  6181. initExtend(Vue);
  6182. initAssetRegisters(Vue);
  6183. }
  6184. initGlobalAPI(Vue);
  6185. Object.defineProperty(Vue.prototype, '$isServer', {
  6186. get: isServerRendering
  6187. });
  6188. Object.defineProperty(Vue.prototype, '$ssrContext', {
  6189. get: function get () {
  6190. /* istanbul ignore next */
  6191. return this.$vnode && this.$vnode.ssrContext
  6192. }
  6193. });
  6194. // expose FunctionalRenderContext for ssr runtime helper installation
  6195. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  6196. value: FunctionalRenderContext
  6197. });
  6198. Vue.version = '2.6.11';
  6199. /**
  6200. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  6201. */
  6202. var ARRAYTYPE = '[object Array]';
  6203. var OBJECTTYPE = '[object Object]';
  6204. // const FUNCTIONTYPE = '[object Function]'
  6205. function diff(current, pre) {
  6206. var result = {};
  6207. syncKeys(current, pre);
  6208. _diff(current, pre, '', result);
  6209. return result
  6210. }
  6211. function syncKeys(current, pre) {
  6212. if (current === pre) { return }
  6213. var rootCurrentType = type(current);
  6214. var rootPreType = type(pre);
  6215. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  6216. if(Object.keys(current).length >= Object.keys(pre).length){
  6217. for (var key in pre) {
  6218. var currentValue = current[key];
  6219. if (currentValue === undefined) {
  6220. current[key] = null;
  6221. } else {
  6222. syncKeys(currentValue, pre[key]);
  6223. }
  6224. }
  6225. }
  6226. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  6227. if (current.length >= pre.length) {
  6228. pre.forEach(function (item, index) {
  6229. syncKeys(current[index], item);
  6230. });
  6231. }
  6232. }
  6233. }
  6234. function _diff(current, pre, path, result) {
  6235. if (current === pre) { return }
  6236. var rootCurrentType = type(current);
  6237. var rootPreType = type(pre);
  6238. if (rootCurrentType == OBJECTTYPE) {
  6239. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  6240. setResult(result, path, current);
  6241. } else {
  6242. var loop = function ( key ) {
  6243. var currentValue = current[key];
  6244. var preValue = pre[key];
  6245. var currentType = type(currentValue);
  6246. var preType = type(preValue);
  6247. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  6248. if (currentValue != pre[key]) {
  6249. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6250. }
  6251. } else if (currentType == ARRAYTYPE) {
  6252. if (preType != ARRAYTYPE) {
  6253. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6254. } else {
  6255. if (currentValue.length < preValue.length) {
  6256. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6257. } else {
  6258. currentValue.forEach(function (item, index) {
  6259. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  6260. });
  6261. }
  6262. }
  6263. } else if (currentType == OBJECTTYPE) {
  6264. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  6265. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6266. } else {
  6267. for (var subKey in currentValue) {
  6268. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  6269. }
  6270. }
  6271. }
  6272. };
  6273. for (var key in current) loop( key );
  6274. }
  6275. } else if (rootCurrentType == ARRAYTYPE) {
  6276. if (rootPreType != ARRAYTYPE) {
  6277. setResult(result, path, current);
  6278. } else {
  6279. if (current.length < pre.length) {
  6280. setResult(result, path, current);
  6281. } else {
  6282. current.forEach(function (item, index) {
  6283. _diff(item, pre[index], path + '[' + index + ']', result);
  6284. });
  6285. }
  6286. }
  6287. } else {
  6288. setResult(result, path, current);
  6289. }
  6290. }
  6291. function setResult(result, k, v) {
  6292. // if (type(v) != FUNCTIONTYPE) {
  6293. result[k] = v;
  6294. // }
  6295. }
  6296. function type(obj) {
  6297. return Object.prototype.toString.call(obj)
  6298. }
  6299. /* */
  6300. function flushCallbacks$1(vm) {
  6301. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  6302. if (Object({"VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  6303. var mpInstance = vm.$scope;
  6304. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  6305. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  6306. }
  6307. var copies = vm.__next_tick_callbacks.slice(0);
  6308. vm.__next_tick_callbacks.length = 0;
  6309. for (var i = 0; i < copies.length; i++) {
  6310. copies[i]();
  6311. }
  6312. }
  6313. }
  6314. function hasRenderWatcher(vm) {
  6315. return queue.find(function (watcher) { return vm._watcher === watcher; })
  6316. }
  6317. function nextTick$1(vm, cb) {
  6318. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  6319. //2.nextTick 之前存在 render watcher
  6320. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  6321. if(Object({"VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  6322. var mpInstance = vm.$scope;
  6323. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  6324. ']:nextVueTick');
  6325. }
  6326. return nextTick(cb, vm)
  6327. }else{
  6328. if(Object({"VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  6329. var mpInstance$1 = vm.$scope;
  6330. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  6331. ']:nextMPTick');
  6332. }
  6333. }
  6334. var _resolve;
  6335. if (!vm.__next_tick_callbacks) {
  6336. vm.__next_tick_callbacks = [];
  6337. }
  6338. vm.__next_tick_callbacks.push(function () {
  6339. if (cb) {
  6340. try {
  6341. cb.call(vm);
  6342. } catch (e) {
  6343. handleError(e, vm, 'nextTick');
  6344. }
  6345. } else if (_resolve) {
  6346. _resolve(vm);
  6347. }
  6348. });
  6349. // $flow-disable-line
  6350. if (!cb && typeof Promise !== 'undefined') {
  6351. return new Promise(function (resolve) {
  6352. _resolve = resolve;
  6353. })
  6354. }
  6355. }
  6356. /* */
  6357. function cloneWithData(vm) {
  6358. // 确保当前 vm 所有数据被同步
  6359. var ret = Object.create(null);
  6360. var dataKeys = [].concat(
  6361. Object.keys(vm._data || {}),
  6362. Object.keys(vm._computedWatchers || {}));
  6363. dataKeys.reduce(function(ret, key) {
  6364. ret[key] = vm[key];
  6365. return ret
  6366. }, ret);
  6367. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  6368. Object.assign(ret, vm.$mp.data || {});
  6369. if (
  6370. Array.isArray(vm.$options.behaviors) &&
  6371. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  6372. ) { //form-field
  6373. ret['name'] = vm.name;
  6374. ret['value'] = vm.value;
  6375. }
  6376. return JSON.parse(JSON.stringify(ret))
  6377. }
  6378. var patch = function(oldVnode, vnode) {
  6379. var this$1 = this;
  6380. if (vnode === null) { //destroy
  6381. return
  6382. }
  6383. if (this.mpType === 'page' || this.mpType === 'component') {
  6384. var mpInstance = this.$scope;
  6385. var data = Object.create(null);
  6386. try {
  6387. data = cloneWithData(this);
  6388. } catch (err) {
  6389. console.error(err);
  6390. }
  6391. data.__webviewId__ = mpInstance.data.__webviewId__;
  6392. var mpData = Object.create(null);
  6393. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  6394. mpData[key] = mpInstance.data[key];
  6395. });
  6396. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  6397. if (Object.keys(diffData).length) {
  6398. if (Object({"VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  6399. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  6400. ']差量更新',
  6401. JSON.stringify(diffData));
  6402. }
  6403. this.__next_tick_pending = true;
  6404. mpInstance.setData(diffData, function () {
  6405. this$1.__next_tick_pending = false;
  6406. flushCallbacks$1(this$1);
  6407. });
  6408. } else {
  6409. flushCallbacks$1(this);
  6410. }
  6411. }
  6412. };
  6413. /* */
  6414. function createEmptyRender() {
  6415. }
  6416. function mountComponent$1(
  6417. vm,
  6418. el,
  6419. hydrating
  6420. ) {
  6421. if (!vm.mpType) {//main.js 中的 new Vue
  6422. return vm
  6423. }
  6424. if (vm.mpType === 'app') {
  6425. vm.$options.render = createEmptyRender;
  6426. }
  6427. if (!vm.$options.render) {
  6428. vm.$options.render = createEmptyRender;
  6429. if (true) {
  6430. /* istanbul ignore if */
  6431. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  6432. vm.$options.el || el) {
  6433. warn(
  6434. 'You are using the runtime-only build of Vue where the template ' +
  6435. 'compiler is not available. Either pre-compile the templates into ' +
  6436. 'render functions, or use the compiler-included build.',
  6437. vm
  6438. );
  6439. } else {
  6440. warn(
  6441. 'Failed to mount component: template or render function not defined.',
  6442. vm
  6443. );
  6444. }
  6445. }
  6446. }
  6447. vm.mpHost !== 'mp-toutiao' && callHook(vm, 'beforeMount');
  6448. var updateComponent = function () {
  6449. vm._update(vm._render(), hydrating);
  6450. };
  6451. // we set this to vm._watcher inside the watcher's constructor
  6452. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  6453. // component's mounted hook), which relies on vm._watcher being already defined
  6454. new Watcher(vm, updateComponent, noop, {
  6455. before: function before() {
  6456. if (vm._isMounted && !vm._isDestroyed) {
  6457. callHook(vm, 'beforeUpdate');
  6458. }
  6459. }
  6460. }, true /* isRenderWatcher */);
  6461. hydrating = false;
  6462. return vm
  6463. }
  6464. /* */
  6465. function renderClass (
  6466. staticClass,
  6467. dynamicClass
  6468. ) {
  6469. if (isDef(staticClass) || isDef(dynamicClass)) {
  6470. return concat(staticClass, stringifyClass(dynamicClass))
  6471. }
  6472. /* istanbul ignore next */
  6473. return ''
  6474. }
  6475. function concat (a, b) {
  6476. return a ? b ? (a + ' ' + b) : a : (b || '')
  6477. }
  6478. function stringifyClass (value) {
  6479. if (Array.isArray(value)) {
  6480. return stringifyArray(value)
  6481. }
  6482. if (isObject(value)) {
  6483. return stringifyObject(value)
  6484. }
  6485. if (typeof value === 'string') {
  6486. return value
  6487. }
  6488. /* istanbul ignore next */
  6489. return ''
  6490. }
  6491. function stringifyArray (value) {
  6492. var res = '';
  6493. var stringified;
  6494. for (var i = 0, l = value.length; i < l; i++) {
  6495. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  6496. if (res) { res += ' '; }
  6497. res += stringified;
  6498. }
  6499. }
  6500. return res
  6501. }
  6502. function stringifyObject (value) {
  6503. var res = '';
  6504. for (var key in value) {
  6505. if (value[key]) {
  6506. if (res) { res += ' '; }
  6507. res += key;
  6508. }
  6509. }
  6510. return res
  6511. }
  6512. /* */
  6513. var parseStyleText = cached(function (cssText) {
  6514. var res = {};
  6515. var listDelimiter = /;(?![^(]*\))/g;
  6516. var propertyDelimiter = /:(.+)/;
  6517. cssText.split(listDelimiter).forEach(function (item) {
  6518. if (item) {
  6519. var tmp = item.split(propertyDelimiter);
  6520. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  6521. }
  6522. });
  6523. return res
  6524. });
  6525. // normalize possible array / string values into Object
  6526. function normalizeStyleBinding (bindingStyle) {
  6527. if (Array.isArray(bindingStyle)) {
  6528. return toObject(bindingStyle)
  6529. }
  6530. if (typeof bindingStyle === 'string') {
  6531. return parseStyleText(bindingStyle)
  6532. }
  6533. return bindingStyle
  6534. }
  6535. /* */
  6536. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  6537. function getTarget(obj, path) {
  6538. var parts = path.split('.');
  6539. var key = parts[0];
  6540. if (key.indexOf('__$n') === 0) { //number index
  6541. key = parseInt(key.replace('__$n', ''));
  6542. }
  6543. if (parts.length === 1) {
  6544. return obj[key]
  6545. }
  6546. return getTarget(obj[key], parts.slice(1).join('.'))
  6547. }
  6548. function internalMixin(Vue) {
  6549. Vue.config.errorHandler = function(err) {
  6550. console.error(err);
  6551. /* eslint-disable no-undef */
  6552. var app = getApp();
  6553. if (app && app.onError) {
  6554. app.onError(err);
  6555. }
  6556. };
  6557. var oldEmit = Vue.prototype.$emit;
  6558. Vue.prototype.$emit = function(event) {
  6559. if (this.$scope && event) {
  6560. this.$scope['triggerEvent'](event, {
  6561. __args__: toArray(arguments, 1)
  6562. });
  6563. }
  6564. return oldEmit.apply(this, arguments)
  6565. };
  6566. Vue.prototype.$nextTick = function(fn) {
  6567. return nextTick$1(this, fn)
  6568. };
  6569. MP_METHODS.forEach(function (method) {
  6570. Vue.prototype[method] = function(args) {
  6571. if (this.$scope && this.$scope[method]) {
  6572. return this.$scope[method](args)
  6573. }
  6574. // mp-alipay
  6575. if (typeof my === 'undefined') {
  6576. return
  6577. }
  6578. if (method === 'createSelectorQuery') {
  6579. /* eslint-disable no-undef */
  6580. return my.createSelectorQuery(args)
  6581. } else if (method === 'createIntersectionObserver') {
  6582. /* eslint-disable no-undef */
  6583. return my.createIntersectionObserver(args)
  6584. }
  6585. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  6586. };
  6587. });
  6588. Vue.prototype.__init_provide = initProvide;
  6589. Vue.prototype.__init_injections = initInjections;
  6590. Vue.prototype.__call_hook = function(hook, args) {
  6591. var vm = this;
  6592. // #7573 disable dep collection when invoking lifecycle hooks
  6593. pushTarget();
  6594. var handlers = vm.$options[hook];
  6595. var info = hook + " hook";
  6596. var ret;
  6597. if (handlers) {
  6598. for (var i = 0, j = handlers.length; i < j; i++) {
  6599. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  6600. }
  6601. }
  6602. if (vm._hasHookEvent) {
  6603. vm.$emit('hook:' + hook, args);
  6604. }
  6605. popTarget();
  6606. return ret
  6607. };
  6608. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  6609. if (Array.isArray(modifiers)) {
  6610. if (modifiers.indexOf('trim') !== -1) {
  6611. value = value.trim();
  6612. }
  6613. if (modifiers.indexOf('number') !== -1) {
  6614. value = this._n(value);
  6615. }
  6616. }
  6617. if (!target) {
  6618. target = this;
  6619. }
  6620. target[key] = value;
  6621. };
  6622. Vue.prototype.__set_sync = function(target, key, value) {
  6623. if (!target) {
  6624. target = this;
  6625. }
  6626. target[key] = value;
  6627. };
  6628. Vue.prototype.__get_orig = function(item) {
  6629. if (isPlainObject(item)) {
  6630. return item['$orig'] || item
  6631. }
  6632. return item
  6633. };
  6634. Vue.prototype.__get_value = function(dataPath, target) {
  6635. return getTarget(target || this, dataPath)
  6636. };
  6637. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  6638. return renderClass(staticClass, dynamicClass)
  6639. };
  6640. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  6641. if (!dynamicStyle && !staticStyle) {
  6642. return ''
  6643. }
  6644. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  6645. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  6646. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  6647. };
  6648. Vue.prototype.__map = function(val, iteratee) {
  6649. //TODO 暂不考虑 string,number
  6650. var ret, i, l, keys, key;
  6651. if (Array.isArray(val)) {
  6652. ret = new Array(val.length);
  6653. for (i = 0, l = val.length; i < l; i++) {
  6654. ret[i] = iteratee(val[i], i);
  6655. }
  6656. return ret
  6657. } else if (isObject(val)) {
  6658. keys = Object.keys(val);
  6659. ret = Object.create(null);
  6660. for (i = 0, l = keys.length; i < l; i++) {
  6661. key = keys[i];
  6662. ret[key] = iteratee(val[key], key, i);
  6663. }
  6664. return ret
  6665. }
  6666. return []
  6667. };
  6668. }
  6669. /* */
  6670. var LIFECYCLE_HOOKS$1 = [
  6671. //App
  6672. 'onLaunch',
  6673. 'onShow',
  6674. 'onHide',
  6675. 'onUniNViewMessage',
  6676. 'onError',
  6677. //Page
  6678. 'onLoad',
  6679. // 'onShow',
  6680. 'onReady',
  6681. // 'onHide',
  6682. 'onUnload',
  6683. 'onPullDownRefresh',
  6684. 'onReachBottom',
  6685. 'onTabItemTap',
  6686. 'onShareAppMessage',
  6687. 'onResize',
  6688. 'onPageScroll',
  6689. 'onNavigationBarButtonTap',
  6690. 'onBackPress',
  6691. 'onNavigationBarSearchInputChanged',
  6692. 'onNavigationBarSearchInputConfirmed',
  6693. 'onNavigationBarSearchInputClicked',
  6694. //Component
  6695. // 'onReady', // 兼容旧版本,应该移除该事件
  6696. 'onPageShow',
  6697. 'onPageHide',
  6698. 'onPageResize'
  6699. ];
  6700. function lifecycleMixin$1(Vue) {
  6701. //fixed vue-class-component
  6702. var oldExtend = Vue.extend;
  6703. Vue.extend = function(extendOptions) {
  6704. extendOptions = extendOptions || {};
  6705. var methods = extendOptions.methods;
  6706. if (methods) {
  6707. Object.keys(methods).forEach(function (methodName) {
  6708. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  6709. extendOptions[methodName] = methods[methodName];
  6710. delete methods[methodName];
  6711. }
  6712. });
  6713. }
  6714. return oldExtend.call(this, extendOptions)
  6715. };
  6716. var strategies = Vue.config.optionMergeStrategies;
  6717. var mergeHook = strategies.created;
  6718. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  6719. strategies[hook] = mergeHook;
  6720. });
  6721. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  6722. }
  6723. /* */
  6724. // install platform patch function
  6725. Vue.prototype.__patch__ = patch;
  6726. // public mount method
  6727. Vue.prototype.$mount = function(
  6728. el ,
  6729. hydrating
  6730. ) {
  6731. return mountComponent$1(this, el, hydrating)
  6732. };
  6733. lifecycleMixin$1(Vue);
  6734. internalMixin(Vue);
  6735. /* */
  6736. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  6737. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  6738. /***/ }),
  6739. /* 3 */
  6740. /*!***********************************!*\
  6741. !*** (webpack)/buildin/global.js ***!
  6742. \***********************************/
  6743. /*! no static exports found */
  6744. /***/ (function(module, exports) {
  6745. var g;
  6746. // This works in non-strict mode
  6747. g = (function() {
  6748. return this;
  6749. })();
  6750. try {
  6751. // This works if eval is allowed (see CSP)
  6752. g = g || new Function("return this")();
  6753. } catch (e) {
  6754. // This works if the window reference is available
  6755. if (typeof window === "object") g = window;
  6756. }
  6757. // g can still be undefined, but nothing to do about it...
  6758. // We return undefined, instead of nothing here, so it's
  6759. // easier to handle this case. if(!global) { ...}
  6760. module.exports = g;
  6761. /***/ }),
  6762. /* 4 */
  6763. /*!************************************************************!*\
  6764. !*** C:/Users/Jzdsh/Desktop/附近养车网uni-app/附近养车网/pages.json ***!
  6765. \************************************************************/
  6766. /*! no static exports found */
  6767. /***/ (function(module, exports, __webpack_require__) {
  6768. "use strict";
  6769. /***/ }),
  6770. /* 5 */
  6771. /*!*******************************************************!*\
  6772. !*** ./node_modules/@dcloudio/uni-stat/dist/index.js ***!
  6773. \*******************************************************/
  6774. /*! no static exports found */
  6775. /***/ (function(module, exports, __webpack_require__) {
  6776. "use strict";
  6777. /* WEBPACK VAR INJECTION */(function(uni) {var _package = __webpack_require__(/*! ../package.json */ 6);function _possibleConstructorReturn(self, call) {if (call && (typeof call === "object" || typeof call === "function")) {return call;}return _assertThisInitialized(self);}function _assertThisInitialized(self) {if (self === void 0) {throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _getPrototypeOf(o) {_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {return o.__proto__ || Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _inherits(subClass, superClass) {if (typeof superClass !== "function" && superClass !== null) {throw new TypeError("Super expression must either be null or a function");}subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });if (superClass) _setPrototypeOf(subClass, superClass);}function _setPrototypeOf(o, p) {_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {o.__proto__ = p;return o;};return _setPrototypeOf(o, p);}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;}
  6778. var STAT_VERSION = _package.version;
  6779. var STAT_URL = 'https://tongji.dcloud.io/uni/stat';
  6780. var STAT_H5_URL = 'https://tongji.dcloud.io/uni/stat.gif';
  6781. var PAGE_PVER_TIME = 1800;
  6782. var APP_PVER_TIME = 300;
  6783. var OPERATING_TIME = 10;
  6784. var UUID_KEY = '__DC_STAT_UUID';
  6785. var UUID_VALUE = '__DC_UUID_VALUE';
  6786. function getUuid() {
  6787. var uuid = '';
  6788. if (getPlatformName() === 'n') {
  6789. try {
  6790. uuid = plus.runtime.getDCloudId();
  6791. } catch (e) {
  6792. uuid = '';
  6793. }
  6794. return uuid;
  6795. }
  6796. try {
  6797. uuid = uni.getStorageSync(UUID_KEY);
  6798. } catch (e) {
  6799. uuid = UUID_VALUE;
  6800. }
  6801. if (!uuid) {
  6802. uuid = Date.now() + '' + Math.floor(Math.random() * 1e7);
  6803. try {
  6804. uni.setStorageSync(UUID_KEY, uuid);
  6805. } catch (e) {
  6806. uni.setStorageSync(UUID_KEY, UUID_VALUE);
  6807. }
  6808. }
  6809. return uuid;
  6810. }
  6811. var getSgin = function getSgin(statData) {
  6812. var arr = Object.keys(statData);
  6813. var sortArr = arr.sort();
  6814. var sgin = {};
  6815. var sginStr = '';
  6816. for (var i in sortArr) {
  6817. sgin[sortArr[i]] = statData[sortArr[i]];
  6818. sginStr += sortArr[i] + '=' + statData[sortArr[i]] + '&';
  6819. }
  6820. // const options = sginStr.substr(0, sginStr.length - 1)
  6821. // sginStr = sginStr.substr(0, sginStr.length - 1) + '&key=' + STAT_KEY;
  6822. // const si = crypto.createHash('md5').update(sginStr).digest('hex');
  6823. return {
  6824. sign: '',
  6825. options: sginStr.substr(0, sginStr.length - 1) };
  6826. };
  6827. var getSplicing = function getSplicing(data) {
  6828. var str = '';
  6829. for (var i in data) {
  6830. str += i + '=' + data[i] + '&';
  6831. }
  6832. return str.substr(0, str.length - 1);
  6833. };
  6834. var getTime = function getTime() {
  6835. return parseInt(new Date().getTime() / 1000);
  6836. };
  6837. var getPlatformName = function getPlatformName() {
  6838. var platformList = {
  6839. 'app-plus': 'n',
  6840. 'h5': 'h5',
  6841. 'mp-weixin': 'wx',
  6842. 'mp-alipay': 'ali',
  6843. 'mp-baidu': 'bd',
  6844. 'mp-toutiao': 'tt',
  6845. 'mp-qq': 'qq' };
  6846. return platformList["mp-weixin"];
  6847. };
  6848. var getPackName = function getPackName() {
  6849. var packName = '';
  6850. if (getPlatformName() === 'wx' || getPlatformName() === 'qq') {
  6851. // 兼容微信小程序低版本基础库
  6852. if (uni.canIUse('getAccountInfoSync')) {
  6853. packName = uni.getAccountInfoSync().miniProgram.appId || '';
  6854. }
  6855. }
  6856. return packName;
  6857. };
  6858. var getVersion = function getVersion() {
  6859. return getPlatformName() === 'n' ? plus.runtime.version : '';
  6860. };
  6861. var getChannel = function getChannel() {
  6862. var platformName = getPlatformName();
  6863. var channel = '';
  6864. if (platformName === 'n') {
  6865. channel = plus.runtime.channel;
  6866. }
  6867. return channel;
  6868. };
  6869. var getScene = function getScene(options) {
  6870. var platformName = getPlatformName();
  6871. var scene = '';
  6872. if (options) {
  6873. return options;
  6874. }
  6875. if (platformName === 'wx') {
  6876. scene = uni.getLaunchOptionsSync().scene;
  6877. }
  6878. return scene;
  6879. };
  6880. var First__Visit__Time__KEY = 'First__Visit__Time';
  6881. var Last__Visit__Time__KEY = 'Last__Visit__Time';
  6882. var getFirstVisitTime = function getFirstVisitTime() {
  6883. var timeStorge = uni.getStorageSync(First__Visit__Time__KEY);
  6884. var time = 0;
  6885. if (timeStorge) {
  6886. time = timeStorge;
  6887. } else {
  6888. time = getTime();
  6889. uni.setStorageSync(First__Visit__Time__KEY, time);
  6890. uni.removeStorageSync(Last__Visit__Time__KEY);
  6891. }
  6892. return time;
  6893. };
  6894. var getLastVisitTime = function getLastVisitTime() {
  6895. var timeStorge = uni.getStorageSync(Last__Visit__Time__KEY);
  6896. var time = 0;
  6897. if (timeStorge) {
  6898. time = timeStorge;
  6899. } else {
  6900. time = '';
  6901. }
  6902. uni.setStorageSync(Last__Visit__Time__KEY, getTime());
  6903. return time;
  6904. };
  6905. var PAGE_RESIDENCE_TIME = '__page__residence__time';
  6906. var First_Page_residence_time = 0;
  6907. var Last_Page_residence_time = 0;
  6908. var setPageResidenceTime = function setPageResidenceTime() {
  6909. First_Page_residence_time = getTime();
  6910. if (getPlatformName() === 'n') {
  6911. uni.setStorageSync(PAGE_RESIDENCE_TIME, getTime());
  6912. }
  6913. return First_Page_residence_time;
  6914. };
  6915. var getPageResidenceTime = function getPageResidenceTime() {
  6916. Last_Page_residence_time = getTime();
  6917. if (getPlatformName() === 'n') {
  6918. First_Page_residence_time = uni.getStorageSync(PAGE_RESIDENCE_TIME);
  6919. }
  6920. return Last_Page_residence_time - First_Page_residence_time;
  6921. };
  6922. var TOTAL__VISIT__COUNT = 'Total__Visit__Count';
  6923. var getTotalVisitCount = function getTotalVisitCount() {
  6924. var timeStorge = uni.getStorageSync(TOTAL__VISIT__COUNT);
  6925. var count = 1;
  6926. if (timeStorge) {
  6927. count = timeStorge;
  6928. count++;
  6929. }
  6930. uni.setStorageSync(TOTAL__VISIT__COUNT, count);
  6931. return count;
  6932. };
  6933. var GetEncodeURIComponentOptions = function GetEncodeURIComponentOptions(statData) {
  6934. var data = {};
  6935. for (var prop in statData) {
  6936. data[prop] = encodeURIComponent(statData[prop]);
  6937. }
  6938. return data;
  6939. };
  6940. var Set__First__Time = 0;
  6941. var Set__Last__Time = 0;
  6942. var getFirstTime = function getFirstTime() {
  6943. var time = new Date().getTime();
  6944. Set__First__Time = time;
  6945. Set__Last__Time = 0;
  6946. return time;
  6947. };
  6948. var getLastTime = function getLastTime() {
  6949. var time = new Date().getTime();
  6950. Set__Last__Time = time;
  6951. return time;
  6952. };
  6953. var getResidenceTime = function getResidenceTime(type) {
  6954. var residenceTime = 0;
  6955. if (Set__First__Time !== 0) {
  6956. residenceTime = Set__Last__Time - Set__First__Time;
  6957. }
  6958. residenceTime = parseInt(residenceTime / 1000);
  6959. residenceTime = residenceTime < 1 ? 1 : residenceTime;
  6960. if (type === 'app') {
  6961. var overtime = residenceTime > APP_PVER_TIME ? true : false;
  6962. return {
  6963. residenceTime: residenceTime,
  6964. overtime: overtime };
  6965. }
  6966. if (type === 'page') {
  6967. var _overtime = residenceTime > PAGE_PVER_TIME ? true : false;
  6968. return {
  6969. residenceTime: residenceTime,
  6970. overtime: _overtime };
  6971. }
  6972. return {
  6973. residenceTime: residenceTime };
  6974. };
  6975. var getRoute = function getRoute() {
  6976. var pages = getCurrentPages();
  6977. var page = pages[pages.length - 1];
  6978. var _self = page.$vm;
  6979. if (getPlatformName() === 'bd') {
  6980. return _self.$mp && _self.$mp.page.is;
  6981. } else {
  6982. return _self.$scope && _self.$scope.route || _self.$mp && _self.$mp.page.route;
  6983. }
  6984. };
  6985. var getPageRoute = function getPageRoute(self) {
  6986. var pages = getCurrentPages();
  6987. var page = pages[pages.length - 1];
  6988. var _self = page.$vm;
  6989. var query = self._query;
  6990. var str = query && JSON.stringify(query) !== '{}' ? '?' + JSON.stringify(query) : '';
  6991. // clear
  6992. self._query = '';
  6993. if (getPlatformName() === 'bd') {
  6994. return _self.$mp && _self.$mp.page.is + str;
  6995. } else {
  6996. return _self.$scope && _self.$scope.route + str || _self.$mp && _self.$mp.page.route + str;
  6997. }
  6998. };
  6999. var getPageTypes = function getPageTypes(self) {
  7000. if (self.mpType === 'page' || self.$mp && self.$mp.mpType === 'page' || self.$options.mpType === 'page') {
  7001. return true;
  7002. }
  7003. return false;
  7004. };
  7005. var calibration = function calibration(eventName, options) {
  7006. // login 、 share 、pay_success 、pay_fail 、register 、title
  7007. if (!eventName) {
  7008. console.error("uni.report \u7F3A\u5C11 [eventName] \u53C2\u6570");
  7009. return true;
  7010. }
  7011. if (typeof eventName !== 'string') {
  7012. console.error("uni.report [eventName] \u53C2\u6570\u7C7B\u578B\u9519\u8BEF,\u53EA\u80FD\u4E3A String \u7C7B\u578B");
  7013. return true;
  7014. }
  7015. if (eventName.length > 255) {
  7016. console.error("uni.report [eventName] \u53C2\u6570\u957F\u5EA6\u4E0D\u80FD\u5927\u4E8E 255");
  7017. return true;
  7018. }
  7019. if (typeof options !== 'string' && typeof options !== 'object') {
  7020. console.error("uni.report [options] \u53C2\u6570\u7C7B\u578B\u9519\u8BEF,\u53EA\u80FD\u4E3A String \u6216 Object \u7C7B\u578B");
  7021. return true;
  7022. }
  7023. if (typeof options === 'string' && options.length > 255) {
  7024. console.error("uni.report [options] \u53C2\u6570\u957F\u5EA6\u4E0D\u80FD\u5927\u4E8E 255");
  7025. return true;
  7026. }
  7027. if (eventName === 'title' && typeof options !== 'string') {
  7028. console.error('uni.report [eventName] 参数为 title 时,[options] 参数只能为 String 类型');
  7029. return true;
  7030. }
  7031. };
  7032. var PagesJson = __webpack_require__(/*! uni-pages?{"type":"style"} */ 7).default;
  7033. var statConfig = __webpack_require__(/*! uni-stat-config */ 8).default || __webpack_require__(/*! uni-stat-config */ 8);
  7034. var resultOptions = uni.getSystemInfoSync();var
  7035. Util = /*#__PURE__*/function () {
  7036. function Util() {_classCallCheck(this, Util);
  7037. this.self = '';
  7038. this._retry = 0;
  7039. this._platform = '';
  7040. this._query = {};
  7041. this._navigationBarTitle = {
  7042. config: '',
  7043. page: '',
  7044. report: '',
  7045. lt: '' };
  7046. this._operatingTime = 0;
  7047. this._reportingRequestData = {
  7048. '1': [],
  7049. '11': [] };
  7050. this.__prevent_triggering = false;
  7051. this.__licationHide = false;
  7052. this.__licationShow = false;
  7053. this._lastPageRoute = '';
  7054. this.statData = {
  7055. uuid: getUuid(),
  7056. ut: getPlatformName(),
  7057. mpn: getPackName(),
  7058. ak: statConfig.appid,
  7059. usv: STAT_VERSION,
  7060. v: getVersion(),
  7061. ch: getChannel(),
  7062. cn: '',
  7063. pn: '',
  7064. ct: '',
  7065. t: getTime(),
  7066. tt: '',
  7067. p: resultOptions.platform === 'android' ? 'a' : 'i',
  7068. brand: resultOptions.brand || '',
  7069. md: resultOptions.model,
  7070. sv: resultOptions.system.replace(/(Android|iOS)\s/, ''),
  7071. mpsdk: resultOptions.SDKVersion || '',
  7072. mpv: resultOptions.version || '',
  7073. lang: resultOptions.language,
  7074. pr: resultOptions.pixelRatio,
  7075. ww: resultOptions.windowWidth,
  7076. wh: resultOptions.windowHeight,
  7077. sw: resultOptions.screenWidth,
  7078. sh: resultOptions.screenHeight };
  7079. }_createClass(Util, [{ key: "_applicationShow", value: function _applicationShow()
  7080. {
  7081. if (this.__licationHide) {
  7082. getLastTime();
  7083. var time = getResidenceTime('app');
  7084. if (time.overtime) {
  7085. var options = {
  7086. path: this._lastPageRoute,
  7087. scene: this.statData.sc };
  7088. this._sendReportRequest(options);
  7089. }
  7090. this.__licationHide = false;
  7091. }
  7092. } }, { key: "_applicationHide", value: function _applicationHide(
  7093. self, type) {
  7094. this.__licationHide = true;
  7095. getLastTime();
  7096. var time = getResidenceTime();
  7097. getFirstTime();
  7098. var route = getPageRoute(this);
  7099. this._sendHideRequest({
  7100. urlref: route,
  7101. urlref_ts: time.residenceTime },
  7102. type);
  7103. } }, { key: "_pageShow", value: function _pageShow()
  7104. {
  7105. var route = getPageRoute(this);
  7106. var routepath = getRoute();
  7107. this._navigationBarTitle.config = PagesJson &&
  7108. PagesJson.pages[routepath] &&
  7109. PagesJson.pages[routepath].titleNView &&
  7110. PagesJson.pages[routepath].titleNView.titleText ||
  7111. PagesJson &&
  7112. PagesJson.pages[routepath] &&
  7113. PagesJson.pages[routepath].navigationBarTitleText || '';
  7114. if (this.__licationShow) {
  7115. getFirstTime();
  7116. this.__licationShow = false;
  7117. // console.log('这是 onLauch 之后执行的第一次 pageShow ,为下次记录时间做准备');
  7118. this._lastPageRoute = route;
  7119. return;
  7120. }
  7121. getLastTime();
  7122. this._lastPageRoute = route;
  7123. var time = getResidenceTime('page');
  7124. if (time.overtime) {
  7125. var options = {
  7126. path: this._lastPageRoute,
  7127. scene: this.statData.sc };
  7128. this._sendReportRequest(options);
  7129. }
  7130. getFirstTime();
  7131. } }, { key: "_pageHide", value: function _pageHide()
  7132. {
  7133. if (!this.__licationHide) {
  7134. getLastTime();
  7135. var time = getResidenceTime('page');
  7136. this._sendPageRequest({
  7137. url: this._lastPageRoute,
  7138. urlref: this._lastPageRoute,
  7139. urlref_ts: time.residenceTime });
  7140. this._navigationBarTitle = {
  7141. config: '',
  7142. page: '',
  7143. report: '',
  7144. lt: '' };
  7145. return;
  7146. }
  7147. } }, { key: "_login", value: function _login()
  7148. {
  7149. this._sendEventRequest({
  7150. key: 'login' },
  7151. 0);
  7152. } }, { key: "_share", value: function _share()
  7153. {
  7154. this._sendEventRequest({
  7155. key: 'share' },
  7156. 0);
  7157. } }, { key: "_payment", value: function _payment(
  7158. key) {
  7159. this._sendEventRequest({
  7160. key: key },
  7161. 0);
  7162. } }, { key: "_sendReportRequest", value: function _sendReportRequest(
  7163. options) {
  7164. this._navigationBarTitle.lt = '1';
  7165. var query = options.query && JSON.stringify(options.query) !== '{}' ? '?' + JSON.stringify(options.query) : '';
  7166. this.statData.lt = '1';
  7167. this.statData.url = options.path + query || '';
  7168. this.statData.t = getTime();
  7169. this.statData.sc = getScene(options.scene);
  7170. this.statData.fvts = getFirstVisitTime();
  7171. this.statData.lvts = getLastVisitTime();
  7172. this.statData.tvc = getTotalVisitCount();
  7173. if (getPlatformName() === 'n') {
  7174. this.getProperty();
  7175. } else {
  7176. this.getNetworkInfo();
  7177. }
  7178. } }, { key: "_sendPageRequest", value: function _sendPageRequest(
  7179. opt) {var
  7180. url =
  7181. opt.url,urlref = opt.urlref,urlref_ts = opt.urlref_ts;
  7182. this._navigationBarTitle.lt = '11';
  7183. var options = {
  7184. ak: this.statData.ak,
  7185. uuid: this.statData.uuid,
  7186. lt: '11',
  7187. ut: this.statData.ut,
  7188. url: url,
  7189. tt: this.statData.tt,
  7190. urlref: urlref,
  7191. urlref_ts: urlref_ts,
  7192. ch: this.statData.ch,
  7193. usv: this.statData.usv,
  7194. t: getTime(),
  7195. p: this.statData.p };
  7196. this.request(options);
  7197. } }, { key: "_sendHideRequest", value: function _sendHideRequest(
  7198. opt, type) {var
  7199. urlref =
  7200. opt.urlref,urlref_ts = opt.urlref_ts;
  7201. var options = {
  7202. ak: this.statData.ak,
  7203. uuid: this.statData.uuid,
  7204. lt: '3',
  7205. ut: this.statData.ut,
  7206. urlref: urlref,
  7207. urlref_ts: urlref_ts,
  7208. ch: this.statData.ch,
  7209. usv: this.statData.usv,
  7210. t: getTime(),
  7211. p: this.statData.p };
  7212. this.request(options, type);
  7213. } }, { key: "_sendEventRequest", value: function _sendEventRequest()
  7214. {var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},_ref$key = _ref.key,key = _ref$key === void 0 ? '' : _ref$key,_ref$value = _ref.value,value = _ref$value === void 0 ? "" : _ref$value;
  7215. var route = this._lastPageRoute;
  7216. var options = {
  7217. ak: this.statData.ak,
  7218. uuid: this.statData.uuid,
  7219. lt: '21',
  7220. ut: this.statData.ut,
  7221. url: route,
  7222. ch: this.statData.ch,
  7223. e_n: key,
  7224. e_v: typeof value === 'object' ? JSON.stringify(value) : value.toString(),
  7225. usv: this.statData.usv,
  7226. t: getTime(),
  7227. p: this.statData.p };
  7228. this.request(options);
  7229. } }, { key: "getNetworkInfo", value: function getNetworkInfo()
  7230. {var _this = this;
  7231. uni.getNetworkType({
  7232. success: function success(result) {
  7233. _this.statData.net = result.networkType;
  7234. _this.getLocation();
  7235. } });
  7236. } }, { key: "getProperty", value: function getProperty()
  7237. {var _this2 = this;
  7238. plus.runtime.getProperty(plus.runtime.appid, function (wgtinfo) {
  7239. _this2.statData.v = wgtinfo.version || '';
  7240. _this2.getNetworkInfo();
  7241. });
  7242. } }, { key: "getLocation", value: function getLocation()
  7243. {var _this3 = this;
  7244. if (statConfig.getLocation) {
  7245. uni.getLocation({
  7246. type: 'wgs84',
  7247. geocode: true,
  7248. success: function success(result) {
  7249. if (result.address) {
  7250. _this3.statData.cn = result.address.country;
  7251. _this3.statData.pn = result.address.province;
  7252. _this3.statData.ct = result.address.city;
  7253. }
  7254. _this3.statData.lat = result.latitude;
  7255. _this3.statData.lng = result.longitude;
  7256. _this3.request(_this3.statData);
  7257. } });
  7258. } else {
  7259. this.statData.lat = 0;
  7260. this.statData.lng = 0;
  7261. this.request(this.statData);
  7262. }
  7263. } }, { key: "request", value: function request(
  7264. data, type) {var _this4 = this;
  7265. var time = getTime();
  7266. var title = this._navigationBarTitle;
  7267. data.ttn = title.page;
  7268. data.ttpj = title.config;
  7269. data.ttc = title.report;
  7270. var requestData = this._reportingRequestData;
  7271. if (getPlatformName() === 'n') {
  7272. requestData = uni.getStorageSync('__UNI__STAT__DATA') || {};
  7273. }
  7274. if (!requestData[data.lt]) {
  7275. requestData[data.lt] = [];
  7276. }
  7277. requestData[data.lt].push(data);
  7278. if (getPlatformName() === 'n') {
  7279. uni.setStorageSync('__UNI__STAT__DATA', requestData);
  7280. }
  7281. if (getPageResidenceTime() < OPERATING_TIME && !type) {
  7282. return;
  7283. }
  7284. var uniStatData = this._reportingRequestData;
  7285. if (getPlatformName() === 'n') {
  7286. uniStatData = uni.getStorageSync('__UNI__STAT__DATA');
  7287. }
  7288. // 时间超过,重新获取时间戳
  7289. setPageResidenceTime();
  7290. var firstArr = [];
  7291. var contentArr = [];
  7292. var lastArr = [];var _loop = function _loop(
  7293. i) {
  7294. var rd = uniStatData[i];
  7295. rd.forEach(function (elm) {
  7296. var newData = getSplicing(elm);
  7297. if (i === 0) {
  7298. firstArr.push(newData);
  7299. } else if (i === 3) {
  7300. lastArr.push(newData);
  7301. } else {
  7302. contentArr.push(newData);
  7303. }
  7304. });};for (var i in uniStatData) {_loop(i);
  7305. }
  7306. firstArr.push.apply(firstArr, contentArr.concat(lastArr));
  7307. var optionsData = {
  7308. usv: STAT_VERSION, //统计 SDK 版本号
  7309. t: time, //发送请求时的时间戮
  7310. requests: JSON.stringify(firstArr) };
  7311. this._reportingRequestData = {};
  7312. if (getPlatformName() === 'n') {
  7313. uni.removeStorageSync('__UNI__STAT__DATA');
  7314. }
  7315. if (data.ut === 'h5') {
  7316. this.imageRequest(optionsData);
  7317. return;
  7318. }
  7319. if (getPlatformName() === 'n' && this.statData.p === 'a') {
  7320. setTimeout(function () {
  7321. _this4._sendRequest(optionsData);
  7322. }, 200);
  7323. return;
  7324. }
  7325. this._sendRequest(optionsData);
  7326. } }, { key: "_sendRequest", value: function _sendRequest(
  7327. optionsData) {var _this5 = this;
  7328. uni.request({
  7329. url: STAT_URL,
  7330. method: 'POST',
  7331. // header: {
  7332. // 'content-type': 'application/json' // 默认值
  7333. // },
  7334. data: optionsData,
  7335. success: function success() {
  7336. // if (process.env.NODE_ENV === 'development') {
  7337. // console.log('stat request success');
  7338. // }
  7339. },
  7340. fail: function fail(e) {
  7341. if (++_this5._retry < 3) {
  7342. setTimeout(function () {
  7343. _this5._sendRequest(optionsData);
  7344. }, 1000);
  7345. }
  7346. } });
  7347. }
  7348. /**
  7349. * h5 请求
  7350. */ }, { key: "imageRequest", value: function imageRequest(
  7351. data) {
  7352. var image = new Image();
  7353. var options = getSgin(GetEncodeURIComponentOptions(data)).options;
  7354. image.src = STAT_H5_URL + '?' + options;
  7355. } }, { key: "sendEvent", value: function sendEvent(
  7356. key, value) {
  7357. // 校验 type 参数
  7358. if (calibration(key, value)) return;
  7359. if (key === 'title') {
  7360. this._navigationBarTitle.report = value;
  7361. return;
  7362. }
  7363. this._sendEventRequest({
  7364. key: key,
  7365. value: typeof value === 'object' ? JSON.stringify(value) : value },
  7366. 1);
  7367. } }]);return Util;}();var
  7368. Stat = /*#__PURE__*/function (_Util) {_inherits(Stat, _Util);_createClass(Stat, null, [{ key: "getInstance", value: function getInstance()
  7369. {
  7370. if (!this.instance) {
  7371. this.instance = new Stat();
  7372. }
  7373. return this.instance;
  7374. } }]);
  7375. function Stat() {var _this6;_classCallCheck(this, Stat);
  7376. _this6 = _possibleConstructorReturn(this, _getPrototypeOf(Stat).call(this));
  7377. _this6.instance = null;
  7378. // 注册拦截器
  7379. if (typeof uni.addInterceptor === 'function' && "development" !== 'development') {
  7380. _this6.addInterceptorInit();
  7381. _this6.interceptLogin();
  7382. _this6.interceptShare(true);
  7383. _this6.interceptRequestPayment();
  7384. }return _this6;
  7385. }_createClass(Stat, [{ key: "addInterceptorInit", value: function addInterceptorInit()
  7386. {
  7387. var self = this;
  7388. uni.addInterceptor('setNavigationBarTitle', {
  7389. invoke: function invoke(args) {
  7390. self._navigationBarTitle.page = args.title;
  7391. } });
  7392. } }, { key: "interceptLogin", value: function interceptLogin()
  7393. {
  7394. var self = this;
  7395. uni.addInterceptor('login', {
  7396. complete: function complete() {
  7397. self._login();
  7398. } });
  7399. } }, { key: "interceptShare", value: function interceptShare(
  7400. type) {
  7401. var self = this;
  7402. if (!type) {
  7403. self._share();
  7404. return;
  7405. }
  7406. uni.addInterceptor('share', {
  7407. success: function success() {
  7408. self._share();
  7409. },
  7410. fail: function fail() {
  7411. self._share();
  7412. } });
  7413. } }, { key: "interceptRequestPayment", value: function interceptRequestPayment()
  7414. {
  7415. var self = this;
  7416. uni.addInterceptor('requestPayment', {
  7417. success: function success() {
  7418. self._payment('pay_success');
  7419. },
  7420. fail: function fail() {
  7421. self._payment('pay_fail');
  7422. } });
  7423. } }, { key: "report", value: function report(
  7424. options, self) {
  7425. this.self = self;
  7426. // if (process.env.NODE_ENV === 'development') {
  7427. // console.log('report init');
  7428. // }
  7429. setPageResidenceTime();
  7430. this.__licationShow = true;
  7431. this._sendReportRequest(options, true);
  7432. } }, { key: "load", value: function load(
  7433. options, self) {
  7434. if (!self.$scope && !self.$mp) {
  7435. var page = getCurrentPages();
  7436. self.$scope = page[page.length - 1];
  7437. }
  7438. this.self = self;
  7439. this._query = options;
  7440. } }, { key: "show", value: function show(
  7441. self) {
  7442. this.self = self;
  7443. if (getPageTypes(self)) {
  7444. this._pageShow(self);
  7445. } else {
  7446. this._applicationShow(self);
  7447. }
  7448. } }, { key: "ready", value: function ready(
  7449. self) {
  7450. // this.self = self;
  7451. // if (getPageTypes(self)) {
  7452. // this._pageShow(self);
  7453. // }
  7454. } }, { key: "hide", value: function hide(
  7455. self) {
  7456. this.self = self;
  7457. if (getPageTypes(self)) {
  7458. this._pageHide(self);
  7459. } else {
  7460. this._applicationHide(self, true);
  7461. }
  7462. } }, { key: "error", value: function error(
  7463. em) {
  7464. if (this._platform === 'devtools') {
  7465. if (true) {
  7466. console.info('当前运行环境为开发者工具,不上报数据。');
  7467. }
  7468. // return;
  7469. }
  7470. var emVal = '';
  7471. if (!em.message) {
  7472. emVal = JSON.stringify(em);
  7473. } else {
  7474. emVal = em.stack;
  7475. }
  7476. var options = {
  7477. ak: this.statData.ak,
  7478. uuid: this.statData.uuid,
  7479. lt: '31',
  7480. ut: this.statData.ut,
  7481. ch: this.statData.ch,
  7482. mpsdk: this.statData.mpsdk,
  7483. mpv: this.statData.mpv,
  7484. v: this.statData.v,
  7485. em: emVal,
  7486. usv: this.statData.usv,
  7487. t: getTime(),
  7488. p: this.statData.p };
  7489. this.request(options);
  7490. } }]);return Stat;}(Util);
  7491. var stat = Stat.getInstance();
  7492. var isHide = false;
  7493. var lifecycle = {
  7494. onLaunch: function onLaunch(options) {
  7495. stat.report(options, this);
  7496. },
  7497. onReady: function onReady() {
  7498. stat.ready(this);
  7499. },
  7500. onLoad: function onLoad(options) {
  7501. stat.load(options, this);
  7502. // 重写分享,获取分享上报事件
  7503. if (this.$scope && this.$scope.onShareAppMessage) {
  7504. var oldShareAppMessage = this.$scope.onShareAppMessage;
  7505. this.$scope.onShareAppMessage = function (options) {
  7506. stat.interceptShare(false);
  7507. return oldShareAppMessage.call(this, options);
  7508. };
  7509. }
  7510. },
  7511. onShow: function onShow() {
  7512. isHide = false;
  7513. stat.show(this);
  7514. },
  7515. onHide: function onHide() {
  7516. isHide = true;
  7517. stat.hide(this);
  7518. },
  7519. onUnload: function onUnload() {
  7520. if (isHide) {
  7521. isHide = false;
  7522. return;
  7523. }
  7524. stat.hide(this);
  7525. },
  7526. onError: function onError(e) {
  7527. stat.error(e);
  7528. } };
  7529. function main() {
  7530. if (true) {
  7531. uni.report = function (type, options) {};
  7532. } else { var Vue; }
  7533. }
  7534. main();
  7535. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  7536. /***/ }),
  7537. /* 6 */
  7538. /*!******************************************************!*\
  7539. !*** ./node_modules/@dcloudio/uni-stat/package.json ***!
  7540. \******************************************************/
  7541. /*! exports provided: _from, _id, _inBundle, _integrity, _location, _phantomChildren, _requested, _requiredBy, _resolved, _shasum, _spec, _where, author, bugs, bundleDependencies, deprecated, description, devDependencies, files, gitHead, homepage, license, main, name, repository, scripts, version, default */
  7542. /***/ (function(module) {
  7543. module.exports = {"_from":"@dcloudio/uni-stat@next","_id":"@dcloudio/uni-stat@2.0.0-26420200313001","_inBundle":false,"_integrity":"sha512-7dPuazTiDmUyRcw+WW+UlWGKH0eeCUB+p0P4pJVKEHjpdXnXgvDQCSdJk764NH99TfsUycnuxecP5oHckVa88g==","_location":"/@dcloudio/uni-stat","_phantomChildren":{},"_requested":{"type":"tag","registry":true,"raw":"@dcloudio/uni-stat@next","name":"@dcloudio/uni-stat","escapedName":"@dcloudio%2funi-stat","scope":"@dcloudio","rawSpec":"next","saveSpec":null,"fetchSpec":"next"},"_requiredBy":["#USER","/","/@dcloudio/vue-cli-plugin-uni"],"_resolved":"https://registry.npmjs.org/@dcloudio/uni-stat/-/uni-stat-2.0.0-26420200313001.tgz","_shasum":"a006e329e033cd412accfa635f8933dbb822a9c3","_spec":"@dcloudio/uni-stat@next","_where":"/Users/guoshengqiang/Documents/dcloud-plugins/release/uniapp-cli","author":"","bugs":{"url":"https://github.com/dcloudio/uni-app/issues"},"bundleDependencies":false,"deprecated":false,"description":"","devDependencies":{"@babel/core":"^7.5.5","@babel/preset-env":"^7.5.5","eslint":"^6.1.0","rollup":"^1.19.3","rollup-plugin-babel":"^4.3.3","rollup-plugin-clear":"^2.0.7","rollup-plugin-commonjs":"^10.0.2","rollup-plugin-copy":"^3.1.0","rollup-plugin-eslint":"^7.0.0","rollup-plugin-json":"^4.0.0","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-replace":"^2.2.0","rollup-plugin-uglify":"^6.0.2"},"files":["dist","package.json","LICENSE"],"gitHead":"b1fdbafab5dd4673cff64188a5203d0c947e4f50","homepage":"https://github.com/dcloudio/uni-app#readme","license":"Apache-2.0","main":"dist/index.js","name":"@dcloudio/uni-stat","repository":{"type":"git","url":"git+https://github.com/dcloudio/uni-app.git","directory":"packages/uni-stat"},"scripts":{"build":"NODE_ENV=production rollup -c rollup.config.js","dev":"NODE_ENV=development rollup -w -c rollup.config.js"},"version":"2.0.0-26420200313001"};
  7544. /***/ }),
  7545. /* 7 */
  7546. /*!*****************************************************************************!*\
  7547. !*** C:/Users/Jzdsh/Desktop/附近养车网uni-app/附近养车网/pages.json?{"type":"style"} ***!
  7548. \*****************************************************************************/
  7549. /*! no static exports found */
  7550. /***/ (function(module, exports, __webpack_require__) {
  7551. "use strict";
  7552. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = { "pages": { "pages/packageOne/service/serviceView/serviceView": { "navigationBarTitleText": "附近养车网", "navigationBarBackgroundColor": "#FFFFFF" }, "pages/packageOne/service/index/index": {}, "pages/packageOne/service/user/index/index": {}, "components/shop-item/shop-item": {}, "pages/packageOne/service/classify/shop_detail/shop_detail": { "navigationBarTitleText": "商家详情" }, "pages/packageOne/service/classify/photo/photo": { "navigationBarTitleText": "图册" }, "pages/packageOne/service/classify/all_serve/all_serve": { "navigationBarTitleText": "查看明细" }, "pages/packageOne/service/classify/project_detail/project_detail": { "navigationBarTitleText": "服务详情" }, "pages/packageOne/service/classify/brand_detail/brand_detail": { "navigationBarTitleText": "品牌详情" }, "pages/packageOne/service/classify/other_shop/other_shop": { "navigationBarTitleText": "商家列表" }, "components/shop_error/shop_error": { "navigationBarTitleText": "商家报错" }, "components/message_error/message_error": {}, "components/no_bussiness/no_bussiness": {}, "components/free-enter/free-enter": {}, "components/news/list/list": {}, "components/news/detail/detail": {}, "pages/packageOne/freeEnter/index/index": { "navigationBarTitleText": "入驻申请" }, "pages/packageOne/freeEnter/bind_tel/bind_tel": { "navigationBarTitleText": "绑定手机号" }, "pages/packageOne/freeEnter/write_data/write_data": { "navigationBarTitleText": "入驻资料提交" }, "pages/packageOne/freeEnter/service_select/service_select": { "navigationBarTitleText": "选择主营信息" }, "pages/packageOne/freeEnter/service_add/service_add": { "navigationBarTitleText": "添加主营信息" }, "pages/packageOne/freeEnter/submit_success/submit_success": { "navigationBarTitleText": "提交成功" }, "pages/packageOne/freeEnter/to_vip/to_vip": { "navigationBarTitleText": "认证资料提交" }, "pages/packageOne/freeEnter/vip_introduce/vip_introduce": { "navigationBarTitleText": "立即认证" }, "pages/packageOne/freeEnter/submit_order/submit_order": { "navigationBarTitleText": "支付订单" }, "pages/packageOne/freeEnter/discounts/discounts": { "navigationBarTitleText": "优惠券" }, "pages/packageOne/freeEnter/pay_success/pay_success": { "navigationBarTitleText": "支付成功" }, "pages/packageOne/freeEnter/user_agreement/user_agreement": { "navigationBarTitleText": "平台许可使用协议" }, "pages/packageOne/freeEnter/agreement/agreement": { "navigationBarTitleText": "平台认证服务协议" }, "pages/packageOne/login/login": { "navigationBarTitleText": "授权登录" }, "pages/packageOne/user/feedback/feedback": { "navigationBarTitleText": "留言反馈" }, "pages/packageOne/user/message_center/message_list/message_list": { "navigationBarTitleText": "消息中心" }, "pages/packageOne/user/message_center/message_detail/message_detail": { "navigationBarTitleText": "系统消息" }, "pages/packageOne/user/my_collect/my_collect": { "navigationBarTitleText": "我的收藏" }, "pages/packageOne/user/history/history": { "navigationBarTitleText": "浏览记录" }, "pages/packageOne/user/share_friend/index/index": { "navigationBarTitleText": "分享推荐" }, "pages/packageOne/user/share_friend/list/list": { "navigationBarTitleText": "好友列表" }, "pages/packageOne/user/about/about": { "navigationBarTitleText": "关于我们" }, "pages/packageOne/user/help/help": { "navigationBarTitleText": "帮助中心" }, "pages/packageOne/service/user/store_manage/message/message": { "navigationBarTitleText": "店铺管理" }, "pages/packageOne/service/user/store_manage/my_serve/my_serve": { "navigationBarTitleText": "我的服务项目" }, "pages/packageOne/service/user/store_manage/add_my_serve/add_my_serve": { "navigationBarTitleText": "我的服务项目" }, "pages/packageOne/service/user/store_manage/serve_class/serve_class": { "navigationBarTitleText": "添加项目类别" }, "pages/packageOne/service/user/store_manage/write_serve/write_serve": { "navigationBarTitleText": "编辑" }, "pages/packageOne/service/user/store_manage/add_message/add_message": { "navigationBarTitleText": "修改主营业务" }, "pages/packageOne/service/user/store_manage/introduce/introduce": {} }, "globalStyle": { "navigationBarTextStyle": "black", "navigationBarTitleText": "附近养车网", "navigationBarBackgroundColor": "#FFFFFF", "backgroundColor": "#F8F8F8" } };exports.default = _default;
  7553. /***/ }),
  7554. /* 8 */
  7555. /*!****************************************************************************!*\
  7556. !*** C:/Users/Jzdsh/Desktop/附近养车网uni-app/附近养车网/pages.json?{"type":"stat"} ***!
  7557. \****************************************************************************/
  7558. /*! no static exports found */
  7559. /***/ (function(module, exports, __webpack_require__) {
  7560. "use strict";
  7561. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = { "appid": "" };exports.default = _default;
  7562. /***/ }),
  7563. /* 9 */,
  7564. /* 10 */,
  7565. /* 11 */,
  7566. /* 12 */
  7567. /*!********************************************************!*\
  7568. !*** C:/Users/Jzdsh/Desktop/附近养车网uni-app/附近养车网/api.js ***!
  7569. \********************************************************/
  7570. /*! no static exports found */
  7571. /***/ (function(module, exports, __webpack_require__) {
  7572. "use strict";
  7573. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  7574. var _request = _interopRequireDefault(__webpack_require__(/*! ./request.js */ 13));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} // Promise封装请求
  7575. // import Request from './request.js';
  7576. // let request = Request.http
  7577. // export default {
  7578. // getJobList: function () {
  7579. // return request('/jobList',{name:123},"Post",1)
  7580. // },
  7581. // getList: function (data) {
  7582. // return request('/jobList',data,"Post",1)
  7583. // }
  7584. // }
  7585. // flyio封装请求 拦截
  7586. var fly = _request.default.fly;var _default = { //登录获取token
  7587. getUserLogin: function getUserLogin(data) {return fly.request("user", data, { method: "post", timeout: 5000 //超时设置为5s
  7588. });}, //首页
  7589. getIndex: function getIndex(data) {//首页加载数据
  7590. return fly.request("p_search/show", data, { method: "post", timeout: 5000 //超时设置为5s
  7591. });}, //获取用户状态 入驻 审核中 管理店铺
  7592. // getUserStatus:(data)=>{
  7593. // return fly.request("p_search/show",data,{
  7594. // method:"post",
  7595. // timeout:5000 //超时设置为5s
  7596. // })
  7597. // },
  7598. //商家详情页
  7599. getShopDetail: function getShopDetail(data) {
  7600. return fly.request("p_search/provider_detail", data, {
  7601. method: "post",
  7602. timeout: 5000 //超时设置为5s
  7603. });
  7604. },
  7605. //商家详情跳转图册
  7606. getShopPhoto: function getShopPhoto(data) {
  7607. return fly.request("p_search/photo", data, {
  7608. method: "post",
  7609. timeout: 5000 //超时设置为5s
  7610. });
  7611. },
  7612. //商家详情跳转主营信息明细
  7613. getShopMessage: function getShopMessage(data) {
  7614. return fly.request("service_category/showServiceItemChoose", data, {
  7615. method: "post",
  7616. timeout: 5000 //超时设置为5s
  7617. });
  7618. },
  7619. //商家详情页服务项目导航栏点击查询
  7620. getShopProject: function getShopProject(data) {
  7621. return fly.request("p_search/list_service_item", data, {
  7622. method: "post",
  7623. timeout: 5000 //超时设置为5s
  7624. });
  7625. },
  7626. //商家服务项目详情
  7627. getShopProjectDetail: function getShopProjectDetail(data) {
  7628. return fly.request("p_search/service_item_detail", data, {
  7629. method: "post",
  7630. timeout: 5000 //超时设置为5s
  7631. });
  7632. },
  7633. //商家品牌详情查询
  7634. getShopBrand: function getShopBrand(data) {
  7635. return fly.request("p_search/get_brand", data, {
  7636. method: "post",
  7637. timeout: 5000 //超时设置为5s
  7638. });
  7639. },
  7640. //查询品牌下其他店铺
  7641. getBrandOther: function getBrandOther(data) {
  7642. return fly.request("p_search/other_provider", data, {
  7643. method: "post",
  7644. timeout: 5000 //超时设置为5s
  7645. });
  7646. },
  7647. //点击收藏商家
  7648. collect: function collect(data) {
  7649. return fly.request("common/collection/save", data, {
  7650. method: "post",
  7651. timeout: 5000 //超时设置为5s
  7652. });
  7653. },
  7654. //商家报错页面查询数据
  7655. getShopError: function getShopError(data) {
  7656. return fly.request("p_search/provider_show", data, {
  7657. method: "post",
  7658. timeout: 5000 //超时设置为5s
  7659. });
  7660. },
  7661. //商家报错提交数据
  7662. submitShopError: function submitShopError(data) {
  7663. return fly.request("p_search/save_correction", data, {
  7664. method: "post",
  7665. timeout: 5000 //超时设置为5s
  7666. });
  7667. },
  7668. //活动资讯加载列表
  7669. getNewsList: function getNewsList(data) {
  7670. return fly.request("p_search/activity_show", '', {
  7671. method: "post",
  7672. timeout: 5000 //超时设置为5s
  7673. });
  7674. },
  7675. // 导航栏切换查询数据
  7676. getNewsItem: function getNewsItem(data) {
  7677. return fly.request("p_search/get_activity_type", data, {
  7678. method: "post",
  7679. timeout: 5000 //超时设置为5s
  7680. });
  7681. },
  7682. //新闻列表跳详情
  7683. getNewsDetail: function getNewsDetail(data) {
  7684. return fly.request("p_search/get_activity", data, {
  7685. method: "post",
  7686. timeout: 5000 //超时设置为5s
  7687. });
  7688. },
  7689. //入驻绑定手机号发送验证码
  7690. getCode: function getCode(data) {
  7691. return fly.request("wx/send_sms_code", data, {
  7692. method: "post",
  7693. timeout: 5000 //超时设置为5s
  7694. });
  7695. },
  7696. //入驻绑定手机号提交
  7697. bindPhone: function bindPhone(data) {
  7698. return fly.request("wx/user_binding", data, {
  7699. method: "post",
  7700. timeout: 5000 //超时设置为5s
  7701. });
  7702. },
  7703. //入驻填写资料获取地理位置
  7704. getAddress: function getAddress(data) {
  7705. return fly.request("common/getAddress", data, {
  7706. method: "post",
  7707. timeout: 5000 //超时设置为5s
  7708. });
  7709. },
  7710. //获取服务商主营信息
  7711. getServiceMessage: function getServiceMessage(data) {
  7712. return fly.request("service_category/mainBusinessChoose", data, {
  7713. method: "post",
  7714. timeout: 5000 //超时设置为5s
  7715. });
  7716. },
  7717. //入驻提交信息
  7718. freeEnterSubmit: function freeEnterSubmit(data) {
  7719. return fly.request("provider/save", data, {
  7720. method: "post",
  7721. timeout: 5000 //超时设置为5s
  7722. });
  7723. },
  7724. //提交认证资料
  7725. submitVipData: function submitVipData(data) {
  7726. return fly.request("authentication/save", data, {
  7727. method: "post",
  7728. timeout: 5000 //超时设置为5s
  7729. });
  7730. },
  7731. //从用户下单起计算时间
  7732. getUserEnterTime: function getUserEnterTime(data) {
  7733. return fly.request("authentication/getAuthTimeBucket", data, {
  7734. method: "post",
  7735. timeout: 5000 //超时设置为5s
  7736. });
  7737. },
  7738. //下单使用默认优惠券
  7739. getUserDiscount: function getUserDiscount(data) {
  7740. return fly.request("authCoupon/default_useCoupon", data, {
  7741. method: "post",
  7742. timeout: 5000 //超时设置为5s
  7743. });
  7744. },
  7745. //下单支付
  7746. getUserPay: function getUserPay(data) {
  7747. return fly.request("order/unified_order", data, {
  7748. method: "post",
  7749. timeout: 5000 //超时设置为5s
  7750. });
  7751. },
  7752. //获取用户所有的优惠券
  7753. getUserAllDiscount: function getUserAllDiscount(data) {
  7754. return fly.request("authCoupon/listAuthCoupon", data, {
  7755. method: "post",
  7756. timeout: 5000 //超时设置为5s
  7757. });
  7758. },
  7759. //支付成功加载订单信息
  7760. getUserOrder: function getUserOrder(data) {
  7761. return fly.request("order/get_order", data, {
  7762. method: "post",
  7763. timeout: 5000 //超时设置为5s
  7764. });
  7765. },
  7766. //个人中心
  7767. //加载留言反馈数据
  7768. getUserFeedBack: function getUserFeedBack(data) {
  7769. return fly.request("common/all_feedback", data, {
  7770. method: "post",
  7771. timeout: 5000 //超时设置为5s
  7772. });
  7773. },
  7774. //留言反馈 提交表单
  7775. submitUserFeenBack: function submitUserFeenBack(data) {
  7776. return fly.request("common/save_feedback", data, {
  7777. method: "post",
  7778. timeout: 5000 //超时设置为5s
  7779. });
  7780. },
  7781. //留言反馈 回复内容
  7782. getUserFeedReply: function getUserFeedReply(data) {
  7783. return fly.request("common/tab_feedback", data, {
  7784. method: "post",
  7785. timeout: 5000 //超时设置为5s
  7786. });
  7787. },
  7788. //消息中心列表
  7789. getUserMessageList: function getUserMessageList(data) {
  7790. return fly.request("common/all_message", data, {
  7791. method: "post",
  7792. timeout: 5000 //超时设置为5s
  7793. });
  7794. },
  7795. //消息中心详情页
  7796. getUserMessageDetail: function getUserMessageDetail(data) {
  7797. return fly.request("common/get_message", data, {
  7798. method: "post",
  7799. timeout: 5000 //超时设置为5s
  7800. });
  7801. },
  7802. //个人中心我的收藏
  7803. getUserMyCollect: function getUserMyCollect(data) {
  7804. return fly.request("common/all_collection", data, {
  7805. method: "post",
  7806. timeout: 5000 //超时设置为5s
  7807. });
  7808. },
  7809. //删除我的收藏
  7810. deleteMyCollect: function deleteMyCollect(data) {
  7811. return fly.request("common/del_collection", data, {
  7812. method: "post",
  7813. timeout: 5000 //超时设置为5s
  7814. });
  7815. },
  7816. //浏览记录
  7817. getUserMyHistory: function getUserMyHistory(data) {
  7818. return fly.request("common/all_browse_record", data, {
  7819. method: "post",
  7820. timeout: 5000 //超时设置为5s
  7821. });
  7822. },
  7823. //删除浏览记录
  7824. deleteMyhistory: function deleteMyhistory(data) {
  7825. return fly.request("common/del_browse_record", data, {
  7826. method: "post",
  7827. timeout: 5000 //超时设置为5s
  7828. });
  7829. },
  7830. //加载分享人的数据
  7831. getUserMyShare: function getUserMyShare(data) {
  7832. return fly.request("authCoupon/invitationInfo", data, {
  7833. method: "post",
  7834. timeout: 5000 //超时设置为5s
  7835. });
  7836. },
  7837. //个人中心关于我们
  7838. getUserAbout: function getUserAbout() {
  7839. return fly.request("common/get_about", '', {
  7840. method: "post",
  7841. timeout: 5000 //超时设置为5s
  7842. });
  7843. },
  7844. //帮助中心
  7845. getUserHelp: function getUserHelp() {
  7846. return fly.request("common/all_hc", '', {
  7847. method: "post",
  7848. timeout: 5000 //超时设置为5s
  7849. });
  7850. },
  7851. //帮助中心导航栏点击查询
  7852. getUserHelpHeader: function getUserHelpHeader(data) {
  7853. return fly.request("common/all_hc_type", data, {
  7854. method: "post",
  7855. timeout: 5000 //超时设置为5s
  7856. });
  7857. },
  7858. //个人中心店铺管理
  7859. getUserStoreMessage: function getUserStoreMessage(data) {
  7860. return fly.request("provider/get_one", data, {
  7861. method: "post",
  7862. timeout: 5000 //超时设置为5s
  7863. });
  7864. },
  7865. //个人中心服务项目查询
  7866. getUserStoreMyServe: function getUserStoreMyServe(data) {
  7867. return fly.request("service_item/get_all", data, {
  7868. method: "post",
  7869. timeout: 5000 //超时设置为5s
  7870. });
  7871. },
  7872. //店铺管理服务项目导航栏点击查询
  7873. getUserStoreServeItem: function getUserStoreServeItem(data) {
  7874. return fly.request("p_search/list_service_item", data, {
  7875. method: "post",
  7876. timeout: 5000 //超时设置为5s
  7877. });
  7878. },
  7879. //店铺管理删除服务项目
  7880. delUserMyServe: function delUserMyServe(data) {
  7881. return fly.request("service_item/remove", data, {
  7882. method: "post",
  7883. timeout: 5000 //超时设置为5s
  7884. });
  7885. },
  7886. //项目类别
  7887. getUserMyServeClass: function getUserMyServeClass(data) {
  7888. return fly.request("service_category/serviceItemChoose", data, {
  7889. method: "post",
  7890. timeout: 5000 //超时设置为5s
  7891. });
  7892. },
  7893. //添加服务项目保存
  7894. submitUserMyServe: function submitUserMyServe(data) {
  7895. return fly.request("service_item/save", data, {
  7896. method: "post",
  7897. timeout: 5000 //超时设置为5s
  7898. });
  7899. },
  7900. //服务项目编辑,回显信息
  7901. getUserMyServrWrite: function getUserMyServrWrite(data) {
  7902. return fly.request("p_search/service_item_show", data, {
  7903. method: "post",
  7904. timeout: 5000 //超时设置为5s
  7905. });
  7906. },
  7907. //个人中心修改主营业务
  7908. getUserMyMessage: function getUserMyMessage(data) {
  7909. return fly.request("service_category/update_mainBusinessChoose", data, {
  7910. method: "post",
  7911. timeout: 5000 //超时设置为5s
  7912. });
  7913. } };exports.default = _default;
  7914. /***/ }),
  7915. /* 13 */
  7916. /*!************************************************************!*\
  7917. !*** C:/Users/Jzdsh/Desktop/附近养车网uni-app/附近养车网/request.js ***!
  7918. \************************************************************/
  7919. /*! no static exports found */
  7920. /***/ (function(module, exports, __webpack_require__) {
  7921. "use strict";
  7922. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  7923. var _asyncValidator = _interopRequireDefault(__webpack_require__(/*! async-validator */ 14));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} // uni-app请求封装
  7924. // export default class Request {
  7925. // http (router,data,method,flag) {
  7926. // // 基础地址
  7927. // let path = 'https://wx.fujinyangche.com/nvrnetwork/';
  7928. // goLogin();
  7929. // if(flag == 1){
  7930. // data.token = "123"
  7931. // }
  7932. // // 返回promise
  7933. // return new Promise((resolve,reject) => {
  7934. // // 请求
  7935. // uni.request({
  7936. // url: `${path}${router}`,
  7937. // data: data,
  7938. // method:method,
  7939. // success: (res) => {
  7940. // // 将结果抛出
  7941. // resolve(res.data)
  7942. // }
  7943. // })
  7944. // })
  7945. // }
  7946. // }
  7947. //promise封装请求
  7948. // export default {
  7949. // http (router,data,method,flag) {
  7950. // // 基础地址
  7951. // let path = 'https://wx.fujinyangche.com/nvrnetwork/';
  7952. // if(flag == 1){
  7953. // data.token = 123
  7954. // }
  7955. // // 返回promise
  7956. // return new Promise((resolve,reject) => {
  7957. // // 请求
  7958. // uni.request({
  7959. // url: `${path}${router}`,
  7960. // data: data,
  7961. // method:method,
  7962. // success: (res) => {
  7963. // // 将结果抛出
  7964. // resolve(res.data)
  7965. // }
  7966. // })
  7967. // })
  7968. // }
  7969. // }
  7970. //flyio 封装请求 拦截
  7971. var Fly = __webpack_require__(/*! ./node_modules/flyio/dist/npm/wx */ 17);var fly = new Fly(); // 配置请求根域名
  7972. // fly.config.baseURL = "https://wx.fujinyangche.com/nvrnetwork/";
  7973. fly.config.baseURL = "http://192.168.3.136:8080/nvrnetwork/"; // fly.config.baseURL = "http://192.168.3.136/";
  7974. // 配置响应拦截器
  7975. fly.interceptors.response.use(function (response) {// 如果请求报错
  7976. if (response.data.code != 200) {// uni.showModal({
  7977. // title: '温馨提示',
  7978. // content: response.data.data
  7979. // })
  7980. } else {//只将请求结果的data字段返回
  7981. return response;}}, function (err) {//发生网络错误后会走到这里
  7982. return Promise.resolve("网络请求:ERROR!");}); // 配置请求拦截器
  7983. fly.interceptors.request.use(function (request) {request.headers = { 'Content-Type': 'application/x-www-form-urlencoded' };return request; // if(request.body.token == undefined){
  7984. // return request;
  7985. // }else{
  7986. // //证明参数中有token
  7987. // let token = uni.getStorageSync('token');
  7988. // if(token == ''){
  7989. // //本地存储中没token,跳转登录页
  7990. // uni.reLaunch({
  7991. // url:'/pages/packageOne/login/login'
  7992. // })
  7993. // }else{
  7994. // return request;
  7995. // }
  7996. // }
  7997. }); //表单验证
  7998. function role(data, roles) {var validator = new _asyncValidator.default(roles);validator.validate(data).then(function () {}).catch(function (_ref) {var errors = _ref.errors,fields = _ref.fields;uni.showToast({ icon: 'none', duration: 2000, title: errors[0].message });});}function nav(url, params) {//用此方法跳转都需要登录以后才有权限
  7999. var token = uni.getStorageSync('token');if (token) {uni.navigateTo({ url: url });} else {uni.navigateTo({ url: '/pages/packageOne/login/login?params=' + params });}}var _default = { fly: fly, role: role, nav: nav };exports.default = _default;
  8000. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  8001. /***/ }),
  8002. /* 14 */
  8003. /*!************************************************************************************************!*\
  8004. !*** C:/Users/Jzdsh/Desktop/附近养车网uni-app/附近养车网/node_modules/async-validator/dist-web/index.js ***!
  8005. \************************************************************************************************/
  8006. /*! no static exports found */
  8007. /***/ (function(module, exports, __webpack_require__) {
  8008. "use strict";
  8009. /* WEBPACK VAR INJECTION */(function(process) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function _extends() {
  8010. _extends = Object.assign || function (target) {
  8011. for (var i = 1; i < arguments.length; i++) {
  8012. var source = arguments[i];
  8013. for (var key in source) {
  8014. if (Object.prototype.hasOwnProperty.call(source, key)) {
  8015. target[key] = source[key];
  8016. }
  8017. }
  8018. }
  8019. return target;
  8020. };
  8021. return _extends.apply(this, arguments);
  8022. }
  8023. /* eslint no-console:0 */
  8024. var formatRegExp = /%[sdj%]/g;
  8025. var warning = function warning() {}; // don't print warning message when in production env or node runtime
  8026. if (typeof process !== 'undefined' && Object({"VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}) && "development" !== 'production' && typeof window !== 'undefined' && typeof document !== 'undefined') {
  8027. warning = function warning(type, errors) {
  8028. if (typeof console !== 'undefined' && console.warn) {
  8029. if (errors.every(function (e) {
  8030. return typeof e === 'string';
  8031. })) {
  8032. console.warn(type, errors);
  8033. }
  8034. }
  8035. };
  8036. }
  8037. function convertFieldsError(errors) {
  8038. if (!errors || !errors.length) return null;
  8039. var fields = {};
  8040. errors.forEach(function (error) {
  8041. var field = error.field;
  8042. fields[field] = fields[field] || [];
  8043. fields[field].push(error);
  8044. });
  8045. return fields;
  8046. }
  8047. function format() {
  8048. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  8049. args[_key] = arguments[_key];
  8050. }
  8051. var i = 1;
  8052. var f = args[0];
  8053. var len = args.length;
  8054. if (typeof f === 'function') {
  8055. return f.apply(null, args.slice(1));
  8056. }
  8057. if (typeof f === 'string') {
  8058. var str = String(f).replace(formatRegExp, function (x) {
  8059. if (x === '%%') {
  8060. return '%';
  8061. }
  8062. if (i >= len) {
  8063. return x;
  8064. }
  8065. switch (x) {
  8066. case '%s':
  8067. return String(args[i++]);
  8068. case '%d':
  8069. return Number(args[i++]);
  8070. case '%j':
  8071. try {
  8072. return JSON.stringify(args[i++]);
  8073. } catch (_) {
  8074. return '[Circular]';
  8075. }
  8076. break;
  8077. default:
  8078. return x;}
  8079. });
  8080. for (var arg = args[i]; i < len; arg = args[++i]) {
  8081. str += " " + arg;
  8082. }
  8083. return str;
  8084. }
  8085. return f;
  8086. }
  8087. function isNativeStringType(type) {
  8088. return type === 'string' || type === 'url' || type === 'hex' || type === 'email' || type === 'pattern';
  8089. }
  8090. function isEmptyValue(value, type) {
  8091. if (value === undefined || value === null) {
  8092. return true;
  8093. }
  8094. if (type === 'array' && Array.isArray(value) && !value.length) {
  8095. return true;
  8096. }
  8097. if (isNativeStringType(type) && typeof value === 'string' && !value) {
  8098. return true;
  8099. }
  8100. return false;
  8101. }
  8102. function asyncParallelArray(arr, func, callback) {
  8103. var results = [];
  8104. var total = 0;
  8105. var arrLength = arr.length;
  8106. function count(errors) {
  8107. results.push.apply(results, errors);
  8108. total++;
  8109. if (total === arrLength) {
  8110. callback(results);
  8111. }
  8112. }
  8113. arr.forEach(function (a) {
  8114. func(a, count);
  8115. });
  8116. }
  8117. function asyncSerialArray(arr, func, callback) {
  8118. var index = 0;
  8119. var arrLength = arr.length;
  8120. function next(errors) {
  8121. if (errors && errors.length) {
  8122. callback(errors);
  8123. return;
  8124. }
  8125. var original = index;
  8126. index = index + 1;
  8127. if (original < arrLength) {
  8128. func(arr[original], next);
  8129. } else {
  8130. callback([]);
  8131. }
  8132. }
  8133. next([]);
  8134. }
  8135. function flattenObjArr(objArr) {
  8136. var ret = [];
  8137. Object.keys(objArr).forEach(function (k) {
  8138. ret.push.apply(ret, objArr[k]);
  8139. });
  8140. return ret;
  8141. }
  8142. function asyncMap(objArr, option, func, callback) {
  8143. if (option.first) {
  8144. var _pending = new Promise(function (resolve, reject) {
  8145. var next = function next(errors) {
  8146. callback(errors);
  8147. return errors.length ? reject({
  8148. errors: errors,
  8149. fields: convertFieldsError(errors) }) :
  8150. resolve();
  8151. };
  8152. var flattenArr = flattenObjArr(objArr);
  8153. asyncSerialArray(flattenArr, func, next);
  8154. });
  8155. _pending["catch"](function (e) {
  8156. return e;
  8157. });
  8158. return _pending;
  8159. }
  8160. var firstFields = option.firstFields || [];
  8161. if (firstFields === true) {
  8162. firstFields = Object.keys(objArr);
  8163. }
  8164. var objArrKeys = Object.keys(objArr);
  8165. var objArrLength = objArrKeys.length;
  8166. var total = 0;
  8167. var results = [];
  8168. var pending = new Promise(function (resolve, reject) {
  8169. var next = function next(errors) {
  8170. results.push.apply(results, errors);
  8171. total++;
  8172. if (total === objArrLength) {
  8173. callback(results);
  8174. return results.length ? reject({
  8175. errors: results,
  8176. fields: convertFieldsError(results) }) :
  8177. resolve();
  8178. }
  8179. };
  8180. if (!objArrKeys.length) {
  8181. callback(results);
  8182. resolve();
  8183. }
  8184. objArrKeys.forEach(function (key) {
  8185. var arr = objArr[key];
  8186. if (firstFields.indexOf(key) !== -1) {
  8187. asyncSerialArray(arr, func, next);
  8188. } else {
  8189. asyncParallelArray(arr, func, next);
  8190. }
  8191. });
  8192. });
  8193. pending["catch"](function (e) {
  8194. return e;
  8195. });
  8196. return pending;
  8197. }
  8198. function complementError(rule) {
  8199. return function (oe) {
  8200. if (oe && oe.message) {
  8201. oe.field = oe.field || rule.fullField;
  8202. return oe;
  8203. }
  8204. return {
  8205. message: typeof oe === 'function' ? oe() : oe,
  8206. field: oe.field || rule.fullField };
  8207. };
  8208. }
  8209. function deepMerge(target, source) {
  8210. if (source) {
  8211. for (var s in source) {
  8212. if (source.hasOwnProperty(s)) {
  8213. var value = source[s];
  8214. if (typeof value === 'object' && typeof target[s] === 'object') {
  8215. target[s] = _extends({}, target[s], {}, value);
  8216. } else {
  8217. target[s] = value;
  8218. }
  8219. }
  8220. }
  8221. }
  8222. return target;
  8223. }
  8224. /**
  8225. * Rule for validating required fields.
  8226. *
  8227. * @param rule The validation rule.
  8228. * @param value The value of the field on the source object.
  8229. * @param source The source object being validated.
  8230. * @param errors An array of errors that this rule may add
  8231. * validation errors to.
  8232. * @param options The validation options.
  8233. * @param options.messages The validation messages.
  8234. */
  8235. function required(rule, value, source, errors, options, type) {
  8236. if (rule.required && (!source.hasOwnProperty(rule.field) || isEmptyValue(value, type || rule.type))) {
  8237. errors.push(format(options.messages.required, rule.fullField));
  8238. }
  8239. }
  8240. /**
  8241. * Rule for validating whitespace.
  8242. *
  8243. * @param rule The validation rule.
  8244. * @param value The value of the field on the source object.
  8245. * @param source The source object being validated.
  8246. * @param errors An array of errors that this rule may add
  8247. * validation errors to.
  8248. * @param options The validation options.
  8249. * @param options.messages The validation messages.
  8250. */
  8251. function whitespace(rule, value, source, errors, options) {
  8252. if (/^\s+$/.test(value) || value === '') {
  8253. errors.push(format(options.messages.whitespace, rule.fullField));
  8254. }
  8255. }
  8256. /* eslint max-len:0 */
  8257. var pattern = {
  8258. // http://emailregex.com/
  8259. email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
  8260. url: new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$", 'i'),
  8261. hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i };
  8262. var types = {
  8263. integer: function integer(value) {
  8264. return types.number(value) && parseInt(value, 10) === value;
  8265. },
  8266. "float": function float(value) {
  8267. return types.number(value) && !types.integer(value);
  8268. },
  8269. array: function array(value) {
  8270. return Array.isArray(value);
  8271. },
  8272. regexp: function regexp(value) {
  8273. if (value instanceof RegExp) {
  8274. return true;
  8275. }
  8276. try {
  8277. return !!new RegExp(value);
  8278. } catch (e) {
  8279. return false;
  8280. }
  8281. },
  8282. date: function date(value) {
  8283. return typeof value.getTime === 'function' && typeof value.getMonth === 'function' && typeof value.getYear === 'function';
  8284. },
  8285. number: function number(value) {
  8286. if (isNaN(value)) {
  8287. return false;
  8288. }
  8289. return typeof value === 'number';
  8290. },
  8291. object: function object(value) {
  8292. return typeof value === 'object' && !types.array(value);
  8293. },
  8294. method: function method(value) {
  8295. return typeof value === 'function';
  8296. },
  8297. email: function email(value) {
  8298. return typeof value === 'string' && !!value.match(pattern.email) && value.length < 255;
  8299. },
  8300. url: function url(value) {
  8301. return typeof value === 'string' && !!value.match(pattern.url);
  8302. },
  8303. hex: function hex(value) {
  8304. return typeof value === 'string' && !!value.match(pattern.hex);
  8305. } };
  8306. /**
  8307. * Rule for validating the type of a value.
  8308. *
  8309. * @param rule The validation rule.
  8310. * @param value The value of the field on the source object.
  8311. * @param source The source object being validated.
  8312. * @param errors An array of errors that this rule may add
  8313. * validation errors to.
  8314. * @param options The validation options.
  8315. * @param options.messages The validation messages.
  8316. */
  8317. function type(rule, value, source, errors, options) {
  8318. if (rule.required && value === undefined) {
  8319. required(rule, value, source, errors, options);
  8320. return;
  8321. }
  8322. var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];
  8323. var ruleType = rule.type;
  8324. if (custom.indexOf(ruleType) > -1) {
  8325. if (!types[ruleType](value)) {
  8326. errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
  8327. } // straight typeof check
  8328. } else if (ruleType && typeof value !== rule.type) {
  8329. errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
  8330. }
  8331. }
  8332. /**
  8333. * Rule for validating minimum and maximum allowed values.
  8334. *
  8335. * @param rule The validation rule.
  8336. * @param value The value of the field on the source object.
  8337. * @param source The source object being validated.
  8338. * @param errors An array of errors that this rule may add
  8339. * validation errors to.
  8340. * @param options The validation options.
  8341. * @param options.messages The validation messages.
  8342. */
  8343. function range(rule, value, source, errors, options) {
  8344. var len = typeof rule.len === 'number';
  8345. var min = typeof rule.min === 'number';
  8346. var max = typeof rule.max === 'number'; // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)
  8347. var spRegexp = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
  8348. var val = value;
  8349. var key = null;
  8350. var num = typeof value === 'number';
  8351. var str = typeof value === 'string';
  8352. var arr = Array.isArray(value);
  8353. if (num) {
  8354. key = 'number';
  8355. } else if (str) {
  8356. key = 'string';
  8357. } else if (arr) {
  8358. key = 'array';
  8359. } // if the value is not of a supported type for range validation
  8360. // the validation rule rule should use the
  8361. // type property to also test for a particular type
  8362. if (!key) {
  8363. return false;
  8364. }
  8365. if (arr) {
  8366. val = value.length;
  8367. }
  8368. if (str) {
  8369. // 处理码点大于U+010000的文字length属性不准确的bug,如"𠮷𠮷𠮷".lenght !== 3
  8370. val = value.replace(spRegexp, '_').length;
  8371. }
  8372. if (len) {
  8373. if (val !== rule.len) {
  8374. errors.push(format(options.messages[key].len, rule.fullField, rule.len));
  8375. }
  8376. } else if (min && !max && val < rule.min) {
  8377. errors.push(format(options.messages[key].min, rule.fullField, rule.min));
  8378. } else if (max && !min && val > rule.max) {
  8379. errors.push(format(options.messages[key].max, rule.fullField, rule.max));
  8380. } else if (min && max && (val < rule.min || val > rule.max)) {
  8381. errors.push(format(options.messages[key].range, rule.fullField, rule.min, rule.max));
  8382. }
  8383. }
  8384. var ENUM = 'enum';
  8385. /**
  8386. * Rule for validating a value exists in an enumerable list.
  8387. *
  8388. * @param rule The validation rule.
  8389. * @param value The value of the field on the source object.
  8390. * @param source The source object being validated.
  8391. * @param errors An array of errors that this rule may add
  8392. * validation errors to.
  8393. * @param options The validation options.
  8394. * @param options.messages The validation messages.
  8395. */
  8396. function enumerable(rule, value, source, errors, options) {
  8397. rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];
  8398. if (rule[ENUM].indexOf(value) === -1) {
  8399. errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));
  8400. }
  8401. }
  8402. /**
  8403. * Rule for validating a regular expression pattern.
  8404. *
  8405. * @param rule The validation rule.
  8406. * @param value The value of the field on the source object.
  8407. * @param source The source object being validated.
  8408. * @param errors An array of errors that this rule may add
  8409. * validation errors to.
  8410. * @param options The validation options.
  8411. * @param options.messages The validation messages.
  8412. */
  8413. function pattern$1(rule, value, source, errors, options) {
  8414. if (rule.pattern) {
  8415. if (rule.pattern instanceof RegExp) {
  8416. // if a RegExp instance is passed, reset `lastIndex` in case its `global`
  8417. // flag is accidentally set to `true`, which in a validation scenario
  8418. // is not necessary and the result might be misleading
  8419. rule.pattern.lastIndex = 0;
  8420. if (!rule.pattern.test(value)) {
  8421. errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
  8422. }
  8423. } else if (typeof rule.pattern === 'string') {
  8424. var _pattern = new RegExp(rule.pattern);
  8425. if (!_pattern.test(value)) {
  8426. errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
  8427. }
  8428. }
  8429. }
  8430. }
  8431. var rules = {
  8432. required: required,
  8433. whitespace: whitespace,
  8434. type: type,
  8435. range: range,
  8436. "enum": enumerable,
  8437. pattern: pattern$1 };
  8438. /**
  8439. * Performs validation for string types.
  8440. *
  8441. * @param rule The validation rule.
  8442. * @param value The value of the field on the source object.
  8443. * @param callback The callback function.
  8444. * @param source The source object being validated.
  8445. * @param options The validation options.
  8446. * @param options.messages The validation messages.
  8447. */
  8448. function string(rule, value, callback, source, options) {
  8449. var errors = [];
  8450. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  8451. if (validate) {
  8452. if (isEmptyValue(value, 'string') && !rule.required) {
  8453. return callback();
  8454. }
  8455. rules.required(rule, value, source, errors, options, 'string');
  8456. if (!isEmptyValue(value, 'string')) {
  8457. rules.type(rule, value, source, errors, options);
  8458. rules.range(rule, value, source, errors, options);
  8459. rules.pattern(rule, value, source, errors, options);
  8460. if (rule.whitespace === true) {
  8461. rules.whitespace(rule, value, source, errors, options);
  8462. }
  8463. }
  8464. }
  8465. callback(errors);
  8466. }
  8467. /**
  8468. * Validates a function.
  8469. *
  8470. * @param rule The validation rule.
  8471. * @param value The value of the field on the source object.
  8472. * @param callback The callback function.
  8473. * @param source The source object being validated.
  8474. * @param options The validation options.
  8475. * @param options.messages The validation messages.
  8476. */
  8477. function method(rule, value, callback, source, options) {
  8478. var errors = [];
  8479. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  8480. if (validate) {
  8481. if (isEmptyValue(value) && !rule.required) {
  8482. return callback();
  8483. }
  8484. rules.required(rule, value, source, errors, options);
  8485. if (value !== undefined) {
  8486. rules.type(rule, value, source, errors, options);
  8487. }
  8488. }
  8489. callback(errors);
  8490. }
  8491. /**
  8492. * Validates a number.
  8493. *
  8494. * @param rule The validation rule.
  8495. * @param value The value of the field on the source object.
  8496. * @param callback The callback function.
  8497. * @param source The source object being validated.
  8498. * @param options The validation options.
  8499. * @param options.messages The validation messages.
  8500. */
  8501. function number(rule, value, callback, source, options) {
  8502. var errors = [];
  8503. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  8504. if (validate) {
  8505. if (value === '') {
  8506. value = undefined;
  8507. }
  8508. if (isEmptyValue(value) && !rule.required) {
  8509. return callback();
  8510. }
  8511. rules.required(rule, value, source, errors, options);
  8512. if (value !== undefined) {
  8513. rules.type(rule, value, source, errors, options);
  8514. rules.range(rule, value, source, errors, options);
  8515. }
  8516. }
  8517. callback(errors);
  8518. }
  8519. /**
  8520. * Validates a boolean.
  8521. *
  8522. * @param rule The validation rule.
  8523. * @param value The value of the field on the source object.
  8524. * @param callback The callback function.
  8525. * @param source The source object being validated.
  8526. * @param options The validation options.
  8527. * @param options.messages The validation messages.
  8528. */
  8529. function _boolean(rule, value, callback, source, options) {
  8530. var errors = [];
  8531. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  8532. if (validate) {
  8533. if (isEmptyValue(value) && !rule.required) {
  8534. return callback();
  8535. }
  8536. rules.required(rule, value, source, errors, options);
  8537. if (value !== undefined) {
  8538. rules.type(rule, value, source, errors, options);
  8539. }
  8540. }
  8541. callback(errors);
  8542. }
  8543. /**
  8544. * Validates the regular expression type.
  8545. *
  8546. * @param rule The validation rule.
  8547. * @param value The value of the field on the source object.
  8548. * @param callback The callback function.
  8549. * @param source The source object being validated.
  8550. * @param options The validation options.
  8551. * @param options.messages The validation messages.
  8552. */
  8553. function regexp(rule, value, callback, source, options) {
  8554. var errors = [];
  8555. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  8556. if (validate) {
  8557. if (isEmptyValue(value) && !rule.required) {
  8558. return callback();
  8559. }
  8560. rules.required(rule, value, source, errors, options);
  8561. if (!isEmptyValue(value)) {
  8562. rules.type(rule, value, source, errors, options);
  8563. }
  8564. }
  8565. callback(errors);
  8566. }
  8567. /**
  8568. * Validates a number is an integer.
  8569. *
  8570. * @param rule The validation rule.
  8571. * @param value The value of the field on the source object.
  8572. * @param callback The callback function.
  8573. * @param source The source object being validated.
  8574. * @param options The validation options.
  8575. * @param options.messages The validation messages.
  8576. */
  8577. function integer(rule, value, callback, source, options) {
  8578. var errors = [];
  8579. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  8580. if (validate) {
  8581. if (isEmptyValue(value) && !rule.required) {
  8582. return callback();
  8583. }
  8584. rules.required(rule, value, source, errors, options);
  8585. if (value !== undefined) {
  8586. rules.type(rule, value, source, errors, options);
  8587. rules.range(rule, value, source, errors, options);
  8588. }
  8589. }
  8590. callback(errors);
  8591. }
  8592. /**
  8593. * Validates a number is a floating point number.
  8594. *
  8595. * @param rule The validation rule.
  8596. * @param value The value of the field on the source object.
  8597. * @param callback The callback function.
  8598. * @param source The source object being validated.
  8599. * @param options The validation options.
  8600. * @param options.messages The validation messages.
  8601. */
  8602. function floatFn(rule, value, callback, source, options) {
  8603. var errors = [];
  8604. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  8605. if (validate) {
  8606. if (isEmptyValue(value) && !rule.required) {
  8607. return callback();
  8608. }
  8609. rules.required(rule, value, source, errors, options);
  8610. if (value !== undefined) {
  8611. rules.type(rule, value, source, errors, options);
  8612. rules.range(rule, value, source, errors, options);
  8613. }
  8614. }
  8615. callback(errors);
  8616. }
  8617. /**
  8618. * Validates an array.
  8619. *
  8620. * @param rule The validation rule.
  8621. * @param value The value of the field on the source object.
  8622. * @param callback The callback function.
  8623. * @param source The source object being validated.
  8624. * @param options The validation options.
  8625. * @param options.messages The validation messages.
  8626. */
  8627. function array(rule, value, callback, source, options) {
  8628. var errors = [];
  8629. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  8630. if (validate) {
  8631. if (isEmptyValue(value, 'array') && !rule.required) {
  8632. return callback();
  8633. }
  8634. rules.required(rule, value, source, errors, options, 'array');
  8635. if (!isEmptyValue(value, 'array')) {
  8636. rules.type(rule, value, source, errors, options);
  8637. rules.range(rule, value, source, errors, options);
  8638. }
  8639. }
  8640. callback(errors);
  8641. }
  8642. /**
  8643. * Validates an object.
  8644. *
  8645. * @param rule The validation rule.
  8646. * @param value The value of the field on the source object.
  8647. * @param callback The callback function.
  8648. * @param source The source object being validated.
  8649. * @param options The validation options.
  8650. * @param options.messages The validation messages.
  8651. */
  8652. function object(rule, value, callback, source, options) {
  8653. var errors = [];
  8654. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  8655. if (validate) {
  8656. if (isEmptyValue(value) && !rule.required) {
  8657. return callback();
  8658. }
  8659. rules.required(rule, value, source, errors, options);
  8660. if (value !== undefined) {
  8661. rules.type(rule, value, source, errors, options);
  8662. }
  8663. }
  8664. callback(errors);
  8665. }
  8666. var ENUM$1 = 'enum';
  8667. /**
  8668. * Validates an enumerable list.
  8669. *
  8670. * @param rule The validation rule.
  8671. * @param value The value of the field on the source object.
  8672. * @param callback The callback function.
  8673. * @param source The source object being validated.
  8674. * @param options The validation options.
  8675. * @param options.messages The validation messages.
  8676. */
  8677. function enumerable$1(rule, value, callback, source, options) {
  8678. var errors = [];
  8679. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  8680. if (validate) {
  8681. if (isEmptyValue(value) && !rule.required) {
  8682. return callback();
  8683. }
  8684. rules.required(rule, value, source, errors, options);
  8685. if (value !== undefined) {
  8686. rules[ENUM$1](rule, value, source, errors, options);
  8687. }
  8688. }
  8689. callback(errors);
  8690. }
  8691. /**
  8692. * Validates a regular expression pattern.
  8693. *
  8694. * Performs validation when a rule only contains
  8695. * a pattern property but is not declared as a string type.
  8696. *
  8697. * @param rule The validation rule.
  8698. * @param value The value of the field on the source object.
  8699. * @param callback The callback function.
  8700. * @param source The source object being validated.
  8701. * @param options The validation options.
  8702. * @param options.messages The validation messages.
  8703. */
  8704. function pattern$2(rule, value, callback, source, options) {
  8705. var errors = [];
  8706. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  8707. if (validate) {
  8708. if (isEmptyValue(value, 'string') && !rule.required) {
  8709. return callback();
  8710. }
  8711. rules.required(rule, value, source, errors, options);
  8712. if (!isEmptyValue(value, 'string')) {
  8713. rules.pattern(rule, value, source, errors, options);
  8714. }
  8715. }
  8716. callback(errors);
  8717. }
  8718. function date(rule, value, callback, source, options) {
  8719. // console.log('integer rule called %j', rule);
  8720. var errors = [];
  8721. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field); // console.log('validate on %s value', value);
  8722. if (validate) {
  8723. if (isEmptyValue(value) && !rule.required) {
  8724. return callback();
  8725. }
  8726. rules.required(rule, value, source, errors, options);
  8727. if (!isEmptyValue(value)) {
  8728. var dateObject;
  8729. if (typeof value === 'number') {
  8730. dateObject = new Date(value);
  8731. } else {
  8732. dateObject = value;
  8733. }
  8734. rules.type(rule, dateObject, source, errors, options);
  8735. if (dateObject) {
  8736. rules.range(rule, dateObject.getTime(), source, errors, options);
  8737. }
  8738. }
  8739. }
  8740. callback(errors);
  8741. }
  8742. function required$1(rule, value, callback, source, options) {
  8743. var errors = [];
  8744. var type = Array.isArray(value) ? 'array' : typeof value;
  8745. rules.required(rule, value, source, errors, options, type);
  8746. callback(errors);
  8747. }
  8748. function type$1(rule, value, callback, source, options) {
  8749. var ruleType = rule.type;
  8750. var errors = [];
  8751. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  8752. if (validate) {
  8753. if (isEmptyValue(value, ruleType) && !rule.required) {
  8754. return callback();
  8755. }
  8756. rules.required(rule, value, source, errors, options, ruleType);
  8757. if (!isEmptyValue(value, ruleType)) {
  8758. rules.type(rule, value, source, errors, options);
  8759. }
  8760. }
  8761. callback(errors);
  8762. }
  8763. /**
  8764. * Performs validation for any type.
  8765. *
  8766. * @param rule The validation rule.
  8767. * @param value The value of the field on the source object.
  8768. * @param callback The callback function.
  8769. * @param source The source object being validated.
  8770. * @param options The validation options.
  8771. * @param options.messages The validation messages.
  8772. */
  8773. function any(rule, value, callback, source, options) {
  8774. var errors = [];
  8775. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  8776. if (validate) {
  8777. if (isEmptyValue(value) && !rule.required) {
  8778. return callback();
  8779. }
  8780. rules.required(rule, value, source, errors, options);
  8781. }
  8782. callback(errors);
  8783. }
  8784. var validators = {
  8785. string: string,
  8786. method: method,
  8787. number: number,
  8788. "boolean": _boolean,
  8789. regexp: regexp,
  8790. integer: integer,
  8791. "float": floatFn,
  8792. array: array,
  8793. object: object,
  8794. "enum": enumerable$1,
  8795. pattern: pattern$2,
  8796. date: date,
  8797. url: type$1,
  8798. hex: type$1,
  8799. email: type$1,
  8800. required: required$1,
  8801. any: any };
  8802. function newMessages() {
  8803. return {
  8804. "default": 'Validation error on field %s',
  8805. required: '%s is required',
  8806. "enum": '%s must be one of %s',
  8807. whitespace: '%s cannot be empty',
  8808. date: {
  8809. format: '%s date %s is invalid for format %s',
  8810. parse: '%s date could not be parsed, %s is invalid ',
  8811. invalid: '%s date %s is invalid' },
  8812. types: {
  8813. string: '%s is not a %s',
  8814. method: '%s is not a %s (function)',
  8815. array: '%s is not an %s',
  8816. object: '%s is not an %s',
  8817. number: '%s is not a %s',
  8818. date: '%s is not a %s',
  8819. "boolean": '%s is not a %s',
  8820. integer: '%s is not an %s',
  8821. "float": '%s is not a %s',
  8822. regexp: '%s is not a valid %s',
  8823. email: '%s is not a valid %s',
  8824. url: '%s is not a valid %s',
  8825. hex: '%s is not a valid %s' },
  8826. string: {
  8827. len: '%s must be exactly %s characters',
  8828. min: '%s must be at least %s characters',
  8829. max: '%s cannot be longer than %s characters',
  8830. range: '%s must be between %s and %s characters' },
  8831. number: {
  8832. len: '%s must equal %s',
  8833. min: '%s cannot be less than %s',
  8834. max: '%s cannot be greater than %s',
  8835. range: '%s must be between %s and %s' },
  8836. array: {
  8837. len: '%s must be exactly %s in length',
  8838. min: '%s cannot be less than %s in length',
  8839. max: '%s cannot be greater than %s in length',
  8840. range: '%s must be between %s and %s in length' },
  8841. pattern: {
  8842. mismatch: '%s value %s does not match pattern %s' },
  8843. clone: function clone() {
  8844. var cloned = JSON.parse(JSON.stringify(this));
  8845. cloned.clone = this.clone;
  8846. return cloned;
  8847. } };
  8848. }
  8849. var messages = newMessages();
  8850. /**
  8851. * Encapsulates a validation schema.
  8852. *
  8853. * @param descriptor An object declaring validation rules
  8854. * for this schema.
  8855. */
  8856. function Schema(descriptor) {
  8857. this.rules = null;
  8858. this._messages = messages;
  8859. this.define(descriptor);
  8860. }
  8861. Schema.prototype = {
  8862. messages: function messages(_messages) {
  8863. if (_messages) {
  8864. this._messages = deepMerge(newMessages(), _messages);
  8865. }
  8866. return this._messages;
  8867. },
  8868. define: function define(rules) {
  8869. if (!rules) {
  8870. throw new Error('Cannot configure a schema with no rules');
  8871. }
  8872. if (typeof rules !== 'object' || Array.isArray(rules)) {
  8873. throw new Error('Rules must be an object');
  8874. }
  8875. this.rules = {};
  8876. var z;
  8877. var item;
  8878. for (z in rules) {
  8879. if (rules.hasOwnProperty(z)) {
  8880. item = rules[z];
  8881. this.rules[z] = Array.isArray(item) ? item : [item];
  8882. }
  8883. }
  8884. },
  8885. validate: function validate(source_, o, oc) {
  8886. var _this = this;
  8887. if (o === void 0) {
  8888. o = {};
  8889. }
  8890. if (oc === void 0) {
  8891. oc = function oc() {};
  8892. }
  8893. var source = source_;
  8894. var options = o;
  8895. var callback = oc;
  8896. if (typeof options === 'function') {
  8897. callback = options;
  8898. options = {};
  8899. }
  8900. if (!this.rules || Object.keys(this.rules).length === 0) {
  8901. if (callback) {
  8902. callback();
  8903. }
  8904. return Promise.resolve();
  8905. }
  8906. function complete(results) {
  8907. var i;
  8908. var errors = [];
  8909. var fields = {};
  8910. function add(e) {
  8911. if (Array.isArray(e)) {
  8912. var _errors;
  8913. errors = (_errors = errors).concat.apply(_errors, e);
  8914. } else {
  8915. errors.push(e);
  8916. }
  8917. }
  8918. for (i = 0; i < results.length; i++) {
  8919. add(results[i]);
  8920. }
  8921. if (!errors.length) {
  8922. errors = null;
  8923. fields = null;
  8924. } else {
  8925. fields = convertFieldsError(errors);
  8926. }
  8927. callback(errors, fields);
  8928. }
  8929. if (options.messages) {
  8930. var messages$1 = this.messages();
  8931. if (messages$1 === messages) {
  8932. messages$1 = newMessages();
  8933. }
  8934. deepMerge(messages$1, options.messages);
  8935. options.messages = messages$1;
  8936. } else {
  8937. options.messages = this.messages();
  8938. }
  8939. var arr;
  8940. var value;
  8941. var series = {};
  8942. var keys = options.keys || Object.keys(this.rules);
  8943. keys.forEach(function (z) {
  8944. arr = _this.rules[z];
  8945. value = source[z];
  8946. arr.forEach(function (r) {
  8947. var rule = r;
  8948. if (typeof rule.transform === 'function') {
  8949. if (source === source_) {
  8950. source = _extends({}, source);
  8951. }
  8952. value = source[z] = rule.transform(value);
  8953. }
  8954. if (typeof rule === 'function') {
  8955. rule = {
  8956. validator: rule };
  8957. } else {
  8958. rule = _extends({}, rule);
  8959. }
  8960. rule.validator = _this.getValidationMethod(rule);
  8961. rule.field = z;
  8962. rule.fullField = rule.fullField || z;
  8963. rule.type = _this.getType(rule);
  8964. if (!rule.validator) {
  8965. return;
  8966. }
  8967. series[z] = series[z] || [];
  8968. series[z].push({
  8969. rule: rule,
  8970. value: value,
  8971. source: source,
  8972. field: z });
  8973. });
  8974. });
  8975. var errorFields = {};
  8976. return asyncMap(series, options, function (data, doIt) {
  8977. var rule = data.rule;
  8978. var deep = (rule.type === 'object' || rule.type === 'array') && (typeof rule.fields === 'object' || typeof rule.defaultField === 'object');
  8979. deep = deep && (rule.required || !rule.required && data.value);
  8980. rule.field = data.field;
  8981. function addFullfield(key, schema) {
  8982. return _extends({}, schema, {
  8983. fullField: rule.fullField + "." + key });
  8984. }
  8985. function cb(e) {
  8986. if (e === void 0) {
  8987. e = [];
  8988. }
  8989. var errors = e;
  8990. if (!Array.isArray(errors)) {
  8991. errors = [errors];
  8992. }
  8993. if (!options.suppressWarning && errors.length) {
  8994. Schema.warning('async-validator:', errors);
  8995. }
  8996. if (errors.length && rule.message) {
  8997. errors = [].concat(rule.message);
  8998. }
  8999. errors = errors.map(complementError(rule));
  9000. if (options.first && errors.length) {
  9001. errorFields[rule.field] = 1;
  9002. return doIt(errors);
  9003. }
  9004. if (!deep) {
  9005. doIt(errors);
  9006. } else {
  9007. // if rule is required but the target object
  9008. // does not exist fail at the rule level and don't
  9009. // go deeper
  9010. if (rule.required && !data.value) {
  9011. if (rule.message) {
  9012. errors = [].concat(rule.message).map(complementError(rule));
  9013. } else if (options.error) {
  9014. errors = [options.error(rule, format(options.messages.required, rule.field))];
  9015. } else {
  9016. errors = [];
  9017. }
  9018. return doIt(errors);
  9019. }
  9020. var fieldsSchema = {};
  9021. if (rule.defaultField) {
  9022. for (var k in data.value) {
  9023. if (data.value.hasOwnProperty(k)) {
  9024. fieldsSchema[k] = rule.defaultField;
  9025. }
  9026. }
  9027. }
  9028. fieldsSchema = _extends({}, fieldsSchema, {}, data.rule.fields);
  9029. for (var f in fieldsSchema) {
  9030. if (fieldsSchema.hasOwnProperty(f)) {
  9031. var fieldSchema = Array.isArray(fieldsSchema[f]) ? fieldsSchema[f] : [fieldsSchema[f]];
  9032. fieldsSchema[f] = fieldSchema.map(addFullfield.bind(null, f));
  9033. }
  9034. }
  9035. var schema = new Schema(fieldsSchema);
  9036. schema.messages(options.messages);
  9037. if (data.rule.options) {
  9038. data.rule.options.messages = options.messages;
  9039. data.rule.options.error = options.error;
  9040. }
  9041. schema.validate(data.value, data.rule.options || options, function (errs) {
  9042. var finalErrors = [];
  9043. if (errors && errors.length) {
  9044. finalErrors.push.apply(finalErrors, errors);
  9045. }
  9046. if (errs && errs.length) {
  9047. finalErrors.push.apply(finalErrors, errs);
  9048. }
  9049. doIt(finalErrors.length ? finalErrors : null);
  9050. });
  9051. }
  9052. }
  9053. var res;
  9054. if (rule.asyncValidator) {
  9055. res = rule.asyncValidator(rule, data.value, cb, data.source, options);
  9056. } else if (rule.validator) {
  9057. res = rule.validator(rule, data.value, cb, data.source, options);
  9058. if (res === true) {
  9059. cb();
  9060. } else if (res === false) {
  9061. cb(rule.message || rule.field + " fails");
  9062. } else if (res instanceof Array) {
  9063. cb(res);
  9064. } else if (res instanceof Error) {
  9065. cb(res.message);
  9066. }
  9067. }
  9068. if (res && res.then) {
  9069. res.then(function () {
  9070. return cb();
  9071. }, function (e) {
  9072. return cb(e);
  9073. });
  9074. }
  9075. }, function (results) {
  9076. complete(results);
  9077. });
  9078. },
  9079. getType: function getType(rule) {
  9080. if (rule.type === undefined && rule.pattern instanceof RegExp) {
  9081. rule.type = 'pattern';
  9082. }
  9083. if (typeof rule.validator !== 'function' && rule.type && !validators.hasOwnProperty(rule.type)) {
  9084. throw new Error(format('Unknown rule type %s', rule.type));
  9085. }
  9086. return rule.type || 'string';
  9087. },
  9088. getValidationMethod: function getValidationMethod(rule) {
  9089. if (typeof rule.validator === 'function') {
  9090. return rule.validator;
  9091. }
  9092. var keys = Object.keys(rule);
  9093. var messageIndex = keys.indexOf('message');
  9094. if (messageIndex !== -1) {
  9095. keys.splice(messageIndex, 1);
  9096. }
  9097. if (keys.length === 1 && keys[0] === 'required') {
  9098. return validators.required;
  9099. }
  9100. return validators[this.getType(rule)] || false;
  9101. } };
  9102. Schema.register = function register(type, validator) {
  9103. if (typeof validator !== 'function') {
  9104. throw new Error('Cannot register a validator by type, validator is not a function');
  9105. }
  9106. validators[type] = validator;
  9107. };
  9108. Schema.warning = warning;
  9109. Schema.messages = messages;var _default =
  9110. Schema;exports.default = _default;
  9111. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/node-libs-browser/mock/process.js */ 15)))
  9112. /***/ }),
  9113. /* 15 */
  9114. /*!********************************************************!*\
  9115. !*** ./node_modules/node-libs-browser/mock/process.js ***!
  9116. \********************************************************/
  9117. /*! no static exports found */
  9118. /***/ (function(module, exports, __webpack_require__) {
  9119. exports.nextTick = function nextTick(fn) {
  9120. setTimeout(fn, 0);
  9121. };
  9122. exports.platform = exports.arch =
  9123. exports.execPath = exports.title = 'browser';
  9124. exports.pid = 1;
  9125. exports.browser = true;
  9126. exports.env = {};
  9127. exports.argv = [];
  9128. exports.binding = function (name) {
  9129. throw new Error('No such module. (Possibly not yet loaded)')
  9130. };
  9131. (function () {
  9132. var cwd = '/';
  9133. var path;
  9134. exports.cwd = function () { return cwd };
  9135. exports.chdir = function (dir) {
  9136. if (!path) path = __webpack_require__(/*! path */ 16);
  9137. cwd = path.resolve(dir, cwd);
  9138. };
  9139. })();
  9140. exports.exit = exports.kill =
  9141. exports.umask = exports.dlopen =
  9142. exports.uptime = exports.memoryUsage =
  9143. exports.uvCounters = function() {};
  9144. exports.features = {};
  9145. /***/ }),
  9146. /* 16 */
  9147. /*!***********************************************!*\
  9148. !*** ./node_modules/path-browserify/index.js ***!
  9149. \***********************************************/
  9150. /*! no static exports found */
  9151. /***/ (function(module, exports, __webpack_require__) {
  9152. /* WEBPACK VAR INJECTION */(function(process) {// Copyright Joyent, Inc. and other Node contributors.
  9153. //
  9154. // Permission is hereby granted, free of charge, to any person obtaining a
  9155. // copy of this software and associated documentation files (the
  9156. // "Software"), to deal in the Software without restriction, including
  9157. // without limitation the rights to use, copy, modify, merge, publish,
  9158. // distribute, sublicense, and/or sell copies of the Software, and to permit
  9159. // persons to whom the Software is furnished to do so, subject to the
  9160. // following conditions:
  9161. //
  9162. // The above copyright notice and this permission notice shall be included
  9163. // in all copies or substantial portions of the Software.
  9164. //
  9165. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  9166. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  9167. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  9168. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  9169. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  9170. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  9171. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  9172. // resolves . and .. elements in a path array with directory names there
  9173. // must be no slashes, empty elements, or device names (c:\) in the array
  9174. // (so also no leading and trailing slashes - it does not distinguish
  9175. // relative and absolute paths)
  9176. function normalizeArray(parts, allowAboveRoot) {
  9177. // if the path tries to go above the root, `up` ends up > 0
  9178. var up = 0;
  9179. for (var i = parts.length - 1; i >= 0; i--) {
  9180. var last = parts[i];
  9181. if (last === '.') {
  9182. parts.splice(i, 1);
  9183. } else if (last === '..') {
  9184. parts.splice(i, 1);
  9185. up++;
  9186. } else if (up) {
  9187. parts.splice(i, 1);
  9188. up--;
  9189. }
  9190. }
  9191. // if the path is allowed to go above the root, restore leading ..s
  9192. if (allowAboveRoot) {
  9193. for (; up--; up) {
  9194. parts.unshift('..');
  9195. }
  9196. }
  9197. return parts;
  9198. }
  9199. // Split a filename into [root, dir, basename, ext], unix version
  9200. // 'root' is just a slash, or nothing.
  9201. var splitPathRe =
  9202. /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;
  9203. var splitPath = function(filename) {
  9204. return splitPathRe.exec(filename).slice(1);
  9205. };
  9206. // path.resolve([from ...], to)
  9207. // posix version
  9208. exports.resolve = function() {
  9209. var resolvedPath = '',
  9210. resolvedAbsolute = false;
  9211. for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
  9212. var path = (i >= 0) ? arguments[i] : process.cwd();
  9213. // Skip empty and invalid entries
  9214. if (typeof path !== 'string') {
  9215. throw new TypeError('Arguments to path.resolve must be strings');
  9216. } else if (!path) {
  9217. continue;
  9218. }
  9219. resolvedPath = path + '/' + resolvedPath;
  9220. resolvedAbsolute = path.charAt(0) === '/';
  9221. }
  9222. // At this point the path should be resolved to a full absolute path, but
  9223. // handle relative paths to be safe (might happen when process.cwd() fails)
  9224. // Normalize the path
  9225. resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
  9226. return !!p;
  9227. }), !resolvedAbsolute).join('/');
  9228. return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
  9229. };
  9230. // path.normalize(path)
  9231. // posix version
  9232. exports.normalize = function(path) {
  9233. var isAbsolute = exports.isAbsolute(path),
  9234. trailingSlash = substr(path, -1) === '/';
  9235. // Normalize the path
  9236. path = normalizeArray(filter(path.split('/'), function(p) {
  9237. return !!p;
  9238. }), !isAbsolute).join('/');
  9239. if (!path && !isAbsolute) {
  9240. path = '.';
  9241. }
  9242. if (path && trailingSlash) {
  9243. path += '/';
  9244. }
  9245. return (isAbsolute ? '/' : '') + path;
  9246. };
  9247. // posix version
  9248. exports.isAbsolute = function(path) {
  9249. return path.charAt(0) === '/';
  9250. };
  9251. // posix version
  9252. exports.join = function() {
  9253. var paths = Array.prototype.slice.call(arguments, 0);
  9254. return exports.normalize(filter(paths, function(p, index) {
  9255. if (typeof p !== 'string') {
  9256. throw new TypeError('Arguments to path.join must be strings');
  9257. }
  9258. return p;
  9259. }).join('/'));
  9260. };
  9261. // path.relative(from, to)
  9262. // posix version
  9263. exports.relative = function(from, to) {
  9264. from = exports.resolve(from).substr(1);
  9265. to = exports.resolve(to).substr(1);
  9266. function trim(arr) {
  9267. var start = 0;
  9268. for (; start < arr.length; start++) {
  9269. if (arr[start] !== '') break;
  9270. }
  9271. var end = arr.length - 1;
  9272. for (; end >= 0; end--) {
  9273. if (arr[end] !== '') break;
  9274. }
  9275. if (start > end) return [];
  9276. return arr.slice(start, end - start + 1);
  9277. }
  9278. var fromParts = trim(from.split('/'));
  9279. var toParts = trim(to.split('/'));
  9280. var length = Math.min(fromParts.length, toParts.length);
  9281. var samePartsLength = length;
  9282. for (var i = 0; i < length; i++) {
  9283. if (fromParts[i] !== toParts[i]) {
  9284. samePartsLength = i;
  9285. break;
  9286. }
  9287. }
  9288. var outputParts = [];
  9289. for (var i = samePartsLength; i < fromParts.length; i++) {
  9290. outputParts.push('..');
  9291. }
  9292. outputParts = outputParts.concat(toParts.slice(samePartsLength));
  9293. return outputParts.join('/');
  9294. };
  9295. exports.sep = '/';
  9296. exports.delimiter = ':';
  9297. exports.dirname = function(path) {
  9298. var result = splitPath(path),
  9299. root = result[0],
  9300. dir = result[1];
  9301. if (!root && !dir) {
  9302. // No dirname whatsoever
  9303. return '.';
  9304. }
  9305. if (dir) {
  9306. // It has a dirname, strip trailing slash
  9307. dir = dir.substr(0, dir.length - 1);
  9308. }
  9309. return root + dir;
  9310. };
  9311. exports.basename = function(path, ext) {
  9312. var f = splitPath(path)[2];
  9313. // TODO: make this comparison case-insensitive on windows?
  9314. if (ext && f.substr(-1 * ext.length) === ext) {
  9315. f = f.substr(0, f.length - ext.length);
  9316. }
  9317. return f;
  9318. };
  9319. exports.extname = function(path) {
  9320. return splitPath(path)[3];
  9321. };
  9322. function filter (xs, f) {
  9323. if (xs.filter) return xs.filter(f);
  9324. var res = [];
  9325. for (var i = 0; i < xs.length; i++) {
  9326. if (f(xs[i], i, xs)) res.push(xs[i]);
  9327. }
  9328. return res;
  9329. }
  9330. // String.prototype.substr - negative index don't work in IE8
  9331. var substr = 'ab'.substr(-1) === 'b'
  9332. ? function (str, start, len) { return str.substr(start, len) }
  9333. : function (str, start, len) {
  9334. if (start < 0) start = str.length + start;
  9335. return str.substr(start, len);
  9336. }
  9337. ;
  9338. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/mock/process.js */ 15)))
  9339. /***/ }),
  9340. /* 17 */
  9341. /*!***********************************************************************************!*\
  9342. !*** C:/Users/Jzdsh/Desktop/附近养车网uni-app/附近养车网/node_modules/flyio/dist/npm/wx.js ***!
  9343. \***********************************************************************************/
  9344. /*! no static exports found */
  9345. /***/ (function(module, exports, __webpack_require__) {
  9346. "use strict";
  9347. (function webpackUniversalModuleDefinition(root, factory) {
  9348. if (true)
  9349. module.exports = factory();else
  9350. { var i, a; }
  9351. })(void 0, function () {
  9352. return (/******/function (modules) {// webpackBootstrap
  9353. /******/ // The module cache
  9354. /******/var installedModules = {};
  9355. /******/
  9356. /******/ // The require function
  9357. /******/function __webpack_require__(moduleId) {
  9358. /******/
  9359. /******/ // Check if module is in cache
  9360. /******/if (installedModules[moduleId]) {
  9361. /******/return installedModules[moduleId].exports;
  9362. /******/}
  9363. /******/ // Create a new module (and put it into the cache)
  9364. /******/var module = installedModules[moduleId] = {
  9365. /******/i: moduleId,
  9366. /******/l: false,
  9367. /******/exports: {}
  9368. /******/ };
  9369. /******/
  9370. /******/ // Execute the module function
  9371. /******/modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  9372. /******/
  9373. /******/ // Flag the module as loaded
  9374. /******/module.l = true;
  9375. /******/
  9376. /******/ // Return the exports of the module
  9377. /******/return module.exports;
  9378. /******/}
  9379. /******/
  9380. /******/
  9381. /******/ // expose the modules object (__webpack_modules__)
  9382. /******/__webpack_require__.m = modules;
  9383. /******/
  9384. /******/ // expose the module cache
  9385. /******/__webpack_require__.c = installedModules;
  9386. /******/
  9387. /******/ // identity function for calling harmony imports with the correct context
  9388. /******/__webpack_require__.i = function (value) {return value;};
  9389. /******/
  9390. /******/ // define getter function for harmony exports
  9391. /******/__webpack_require__.d = function (exports, name, getter) {
  9392. /******/if (!__webpack_require__.o(exports, name)) {
  9393. /******/Object.defineProperty(exports, name, {
  9394. /******/configurable: false,
  9395. /******/enumerable: true,
  9396. /******/get: getter
  9397. /******/ });
  9398. /******/}
  9399. /******/};
  9400. /******/
  9401. /******/ // getDefaultExport function for compatibility with non-harmony modules
  9402. /******/__webpack_require__.n = function (module) {
  9403. /******/var getter = module && module.__esModule ?
  9404. /******/function getDefault() {return module['default'];} :
  9405. /******/function getModuleExports() {return module;};
  9406. /******/__webpack_require__.d(getter, 'a', getter);
  9407. /******/return getter;
  9408. /******/};
  9409. /******/
  9410. /******/ // Object.prototype.hasOwnProperty.call
  9411. /******/__webpack_require__.o = function (object, property) {return Object.prototype.hasOwnProperty.call(object, property);};
  9412. /******/
  9413. /******/ // __webpack_public_path__
  9414. /******/__webpack_require__.p = "";
  9415. /******/
  9416. /******/ // Load entry module and return exports
  9417. /******/return __webpack_require__(__webpack_require__.s = 13);
  9418. /******/}(
  9419. /************************************************************************/
  9420. /******/[
  9421. /* 0 */
  9422. /***/function (module, exports, __webpack_require__) {
  9423. "use strict";
  9424. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {return typeof obj;} : function (obj) {return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;};
  9425. module.exports = {
  9426. type: function type(ob) {
  9427. return Object.prototype.toString.call(ob).slice(8, -1).toLowerCase();
  9428. },
  9429. isObject: function isObject(ob, real) {
  9430. if (real) {
  9431. return this.type(ob) === "object";
  9432. } else {
  9433. return ob && (typeof ob === 'undefined' ? 'undefined' : _typeof(ob)) === 'object';
  9434. }
  9435. },
  9436. isFormData: function isFormData(val) {
  9437. return typeof FormData !== 'undefined' && val instanceof FormData;
  9438. },
  9439. trim: function trim(str) {
  9440. return str.replace(/(^\s*)|(\s*$)/g, '');
  9441. },
  9442. encode: function encode(val) {
  9443. return encodeURIComponent(val).replace(/%40/gi, '@').replace(/%3A/gi, ':').replace(/%24/g, '$').replace(/%2C/gi, ',').replace(/%20/g, '+').replace(/%5B/gi, '[').replace(/%5D/gi, ']');
  9444. },
  9445. formatParams: function formatParams(data) {
  9446. var str = "";
  9447. var first = true;
  9448. var that = this;
  9449. if (!this.isObject(data)) {
  9450. return data;
  9451. }
  9452. function _encode(sub, path) {
  9453. var encode = that.encode;
  9454. var type = that.type(sub);
  9455. if (type == "array") {
  9456. sub.forEach(function (e, i) {
  9457. if (!that.isObject(e)) i = "";
  9458. _encode(e, path + ('%5B' + i + '%5D'));
  9459. });
  9460. } else if (type == "object") {
  9461. for (var key in sub) {
  9462. if (path) {
  9463. _encode(sub[key], path + "%5B" + encode(key) + "%5D");
  9464. } else {
  9465. _encode(sub[key], encode(key));
  9466. }
  9467. }
  9468. } else {
  9469. if (!first) {
  9470. str += "&";
  9471. }
  9472. first = false;
  9473. str += path + "=" + encode(sub);
  9474. }
  9475. }
  9476. _encode(data, "");
  9477. return str;
  9478. },
  9479. // Do not overwrite existing attributes
  9480. merge: function merge(a, b) {
  9481. for (var key in b) {
  9482. if (!a.hasOwnProperty(key)) {
  9483. a[key] = b[key];
  9484. } else if (this.isObject(b[key], 1) && this.isObject(a[key], 1)) {
  9485. this.merge(a[key], b[key]);
  9486. }
  9487. }
  9488. return a;
  9489. } };
  9490. /***/},
  9491. /* 1 */
  9492. /***/function (module, exports, __webpack_require__) {
  9493. function KEEP(_, cb) {cb();}
  9494. "use strict";
  9495. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {return typeof obj;} : function (obj) {return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;};
  9496. var _createClass = function () {function defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}return function (Constructor, protoProps, staticProps) {if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;};}();
  9497. function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}
  9498. /*
  9499. * author: wendu
  9500. * email: 824783146@qq.com
  9501. **/
  9502. var util = __webpack_require__(0);
  9503. var isBrowser = typeof document !== "undefined";
  9504. //EngineWrapper can help generating a http engine quickly through a adapter
  9505. function EngineWrapper(adapter) {
  9506. var AjaxEngine = function () {
  9507. function AjaxEngine() {
  9508. _classCallCheck(this, AjaxEngine);
  9509. this.requestHeaders = {};
  9510. this.readyState = 0;
  9511. this.timeout = 0; // 0 stands for no timeout
  9512. this.responseURL = "";
  9513. this.responseHeaders = {};
  9514. }
  9515. _createClass(AjaxEngine, [{
  9516. key: "_call",
  9517. value: function _call(name) {
  9518. this[name] && this[name].apply(this, [].splice.call(arguments, 1));
  9519. } },
  9520. {
  9521. key: "_changeReadyState",
  9522. value: function _changeReadyState(state) {
  9523. this.readyState = state;
  9524. this._call("onreadystatechange");
  9525. } },
  9526. {
  9527. key: "open",
  9528. value: function open(method, url) {
  9529. this.method = method;
  9530. if (!url) {
  9531. url = location.href;
  9532. } else {
  9533. url = util.trim(url);
  9534. if (url.indexOf("http") !== 0) {
  9535. // Normalize the request url
  9536. if (isBrowser) {
  9537. var t = document.createElement("a");
  9538. t.href = url;
  9539. url = t.href;
  9540. }
  9541. }
  9542. }
  9543. this.responseURL = url;
  9544. this._changeReadyState(1);
  9545. } },
  9546. {
  9547. key: "send",
  9548. value: function send(arg) {
  9549. var _this = this;
  9550. arg = arg || null;
  9551. var self = this;
  9552. if (adapter) {
  9553. var request = {
  9554. method: self.method,
  9555. url: self.responseURL,
  9556. headers: self.requestHeaders || {},
  9557. body: arg };
  9558. util.merge(request, self._options || {});
  9559. if (request.method === "GET") {
  9560. request.body = null;
  9561. }
  9562. self._changeReadyState(3);
  9563. var timer = void 0;
  9564. self.timeout = self.timeout || 0;
  9565. if (self.timeout > 0) {
  9566. timer = setTimeout(function () {
  9567. if (self.readyState === 3) {
  9568. _this._call("onloadend");
  9569. self._changeReadyState(0);
  9570. self._call("ontimeout");
  9571. }
  9572. }, self.timeout);
  9573. }
  9574. request.timeout = self.timeout;
  9575. adapter(request, function (response) {
  9576. function getAndDelete(key) {
  9577. var t = response[key];
  9578. delete response[key];
  9579. return t;
  9580. }
  9581. // If the request has already timeout, return
  9582. if (self.readyState !== 3) return;
  9583. clearTimeout(timer);
  9584. // Make sure the type of status is integer
  9585. self.status = getAndDelete("statusCode") - 0;
  9586. var responseText = getAndDelete("responseText");
  9587. var statusMessage = getAndDelete("statusMessage");
  9588. // Network error, set the status code 0
  9589. if (!self.status) {
  9590. self.statusText = responseText;
  9591. self._call("onerror", { msg: statusMessage });
  9592. } else {
  9593. // Parsing the response headers to array in a object, because
  9594. // there may be multiple values with the same header name
  9595. var responseHeaders = getAndDelete("headers");
  9596. var headers = {};
  9597. for (var field in responseHeaders) {
  9598. var value = responseHeaders[field];
  9599. var key = field.toLowerCase();
  9600. // Is array
  9601. if ((typeof value === "undefined" ? "undefined" : _typeof(value)) === "object") {
  9602. headers[key] = value;
  9603. } else {
  9604. headers[key] = headers[key] || [];
  9605. headers[key].push(value);
  9606. }
  9607. }
  9608. var cookies = headers["set-cookie"];
  9609. if (isBrowser && cookies) {
  9610. cookies.forEach(function (e) {
  9611. // Remove the http-Only property of the cookie
  9612. // so that JavaScript can operate it.
  9613. document.cookie = e.replace(/;\s*httpOnly/ig, "");
  9614. });
  9615. }
  9616. self.responseHeaders = headers;
  9617. // Set the fields of engine from response
  9618. self.statusText = statusMessage || "";
  9619. self.response = self.responseText = responseText;
  9620. self._response = response;
  9621. self._changeReadyState(4);
  9622. self._call("onload");
  9623. }
  9624. self._call("onloadend");
  9625. });
  9626. } else {
  9627. console.error("Ajax require adapter");
  9628. }
  9629. } },
  9630. {
  9631. key: "setRequestHeader",
  9632. value: function setRequestHeader(key, value) {
  9633. this.requestHeaders[util.trim(key)] = value;
  9634. } },
  9635. {
  9636. key: "getResponseHeader",
  9637. value: function getResponseHeader(key) {
  9638. return (this.responseHeaders[key.toLowerCase()] || "").toString() || null;
  9639. } },
  9640. {
  9641. key: "getAllResponseHeaders",
  9642. value: function getAllResponseHeaders() {
  9643. var str = "";
  9644. for (var key in this.responseHeaders) {
  9645. str += key + ":" + this.getResponseHeader(key) + "\r\n";
  9646. }
  9647. return str || null;
  9648. } },
  9649. {
  9650. key: "abort",
  9651. value: function abort(msg) {
  9652. this._changeReadyState(0);
  9653. this._call("onerror", { msg: msg });
  9654. this._call("onloadend");
  9655. } }],
  9656. [{
  9657. key: "setAdapter",
  9658. value: function setAdapter(requestAdapter) {
  9659. adapter = requestAdapter;
  9660. } }]);
  9661. return AjaxEngine;
  9662. }();
  9663. return AjaxEngine;
  9664. }
  9665. // learn more about keep-loader: https://github.com/wendux/keep-loader
  9666. ;
  9667. module.exports = EngineWrapper;
  9668. /***/},
  9669. /* 2 */
  9670. /***/function (module, exports, __webpack_require__) {
  9671. function KEEP(_, cb) {cb();}
  9672. "use strict";
  9673. var _createClass = function () {function defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}return function (Constructor, protoProps, staticProps) {if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor;};}();
  9674. function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}
  9675. var utils = __webpack_require__(0);
  9676. var isBrowser = typeof document !== "undefined";
  9677. var Fly = function () {
  9678. function Fly(engine) {
  9679. _classCallCheck(this, Fly);
  9680. this.engine = engine || XMLHttpRequest;
  9681. this.default = this; //For typeScript
  9682. /**
  9683. * Add lock/unlock API for interceptor.
  9684. *
  9685. * Once an request/response interceptor is locked, the incoming request/response
  9686. * will be added to a queue before they enter the interceptor, they will not be
  9687. * continued until the interceptor is unlocked.
  9688. *
  9689. * @param [interceptor] either is interceptors.request or interceptors.response
  9690. */
  9691. function wrap(interceptor) {
  9692. var resolve = void 0;
  9693. var reject = void 0;
  9694. function _clear() {
  9695. interceptor.p = resolve = reject = null;
  9696. }
  9697. utils.merge(interceptor, {
  9698. lock: function lock() {
  9699. if (!resolve) {
  9700. interceptor.p = new Promise(function (_resolve, _reject) {
  9701. resolve = _resolve;
  9702. reject = _reject;
  9703. });
  9704. }
  9705. },
  9706. unlock: function unlock() {
  9707. if (resolve) {
  9708. resolve();
  9709. _clear();
  9710. }
  9711. },
  9712. clear: function clear() {
  9713. if (reject) {
  9714. reject("cancel");
  9715. _clear();
  9716. }
  9717. } });
  9718. }
  9719. var interceptors = this.interceptors = {
  9720. response: {
  9721. use: function use(handler, onerror) {
  9722. this.handler = handler;
  9723. this.onerror = onerror;
  9724. } },
  9725. request: {
  9726. use: function use(handler) {
  9727. this.handler = handler;
  9728. } } };
  9729. var irq = interceptors.request;
  9730. var irp = interceptors.response;
  9731. wrap(irp);
  9732. wrap(irq);
  9733. this.config = {
  9734. method: "GET",
  9735. baseURL: "",
  9736. headers: {},
  9737. timeout: 0,
  9738. params: {}, // Default Url params
  9739. parseJson: true, // Convert response data to JSON object automatically.
  9740. withCredentials: false };
  9741. }
  9742. _createClass(Fly, [{
  9743. key: "request",
  9744. value: function request(url, data, options) {
  9745. var _this = this;
  9746. var engine = new this.engine();
  9747. var contentType = "Content-Type";
  9748. var contentTypeLowerCase = contentType.toLowerCase();
  9749. var interceptors = this.interceptors;
  9750. var requestInterceptor = interceptors.request;
  9751. var responseInterceptor = interceptors.response;
  9752. var requestInterceptorHandler = requestInterceptor.handler;
  9753. var promise = new Promise(function (resolve, reject) {
  9754. if (utils.isObject(url)) {
  9755. options = url;
  9756. url = options.url;
  9757. }
  9758. options = options || {};
  9759. options.headers = options.headers || {};
  9760. function isPromise(p) {
  9761. // some polyfill implementation of Promise may be not standard,
  9762. // so, we test by duck-typing
  9763. return p && p.then && p.catch;
  9764. }
  9765. /**
  9766. * If the request/response interceptor has been locked,
  9767. * the new request/response will enter a queue. otherwise, it will be performed directly.
  9768. * @param [promise] if the promise exist, means the interceptor is locked.
  9769. * @param [callback]
  9770. */
  9771. function enqueueIfLocked(promise, callback) {
  9772. if (promise) {
  9773. promise.then(function () {
  9774. callback();
  9775. });
  9776. } else {
  9777. callback();
  9778. }
  9779. }
  9780. // make the http request
  9781. function makeRequest(options) {
  9782. data = options.body;
  9783. // Normalize the request url
  9784. url = utils.trim(options.url);
  9785. var baseUrl = utils.trim(options.baseURL || "");
  9786. if (!url && isBrowser && !baseUrl) url = location.href;
  9787. if (url.indexOf("http") !== 0) {
  9788. var isAbsolute = url[0] === "/";
  9789. if (!baseUrl && isBrowser) {
  9790. var arr = location.pathname.split("/");
  9791. arr.pop();
  9792. baseUrl = location.protocol + "//" + location.host + (isAbsolute ? "" : arr.join("/"));
  9793. }
  9794. if (baseUrl[baseUrl.length - 1] !== "/") {
  9795. baseUrl += "/";
  9796. }
  9797. url = baseUrl + (isAbsolute ? url.substr(1) : url);
  9798. if (isBrowser) {
  9799. // Normalize the url which contains the ".." or ".", such as
  9800. // "http://xx.com/aa/bb/../../xx" to "http://xx.com/xx" .
  9801. var t = document.createElement("a");
  9802. t.href = url;
  9803. url = t.href;
  9804. }
  9805. }
  9806. var responseType = utils.trim(options.responseType || "");
  9807. var needQuery = ["GET", "HEAD", "DELETE", "OPTION"].indexOf(options.method) !== -1;
  9808. var dataType = utils.type(data);
  9809. var params = options.params || {};
  9810. // merge url params when the method is "GET" (data is object)
  9811. if (needQuery && dataType === "object") {
  9812. params = utils.merge(data, params);
  9813. }
  9814. // encode params to String
  9815. params = utils.formatParams(params);
  9816. // save url params
  9817. var _params = [];
  9818. if (params) {
  9819. _params.push(params);
  9820. }
  9821. // Add data to url params when the method is "GET" (data is String)
  9822. if (needQuery && data && dataType === "string") {
  9823. _params.push(data);
  9824. }
  9825. // make the final url
  9826. if (_params.length > 0) {
  9827. url += (url.indexOf("?") === -1 ? "?" : "&") + _params.join("&");
  9828. }
  9829. engine.open(options.method, url);
  9830. // try catch for ie >=9
  9831. try {
  9832. engine.withCredentials = !!options.withCredentials;
  9833. engine.timeout = options.timeout || 0;
  9834. if (responseType !== "stream") {
  9835. engine.responseType = responseType;
  9836. }
  9837. } catch (e) {}
  9838. var customContentType = options.headers[contentType] || options.headers[contentTypeLowerCase];
  9839. // default content type
  9840. var _contentType = "application/x-www-form-urlencoded";
  9841. // If the request data is json object, transforming it to json string,
  9842. // and set request content-type to "json". In browser, the data will
  9843. // be sent as RequestBody instead of FormData
  9844. if (utils.trim((customContentType || "").toLowerCase()) === _contentType) {
  9845. data = utils.formatParams(data);
  9846. } else if (!utils.isFormData(data) && ["object", "array"].indexOf(utils.type(data)) !== -1) {
  9847. _contentType = 'application/json;charset=utf-8';
  9848. data = JSON.stringify(data);
  9849. }
  9850. //If user doesn't set content-type, set default.
  9851. if (!(customContentType || needQuery)) {
  9852. options.headers[contentType] = _contentType;
  9853. }
  9854. for (var k in options.headers) {
  9855. if (k === contentType && utils.isFormData(data)) {
  9856. // Delete the content-type, Let the browser set it
  9857. delete options.headers[k];
  9858. } else {
  9859. try {
  9860. // In browser environment, some header fields are readonly,
  9861. // write will cause the exception .
  9862. engine.setRequestHeader(k, options.headers[k]);
  9863. } catch (e) {}
  9864. }
  9865. }
  9866. function onresult(handler, data, type) {
  9867. enqueueIfLocked(responseInterceptor.p, function () {
  9868. if (handler) {
  9869. //如果失败,添加请求信息
  9870. if (type) {
  9871. data.request = options;
  9872. }
  9873. var ret = handler.call(responseInterceptor, data, Promise);
  9874. data = ret === undefined ? data : ret;
  9875. }
  9876. if (!isPromise(data)) {
  9877. data = Promise[type === 0 ? "resolve" : "reject"](data);
  9878. }
  9879. data.then(function (d) {
  9880. resolve(d);
  9881. }).catch(function (e) {
  9882. reject(e);
  9883. });
  9884. });
  9885. }
  9886. function onerror(e) {
  9887. e.engine = engine;
  9888. onresult(responseInterceptor.onerror, e, -1);
  9889. }
  9890. function Err(msg, status) {
  9891. this.message = msg;
  9892. this.status = status;
  9893. }
  9894. engine.onload = function () {
  9895. try {
  9896. // The xhr of IE9 has not response field
  9897. var response = engine.response || engine.responseText;
  9898. if (response && options.parseJson && (engine.getResponseHeader(contentType) || "").indexOf("json") !== -1
  9899. // Some third engine implementation may transform the response text to json object automatically,
  9900. // so we should test the type of response before transforming it
  9901. && !utils.isObject(response)) {
  9902. response = JSON.parse(response);
  9903. }
  9904. var headers = engine.responseHeaders;
  9905. // In browser
  9906. if (!headers) {
  9907. headers = {};
  9908. var items = (engine.getAllResponseHeaders() || "").split("\r\n");
  9909. items.pop();
  9910. items.forEach(function (e) {
  9911. if (!e) return;
  9912. var key = e.split(":")[0];
  9913. headers[key] = engine.getResponseHeader(key);
  9914. });
  9915. }
  9916. var status = engine.status;
  9917. var statusText = engine.statusText;
  9918. var _data = { data: response, headers: headers, status: status, statusText: statusText };
  9919. // The _response filed of engine is set in adapter which be called in engine-wrapper.js
  9920. utils.merge(_data, engine._response);
  9921. if (status >= 200 && status < 300 || status === 304) {
  9922. _data.engine = engine;
  9923. _data.request = options;
  9924. onresult(responseInterceptor.handler, _data, 0);
  9925. } else {
  9926. var e = new Err(statusText, status);
  9927. e.response = _data;
  9928. onerror(e);
  9929. }
  9930. } catch (e) {
  9931. onerror(new Err(e.msg, engine.status));
  9932. }
  9933. };
  9934. engine.onerror = function (e) {
  9935. onerror(new Err(e.msg || "Network Error", 0));
  9936. };
  9937. engine.ontimeout = function () {
  9938. onerror(new Err("timeout [ " + engine.timeout + "ms ]", 1));
  9939. };
  9940. engine._options = options;
  9941. setTimeout(function () {
  9942. engine.send(needQuery ? null : data);
  9943. }, 0);
  9944. }
  9945. enqueueIfLocked(requestInterceptor.p, function () {
  9946. utils.merge(options, JSON.parse(JSON.stringify(_this.config)));
  9947. var headers = options.headers;
  9948. headers[contentType] = headers[contentType] || headers[contentTypeLowerCase] || "";
  9949. delete headers[contentTypeLowerCase];
  9950. options.body = data || options.body;
  9951. url = utils.trim(url || "");
  9952. options.method = options.method.toUpperCase();
  9953. options.url = url;
  9954. var ret = options;
  9955. if (requestInterceptorHandler) {
  9956. ret = requestInterceptorHandler.call(requestInterceptor, options, Promise) || options;
  9957. }
  9958. if (!isPromise(ret)) {
  9959. ret = Promise.resolve(ret);
  9960. }
  9961. ret.then(function (d) {
  9962. //if options continue
  9963. if (d === options) {
  9964. makeRequest(d);
  9965. } else {
  9966. resolve(d);
  9967. }
  9968. }, function (err) {
  9969. reject(err);
  9970. });
  9971. });
  9972. });
  9973. promise.engine = engine;
  9974. return promise;
  9975. } },
  9976. {
  9977. key: "all",
  9978. value: function all(promises) {
  9979. return Promise.all(promises);
  9980. } },
  9981. {
  9982. key: "spread",
  9983. value: function spread(callback) {
  9984. return function (arr) {
  9985. return callback.apply(null, arr);
  9986. };
  9987. } }]);
  9988. return Fly;
  9989. }();
  9990. //For typeScript
  9991. Fly.default = Fly;
  9992. ["get", "post", "put", "patch", "head", "delete"].forEach(function (e) {
  9993. Fly.prototype[e] = function (url, data, option) {
  9994. return this.request(url, data, utils.merge({ method: e }, option));
  9995. };
  9996. });
  9997. ["lock", "unlock", "clear"].forEach(function (e) {
  9998. Fly.prototype[e] = function () {
  9999. this.interceptors.request[e]();
  10000. };
  10001. });
  10002. // Learn more about keep-loader: https://github.com/wendux/keep-loader
  10003. ;
  10004. module.exports = Fly;
  10005. /***/},,,,,
  10006. /* 3 */
  10007. /* 4 */
  10008. /* 5 */
  10009. /* 6 */
  10010. /* 7 */
  10011. /***/function (module, exports, __webpack_require__) {
  10012. "use strict";
  10013. //微信小程序适配器
  10014. module.exports = function (request, responseCallback) {
  10015. var con = {
  10016. method: request.method,
  10017. url: request.url,
  10018. dataType: request.dataType || undefined,
  10019. header: request.headers,
  10020. data: request.body || {},
  10021. responseType: request.responseType || 'text',
  10022. success: function success(res) {
  10023. responseCallback({
  10024. statusCode: res.statusCode,
  10025. responseText: res.data,
  10026. headers: res.header,
  10027. statusMessage: res.errMsg });
  10028. },
  10029. fail: function fail(res) {
  10030. responseCallback({
  10031. statusCode: res.statusCode || 0,
  10032. statusMessage: res.errMsg });
  10033. } };
  10034. wx.request(con);
  10035. };
  10036. /***/},,,,,,
  10037. /* 8 */
  10038. /* 9 */
  10039. /* 10 */
  10040. /* 11 */
  10041. /* 12 */
  10042. /* 13 */
  10043. /***/function (module, exports, __webpack_require__) {
  10044. "use strict";
  10045. //微信小程序入口
  10046. var _Fly = __webpack_require__(2);
  10047. var EngineWrapper = __webpack_require__(1);
  10048. var adapter = __webpack_require__(7);
  10049. var wxEngine = EngineWrapper(adapter);
  10050. module.exports = function (engine) {
  10051. return new _Fly(engine || wxEngine);
  10052. };
  10053. /***/}]));
  10054. });
  10055. /***/ }),
  10056. /* 18 */,
  10057. /* 19 */,
  10058. /* 20 */
  10059. /*!**********************************************************************************************************!*\
  10060. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  10061. \**********************************************************************************************************/
  10062. /*! exports provided: default */
  10063. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10064. "use strict";
  10065. __webpack_require__.r(__webpack_exports__);
  10066. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  10067. /* globals __VUE_SSR_CONTEXT__ */
  10068. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  10069. // This module is a runtime utility for cleaner component module output and will
  10070. // be included in the final webpack user bundle.
  10071. function normalizeComponent (
  10072. scriptExports,
  10073. render,
  10074. staticRenderFns,
  10075. functionalTemplate,
  10076. injectStyles,
  10077. scopeId,
  10078. moduleIdentifier, /* server only */
  10079. shadowMode, /* vue-cli only */
  10080. components, // fixed by xxxxxx auto components
  10081. renderjs // fixed by xxxxxx renderjs
  10082. ) {
  10083. // Vue.extend constructor export interop
  10084. var options = typeof scriptExports === 'function'
  10085. ? scriptExports.options
  10086. : scriptExports
  10087. // fixed by xxxxxx auto components
  10088. if (components) {
  10089. options.components = Object.assign(components, options.components || {})
  10090. }
  10091. // fixed by xxxxxx renderjs
  10092. if (renderjs) {
  10093. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  10094. this[renderjs.__module] = this
  10095. });
  10096. (options.mixins || (options.mixins = [])).push(renderjs)
  10097. }
  10098. // render functions
  10099. if (render) {
  10100. options.render = render
  10101. options.staticRenderFns = staticRenderFns
  10102. options._compiled = true
  10103. }
  10104. // functional template
  10105. if (functionalTemplate) {
  10106. options.functional = true
  10107. }
  10108. // scopedId
  10109. if (scopeId) {
  10110. options._scopeId = 'data-v-' + scopeId
  10111. }
  10112. var hook
  10113. if (moduleIdentifier) { // server build
  10114. hook = function (context) {
  10115. // 2.3 injection
  10116. context =
  10117. context || // cached call
  10118. (this.$vnode && this.$vnode.ssrContext) || // stateful
  10119. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  10120. // 2.2 with runInNewContext: true
  10121. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  10122. context = __VUE_SSR_CONTEXT__
  10123. }
  10124. // inject component styles
  10125. if (injectStyles) {
  10126. injectStyles.call(this, context)
  10127. }
  10128. // register component module identifier for async chunk inferrence
  10129. if (context && context._registeredComponents) {
  10130. context._registeredComponents.add(moduleIdentifier)
  10131. }
  10132. }
  10133. // used by ssr in case component is cached and beforeCreate
  10134. // never gets called
  10135. options._ssrRegister = hook
  10136. } else if (injectStyles) {
  10137. hook = shadowMode
  10138. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  10139. : injectStyles
  10140. }
  10141. if (hook) {
  10142. if (options.functional) {
  10143. // for template-only hot-reload because in that case the render fn doesn't
  10144. // go through the normalizer
  10145. options._injectStyles = hook
  10146. // register for functioal component in vue file
  10147. var originalRender = options.render
  10148. options.render = function renderWithStyleInjection (h, context) {
  10149. hook.call(context)
  10150. return originalRender(h, context)
  10151. }
  10152. } else {
  10153. // inject component registration as beforeCreate hook
  10154. var existing = options.beforeCreate
  10155. options.beforeCreate = existing
  10156. ? [].concat(existing, hook)
  10157. : [hook]
  10158. }
  10159. }
  10160. return {
  10161. exports: scriptExports,
  10162. options: options
  10163. }
  10164. }
  10165. /***/ })
  10166. ]]);
  10167. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map