vendor.js 308 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],[
  2. /* 0 */,
  3. /* 1 */
  4. /*!*********************************************************!*\
  5. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js ***!
  6. \*********************************************************/
  7. /*! no static exports found */
  8. /***/ (function(module, exports, __webpack_require__) {
  9. "use strict";
  10. Object.defineProperty(exports, "__esModule", {
  11. value: true
  12. });
  13. exports.default = void 0;
  14. var objectKeys = ['qy', 'env', 'error', 'version', 'lanDebug', 'cloud', 'serviceMarket', 'router', 'worklet'];
  15. var target = typeof globalThis !== 'undefined' ? globalThis : function () {
  16. return this;
  17. }();
  18. var key = ['w', 'x'].join('');
  19. var oldWx = target[key];
  20. function isWxKey(key) {
  21. return objectKeys.indexOf(key) > -1 || typeof oldWx[key] === 'function';
  22. }
  23. function initWx() {
  24. var newWx = {};
  25. for (var _key in oldWx) {
  26. if (isWxKey(_key)) {
  27. // TODO wrapper function
  28. newWx[_key] = oldWx[_key];
  29. }
  30. }
  31. return newWx;
  32. }
  33. target[key] = initWx();
  34. var _default = target[key];
  35. exports.default = _default;
  36. /***/ }),
  37. /* 2 */
  38. /*!************************************************************!*\
  39. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  40. \************************************************************/
  41. /*! no static exports found */
  42. /***/ (function(module, exports, __webpack_require__) {
  43. "use strict";
  44. /* WEBPACK VAR INJECTION */(function(wx, global) {
  45. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  46. Object.defineProperty(exports, "__esModule", {
  47. value: true
  48. });
  49. exports.createApp = createApp;
  50. exports.createComponent = createComponent;
  51. exports.createPage = createPage;
  52. exports.createPlugin = createPlugin;
  53. exports.createSubpackageApp = createSubpackageApp;
  54. exports.default = void 0;
  55. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  56. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  57. var _construct2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/construct */ 15));
  58. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
  59. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  60. var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 22);
  61. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 25));
  62. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
  63. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
  64. var realAtob;
  65. var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  66. var b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  67. if (typeof atob !== 'function') {
  68. realAtob = function realAtob(str) {
  69. str = String(str).replace(/[\t\n\f\r ]+/g, '');
  70. if (!b64re.test(str)) {
  71. throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  72. }
  73. // Adding the padding if missing, for semplicity
  74. str += '=='.slice(2 - (str.length & 3));
  75. var bitmap;
  76. var result = '';
  77. var r1;
  78. var r2;
  79. var i = 0;
  80. for (; i < str.length;) {
  81. bitmap = b64.indexOf(str.charAt(i++)) << 18 | b64.indexOf(str.charAt(i++)) << 12 | (r1 = b64.indexOf(str.charAt(i++))) << 6 | (r2 = b64.indexOf(str.charAt(i++)));
  82. result += r1 === 64 ? String.fromCharCode(bitmap >> 16 & 255) : r2 === 64 ? String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255) : String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255);
  83. }
  84. return result;
  85. };
  86. } else {
  87. // 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法
  88. realAtob = atob;
  89. }
  90. function b64DecodeUnicode(str) {
  91. return decodeURIComponent(realAtob(str).split('').map(function (c) {
  92. return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
  93. }).join(''));
  94. }
  95. function getCurrentUserInfo() {
  96. var token = wx.getStorageSync('uni_id_token') || '';
  97. var tokenArr = token.split('.');
  98. if (!token || tokenArr.length !== 3) {
  99. return {
  100. uid: null,
  101. role: [],
  102. permission: [],
  103. tokenExpired: 0
  104. };
  105. }
  106. var userInfo;
  107. try {
  108. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  109. } catch (error) {
  110. throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message);
  111. }
  112. userInfo.tokenExpired = userInfo.exp * 1000;
  113. delete userInfo.exp;
  114. delete userInfo.iat;
  115. return userInfo;
  116. }
  117. function uniIdMixin(Vue) {
  118. Vue.prototype.uniIDHasRole = function (roleId) {
  119. var _getCurrentUserInfo = getCurrentUserInfo(),
  120. role = _getCurrentUserInfo.role;
  121. return role.indexOf(roleId) > -1;
  122. };
  123. Vue.prototype.uniIDHasPermission = function (permissionId) {
  124. var _getCurrentUserInfo2 = getCurrentUserInfo(),
  125. permission = _getCurrentUserInfo2.permission;
  126. return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1;
  127. };
  128. Vue.prototype.uniIDTokenValid = function () {
  129. var _getCurrentUserInfo3 = getCurrentUserInfo(),
  130. tokenExpired = _getCurrentUserInfo3.tokenExpired;
  131. return tokenExpired > Date.now();
  132. };
  133. }
  134. var _toString = Object.prototype.toString;
  135. var hasOwnProperty = Object.prototype.hasOwnProperty;
  136. function isFn(fn) {
  137. return typeof fn === 'function';
  138. }
  139. function isStr(str) {
  140. return typeof str === 'string';
  141. }
  142. function isObject(obj) {
  143. return obj !== null && (0, _typeof2.default)(obj) === 'object';
  144. }
  145. function isPlainObject(obj) {
  146. return _toString.call(obj) === '[object Object]';
  147. }
  148. function hasOwn(obj, key) {
  149. return hasOwnProperty.call(obj, key);
  150. }
  151. function noop() {}
  152. /**
  153. * Create a cached version of a pure function.
  154. */
  155. function cached(fn) {
  156. var cache = Object.create(null);
  157. return function cachedFn(str) {
  158. var hit = cache[str];
  159. return hit || (cache[str] = fn(str));
  160. };
  161. }
  162. /**
  163. * Camelize a hyphen-delimited string.
  164. */
  165. var camelizeRE = /-(\w)/g;
  166. var camelize = cached(function (str) {
  167. return str.replace(camelizeRE, function (_, c) {
  168. return c ? c.toUpperCase() : '';
  169. });
  170. });
  171. function sortObject(obj) {
  172. var sortObj = {};
  173. if (isPlainObject(obj)) {
  174. Object.keys(obj).sort().forEach(function (key) {
  175. sortObj[key] = obj[key];
  176. });
  177. }
  178. return !Object.keys(sortObj) ? obj : sortObj;
  179. }
  180. var HOOKS = ['invoke', 'success', 'fail', 'complete', 'returnValue'];
  181. var globalInterceptors = {};
  182. var scopedInterceptors = {};
  183. function mergeHook(parentVal, childVal) {
  184. var res = childVal ? parentVal ? parentVal.concat(childVal) : Array.isArray(childVal) ? childVal : [childVal] : parentVal;
  185. return res ? dedupeHooks(res) : res;
  186. }
  187. function dedupeHooks(hooks) {
  188. var res = [];
  189. for (var i = 0; i < hooks.length; i++) {
  190. if (res.indexOf(hooks[i]) === -1) {
  191. res.push(hooks[i]);
  192. }
  193. }
  194. return res;
  195. }
  196. function removeHook(hooks, hook) {
  197. var index = hooks.indexOf(hook);
  198. if (index !== -1) {
  199. hooks.splice(index, 1);
  200. }
  201. }
  202. function mergeInterceptorHook(interceptor, option) {
  203. Object.keys(option).forEach(function (hook) {
  204. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  205. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  206. }
  207. });
  208. }
  209. function removeInterceptorHook(interceptor, option) {
  210. if (!interceptor || !option) {
  211. return;
  212. }
  213. Object.keys(option).forEach(function (hook) {
  214. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  215. removeHook(interceptor[hook], option[hook]);
  216. }
  217. });
  218. }
  219. function addInterceptor(method, option) {
  220. if (typeof method === 'string' && isPlainObject(option)) {
  221. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  222. } else if (isPlainObject(method)) {
  223. mergeInterceptorHook(globalInterceptors, method);
  224. }
  225. }
  226. function removeInterceptor(method, option) {
  227. if (typeof method === 'string') {
  228. if (isPlainObject(option)) {
  229. removeInterceptorHook(scopedInterceptors[method], option);
  230. } else {
  231. delete scopedInterceptors[method];
  232. }
  233. } else if (isPlainObject(method)) {
  234. removeInterceptorHook(globalInterceptors, method);
  235. }
  236. }
  237. function wrapperHook(hook) {
  238. return function (data) {
  239. return hook(data) || data;
  240. };
  241. }
  242. function isPromise(obj) {
  243. return !!obj && ((0, _typeof2.default)(obj) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  244. }
  245. function queue(hooks, data) {
  246. var promise = false;
  247. for (var i = 0; i < hooks.length; i++) {
  248. var hook = hooks[i];
  249. if (promise) {
  250. promise = Promise.resolve(wrapperHook(hook));
  251. } else {
  252. var res = hook(data);
  253. if (isPromise(res)) {
  254. promise = Promise.resolve(res);
  255. }
  256. if (res === false) {
  257. return {
  258. then: function then() {}
  259. };
  260. }
  261. }
  262. }
  263. return promise || {
  264. then: function then(callback) {
  265. return callback(data);
  266. }
  267. };
  268. }
  269. function wrapperOptions(interceptor) {
  270. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  271. ['success', 'fail', 'complete'].forEach(function (name) {
  272. if (Array.isArray(interceptor[name])) {
  273. var oldCallback = options[name];
  274. options[name] = function callbackInterceptor(res) {
  275. queue(interceptor[name], res).then(function (res) {
  276. /* eslint-disable no-mixed-operators */
  277. return isFn(oldCallback) && oldCallback(res) || res;
  278. });
  279. };
  280. }
  281. });
  282. return options;
  283. }
  284. function wrapperReturnValue(method, returnValue) {
  285. var returnValueHooks = [];
  286. if (Array.isArray(globalInterceptors.returnValue)) {
  287. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(globalInterceptors.returnValue));
  288. }
  289. var interceptor = scopedInterceptors[method];
  290. if (interceptor && Array.isArray(interceptor.returnValue)) {
  291. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(interceptor.returnValue));
  292. }
  293. returnValueHooks.forEach(function (hook) {
  294. returnValue = hook(returnValue) || returnValue;
  295. });
  296. return returnValue;
  297. }
  298. function getApiInterceptorHooks(method) {
  299. var interceptor = Object.create(null);
  300. Object.keys(globalInterceptors).forEach(function (hook) {
  301. if (hook !== 'returnValue') {
  302. interceptor[hook] = globalInterceptors[hook].slice();
  303. }
  304. });
  305. var scopedInterceptor = scopedInterceptors[method];
  306. if (scopedInterceptor) {
  307. Object.keys(scopedInterceptor).forEach(function (hook) {
  308. if (hook !== 'returnValue') {
  309. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  310. }
  311. });
  312. }
  313. return interceptor;
  314. }
  315. function invokeApi(method, api, options) {
  316. for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
  317. params[_key - 3] = arguments[_key];
  318. }
  319. var interceptor = getApiInterceptorHooks(method);
  320. if (interceptor && Object.keys(interceptor).length) {
  321. if (Array.isArray(interceptor.invoke)) {
  322. var res = queue(interceptor.invoke, options);
  323. return res.then(function (options) {
  324. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  325. });
  326. } else {
  327. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  328. }
  329. }
  330. return api.apply(void 0, [options].concat(params));
  331. }
  332. var promiseInterceptor = {
  333. returnValue: function returnValue(res) {
  334. if (!isPromise(res)) {
  335. return res;
  336. }
  337. return new Promise(function (resolve, reject) {
  338. res.then(function (res) {
  339. if (res[0]) {
  340. reject(res[0]);
  341. } else {
  342. resolve(res[1]);
  343. }
  344. });
  345. });
  346. }
  347. };
  348. var SYNC_API_RE = /^\$|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback|getWindowInfo|getDeviceInfo|getAppBaseInfo|getSystemSetting|getAppAuthorizeSetting/;
  349. var CONTEXT_API_RE = /^create|Manager$/;
  350. // Context例外情况
  351. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  352. // 同步例外情况
  353. var ASYNC_API = ['createBLEConnection', 'createPushMessage'];
  354. var CALLBACK_API_RE = /^on|^off/;
  355. function isContextApi(name) {
  356. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  357. }
  358. function isSyncApi(name) {
  359. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  360. }
  361. function isCallbackApi(name) {
  362. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  363. }
  364. function handlePromise(promise) {
  365. return promise.then(function (data) {
  366. return [null, data];
  367. }).catch(function (err) {
  368. return [err];
  369. });
  370. }
  371. function shouldPromise(name) {
  372. if (isContextApi(name) || isSyncApi(name) || isCallbackApi(name)) {
  373. return false;
  374. }
  375. return true;
  376. }
  377. /* eslint-disable no-extend-native */
  378. if (!Promise.prototype.finally) {
  379. Promise.prototype.finally = function (callback) {
  380. var promise = this.constructor;
  381. return this.then(function (value) {
  382. return promise.resolve(callback()).then(function () {
  383. return value;
  384. });
  385. }, function (reason) {
  386. return promise.resolve(callback()).then(function () {
  387. throw reason;
  388. });
  389. });
  390. };
  391. }
  392. function promisify(name, api) {
  393. if (!shouldPromise(name) || !isFn(api)) {
  394. return api;
  395. }
  396. return function promiseApi() {
  397. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  398. for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  399. params[_key2 - 1] = arguments[_key2];
  400. }
  401. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  402. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  403. }
  404. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  405. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  406. success: resolve,
  407. fail: reject
  408. })].concat(params));
  409. })));
  410. };
  411. }
  412. var EPS = 1e-4;
  413. var BASE_DEVICE_WIDTH = 750;
  414. var isIOS = false;
  415. var deviceWidth = 0;
  416. var deviceDPR = 0;
  417. function checkDeviceWidth() {
  418. var _wx$getSystemInfoSync = wx.getSystemInfoSync(),
  419. platform = _wx$getSystemInfoSync.platform,
  420. pixelRatio = _wx$getSystemInfoSync.pixelRatio,
  421. windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  422. deviceWidth = windowWidth;
  423. deviceDPR = pixelRatio;
  424. isIOS = platform === 'ios';
  425. }
  426. function upx2px(number, newDeviceWidth) {
  427. if (deviceWidth === 0) {
  428. checkDeviceWidth();
  429. }
  430. number = Number(number);
  431. if (number === 0) {
  432. return 0;
  433. }
  434. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  435. if (result < 0) {
  436. result = -result;
  437. }
  438. result = Math.floor(result + EPS);
  439. if (result === 0) {
  440. if (deviceDPR === 1 || !isIOS) {
  441. result = 1;
  442. } else {
  443. result = 0.5;
  444. }
  445. }
  446. return number < 0 ? -result : result;
  447. }
  448. var LOCALE_ZH_HANS = 'zh-Hans';
  449. var LOCALE_ZH_HANT = 'zh-Hant';
  450. var LOCALE_EN = 'en';
  451. var LOCALE_FR = 'fr';
  452. var LOCALE_ES = 'es';
  453. var messages = {};
  454. var locale;
  455. {
  456. locale = normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  457. }
  458. function initI18nMessages() {
  459. if (!isEnableLocale()) {
  460. return;
  461. }
  462. var localeKeys = Object.keys(__uniConfig.locales);
  463. if (localeKeys.length) {
  464. localeKeys.forEach(function (locale) {
  465. var curMessages = messages[locale];
  466. var userMessages = __uniConfig.locales[locale];
  467. if (curMessages) {
  468. Object.assign(curMessages, userMessages);
  469. } else {
  470. messages[locale] = userMessages;
  471. }
  472. });
  473. }
  474. }
  475. initI18nMessages();
  476. var i18n = (0, _uniI18n.initVueI18n)(locale, {});
  477. var t = i18n.t;
  478. var i18nMixin = i18n.mixin = {
  479. beforeCreate: function beforeCreate() {
  480. var _this = this;
  481. var unwatch = i18n.i18n.watchLocale(function () {
  482. _this.$forceUpdate();
  483. });
  484. this.$once('hook:beforeDestroy', function () {
  485. unwatch();
  486. });
  487. },
  488. methods: {
  489. $$t: function $$t(key, values) {
  490. return t(key, values);
  491. }
  492. }
  493. };
  494. var setLocale = i18n.setLocale;
  495. var getLocale = i18n.getLocale;
  496. function initAppLocale(Vue, appVm, locale) {
  497. var state = Vue.observable({
  498. locale: locale || i18n.getLocale()
  499. });
  500. var localeWatchers = [];
  501. appVm.$watchLocale = function (fn) {
  502. localeWatchers.push(fn);
  503. };
  504. Object.defineProperty(appVm, '$locale', {
  505. get: function get() {
  506. return state.locale;
  507. },
  508. set: function set(v) {
  509. state.locale = v;
  510. localeWatchers.forEach(function (watch) {
  511. return watch(v);
  512. });
  513. }
  514. });
  515. }
  516. function isEnableLocale() {
  517. return typeof __uniConfig !== 'undefined' && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length;
  518. }
  519. function include(str, parts) {
  520. return !!parts.find(function (part) {
  521. return str.indexOf(part) !== -1;
  522. });
  523. }
  524. function startsWith(str, parts) {
  525. return parts.find(function (part) {
  526. return str.indexOf(part) === 0;
  527. });
  528. }
  529. function normalizeLocale(locale, messages) {
  530. if (!locale) {
  531. return;
  532. }
  533. locale = locale.trim().replace(/_/g, '-');
  534. if (messages && messages[locale]) {
  535. return locale;
  536. }
  537. locale = locale.toLowerCase();
  538. if (locale === 'chinese') {
  539. // 支付宝
  540. return LOCALE_ZH_HANS;
  541. }
  542. if (locale.indexOf('zh') === 0) {
  543. if (locale.indexOf('-hans') > -1) {
  544. return LOCALE_ZH_HANS;
  545. }
  546. if (locale.indexOf('-hant') > -1) {
  547. return LOCALE_ZH_HANT;
  548. }
  549. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  550. return LOCALE_ZH_HANT;
  551. }
  552. return LOCALE_ZH_HANS;
  553. }
  554. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  555. if (lang) {
  556. return lang;
  557. }
  558. }
  559. // export function initI18n() {
  560. // const localeKeys = Object.keys(__uniConfig.locales || {})
  561. // if (localeKeys.length) {
  562. // localeKeys.forEach((locale) =>
  563. // i18n.add(locale, __uniConfig.locales[locale])
  564. // )
  565. // }
  566. // }
  567. function getLocale$1() {
  568. // 优先使用 $locale
  569. if (isFn(getApp)) {
  570. var app = getApp({
  571. allowDefault: true
  572. });
  573. if (app && app.$vm) {
  574. return app.$vm.$locale;
  575. }
  576. }
  577. return normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  578. }
  579. function setLocale$1(locale) {
  580. var app = isFn(getApp) ? getApp() : false;
  581. if (!app) {
  582. return false;
  583. }
  584. var oldLocale = app.$vm.$locale;
  585. if (oldLocale !== locale) {
  586. app.$vm.$locale = locale;
  587. onLocaleChangeCallbacks.forEach(function (fn) {
  588. return fn({
  589. locale: locale
  590. });
  591. });
  592. return true;
  593. }
  594. return false;
  595. }
  596. var onLocaleChangeCallbacks = [];
  597. function onLocaleChange(fn) {
  598. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  599. onLocaleChangeCallbacks.push(fn);
  600. }
  601. }
  602. if (typeof global !== 'undefined') {
  603. global.getLocale = getLocale$1;
  604. }
  605. var interceptors = {
  606. promiseInterceptor: promiseInterceptor
  607. };
  608. var baseApi = /*#__PURE__*/Object.freeze({
  609. __proto__: null,
  610. upx2px: upx2px,
  611. getLocale: getLocale$1,
  612. setLocale: setLocale$1,
  613. onLocaleChange: onLocaleChange,
  614. addInterceptor: addInterceptor,
  615. removeInterceptor: removeInterceptor,
  616. interceptors: interceptors
  617. });
  618. function findExistsPageIndex(url) {
  619. var pages = getCurrentPages();
  620. var len = pages.length;
  621. while (len--) {
  622. var page = pages[len];
  623. if (page.$page && page.$page.fullPath === url) {
  624. return len;
  625. }
  626. }
  627. return -1;
  628. }
  629. var redirectTo = {
  630. name: function name(fromArgs) {
  631. if (fromArgs.exists === 'back' && fromArgs.delta) {
  632. return 'navigateBack';
  633. }
  634. return 'redirectTo';
  635. },
  636. args: function args(fromArgs) {
  637. if (fromArgs.exists === 'back' && fromArgs.url) {
  638. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  639. if (existsPageIndex !== -1) {
  640. var delta = getCurrentPages().length - 1 - existsPageIndex;
  641. if (delta > 0) {
  642. fromArgs.delta = delta;
  643. }
  644. }
  645. }
  646. }
  647. };
  648. var previewImage = {
  649. args: function args(fromArgs) {
  650. var currentIndex = parseInt(fromArgs.current);
  651. if (isNaN(currentIndex)) {
  652. return;
  653. }
  654. var urls = fromArgs.urls;
  655. if (!Array.isArray(urls)) {
  656. return;
  657. }
  658. var len = urls.length;
  659. if (!len) {
  660. return;
  661. }
  662. if (currentIndex < 0) {
  663. currentIndex = 0;
  664. } else if (currentIndex >= len) {
  665. currentIndex = len - 1;
  666. }
  667. if (currentIndex > 0) {
  668. fromArgs.current = urls[currentIndex];
  669. fromArgs.urls = urls.filter(function (item, index) {
  670. return index < currentIndex ? item !== urls[currentIndex] : true;
  671. });
  672. } else {
  673. fromArgs.current = urls[0];
  674. }
  675. return {
  676. indicator: false,
  677. loop: false
  678. };
  679. }
  680. };
  681. var UUID_KEY = '__DC_STAT_UUID';
  682. var deviceId;
  683. function useDeviceId(result) {
  684. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  685. if (!deviceId) {
  686. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  687. wx.setStorage({
  688. key: UUID_KEY,
  689. data: deviceId
  690. });
  691. }
  692. result.deviceId = deviceId;
  693. }
  694. function addSafeAreaInsets(result) {
  695. if (result.safeArea) {
  696. var safeArea = result.safeArea;
  697. result.safeAreaInsets = {
  698. top: safeArea.top,
  699. left: safeArea.left,
  700. right: result.windowWidth - safeArea.right,
  701. bottom: result.screenHeight - safeArea.bottom
  702. };
  703. }
  704. }
  705. function populateParameters(result) {
  706. var _result$brand = result.brand,
  707. brand = _result$brand === void 0 ? '' : _result$brand,
  708. _result$model = result.model,
  709. model = _result$model === void 0 ? '' : _result$model,
  710. _result$system = result.system,
  711. system = _result$system === void 0 ? '' : _result$system,
  712. _result$language = result.language,
  713. language = _result$language === void 0 ? '' : _result$language,
  714. theme = result.theme,
  715. version = result.version,
  716. platform = result.platform,
  717. fontSizeSetting = result.fontSizeSetting,
  718. SDKVersion = result.SDKVersion,
  719. pixelRatio = result.pixelRatio,
  720. deviceOrientation = result.deviceOrientation;
  721. // const isQuickApp = "mp-weixin".indexOf('quickapp-webview') !== -1
  722. // osName osVersion
  723. var osName = '';
  724. var osVersion = '';
  725. {
  726. osName = system.split(' ')[0] || '';
  727. osVersion = system.split(' ')[1] || '';
  728. }
  729. var hostVersion = version;
  730. // deviceType
  731. var deviceType = getGetDeviceType(result, model);
  732. // deviceModel
  733. var deviceBrand = getDeviceBrand(brand);
  734. // hostName
  735. var _hostName = getHostName(result);
  736. // deviceOrientation
  737. var _deviceOrientation = deviceOrientation; // 仅 微信 百度 支持
  738. // devicePixelRatio
  739. var _devicePixelRatio = pixelRatio;
  740. // SDKVersion
  741. var _SDKVersion = SDKVersion;
  742. // hostLanguage
  743. var hostLanguage = language.replace(/_/g, '-');
  744. // wx.getAccountInfoSync
  745. var parameters = {
  746. appId: "__UNI__2080341",
  747. appName: "益智游戏",
  748. appVersion: "1.1.1",
  749. appVersionCode: "111",
  750. appLanguage: getAppLanguage(hostLanguage),
  751. uniCompileVersion: "3.6.18",
  752. uniRuntimeVersion: "3.6.18",
  753. uniPlatform: undefined || "mp-weixin",
  754. deviceBrand: deviceBrand,
  755. deviceModel: model,
  756. deviceType: deviceType,
  757. devicePixelRatio: _devicePixelRatio,
  758. deviceOrientation: _deviceOrientation,
  759. osName: osName.toLocaleLowerCase(),
  760. osVersion: osVersion,
  761. hostTheme: theme,
  762. hostVersion: hostVersion,
  763. hostLanguage: hostLanguage,
  764. hostName: _hostName,
  765. hostSDKVersion: _SDKVersion,
  766. hostFontSizeSetting: fontSizeSetting,
  767. windowTop: 0,
  768. windowBottom: 0,
  769. // TODO
  770. osLanguage: undefined,
  771. osTheme: undefined,
  772. ua: undefined,
  773. hostPackageName: undefined,
  774. browserName: undefined,
  775. browserVersion: undefined
  776. };
  777. Object.assign(result, parameters);
  778. }
  779. function getGetDeviceType(result, model) {
  780. var deviceType = result.deviceType || 'phone';
  781. {
  782. var deviceTypeMaps = {
  783. ipad: 'pad',
  784. windows: 'pc',
  785. mac: 'pc'
  786. };
  787. var deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
  788. var _model = model.toLocaleLowerCase();
  789. for (var index = 0; index < deviceTypeMapsKeys.length; index++) {
  790. var _m = deviceTypeMapsKeys[index];
  791. if (_model.indexOf(_m) !== -1) {
  792. deviceType = deviceTypeMaps[_m];
  793. break;
  794. }
  795. }
  796. }
  797. return deviceType;
  798. }
  799. function getDeviceBrand(brand) {
  800. var deviceBrand = brand;
  801. if (deviceBrand) {
  802. deviceBrand = brand.toLocaleLowerCase();
  803. }
  804. return deviceBrand;
  805. }
  806. function getAppLanguage(defaultLanguage) {
  807. return getLocale$1 ? getLocale$1() : defaultLanguage;
  808. }
  809. function getHostName(result) {
  810. var _platform = 'WeChat';
  811. var _hostName = result.hostName || _platform; // mp-jd
  812. {
  813. if (result.environment) {
  814. _hostName = result.environment;
  815. } else if (result.host && result.host.env) {
  816. _hostName = result.host.env;
  817. }
  818. }
  819. return _hostName;
  820. }
  821. var getSystemInfo = {
  822. returnValue: function returnValue(result) {
  823. useDeviceId(result);
  824. addSafeAreaInsets(result);
  825. populateParameters(result);
  826. }
  827. };
  828. var showActionSheet = {
  829. args: function args(fromArgs) {
  830. if ((0, _typeof2.default)(fromArgs) === 'object') {
  831. fromArgs.alertText = fromArgs.title;
  832. }
  833. }
  834. };
  835. var getAppBaseInfo = {
  836. returnValue: function returnValue(result) {
  837. var _result = result,
  838. version = _result.version,
  839. language = _result.language,
  840. SDKVersion = _result.SDKVersion,
  841. theme = _result.theme;
  842. var _hostName = getHostName(result);
  843. var hostLanguage = language.replace('_', '-');
  844. result = sortObject(Object.assign(result, {
  845. appId: "__UNI__2080341",
  846. appName: "益智游戏",
  847. appVersion: "1.1.1",
  848. appVersionCode: "111",
  849. appLanguage: getAppLanguage(hostLanguage),
  850. hostVersion: version,
  851. hostLanguage: hostLanguage,
  852. hostName: _hostName,
  853. hostSDKVersion: SDKVersion,
  854. hostTheme: theme
  855. }));
  856. }
  857. };
  858. var getDeviceInfo = {
  859. returnValue: function returnValue(result) {
  860. var _result2 = result,
  861. brand = _result2.brand,
  862. model = _result2.model;
  863. var deviceType = getGetDeviceType(result, model);
  864. var deviceBrand = getDeviceBrand(brand);
  865. useDeviceId(result);
  866. result = sortObject(Object.assign(result, {
  867. deviceType: deviceType,
  868. deviceBrand: deviceBrand,
  869. deviceModel: model
  870. }));
  871. }
  872. };
  873. var getWindowInfo = {
  874. returnValue: function returnValue(result) {
  875. addSafeAreaInsets(result);
  876. result = sortObject(Object.assign(result, {
  877. windowTop: 0,
  878. windowBottom: 0
  879. }));
  880. }
  881. };
  882. var getAppAuthorizeSetting = {
  883. returnValue: function returnValue(result) {
  884. var locationReducedAccuracy = result.locationReducedAccuracy;
  885. result.locationAccuracy = 'unsupported';
  886. if (locationReducedAccuracy === true) {
  887. result.locationAccuracy = 'reduced';
  888. } else if (locationReducedAccuracy === false) {
  889. result.locationAccuracy = 'full';
  890. }
  891. }
  892. };
  893. // import navigateTo from 'uni-helpers/navigate-to'
  894. var protocols = {
  895. redirectTo: redirectTo,
  896. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  897. previewImage: previewImage,
  898. getSystemInfo: getSystemInfo,
  899. getSystemInfoSync: getSystemInfo,
  900. showActionSheet: showActionSheet,
  901. getAppBaseInfo: getAppBaseInfo,
  902. getDeviceInfo: getDeviceInfo,
  903. getWindowInfo: getWindowInfo,
  904. getAppAuthorizeSetting: getAppAuthorizeSetting
  905. };
  906. var todos = ['vibrate', 'preloadPage', 'unPreloadPage', 'loadSubPackage'];
  907. var canIUses = [];
  908. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  909. function processCallback(methodName, method, returnValue) {
  910. return function (res) {
  911. return method(processReturnValue(methodName, res, returnValue));
  912. };
  913. }
  914. function processArgs(methodName, fromArgs) {
  915. var argsOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  916. var returnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  917. var keepFromArgs = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  918. if (isPlainObject(fromArgs)) {
  919. // 一般 api 的参数解析
  920. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  921. if (isFn(argsOption)) {
  922. argsOption = argsOption(fromArgs, toArgs) || {};
  923. }
  924. for (var key in fromArgs) {
  925. if (hasOwn(argsOption, key)) {
  926. var keyOption = argsOption[key];
  927. if (isFn(keyOption)) {
  928. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  929. }
  930. if (!keyOption) {
  931. // 不支持的参数
  932. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  933. } else if (isStr(keyOption)) {
  934. // 重写参数 key
  935. toArgs[keyOption] = fromArgs[key];
  936. } else if (isPlainObject(keyOption)) {
  937. // {name:newName,value:value}可重新指定参数 key:value
  938. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  939. }
  940. } else if (CALLBACKS.indexOf(key) !== -1) {
  941. if (isFn(fromArgs[key])) {
  942. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  943. }
  944. } else {
  945. if (!keepFromArgs) {
  946. toArgs[key] = fromArgs[key];
  947. }
  948. }
  949. }
  950. return toArgs;
  951. } else if (isFn(fromArgs)) {
  952. fromArgs = processCallback(methodName, fromArgs, returnValue);
  953. }
  954. return fromArgs;
  955. }
  956. function processReturnValue(methodName, res, returnValue) {
  957. var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  958. if (isFn(protocols.returnValue)) {
  959. // 处理通用 returnValue
  960. res = protocols.returnValue(methodName, res);
  961. }
  962. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  963. }
  964. function wrapper(methodName, method) {
  965. if (hasOwn(protocols, methodName)) {
  966. var protocol = protocols[methodName];
  967. if (!protocol) {
  968. // 暂不支持的 api
  969. return function () {
  970. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  971. };
  972. }
  973. return function (arg1, arg2) {
  974. // 目前 api 最多两个参数
  975. var options = protocol;
  976. if (isFn(protocol)) {
  977. options = protocol(arg1);
  978. }
  979. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  980. var args = [arg1];
  981. if (typeof arg2 !== 'undefined') {
  982. args.push(arg2);
  983. }
  984. if (isFn(options.name)) {
  985. methodName = options.name(arg1);
  986. } else if (isStr(options.name)) {
  987. methodName = options.name;
  988. }
  989. var returnValue = wx[methodName].apply(wx, args);
  990. if (isSyncApi(methodName)) {
  991. // 同步 api
  992. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  993. }
  994. return returnValue;
  995. };
  996. }
  997. return method;
  998. }
  999. var todoApis = Object.create(null);
  1000. var TODOS = ['onTabBarMidButtonTap', 'subscribePush', 'unsubscribePush', 'onPush', 'offPush', 'share'];
  1001. function createTodoApi(name) {
  1002. return function todoApi(_ref) {
  1003. var fail = _ref.fail,
  1004. complete = _ref.complete;
  1005. var res = {
  1006. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported")
  1007. };
  1008. isFn(fail) && fail(res);
  1009. isFn(complete) && complete(res);
  1010. };
  1011. }
  1012. TODOS.forEach(function (name) {
  1013. todoApis[name] = createTodoApi(name);
  1014. });
  1015. var providers = {
  1016. oauth: ['weixin'],
  1017. share: ['weixin'],
  1018. payment: ['wxpay'],
  1019. push: ['weixin']
  1020. };
  1021. function getProvider(_ref2) {
  1022. var service = _ref2.service,
  1023. success = _ref2.success,
  1024. fail = _ref2.fail,
  1025. complete = _ref2.complete;
  1026. var res = false;
  1027. if (providers[service]) {
  1028. res = {
  1029. errMsg: 'getProvider:ok',
  1030. service: service,
  1031. provider: providers[service]
  1032. };
  1033. isFn(success) && success(res);
  1034. } else {
  1035. res = {
  1036. errMsg: 'getProvider:fail service not found'
  1037. };
  1038. isFn(fail) && fail(res);
  1039. }
  1040. isFn(complete) && complete(res);
  1041. }
  1042. var extraApi = /*#__PURE__*/Object.freeze({
  1043. __proto__: null,
  1044. getProvider: getProvider
  1045. });
  1046. var getEmitter = function () {
  1047. var Emitter;
  1048. return function getUniEmitter() {
  1049. if (!Emitter) {
  1050. Emitter = new _vue.default();
  1051. }
  1052. return Emitter;
  1053. };
  1054. }();
  1055. function apply(ctx, method, args) {
  1056. return ctx[method].apply(ctx, args);
  1057. }
  1058. function $on() {
  1059. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  1060. }
  1061. function $off() {
  1062. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  1063. }
  1064. function $once() {
  1065. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  1066. }
  1067. function $emit() {
  1068. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  1069. }
  1070. var eventApi = /*#__PURE__*/Object.freeze({
  1071. __proto__: null,
  1072. $on: $on,
  1073. $off: $off,
  1074. $once: $once,
  1075. $emit: $emit
  1076. });
  1077. /**
  1078. * 框架内 try-catch
  1079. */
  1080. /**
  1081. * 开发者 try-catch
  1082. */
  1083. function tryCatch(fn) {
  1084. return function () {
  1085. try {
  1086. return fn.apply(fn, arguments);
  1087. } catch (e) {
  1088. // TODO
  1089. console.error(e);
  1090. }
  1091. };
  1092. }
  1093. function getApiCallbacks(params) {
  1094. var apiCallbacks = {};
  1095. for (var name in params) {
  1096. var param = params[name];
  1097. if (isFn(param)) {
  1098. apiCallbacks[name] = tryCatch(param);
  1099. delete params[name];
  1100. }
  1101. }
  1102. return apiCallbacks;
  1103. }
  1104. var cid;
  1105. var cidErrMsg;
  1106. var enabled;
  1107. function normalizePushMessage(message) {
  1108. try {
  1109. return JSON.parse(message);
  1110. } catch (e) {}
  1111. return message;
  1112. }
  1113. function invokePushCallback(args) {
  1114. if (args.type === 'enabled') {
  1115. enabled = true;
  1116. } else if (args.type === 'clientId') {
  1117. cid = args.cid;
  1118. cidErrMsg = args.errMsg;
  1119. invokeGetPushCidCallbacks(cid, args.errMsg);
  1120. } else if (args.type === 'pushMsg') {
  1121. var message = {
  1122. type: 'receive',
  1123. data: normalizePushMessage(args.message)
  1124. };
  1125. for (var i = 0; i < onPushMessageCallbacks.length; i++) {
  1126. var callback = onPushMessageCallbacks[i];
  1127. callback(message);
  1128. // 该消息已被阻止
  1129. if (message.stopped) {
  1130. break;
  1131. }
  1132. }
  1133. } else if (args.type === 'click') {
  1134. onPushMessageCallbacks.forEach(function (callback) {
  1135. callback({
  1136. type: 'click',
  1137. data: normalizePushMessage(args.message)
  1138. });
  1139. });
  1140. }
  1141. }
  1142. var getPushCidCallbacks = [];
  1143. function invokeGetPushCidCallbacks(cid, errMsg) {
  1144. getPushCidCallbacks.forEach(function (callback) {
  1145. callback(cid, errMsg);
  1146. });
  1147. getPushCidCallbacks.length = 0;
  1148. }
  1149. function getPushClientId(args) {
  1150. if (!isPlainObject(args)) {
  1151. args = {};
  1152. }
  1153. var _getApiCallbacks = getApiCallbacks(args),
  1154. success = _getApiCallbacks.success,
  1155. fail = _getApiCallbacks.fail,
  1156. complete = _getApiCallbacks.complete;
  1157. var hasSuccess = isFn(success);
  1158. var hasFail = isFn(fail);
  1159. var hasComplete = isFn(complete);
  1160. Promise.resolve().then(function () {
  1161. if (typeof enabled === 'undefined') {
  1162. enabled = false;
  1163. cid = '';
  1164. cidErrMsg = 'uniPush is not enabled';
  1165. }
  1166. getPushCidCallbacks.push(function (cid, errMsg) {
  1167. var res;
  1168. if (cid) {
  1169. res = {
  1170. errMsg: 'getPushClientId:ok',
  1171. cid: cid
  1172. };
  1173. hasSuccess && success(res);
  1174. } else {
  1175. res = {
  1176. errMsg: 'getPushClientId:fail' + (errMsg ? ' ' + errMsg : '')
  1177. };
  1178. hasFail && fail(res);
  1179. }
  1180. hasComplete && complete(res);
  1181. });
  1182. if (typeof cid !== 'undefined') {
  1183. invokeGetPushCidCallbacks(cid, cidErrMsg);
  1184. }
  1185. });
  1186. }
  1187. var onPushMessageCallbacks = [];
  1188. // 不使用 defineOnApi 实现,是因为 defineOnApi 依赖 UniServiceJSBridge ,该对象目前在小程序上未提供,故简单实现
  1189. var onPushMessage = function onPushMessage(fn) {
  1190. if (onPushMessageCallbacks.indexOf(fn) === -1) {
  1191. onPushMessageCallbacks.push(fn);
  1192. }
  1193. };
  1194. var offPushMessage = function offPushMessage(fn) {
  1195. if (!fn) {
  1196. onPushMessageCallbacks.length = 0;
  1197. } else {
  1198. var index = onPushMessageCallbacks.indexOf(fn);
  1199. if (index > -1) {
  1200. onPushMessageCallbacks.splice(index, 1);
  1201. }
  1202. }
  1203. };
  1204. var baseInfo = wx.getAppBaseInfo && wx.getAppBaseInfo();
  1205. if (!baseInfo) {
  1206. baseInfo = wx.getSystemInfoSync();
  1207. }
  1208. var host = baseInfo ? baseInfo.host : null;
  1209. var shareVideoMessage = host && host.env === 'SAAASDK' ? wx.miniapp.shareVideoMessage : wx.shareVideoMessage;
  1210. var api = /*#__PURE__*/Object.freeze({
  1211. __proto__: null,
  1212. shareVideoMessage: shareVideoMessage,
  1213. getPushClientId: getPushClientId,
  1214. onPushMessage: onPushMessage,
  1215. offPushMessage: offPushMessage,
  1216. invokePushCallback: invokePushCallback
  1217. });
  1218. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1219. function findVmByVueId(vm, vuePid) {
  1220. var $children = vm.$children;
  1221. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1222. for (var i = $children.length - 1; i >= 0; i--) {
  1223. var childVm = $children[i];
  1224. if (childVm.$scope._$vueId === vuePid) {
  1225. return childVm;
  1226. }
  1227. }
  1228. // 反向递归查找
  1229. var parentVm;
  1230. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1231. parentVm = findVmByVueId($children[_i], vuePid);
  1232. if (parentVm) {
  1233. return parentVm;
  1234. }
  1235. }
  1236. }
  1237. function initBehavior(options) {
  1238. return Behavior(options);
  1239. }
  1240. function isPage() {
  1241. return !!this.route;
  1242. }
  1243. function initRelation(detail) {
  1244. this.triggerEvent('__l', detail);
  1245. }
  1246. function selectAllComponents(mpInstance, selector, $refs) {
  1247. var components = mpInstance.selectAllComponents(selector) || [];
  1248. components.forEach(function (component) {
  1249. var ref = component.dataset.ref;
  1250. $refs[ref] = component.$vm || toSkip(component);
  1251. {
  1252. if (component.dataset.vueGeneric === 'scoped') {
  1253. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  1254. selectAllComponents(scopedComponent, selector, $refs);
  1255. });
  1256. }
  1257. }
  1258. });
  1259. }
  1260. function syncRefs(refs, newRefs) {
  1261. var oldKeys = (0, _construct2.default)(Set, (0, _toConsumableArray2.default)(Object.keys(refs)));
  1262. var newKeys = Object.keys(newRefs);
  1263. newKeys.forEach(function (key) {
  1264. var oldValue = refs[key];
  1265. var newValue = newRefs[key];
  1266. if (Array.isArray(oldValue) && Array.isArray(newValue) && oldValue.length === newValue.length && newValue.every(function (value) {
  1267. return oldValue.includes(value);
  1268. })) {
  1269. return;
  1270. }
  1271. refs[key] = newValue;
  1272. oldKeys.delete(key);
  1273. });
  1274. oldKeys.forEach(function (key) {
  1275. delete refs[key];
  1276. });
  1277. return refs;
  1278. }
  1279. function initRefs(vm) {
  1280. var mpInstance = vm.$scope;
  1281. var refs = {};
  1282. Object.defineProperty(vm, '$refs', {
  1283. get: function get() {
  1284. var $refs = {};
  1285. selectAllComponents(mpInstance, '.vue-ref', $refs);
  1286. // TODO 暂不考虑 for 中的 scoped
  1287. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for') || [];
  1288. forComponents.forEach(function (component) {
  1289. var ref = component.dataset.ref;
  1290. if (!$refs[ref]) {
  1291. $refs[ref] = [];
  1292. }
  1293. $refs[ref].push(component.$vm || toSkip(component));
  1294. });
  1295. return syncRefs(refs, $refs);
  1296. }
  1297. });
  1298. }
  1299. function handleLink(event) {
  1300. var _ref3 = event.detail || event.value,
  1301. vuePid = _ref3.vuePid,
  1302. vueOptions = _ref3.vueOptions; // detail 是微信,value 是百度(dipatch)
  1303. var parentVm;
  1304. if (vuePid) {
  1305. parentVm = findVmByVueId(this.$vm, vuePid);
  1306. }
  1307. if (!parentVm) {
  1308. parentVm = this.$vm;
  1309. }
  1310. vueOptions.parent = parentVm;
  1311. }
  1312. function markMPComponent(component) {
  1313. // 在 Vue 中标记为小程序组件
  1314. var IS_MP = '__v_isMPComponent';
  1315. Object.defineProperty(component, IS_MP, {
  1316. configurable: true,
  1317. enumerable: false,
  1318. value: true
  1319. });
  1320. return component;
  1321. }
  1322. function toSkip(obj) {
  1323. var OB = '__ob__';
  1324. var SKIP = '__v_skip';
  1325. if (isObject(obj) && Object.isExtensible(obj)) {
  1326. // 避免被 @vue/composition-api 观测
  1327. Object.defineProperty(obj, OB, {
  1328. configurable: true,
  1329. enumerable: false,
  1330. value: (0, _defineProperty2.default)({}, SKIP, true)
  1331. });
  1332. }
  1333. return obj;
  1334. }
  1335. var MPPage = Page;
  1336. var MPComponent = Component;
  1337. var customizeRE = /:/g;
  1338. var customize = cached(function (str) {
  1339. return camelize(str.replace(customizeRE, '-'));
  1340. });
  1341. function initTriggerEvent(mpInstance) {
  1342. var oldTriggerEvent = mpInstance.triggerEvent;
  1343. var newTriggerEvent = function newTriggerEvent(event) {
  1344. for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
  1345. args[_key3 - 1] = arguments[_key3];
  1346. }
  1347. // 事件名统一转驼峰格式,仅处理:当前组件为 vue 组件、当前组件为 vue 组件子组件
  1348. if (this.$vm || this.dataset && this.dataset.comType) {
  1349. event = customize(event);
  1350. } else {
  1351. // 针对微信/QQ小程序单独补充驼峰格式事件,以兼容历史项目
  1352. var newEvent = customize(event);
  1353. if (newEvent !== event) {
  1354. oldTriggerEvent.apply(this, [newEvent].concat(args));
  1355. }
  1356. }
  1357. return oldTriggerEvent.apply(this, [event].concat(args));
  1358. };
  1359. try {
  1360. // 京东小程序 triggerEvent 为只读
  1361. mpInstance.triggerEvent = newTriggerEvent;
  1362. } catch (error) {
  1363. mpInstance._triggerEvent = newTriggerEvent;
  1364. }
  1365. }
  1366. function initHook(name, options, isComponent) {
  1367. var oldHook = options[name];
  1368. options[name] = function () {
  1369. markMPComponent(this);
  1370. initTriggerEvent(this);
  1371. if (oldHook) {
  1372. for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  1373. args[_key4] = arguments[_key4];
  1374. }
  1375. return oldHook.apply(this, args);
  1376. }
  1377. };
  1378. }
  1379. if (!MPPage.__$wrappered) {
  1380. MPPage.__$wrappered = true;
  1381. Page = function Page() {
  1382. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1383. initHook('onLoad', options);
  1384. return MPPage(options);
  1385. };
  1386. Page.after = MPPage.after;
  1387. Component = function Component() {
  1388. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1389. initHook('created', options);
  1390. return MPComponent(options);
  1391. };
  1392. }
  1393. var PAGE_EVENT_HOOKS = ['onPullDownRefresh', 'onReachBottom', 'onAddToFavorites', 'onShareTimeline', 'onShareAppMessage', 'onPageScroll', 'onResize', 'onTabItemTap'];
  1394. function initMocks(vm, mocks) {
  1395. var mpInstance = vm.$mp[vm.mpType];
  1396. mocks.forEach(function (mock) {
  1397. if (hasOwn(mpInstance, mock)) {
  1398. vm[mock] = mpInstance[mock];
  1399. }
  1400. });
  1401. }
  1402. function hasHook(hook, vueOptions) {
  1403. if (!vueOptions) {
  1404. return true;
  1405. }
  1406. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  1407. return true;
  1408. }
  1409. vueOptions = vueOptions.default || vueOptions;
  1410. if (isFn(vueOptions)) {
  1411. if (isFn(vueOptions.extendOptions[hook])) {
  1412. return true;
  1413. }
  1414. if (vueOptions.super && vueOptions.super.options && Array.isArray(vueOptions.super.options[hook])) {
  1415. return true;
  1416. }
  1417. return false;
  1418. }
  1419. if (isFn(vueOptions[hook]) || Array.isArray(vueOptions[hook])) {
  1420. return true;
  1421. }
  1422. var mixins = vueOptions.mixins;
  1423. if (Array.isArray(mixins)) {
  1424. return !!mixins.find(function (mixin) {
  1425. return hasHook(hook, mixin);
  1426. });
  1427. }
  1428. }
  1429. function initHooks(mpOptions, hooks, vueOptions) {
  1430. hooks.forEach(function (hook) {
  1431. if (hasHook(hook, vueOptions)) {
  1432. mpOptions[hook] = function (args) {
  1433. return this.$vm && this.$vm.__call_hook(hook, args);
  1434. };
  1435. }
  1436. });
  1437. }
  1438. function initUnknownHooks(mpOptions, vueOptions) {
  1439. var excludes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  1440. findHooks(vueOptions).forEach(function (hook) {
  1441. return initHook$1(mpOptions, hook, excludes);
  1442. });
  1443. }
  1444. function findHooks(vueOptions) {
  1445. var hooks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  1446. if (vueOptions) {
  1447. Object.keys(vueOptions).forEach(function (name) {
  1448. if (name.indexOf('on') === 0 && isFn(vueOptions[name])) {
  1449. hooks.push(name);
  1450. }
  1451. });
  1452. }
  1453. return hooks;
  1454. }
  1455. function initHook$1(mpOptions, hook, excludes) {
  1456. if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
  1457. mpOptions[hook] = function (args) {
  1458. return this.$vm && this.$vm.__call_hook(hook, args);
  1459. };
  1460. }
  1461. }
  1462. function initVueComponent(Vue, vueOptions) {
  1463. vueOptions = vueOptions.default || vueOptions;
  1464. var VueComponent;
  1465. if (isFn(vueOptions)) {
  1466. VueComponent = vueOptions;
  1467. } else {
  1468. VueComponent = Vue.extend(vueOptions);
  1469. }
  1470. vueOptions = VueComponent.options;
  1471. return [VueComponent, vueOptions];
  1472. }
  1473. function initSlots(vm, vueSlots) {
  1474. if (Array.isArray(vueSlots) && vueSlots.length) {
  1475. var $slots = Object.create(null);
  1476. vueSlots.forEach(function (slotName) {
  1477. $slots[slotName] = true;
  1478. });
  1479. vm.$scopedSlots = vm.$slots = $slots;
  1480. }
  1481. }
  1482. function initVueIds(vueIds, mpInstance) {
  1483. vueIds = (vueIds || '').split(',');
  1484. var len = vueIds.length;
  1485. if (len === 1) {
  1486. mpInstance._$vueId = vueIds[0];
  1487. } else if (len === 2) {
  1488. mpInstance._$vueId = vueIds[0];
  1489. mpInstance._$vuePid = vueIds[1];
  1490. }
  1491. }
  1492. function initData(vueOptions, context) {
  1493. var data = vueOptions.data || {};
  1494. var methods = vueOptions.methods || {};
  1495. if (typeof data === 'function') {
  1496. try {
  1497. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  1498. } catch (e) {
  1499. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"益智游戏","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  1500. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  1501. }
  1502. }
  1503. } else {
  1504. try {
  1505. // 对 data 格式化
  1506. data = JSON.parse(JSON.stringify(data));
  1507. } catch (e) {}
  1508. }
  1509. if (!isPlainObject(data)) {
  1510. data = {};
  1511. }
  1512. Object.keys(methods).forEach(function (methodName) {
  1513. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  1514. data[methodName] = methods[methodName];
  1515. }
  1516. });
  1517. return data;
  1518. }
  1519. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  1520. function createObserver(name) {
  1521. return function observer(newVal, oldVal) {
  1522. if (this.$vm) {
  1523. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  1524. }
  1525. };
  1526. }
  1527. function initBehaviors(vueOptions, initBehavior) {
  1528. var vueBehaviors = vueOptions.behaviors;
  1529. var vueExtends = vueOptions.extends;
  1530. var vueMixins = vueOptions.mixins;
  1531. var vueProps = vueOptions.props;
  1532. if (!vueProps) {
  1533. vueOptions.props = vueProps = [];
  1534. }
  1535. var behaviors = [];
  1536. if (Array.isArray(vueBehaviors)) {
  1537. vueBehaviors.forEach(function (behavior) {
  1538. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  1539. if (behavior === 'uni://form-field') {
  1540. if (Array.isArray(vueProps)) {
  1541. vueProps.push('name');
  1542. vueProps.push('value');
  1543. } else {
  1544. vueProps.name = {
  1545. type: String,
  1546. default: ''
  1547. };
  1548. vueProps.value = {
  1549. type: [String, Number, Boolean, Array, Object, Date],
  1550. default: ''
  1551. };
  1552. }
  1553. }
  1554. });
  1555. }
  1556. if (isPlainObject(vueExtends) && vueExtends.props) {
  1557. behaviors.push(initBehavior({
  1558. properties: initProperties(vueExtends.props, true)
  1559. }));
  1560. }
  1561. if (Array.isArray(vueMixins)) {
  1562. vueMixins.forEach(function (vueMixin) {
  1563. if (isPlainObject(vueMixin) && vueMixin.props) {
  1564. behaviors.push(initBehavior({
  1565. properties: initProperties(vueMixin.props, true)
  1566. }));
  1567. }
  1568. });
  1569. }
  1570. return behaviors;
  1571. }
  1572. function parsePropType(key, type, defaultValue, file) {
  1573. // [String]=>String
  1574. if (Array.isArray(type) && type.length === 1) {
  1575. return type[0];
  1576. }
  1577. return type;
  1578. }
  1579. function initProperties(props) {
  1580. var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  1581. var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  1582. var options = arguments.length > 3 ? arguments[3] : undefined;
  1583. var properties = {};
  1584. if (!isBehavior) {
  1585. properties.vueId = {
  1586. type: String,
  1587. value: ''
  1588. };
  1589. {
  1590. if (options.virtualHost) {
  1591. properties.virtualHostStyle = {
  1592. type: null,
  1593. value: ''
  1594. };
  1595. properties.virtualHostClass = {
  1596. type: null,
  1597. value: ''
  1598. };
  1599. }
  1600. }
  1601. // scopedSlotsCompiler auto
  1602. properties.scopedSlotsCompiler = {
  1603. type: String,
  1604. value: ''
  1605. };
  1606. properties.vueSlots = {
  1607. // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  1608. type: null,
  1609. value: [],
  1610. observer: function observer(newVal, oldVal) {
  1611. var $slots = Object.create(null);
  1612. newVal.forEach(function (slotName) {
  1613. $slots[slotName] = true;
  1614. });
  1615. this.setData({
  1616. $slots: $slots
  1617. });
  1618. }
  1619. };
  1620. }
  1621. if (Array.isArray(props)) {
  1622. // ['title']
  1623. props.forEach(function (key) {
  1624. properties[key] = {
  1625. type: null,
  1626. observer: createObserver(key)
  1627. };
  1628. });
  1629. } else if (isPlainObject(props)) {
  1630. // {title:{type:String,default:''},content:String}
  1631. Object.keys(props).forEach(function (key) {
  1632. var opts = props[key];
  1633. if (isPlainObject(opts)) {
  1634. // title:{type:String,default:''}
  1635. var value = opts.default;
  1636. if (isFn(value)) {
  1637. value = value();
  1638. }
  1639. opts.type = parsePropType(key, opts.type);
  1640. properties[key] = {
  1641. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  1642. value: value,
  1643. observer: createObserver(key)
  1644. };
  1645. } else {
  1646. // content:String
  1647. var type = parsePropType(key, opts);
  1648. properties[key] = {
  1649. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  1650. observer: createObserver(key)
  1651. };
  1652. }
  1653. });
  1654. }
  1655. return properties;
  1656. }
  1657. function wrapper$1(event) {
  1658. // TODO 又得兼容 mpvue 的 mp 对象
  1659. try {
  1660. event.mp = JSON.parse(JSON.stringify(event));
  1661. } catch (e) {}
  1662. event.stopPropagation = noop;
  1663. event.preventDefault = noop;
  1664. event.target = event.target || {};
  1665. if (!hasOwn(event, 'detail')) {
  1666. event.detail = {};
  1667. }
  1668. if (hasOwn(event, 'markerId')) {
  1669. event.detail = (0, _typeof2.default)(event.detail) === 'object' ? event.detail : {};
  1670. event.detail.markerId = event.markerId;
  1671. }
  1672. if (isPlainObject(event.detail)) {
  1673. event.target = Object.assign({}, event.target, event.detail);
  1674. }
  1675. return event;
  1676. }
  1677. function getExtraValue(vm, dataPathsArray) {
  1678. var context = vm;
  1679. dataPathsArray.forEach(function (dataPathArray) {
  1680. var dataPath = dataPathArray[0];
  1681. var value = dataPathArray[2];
  1682. if (dataPath || typeof value !== 'undefined') {
  1683. // ['','',index,'disable']
  1684. var propPath = dataPathArray[1];
  1685. var valuePath = dataPathArray[3];
  1686. var vFor;
  1687. if (Number.isInteger(dataPath)) {
  1688. vFor = dataPath;
  1689. } else if (!dataPath) {
  1690. vFor = context;
  1691. } else if (typeof dataPath === 'string' && dataPath) {
  1692. if (dataPath.indexOf('#s#') === 0) {
  1693. vFor = dataPath.substr(3);
  1694. } else {
  1695. vFor = vm.__get_value(dataPath, context);
  1696. }
  1697. }
  1698. if (Number.isInteger(vFor)) {
  1699. context = value;
  1700. } else if (!propPath) {
  1701. context = vFor[value];
  1702. } else {
  1703. if (Array.isArray(vFor)) {
  1704. context = vFor.find(function (vForItem) {
  1705. return vm.__get_value(propPath, vForItem) === value;
  1706. });
  1707. } else if (isPlainObject(vFor)) {
  1708. context = Object.keys(vFor).find(function (vForKey) {
  1709. return vm.__get_value(propPath, vFor[vForKey]) === value;
  1710. });
  1711. } else {
  1712. console.error('v-for 暂不支持循环数据:', vFor);
  1713. }
  1714. }
  1715. if (valuePath) {
  1716. context = vm.__get_value(valuePath, context);
  1717. }
  1718. }
  1719. });
  1720. return context;
  1721. }
  1722. function processEventExtra(vm, extra, event, __args__) {
  1723. var extraObj = {};
  1724. if (Array.isArray(extra) && extra.length) {
  1725. /**
  1726. *[
  1727. * ['data.items', 'data.id', item.data.id],
  1728. * ['metas', 'id', meta.id]
  1729. *],
  1730. *[
  1731. * ['data.items', 'data.id', item.data.id],
  1732. * ['metas', 'id', meta.id]
  1733. *],
  1734. *'test'
  1735. */
  1736. extra.forEach(function (dataPath, index) {
  1737. if (typeof dataPath === 'string') {
  1738. if (!dataPath) {
  1739. // model,prop.sync
  1740. extraObj['$' + index] = vm;
  1741. } else {
  1742. if (dataPath === '$event') {
  1743. // $event
  1744. extraObj['$' + index] = event;
  1745. } else if (dataPath === 'arguments') {
  1746. extraObj['$' + index] = event.detail ? event.detail.__args__ || __args__ : __args__;
  1747. } else if (dataPath.indexOf('$event.') === 0) {
  1748. // $event.target.value
  1749. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  1750. } else {
  1751. extraObj['$' + index] = vm.__get_value(dataPath);
  1752. }
  1753. }
  1754. } else {
  1755. extraObj['$' + index] = getExtraValue(vm, dataPath);
  1756. }
  1757. });
  1758. }
  1759. return extraObj;
  1760. }
  1761. function getObjByArray(arr) {
  1762. var obj = {};
  1763. for (var i = 1; i < arr.length; i++) {
  1764. var element = arr[i];
  1765. obj[element[0]] = element[1];
  1766. }
  1767. return obj;
  1768. }
  1769. function processEventArgs(vm, event) {
  1770. var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  1771. var extra = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
  1772. var isCustom = arguments.length > 4 ? arguments[4] : undefined;
  1773. var methodName = arguments.length > 5 ? arguments[5] : undefined;
  1774. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  1775. // fixed 用户直接触发 mpInstance.triggerEvent
  1776. var __args__ = isPlainObject(event.detail) ? event.detail.__args__ || [event.detail] : [event.detail];
  1777. if (isCustom) {
  1778. // 自定义事件
  1779. isCustomMPEvent = event.currentTarget && event.currentTarget.dataset && event.currentTarget.dataset.comType === 'wx';
  1780. if (!args.length) {
  1781. // 无参数,直接传入 event 或 detail 数组
  1782. if (isCustomMPEvent) {
  1783. return [event];
  1784. }
  1785. return __args__;
  1786. }
  1787. }
  1788. var extraObj = processEventExtra(vm, extra, event, __args__);
  1789. var ret = [];
  1790. args.forEach(function (arg) {
  1791. if (arg === '$event') {
  1792. if (methodName === '__set_model' && !isCustom) {
  1793. // input v-model value
  1794. ret.push(event.target.value);
  1795. } else {
  1796. if (isCustom && !isCustomMPEvent) {
  1797. ret.push(__args__[0]);
  1798. } else {
  1799. // wxcomponent 组件或内置组件
  1800. ret.push(event);
  1801. }
  1802. }
  1803. } else {
  1804. if (Array.isArray(arg) && arg[0] === 'o') {
  1805. ret.push(getObjByArray(arg));
  1806. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  1807. ret.push(extraObj[arg]);
  1808. } else {
  1809. ret.push(arg);
  1810. }
  1811. }
  1812. });
  1813. return ret;
  1814. }
  1815. var ONCE = '~';
  1816. var CUSTOM = '^';
  1817. function isMatchEventType(eventType, optType) {
  1818. return eventType === optType || optType === 'regionchange' && (eventType === 'begin' || eventType === 'end');
  1819. }
  1820. function getContextVm(vm) {
  1821. var $parent = vm.$parent;
  1822. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  1823. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  1824. $parent = $parent.$parent;
  1825. }
  1826. return $parent && $parent.$parent;
  1827. }
  1828. function handleEvent(event) {
  1829. var _this2 = this;
  1830. event = wrapper$1(event);
  1831. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  1832. var dataset = (event.currentTarget || event.target).dataset;
  1833. if (!dataset) {
  1834. return console.warn('事件信息不存在');
  1835. }
  1836. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  1837. if (!eventOpts) {
  1838. return console.warn('事件信息不存在');
  1839. }
  1840. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  1841. var eventType = event.type;
  1842. var ret = [];
  1843. eventOpts.forEach(function (eventOpt) {
  1844. var type = eventOpt[0];
  1845. var eventsArray = eventOpt[1];
  1846. var isCustom = type.charAt(0) === CUSTOM;
  1847. type = isCustom ? type.slice(1) : type;
  1848. var isOnce = type.charAt(0) === ONCE;
  1849. type = isOnce ? type.slice(1) : type;
  1850. if (eventsArray && isMatchEventType(eventType, type)) {
  1851. eventsArray.forEach(function (eventArray) {
  1852. var methodName = eventArray[0];
  1853. if (methodName) {
  1854. var handlerCtx = _this2.$vm;
  1855. if (handlerCtx.$options.generic) {
  1856. // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  1857. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  1858. }
  1859. if (methodName === '$emit') {
  1860. handlerCtx.$emit.apply(handlerCtx, processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName));
  1861. return;
  1862. }
  1863. var handler = handlerCtx[methodName];
  1864. if (!isFn(handler)) {
  1865. var _type = _this2.$vm.mpType === 'page' ? 'Page' : 'Component';
  1866. var path = _this2.route || _this2.is;
  1867. throw new Error("".concat(_type, " \"").concat(path, "\" does not have a method \"").concat(methodName, "\""));
  1868. }
  1869. if (isOnce) {
  1870. if (handler.once) {
  1871. return;
  1872. }
  1873. handler.once = true;
  1874. }
  1875. var params = processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName);
  1876. params = Array.isArray(params) ? params : [];
  1877. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  1878. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  1879. // eslint-disable-next-line no-sparse-arrays
  1880. params = params.concat([,,,,,,,,,, event]);
  1881. }
  1882. ret.push(handler.apply(handlerCtx, params));
  1883. }
  1884. });
  1885. }
  1886. });
  1887. if (eventType === 'input' && ret.length === 1 && typeof ret[0] !== 'undefined') {
  1888. return ret[0];
  1889. }
  1890. }
  1891. var eventChannels = {};
  1892. var eventChannelStack = [];
  1893. function getEventChannel(id) {
  1894. if (id) {
  1895. var eventChannel = eventChannels[id];
  1896. delete eventChannels[id];
  1897. return eventChannel;
  1898. }
  1899. return eventChannelStack.shift();
  1900. }
  1901. var hooks = ['onShow', 'onHide', 'onError', 'onPageNotFound', 'onThemeChange', 'onUnhandledRejection'];
  1902. function initEventChannel() {
  1903. _vue.default.prototype.getOpenerEventChannel = function () {
  1904. // 微信小程序使用自身getOpenerEventChannel
  1905. {
  1906. return this.$scope.getOpenerEventChannel();
  1907. }
  1908. };
  1909. var callHook = _vue.default.prototype.__call_hook;
  1910. _vue.default.prototype.__call_hook = function (hook, args) {
  1911. if (hook === 'onLoad' && args && args.__id__) {
  1912. this.__eventChannel__ = getEventChannel(args.__id__);
  1913. delete args.__id__;
  1914. }
  1915. return callHook.call(this, hook, args);
  1916. };
  1917. }
  1918. function initScopedSlotsParams() {
  1919. var center = {};
  1920. var parents = {};
  1921. _vue.default.prototype.$hasScopedSlotsParams = function (vueId) {
  1922. var has = center[vueId];
  1923. if (!has) {
  1924. parents[vueId] = this;
  1925. this.$on('hook:destroyed', function () {
  1926. delete parents[vueId];
  1927. });
  1928. }
  1929. return has;
  1930. };
  1931. _vue.default.prototype.$getScopedSlotsParams = function (vueId, name, key) {
  1932. var data = center[vueId];
  1933. if (data) {
  1934. var object = data[name] || {};
  1935. return key ? object[key] : object;
  1936. } else {
  1937. parents[vueId] = this;
  1938. this.$on('hook:destroyed', function () {
  1939. delete parents[vueId];
  1940. });
  1941. }
  1942. };
  1943. _vue.default.prototype.$setScopedSlotsParams = function (name, value) {
  1944. var vueIds = this.$options.propsData.vueId;
  1945. if (vueIds) {
  1946. var vueId = vueIds.split(',')[0];
  1947. var object = center[vueId] = center[vueId] || {};
  1948. object[name] = value;
  1949. if (parents[vueId]) {
  1950. parents[vueId].$forceUpdate();
  1951. }
  1952. }
  1953. };
  1954. _vue.default.mixin({
  1955. destroyed: function destroyed() {
  1956. var propsData = this.$options.propsData;
  1957. var vueId = propsData && propsData.vueId;
  1958. if (vueId) {
  1959. delete center[vueId];
  1960. delete parents[vueId];
  1961. }
  1962. }
  1963. });
  1964. }
  1965. function parseBaseApp(vm, _ref4) {
  1966. var mocks = _ref4.mocks,
  1967. initRefs = _ref4.initRefs;
  1968. initEventChannel();
  1969. {
  1970. initScopedSlotsParams();
  1971. }
  1972. if (vm.$options.store) {
  1973. _vue.default.prototype.$store = vm.$options.store;
  1974. }
  1975. uniIdMixin(_vue.default);
  1976. _vue.default.prototype.mpHost = "mp-weixin";
  1977. _vue.default.mixin({
  1978. beforeCreate: function beforeCreate() {
  1979. if (!this.$options.mpType) {
  1980. return;
  1981. }
  1982. this.mpType = this.$options.mpType;
  1983. this.$mp = (0, _defineProperty2.default)({
  1984. data: {}
  1985. }, this.mpType, this.$options.mpInstance);
  1986. this.$scope = this.$options.mpInstance;
  1987. delete this.$options.mpType;
  1988. delete this.$options.mpInstance;
  1989. if (this.mpType === 'page' && typeof getApp === 'function') {
  1990. // hack vue-i18n
  1991. var app = getApp();
  1992. if (app.$vm && app.$vm.$i18n) {
  1993. this._i18n = app.$vm.$i18n;
  1994. }
  1995. }
  1996. if (this.mpType !== 'app') {
  1997. initRefs(this);
  1998. initMocks(this, mocks);
  1999. }
  2000. }
  2001. });
  2002. var appOptions = {
  2003. onLaunch: function onLaunch(args) {
  2004. if (this.$vm) {
  2005. // 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  2006. return;
  2007. }
  2008. {
  2009. if (wx.canIUse && !wx.canIUse('nextTick')) {
  2010. // 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  2011. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  2012. }
  2013. }
  2014. this.$vm = vm;
  2015. this.$vm.$mp = {
  2016. app: this
  2017. };
  2018. this.$vm.$scope = this;
  2019. // vm 上也挂载 globalData
  2020. this.$vm.globalData = this.globalData;
  2021. this.$vm._isMounted = true;
  2022. this.$vm.__call_hook('mounted', args);
  2023. this.$vm.__call_hook('onLaunch', args);
  2024. }
  2025. };
  2026. // 兼容旧版本 globalData
  2027. appOptions.globalData = vm.$options.globalData || {};
  2028. // 将 methods 中的方法挂在 getApp() 中
  2029. var methods = vm.$options.methods;
  2030. if (methods) {
  2031. Object.keys(methods).forEach(function (name) {
  2032. appOptions[name] = methods[name];
  2033. });
  2034. }
  2035. initAppLocale(_vue.default, vm, normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN);
  2036. initHooks(appOptions, hooks);
  2037. initUnknownHooks(appOptions, vm.$options);
  2038. return appOptions;
  2039. }
  2040. function parseApp(vm) {
  2041. return parseBaseApp(vm, {
  2042. mocks: mocks,
  2043. initRefs: initRefs
  2044. });
  2045. }
  2046. function createApp(vm) {
  2047. App(parseApp(vm));
  2048. return vm;
  2049. }
  2050. var encodeReserveRE = /[!'()*]/g;
  2051. var encodeReserveReplacer = function encodeReserveReplacer(c) {
  2052. return '%' + c.charCodeAt(0).toString(16);
  2053. };
  2054. var commaRE = /%2C/g;
  2055. // fixed encodeURIComponent which is more conformant to RFC3986:
  2056. // - escapes [!'()*]
  2057. // - preserve commas
  2058. var encode = function encode(str) {
  2059. return encodeURIComponent(str).replace(encodeReserveRE, encodeReserveReplacer).replace(commaRE, ',');
  2060. };
  2061. function stringifyQuery(obj) {
  2062. var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  2063. var res = obj ? Object.keys(obj).map(function (key) {
  2064. var val = obj[key];
  2065. if (val === undefined) {
  2066. return '';
  2067. }
  2068. if (val === null) {
  2069. return encodeStr(key);
  2070. }
  2071. if (Array.isArray(val)) {
  2072. var result = [];
  2073. val.forEach(function (val2) {
  2074. if (val2 === undefined) {
  2075. return;
  2076. }
  2077. if (val2 === null) {
  2078. result.push(encodeStr(key));
  2079. } else {
  2080. result.push(encodeStr(key) + '=' + encodeStr(val2));
  2081. }
  2082. });
  2083. return result.join('&');
  2084. }
  2085. return encodeStr(key) + '=' + encodeStr(val);
  2086. }).filter(function (x) {
  2087. return x.length > 0;
  2088. }).join('&') : null;
  2089. return res ? "?".concat(res) : '';
  2090. }
  2091. function parseBaseComponent(vueComponentOptions) {
  2092. var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  2093. isPage = _ref5.isPage,
  2094. initRelation = _ref5.initRelation;
  2095. var needVueOptions = arguments.length > 2 ? arguments[2] : undefined;
  2096. var _initVueComponent = initVueComponent(_vue.default, vueComponentOptions),
  2097. _initVueComponent2 = (0, _slicedToArray2.default)(_initVueComponent, 2),
  2098. VueComponent = _initVueComponent2[0],
  2099. vueOptions = _initVueComponent2[1];
  2100. var options = _objectSpread({
  2101. multipleSlots: true,
  2102. addGlobalClass: true
  2103. }, vueOptions.options || {});
  2104. {
  2105. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  2106. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  2107. Object.assign(options, vueOptions['mp-weixin'].options);
  2108. }
  2109. }
  2110. var componentOptions = {
  2111. options: options,
  2112. data: initData(vueOptions, _vue.default.prototype),
  2113. behaviors: initBehaviors(vueOptions, initBehavior),
  2114. properties: initProperties(vueOptions.props, false, vueOptions.__file, options),
  2115. lifetimes: {
  2116. attached: function attached() {
  2117. var properties = this.properties;
  2118. var options = {
  2119. mpType: isPage.call(this) ? 'page' : 'component',
  2120. mpInstance: this,
  2121. propsData: properties
  2122. };
  2123. initVueIds(properties.vueId, this);
  2124. // 处理父子关系
  2125. initRelation.call(this, {
  2126. vuePid: this._$vuePid,
  2127. vueOptions: options
  2128. });
  2129. // 初始化 vue 实例
  2130. this.$vm = new VueComponent(options);
  2131. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  2132. initSlots(this.$vm, properties.vueSlots);
  2133. // 触发首次 setData
  2134. this.$vm.$mount();
  2135. },
  2136. ready: function ready() {
  2137. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  2138. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  2139. if (this.$vm) {
  2140. this.$vm._isMounted = true;
  2141. this.$vm.__call_hook('mounted');
  2142. this.$vm.__call_hook('onReady');
  2143. }
  2144. },
  2145. detached: function detached() {
  2146. this.$vm && this.$vm.$destroy();
  2147. }
  2148. },
  2149. pageLifetimes: {
  2150. show: function show(args) {
  2151. this.$vm && this.$vm.__call_hook('onPageShow', args);
  2152. },
  2153. hide: function hide() {
  2154. this.$vm && this.$vm.__call_hook('onPageHide');
  2155. },
  2156. resize: function resize(size) {
  2157. this.$vm && this.$vm.__call_hook('onPageResize', size);
  2158. }
  2159. },
  2160. methods: {
  2161. __l: handleLink,
  2162. __e: handleEvent
  2163. }
  2164. };
  2165. // externalClasses
  2166. if (vueOptions.externalClasses) {
  2167. componentOptions.externalClasses = vueOptions.externalClasses;
  2168. }
  2169. if (Array.isArray(vueOptions.wxsCallMethods)) {
  2170. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  2171. componentOptions.methods[callMethod] = function (args) {
  2172. return this.$vm[callMethod](args);
  2173. };
  2174. });
  2175. }
  2176. if (needVueOptions) {
  2177. return [componentOptions, vueOptions, VueComponent];
  2178. }
  2179. if (isPage) {
  2180. return componentOptions;
  2181. }
  2182. return [componentOptions, VueComponent];
  2183. }
  2184. function parseComponent(vueComponentOptions, needVueOptions) {
  2185. return parseBaseComponent(vueComponentOptions, {
  2186. isPage: isPage,
  2187. initRelation: initRelation
  2188. }, needVueOptions);
  2189. }
  2190. var hooks$1 = ['onShow', 'onHide', 'onUnload'];
  2191. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  2192. function parseBasePage(vuePageOptions) {
  2193. var _parseComponent = parseComponent(vuePageOptions, true),
  2194. _parseComponent2 = (0, _slicedToArray2.default)(_parseComponent, 2),
  2195. pageOptions = _parseComponent2[0],
  2196. vueOptions = _parseComponent2[1];
  2197. initHooks(pageOptions.methods, hooks$1, vueOptions);
  2198. pageOptions.methods.onLoad = function (query) {
  2199. this.options = query;
  2200. var copyQuery = Object.assign({}, query);
  2201. delete copyQuery.__id__;
  2202. this.$page = {
  2203. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery)
  2204. };
  2205. this.$vm.$mp.query = query; // 兼容 mpvue
  2206. this.$vm.__call_hook('onLoad', query);
  2207. };
  2208. {
  2209. initUnknownHooks(pageOptions.methods, vuePageOptions, ['onReady']);
  2210. }
  2211. return pageOptions;
  2212. }
  2213. function parsePage(vuePageOptions) {
  2214. return parseBasePage(vuePageOptions);
  2215. }
  2216. function createPage(vuePageOptions) {
  2217. {
  2218. return Component(parsePage(vuePageOptions));
  2219. }
  2220. }
  2221. function createComponent(vueOptions) {
  2222. {
  2223. return Component(parseComponent(vueOptions));
  2224. }
  2225. }
  2226. function createSubpackageApp(vm) {
  2227. var appOptions = parseApp(vm);
  2228. var app = getApp({
  2229. allowDefault: true
  2230. });
  2231. vm.$scope = app;
  2232. var globalData = app.globalData;
  2233. if (globalData) {
  2234. Object.keys(appOptions.globalData).forEach(function (name) {
  2235. if (!hasOwn(globalData, name)) {
  2236. globalData[name] = appOptions.globalData[name];
  2237. }
  2238. });
  2239. }
  2240. Object.keys(appOptions).forEach(function (name) {
  2241. if (!hasOwn(app, name)) {
  2242. app[name] = appOptions[name];
  2243. }
  2244. });
  2245. if (isFn(appOptions.onShow) && wx.onAppShow) {
  2246. wx.onAppShow(function () {
  2247. for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
  2248. args[_key5] = arguments[_key5];
  2249. }
  2250. vm.__call_hook('onShow', args);
  2251. });
  2252. }
  2253. if (isFn(appOptions.onHide) && wx.onAppHide) {
  2254. wx.onAppHide(function () {
  2255. for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
  2256. args[_key6] = arguments[_key6];
  2257. }
  2258. vm.__call_hook('onHide', args);
  2259. });
  2260. }
  2261. if (isFn(appOptions.onLaunch)) {
  2262. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  2263. vm.__call_hook('onLaunch', args);
  2264. }
  2265. return vm;
  2266. }
  2267. function createPlugin(vm) {
  2268. var appOptions = parseApp(vm);
  2269. if (isFn(appOptions.onShow) && wx.onAppShow) {
  2270. wx.onAppShow(function () {
  2271. for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
  2272. args[_key7] = arguments[_key7];
  2273. }
  2274. vm.__call_hook('onShow', args);
  2275. });
  2276. }
  2277. if (isFn(appOptions.onHide) && wx.onAppHide) {
  2278. wx.onAppHide(function () {
  2279. for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
  2280. args[_key8] = arguments[_key8];
  2281. }
  2282. vm.__call_hook('onHide', args);
  2283. });
  2284. }
  2285. if (isFn(appOptions.onLaunch)) {
  2286. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  2287. vm.__call_hook('onLaunch', args);
  2288. }
  2289. return vm;
  2290. }
  2291. todos.forEach(function (todoApi) {
  2292. protocols[todoApi] = false;
  2293. });
  2294. canIUses.forEach(function (canIUseApi) {
  2295. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name : canIUseApi;
  2296. if (!wx.canIUse(apiName)) {
  2297. protocols[canIUseApi] = false;
  2298. }
  2299. });
  2300. var uni = {};
  2301. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  2302. uni = new Proxy({}, {
  2303. get: function get(target, name) {
  2304. if (hasOwn(target, name)) {
  2305. return target[name];
  2306. }
  2307. if (baseApi[name]) {
  2308. return baseApi[name];
  2309. }
  2310. if (api[name]) {
  2311. return promisify(name, api[name]);
  2312. }
  2313. {
  2314. if (extraApi[name]) {
  2315. return promisify(name, extraApi[name]);
  2316. }
  2317. if (todoApis[name]) {
  2318. return promisify(name, todoApis[name]);
  2319. }
  2320. }
  2321. if (eventApi[name]) {
  2322. return eventApi[name];
  2323. }
  2324. return promisify(name, wrapper(name, wx[name]));
  2325. },
  2326. set: function set(target, name, value) {
  2327. target[name] = value;
  2328. return true;
  2329. }
  2330. });
  2331. } else {
  2332. Object.keys(baseApi).forEach(function (name) {
  2333. uni[name] = baseApi[name];
  2334. });
  2335. {
  2336. Object.keys(todoApis).forEach(function (name) {
  2337. uni[name] = promisify(name, todoApis[name]);
  2338. });
  2339. Object.keys(extraApi).forEach(function (name) {
  2340. uni[name] = promisify(name, todoApis[name]);
  2341. });
  2342. }
  2343. Object.keys(eventApi).forEach(function (name) {
  2344. uni[name] = eventApi[name];
  2345. });
  2346. Object.keys(api).forEach(function (name) {
  2347. uni[name] = promisify(name, api[name]);
  2348. });
  2349. Object.keys(wx).forEach(function (name) {
  2350. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  2351. uni[name] = promisify(name, wrapper(name, wx[name]));
  2352. }
  2353. });
  2354. }
  2355. wx.createApp = createApp;
  2356. wx.createPage = createPage;
  2357. wx.createComponent = createComponent;
  2358. wx.createSubpackageApp = createSubpackageApp;
  2359. wx.createPlugin = createPlugin;
  2360. var uni$1 = uni;
  2361. var _default = uni$1;
  2362. exports.default = _default;
  2363. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"], __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 3)))
  2364. /***/ }),
  2365. /* 3 */
  2366. /*!***********************************!*\
  2367. !*** (webpack)/buildin/global.js ***!
  2368. \***********************************/
  2369. /*! no static exports found */
  2370. /***/ (function(module, exports) {
  2371. var g;
  2372. // This works in non-strict mode
  2373. g = (function() {
  2374. return this;
  2375. })();
  2376. try {
  2377. // This works if eval is allowed (see CSP)
  2378. g = g || new Function("return this")();
  2379. } catch (e) {
  2380. // This works if the window reference is available
  2381. if (typeof window === "object") g = window;
  2382. }
  2383. // g can still be undefined, but nothing to do about it...
  2384. // We return undefined, instead of nothing here, so it's
  2385. // easier to handle this case. if(!global) { ...}
  2386. module.exports = g;
  2387. /***/ }),
  2388. /* 4 */
  2389. /*!**********************************************************************!*\
  2390. !*** ./node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
  2391. \**********************************************************************/
  2392. /*! no static exports found */
  2393. /***/ (function(module, exports) {
  2394. function _interopRequireDefault(obj) {
  2395. return obj && obj.__esModule ? obj : {
  2396. "default": obj
  2397. };
  2398. }
  2399. module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2400. /***/ }),
  2401. /* 5 */
  2402. /*!**************************************************************!*\
  2403. !*** ./node_modules/@babel/runtime/helpers/slicedToArray.js ***!
  2404. \**************************************************************/
  2405. /*! no static exports found */
  2406. /***/ (function(module, exports, __webpack_require__) {
  2407. var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ 6);
  2408. var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ 7);
  2409. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  2410. var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ 10);
  2411. function _slicedToArray(arr, i) {
  2412. return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
  2413. }
  2414. module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2415. /***/ }),
  2416. /* 6 */
  2417. /*!***************************************************************!*\
  2418. !*** ./node_modules/@babel/runtime/helpers/arrayWithHoles.js ***!
  2419. \***************************************************************/
  2420. /*! no static exports found */
  2421. /***/ (function(module, exports) {
  2422. function _arrayWithHoles(arr) {
  2423. if (Array.isArray(arr)) return arr;
  2424. }
  2425. module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2426. /***/ }),
  2427. /* 7 */
  2428. /*!*********************************************************************!*\
  2429. !*** ./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***!
  2430. \*********************************************************************/
  2431. /*! no static exports found */
  2432. /***/ (function(module, exports) {
  2433. function _iterableToArrayLimit(arr, i) {
  2434. var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
  2435. if (null != _i) {
  2436. var _s,
  2437. _e,
  2438. _x,
  2439. _r,
  2440. _arr = [],
  2441. _n = !0,
  2442. _d = !1;
  2443. try {
  2444. if (_x = (_i = _i.call(arr)).next, 0 === i) {
  2445. if (Object(_i) !== _i) return;
  2446. _n = !1;
  2447. } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) {
  2448. ;
  2449. }
  2450. } catch (err) {
  2451. _d = !0, _e = err;
  2452. } finally {
  2453. try {
  2454. if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
  2455. } finally {
  2456. if (_d) throw _e;
  2457. }
  2458. }
  2459. return _arr;
  2460. }
  2461. }
  2462. module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2463. /***/ }),
  2464. /* 8 */
  2465. /*!***************************************************************************!*\
  2466. !*** ./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***!
  2467. \***************************************************************************/
  2468. /*! no static exports found */
  2469. /***/ (function(module, exports, __webpack_require__) {
  2470. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  2471. function _unsupportedIterableToArray(o, minLen) {
  2472. if (!o) return;
  2473. if (typeof o === "string") return arrayLikeToArray(o, minLen);
  2474. var n = Object.prototype.toString.call(o).slice(8, -1);
  2475. if (n === "Object" && o.constructor) n = o.constructor.name;
  2476. if (n === "Map" || n === "Set") return Array.from(o);
  2477. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
  2478. }
  2479. module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2480. /***/ }),
  2481. /* 9 */
  2482. /*!*****************************************************************!*\
  2483. !*** ./node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
  2484. \*****************************************************************/
  2485. /*! no static exports found */
  2486. /***/ (function(module, exports) {
  2487. function _arrayLikeToArray(arr, len) {
  2488. if (len == null || len > arr.length) len = arr.length;
  2489. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  2490. arr2[i] = arr[i];
  2491. }
  2492. return arr2;
  2493. }
  2494. module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2495. /***/ }),
  2496. /* 10 */
  2497. /*!****************************************************************!*\
  2498. !*** ./node_modules/@babel/runtime/helpers/nonIterableRest.js ***!
  2499. \****************************************************************/
  2500. /*! no static exports found */
  2501. /***/ (function(module, exports) {
  2502. function _nonIterableRest() {
  2503. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  2504. }
  2505. module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2506. /***/ }),
  2507. /* 11 */
  2508. /*!***************************************************************!*\
  2509. !*** ./node_modules/@babel/runtime/helpers/defineProperty.js ***!
  2510. \***************************************************************/
  2511. /*! no static exports found */
  2512. /***/ (function(module, exports, __webpack_require__) {
  2513. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
  2514. function _defineProperty(obj, key, value) {
  2515. key = toPropertyKey(key);
  2516. if (key in obj) {
  2517. Object.defineProperty(obj, key, {
  2518. value: value,
  2519. enumerable: true,
  2520. configurable: true,
  2521. writable: true
  2522. });
  2523. } else {
  2524. obj[key] = value;
  2525. }
  2526. return obj;
  2527. }
  2528. module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2529. /***/ }),
  2530. /* 12 */
  2531. /*!**************************************************************!*\
  2532. !*** ./node_modules/@babel/runtime/helpers/toPropertyKey.js ***!
  2533. \**************************************************************/
  2534. /*! no static exports found */
  2535. /***/ (function(module, exports, __webpack_require__) {
  2536. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  2537. var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ 14);
  2538. function _toPropertyKey(arg) {
  2539. var key = toPrimitive(arg, "string");
  2540. return _typeof(key) === "symbol" ? key : String(key);
  2541. }
  2542. module.exports = _toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2543. /***/ }),
  2544. /* 13 */
  2545. /*!*******************************************************!*\
  2546. !*** ./node_modules/@babel/runtime/helpers/typeof.js ***!
  2547. \*******************************************************/
  2548. /*! no static exports found */
  2549. /***/ (function(module, exports) {
  2550. function _typeof(obj) {
  2551. "@babel/helpers - typeof";
  2552. return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
  2553. return typeof obj;
  2554. } : function (obj) {
  2555. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  2556. }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
  2557. }
  2558. module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2559. /***/ }),
  2560. /* 14 */
  2561. /*!************************************************************!*\
  2562. !*** ./node_modules/@babel/runtime/helpers/toPrimitive.js ***!
  2563. \************************************************************/
  2564. /*! no static exports found */
  2565. /***/ (function(module, exports, __webpack_require__) {
  2566. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  2567. function _toPrimitive(input, hint) {
  2568. if (_typeof(input) !== "object" || input === null) return input;
  2569. var prim = input[Symbol.toPrimitive];
  2570. if (prim !== undefined) {
  2571. var res = prim.call(input, hint || "default");
  2572. if (_typeof(res) !== "object") return res;
  2573. throw new TypeError("@@toPrimitive must return a primitive value.");
  2574. }
  2575. return (hint === "string" ? String : Number)(input);
  2576. }
  2577. module.exports = _toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2578. /***/ }),
  2579. /* 15 */
  2580. /*!**********************************************************!*\
  2581. !*** ./node_modules/@babel/runtime/helpers/construct.js ***!
  2582. \**********************************************************/
  2583. /*! no static exports found */
  2584. /***/ (function(module, exports, __webpack_require__) {
  2585. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  2586. var isNativeReflectConstruct = __webpack_require__(/*! ./isNativeReflectConstruct.js */ 17);
  2587. function _construct(Parent, args, Class) {
  2588. if (isNativeReflectConstruct()) {
  2589. module.exports = _construct = Reflect.construct.bind(), module.exports.__esModule = true, module.exports["default"] = module.exports;
  2590. } else {
  2591. module.exports = _construct = function _construct(Parent, args, Class) {
  2592. var a = [null];
  2593. a.push.apply(a, args);
  2594. var Constructor = Function.bind.apply(Parent, a);
  2595. var instance = new Constructor();
  2596. if (Class) setPrototypeOf(instance, Class.prototype);
  2597. return instance;
  2598. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2599. }
  2600. return _construct.apply(null, arguments);
  2601. }
  2602. module.exports = _construct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2603. /***/ }),
  2604. /* 16 */
  2605. /*!***************************************************************!*\
  2606. !*** ./node_modules/@babel/runtime/helpers/setPrototypeOf.js ***!
  2607. \***************************************************************/
  2608. /*! no static exports found */
  2609. /***/ (function(module, exports) {
  2610. function _setPrototypeOf(o, p) {
  2611. module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
  2612. o.__proto__ = p;
  2613. return o;
  2614. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2615. return _setPrototypeOf(o, p);
  2616. }
  2617. module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2618. /***/ }),
  2619. /* 17 */
  2620. /*!*************************************************************************!*\
  2621. !*** ./node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js ***!
  2622. \*************************************************************************/
  2623. /*! no static exports found */
  2624. /***/ (function(module, exports) {
  2625. function _isNativeReflectConstruct() {
  2626. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  2627. if (Reflect.construct.sham) return false;
  2628. if (typeof Proxy === "function") return true;
  2629. try {
  2630. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  2631. return true;
  2632. } catch (e) {
  2633. return false;
  2634. }
  2635. }
  2636. module.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2637. /***/ }),
  2638. /* 18 */
  2639. /*!******************************************************************!*\
  2640. !*** ./node_modules/@babel/runtime/helpers/toConsumableArray.js ***!
  2641. \******************************************************************/
  2642. /*! no static exports found */
  2643. /***/ (function(module, exports, __webpack_require__) {
  2644. var arrayWithoutHoles = __webpack_require__(/*! ./arrayWithoutHoles.js */ 19);
  2645. var iterableToArray = __webpack_require__(/*! ./iterableToArray.js */ 20);
  2646. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  2647. var nonIterableSpread = __webpack_require__(/*! ./nonIterableSpread.js */ 21);
  2648. function _toConsumableArray(arr) {
  2649. return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
  2650. }
  2651. module.exports = _toConsumableArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2652. /***/ }),
  2653. /* 19 */
  2654. /*!******************************************************************!*\
  2655. !*** ./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js ***!
  2656. \******************************************************************/
  2657. /*! no static exports found */
  2658. /***/ (function(module, exports, __webpack_require__) {
  2659. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  2660. function _arrayWithoutHoles(arr) {
  2661. if (Array.isArray(arr)) return arrayLikeToArray(arr);
  2662. }
  2663. module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2664. /***/ }),
  2665. /* 20 */
  2666. /*!****************************************************************!*\
  2667. !*** ./node_modules/@babel/runtime/helpers/iterableToArray.js ***!
  2668. \****************************************************************/
  2669. /*! no static exports found */
  2670. /***/ (function(module, exports) {
  2671. function _iterableToArray(iter) {
  2672. if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  2673. }
  2674. module.exports = _iterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2675. /***/ }),
  2676. /* 21 */
  2677. /*!******************************************************************!*\
  2678. !*** ./node_modules/@babel/runtime/helpers/nonIterableSpread.js ***!
  2679. \******************************************************************/
  2680. /*! no static exports found */
  2681. /***/ (function(module, exports) {
  2682. function _nonIterableSpread() {
  2683. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  2684. }
  2685. module.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports["default"] = module.exports;
  2686. /***/ }),
  2687. /* 22 */
  2688. /*!*************************************************************!*\
  2689. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  2690. \*************************************************************/
  2691. /*! no static exports found */
  2692. /***/ (function(module, exports, __webpack_require__) {
  2693. "use strict";
  2694. /* WEBPACK VAR INJECTION */(function(uni, global) {
  2695. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  2696. Object.defineProperty(exports, "__esModule", {
  2697. value: true
  2698. });
  2699. exports.LOCALE_ZH_HANT = exports.LOCALE_ZH_HANS = exports.LOCALE_FR = exports.LOCALE_ES = exports.LOCALE_EN = exports.I18n = exports.Formatter = void 0;
  2700. exports.compileI18nJsonStr = compileI18nJsonStr;
  2701. exports.hasI18nJson = hasI18nJson;
  2702. exports.initVueI18n = initVueI18n;
  2703. exports.isI18nStr = isI18nStr;
  2704. exports.isString = void 0;
  2705. exports.normalizeLocale = normalizeLocale;
  2706. exports.parseI18nJson = parseI18nJson;
  2707. exports.resolveLocale = resolveLocale;
  2708. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  2709. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  2710. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  2711. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  2712. var isArray = Array.isArray;
  2713. var isObject = function isObject(val) {
  2714. return val !== null && (0, _typeof2.default)(val) === 'object';
  2715. };
  2716. var defaultDelimiters = ['{', '}'];
  2717. var BaseFormatter = /*#__PURE__*/function () {
  2718. function BaseFormatter() {
  2719. (0, _classCallCheck2.default)(this, BaseFormatter);
  2720. this._caches = Object.create(null);
  2721. }
  2722. (0, _createClass2.default)(BaseFormatter, [{
  2723. key: "interpolate",
  2724. value: function interpolate(message, values) {
  2725. var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  2726. if (!values) {
  2727. return [message];
  2728. }
  2729. var tokens = this._caches[message];
  2730. if (!tokens) {
  2731. tokens = parse(message, delimiters);
  2732. this._caches[message] = tokens;
  2733. }
  2734. return compile(tokens, values);
  2735. }
  2736. }]);
  2737. return BaseFormatter;
  2738. }();
  2739. exports.Formatter = BaseFormatter;
  2740. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  2741. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  2742. function parse(format, _ref) {
  2743. var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
  2744. startDelimiter = _ref2[0],
  2745. endDelimiter = _ref2[1];
  2746. var tokens = [];
  2747. var position = 0;
  2748. var text = '';
  2749. while (position < format.length) {
  2750. var char = format[position++];
  2751. if (char === startDelimiter) {
  2752. if (text) {
  2753. tokens.push({
  2754. type: 'text',
  2755. value: text
  2756. });
  2757. }
  2758. text = '';
  2759. var sub = '';
  2760. char = format[position++];
  2761. while (char !== undefined && char !== endDelimiter) {
  2762. sub += char;
  2763. char = format[position++];
  2764. }
  2765. var isClosed = char === endDelimiter;
  2766. var type = RE_TOKEN_LIST_VALUE.test(sub) ? 'list' : isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ? 'named' : 'unknown';
  2767. tokens.push({
  2768. value: sub,
  2769. type: type
  2770. });
  2771. }
  2772. // else if (char === '%') {
  2773. // // when found rails i18n syntax, skip text capture
  2774. // if (format[position] !== '{') {
  2775. // text += char
  2776. // }
  2777. // }
  2778. else {
  2779. text += char;
  2780. }
  2781. }
  2782. text && tokens.push({
  2783. type: 'text',
  2784. value: text
  2785. });
  2786. return tokens;
  2787. }
  2788. function compile(tokens, values) {
  2789. var compiled = [];
  2790. var index = 0;
  2791. var mode = isArray(values) ? 'list' : isObject(values) ? 'named' : 'unknown';
  2792. if (mode === 'unknown') {
  2793. return compiled;
  2794. }
  2795. while (index < tokens.length) {
  2796. var token = tokens[index];
  2797. switch (token.type) {
  2798. case 'text':
  2799. compiled.push(token.value);
  2800. break;
  2801. case 'list':
  2802. compiled.push(values[parseInt(token.value, 10)]);
  2803. break;
  2804. case 'named':
  2805. if (mode === 'named') {
  2806. compiled.push(values[token.value]);
  2807. } else {
  2808. if (true) {
  2809. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  2810. }
  2811. }
  2812. break;
  2813. case 'unknown':
  2814. if (true) {
  2815. console.warn("Detect 'unknown' type of token!");
  2816. }
  2817. break;
  2818. }
  2819. index++;
  2820. }
  2821. return compiled;
  2822. }
  2823. var LOCALE_ZH_HANS = 'zh-Hans';
  2824. exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  2825. var LOCALE_ZH_HANT = 'zh-Hant';
  2826. exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  2827. var LOCALE_EN = 'en';
  2828. exports.LOCALE_EN = LOCALE_EN;
  2829. var LOCALE_FR = 'fr';
  2830. exports.LOCALE_FR = LOCALE_FR;
  2831. var LOCALE_ES = 'es';
  2832. exports.LOCALE_ES = LOCALE_ES;
  2833. var hasOwnProperty = Object.prototype.hasOwnProperty;
  2834. var hasOwn = function hasOwn(val, key) {
  2835. return hasOwnProperty.call(val, key);
  2836. };
  2837. var defaultFormatter = new BaseFormatter();
  2838. function include(str, parts) {
  2839. return !!parts.find(function (part) {
  2840. return str.indexOf(part) !== -1;
  2841. });
  2842. }
  2843. function startsWith(str, parts) {
  2844. return parts.find(function (part) {
  2845. return str.indexOf(part) === 0;
  2846. });
  2847. }
  2848. function normalizeLocale(locale, messages) {
  2849. if (!locale) {
  2850. return;
  2851. }
  2852. locale = locale.trim().replace(/_/g, '-');
  2853. if (messages && messages[locale]) {
  2854. return locale;
  2855. }
  2856. locale = locale.toLowerCase();
  2857. if (locale.indexOf('zh') === 0) {
  2858. if (locale.indexOf('-hans') > -1) {
  2859. return LOCALE_ZH_HANS;
  2860. }
  2861. if (locale.indexOf('-hant') > -1) {
  2862. return LOCALE_ZH_HANT;
  2863. }
  2864. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  2865. return LOCALE_ZH_HANT;
  2866. }
  2867. return LOCALE_ZH_HANS;
  2868. }
  2869. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  2870. if (lang) {
  2871. return lang;
  2872. }
  2873. }
  2874. var I18n = /*#__PURE__*/function () {
  2875. function I18n(_ref3) {
  2876. var locale = _ref3.locale,
  2877. fallbackLocale = _ref3.fallbackLocale,
  2878. messages = _ref3.messages,
  2879. watcher = _ref3.watcher,
  2880. formater = _ref3.formater;
  2881. (0, _classCallCheck2.default)(this, I18n);
  2882. this.locale = LOCALE_EN;
  2883. this.fallbackLocale = LOCALE_EN;
  2884. this.message = {};
  2885. this.messages = {};
  2886. this.watchers = [];
  2887. if (fallbackLocale) {
  2888. this.fallbackLocale = fallbackLocale;
  2889. }
  2890. this.formater = formater || defaultFormatter;
  2891. this.messages = messages || {};
  2892. this.setLocale(locale || LOCALE_EN);
  2893. if (watcher) {
  2894. this.watchLocale(watcher);
  2895. }
  2896. }
  2897. (0, _createClass2.default)(I18n, [{
  2898. key: "setLocale",
  2899. value: function setLocale(locale) {
  2900. var _this = this;
  2901. var oldLocale = this.locale;
  2902. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  2903. if (!this.messages[this.locale]) {
  2904. // 可能初始化时不存在
  2905. this.messages[this.locale] = {};
  2906. }
  2907. this.message = this.messages[this.locale];
  2908. // 仅发生变化时,通知
  2909. if (oldLocale !== this.locale) {
  2910. this.watchers.forEach(function (watcher) {
  2911. watcher(_this.locale, oldLocale);
  2912. });
  2913. }
  2914. }
  2915. }, {
  2916. key: "getLocale",
  2917. value: function getLocale() {
  2918. return this.locale;
  2919. }
  2920. }, {
  2921. key: "watchLocale",
  2922. value: function watchLocale(fn) {
  2923. var _this2 = this;
  2924. var index = this.watchers.push(fn) - 1;
  2925. return function () {
  2926. _this2.watchers.splice(index, 1);
  2927. };
  2928. }
  2929. }, {
  2930. key: "add",
  2931. value: function add(locale, message) {
  2932. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  2933. var curMessages = this.messages[locale];
  2934. if (curMessages) {
  2935. if (override) {
  2936. Object.assign(curMessages, message);
  2937. } else {
  2938. Object.keys(message).forEach(function (key) {
  2939. if (!hasOwn(curMessages, key)) {
  2940. curMessages[key] = message[key];
  2941. }
  2942. });
  2943. }
  2944. } else {
  2945. this.messages[locale] = message;
  2946. }
  2947. }
  2948. }, {
  2949. key: "f",
  2950. value: function f(message, values, delimiters) {
  2951. return this.formater.interpolate(message, values, delimiters).join('');
  2952. }
  2953. }, {
  2954. key: "t",
  2955. value: function t(key, locale, values) {
  2956. var message = this.message;
  2957. if (typeof locale === 'string') {
  2958. locale = normalizeLocale(locale, this.messages);
  2959. locale && (message = this.messages[locale]);
  2960. } else {
  2961. values = locale;
  2962. }
  2963. if (!hasOwn(message, key)) {
  2964. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  2965. return key;
  2966. }
  2967. return this.formater.interpolate(message[key], values).join('');
  2968. }
  2969. }]);
  2970. return I18n;
  2971. }();
  2972. exports.I18n = I18n;
  2973. function watchAppLocale(appVm, i18n) {
  2974. // 需要保证 watch 的触发在组件渲染之前
  2975. if (appVm.$watchLocale) {
  2976. // vue2
  2977. appVm.$watchLocale(function (newLocale) {
  2978. i18n.setLocale(newLocale);
  2979. });
  2980. } else {
  2981. appVm.$watch(function () {
  2982. return appVm.$locale;
  2983. }, function (newLocale) {
  2984. i18n.setLocale(newLocale);
  2985. });
  2986. }
  2987. }
  2988. function getDefaultLocale() {
  2989. if (typeof uni !== 'undefined' && uni.getLocale) {
  2990. return uni.getLocale();
  2991. }
  2992. // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
  2993. if (typeof global !== 'undefined' && global.getLocale) {
  2994. return global.getLocale();
  2995. }
  2996. return LOCALE_EN;
  2997. }
  2998. function initVueI18n(locale) {
  2999. var messages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  3000. var fallbackLocale = arguments.length > 2 ? arguments[2] : undefined;
  3001. var watcher = arguments.length > 3 ? arguments[3] : undefined;
  3002. // 兼容旧版本入参
  3003. if (typeof locale !== 'string') {
  3004. var _ref4 = [messages, locale];
  3005. locale = _ref4[0];
  3006. messages = _ref4[1];
  3007. }
  3008. if (typeof locale !== 'string') {
  3009. // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
  3010. locale = getDefaultLocale();
  3011. }
  3012. if (typeof fallbackLocale !== 'string') {
  3013. fallbackLocale = typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale || LOCALE_EN;
  3014. }
  3015. var i18n = new I18n({
  3016. locale: locale,
  3017. fallbackLocale: fallbackLocale,
  3018. messages: messages,
  3019. watcher: watcher
  3020. });
  3021. var _t = function t(key, values) {
  3022. if (typeof getApp !== 'function') {
  3023. // app view
  3024. /* eslint-disable no-func-assign */
  3025. _t = function t(key, values) {
  3026. return i18n.t(key, values);
  3027. };
  3028. } else {
  3029. var isWatchedAppLocale = false;
  3030. _t = function t(key, values) {
  3031. var appVm = getApp().$vm;
  3032. // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
  3033. // options: {
  3034. // type: Array,
  3035. // default () {
  3036. // return [{
  3037. // icon: 'shop',
  3038. // text: t("uni-goods-nav.options.shop"),
  3039. // }, {
  3040. // icon: 'cart',
  3041. // text: t("uni-goods-nav.options.cart")
  3042. // }]
  3043. // }
  3044. // },
  3045. if (appVm) {
  3046. // 触发响应式
  3047. appVm.$locale;
  3048. if (!isWatchedAppLocale) {
  3049. isWatchedAppLocale = true;
  3050. watchAppLocale(appVm, i18n);
  3051. }
  3052. }
  3053. return i18n.t(key, values);
  3054. };
  3055. }
  3056. return _t(key, values);
  3057. };
  3058. return {
  3059. i18n: i18n,
  3060. f: function f(message, values, delimiters) {
  3061. return i18n.f(message, values, delimiters);
  3062. },
  3063. t: function t(key, values) {
  3064. return _t(key, values);
  3065. },
  3066. add: function add(locale, message) {
  3067. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  3068. return i18n.add(locale, message, override);
  3069. },
  3070. watch: function watch(fn) {
  3071. return i18n.watchLocale(fn);
  3072. },
  3073. getLocale: function getLocale() {
  3074. return i18n.getLocale();
  3075. },
  3076. setLocale: function setLocale(newLocale) {
  3077. return i18n.setLocale(newLocale);
  3078. }
  3079. };
  3080. }
  3081. var isString = function isString(val) {
  3082. return typeof val === 'string';
  3083. };
  3084. exports.isString = isString;
  3085. var formater;
  3086. function hasI18nJson(jsonObj, delimiters) {
  3087. if (!formater) {
  3088. formater = new BaseFormatter();
  3089. }
  3090. return walkJsonObj(jsonObj, function (jsonObj, key) {
  3091. var value = jsonObj[key];
  3092. if (isString(value)) {
  3093. if (isI18nStr(value, delimiters)) {
  3094. return true;
  3095. }
  3096. } else {
  3097. return hasI18nJson(value, delimiters);
  3098. }
  3099. });
  3100. }
  3101. function parseI18nJson(jsonObj, values, delimiters) {
  3102. if (!formater) {
  3103. formater = new BaseFormatter();
  3104. }
  3105. walkJsonObj(jsonObj, function (jsonObj, key) {
  3106. var value = jsonObj[key];
  3107. if (isString(value)) {
  3108. if (isI18nStr(value, delimiters)) {
  3109. jsonObj[key] = compileStr(value, values, delimiters);
  3110. }
  3111. } else {
  3112. parseI18nJson(value, values, delimiters);
  3113. }
  3114. });
  3115. return jsonObj;
  3116. }
  3117. function compileI18nJsonStr(jsonStr, _ref5) {
  3118. var locale = _ref5.locale,
  3119. locales = _ref5.locales,
  3120. delimiters = _ref5.delimiters;
  3121. if (!isI18nStr(jsonStr, delimiters)) {
  3122. return jsonStr;
  3123. }
  3124. if (!formater) {
  3125. formater = new BaseFormatter();
  3126. }
  3127. var localeValues = [];
  3128. Object.keys(locales).forEach(function (name) {
  3129. if (name !== locale) {
  3130. localeValues.push({
  3131. locale: name,
  3132. values: locales[name]
  3133. });
  3134. }
  3135. });
  3136. localeValues.unshift({
  3137. locale: locale,
  3138. values: locales[locale]
  3139. });
  3140. try {
  3141. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  3142. } catch (e) {}
  3143. return jsonStr;
  3144. }
  3145. function isI18nStr(value, delimiters) {
  3146. return value.indexOf(delimiters[0]) > -1;
  3147. }
  3148. function compileStr(value, values, delimiters) {
  3149. return formater.interpolate(value, values, delimiters).join('');
  3150. }
  3151. function compileValue(jsonObj, key, localeValues, delimiters) {
  3152. var value = jsonObj[key];
  3153. if (isString(value)) {
  3154. // 存在国际化
  3155. if (isI18nStr(value, delimiters)) {
  3156. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  3157. if (localeValues.length > 1) {
  3158. // 格式化国际化语言
  3159. var valueLocales = jsonObj[key + 'Locales'] = {};
  3160. localeValues.forEach(function (localValue) {
  3161. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  3162. });
  3163. }
  3164. }
  3165. } else {
  3166. compileJsonObj(value, localeValues, delimiters);
  3167. }
  3168. }
  3169. function compileJsonObj(jsonObj, localeValues, delimiters) {
  3170. walkJsonObj(jsonObj, function (jsonObj, key) {
  3171. compileValue(jsonObj, key, localeValues, delimiters);
  3172. });
  3173. return jsonObj;
  3174. }
  3175. function walkJsonObj(jsonObj, walk) {
  3176. if (isArray(jsonObj)) {
  3177. for (var i = 0; i < jsonObj.length; i++) {
  3178. if (walk(jsonObj, i)) {
  3179. return true;
  3180. }
  3181. }
  3182. } else if (isObject(jsonObj)) {
  3183. for (var key in jsonObj) {
  3184. if (walk(jsonObj, key)) {
  3185. return true;
  3186. }
  3187. }
  3188. }
  3189. return false;
  3190. }
  3191. function resolveLocale(locales) {
  3192. return function (locale) {
  3193. if (!locale) {
  3194. return locale;
  3195. }
  3196. locale = normalizeLocale(locale) || locale;
  3197. return resolveLocaleChain(locale).find(function (locale) {
  3198. return locales.indexOf(locale) > -1;
  3199. });
  3200. };
  3201. }
  3202. function resolveLocaleChain(locale) {
  3203. var chain = [];
  3204. var tokens = locale.split('-');
  3205. while (tokens.length) {
  3206. chain.push(tokens.join('-'));
  3207. tokens.pop();
  3208. }
  3209. return chain;
  3210. }
  3211. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"], __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 3)))
  3212. /***/ }),
  3213. /* 23 */
  3214. /*!***************************************************************!*\
  3215. !*** ./node_modules/@babel/runtime/helpers/classCallCheck.js ***!
  3216. \***************************************************************/
  3217. /*! no static exports found */
  3218. /***/ (function(module, exports) {
  3219. function _classCallCheck(instance, Constructor) {
  3220. if (!(instance instanceof Constructor)) {
  3221. throw new TypeError("Cannot call a class as a function");
  3222. }
  3223. }
  3224. module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3225. /***/ }),
  3226. /* 24 */
  3227. /*!************************************************************!*\
  3228. !*** ./node_modules/@babel/runtime/helpers/createClass.js ***!
  3229. \************************************************************/
  3230. /*! no static exports found */
  3231. /***/ (function(module, exports, __webpack_require__) {
  3232. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
  3233. function _defineProperties(target, props) {
  3234. for (var i = 0; i < props.length; i++) {
  3235. var descriptor = props[i];
  3236. descriptor.enumerable = descriptor.enumerable || false;
  3237. descriptor.configurable = true;
  3238. if ("value" in descriptor) descriptor.writable = true;
  3239. Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
  3240. }
  3241. }
  3242. function _createClass(Constructor, protoProps, staticProps) {
  3243. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  3244. if (staticProps) _defineProperties(Constructor, staticProps);
  3245. Object.defineProperty(Constructor, "prototype", {
  3246. writable: false
  3247. });
  3248. return Constructor;
  3249. }
  3250. module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3251. /***/ }),
  3252. /* 25 */
  3253. /*!******************************************************************************************!*\
  3254. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  3255. \******************************************************************************************/
  3256. /*! exports provided: default */
  3257. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3258. "use strict";
  3259. __webpack_require__.r(__webpack_exports__);
  3260. /* WEBPACK VAR INJECTION */(function(global) {/*!
  3261. * Vue.js v2.6.11
  3262. * (c) 2014-2022 Evan You
  3263. * Released under the MIT License.
  3264. */
  3265. /* */
  3266. var emptyObject = Object.freeze({});
  3267. // These helpers produce better VM code in JS engines due to their
  3268. // explicitness and function inlining.
  3269. function isUndef (v) {
  3270. return v === undefined || v === null
  3271. }
  3272. function isDef (v) {
  3273. return v !== undefined && v !== null
  3274. }
  3275. function isTrue (v) {
  3276. return v === true
  3277. }
  3278. function isFalse (v) {
  3279. return v === false
  3280. }
  3281. /**
  3282. * Check if value is primitive.
  3283. */
  3284. function isPrimitive (value) {
  3285. return (
  3286. typeof value === 'string' ||
  3287. typeof value === 'number' ||
  3288. // $flow-disable-line
  3289. typeof value === 'symbol' ||
  3290. typeof value === 'boolean'
  3291. )
  3292. }
  3293. /**
  3294. * Quick object check - this is primarily used to tell
  3295. * Objects from primitive values when we know the value
  3296. * is a JSON-compliant type.
  3297. */
  3298. function isObject (obj) {
  3299. return obj !== null && typeof obj === 'object'
  3300. }
  3301. /**
  3302. * Get the raw type string of a value, e.g., [object Object].
  3303. */
  3304. var _toString = Object.prototype.toString;
  3305. function toRawType (value) {
  3306. return _toString.call(value).slice(8, -1)
  3307. }
  3308. /**
  3309. * Strict object type check. Only returns true
  3310. * for plain JavaScript objects.
  3311. */
  3312. function isPlainObject (obj) {
  3313. return _toString.call(obj) === '[object Object]'
  3314. }
  3315. function isRegExp (v) {
  3316. return _toString.call(v) === '[object RegExp]'
  3317. }
  3318. /**
  3319. * Check if val is a valid array index.
  3320. */
  3321. function isValidArrayIndex (val) {
  3322. var n = parseFloat(String(val));
  3323. return n >= 0 && Math.floor(n) === n && isFinite(val)
  3324. }
  3325. function isPromise (val) {
  3326. return (
  3327. isDef(val) &&
  3328. typeof val.then === 'function' &&
  3329. typeof val.catch === 'function'
  3330. )
  3331. }
  3332. /**
  3333. * Convert a value to a string that is actually rendered.
  3334. */
  3335. function toString (val) {
  3336. return val == null
  3337. ? ''
  3338. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  3339. ? JSON.stringify(val, null, 2)
  3340. : String(val)
  3341. }
  3342. /**
  3343. * Convert an input value to a number for persistence.
  3344. * If the conversion fails, return original string.
  3345. */
  3346. function toNumber (val) {
  3347. var n = parseFloat(val);
  3348. return isNaN(n) ? val : n
  3349. }
  3350. /**
  3351. * Make a map and return a function for checking if a key
  3352. * is in that map.
  3353. */
  3354. function makeMap (
  3355. str,
  3356. expectsLowerCase
  3357. ) {
  3358. var map = Object.create(null);
  3359. var list = str.split(',');
  3360. for (var i = 0; i < list.length; i++) {
  3361. map[list[i]] = true;
  3362. }
  3363. return expectsLowerCase
  3364. ? function (val) { return map[val.toLowerCase()]; }
  3365. : function (val) { return map[val]; }
  3366. }
  3367. /**
  3368. * Check if a tag is a built-in tag.
  3369. */
  3370. var isBuiltInTag = makeMap('slot,component', true);
  3371. /**
  3372. * Check if an attribute is a reserved attribute.
  3373. */
  3374. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  3375. /**
  3376. * Remove an item from an array.
  3377. */
  3378. function remove (arr, item) {
  3379. if (arr.length) {
  3380. var index = arr.indexOf(item);
  3381. if (index > -1) {
  3382. return arr.splice(index, 1)
  3383. }
  3384. }
  3385. }
  3386. /**
  3387. * Check whether an object has the property.
  3388. */
  3389. var hasOwnProperty = Object.prototype.hasOwnProperty;
  3390. function hasOwn (obj, key) {
  3391. return hasOwnProperty.call(obj, key)
  3392. }
  3393. /**
  3394. * Create a cached version of a pure function.
  3395. */
  3396. function cached (fn) {
  3397. var cache = Object.create(null);
  3398. return (function cachedFn (str) {
  3399. var hit = cache[str];
  3400. return hit || (cache[str] = fn(str))
  3401. })
  3402. }
  3403. /**
  3404. * Camelize a hyphen-delimited string.
  3405. */
  3406. var camelizeRE = /-(\w)/g;
  3407. var camelize = cached(function (str) {
  3408. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  3409. });
  3410. /**
  3411. * Capitalize a string.
  3412. */
  3413. var capitalize = cached(function (str) {
  3414. return str.charAt(0).toUpperCase() + str.slice(1)
  3415. });
  3416. /**
  3417. * Hyphenate a camelCase string.
  3418. */
  3419. var hyphenateRE = /\B([A-Z])/g;
  3420. var hyphenate = cached(function (str) {
  3421. return str.replace(hyphenateRE, '-$1').toLowerCase()
  3422. });
  3423. /**
  3424. * Simple bind polyfill for environments that do not support it,
  3425. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  3426. * since native bind is now performant enough in most browsers.
  3427. * But removing it would mean breaking code that was able to run in
  3428. * PhantomJS 1.x, so this must be kept for backward compatibility.
  3429. */
  3430. /* istanbul ignore next */
  3431. function polyfillBind (fn, ctx) {
  3432. function boundFn (a) {
  3433. var l = arguments.length;
  3434. return l
  3435. ? l > 1
  3436. ? fn.apply(ctx, arguments)
  3437. : fn.call(ctx, a)
  3438. : fn.call(ctx)
  3439. }
  3440. boundFn._length = fn.length;
  3441. return boundFn
  3442. }
  3443. function nativeBind (fn, ctx) {
  3444. return fn.bind(ctx)
  3445. }
  3446. var bind = Function.prototype.bind
  3447. ? nativeBind
  3448. : polyfillBind;
  3449. /**
  3450. * Convert an Array-like object to a real Array.
  3451. */
  3452. function toArray (list, start) {
  3453. start = start || 0;
  3454. var i = list.length - start;
  3455. var ret = new Array(i);
  3456. while (i--) {
  3457. ret[i] = list[i + start];
  3458. }
  3459. return ret
  3460. }
  3461. /**
  3462. * Mix properties into target object.
  3463. */
  3464. function extend (to, _from) {
  3465. for (var key in _from) {
  3466. to[key] = _from[key];
  3467. }
  3468. return to
  3469. }
  3470. /**
  3471. * Merge an Array of Objects into a single Object.
  3472. */
  3473. function toObject (arr) {
  3474. var res = {};
  3475. for (var i = 0; i < arr.length; i++) {
  3476. if (arr[i]) {
  3477. extend(res, arr[i]);
  3478. }
  3479. }
  3480. return res
  3481. }
  3482. /* eslint-disable no-unused-vars */
  3483. /**
  3484. * Perform no operation.
  3485. * Stubbing args to make Flow happy without leaving useless transpiled code
  3486. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  3487. */
  3488. function noop (a, b, c) {}
  3489. /**
  3490. * Always return false.
  3491. */
  3492. var no = function (a, b, c) { return false; };
  3493. /* eslint-enable no-unused-vars */
  3494. /**
  3495. * Return the same value.
  3496. */
  3497. var identity = function (_) { return _; };
  3498. /**
  3499. * Check if two values are loosely equal - that is,
  3500. * if they are plain objects, do they have the same shape?
  3501. */
  3502. function looseEqual (a, b) {
  3503. if (a === b) { return true }
  3504. var isObjectA = isObject(a);
  3505. var isObjectB = isObject(b);
  3506. if (isObjectA && isObjectB) {
  3507. try {
  3508. var isArrayA = Array.isArray(a);
  3509. var isArrayB = Array.isArray(b);
  3510. if (isArrayA && isArrayB) {
  3511. return a.length === b.length && a.every(function (e, i) {
  3512. return looseEqual(e, b[i])
  3513. })
  3514. } else if (a instanceof Date && b instanceof Date) {
  3515. return a.getTime() === b.getTime()
  3516. } else if (!isArrayA && !isArrayB) {
  3517. var keysA = Object.keys(a);
  3518. var keysB = Object.keys(b);
  3519. return keysA.length === keysB.length && keysA.every(function (key) {
  3520. return looseEqual(a[key], b[key])
  3521. })
  3522. } else {
  3523. /* istanbul ignore next */
  3524. return false
  3525. }
  3526. } catch (e) {
  3527. /* istanbul ignore next */
  3528. return false
  3529. }
  3530. } else if (!isObjectA && !isObjectB) {
  3531. return String(a) === String(b)
  3532. } else {
  3533. return false
  3534. }
  3535. }
  3536. /**
  3537. * Return the first index at which a loosely equal value can be
  3538. * found in the array (if value is a plain object, the array must
  3539. * contain an object of the same shape), or -1 if it is not present.
  3540. */
  3541. function looseIndexOf (arr, val) {
  3542. for (var i = 0; i < arr.length; i++) {
  3543. if (looseEqual(arr[i], val)) { return i }
  3544. }
  3545. return -1
  3546. }
  3547. /**
  3548. * Ensure a function is called only once.
  3549. */
  3550. function once (fn) {
  3551. var called = false;
  3552. return function () {
  3553. if (!called) {
  3554. called = true;
  3555. fn.apply(this, arguments);
  3556. }
  3557. }
  3558. }
  3559. var ASSET_TYPES = [
  3560. 'component',
  3561. 'directive',
  3562. 'filter'
  3563. ];
  3564. var LIFECYCLE_HOOKS = [
  3565. 'beforeCreate',
  3566. 'created',
  3567. 'beforeMount',
  3568. 'mounted',
  3569. 'beforeUpdate',
  3570. 'updated',
  3571. 'beforeDestroy',
  3572. 'destroyed',
  3573. 'activated',
  3574. 'deactivated',
  3575. 'errorCaptured',
  3576. 'serverPrefetch'
  3577. ];
  3578. /* */
  3579. var config = ({
  3580. /**
  3581. * Option merge strategies (used in core/util/options)
  3582. */
  3583. // $flow-disable-line
  3584. optionMergeStrategies: Object.create(null),
  3585. /**
  3586. * Whether to suppress warnings.
  3587. */
  3588. silent: false,
  3589. /**
  3590. * Show production mode tip message on boot?
  3591. */
  3592. productionTip: "development" !== 'production',
  3593. /**
  3594. * Whether to enable devtools
  3595. */
  3596. devtools: "development" !== 'production',
  3597. /**
  3598. * Whether to record perf
  3599. */
  3600. performance: false,
  3601. /**
  3602. * Error handler for watcher errors
  3603. */
  3604. errorHandler: null,
  3605. /**
  3606. * Warn handler for watcher warns
  3607. */
  3608. warnHandler: null,
  3609. /**
  3610. * Ignore certain custom elements
  3611. */
  3612. ignoredElements: [],
  3613. /**
  3614. * Custom user key aliases for v-on
  3615. */
  3616. // $flow-disable-line
  3617. keyCodes: Object.create(null),
  3618. /**
  3619. * Check if a tag is reserved so that it cannot be registered as a
  3620. * component. This is platform-dependent and may be overwritten.
  3621. */
  3622. isReservedTag: no,
  3623. /**
  3624. * Check if an attribute is reserved so that it cannot be used as a component
  3625. * prop. This is platform-dependent and may be overwritten.
  3626. */
  3627. isReservedAttr: no,
  3628. /**
  3629. * Check if a tag is an unknown element.
  3630. * Platform-dependent.
  3631. */
  3632. isUnknownElement: no,
  3633. /**
  3634. * Get the namespace of an element
  3635. */
  3636. getTagNamespace: noop,
  3637. /**
  3638. * Parse the real tag name for the specific platform.
  3639. */
  3640. parsePlatformTagName: identity,
  3641. /**
  3642. * Check if an attribute must be bound using property, e.g. value
  3643. * Platform-dependent.
  3644. */
  3645. mustUseProp: no,
  3646. /**
  3647. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  3648. * This will significantly reduce performance if set to false.
  3649. */
  3650. async: true,
  3651. /**
  3652. * Exposed for legacy reasons
  3653. */
  3654. _lifecycleHooks: LIFECYCLE_HOOKS
  3655. });
  3656. /* */
  3657. /**
  3658. * unicode letters used for parsing html tags, component names and property paths.
  3659. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  3660. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  3661. */
  3662. 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/;
  3663. /**
  3664. * Check if a string starts with $ or _
  3665. */
  3666. function isReserved (str) {
  3667. var c = (str + '').charCodeAt(0);
  3668. return c === 0x24 || c === 0x5F
  3669. }
  3670. /**
  3671. * Define a property.
  3672. */
  3673. function def (obj, key, val, enumerable) {
  3674. Object.defineProperty(obj, key, {
  3675. value: val,
  3676. enumerable: !!enumerable,
  3677. writable: true,
  3678. configurable: true
  3679. });
  3680. }
  3681. /**
  3682. * Parse simple path.
  3683. */
  3684. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  3685. function parsePath (path) {
  3686. if (bailRE.test(path)) {
  3687. return
  3688. }
  3689. var segments = path.split('.');
  3690. return function (obj) {
  3691. for (var i = 0; i < segments.length; i++) {
  3692. if (!obj) { return }
  3693. obj = obj[segments[i]];
  3694. }
  3695. return obj
  3696. }
  3697. }
  3698. /* */
  3699. // can we use __proto__?
  3700. var hasProto = '__proto__' in {};
  3701. // Browser environment sniffing
  3702. var inBrowser = typeof window !== 'undefined';
  3703. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  3704. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  3705. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  3706. var isIE = UA && /msie|trident/.test(UA);
  3707. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  3708. var isEdge = UA && UA.indexOf('edge/') > 0;
  3709. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  3710. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  3711. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  3712. var isPhantomJS = UA && /phantomjs/.test(UA);
  3713. var isFF = UA && UA.match(/firefox\/(\d+)/);
  3714. // Firefox has a "watch" function on Object.prototype...
  3715. var nativeWatch = ({}).watch;
  3716. if (inBrowser) {
  3717. try {
  3718. var opts = {};
  3719. Object.defineProperty(opts, 'passive', ({
  3720. get: function get () {
  3721. }
  3722. })); // https://github.com/facebook/flow/issues/285
  3723. window.addEventListener('test-passive', null, opts);
  3724. } catch (e) {}
  3725. }
  3726. // this needs to be lazy-evaled because vue may be required before
  3727. // vue-server-renderer can set VUE_ENV
  3728. var _isServer;
  3729. var isServerRendering = function () {
  3730. if (_isServer === undefined) {
  3731. /* istanbul ignore if */
  3732. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  3733. // detect presence of vue-server-renderer and avoid
  3734. // Webpack shimming the process
  3735. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  3736. } else {
  3737. _isServer = false;
  3738. }
  3739. }
  3740. return _isServer
  3741. };
  3742. // detect devtools
  3743. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  3744. /* istanbul ignore next */
  3745. function isNative (Ctor) {
  3746. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  3747. }
  3748. var hasSymbol =
  3749. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  3750. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  3751. var _Set;
  3752. /* istanbul ignore if */ // $flow-disable-line
  3753. if (typeof Set !== 'undefined' && isNative(Set)) {
  3754. // use native Set when available.
  3755. _Set = Set;
  3756. } else {
  3757. // a non-standard Set polyfill that only works with primitive keys.
  3758. _Set = /*@__PURE__*/(function () {
  3759. function Set () {
  3760. this.set = Object.create(null);
  3761. }
  3762. Set.prototype.has = function has (key) {
  3763. return this.set[key] === true
  3764. };
  3765. Set.prototype.add = function add (key) {
  3766. this.set[key] = true;
  3767. };
  3768. Set.prototype.clear = function clear () {
  3769. this.set = Object.create(null);
  3770. };
  3771. return Set;
  3772. }());
  3773. }
  3774. /* */
  3775. var warn = noop;
  3776. var tip = noop;
  3777. var generateComponentTrace = (noop); // work around flow check
  3778. var formatComponentName = (noop);
  3779. if (true) {
  3780. var hasConsole = typeof console !== 'undefined';
  3781. var classifyRE = /(?:^|[-_])(\w)/g;
  3782. var classify = function (str) { return str
  3783. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  3784. .replace(/[-_]/g, ''); };
  3785. warn = function (msg, vm) {
  3786. var trace = vm ? generateComponentTrace(vm) : '';
  3787. if (config.warnHandler) {
  3788. config.warnHandler.call(null, msg, vm, trace);
  3789. } else if (hasConsole && (!config.silent)) {
  3790. console.error(("[Vue warn]: " + msg + trace));
  3791. }
  3792. };
  3793. tip = function (msg, vm) {
  3794. if (hasConsole && (!config.silent)) {
  3795. console.warn("[Vue tip]: " + msg + (
  3796. vm ? generateComponentTrace(vm) : ''
  3797. ));
  3798. }
  3799. };
  3800. formatComponentName = function (vm, includeFile) {
  3801. if (vm.$root === vm) {
  3802. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  3803. return ('') + vm.$options.__file
  3804. }
  3805. return '<Root>'
  3806. }
  3807. var options = typeof vm === 'function' && vm.cid != null
  3808. ? vm.options
  3809. : vm._isVue
  3810. ? vm.$options || vm.constructor.options
  3811. : vm;
  3812. var name = options.name || options._componentTag;
  3813. var file = options.__file;
  3814. if (!name && file) {
  3815. var match = file.match(/([^/\\]+)\.vue$/);
  3816. name = match && match[1];
  3817. }
  3818. return (
  3819. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  3820. (file && includeFile !== false ? (" at " + file) : '')
  3821. )
  3822. };
  3823. var repeat = function (str, n) {
  3824. var res = '';
  3825. while (n) {
  3826. if (n % 2 === 1) { res += str; }
  3827. if (n > 1) { str += str; }
  3828. n >>= 1;
  3829. }
  3830. return res
  3831. };
  3832. generateComponentTrace = function (vm) {
  3833. if (vm._isVue && vm.$parent) {
  3834. var tree = [];
  3835. var currentRecursiveSequence = 0;
  3836. while (vm && vm.$options.name !== 'PageBody') {
  3837. if (tree.length > 0) {
  3838. var last = tree[tree.length - 1];
  3839. if (last.constructor === vm.constructor) {
  3840. currentRecursiveSequence++;
  3841. vm = vm.$parent;
  3842. continue
  3843. } else if (currentRecursiveSequence > 0) {
  3844. tree[tree.length - 1] = [last, currentRecursiveSequence];
  3845. currentRecursiveSequence = 0;
  3846. }
  3847. }
  3848. !vm.$options.isReserved && tree.push(vm);
  3849. vm = vm.$parent;
  3850. }
  3851. return '\n\nfound in\n\n' + tree
  3852. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  3853. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  3854. : formatComponentName(vm))); })
  3855. .join('\n')
  3856. } else {
  3857. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  3858. }
  3859. };
  3860. }
  3861. /* */
  3862. var uid = 0;
  3863. /**
  3864. * A dep is an observable that can have multiple
  3865. * directives subscribing to it.
  3866. */
  3867. var Dep = function Dep () {
  3868. this.id = uid++;
  3869. this.subs = [];
  3870. };
  3871. Dep.prototype.addSub = function addSub (sub) {
  3872. this.subs.push(sub);
  3873. };
  3874. Dep.prototype.removeSub = function removeSub (sub) {
  3875. remove(this.subs, sub);
  3876. };
  3877. Dep.prototype.depend = function depend () {
  3878. if (Dep.SharedObject.target) {
  3879. Dep.SharedObject.target.addDep(this);
  3880. }
  3881. };
  3882. Dep.prototype.notify = function notify () {
  3883. // stabilize the subscriber list first
  3884. var subs = this.subs.slice();
  3885. if ( true && !config.async) {
  3886. // subs aren't sorted in scheduler if not running async
  3887. // we need to sort them now to make sure they fire in correct
  3888. // order
  3889. subs.sort(function (a, b) { return a.id - b.id; });
  3890. }
  3891. for (var i = 0, l = subs.length; i < l; i++) {
  3892. subs[i].update();
  3893. }
  3894. };
  3895. // The current target watcher being evaluated.
  3896. // This is globally unique because only one watcher
  3897. // can be evaluated at a time.
  3898. // fixed by xxxxxx (nvue shared vuex)
  3899. /* eslint-disable no-undef */
  3900. Dep.SharedObject = {};
  3901. Dep.SharedObject.target = null;
  3902. Dep.SharedObject.targetStack = [];
  3903. function pushTarget (target) {
  3904. Dep.SharedObject.targetStack.push(target);
  3905. Dep.SharedObject.target = target;
  3906. Dep.target = target;
  3907. }
  3908. function popTarget () {
  3909. Dep.SharedObject.targetStack.pop();
  3910. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  3911. Dep.target = Dep.SharedObject.target;
  3912. }
  3913. /* */
  3914. var VNode = function VNode (
  3915. tag,
  3916. data,
  3917. children,
  3918. text,
  3919. elm,
  3920. context,
  3921. componentOptions,
  3922. asyncFactory
  3923. ) {
  3924. this.tag = tag;
  3925. this.data = data;
  3926. this.children = children;
  3927. this.text = text;
  3928. this.elm = elm;
  3929. this.ns = undefined;
  3930. this.context = context;
  3931. this.fnContext = undefined;
  3932. this.fnOptions = undefined;
  3933. this.fnScopeId = undefined;
  3934. this.key = data && data.key;
  3935. this.componentOptions = componentOptions;
  3936. this.componentInstance = undefined;
  3937. this.parent = undefined;
  3938. this.raw = false;
  3939. this.isStatic = false;
  3940. this.isRootInsert = true;
  3941. this.isComment = false;
  3942. this.isCloned = false;
  3943. this.isOnce = false;
  3944. this.asyncFactory = asyncFactory;
  3945. this.asyncMeta = undefined;
  3946. this.isAsyncPlaceholder = false;
  3947. };
  3948. var prototypeAccessors = { child: { configurable: true } };
  3949. // DEPRECATED: alias for componentInstance for backwards compat.
  3950. /* istanbul ignore next */
  3951. prototypeAccessors.child.get = function () {
  3952. return this.componentInstance
  3953. };
  3954. Object.defineProperties( VNode.prototype, prototypeAccessors );
  3955. var createEmptyVNode = function (text) {
  3956. if ( text === void 0 ) text = '';
  3957. var node = new VNode();
  3958. node.text = text;
  3959. node.isComment = true;
  3960. return node
  3961. };
  3962. function createTextVNode (val) {
  3963. return new VNode(undefined, undefined, undefined, String(val))
  3964. }
  3965. // optimized shallow clone
  3966. // used for static nodes and slot nodes because they may be reused across
  3967. // multiple renders, cloning them avoids errors when DOM manipulations rely
  3968. // on their elm reference.
  3969. function cloneVNode (vnode) {
  3970. var cloned = new VNode(
  3971. vnode.tag,
  3972. vnode.data,
  3973. // #7975
  3974. // clone children array to avoid mutating original in case of cloning
  3975. // a child.
  3976. vnode.children && vnode.children.slice(),
  3977. vnode.text,
  3978. vnode.elm,
  3979. vnode.context,
  3980. vnode.componentOptions,
  3981. vnode.asyncFactory
  3982. );
  3983. cloned.ns = vnode.ns;
  3984. cloned.isStatic = vnode.isStatic;
  3985. cloned.key = vnode.key;
  3986. cloned.isComment = vnode.isComment;
  3987. cloned.fnContext = vnode.fnContext;
  3988. cloned.fnOptions = vnode.fnOptions;
  3989. cloned.fnScopeId = vnode.fnScopeId;
  3990. cloned.asyncMeta = vnode.asyncMeta;
  3991. cloned.isCloned = true;
  3992. return cloned
  3993. }
  3994. /*
  3995. * not type checking this file because flow doesn't play well with
  3996. * dynamically accessing methods on Array prototype
  3997. */
  3998. var arrayProto = Array.prototype;
  3999. var arrayMethods = Object.create(arrayProto);
  4000. var methodsToPatch = [
  4001. 'push',
  4002. 'pop',
  4003. 'shift',
  4004. 'unshift',
  4005. 'splice',
  4006. 'sort',
  4007. 'reverse'
  4008. ];
  4009. /**
  4010. * Intercept mutating methods and emit events
  4011. */
  4012. methodsToPatch.forEach(function (method) {
  4013. // cache original method
  4014. var original = arrayProto[method];
  4015. def(arrayMethods, method, function mutator () {
  4016. var args = [], len = arguments.length;
  4017. while ( len-- ) args[ len ] = arguments[ len ];
  4018. var result = original.apply(this, args);
  4019. var ob = this.__ob__;
  4020. var inserted;
  4021. switch (method) {
  4022. case 'push':
  4023. case 'unshift':
  4024. inserted = args;
  4025. break
  4026. case 'splice':
  4027. inserted = args.slice(2);
  4028. break
  4029. }
  4030. if (inserted) { ob.observeArray(inserted); }
  4031. // notify change
  4032. ob.dep.notify();
  4033. return result
  4034. });
  4035. });
  4036. /* */
  4037. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  4038. /**
  4039. * In some cases we may want to disable observation inside a component's
  4040. * update computation.
  4041. */
  4042. var shouldObserve = true;
  4043. function toggleObserving (value) {
  4044. shouldObserve = value;
  4045. }
  4046. /**
  4047. * Observer class that is attached to each observed
  4048. * object. Once attached, the observer converts the target
  4049. * object's property keys into getter/setters that
  4050. * collect dependencies and dispatch updates.
  4051. */
  4052. var Observer = function Observer (value) {
  4053. this.value = value;
  4054. this.dep = new Dep();
  4055. this.vmCount = 0;
  4056. def(value, '__ob__', this);
  4057. if (Array.isArray(value)) {
  4058. if (hasProto) {
  4059. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  4060. if(value.push !== value.__proto__.push){
  4061. copyAugment(value, arrayMethods, arrayKeys);
  4062. } else {
  4063. protoAugment(value, arrayMethods);
  4064. }
  4065. }
  4066. } else {
  4067. copyAugment(value, arrayMethods, arrayKeys);
  4068. }
  4069. this.observeArray(value);
  4070. } else {
  4071. this.walk(value);
  4072. }
  4073. };
  4074. /**
  4075. * Walk through all properties and convert them into
  4076. * getter/setters. This method should only be called when
  4077. * value type is Object.
  4078. */
  4079. Observer.prototype.walk = function walk (obj) {
  4080. var keys = Object.keys(obj);
  4081. for (var i = 0; i < keys.length; i++) {
  4082. defineReactive$$1(obj, keys[i]);
  4083. }
  4084. };
  4085. /**
  4086. * Observe a list of Array items.
  4087. */
  4088. Observer.prototype.observeArray = function observeArray (items) {
  4089. for (var i = 0, l = items.length; i < l; i++) {
  4090. observe(items[i]);
  4091. }
  4092. };
  4093. // helpers
  4094. /**
  4095. * Augment a target Object or Array by intercepting
  4096. * the prototype chain using __proto__
  4097. */
  4098. function protoAugment (target, src) {
  4099. /* eslint-disable no-proto */
  4100. target.__proto__ = src;
  4101. /* eslint-enable no-proto */
  4102. }
  4103. /**
  4104. * Augment a target Object or Array by defining
  4105. * hidden properties.
  4106. */
  4107. /* istanbul ignore next */
  4108. function copyAugment (target, src, keys) {
  4109. for (var i = 0, l = keys.length; i < l; i++) {
  4110. var key = keys[i];
  4111. def(target, key, src[key]);
  4112. }
  4113. }
  4114. /**
  4115. * Attempt to create an observer instance for a value,
  4116. * returns the new observer if successfully observed,
  4117. * or the existing observer if the value already has one.
  4118. */
  4119. function observe (value, asRootData) {
  4120. if (!isObject(value) || value instanceof VNode) {
  4121. return
  4122. }
  4123. var ob;
  4124. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  4125. ob = value.__ob__;
  4126. } else if (
  4127. shouldObserve &&
  4128. !isServerRendering() &&
  4129. (Array.isArray(value) || isPlainObject(value)) &&
  4130. Object.isExtensible(value) &&
  4131. !value._isVue &&
  4132. !value.__v_isMPComponent
  4133. ) {
  4134. ob = new Observer(value);
  4135. }
  4136. if (asRootData && ob) {
  4137. ob.vmCount++;
  4138. }
  4139. return ob
  4140. }
  4141. /**
  4142. * Define a reactive property on an Object.
  4143. */
  4144. function defineReactive$$1 (
  4145. obj,
  4146. key,
  4147. val,
  4148. customSetter,
  4149. shallow
  4150. ) {
  4151. var dep = new Dep();
  4152. var property = Object.getOwnPropertyDescriptor(obj, key);
  4153. if (property && property.configurable === false) {
  4154. return
  4155. }
  4156. // cater for pre-defined getter/setters
  4157. var getter = property && property.get;
  4158. var setter = property && property.set;
  4159. if ((!getter || setter) && arguments.length === 2) {
  4160. val = obj[key];
  4161. }
  4162. var childOb = !shallow && observe(val);
  4163. Object.defineProperty(obj, key, {
  4164. enumerable: true,
  4165. configurable: true,
  4166. get: function reactiveGetter () {
  4167. var value = getter ? getter.call(obj) : val;
  4168. if (Dep.SharedObject.target) { // fixed by xxxxxx
  4169. dep.depend();
  4170. if (childOb) {
  4171. childOb.dep.depend();
  4172. if (Array.isArray(value)) {
  4173. dependArray(value);
  4174. }
  4175. }
  4176. }
  4177. return value
  4178. },
  4179. set: function reactiveSetter (newVal) {
  4180. var value = getter ? getter.call(obj) : val;
  4181. /* eslint-disable no-self-compare */
  4182. if (newVal === value || (newVal !== newVal && value !== value)) {
  4183. return
  4184. }
  4185. /* eslint-enable no-self-compare */
  4186. if ( true && customSetter) {
  4187. customSetter();
  4188. }
  4189. // #7981: for accessor properties without setter
  4190. if (getter && !setter) { return }
  4191. if (setter) {
  4192. setter.call(obj, newVal);
  4193. } else {
  4194. val = newVal;
  4195. }
  4196. childOb = !shallow && observe(newVal);
  4197. dep.notify();
  4198. }
  4199. });
  4200. }
  4201. /**
  4202. * Set a property on an object. Adds the new property and
  4203. * triggers change notification if the property doesn't
  4204. * already exist.
  4205. */
  4206. function set (target, key, val) {
  4207. if ( true &&
  4208. (isUndef(target) || isPrimitive(target))
  4209. ) {
  4210. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  4211. }
  4212. if (Array.isArray(target) && isValidArrayIndex(key)) {
  4213. target.length = Math.max(target.length, key);
  4214. target.splice(key, 1, val);
  4215. return val
  4216. }
  4217. if (key in target && !(key in Object.prototype)) {
  4218. target[key] = val;
  4219. return val
  4220. }
  4221. var ob = (target).__ob__;
  4222. if (target._isVue || (ob && ob.vmCount)) {
  4223. true && warn(
  4224. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  4225. 'at runtime - declare it upfront in the data option.'
  4226. );
  4227. return val
  4228. }
  4229. if (!ob) {
  4230. target[key] = val;
  4231. return val
  4232. }
  4233. defineReactive$$1(ob.value, key, val);
  4234. ob.dep.notify();
  4235. return val
  4236. }
  4237. /**
  4238. * Delete a property and trigger change if necessary.
  4239. */
  4240. function del (target, key) {
  4241. if ( true &&
  4242. (isUndef(target) || isPrimitive(target))
  4243. ) {
  4244. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  4245. }
  4246. if (Array.isArray(target) && isValidArrayIndex(key)) {
  4247. target.splice(key, 1);
  4248. return
  4249. }
  4250. var ob = (target).__ob__;
  4251. if (target._isVue || (ob && ob.vmCount)) {
  4252. true && warn(
  4253. 'Avoid deleting properties on a Vue instance or its root $data ' +
  4254. '- just set it to null.'
  4255. );
  4256. return
  4257. }
  4258. if (!hasOwn(target, key)) {
  4259. return
  4260. }
  4261. delete target[key];
  4262. if (!ob) {
  4263. return
  4264. }
  4265. ob.dep.notify();
  4266. }
  4267. /**
  4268. * Collect dependencies on array elements when the array is touched, since
  4269. * we cannot intercept array element access like property getters.
  4270. */
  4271. function dependArray (value) {
  4272. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  4273. e = value[i];
  4274. e && e.__ob__ && e.__ob__.dep.depend();
  4275. if (Array.isArray(e)) {
  4276. dependArray(e);
  4277. }
  4278. }
  4279. }
  4280. /* */
  4281. /**
  4282. * Option overwriting strategies are functions that handle
  4283. * how to merge a parent option value and a child option
  4284. * value into the final value.
  4285. */
  4286. var strats = config.optionMergeStrategies;
  4287. /**
  4288. * Options with restrictions
  4289. */
  4290. if (true) {
  4291. strats.el = strats.propsData = function (parent, child, vm, key) {
  4292. if (!vm) {
  4293. warn(
  4294. "option \"" + key + "\" can only be used during instance " +
  4295. 'creation with the `new` keyword.'
  4296. );
  4297. }
  4298. return defaultStrat(parent, child)
  4299. };
  4300. }
  4301. /**
  4302. * Helper that recursively merges two data objects together.
  4303. */
  4304. function mergeData (to, from) {
  4305. if (!from) { return to }
  4306. var key, toVal, fromVal;
  4307. var keys = hasSymbol
  4308. ? Reflect.ownKeys(from)
  4309. : Object.keys(from);
  4310. for (var i = 0; i < keys.length; i++) {
  4311. key = keys[i];
  4312. // in case the object is already observed...
  4313. if (key === '__ob__') { continue }
  4314. toVal = to[key];
  4315. fromVal = from[key];
  4316. if (!hasOwn(to, key)) {
  4317. set(to, key, fromVal);
  4318. } else if (
  4319. toVal !== fromVal &&
  4320. isPlainObject(toVal) &&
  4321. isPlainObject(fromVal)
  4322. ) {
  4323. mergeData(toVal, fromVal);
  4324. }
  4325. }
  4326. return to
  4327. }
  4328. /**
  4329. * Data
  4330. */
  4331. function mergeDataOrFn (
  4332. parentVal,
  4333. childVal,
  4334. vm
  4335. ) {
  4336. if (!vm) {
  4337. // in a Vue.extend merge, both should be functions
  4338. if (!childVal) {
  4339. return parentVal
  4340. }
  4341. if (!parentVal) {
  4342. return childVal
  4343. }
  4344. // when parentVal & childVal are both present,
  4345. // we need to return a function that returns the
  4346. // merged result of both functions... no need to
  4347. // check if parentVal is a function here because
  4348. // it has to be a function to pass previous merges.
  4349. return function mergedDataFn () {
  4350. return mergeData(
  4351. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  4352. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  4353. )
  4354. }
  4355. } else {
  4356. return function mergedInstanceDataFn () {
  4357. // instance merge
  4358. var instanceData = typeof childVal === 'function'
  4359. ? childVal.call(vm, vm)
  4360. : childVal;
  4361. var defaultData = typeof parentVal === 'function'
  4362. ? parentVal.call(vm, vm)
  4363. : parentVal;
  4364. if (instanceData) {
  4365. return mergeData(instanceData, defaultData)
  4366. } else {
  4367. return defaultData
  4368. }
  4369. }
  4370. }
  4371. }
  4372. strats.data = function (
  4373. parentVal,
  4374. childVal,
  4375. vm
  4376. ) {
  4377. if (!vm) {
  4378. if (childVal && typeof childVal !== 'function') {
  4379. true && warn(
  4380. 'The "data" option should be a function ' +
  4381. 'that returns a per-instance value in component ' +
  4382. 'definitions.',
  4383. vm
  4384. );
  4385. return parentVal
  4386. }
  4387. return mergeDataOrFn(parentVal, childVal)
  4388. }
  4389. return mergeDataOrFn(parentVal, childVal, vm)
  4390. };
  4391. /**
  4392. * Hooks and props are merged as arrays.
  4393. */
  4394. function mergeHook (
  4395. parentVal,
  4396. childVal
  4397. ) {
  4398. var res = childVal
  4399. ? parentVal
  4400. ? parentVal.concat(childVal)
  4401. : Array.isArray(childVal)
  4402. ? childVal
  4403. : [childVal]
  4404. : parentVal;
  4405. return res
  4406. ? dedupeHooks(res)
  4407. : res
  4408. }
  4409. function dedupeHooks (hooks) {
  4410. var res = [];
  4411. for (var i = 0; i < hooks.length; i++) {
  4412. if (res.indexOf(hooks[i]) === -1) {
  4413. res.push(hooks[i]);
  4414. }
  4415. }
  4416. return res
  4417. }
  4418. LIFECYCLE_HOOKS.forEach(function (hook) {
  4419. strats[hook] = mergeHook;
  4420. });
  4421. /**
  4422. * Assets
  4423. *
  4424. * When a vm is present (instance creation), we need to do
  4425. * a three-way merge between constructor options, instance
  4426. * options and parent options.
  4427. */
  4428. function mergeAssets (
  4429. parentVal,
  4430. childVal,
  4431. vm,
  4432. key
  4433. ) {
  4434. var res = Object.create(parentVal || null);
  4435. if (childVal) {
  4436. true && assertObjectType(key, childVal, vm);
  4437. return extend(res, childVal)
  4438. } else {
  4439. return res
  4440. }
  4441. }
  4442. ASSET_TYPES.forEach(function (type) {
  4443. strats[type + 's'] = mergeAssets;
  4444. });
  4445. /**
  4446. * Watchers.
  4447. *
  4448. * Watchers hashes should not overwrite one
  4449. * another, so we merge them as arrays.
  4450. */
  4451. strats.watch = function (
  4452. parentVal,
  4453. childVal,
  4454. vm,
  4455. key
  4456. ) {
  4457. // work around Firefox's Object.prototype.watch...
  4458. if (parentVal === nativeWatch) { parentVal = undefined; }
  4459. if (childVal === nativeWatch) { childVal = undefined; }
  4460. /* istanbul ignore if */
  4461. if (!childVal) { return Object.create(parentVal || null) }
  4462. if (true) {
  4463. assertObjectType(key, childVal, vm);
  4464. }
  4465. if (!parentVal) { return childVal }
  4466. var ret = {};
  4467. extend(ret, parentVal);
  4468. for (var key$1 in childVal) {
  4469. var parent = ret[key$1];
  4470. var child = childVal[key$1];
  4471. if (parent && !Array.isArray(parent)) {
  4472. parent = [parent];
  4473. }
  4474. ret[key$1] = parent
  4475. ? parent.concat(child)
  4476. : Array.isArray(child) ? child : [child];
  4477. }
  4478. return ret
  4479. };
  4480. /**
  4481. * Other object hashes.
  4482. */
  4483. strats.props =
  4484. strats.methods =
  4485. strats.inject =
  4486. strats.computed = function (
  4487. parentVal,
  4488. childVal,
  4489. vm,
  4490. key
  4491. ) {
  4492. if (childVal && "development" !== 'production') {
  4493. assertObjectType(key, childVal, vm);
  4494. }
  4495. if (!parentVal) { return childVal }
  4496. var ret = Object.create(null);
  4497. extend(ret, parentVal);
  4498. if (childVal) { extend(ret, childVal); }
  4499. return ret
  4500. };
  4501. strats.provide = mergeDataOrFn;
  4502. /**
  4503. * Default strategy.
  4504. */
  4505. var defaultStrat = function (parentVal, childVal) {
  4506. return childVal === undefined
  4507. ? parentVal
  4508. : childVal
  4509. };
  4510. /**
  4511. * Validate component names
  4512. */
  4513. function checkComponents (options) {
  4514. for (var key in options.components) {
  4515. validateComponentName(key);
  4516. }
  4517. }
  4518. function validateComponentName (name) {
  4519. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  4520. warn(
  4521. 'Invalid component name: "' + name + '". Component names ' +
  4522. 'should conform to valid custom element name in html5 specification.'
  4523. );
  4524. }
  4525. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  4526. warn(
  4527. 'Do not use built-in or reserved HTML elements as component ' +
  4528. 'id: ' + name
  4529. );
  4530. }
  4531. }
  4532. /**
  4533. * Ensure all props option syntax are normalized into the
  4534. * Object-based format.
  4535. */
  4536. function normalizeProps (options, vm) {
  4537. var props = options.props;
  4538. if (!props) { return }
  4539. var res = {};
  4540. var i, val, name;
  4541. if (Array.isArray(props)) {
  4542. i = props.length;
  4543. while (i--) {
  4544. val = props[i];
  4545. if (typeof val === 'string') {
  4546. name = camelize(val);
  4547. res[name] = { type: null };
  4548. } else if (true) {
  4549. warn('props must be strings when using array syntax.');
  4550. }
  4551. }
  4552. } else if (isPlainObject(props)) {
  4553. for (var key in props) {
  4554. val = props[key];
  4555. name = camelize(key);
  4556. res[name] = isPlainObject(val)
  4557. ? val
  4558. : { type: val };
  4559. }
  4560. } else if (true) {
  4561. warn(
  4562. "Invalid value for option \"props\": expected an Array or an Object, " +
  4563. "but got " + (toRawType(props)) + ".",
  4564. vm
  4565. );
  4566. }
  4567. options.props = res;
  4568. }
  4569. /**
  4570. * Normalize all injections into Object-based format
  4571. */
  4572. function normalizeInject (options, vm) {
  4573. var inject = options.inject;
  4574. if (!inject) { return }
  4575. var normalized = options.inject = {};
  4576. if (Array.isArray(inject)) {
  4577. for (var i = 0; i < inject.length; i++) {
  4578. normalized[inject[i]] = { from: inject[i] };
  4579. }
  4580. } else if (isPlainObject(inject)) {
  4581. for (var key in inject) {
  4582. var val = inject[key];
  4583. normalized[key] = isPlainObject(val)
  4584. ? extend({ from: key }, val)
  4585. : { from: val };
  4586. }
  4587. } else if (true) {
  4588. warn(
  4589. "Invalid value for option \"inject\": expected an Array or an Object, " +
  4590. "but got " + (toRawType(inject)) + ".",
  4591. vm
  4592. );
  4593. }
  4594. }
  4595. /**
  4596. * Normalize raw function directives into object format.
  4597. */
  4598. function normalizeDirectives (options) {
  4599. var dirs = options.directives;
  4600. if (dirs) {
  4601. for (var key in dirs) {
  4602. var def$$1 = dirs[key];
  4603. if (typeof def$$1 === 'function') {
  4604. dirs[key] = { bind: def$$1, update: def$$1 };
  4605. }
  4606. }
  4607. }
  4608. }
  4609. function assertObjectType (name, value, vm) {
  4610. if (!isPlainObject(value)) {
  4611. warn(
  4612. "Invalid value for option \"" + name + "\": expected an Object, " +
  4613. "but got " + (toRawType(value)) + ".",
  4614. vm
  4615. );
  4616. }
  4617. }
  4618. /**
  4619. * Merge two option objects into a new one.
  4620. * Core utility used in both instantiation and inheritance.
  4621. */
  4622. function mergeOptions (
  4623. parent,
  4624. child,
  4625. vm
  4626. ) {
  4627. if (true) {
  4628. checkComponents(child);
  4629. }
  4630. if (typeof child === 'function') {
  4631. child = child.options;
  4632. }
  4633. normalizeProps(child, vm);
  4634. normalizeInject(child, vm);
  4635. normalizeDirectives(child);
  4636. // Apply extends and mixins on the child options,
  4637. // but only if it is a raw options object that isn't
  4638. // the result of another mergeOptions call.
  4639. // Only merged options has the _base property.
  4640. if (!child._base) {
  4641. if (child.extends) {
  4642. parent = mergeOptions(parent, child.extends, vm);
  4643. }
  4644. if (child.mixins) {
  4645. for (var i = 0, l = child.mixins.length; i < l; i++) {
  4646. parent = mergeOptions(parent, child.mixins[i], vm);
  4647. }
  4648. }
  4649. }
  4650. var options = {};
  4651. var key;
  4652. for (key in parent) {
  4653. mergeField(key);
  4654. }
  4655. for (key in child) {
  4656. if (!hasOwn(parent, key)) {
  4657. mergeField(key);
  4658. }
  4659. }
  4660. function mergeField (key) {
  4661. var strat = strats[key] || defaultStrat;
  4662. options[key] = strat(parent[key], child[key], vm, key);
  4663. }
  4664. return options
  4665. }
  4666. /**
  4667. * Resolve an asset.
  4668. * This function is used because child instances need access
  4669. * to assets defined in its ancestor chain.
  4670. */
  4671. function resolveAsset (
  4672. options,
  4673. type,
  4674. id,
  4675. warnMissing
  4676. ) {
  4677. /* istanbul ignore if */
  4678. if (typeof id !== 'string') {
  4679. return
  4680. }
  4681. var assets = options[type];
  4682. // check local registration variations first
  4683. if (hasOwn(assets, id)) { return assets[id] }
  4684. var camelizedId = camelize(id);
  4685. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  4686. var PascalCaseId = capitalize(camelizedId);
  4687. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  4688. // fallback to prototype chain
  4689. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  4690. if ( true && warnMissing && !res) {
  4691. warn(
  4692. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  4693. options
  4694. );
  4695. }
  4696. return res
  4697. }
  4698. /* */
  4699. function validateProp (
  4700. key,
  4701. propOptions,
  4702. propsData,
  4703. vm
  4704. ) {
  4705. var prop = propOptions[key];
  4706. var absent = !hasOwn(propsData, key);
  4707. var value = propsData[key];
  4708. // boolean casting
  4709. var booleanIndex = getTypeIndex(Boolean, prop.type);
  4710. if (booleanIndex > -1) {
  4711. if (absent && !hasOwn(prop, 'default')) {
  4712. value = false;
  4713. } else if (value === '' || value === hyphenate(key)) {
  4714. // only cast empty string / same name to boolean if
  4715. // boolean has higher priority
  4716. var stringIndex = getTypeIndex(String, prop.type);
  4717. if (stringIndex < 0 || booleanIndex < stringIndex) {
  4718. value = true;
  4719. }
  4720. }
  4721. }
  4722. // check default value
  4723. if (value === undefined) {
  4724. value = getPropDefaultValue(vm, prop, key);
  4725. // since the default value is a fresh copy,
  4726. // make sure to observe it.
  4727. var prevShouldObserve = shouldObserve;
  4728. toggleObserving(true);
  4729. observe(value);
  4730. toggleObserving(prevShouldObserve);
  4731. }
  4732. if (
  4733. true
  4734. ) {
  4735. assertProp(prop, key, value, vm, absent);
  4736. }
  4737. return value
  4738. }
  4739. /**
  4740. * Get the default value of a prop.
  4741. */
  4742. function getPropDefaultValue (vm, prop, key) {
  4743. // no default, return undefined
  4744. if (!hasOwn(prop, 'default')) {
  4745. return undefined
  4746. }
  4747. var def = prop.default;
  4748. // warn against non-factory defaults for Object & Array
  4749. if ( true && isObject(def)) {
  4750. warn(
  4751. 'Invalid default value for prop "' + key + '": ' +
  4752. 'Props with type Object/Array must use a factory function ' +
  4753. 'to return the default value.',
  4754. vm
  4755. );
  4756. }
  4757. // the raw prop value was also undefined from previous render,
  4758. // return previous default value to avoid unnecessary watcher trigger
  4759. if (vm && vm.$options.propsData &&
  4760. vm.$options.propsData[key] === undefined &&
  4761. vm._props[key] !== undefined
  4762. ) {
  4763. return vm._props[key]
  4764. }
  4765. // call factory function for non-Function types
  4766. // a value is Function if its prototype is function even across different execution context
  4767. return typeof def === 'function' && getType(prop.type) !== 'Function'
  4768. ? def.call(vm)
  4769. : def
  4770. }
  4771. /**
  4772. * Assert whether a prop is valid.
  4773. */
  4774. function assertProp (
  4775. prop,
  4776. name,
  4777. value,
  4778. vm,
  4779. absent
  4780. ) {
  4781. if (prop.required && absent) {
  4782. warn(
  4783. 'Missing required prop: "' + name + '"',
  4784. vm
  4785. );
  4786. return
  4787. }
  4788. if (value == null && !prop.required) {
  4789. return
  4790. }
  4791. var type = prop.type;
  4792. var valid = !type || type === true;
  4793. var expectedTypes = [];
  4794. if (type) {
  4795. if (!Array.isArray(type)) {
  4796. type = [type];
  4797. }
  4798. for (var i = 0; i < type.length && !valid; i++) {
  4799. var assertedType = assertType(value, type[i]);
  4800. expectedTypes.push(assertedType.expectedType || '');
  4801. valid = assertedType.valid;
  4802. }
  4803. }
  4804. if (!valid) {
  4805. warn(
  4806. getInvalidTypeMessage(name, value, expectedTypes),
  4807. vm
  4808. );
  4809. return
  4810. }
  4811. var validator = prop.validator;
  4812. if (validator) {
  4813. if (!validator(value)) {
  4814. warn(
  4815. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  4816. vm
  4817. );
  4818. }
  4819. }
  4820. }
  4821. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  4822. function assertType (value, type) {
  4823. var valid;
  4824. var expectedType = getType(type);
  4825. if (simpleCheckRE.test(expectedType)) {
  4826. var t = typeof value;
  4827. valid = t === expectedType.toLowerCase();
  4828. // for primitive wrapper objects
  4829. if (!valid && t === 'object') {
  4830. valid = value instanceof type;
  4831. }
  4832. } else if (expectedType === 'Object') {
  4833. valid = isPlainObject(value);
  4834. } else if (expectedType === 'Array') {
  4835. valid = Array.isArray(value);
  4836. } else {
  4837. valid = value instanceof type;
  4838. }
  4839. return {
  4840. valid: valid,
  4841. expectedType: expectedType
  4842. }
  4843. }
  4844. /**
  4845. * Use function string name to check built-in types,
  4846. * because a simple equality check will fail when running
  4847. * across different vms / iframes.
  4848. */
  4849. function getType (fn) {
  4850. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  4851. return match ? match[1] : ''
  4852. }
  4853. function isSameType (a, b) {
  4854. return getType(a) === getType(b)
  4855. }
  4856. function getTypeIndex (type, expectedTypes) {
  4857. if (!Array.isArray(expectedTypes)) {
  4858. return isSameType(expectedTypes, type) ? 0 : -1
  4859. }
  4860. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  4861. if (isSameType(expectedTypes[i], type)) {
  4862. return i
  4863. }
  4864. }
  4865. return -1
  4866. }
  4867. function getInvalidTypeMessage (name, value, expectedTypes) {
  4868. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  4869. " Expected " + (expectedTypes.map(capitalize).join(', '));
  4870. var expectedType = expectedTypes[0];
  4871. var receivedType = toRawType(value);
  4872. var expectedValue = styleValue(value, expectedType);
  4873. var receivedValue = styleValue(value, receivedType);
  4874. // check if we need to specify expected value
  4875. if (expectedTypes.length === 1 &&
  4876. isExplicable(expectedType) &&
  4877. !isBoolean(expectedType, receivedType)) {
  4878. message += " with value " + expectedValue;
  4879. }
  4880. message += ", got " + receivedType + " ";
  4881. // check if we need to specify received value
  4882. if (isExplicable(receivedType)) {
  4883. message += "with value " + receivedValue + ".";
  4884. }
  4885. return message
  4886. }
  4887. function styleValue (value, type) {
  4888. if (type === 'String') {
  4889. return ("\"" + value + "\"")
  4890. } else if (type === 'Number') {
  4891. return ("" + (Number(value)))
  4892. } else {
  4893. return ("" + value)
  4894. }
  4895. }
  4896. function isExplicable (value) {
  4897. var explicitTypes = ['string', 'number', 'boolean'];
  4898. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  4899. }
  4900. function isBoolean () {
  4901. var args = [], len = arguments.length;
  4902. while ( len-- ) args[ len ] = arguments[ len ];
  4903. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  4904. }
  4905. /* */
  4906. function handleError (err, vm, info) {
  4907. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  4908. // See: https://github.com/vuejs/vuex/issues/1505
  4909. pushTarget();
  4910. try {
  4911. if (vm) {
  4912. var cur = vm;
  4913. while ((cur = cur.$parent)) {
  4914. var hooks = cur.$options.errorCaptured;
  4915. if (hooks) {
  4916. for (var i = 0; i < hooks.length; i++) {
  4917. try {
  4918. var capture = hooks[i].call(cur, err, vm, info) === false;
  4919. if (capture) { return }
  4920. } catch (e) {
  4921. globalHandleError(e, cur, 'errorCaptured hook');
  4922. }
  4923. }
  4924. }
  4925. }
  4926. }
  4927. globalHandleError(err, vm, info);
  4928. } finally {
  4929. popTarget();
  4930. }
  4931. }
  4932. function invokeWithErrorHandling (
  4933. handler,
  4934. context,
  4935. args,
  4936. vm,
  4937. info
  4938. ) {
  4939. var res;
  4940. try {
  4941. res = args ? handler.apply(context, args) : handler.call(context);
  4942. if (res && !res._isVue && isPromise(res) && !res._handled) {
  4943. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  4944. // issue #9511
  4945. // avoid catch triggering multiple times when nested calls
  4946. res._handled = true;
  4947. }
  4948. } catch (e) {
  4949. handleError(e, vm, info);
  4950. }
  4951. return res
  4952. }
  4953. function globalHandleError (err, vm, info) {
  4954. if (config.errorHandler) {
  4955. try {
  4956. return config.errorHandler.call(null, err, vm, info)
  4957. } catch (e) {
  4958. // if the user intentionally throws the original error in the handler,
  4959. // do not log it twice
  4960. if (e !== err) {
  4961. logError(e, null, 'config.errorHandler');
  4962. }
  4963. }
  4964. }
  4965. logError(err, vm, info);
  4966. }
  4967. function logError (err, vm, info) {
  4968. if (true) {
  4969. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  4970. }
  4971. /* istanbul ignore else */
  4972. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  4973. console.error(err);
  4974. } else {
  4975. throw err
  4976. }
  4977. }
  4978. /* */
  4979. var callbacks = [];
  4980. var pending = false;
  4981. function flushCallbacks () {
  4982. pending = false;
  4983. var copies = callbacks.slice(0);
  4984. callbacks.length = 0;
  4985. for (var i = 0; i < copies.length; i++) {
  4986. copies[i]();
  4987. }
  4988. }
  4989. // Here we have async deferring wrappers using microtasks.
  4990. // In 2.5 we used (macro) tasks (in combination with microtasks).
  4991. // However, it has subtle problems when state is changed right before repaint
  4992. // (e.g. #6813, out-in transitions).
  4993. // Also, using (macro) tasks in event handler would cause some weird behaviors
  4994. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  4995. // So we now use microtasks everywhere, again.
  4996. // A major drawback of this tradeoff is that there are some scenarios
  4997. // where microtasks have too high a priority and fire in between supposedly
  4998. // sequential events (e.g. #4521, #6690, which have workarounds)
  4999. // or even between bubbling of the same event (#6566).
  5000. var timerFunc;
  5001. // The nextTick behavior leverages the microtask queue, which can be accessed
  5002. // via either native Promise.then or MutationObserver.
  5003. // MutationObserver has wider support, however it is seriously bugged in
  5004. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  5005. // completely stops working after triggering a few times... so, if native
  5006. // Promise is available, we will use it:
  5007. /* istanbul ignore next, $flow-disable-line */
  5008. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  5009. var p = Promise.resolve();
  5010. timerFunc = function () {
  5011. p.then(flushCallbacks);
  5012. // In problematic UIWebViews, Promise.then doesn't completely break, but
  5013. // it can get stuck in a weird state where callbacks are pushed into the
  5014. // microtask queue but the queue isn't being flushed, until the browser
  5015. // needs to do some other work, e.g. handle a timer. Therefore we can
  5016. // "force" the microtask queue to be flushed by adding an empty timer.
  5017. if (isIOS) { setTimeout(noop); }
  5018. };
  5019. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  5020. isNative(MutationObserver) ||
  5021. // PhantomJS and iOS 7.x
  5022. MutationObserver.toString() === '[object MutationObserverConstructor]'
  5023. )) {
  5024. // Use MutationObserver where native Promise is not available,
  5025. // e.g. PhantomJS, iOS7, Android 4.4
  5026. // (#6466 MutationObserver is unreliable in IE11)
  5027. var counter = 1;
  5028. var observer = new MutationObserver(flushCallbacks);
  5029. var textNode = document.createTextNode(String(counter));
  5030. observer.observe(textNode, {
  5031. characterData: true
  5032. });
  5033. timerFunc = function () {
  5034. counter = (counter + 1) % 2;
  5035. textNode.data = String(counter);
  5036. };
  5037. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  5038. // Fallback to setImmediate.
  5039. // Technically it leverages the (macro) task queue,
  5040. // but it is still a better choice than setTimeout.
  5041. timerFunc = function () {
  5042. setImmediate(flushCallbacks);
  5043. };
  5044. } else {
  5045. // Fallback to setTimeout.
  5046. timerFunc = function () {
  5047. setTimeout(flushCallbacks, 0);
  5048. };
  5049. }
  5050. function nextTick (cb, ctx) {
  5051. var _resolve;
  5052. callbacks.push(function () {
  5053. if (cb) {
  5054. try {
  5055. cb.call(ctx);
  5056. } catch (e) {
  5057. handleError(e, ctx, 'nextTick');
  5058. }
  5059. } else if (_resolve) {
  5060. _resolve(ctx);
  5061. }
  5062. });
  5063. if (!pending) {
  5064. pending = true;
  5065. timerFunc();
  5066. }
  5067. // $flow-disable-line
  5068. if (!cb && typeof Promise !== 'undefined') {
  5069. return new Promise(function (resolve) {
  5070. _resolve = resolve;
  5071. })
  5072. }
  5073. }
  5074. /* */
  5075. /* not type checking this file because flow doesn't play well with Proxy */
  5076. var initProxy;
  5077. if (true) {
  5078. var allowedGlobals = makeMap(
  5079. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  5080. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  5081. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  5082. 'require' // for Webpack/Browserify
  5083. );
  5084. var warnNonPresent = function (target, key) {
  5085. warn(
  5086. "Property or method \"" + key + "\" is not defined on the instance but " +
  5087. 'referenced during render. Make sure that this property is reactive, ' +
  5088. 'either in the data option, or for class-based components, by ' +
  5089. 'initializing the property. ' +
  5090. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  5091. target
  5092. );
  5093. };
  5094. var warnReservedPrefix = function (target, key) {
  5095. warn(
  5096. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  5097. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  5098. 'prevent conflicts with Vue internals. ' +
  5099. 'See: https://vuejs.org/v2/api/#data',
  5100. target
  5101. );
  5102. };
  5103. var hasProxy =
  5104. typeof Proxy !== 'undefined' && isNative(Proxy);
  5105. if (hasProxy) {
  5106. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  5107. config.keyCodes = new Proxy(config.keyCodes, {
  5108. set: function set (target, key, value) {
  5109. if (isBuiltInModifier(key)) {
  5110. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  5111. return false
  5112. } else {
  5113. target[key] = value;
  5114. return true
  5115. }
  5116. }
  5117. });
  5118. }
  5119. var hasHandler = {
  5120. has: function has (target, key) {
  5121. var has = key in target;
  5122. var isAllowed = allowedGlobals(key) ||
  5123. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  5124. if (!has && !isAllowed) {
  5125. if (key in target.$data) { warnReservedPrefix(target, key); }
  5126. else { warnNonPresent(target, key); }
  5127. }
  5128. return has || !isAllowed
  5129. }
  5130. };
  5131. var getHandler = {
  5132. get: function get (target, key) {
  5133. if (typeof key === 'string' && !(key in target)) {
  5134. if (key in target.$data) { warnReservedPrefix(target, key); }
  5135. else { warnNonPresent(target, key); }
  5136. }
  5137. return target[key]
  5138. }
  5139. };
  5140. initProxy = function initProxy (vm) {
  5141. if (hasProxy) {
  5142. // determine which proxy handler to use
  5143. var options = vm.$options;
  5144. var handlers = options.render && options.render._withStripped
  5145. ? getHandler
  5146. : hasHandler;
  5147. vm._renderProxy = new Proxy(vm, handlers);
  5148. } else {
  5149. vm._renderProxy = vm;
  5150. }
  5151. };
  5152. }
  5153. /* */
  5154. var seenObjects = new _Set();
  5155. /**
  5156. * Recursively traverse an object to evoke all converted
  5157. * getters, so that every nested property inside the object
  5158. * is collected as a "deep" dependency.
  5159. */
  5160. function traverse (val) {
  5161. _traverse(val, seenObjects);
  5162. seenObjects.clear();
  5163. }
  5164. function _traverse (val, seen) {
  5165. var i, keys;
  5166. var isA = Array.isArray(val);
  5167. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  5168. return
  5169. }
  5170. if (val.__ob__) {
  5171. var depId = val.__ob__.dep.id;
  5172. if (seen.has(depId)) {
  5173. return
  5174. }
  5175. seen.add(depId);
  5176. }
  5177. if (isA) {
  5178. i = val.length;
  5179. while (i--) { _traverse(val[i], seen); }
  5180. } else {
  5181. keys = Object.keys(val);
  5182. i = keys.length;
  5183. while (i--) { _traverse(val[keys[i]], seen); }
  5184. }
  5185. }
  5186. var mark;
  5187. var measure;
  5188. if (true) {
  5189. var perf = inBrowser && window.performance;
  5190. /* istanbul ignore if */
  5191. if (
  5192. perf &&
  5193. perf.mark &&
  5194. perf.measure &&
  5195. perf.clearMarks &&
  5196. perf.clearMeasures
  5197. ) {
  5198. mark = function (tag) { return perf.mark(tag); };
  5199. measure = function (name, startTag, endTag) {
  5200. perf.measure(name, startTag, endTag);
  5201. perf.clearMarks(startTag);
  5202. perf.clearMarks(endTag);
  5203. // perf.clearMeasures(name)
  5204. };
  5205. }
  5206. }
  5207. /* */
  5208. var normalizeEvent = cached(function (name) {
  5209. var passive = name.charAt(0) === '&';
  5210. name = passive ? name.slice(1) : name;
  5211. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  5212. name = once$$1 ? name.slice(1) : name;
  5213. var capture = name.charAt(0) === '!';
  5214. name = capture ? name.slice(1) : name;
  5215. return {
  5216. name: name,
  5217. once: once$$1,
  5218. capture: capture,
  5219. passive: passive
  5220. }
  5221. });
  5222. function createFnInvoker (fns, vm) {
  5223. function invoker () {
  5224. var arguments$1 = arguments;
  5225. var fns = invoker.fns;
  5226. if (Array.isArray(fns)) {
  5227. var cloned = fns.slice();
  5228. for (var i = 0; i < cloned.length; i++) {
  5229. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  5230. }
  5231. } else {
  5232. // return handler return value for single handlers
  5233. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  5234. }
  5235. }
  5236. invoker.fns = fns;
  5237. return invoker
  5238. }
  5239. function updateListeners (
  5240. on,
  5241. oldOn,
  5242. add,
  5243. remove$$1,
  5244. createOnceHandler,
  5245. vm
  5246. ) {
  5247. var name, def$$1, cur, old, event;
  5248. for (name in on) {
  5249. def$$1 = cur = on[name];
  5250. old = oldOn[name];
  5251. event = normalizeEvent(name);
  5252. if (isUndef(cur)) {
  5253. true && warn(
  5254. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  5255. vm
  5256. );
  5257. } else if (isUndef(old)) {
  5258. if (isUndef(cur.fns)) {
  5259. cur = on[name] = createFnInvoker(cur, vm);
  5260. }
  5261. if (isTrue(event.once)) {
  5262. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  5263. }
  5264. add(event.name, cur, event.capture, event.passive, event.params);
  5265. } else if (cur !== old) {
  5266. old.fns = cur;
  5267. on[name] = old;
  5268. }
  5269. }
  5270. for (name in oldOn) {
  5271. if (isUndef(on[name])) {
  5272. event = normalizeEvent(name);
  5273. remove$$1(event.name, oldOn[name], event.capture);
  5274. }
  5275. }
  5276. }
  5277. /* */
  5278. /* */
  5279. // fixed by xxxxxx (mp properties)
  5280. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  5281. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  5282. if (isUndef(propOptions)) {
  5283. return res
  5284. }
  5285. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  5286. var attrs = data.attrs;
  5287. var props = data.props;
  5288. if (isDef(attrs) || isDef(props)) {
  5289. for (var key in propOptions) {
  5290. var altKey = hyphenate(key);
  5291. var result = checkProp(res, props, key, altKey, true) ||
  5292. checkProp(res, attrs, key, altKey, false);
  5293. // externalClass
  5294. if (
  5295. result &&
  5296. res[key] &&
  5297. externalClasses.indexOf(altKey) !== -1 &&
  5298. context[camelize(res[key])]
  5299. ) {
  5300. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  5301. res[key] = context[camelize(res[key])];
  5302. }
  5303. }
  5304. }
  5305. return res
  5306. }
  5307. function extractPropsFromVNodeData (
  5308. data,
  5309. Ctor,
  5310. tag,
  5311. context// fixed by xxxxxx
  5312. ) {
  5313. // we are only extracting raw values here.
  5314. // validation and default values are handled in the child
  5315. // component itself.
  5316. var propOptions = Ctor.options.props;
  5317. if (isUndef(propOptions)) {
  5318. // fixed by xxxxxx
  5319. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  5320. }
  5321. var res = {};
  5322. var attrs = data.attrs;
  5323. var props = data.props;
  5324. if (isDef(attrs) || isDef(props)) {
  5325. for (var key in propOptions) {
  5326. var altKey = hyphenate(key);
  5327. if (true) {
  5328. var keyInLowerCase = key.toLowerCase();
  5329. if (
  5330. key !== keyInLowerCase &&
  5331. attrs && hasOwn(attrs, keyInLowerCase)
  5332. ) {
  5333. tip(
  5334. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  5335. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  5336. " \"" + key + "\". " +
  5337. "Note that HTML attributes are case-insensitive and camelCased " +
  5338. "props need to use their kebab-case equivalents when using in-DOM " +
  5339. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  5340. );
  5341. }
  5342. }
  5343. checkProp(res, props, key, altKey, true) ||
  5344. checkProp(res, attrs, key, altKey, false);
  5345. }
  5346. }
  5347. // fixed by xxxxxx
  5348. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  5349. }
  5350. function checkProp (
  5351. res,
  5352. hash,
  5353. key,
  5354. altKey,
  5355. preserve
  5356. ) {
  5357. if (isDef(hash)) {
  5358. if (hasOwn(hash, key)) {
  5359. res[key] = hash[key];
  5360. if (!preserve) {
  5361. delete hash[key];
  5362. }
  5363. return true
  5364. } else if (hasOwn(hash, altKey)) {
  5365. res[key] = hash[altKey];
  5366. if (!preserve) {
  5367. delete hash[altKey];
  5368. }
  5369. return true
  5370. }
  5371. }
  5372. return false
  5373. }
  5374. /* */
  5375. // The template compiler attempts to minimize the need for normalization by
  5376. // statically analyzing the template at compile time.
  5377. //
  5378. // For plain HTML markup, normalization can be completely skipped because the
  5379. // generated render function is guaranteed to return Array<VNode>. There are
  5380. // two cases where extra normalization is needed:
  5381. // 1. When the children contains components - because a functional component
  5382. // may return an Array instead of a single root. In this case, just a simple
  5383. // normalization is needed - if any child is an Array, we flatten the whole
  5384. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  5385. // because functional components already normalize their own children.
  5386. function simpleNormalizeChildren (children) {
  5387. for (var i = 0; i < children.length; i++) {
  5388. if (Array.isArray(children[i])) {
  5389. return Array.prototype.concat.apply([], children)
  5390. }
  5391. }
  5392. return children
  5393. }
  5394. // 2. When the children contains constructs that always generated nested Arrays,
  5395. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  5396. // with hand-written render functions / JSX. In such cases a full normalization
  5397. // is needed to cater to all possible types of children values.
  5398. function normalizeChildren (children) {
  5399. return isPrimitive(children)
  5400. ? [createTextVNode(children)]
  5401. : Array.isArray(children)
  5402. ? normalizeArrayChildren(children)
  5403. : undefined
  5404. }
  5405. function isTextNode (node) {
  5406. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  5407. }
  5408. function normalizeArrayChildren (children, nestedIndex) {
  5409. var res = [];
  5410. var i, c, lastIndex, last;
  5411. for (i = 0; i < children.length; i++) {
  5412. c = children[i];
  5413. if (isUndef(c) || typeof c === 'boolean') { continue }
  5414. lastIndex = res.length - 1;
  5415. last = res[lastIndex];
  5416. // nested
  5417. if (Array.isArray(c)) {
  5418. if (c.length > 0) {
  5419. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  5420. // merge adjacent text nodes
  5421. if (isTextNode(c[0]) && isTextNode(last)) {
  5422. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  5423. c.shift();
  5424. }
  5425. res.push.apply(res, c);
  5426. }
  5427. } else if (isPrimitive(c)) {
  5428. if (isTextNode(last)) {
  5429. // merge adjacent text nodes
  5430. // this is necessary for SSR hydration because text nodes are
  5431. // essentially merged when rendered to HTML strings
  5432. res[lastIndex] = createTextVNode(last.text + c);
  5433. } else if (c !== '') {
  5434. // convert primitive to vnode
  5435. res.push(createTextVNode(c));
  5436. }
  5437. } else {
  5438. if (isTextNode(c) && isTextNode(last)) {
  5439. // merge adjacent text nodes
  5440. res[lastIndex] = createTextVNode(last.text + c.text);
  5441. } else {
  5442. // default key for nested array children (likely generated by v-for)
  5443. if (isTrue(children._isVList) &&
  5444. isDef(c.tag) &&
  5445. isUndef(c.key) &&
  5446. isDef(nestedIndex)) {
  5447. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  5448. }
  5449. res.push(c);
  5450. }
  5451. }
  5452. }
  5453. return res
  5454. }
  5455. /* */
  5456. function initProvide (vm) {
  5457. var provide = vm.$options.provide;
  5458. if (provide) {
  5459. vm._provided = typeof provide === 'function'
  5460. ? provide.call(vm)
  5461. : provide;
  5462. }
  5463. }
  5464. function initInjections (vm) {
  5465. var result = resolveInject(vm.$options.inject, vm);
  5466. if (result) {
  5467. toggleObserving(false);
  5468. Object.keys(result).forEach(function (key) {
  5469. /* istanbul ignore else */
  5470. if (true) {
  5471. defineReactive$$1(vm, key, result[key], function () {
  5472. warn(
  5473. "Avoid mutating an injected value directly since the changes will be " +
  5474. "overwritten whenever the provided component re-renders. " +
  5475. "injection being mutated: \"" + key + "\"",
  5476. vm
  5477. );
  5478. });
  5479. } else {}
  5480. });
  5481. toggleObserving(true);
  5482. }
  5483. }
  5484. function resolveInject (inject, vm) {
  5485. if (inject) {
  5486. // inject is :any because flow is not smart enough to figure out cached
  5487. var result = Object.create(null);
  5488. var keys = hasSymbol
  5489. ? Reflect.ownKeys(inject)
  5490. : Object.keys(inject);
  5491. for (var i = 0; i < keys.length; i++) {
  5492. var key = keys[i];
  5493. // #6574 in case the inject object is observed...
  5494. if (key === '__ob__') { continue }
  5495. var provideKey = inject[key].from;
  5496. var source = vm;
  5497. while (source) {
  5498. if (source._provided && hasOwn(source._provided, provideKey)) {
  5499. result[key] = source._provided[provideKey];
  5500. break
  5501. }
  5502. source = source.$parent;
  5503. }
  5504. if (!source) {
  5505. if ('default' in inject[key]) {
  5506. var provideDefault = inject[key].default;
  5507. result[key] = typeof provideDefault === 'function'
  5508. ? provideDefault.call(vm)
  5509. : provideDefault;
  5510. } else if (true) {
  5511. warn(("Injection \"" + key + "\" not found"), vm);
  5512. }
  5513. }
  5514. }
  5515. return result
  5516. }
  5517. }
  5518. /* */
  5519. /**
  5520. * Runtime helper for resolving raw children VNodes into a slot object.
  5521. */
  5522. function resolveSlots (
  5523. children,
  5524. context
  5525. ) {
  5526. if (!children || !children.length) {
  5527. return {}
  5528. }
  5529. var slots = {};
  5530. for (var i = 0, l = children.length; i < l; i++) {
  5531. var child = children[i];
  5532. var data = child.data;
  5533. // remove slot attribute if the node is resolved as a Vue slot node
  5534. if (data && data.attrs && data.attrs.slot) {
  5535. delete data.attrs.slot;
  5536. }
  5537. // named slots should only be respected if the vnode was rendered in the
  5538. // same context.
  5539. if ((child.context === context || child.fnContext === context) &&
  5540. data && data.slot != null
  5541. ) {
  5542. var name = data.slot;
  5543. var slot = (slots[name] || (slots[name] = []));
  5544. if (child.tag === 'template') {
  5545. slot.push.apply(slot, child.children || []);
  5546. } else {
  5547. slot.push(child);
  5548. }
  5549. } else {
  5550. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  5551. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  5552. (slots['page'] || (slots['page'] = [])).push(child);
  5553. }else{
  5554. (slots.default || (slots.default = [])).push(child);
  5555. }
  5556. }
  5557. }
  5558. // ignore slots that contains only whitespace
  5559. for (var name$1 in slots) {
  5560. if (slots[name$1].every(isWhitespace)) {
  5561. delete slots[name$1];
  5562. }
  5563. }
  5564. return slots
  5565. }
  5566. function isWhitespace (node) {
  5567. return (node.isComment && !node.asyncFactory) || node.text === ' '
  5568. }
  5569. /* */
  5570. function normalizeScopedSlots (
  5571. slots,
  5572. normalSlots,
  5573. prevSlots
  5574. ) {
  5575. var res;
  5576. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  5577. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  5578. var key = slots && slots.$key;
  5579. if (!slots) {
  5580. res = {};
  5581. } else if (slots._normalized) {
  5582. // fast path 1: child component re-render only, parent did not change
  5583. return slots._normalized
  5584. } else if (
  5585. isStable &&
  5586. prevSlots &&
  5587. prevSlots !== emptyObject &&
  5588. key === prevSlots.$key &&
  5589. !hasNormalSlots &&
  5590. !prevSlots.$hasNormal
  5591. ) {
  5592. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  5593. // only need to normalize once
  5594. return prevSlots
  5595. } else {
  5596. res = {};
  5597. for (var key$1 in slots) {
  5598. if (slots[key$1] && key$1[0] !== '$') {
  5599. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  5600. }
  5601. }
  5602. }
  5603. // expose normal slots on scopedSlots
  5604. for (var key$2 in normalSlots) {
  5605. if (!(key$2 in res)) {
  5606. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  5607. }
  5608. }
  5609. // avoriaz seems to mock a non-extensible $scopedSlots object
  5610. // and when that is passed down this would cause an error
  5611. if (slots && Object.isExtensible(slots)) {
  5612. (slots)._normalized = res;
  5613. }
  5614. def(res, '$stable', isStable);
  5615. def(res, '$key', key);
  5616. def(res, '$hasNormal', hasNormalSlots);
  5617. return res
  5618. }
  5619. function normalizeScopedSlot(normalSlots, key, fn) {
  5620. var normalized = function () {
  5621. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  5622. res = res && typeof res === 'object' && !Array.isArray(res)
  5623. ? [res] // single vnode
  5624. : normalizeChildren(res);
  5625. return res && (
  5626. res.length === 0 ||
  5627. (res.length === 1 && res[0].isComment) // #9658
  5628. ) ? undefined
  5629. : res
  5630. };
  5631. // this is a slot using the new v-slot syntax without scope. although it is
  5632. // compiled as a scoped slot, render fn users would expect it to be present
  5633. // on this.$slots because the usage is semantically a normal slot.
  5634. if (fn.proxy) {
  5635. Object.defineProperty(normalSlots, key, {
  5636. get: normalized,
  5637. enumerable: true,
  5638. configurable: true
  5639. });
  5640. }
  5641. return normalized
  5642. }
  5643. function proxyNormalSlot(slots, key) {
  5644. return function () { return slots[key]; }
  5645. }
  5646. /* */
  5647. /**
  5648. * Runtime helper for rendering v-for lists.
  5649. */
  5650. function renderList (
  5651. val,
  5652. render
  5653. ) {
  5654. var ret, i, l, keys, key;
  5655. if (Array.isArray(val) || typeof val === 'string') {
  5656. ret = new Array(val.length);
  5657. for (i = 0, l = val.length; i < l; i++) {
  5658. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  5659. }
  5660. } else if (typeof val === 'number') {
  5661. ret = new Array(val);
  5662. for (i = 0; i < val; i++) {
  5663. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  5664. }
  5665. } else if (isObject(val)) {
  5666. if (hasSymbol && val[Symbol.iterator]) {
  5667. ret = [];
  5668. var iterator = val[Symbol.iterator]();
  5669. var result = iterator.next();
  5670. while (!result.done) {
  5671. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  5672. result = iterator.next();
  5673. }
  5674. } else {
  5675. keys = Object.keys(val);
  5676. ret = new Array(keys.length);
  5677. for (i = 0, l = keys.length; i < l; i++) {
  5678. key = keys[i];
  5679. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  5680. }
  5681. }
  5682. }
  5683. if (!isDef(ret)) {
  5684. ret = [];
  5685. }
  5686. (ret)._isVList = true;
  5687. return ret
  5688. }
  5689. /* */
  5690. /**
  5691. * Runtime helper for rendering <slot>
  5692. */
  5693. function renderSlot (
  5694. name,
  5695. fallback,
  5696. props,
  5697. bindObject
  5698. ) {
  5699. var scopedSlotFn = this.$scopedSlots[name];
  5700. var nodes;
  5701. if (scopedSlotFn) { // scoped slot
  5702. props = props || {};
  5703. if (bindObject) {
  5704. if ( true && !isObject(bindObject)) {
  5705. warn(
  5706. 'slot v-bind without argument expects an Object',
  5707. this
  5708. );
  5709. }
  5710. props = extend(extend({}, bindObject), props);
  5711. }
  5712. // fixed by xxxxxx app-plus scopedSlot
  5713. nodes = scopedSlotFn(props, this, props._i) || fallback;
  5714. } else {
  5715. nodes = this.$slots[name] || fallback;
  5716. }
  5717. var target = props && props.slot;
  5718. if (target) {
  5719. return this.$createElement('template', { slot: target }, nodes)
  5720. } else {
  5721. return nodes
  5722. }
  5723. }
  5724. /* */
  5725. /**
  5726. * Runtime helper for resolving filters
  5727. */
  5728. function resolveFilter (id) {
  5729. return resolveAsset(this.$options, 'filters', id, true) || identity
  5730. }
  5731. /* */
  5732. function isKeyNotMatch (expect, actual) {
  5733. if (Array.isArray(expect)) {
  5734. return expect.indexOf(actual) === -1
  5735. } else {
  5736. return expect !== actual
  5737. }
  5738. }
  5739. /**
  5740. * Runtime helper for checking keyCodes from config.
  5741. * exposed as Vue.prototype._k
  5742. * passing in eventKeyName as last argument separately for backwards compat
  5743. */
  5744. function checkKeyCodes (
  5745. eventKeyCode,
  5746. key,
  5747. builtInKeyCode,
  5748. eventKeyName,
  5749. builtInKeyName
  5750. ) {
  5751. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  5752. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  5753. return isKeyNotMatch(builtInKeyName, eventKeyName)
  5754. } else if (mappedKeyCode) {
  5755. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  5756. } else if (eventKeyName) {
  5757. return hyphenate(eventKeyName) !== key
  5758. }
  5759. }
  5760. /* */
  5761. /**
  5762. * Runtime helper for merging v-bind="object" into a VNode's data.
  5763. */
  5764. function bindObjectProps (
  5765. data,
  5766. tag,
  5767. value,
  5768. asProp,
  5769. isSync
  5770. ) {
  5771. if (value) {
  5772. if (!isObject(value)) {
  5773. true && warn(
  5774. 'v-bind without argument expects an Object or Array value',
  5775. this
  5776. );
  5777. } else {
  5778. if (Array.isArray(value)) {
  5779. value = toObject(value);
  5780. }
  5781. var hash;
  5782. var loop = function ( key ) {
  5783. if (
  5784. key === 'class' ||
  5785. key === 'style' ||
  5786. isReservedAttribute(key)
  5787. ) {
  5788. hash = data;
  5789. } else {
  5790. var type = data.attrs && data.attrs.type;
  5791. hash = asProp || config.mustUseProp(tag, type, key)
  5792. ? data.domProps || (data.domProps = {})
  5793. : data.attrs || (data.attrs = {});
  5794. }
  5795. var camelizedKey = camelize(key);
  5796. var hyphenatedKey = hyphenate(key);
  5797. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  5798. hash[key] = value[key];
  5799. if (isSync) {
  5800. var on = data.on || (data.on = {});
  5801. on[("update:" + key)] = function ($event) {
  5802. value[key] = $event;
  5803. };
  5804. }
  5805. }
  5806. };
  5807. for (var key in value) loop( key );
  5808. }
  5809. }
  5810. return data
  5811. }
  5812. /* */
  5813. /**
  5814. * Runtime helper for rendering static trees.
  5815. */
  5816. function renderStatic (
  5817. index,
  5818. isInFor
  5819. ) {
  5820. var cached = this._staticTrees || (this._staticTrees = []);
  5821. var tree = cached[index];
  5822. // if has already-rendered static tree and not inside v-for,
  5823. // we can reuse the same tree.
  5824. if (tree && !isInFor) {
  5825. return tree
  5826. }
  5827. // otherwise, render a fresh tree.
  5828. tree = cached[index] = this.$options.staticRenderFns[index].call(
  5829. this._renderProxy,
  5830. null,
  5831. this // for render fns generated for functional component templates
  5832. );
  5833. markStatic(tree, ("__static__" + index), false);
  5834. return tree
  5835. }
  5836. /**
  5837. * Runtime helper for v-once.
  5838. * Effectively it means marking the node as static with a unique key.
  5839. */
  5840. function markOnce (
  5841. tree,
  5842. index,
  5843. key
  5844. ) {
  5845. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  5846. return tree
  5847. }
  5848. function markStatic (
  5849. tree,
  5850. key,
  5851. isOnce
  5852. ) {
  5853. if (Array.isArray(tree)) {
  5854. for (var i = 0; i < tree.length; i++) {
  5855. if (tree[i] && typeof tree[i] !== 'string') {
  5856. markStaticNode(tree[i], (key + "_" + i), isOnce);
  5857. }
  5858. }
  5859. } else {
  5860. markStaticNode(tree, key, isOnce);
  5861. }
  5862. }
  5863. function markStaticNode (node, key, isOnce) {
  5864. node.isStatic = true;
  5865. node.key = key;
  5866. node.isOnce = isOnce;
  5867. }
  5868. /* */
  5869. function bindObjectListeners (data, value) {
  5870. if (value) {
  5871. if (!isPlainObject(value)) {
  5872. true && warn(
  5873. 'v-on without argument expects an Object value',
  5874. this
  5875. );
  5876. } else {
  5877. var on = data.on = data.on ? extend({}, data.on) : {};
  5878. for (var key in value) {
  5879. var existing = on[key];
  5880. var ours = value[key];
  5881. on[key] = existing ? [].concat(existing, ours) : ours;
  5882. }
  5883. }
  5884. }
  5885. return data
  5886. }
  5887. /* */
  5888. function resolveScopedSlots (
  5889. fns, // see flow/vnode
  5890. res,
  5891. // the following are added in 2.6
  5892. hasDynamicKeys,
  5893. contentHashKey
  5894. ) {
  5895. res = res || { $stable: !hasDynamicKeys };
  5896. for (var i = 0; i < fns.length; i++) {
  5897. var slot = fns[i];
  5898. if (Array.isArray(slot)) {
  5899. resolveScopedSlots(slot, res, hasDynamicKeys);
  5900. } else if (slot) {
  5901. // marker for reverse proxying v-slot without scope on this.$slots
  5902. if (slot.proxy) {
  5903. slot.fn.proxy = true;
  5904. }
  5905. res[slot.key] = slot.fn;
  5906. }
  5907. }
  5908. if (contentHashKey) {
  5909. (res).$key = contentHashKey;
  5910. }
  5911. return res
  5912. }
  5913. /* */
  5914. function bindDynamicKeys (baseObj, values) {
  5915. for (var i = 0; i < values.length; i += 2) {
  5916. var key = values[i];
  5917. if (typeof key === 'string' && key) {
  5918. baseObj[values[i]] = values[i + 1];
  5919. } else if ( true && key !== '' && key !== null) {
  5920. // null is a special value for explicitly removing a binding
  5921. warn(
  5922. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  5923. this
  5924. );
  5925. }
  5926. }
  5927. return baseObj
  5928. }
  5929. // helper to dynamically append modifier runtime markers to event names.
  5930. // ensure only append when value is already string, otherwise it will be cast
  5931. // to string and cause the type check to miss.
  5932. function prependModifier (value, symbol) {
  5933. return typeof value === 'string' ? symbol + value : value
  5934. }
  5935. /* */
  5936. function installRenderHelpers (target) {
  5937. target._o = markOnce;
  5938. target._n = toNumber;
  5939. target._s = toString;
  5940. target._l = renderList;
  5941. target._t = renderSlot;
  5942. target._q = looseEqual;
  5943. target._i = looseIndexOf;
  5944. target._m = renderStatic;
  5945. target._f = resolveFilter;
  5946. target._k = checkKeyCodes;
  5947. target._b = bindObjectProps;
  5948. target._v = createTextVNode;
  5949. target._e = createEmptyVNode;
  5950. target._u = resolveScopedSlots;
  5951. target._g = bindObjectListeners;
  5952. target._d = bindDynamicKeys;
  5953. target._p = prependModifier;
  5954. }
  5955. /* */
  5956. function FunctionalRenderContext (
  5957. data,
  5958. props,
  5959. children,
  5960. parent,
  5961. Ctor
  5962. ) {
  5963. var this$1 = this;
  5964. var options = Ctor.options;
  5965. // ensure the createElement function in functional components
  5966. // gets a unique context - this is necessary for correct named slot check
  5967. var contextVm;
  5968. if (hasOwn(parent, '_uid')) {
  5969. contextVm = Object.create(parent);
  5970. // $flow-disable-line
  5971. contextVm._original = parent;
  5972. } else {
  5973. // the context vm passed in is a functional context as well.
  5974. // in this case we want to make sure we are able to get a hold to the
  5975. // real context instance.
  5976. contextVm = parent;
  5977. // $flow-disable-line
  5978. parent = parent._original;
  5979. }
  5980. var isCompiled = isTrue(options._compiled);
  5981. var needNormalization = !isCompiled;
  5982. this.data = data;
  5983. this.props = props;
  5984. this.children = children;
  5985. this.parent = parent;
  5986. this.listeners = data.on || emptyObject;
  5987. this.injections = resolveInject(options.inject, parent);
  5988. this.slots = function () {
  5989. if (!this$1.$slots) {
  5990. normalizeScopedSlots(
  5991. data.scopedSlots,
  5992. this$1.$slots = resolveSlots(children, parent)
  5993. );
  5994. }
  5995. return this$1.$slots
  5996. };
  5997. Object.defineProperty(this, 'scopedSlots', ({
  5998. enumerable: true,
  5999. get: function get () {
  6000. return normalizeScopedSlots(data.scopedSlots, this.slots())
  6001. }
  6002. }));
  6003. // support for compiled functional template
  6004. if (isCompiled) {
  6005. // exposing $options for renderStatic()
  6006. this.$options = options;
  6007. // pre-resolve slots for renderSlot()
  6008. this.$slots = this.slots();
  6009. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  6010. }
  6011. if (options._scopeId) {
  6012. this._c = function (a, b, c, d) {
  6013. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  6014. if (vnode && !Array.isArray(vnode)) {
  6015. vnode.fnScopeId = options._scopeId;
  6016. vnode.fnContext = parent;
  6017. }
  6018. return vnode
  6019. };
  6020. } else {
  6021. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  6022. }
  6023. }
  6024. installRenderHelpers(FunctionalRenderContext.prototype);
  6025. function createFunctionalComponent (
  6026. Ctor,
  6027. propsData,
  6028. data,
  6029. contextVm,
  6030. children
  6031. ) {
  6032. var options = Ctor.options;
  6033. var props = {};
  6034. var propOptions = options.props;
  6035. if (isDef(propOptions)) {
  6036. for (var key in propOptions) {
  6037. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  6038. }
  6039. } else {
  6040. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  6041. if (isDef(data.props)) { mergeProps(props, data.props); }
  6042. }
  6043. var renderContext = new FunctionalRenderContext(
  6044. data,
  6045. props,
  6046. children,
  6047. contextVm,
  6048. Ctor
  6049. );
  6050. var vnode = options.render.call(null, renderContext._c, renderContext);
  6051. if (vnode instanceof VNode) {
  6052. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  6053. } else if (Array.isArray(vnode)) {
  6054. var vnodes = normalizeChildren(vnode) || [];
  6055. var res = new Array(vnodes.length);
  6056. for (var i = 0; i < vnodes.length; i++) {
  6057. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  6058. }
  6059. return res
  6060. }
  6061. }
  6062. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  6063. // #7817 clone node before setting fnContext, otherwise if the node is reused
  6064. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  6065. // that should not be matched to match.
  6066. var clone = cloneVNode(vnode);
  6067. clone.fnContext = contextVm;
  6068. clone.fnOptions = options;
  6069. if (true) {
  6070. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  6071. }
  6072. if (data.slot) {
  6073. (clone.data || (clone.data = {})).slot = data.slot;
  6074. }
  6075. return clone
  6076. }
  6077. function mergeProps (to, from) {
  6078. for (var key in from) {
  6079. to[camelize(key)] = from[key];
  6080. }
  6081. }
  6082. /* */
  6083. /* */
  6084. /* */
  6085. /* */
  6086. // inline hooks to be invoked on component VNodes during patch
  6087. var componentVNodeHooks = {
  6088. init: function init (vnode, hydrating) {
  6089. if (
  6090. vnode.componentInstance &&
  6091. !vnode.componentInstance._isDestroyed &&
  6092. vnode.data.keepAlive
  6093. ) {
  6094. // kept-alive components, treat as a patch
  6095. var mountedNode = vnode; // work around flow
  6096. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  6097. } else {
  6098. var child = vnode.componentInstance = createComponentInstanceForVnode(
  6099. vnode,
  6100. activeInstance
  6101. );
  6102. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  6103. }
  6104. },
  6105. prepatch: function prepatch (oldVnode, vnode) {
  6106. var options = vnode.componentOptions;
  6107. var child = vnode.componentInstance = oldVnode.componentInstance;
  6108. updateChildComponent(
  6109. child,
  6110. options.propsData, // updated props
  6111. options.listeners, // updated listeners
  6112. vnode, // new parent vnode
  6113. options.children // new children
  6114. );
  6115. },
  6116. insert: function insert (vnode) {
  6117. var context = vnode.context;
  6118. var componentInstance = vnode.componentInstance;
  6119. if (!componentInstance._isMounted) {
  6120. callHook(componentInstance, 'onServiceCreated');
  6121. callHook(componentInstance, 'onServiceAttached');
  6122. componentInstance._isMounted = true;
  6123. callHook(componentInstance, 'mounted');
  6124. }
  6125. if (vnode.data.keepAlive) {
  6126. if (context._isMounted) {
  6127. // vue-router#1212
  6128. // During updates, a kept-alive component's child components may
  6129. // change, so directly walking the tree here may call activated hooks
  6130. // on incorrect children. Instead we push them into a queue which will
  6131. // be processed after the whole patch process ended.
  6132. queueActivatedComponent(componentInstance);
  6133. } else {
  6134. activateChildComponent(componentInstance, true /* direct */);
  6135. }
  6136. }
  6137. },
  6138. destroy: function destroy (vnode) {
  6139. var componentInstance = vnode.componentInstance;
  6140. if (!componentInstance._isDestroyed) {
  6141. if (!vnode.data.keepAlive) {
  6142. componentInstance.$destroy();
  6143. } else {
  6144. deactivateChildComponent(componentInstance, true /* direct */);
  6145. }
  6146. }
  6147. }
  6148. };
  6149. var hooksToMerge = Object.keys(componentVNodeHooks);
  6150. function createComponent (
  6151. Ctor,
  6152. data,
  6153. context,
  6154. children,
  6155. tag
  6156. ) {
  6157. if (isUndef(Ctor)) {
  6158. return
  6159. }
  6160. var baseCtor = context.$options._base;
  6161. // plain options object: turn it into a constructor
  6162. if (isObject(Ctor)) {
  6163. Ctor = baseCtor.extend(Ctor);
  6164. }
  6165. // if at this stage it's not a constructor or an async component factory,
  6166. // reject.
  6167. if (typeof Ctor !== 'function') {
  6168. if (true) {
  6169. warn(("Invalid Component definition: " + (String(Ctor))), context);
  6170. }
  6171. return
  6172. }
  6173. // async component
  6174. var asyncFactory;
  6175. if (isUndef(Ctor.cid)) {
  6176. asyncFactory = Ctor;
  6177. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  6178. if (Ctor === undefined) {
  6179. // return a placeholder node for async component, which is rendered
  6180. // as a comment node but preserves all the raw information for the node.
  6181. // the information will be used for async server-rendering and hydration.
  6182. return createAsyncPlaceholder(
  6183. asyncFactory,
  6184. data,
  6185. context,
  6186. children,
  6187. tag
  6188. )
  6189. }
  6190. }
  6191. data = data || {};
  6192. // resolve constructor options in case global mixins are applied after
  6193. // component constructor creation
  6194. resolveConstructorOptions(Ctor);
  6195. // transform component v-model data into props & events
  6196. if (isDef(data.model)) {
  6197. transformModel(Ctor.options, data);
  6198. }
  6199. // extract props
  6200. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  6201. // functional component
  6202. if (isTrue(Ctor.options.functional)) {
  6203. return createFunctionalComponent(Ctor, propsData, data, context, children)
  6204. }
  6205. // extract listeners, since these needs to be treated as
  6206. // child component listeners instead of DOM listeners
  6207. var listeners = data.on;
  6208. // replace with listeners with .native modifier
  6209. // so it gets processed during parent component patch.
  6210. data.on = data.nativeOn;
  6211. if (isTrue(Ctor.options.abstract)) {
  6212. // abstract components do not keep anything
  6213. // other than props & listeners & slot
  6214. // work around flow
  6215. var slot = data.slot;
  6216. data = {};
  6217. if (slot) {
  6218. data.slot = slot;
  6219. }
  6220. }
  6221. // install component management hooks onto the placeholder node
  6222. installComponentHooks(data);
  6223. // return a placeholder vnode
  6224. var name = Ctor.options.name || tag;
  6225. var vnode = new VNode(
  6226. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  6227. data, undefined, undefined, undefined, context,
  6228. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  6229. asyncFactory
  6230. );
  6231. return vnode
  6232. }
  6233. function createComponentInstanceForVnode (
  6234. vnode, // we know it's MountedComponentVNode but flow doesn't
  6235. parent // activeInstance in lifecycle state
  6236. ) {
  6237. var options = {
  6238. _isComponent: true,
  6239. _parentVnode: vnode,
  6240. parent: parent
  6241. };
  6242. // check inline-template render functions
  6243. var inlineTemplate = vnode.data.inlineTemplate;
  6244. if (isDef(inlineTemplate)) {
  6245. options.render = inlineTemplate.render;
  6246. options.staticRenderFns = inlineTemplate.staticRenderFns;
  6247. }
  6248. return new vnode.componentOptions.Ctor(options)
  6249. }
  6250. function installComponentHooks (data) {
  6251. var hooks = data.hook || (data.hook = {});
  6252. for (var i = 0; i < hooksToMerge.length; i++) {
  6253. var key = hooksToMerge[i];
  6254. var existing = hooks[key];
  6255. var toMerge = componentVNodeHooks[key];
  6256. if (existing !== toMerge && !(existing && existing._merged)) {
  6257. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  6258. }
  6259. }
  6260. }
  6261. function mergeHook$1 (f1, f2) {
  6262. var merged = function (a, b) {
  6263. // flow complains about extra args which is why we use any
  6264. f1(a, b);
  6265. f2(a, b);
  6266. };
  6267. merged._merged = true;
  6268. return merged
  6269. }
  6270. // transform component v-model info (value and callback) into
  6271. // prop and event handler respectively.
  6272. function transformModel (options, data) {
  6273. var prop = (options.model && options.model.prop) || 'value';
  6274. var event = (options.model && options.model.event) || 'input'
  6275. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  6276. var on = data.on || (data.on = {});
  6277. var existing = on[event];
  6278. var callback = data.model.callback;
  6279. if (isDef(existing)) {
  6280. if (
  6281. Array.isArray(existing)
  6282. ? existing.indexOf(callback) === -1
  6283. : existing !== callback
  6284. ) {
  6285. on[event] = [callback].concat(existing);
  6286. }
  6287. } else {
  6288. on[event] = callback;
  6289. }
  6290. }
  6291. /* */
  6292. var SIMPLE_NORMALIZE = 1;
  6293. var ALWAYS_NORMALIZE = 2;
  6294. // wrapper function for providing a more flexible interface
  6295. // without getting yelled at by flow
  6296. function createElement (
  6297. context,
  6298. tag,
  6299. data,
  6300. children,
  6301. normalizationType,
  6302. alwaysNormalize
  6303. ) {
  6304. if (Array.isArray(data) || isPrimitive(data)) {
  6305. normalizationType = children;
  6306. children = data;
  6307. data = undefined;
  6308. }
  6309. if (isTrue(alwaysNormalize)) {
  6310. normalizationType = ALWAYS_NORMALIZE;
  6311. }
  6312. return _createElement(context, tag, data, children, normalizationType)
  6313. }
  6314. function _createElement (
  6315. context,
  6316. tag,
  6317. data,
  6318. children,
  6319. normalizationType
  6320. ) {
  6321. if (isDef(data) && isDef((data).__ob__)) {
  6322. true && warn(
  6323. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  6324. 'Always create fresh vnode data objects in each render!',
  6325. context
  6326. );
  6327. return createEmptyVNode()
  6328. }
  6329. // object syntax in v-bind
  6330. if (isDef(data) && isDef(data.is)) {
  6331. tag = data.is;
  6332. }
  6333. if (!tag) {
  6334. // in case of component :is set to falsy value
  6335. return createEmptyVNode()
  6336. }
  6337. // warn against non-primitive key
  6338. if ( true &&
  6339. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  6340. ) {
  6341. {
  6342. warn(
  6343. 'Avoid using non-primitive value as key, ' +
  6344. 'use string/number value instead.',
  6345. context
  6346. );
  6347. }
  6348. }
  6349. // support single function children as default scoped slot
  6350. if (Array.isArray(children) &&
  6351. typeof children[0] === 'function'
  6352. ) {
  6353. data = data || {};
  6354. data.scopedSlots = { default: children[0] };
  6355. children.length = 0;
  6356. }
  6357. if (normalizationType === ALWAYS_NORMALIZE) {
  6358. children = normalizeChildren(children);
  6359. } else if (normalizationType === SIMPLE_NORMALIZE) {
  6360. children = simpleNormalizeChildren(children);
  6361. }
  6362. var vnode, ns;
  6363. if (typeof tag === 'string') {
  6364. var Ctor;
  6365. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  6366. if (config.isReservedTag(tag)) {
  6367. // platform built-in elements
  6368. if ( true && isDef(data) && isDef(data.nativeOn)) {
  6369. warn(
  6370. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  6371. context
  6372. );
  6373. }
  6374. vnode = new VNode(
  6375. config.parsePlatformTagName(tag), data, children,
  6376. undefined, undefined, context
  6377. );
  6378. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  6379. // component
  6380. vnode = createComponent(Ctor, data, context, children, tag);
  6381. } else {
  6382. // unknown or unlisted namespaced elements
  6383. // check at runtime because it may get assigned a namespace when its
  6384. // parent normalizes children
  6385. vnode = new VNode(
  6386. tag, data, children,
  6387. undefined, undefined, context
  6388. );
  6389. }
  6390. } else {
  6391. // direct component options / constructor
  6392. vnode = createComponent(tag, data, context, children);
  6393. }
  6394. if (Array.isArray(vnode)) {
  6395. return vnode
  6396. } else if (isDef(vnode)) {
  6397. if (isDef(ns)) { applyNS(vnode, ns); }
  6398. if (isDef(data)) { registerDeepBindings(data); }
  6399. return vnode
  6400. } else {
  6401. return createEmptyVNode()
  6402. }
  6403. }
  6404. function applyNS (vnode, ns, force) {
  6405. vnode.ns = ns;
  6406. if (vnode.tag === 'foreignObject') {
  6407. // use default namespace inside foreignObject
  6408. ns = undefined;
  6409. force = true;
  6410. }
  6411. if (isDef(vnode.children)) {
  6412. for (var i = 0, l = vnode.children.length; i < l; i++) {
  6413. var child = vnode.children[i];
  6414. if (isDef(child.tag) && (
  6415. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  6416. applyNS(child, ns, force);
  6417. }
  6418. }
  6419. }
  6420. }
  6421. // ref #5318
  6422. // necessary to ensure parent re-render when deep bindings like :style and
  6423. // :class are used on slot nodes
  6424. function registerDeepBindings (data) {
  6425. if (isObject(data.style)) {
  6426. traverse(data.style);
  6427. }
  6428. if (isObject(data.class)) {
  6429. traverse(data.class);
  6430. }
  6431. }
  6432. /* */
  6433. function initRender (vm) {
  6434. vm._vnode = null; // the root of the child tree
  6435. vm._staticTrees = null; // v-once cached trees
  6436. var options = vm.$options;
  6437. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  6438. var renderContext = parentVnode && parentVnode.context;
  6439. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  6440. vm.$scopedSlots = emptyObject;
  6441. // bind the createElement fn to this instance
  6442. // so that we get proper render context inside it.
  6443. // args order: tag, data, children, normalizationType, alwaysNormalize
  6444. // internal version is used by render functions compiled from templates
  6445. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  6446. // normalization is always applied for the public version, used in
  6447. // user-written render functions.
  6448. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  6449. // $attrs & $listeners are exposed for easier HOC creation.
  6450. // they need to be reactive so that HOCs using them are always updated
  6451. var parentData = parentVnode && parentVnode.data;
  6452. /* istanbul ignore else */
  6453. if (true) {
  6454. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  6455. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  6456. }, true);
  6457. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  6458. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  6459. }, true);
  6460. } else {}
  6461. }
  6462. var currentRenderingInstance = null;
  6463. function renderMixin (Vue) {
  6464. // install runtime convenience helpers
  6465. installRenderHelpers(Vue.prototype);
  6466. Vue.prototype.$nextTick = function (fn) {
  6467. return nextTick(fn, this)
  6468. };
  6469. Vue.prototype._render = function () {
  6470. var vm = this;
  6471. var ref = vm.$options;
  6472. var render = ref.render;
  6473. var _parentVnode = ref._parentVnode;
  6474. if (_parentVnode) {
  6475. vm.$scopedSlots = normalizeScopedSlots(
  6476. _parentVnode.data.scopedSlots,
  6477. vm.$slots,
  6478. vm.$scopedSlots
  6479. );
  6480. }
  6481. // set parent vnode. this allows render functions to have access
  6482. // to the data on the placeholder node.
  6483. vm.$vnode = _parentVnode;
  6484. // render self
  6485. var vnode;
  6486. try {
  6487. // There's no need to maintain a stack because all render fns are called
  6488. // separately from one another. Nested component's render fns are called
  6489. // when parent component is patched.
  6490. currentRenderingInstance = vm;
  6491. vnode = render.call(vm._renderProxy, vm.$createElement);
  6492. } catch (e) {
  6493. handleError(e, vm, "render");
  6494. // return error render result,
  6495. // or previous vnode to prevent render error causing blank component
  6496. /* istanbul ignore else */
  6497. if ( true && vm.$options.renderError) {
  6498. try {
  6499. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  6500. } catch (e) {
  6501. handleError(e, vm, "renderError");
  6502. vnode = vm._vnode;
  6503. }
  6504. } else {
  6505. vnode = vm._vnode;
  6506. }
  6507. } finally {
  6508. currentRenderingInstance = null;
  6509. }
  6510. // if the returned array contains only a single node, allow it
  6511. if (Array.isArray(vnode) && vnode.length === 1) {
  6512. vnode = vnode[0];
  6513. }
  6514. // return empty vnode in case the render function errored out
  6515. if (!(vnode instanceof VNode)) {
  6516. if ( true && Array.isArray(vnode)) {
  6517. warn(
  6518. 'Multiple root nodes returned from render function. Render function ' +
  6519. 'should return a single root node.',
  6520. vm
  6521. );
  6522. }
  6523. vnode = createEmptyVNode();
  6524. }
  6525. // set parent
  6526. vnode.parent = _parentVnode;
  6527. return vnode
  6528. };
  6529. }
  6530. /* */
  6531. function ensureCtor (comp, base) {
  6532. if (
  6533. comp.__esModule ||
  6534. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  6535. ) {
  6536. comp = comp.default;
  6537. }
  6538. return isObject(comp)
  6539. ? base.extend(comp)
  6540. : comp
  6541. }
  6542. function createAsyncPlaceholder (
  6543. factory,
  6544. data,
  6545. context,
  6546. children,
  6547. tag
  6548. ) {
  6549. var node = createEmptyVNode();
  6550. node.asyncFactory = factory;
  6551. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  6552. return node
  6553. }
  6554. function resolveAsyncComponent (
  6555. factory,
  6556. baseCtor
  6557. ) {
  6558. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  6559. return factory.errorComp
  6560. }
  6561. if (isDef(factory.resolved)) {
  6562. return factory.resolved
  6563. }
  6564. var owner = currentRenderingInstance;
  6565. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  6566. // already pending
  6567. factory.owners.push(owner);
  6568. }
  6569. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  6570. return factory.loadingComp
  6571. }
  6572. if (owner && !isDef(factory.owners)) {
  6573. var owners = factory.owners = [owner];
  6574. var sync = true;
  6575. var timerLoading = null;
  6576. var timerTimeout = null
  6577. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  6578. var forceRender = function (renderCompleted) {
  6579. for (var i = 0, l = owners.length; i < l; i++) {
  6580. (owners[i]).$forceUpdate();
  6581. }
  6582. if (renderCompleted) {
  6583. owners.length = 0;
  6584. if (timerLoading !== null) {
  6585. clearTimeout(timerLoading);
  6586. timerLoading = null;
  6587. }
  6588. if (timerTimeout !== null) {
  6589. clearTimeout(timerTimeout);
  6590. timerTimeout = null;
  6591. }
  6592. }
  6593. };
  6594. var resolve = once(function (res) {
  6595. // cache resolved
  6596. factory.resolved = ensureCtor(res, baseCtor);
  6597. // invoke callbacks only if this is not a synchronous resolve
  6598. // (async resolves are shimmed as synchronous during SSR)
  6599. if (!sync) {
  6600. forceRender(true);
  6601. } else {
  6602. owners.length = 0;
  6603. }
  6604. });
  6605. var reject = once(function (reason) {
  6606. true && warn(
  6607. "Failed to resolve async component: " + (String(factory)) +
  6608. (reason ? ("\nReason: " + reason) : '')
  6609. );
  6610. if (isDef(factory.errorComp)) {
  6611. factory.error = true;
  6612. forceRender(true);
  6613. }
  6614. });
  6615. var res = factory(resolve, reject);
  6616. if (isObject(res)) {
  6617. if (isPromise(res)) {
  6618. // () => Promise
  6619. if (isUndef(factory.resolved)) {
  6620. res.then(resolve, reject);
  6621. }
  6622. } else if (isPromise(res.component)) {
  6623. res.component.then(resolve, reject);
  6624. if (isDef(res.error)) {
  6625. factory.errorComp = ensureCtor(res.error, baseCtor);
  6626. }
  6627. if (isDef(res.loading)) {
  6628. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  6629. if (res.delay === 0) {
  6630. factory.loading = true;
  6631. } else {
  6632. timerLoading = setTimeout(function () {
  6633. timerLoading = null;
  6634. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  6635. factory.loading = true;
  6636. forceRender(false);
  6637. }
  6638. }, res.delay || 200);
  6639. }
  6640. }
  6641. if (isDef(res.timeout)) {
  6642. timerTimeout = setTimeout(function () {
  6643. timerTimeout = null;
  6644. if (isUndef(factory.resolved)) {
  6645. reject(
  6646. true
  6647. ? ("timeout (" + (res.timeout) + "ms)")
  6648. : undefined
  6649. );
  6650. }
  6651. }, res.timeout);
  6652. }
  6653. }
  6654. }
  6655. sync = false;
  6656. // return in case resolved synchronously
  6657. return factory.loading
  6658. ? factory.loadingComp
  6659. : factory.resolved
  6660. }
  6661. }
  6662. /* */
  6663. function isAsyncPlaceholder (node) {
  6664. return node.isComment && node.asyncFactory
  6665. }
  6666. /* */
  6667. function getFirstComponentChild (children) {
  6668. if (Array.isArray(children)) {
  6669. for (var i = 0; i < children.length; i++) {
  6670. var c = children[i];
  6671. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  6672. return c
  6673. }
  6674. }
  6675. }
  6676. }
  6677. /* */
  6678. /* */
  6679. function initEvents (vm) {
  6680. vm._events = Object.create(null);
  6681. vm._hasHookEvent = false;
  6682. // init parent attached events
  6683. var listeners = vm.$options._parentListeners;
  6684. if (listeners) {
  6685. updateComponentListeners(vm, listeners);
  6686. }
  6687. }
  6688. var target;
  6689. function add (event, fn) {
  6690. target.$on(event, fn);
  6691. }
  6692. function remove$1 (event, fn) {
  6693. target.$off(event, fn);
  6694. }
  6695. function createOnceHandler (event, fn) {
  6696. var _target = target;
  6697. return function onceHandler () {
  6698. var res = fn.apply(null, arguments);
  6699. if (res !== null) {
  6700. _target.$off(event, onceHandler);
  6701. }
  6702. }
  6703. }
  6704. function updateComponentListeners (
  6705. vm,
  6706. listeners,
  6707. oldListeners
  6708. ) {
  6709. target = vm;
  6710. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  6711. target = undefined;
  6712. }
  6713. function eventsMixin (Vue) {
  6714. var hookRE = /^hook:/;
  6715. Vue.prototype.$on = function (event, fn) {
  6716. var vm = this;
  6717. if (Array.isArray(event)) {
  6718. for (var i = 0, l = event.length; i < l; i++) {
  6719. vm.$on(event[i], fn);
  6720. }
  6721. } else {
  6722. (vm._events[event] || (vm._events[event] = [])).push(fn);
  6723. // optimize hook:event cost by using a boolean flag marked at registration
  6724. // instead of a hash lookup
  6725. if (hookRE.test(event)) {
  6726. vm._hasHookEvent = true;
  6727. }
  6728. }
  6729. return vm
  6730. };
  6731. Vue.prototype.$once = function (event, fn) {
  6732. var vm = this;
  6733. function on () {
  6734. vm.$off(event, on);
  6735. fn.apply(vm, arguments);
  6736. }
  6737. on.fn = fn;
  6738. vm.$on(event, on);
  6739. return vm
  6740. };
  6741. Vue.prototype.$off = function (event, fn) {
  6742. var vm = this;
  6743. // all
  6744. if (!arguments.length) {
  6745. vm._events = Object.create(null);
  6746. return vm
  6747. }
  6748. // array of events
  6749. if (Array.isArray(event)) {
  6750. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  6751. vm.$off(event[i$1], fn);
  6752. }
  6753. return vm
  6754. }
  6755. // specific event
  6756. var cbs = vm._events[event];
  6757. if (!cbs) {
  6758. return vm
  6759. }
  6760. if (!fn) {
  6761. vm._events[event] = null;
  6762. return vm
  6763. }
  6764. // specific handler
  6765. var cb;
  6766. var i = cbs.length;
  6767. while (i--) {
  6768. cb = cbs[i];
  6769. if (cb === fn || cb.fn === fn) {
  6770. cbs.splice(i, 1);
  6771. break
  6772. }
  6773. }
  6774. return vm
  6775. };
  6776. Vue.prototype.$emit = function (event) {
  6777. var vm = this;
  6778. if (true) {
  6779. var lowerCaseEvent = event.toLowerCase();
  6780. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  6781. tip(
  6782. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  6783. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  6784. "Note that HTML attributes are case-insensitive and you cannot use " +
  6785. "v-on to listen to camelCase events when using in-DOM templates. " +
  6786. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  6787. );
  6788. }
  6789. }
  6790. var cbs = vm._events[event];
  6791. if (cbs) {
  6792. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  6793. var args = toArray(arguments, 1);
  6794. var info = "event handler for \"" + event + "\"";
  6795. for (var i = 0, l = cbs.length; i < l; i++) {
  6796. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  6797. }
  6798. }
  6799. return vm
  6800. };
  6801. }
  6802. /* */
  6803. var activeInstance = null;
  6804. var isUpdatingChildComponent = false;
  6805. function setActiveInstance(vm) {
  6806. var prevActiveInstance = activeInstance;
  6807. activeInstance = vm;
  6808. return function () {
  6809. activeInstance = prevActiveInstance;
  6810. }
  6811. }
  6812. function initLifecycle (vm) {
  6813. var options = vm.$options;
  6814. // locate first non-abstract parent
  6815. var parent = options.parent;
  6816. if (parent && !options.abstract) {
  6817. while (parent.$options.abstract && parent.$parent) {
  6818. parent = parent.$parent;
  6819. }
  6820. parent.$children.push(vm);
  6821. }
  6822. vm.$parent = parent;
  6823. vm.$root = parent ? parent.$root : vm;
  6824. vm.$children = [];
  6825. vm.$refs = {};
  6826. vm._watcher = null;
  6827. vm._inactive = null;
  6828. vm._directInactive = false;
  6829. vm._isMounted = false;
  6830. vm._isDestroyed = false;
  6831. vm._isBeingDestroyed = false;
  6832. }
  6833. function lifecycleMixin (Vue) {
  6834. Vue.prototype._update = function (vnode, hydrating) {
  6835. var vm = this;
  6836. var prevEl = vm.$el;
  6837. var prevVnode = vm._vnode;
  6838. var restoreActiveInstance = setActiveInstance(vm);
  6839. vm._vnode = vnode;
  6840. // Vue.prototype.__patch__ is injected in entry points
  6841. // based on the rendering backend used.
  6842. if (!prevVnode) {
  6843. // initial render
  6844. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  6845. } else {
  6846. // updates
  6847. vm.$el = vm.__patch__(prevVnode, vnode);
  6848. }
  6849. restoreActiveInstance();
  6850. // update __vue__ reference
  6851. if (prevEl) {
  6852. prevEl.__vue__ = null;
  6853. }
  6854. if (vm.$el) {
  6855. vm.$el.__vue__ = vm;
  6856. }
  6857. // if parent is an HOC, update its $el as well
  6858. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  6859. vm.$parent.$el = vm.$el;
  6860. }
  6861. // updated hook is called by the scheduler to ensure that children are
  6862. // updated in a parent's updated hook.
  6863. };
  6864. Vue.prototype.$forceUpdate = function () {
  6865. var vm = this;
  6866. if (vm._watcher) {
  6867. vm._watcher.update();
  6868. }
  6869. };
  6870. Vue.prototype.$destroy = function () {
  6871. var vm = this;
  6872. if (vm._isBeingDestroyed) {
  6873. return
  6874. }
  6875. callHook(vm, 'beforeDestroy');
  6876. vm._isBeingDestroyed = true;
  6877. // remove self from parent
  6878. var parent = vm.$parent;
  6879. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  6880. remove(parent.$children, vm);
  6881. }
  6882. // teardown watchers
  6883. if (vm._watcher) {
  6884. vm._watcher.teardown();
  6885. }
  6886. var i = vm._watchers.length;
  6887. while (i--) {
  6888. vm._watchers[i].teardown();
  6889. }
  6890. // remove reference from data ob
  6891. // frozen object may not have observer.
  6892. if (vm._data.__ob__) {
  6893. vm._data.__ob__.vmCount--;
  6894. }
  6895. // call the last hook...
  6896. vm._isDestroyed = true;
  6897. // invoke destroy hooks on current rendered tree
  6898. vm.__patch__(vm._vnode, null);
  6899. // fire destroyed hook
  6900. callHook(vm, 'destroyed');
  6901. // turn off all instance listeners.
  6902. vm.$off();
  6903. // remove __vue__ reference
  6904. if (vm.$el) {
  6905. vm.$el.__vue__ = null;
  6906. }
  6907. // release circular reference (#6759)
  6908. if (vm.$vnode) {
  6909. vm.$vnode.parent = null;
  6910. }
  6911. };
  6912. }
  6913. function updateChildComponent (
  6914. vm,
  6915. propsData,
  6916. listeners,
  6917. parentVnode,
  6918. renderChildren
  6919. ) {
  6920. if (true) {
  6921. isUpdatingChildComponent = true;
  6922. }
  6923. // determine whether component has slot children
  6924. // we need to do this before overwriting $options._renderChildren.
  6925. // check if there are dynamic scopedSlots (hand-written or compiled but with
  6926. // dynamic slot names). Static scoped slots compiled from template has the
  6927. // "$stable" marker.
  6928. var newScopedSlots = parentVnode.data.scopedSlots;
  6929. var oldScopedSlots = vm.$scopedSlots;
  6930. var hasDynamicScopedSlot = !!(
  6931. (newScopedSlots && !newScopedSlots.$stable) ||
  6932. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  6933. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  6934. );
  6935. // Any static slot children from the parent may have changed during parent's
  6936. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  6937. // update is necessary to ensure correctness.
  6938. var needsForceUpdate = !!(
  6939. renderChildren || // has new static slots
  6940. vm.$options._renderChildren || // has old static slots
  6941. hasDynamicScopedSlot
  6942. );
  6943. vm.$options._parentVnode = parentVnode;
  6944. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  6945. if (vm._vnode) { // update child tree's parent
  6946. vm._vnode.parent = parentVnode;
  6947. }
  6948. vm.$options._renderChildren = renderChildren;
  6949. // update $attrs and $listeners hash
  6950. // these are also reactive so they may trigger child update if the child
  6951. // used them during render
  6952. vm.$attrs = parentVnode.data.attrs || emptyObject;
  6953. vm.$listeners = listeners || emptyObject;
  6954. // update props
  6955. if (propsData && vm.$options.props) {
  6956. toggleObserving(false);
  6957. var props = vm._props;
  6958. var propKeys = vm.$options._propKeys || [];
  6959. for (var i = 0; i < propKeys.length; i++) {
  6960. var key = propKeys[i];
  6961. var propOptions = vm.$options.props; // wtf flow?
  6962. props[key] = validateProp(key, propOptions, propsData, vm);
  6963. }
  6964. toggleObserving(true);
  6965. // keep a copy of raw propsData
  6966. vm.$options.propsData = propsData;
  6967. }
  6968. // fixed by xxxxxx update properties(mp runtime)
  6969. vm._$updateProperties && vm._$updateProperties(vm);
  6970. // update listeners
  6971. listeners = listeners || emptyObject;
  6972. var oldListeners = vm.$options._parentListeners;
  6973. vm.$options._parentListeners = listeners;
  6974. updateComponentListeners(vm, listeners, oldListeners);
  6975. // resolve slots + force update if has children
  6976. if (needsForceUpdate) {
  6977. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  6978. vm.$forceUpdate();
  6979. }
  6980. if (true) {
  6981. isUpdatingChildComponent = false;
  6982. }
  6983. }
  6984. function isInInactiveTree (vm) {
  6985. while (vm && (vm = vm.$parent)) {
  6986. if (vm._inactive) { return true }
  6987. }
  6988. return false
  6989. }
  6990. function activateChildComponent (vm, direct) {
  6991. if (direct) {
  6992. vm._directInactive = false;
  6993. if (isInInactiveTree(vm)) {
  6994. return
  6995. }
  6996. } else if (vm._directInactive) {
  6997. return
  6998. }
  6999. if (vm._inactive || vm._inactive === null) {
  7000. vm._inactive = false;
  7001. for (var i = 0; i < vm.$children.length; i++) {
  7002. activateChildComponent(vm.$children[i]);
  7003. }
  7004. callHook(vm, 'activated');
  7005. }
  7006. }
  7007. function deactivateChildComponent (vm, direct) {
  7008. if (direct) {
  7009. vm._directInactive = true;
  7010. if (isInInactiveTree(vm)) {
  7011. return
  7012. }
  7013. }
  7014. if (!vm._inactive) {
  7015. vm._inactive = true;
  7016. for (var i = 0; i < vm.$children.length; i++) {
  7017. deactivateChildComponent(vm.$children[i]);
  7018. }
  7019. callHook(vm, 'deactivated');
  7020. }
  7021. }
  7022. function callHook (vm, hook) {
  7023. // #7573 disable dep collection when invoking lifecycle hooks
  7024. pushTarget();
  7025. var handlers = vm.$options[hook];
  7026. var info = hook + " hook";
  7027. if (handlers) {
  7028. for (var i = 0, j = handlers.length; i < j; i++) {
  7029. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  7030. }
  7031. }
  7032. if (vm._hasHookEvent) {
  7033. vm.$emit('hook:' + hook);
  7034. }
  7035. popTarget();
  7036. }
  7037. /* */
  7038. var MAX_UPDATE_COUNT = 100;
  7039. var queue = [];
  7040. var activatedChildren = [];
  7041. var has = {};
  7042. var circular = {};
  7043. var waiting = false;
  7044. var flushing = false;
  7045. var index = 0;
  7046. /**
  7047. * Reset the scheduler's state.
  7048. */
  7049. function resetSchedulerState () {
  7050. index = queue.length = activatedChildren.length = 0;
  7051. has = {};
  7052. if (true) {
  7053. circular = {};
  7054. }
  7055. waiting = flushing = false;
  7056. }
  7057. // Async edge case #6566 requires saving the timestamp when event listeners are
  7058. // attached. However, calling performance.now() has a perf overhead especially
  7059. // if the page has thousands of event listeners. Instead, we take a timestamp
  7060. // every time the scheduler flushes and use that for all event listeners
  7061. // attached during that flush.
  7062. var currentFlushTimestamp = 0;
  7063. // Async edge case fix requires storing an event listener's attach timestamp.
  7064. var getNow = Date.now;
  7065. // Determine what event timestamp the browser is using. Annoyingly, the
  7066. // timestamp can either be hi-res (relative to page load) or low-res
  7067. // (relative to UNIX epoch), so in order to compare time we have to use the
  7068. // same timestamp type when saving the flush timestamp.
  7069. // All IE versions use low-res event timestamps, and have problematic clock
  7070. // implementations (#9632)
  7071. if (inBrowser && !isIE) {
  7072. var performance = window.performance;
  7073. if (
  7074. performance &&
  7075. typeof performance.now === 'function' &&
  7076. getNow() > document.createEvent('Event').timeStamp
  7077. ) {
  7078. // if the event timestamp, although evaluated AFTER the Date.now(), is
  7079. // smaller than it, it means the event is using a hi-res timestamp,
  7080. // and we need to use the hi-res version for event listener timestamps as
  7081. // well.
  7082. getNow = function () { return performance.now(); };
  7083. }
  7084. }
  7085. /**
  7086. * Flush both queues and run the watchers.
  7087. */
  7088. function flushSchedulerQueue () {
  7089. currentFlushTimestamp = getNow();
  7090. flushing = true;
  7091. var watcher, id;
  7092. // Sort queue before flush.
  7093. // This ensures that:
  7094. // 1. Components are updated from parent to child. (because parent is always
  7095. // created before the child)
  7096. // 2. A component's user watchers are run before its render watcher (because
  7097. // user watchers are created before the render watcher)
  7098. // 3. If a component is destroyed during a parent component's watcher run,
  7099. // its watchers can be skipped.
  7100. queue.sort(function (a, b) { return a.id - b.id; });
  7101. // do not cache length because more watchers might be pushed
  7102. // as we run existing watchers
  7103. for (index = 0; index < queue.length; index++) {
  7104. watcher = queue[index];
  7105. if (watcher.before) {
  7106. watcher.before();
  7107. }
  7108. id = watcher.id;
  7109. has[id] = null;
  7110. watcher.run();
  7111. // in dev build, check and stop circular updates.
  7112. if ( true && has[id] != null) {
  7113. circular[id] = (circular[id] || 0) + 1;
  7114. if (circular[id] > MAX_UPDATE_COUNT) {
  7115. warn(
  7116. 'You may have an infinite update loop ' + (
  7117. watcher.user
  7118. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  7119. : "in a component render function."
  7120. ),
  7121. watcher.vm
  7122. );
  7123. break
  7124. }
  7125. }
  7126. }
  7127. // keep copies of post queues before resetting state
  7128. var activatedQueue = activatedChildren.slice();
  7129. var updatedQueue = queue.slice();
  7130. resetSchedulerState();
  7131. // call component updated and activated hooks
  7132. callActivatedHooks(activatedQueue);
  7133. callUpdatedHooks(updatedQueue);
  7134. // devtool hook
  7135. /* istanbul ignore if */
  7136. if (devtools && config.devtools) {
  7137. devtools.emit('flush');
  7138. }
  7139. }
  7140. function callUpdatedHooks (queue) {
  7141. var i = queue.length;
  7142. while (i--) {
  7143. var watcher = queue[i];
  7144. var vm = watcher.vm;
  7145. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  7146. callHook(vm, 'updated');
  7147. }
  7148. }
  7149. }
  7150. /**
  7151. * Queue a kept-alive component that was activated during patch.
  7152. * The queue will be processed after the entire tree has been patched.
  7153. */
  7154. function queueActivatedComponent (vm) {
  7155. // setting _inactive to false here so that a render function can
  7156. // rely on checking whether it's in an inactive tree (e.g. router-view)
  7157. vm._inactive = false;
  7158. activatedChildren.push(vm);
  7159. }
  7160. function callActivatedHooks (queue) {
  7161. for (var i = 0; i < queue.length; i++) {
  7162. queue[i]._inactive = true;
  7163. activateChildComponent(queue[i], true /* true */);
  7164. }
  7165. }
  7166. /**
  7167. * Push a watcher into the watcher queue.
  7168. * Jobs with duplicate IDs will be skipped unless it's
  7169. * pushed when the queue is being flushed.
  7170. */
  7171. function queueWatcher (watcher) {
  7172. var id = watcher.id;
  7173. if (has[id] == null) {
  7174. has[id] = true;
  7175. if (!flushing) {
  7176. queue.push(watcher);
  7177. } else {
  7178. // if already flushing, splice the watcher based on its id
  7179. // if already past its id, it will be run next immediately.
  7180. var i = queue.length - 1;
  7181. while (i > index && queue[i].id > watcher.id) {
  7182. i--;
  7183. }
  7184. queue.splice(i + 1, 0, watcher);
  7185. }
  7186. // queue the flush
  7187. if (!waiting) {
  7188. waiting = true;
  7189. if ( true && !config.async) {
  7190. flushSchedulerQueue();
  7191. return
  7192. }
  7193. nextTick(flushSchedulerQueue);
  7194. }
  7195. }
  7196. }
  7197. /* */
  7198. var uid$2 = 0;
  7199. /**
  7200. * A watcher parses an expression, collects dependencies,
  7201. * and fires callback when the expression value changes.
  7202. * This is used for both the $watch() api and directives.
  7203. */
  7204. var Watcher = function Watcher (
  7205. vm,
  7206. expOrFn,
  7207. cb,
  7208. options,
  7209. isRenderWatcher
  7210. ) {
  7211. this.vm = vm;
  7212. if (isRenderWatcher) {
  7213. vm._watcher = this;
  7214. }
  7215. vm._watchers.push(this);
  7216. // options
  7217. if (options) {
  7218. this.deep = !!options.deep;
  7219. this.user = !!options.user;
  7220. this.lazy = !!options.lazy;
  7221. this.sync = !!options.sync;
  7222. this.before = options.before;
  7223. } else {
  7224. this.deep = this.user = this.lazy = this.sync = false;
  7225. }
  7226. this.cb = cb;
  7227. this.id = ++uid$2; // uid for batching
  7228. this.active = true;
  7229. this.dirty = this.lazy; // for lazy watchers
  7230. this.deps = [];
  7231. this.newDeps = [];
  7232. this.depIds = new _Set();
  7233. this.newDepIds = new _Set();
  7234. this.expression = true
  7235. ? expOrFn.toString()
  7236. : undefined;
  7237. // parse expression for getter
  7238. if (typeof expOrFn === 'function') {
  7239. this.getter = expOrFn;
  7240. } else {
  7241. this.getter = parsePath(expOrFn);
  7242. if (!this.getter) {
  7243. this.getter = noop;
  7244. true && warn(
  7245. "Failed watching path: \"" + expOrFn + "\" " +
  7246. 'Watcher only accepts simple dot-delimited paths. ' +
  7247. 'For full control, use a function instead.',
  7248. vm
  7249. );
  7250. }
  7251. }
  7252. this.value = this.lazy
  7253. ? undefined
  7254. : this.get();
  7255. };
  7256. /**
  7257. * Evaluate the getter, and re-collect dependencies.
  7258. */
  7259. Watcher.prototype.get = function get () {
  7260. pushTarget(this);
  7261. var value;
  7262. var vm = this.vm;
  7263. try {
  7264. value = this.getter.call(vm, vm);
  7265. } catch (e) {
  7266. if (this.user) {
  7267. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  7268. } else {
  7269. throw e
  7270. }
  7271. } finally {
  7272. // "touch" every property so they are all tracked as
  7273. // dependencies for deep watching
  7274. if (this.deep) {
  7275. traverse(value);
  7276. }
  7277. popTarget();
  7278. this.cleanupDeps();
  7279. }
  7280. return value
  7281. };
  7282. /**
  7283. * Add a dependency to this directive.
  7284. */
  7285. Watcher.prototype.addDep = function addDep (dep) {
  7286. var id = dep.id;
  7287. if (!this.newDepIds.has(id)) {
  7288. this.newDepIds.add(id);
  7289. this.newDeps.push(dep);
  7290. if (!this.depIds.has(id)) {
  7291. dep.addSub(this);
  7292. }
  7293. }
  7294. };
  7295. /**
  7296. * Clean up for dependency collection.
  7297. */
  7298. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  7299. var i = this.deps.length;
  7300. while (i--) {
  7301. var dep = this.deps[i];
  7302. if (!this.newDepIds.has(dep.id)) {
  7303. dep.removeSub(this);
  7304. }
  7305. }
  7306. var tmp = this.depIds;
  7307. this.depIds = this.newDepIds;
  7308. this.newDepIds = tmp;
  7309. this.newDepIds.clear();
  7310. tmp = this.deps;
  7311. this.deps = this.newDeps;
  7312. this.newDeps = tmp;
  7313. this.newDeps.length = 0;
  7314. };
  7315. /**
  7316. * Subscriber interface.
  7317. * Will be called when a dependency changes.
  7318. */
  7319. Watcher.prototype.update = function update () {
  7320. /* istanbul ignore else */
  7321. if (this.lazy) {
  7322. this.dirty = true;
  7323. } else if (this.sync) {
  7324. this.run();
  7325. } else {
  7326. queueWatcher(this);
  7327. }
  7328. };
  7329. /**
  7330. * Scheduler job interface.
  7331. * Will be called by the scheduler.
  7332. */
  7333. Watcher.prototype.run = function run () {
  7334. if (this.active) {
  7335. var value = this.get();
  7336. if (
  7337. value !== this.value ||
  7338. // Deep watchers and watchers on Object/Arrays should fire even
  7339. // when the value is the same, because the value may
  7340. // have mutated.
  7341. isObject(value) ||
  7342. this.deep
  7343. ) {
  7344. // set new value
  7345. var oldValue = this.value;
  7346. this.value = value;
  7347. if (this.user) {
  7348. try {
  7349. this.cb.call(this.vm, value, oldValue);
  7350. } catch (e) {
  7351. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  7352. }
  7353. } else {
  7354. this.cb.call(this.vm, value, oldValue);
  7355. }
  7356. }
  7357. }
  7358. };
  7359. /**
  7360. * Evaluate the value of the watcher.
  7361. * This only gets called for lazy watchers.
  7362. */
  7363. Watcher.prototype.evaluate = function evaluate () {
  7364. this.value = this.get();
  7365. this.dirty = false;
  7366. };
  7367. /**
  7368. * Depend on all deps collected by this watcher.
  7369. */
  7370. Watcher.prototype.depend = function depend () {
  7371. var i = this.deps.length;
  7372. while (i--) {
  7373. this.deps[i].depend();
  7374. }
  7375. };
  7376. /**
  7377. * Remove self from all dependencies' subscriber list.
  7378. */
  7379. Watcher.prototype.teardown = function teardown () {
  7380. if (this.active) {
  7381. // remove self from vm's watcher list
  7382. // this is a somewhat expensive operation so we skip it
  7383. // if the vm is being destroyed.
  7384. if (!this.vm._isBeingDestroyed) {
  7385. remove(this.vm._watchers, this);
  7386. }
  7387. var i = this.deps.length;
  7388. while (i--) {
  7389. this.deps[i].removeSub(this);
  7390. }
  7391. this.active = false;
  7392. }
  7393. };
  7394. /* */
  7395. var sharedPropertyDefinition = {
  7396. enumerable: true,
  7397. configurable: true,
  7398. get: noop,
  7399. set: noop
  7400. };
  7401. function proxy (target, sourceKey, key) {
  7402. sharedPropertyDefinition.get = function proxyGetter () {
  7403. return this[sourceKey][key]
  7404. };
  7405. sharedPropertyDefinition.set = function proxySetter (val) {
  7406. this[sourceKey][key] = val;
  7407. };
  7408. Object.defineProperty(target, key, sharedPropertyDefinition);
  7409. }
  7410. function initState (vm) {
  7411. vm._watchers = [];
  7412. var opts = vm.$options;
  7413. if (opts.props) { initProps(vm, opts.props); }
  7414. if (opts.methods) { initMethods(vm, opts.methods); }
  7415. if (opts.data) {
  7416. initData(vm);
  7417. } else {
  7418. observe(vm._data = {}, true /* asRootData */);
  7419. }
  7420. if (opts.computed) { initComputed(vm, opts.computed); }
  7421. if (opts.watch && opts.watch !== nativeWatch) {
  7422. initWatch(vm, opts.watch);
  7423. }
  7424. }
  7425. function initProps (vm, propsOptions) {
  7426. var propsData = vm.$options.propsData || {};
  7427. var props = vm._props = {};
  7428. // cache prop keys so that future props updates can iterate using Array
  7429. // instead of dynamic object key enumeration.
  7430. var keys = vm.$options._propKeys = [];
  7431. var isRoot = !vm.$parent;
  7432. // root instance props should be converted
  7433. if (!isRoot) {
  7434. toggleObserving(false);
  7435. }
  7436. var loop = function ( key ) {
  7437. keys.push(key);
  7438. var value = validateProp(key, propsOptions, propsData, vm);
  7439. /* istanbul ignore else */
  7440. if (true) {
  7441. var hyphenatedKey = hyphenate(key);
  7442. if (isReservedAttribute(hyphenatedKey) ||
  7443. config.isReservedAttr(hyphenatedKey)) {
  7444. warn(
  7445. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  7446. vm
  7447. );
  7448. }
  7449. defineReactive$$1(props, key, value, function () {
  7450. if (!isRoot && !isUpdatingChildComponent) {
  7451. {
  7452. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou' || vm.mpHost === 'mp-xhs'){//百度、快手、小红书 observer 在 setData callback 之后触发,直接忽略该 warn
  7453. return
  7454. }
  7455. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  7456. if(
  7457. key === 'value' &&
  7458. Array.isArray(vm.$options.behaviors) &&
  7459. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  7460. ){
  7461. return
  7462. }
  7463. if(vm._getFormData){
  7464. return
  7465. }
  7466. var $parent = vm.$parent;
  7467. while($parent){
  7468. if($parent.__next_tick_pending){
  7469. return
  7470. }
  7471. $parent = $parent.$parent;
  7472. }
  7473. }
  7474. warn(
  7475. "Avoid mutating a prop directly since the value will be " +
  7476. "overwritten whenever the parent component re-renders. " +
  7477. "Instead, use a data or computed property based on the prop's " +
  7478. "value. Prop being mutated: \"" + key + "\"",
  7479. vm
  7480. );
  7481. }
  7482. });
  7483. } else {}
  7484. // static props are already proxied on the component's prototype
  7485. // during Vue.extend(). We only need to proxy props defined at
  7486. // instantiation here.
  7487. if (!(key in vm)) {
  7488. proxy(vm, "_props", key);
  7489. }
  7490. };
  7491. for (var key in propsOptions) loop( key );
  7492. toggleObserving(true);
  7493. }
  7494. function initData (vm) {
  7495. var data = vm.$options.data;
  7496. data = vm._data = typeof data === 'function'
  7497. ? getData(data, vm)
  7498. : data || {};
  7499. if (!isPlainObject(data)) {
  7500. data = {};
  7501. true && warn(
  7502. 'data functions should return an object:\n' +
  7503. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  7504. vm
  7505. );
  7506. }
  7507. // proxy data on instance
  7508. var keys = Object.keys(data);
  7509. var props = vm.$options.props;
  7510. var methods = vm.$options.methods;
  7511. var i = keys.length;
  7512. while (i--) {
  7513. var key = keys[i];
  7514. if (true) {
  7515. if (methods && hasOwn(methods, key)) {
  7516. warn(
  7517. ("Method \"" + key + "\" has already been defined as a data property."),
  7518. vm
  7519. );
  7520. }
  7521. }
  7522. if (props && hasOwn(props, key)) {
  7523. true && warn(
  7524. "The data property \"" + key + "\" is already declared as a prop. " +
  7525. "Use prop default value instead.",
  7526. vm
  7527. );
  7528. } else if (!isReserved(key)) {
  7529. proxy(vm, "_data", key);
  7530. }
  7531. }
  7532. // observe data
  7533. observe(data, true /* asRootData */);
  7534. }
  7535. function getData (data, vm) {
  7536. // #7573 disable dep collection when invoking data getters
  7537. pushTarget();
  7538. try {
  7539. return data.call(vm, vm)
  7540. } catch (e) {
  7541. handleError(e, vm, "data()");
  7542. return {}
  7543. } finally {
  7544. popTarget();
  7545. }
  7546. }
  7547. var computedWatcherOptions = { lazy: true };
  7548. function initComputed (vm, computed) {
  7549. // $flow-disable-line
  7550. var watchers = vm._computedWatchers = Object.create(null);
  7551. // computed properties are just getters during SSR
  7552. var isSSR = isServerRendering();
  7553. for (var key in computed) {
  7554. var userDef = computed[key];
  7555. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  7556. if ( true && getter == null) {
  7557. warn(
  7558. ("Getter is missing for computed property \"" + key + "\"."),
  7559. vm
  7560. );
  7561. }
  7562. if (!isSSR) {
  7563. // create internal watcher for the computed property.
  7564. watchers[key] = new Watcher(
  7565. vm,
  7566. getter || noop,
  7567. noop,
  7568. computedWatcherOptions
  7569. );
  7570. }
  7571. // component-defined computed properties are already defined on the
  7572. // component prototype. We only need to define computed properties defined
  7573. // at instantiation here.
  7574. if (!(key in vm)) {
  7575. defineComputed(vm, key, userDef);
  7576. } else if (true) {
  7577. if (key in vm.$data) {
  7578. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  7579. } else if (vm.$options.props && key in vm.$options.props) {
  7580. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  7581. }
  7582. }
  7583. }
  7584. }
  7585. function defineComputed (
  7586. target,
  7587. key,
  7588. userDef
  7589. ) {
  7590. var shouldCache = !isServerRendering();
  7591. if (typeof userDef === 'function') {
  7592. sharedPropertyDefinition.get = shouldCache
  7593. ? createComputedGetter(key)
  7594. : createGetterInvoker(userDef);
  7595. sharedPropertyDefinition.set = noop;
  7596. } else {
  7597. sharedPropertyDefinition.get = userDef.get
  7598. ? shouldCache && userDef.cache !== false
  7599. ? createComputedGetter(key)
  7600. : createGetterInvoker(userDef.get)
  7601. : noop;
  7602. sharedPropertyDefinition.set = userDef.set || noop;
  7603. }
  7604. if ( true &&
  7605. sharedPropertyDefinition.set === noop) {
  7606. sharedPropertyDefinition.set = function () {
  7607. warn(
  7608. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  7609. this
  7610. );
  7611. };
  7612. }
  7613. Object.defineProperty(target, key, sharedPropertyDefinition);
  7614. }
  7615. function createComputedGetter (key) {
  7616. return function computedGetter () {
  7617. var watcher = this._computedWatchers && this._computedWatchers[key];
  7618. if (watcher) {
  7619. if (watcher.dirty) {
  7620. watcher.evaluate();
  7621. }
  7622. if (Dep.SharedObject.target) {// fixed by xxxxxx
  7623. watcher.depend();
  7624. }
  7625. return watcher.value
  7626. }
  7627. }
  7628. }
  7629. function createGetterInvoker(fn) {
  7630. return function computedGetter () {
  7631. return fn.call(this, this)
  7632. }
  7633. }
  7634. function initMethods (vm, methods) {
  7635. var props = vm.$options.props;
  7636. for (var key in methods) {
  7637. if (true) {
  7638. if (typeof methods[key] !== 'function') {
  7639. warn(
  7640. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  7641. "Did you reference the function correctly?",
  7642. vm
  7643. );
  7644. }
  7645. if (props && hasOwn(props, key)) {
  7646. warn(
  7647. ("Method \"" + key + "\" has already been defined as a prop."),
  7648. vm
  7649. );
  7650. }
  7651. if ((key in vm) && isReserved(key)) {
  7652. warn(
  7653. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  7654. "Avoid defining component methods that start with _ or $."
  7655. );
  7656. }
  7657. }
  7658. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  7659. }
  7660. }
  7661. function initWatch (vm, watch) {
  7662. for (var key in watch) {
  7663. var handler = watch[key];
  7664. if (Array.isArray(handler)) {
  7665. for (var i = 0; i < handler.length; i++) {
  7666. createWatcher(vm, key, handler[i]);
  7667. }
  7668. } else {
  7669. createWatcher(vm, key, handler);
  7670. }
  7671. }
  7672. }
  7673. function createWatcher (
  7674. vm,
  7675. expOrFn,
  7676. handler,
  7677. options
  7678. ) {
  7679. if (isPlainObject(handler)) {
  7680. options = handler;
  7681. handler = handler.handler;
  7682. }
  7683. if (typeof handler === 'string') {
  7684. handler = vm[handler];
  7685. }
  7686. return vm.$watch(expOrFn, handler, options)
  7687. }
  7688. function stateMixin (Vue) {
  7689. // flow somehow has problems with directly declared definition object
  7690. // when using Object.defineProperty, so we have to procedurally build up
  7691. // the object here.
  7692. var dataDef = {};
  7693. dataDef.get = function () { return this._data };
  7694. var propsDef = {};
  7695. propsDef.get = function () { return this._props };
  7696. if (true) {
  7697. dataDef.set = function () {
  7698. warn(
  7699. 'Avoid replacing instance root $data. ' +
  7700. 'Use nested data properties instead.',
  7701. this
  7702. );
  7703. };
  7704. propsDef.set = function () {
  7705. warn("$props is readonly.", this);
  7706. };
  7707. }
  7708. Object.defineProperty(Vue.prototype, '$data', dataDef);
  7709. Object.defineProperty(Vue.prototype, '$props', propsDef);
  7710. Vue.prototype.$set = set;
  7711. Vue.prototype.$delete = del;
  7712. Vue.prototype.$watch = function (
  7713. expOrFn,
  7714. cb,
  7715. options
  7716. ) {
  7717. var vm = this;
  7718. if (isPlainObject(cb)) {
  7719. return createWatcher(vm, expOrFn, cb, options)
  7720. }
  7721. options = options || {};
  7722. options.user = true;
  7723. var watcher = new Watcher(vm, expOrFn, cb, options);
  7724. if (options.immediate) {
  7725. try {
  7726. cb.call(vm, watcher.value);
  7727. } catch (error) {
  7728. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  7729. }
  7730. }
  7731. return function unwatchFn () {
  7732. watcher.teardown();
  7733. }
  7734. };
  7735. }
  7736. /* */
  7737. var uid$3 = 0;
  7738. function initMixin (Vue) {
  7739. Vue.prototype._init = function (options) {
  7740. var vm = this;
  7741. // a uid
  7742. vm._uid = uid$3++;
  7743. var startTag, endTag;
  7744. /* istanbul ignore if */
  7745. if ( true && config.performance && mark) {
  7746. startTag = "vue-perf-start:" + (vm._uid);
  7747. endTag = "vue-perf-end:" + (vm._uid);
  7748. mark(startTag);
  7749. }
  7750. // a flag to avoid this being observed
  7751. vm._isVue = true;
  7752. // merge options
  7753. if (options && options._isComponent) {
  7754. // optimize internal component instantiation
  7755. // since dynamic options merging is pretty slow, and none of the
  7756. // internal component options needs special treatment.
  7757. initInternalComponent(vm, options);
  7758. } else {
  7759. vm.$options = mergeOptions(
  7760. resolveConstructorOptions(vm.constructor),
  7761. options || {},
  7762. vm
  7763. );
  7764. }
  7765. /* istanbul ignore else */
  7766. if (true) {
  7767. initProxy(vm);
  7768. } else {}
  7769. // expose real self
  7770. vm._self = vm;
  7771. initLifecycle(vm);
  7772. initEvents(vm);
  7773. initRender(vm);
  7774. callHook(vm, 'beforeCreate');
  7775. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  7776. initState(vm);
  7777. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  7778. !vm._$fallback && callHook(vm, 'created');
  7779. /* istanbul ignore if */
  7780. if ( true && config.performance && mark) {
  7781. vm._name = formatComponentName(vm, false);
  7782. mark(endTag);
  7783. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  7784. }
  7785. if (vm.$options.el) {
  7786. vm.$mount(vm.$options.el);
  7787. }
  7788. };
  7789. }
  7790. function initInternalComponent (vm, options) {
  7791. var opts = vm.$options = Object.create(vm.constructor.options);
  7792. // doing this because it's faster than dynamic enumeration.
  7793. var parentVnode = options._parentVnode;
  7794. opts.parent = options.parent;
  7795. opts._parentVnode = parentVnode;
  7796. var vnodeComponentOptions = parentVnode.componentOptions;
  7797. opts.propsData = vnodeComponentOptions.propsData;
  7798. opts._parentListeners = vnodeComponentOptions.listeners;
  7799. opts._renderChildren = vnodeComponentOptions.children;
  7800. opts._componentTag = vnodeComponentOptions.tag;
  7801. if (options.render) {
  7802. opts.render = options.render;
  7803. opts.staticRenderFns = options.staticRenderFns;
  7804. }
  7805. }
  7806. function resolveConstructorOptions (Ctor) {
  7807. var options = Ctor.options;
  7808. if (Ctor.super) {
  7809. var superOptions = resolveConstructorOptions(Ctor.super);
  7810. var cachedSuperOptions = Ctor.superOptions;
  7811. if (superOptions !== cachedSuperOptions) {
  7812. // super option changed,
  7813. // need to resolve new options.
  7814. Ctor.superOptions = superOptions;
  7815. // check if there are any late-modified/attached options (#4976)
  7816. var modifiedOptions = resolveModifiedOptions(Ctor);
  7817. // update base extend options
  7818. if (modifiedOptions) {
  7819. extend(Ctor.extendOptions, modifiedOptions);
  7820. }
  7821. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  7822. if (options.name) {
  7823. options.components[options.name] = Ctor;
  7824. }
  7825. }
  7826. }
  7827. return options
  7828. }
  7829. function resolveModifiedOptions (Ctor) {
  7830. var modified;
  7831. var latest = Ctor.options;
  7832. var sealed = Ctor.sealedOptions;
  7833. for (var key in latest) {
  7834. if (latest[key] !== sealed[key]) {
  7835. if (!modified) { modified = {}; }
  7836. modified[key] = latest[key];
  7837. }
  7838. }
  7839. return modified
  7840. }
  7841. function Vue (options) {
  7842. if ( true &&
  7843. !(this instanceof Vue)
  7844. ) {
  7845. warn('Vue is a constructor and should be called with the `new` keyword');
  7846. }
  7847. this._init(options);
  7848. }
  7849. initMixin(Vue);
  7850. stateMixin(Vue);
  7851. eventsMixin(Vue);
  7852. lifecycleMixin(Vue);
  7853. renderMixin(Vue);
  7854. /* */
  7855. function initUse (Vue) {
  7856. Vue.use = function (plugin) {
  7857. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  7858. if (installedPlugins.indexOf(plugin) > -1) {
  7859. return this
  7860. }
  7861. // additional parameters
  7862. var args = toArray(arguments, 1);
  7863. args.unshift(this);
  7864. if (typeof plugin.install === 'function') {
  7865. plugin.install.apply(plugin, args);
  7866. } else if (typeof plugin === 'function') {
  7867. plugin.apply(null, args);
  7868. }
  7869. installedPlugins.push(plugin);
  7870. return this
  7871. };
  7872. }
  7873. /* */
  7874. function initMixin$1 (Vue) {
  7875. Vue.mixin = function (mixin) {
  7876. this.options = mergeOptions(this.options, mixin);
  7877. return this
  7878. };
  7879. }
  7880. /* */
  7881. function initExtend (Vue) {
  7882. /**
  7883. * Each instance constructor, including Vue, has a unique
  7884. * cid. This enables us to create wrapped "child
  7885. * constructors" for prototypal inheritance and cache them.
  7886. */
  7887. Vue.cid = 0;
  7888. var cid = 1;
  7889. /**
  7890. * Class inheritance
  7891. */
  7892. Vue.extend = function (extendOptions) {
  7893. extendOptions = extendOptions || {};
  7894. var Super = this;
  7895. var SuperId = Super.cid;
  7896. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  7897. if (cachedCtors[SuperId]) {
  7898. return cachedCtors[SuperId]
  7899. }
  7900. var name = extendOptions.name || Super.options.name;
  7901. if ( true && name) {
  7902. validateComponentName(name);
  7903. }
  7904. var Sub = function VueComponent (options) {
  7905. this._init(options);
  7906. };
  7907. Sub.prototype = Object.create(Super.prototype);
  7908. Sub.prototype.constructor = Sub;
  7909. Sub.cid = cid++;
  7910. Sub.options = mergeOptions(
  7911. Super.options,
  7912. extendOptions
  7913. );
  7914. Sub['super'] = Super;
  7915. // For props and computed properties, we define the proxy getters on
  7916. // the Vue instances at extension time, on the extended prototype. This
  7917. // avoids Object.defineProperty calls for each instance created.
  7918. if (Sub.options.props) {
  7919. initProps$1(Sub);
  7920. }
  7921. if (Sub.options.computed) {
  7922. initComputed$1(Sub);
  7923. }
  7924. // allow further extension/mixin/plugin usage
  7925. Sub.extend = Super.extend;
  7926. Sub.mixin = Super.mixin;
  7927. Sub.use = Super.use;
  7928. // create asset registers, so extended classes
  7929. // can have their private assets too.
  7930. ASSET_TYPES.forEach(function (type) {
  7931. Sub[type] = Super[type];
  7932. });
  7933. // enable recursive self-lookup
  7934. if (name) {
  7935. Sub.options.components[name] = Sub;
  7936. }
  7937. // keep a reference to the super options at extension time.
  7938. // later at instantiation we can check if Super's options have
  7939. // been updated.
  7940. Sub.superOptions = Super.options;
  7941. Sub.extendOptions = extendOptions;
  7942. Sub.sealedOptions = extend({}, Sub.options);
  7943. // cache constructor
  7944. cachedCtors[SuperId] = Sub;
  7945. return Sub
  7946. };
  7947. }
  7948. function initProps$1 (Comp) {
  7949. var props = Comp.options.props;
  7950. for (var key in props) {
  7951. proxy(Comp.prototype, "_props", key);
  7952. }
  7953. }
  7954. function initComputed$1 (Comp) {
  7955. var computed = Comp.options.computed;
  7956. for (var key in computed) {
  7957. defineComputed(Comp.prototype, key, computed[key]);
  7958. }
  7959. }
  7960. /* */
  7961. function initAssetRegisters (Vue) {
  7962. /**
  7963. * Create asset registration methods.
  7964. */
  7965. ASSET_TYPES.forEach(function (type) {
  7966. Vue[type] = function (
  7967. id,
  7968. definition
  7969. ) {
  7970. if (!definition) {
  7971. return this.options[type + 's'][id]
  7972. } else {
  7973. /* istanbul ignore if */
  7974. if ( true && type === 'component') {
  7975. validateComponentName(id);
  7976. }
  7977. if (type === 'component' && isPlainObject(definition)) {
  7978. definition.name = definition.name || id;
  7979. definition = this.options._base.extend(definition);
  7980. }
  7981. if (type === 'directive' && typeof definition === 'function') {
  7982. definition = { bind: definition, update: definition };
  7983. }
  7984. this.options[type + 's'][id] = definition;
  7985. return definition
  7986. }
  7987. };
  7988. });
  7989. }
  7990. /* */
  7991. function getComponentName (opts) {
  7992. return opts && (opts.Ctor.options.name || opts.tag)
  7993. }
  7994. function matches (pattern, name) {
  7995. if (Array.isArray(pattern)) {
  7996. return pattern.indexOf(name) > -1
  7997. } else if (typeof pattern === 'string') {
  7998. return pattern.split(',').indexOf(name) > -1
  7999. } else if (isRegExp(pattern)) {
  8000. return pattern.test(name)
  8001. }
  8002. /* istanbul ignore next */
  8003. return false
  8004. }
  8005. function pruneCache (keepAliveInstance, filter) {
  8006. var cache = keepAliveInstance.cache;
  8007. var keys = keepAliveInstance.keys;
  8008. var _vnode = keepAliveInstance._vnode;
  8009. for (var key in cache) {
  8010. var cachedNode = cache[key];
  8011. if (cachedNode) {
  8012. var name = getComponentName(cachedNode.componentOptions);
  8013. if (name && !filter(name)) {
  8014. pruneCacheEntry(cache, key, keys, _vnode);
  8015. }
  8016. }
  8017. }
  8018. }
  8019. function pruneCacheEntry (
  8020. cache,
  8021. key,
  8022. keys,
  8023. current
  8024. ) {
  8025. var cached$$1 = cache[key];
  8026. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  8027. cached$$1.componentInstance.$destroy();
  8028. }
  8029. cache[key] = null;
  8030. remove(keys, key);
  8031. }
  8032. var patternTypes = [String, RegExp, Array];
  8033. var KeepAlive = {
  8034. name: 'keep-alive',
  8035. abstract: true,
  8036. props: {
  8037. include: patternTypes,
  8038. exclude: patternTypes,
  8039. max: [String, Number]
  8040. },
  8041. created: function created () {
  8042. this.cache = Object.create(null);
  8043. this.keys = [];
  8044. },
  8045. destroyed: function destroyed () {
  8046. for (var key in this.cache) {
  8047. pruneCacheEntry(this.cache, key, this.keys);
  8048. }
  8049. },
  8050. mounted: function mounted () {
  8051. var this$1 = this;
  8052. this.$watch('include', function (val) {
  8053. pruneCache(this$1, function (name) { return matches(val, name); });
  8054. });
  8055. this.$watch('exclude', function (val) {
  8056. pruneCache(this$1, function (name) { return !matches(val, name); });
  8057. });
  8058. },
  8059. render: function render () {
  8060. var slot = this.$slots.default;
  8061. var vnode = getFirstComponentChild(slot);
  8062. var componentOptions = vnode && vnode.componentOptions;
  8063. if (componentOptions) {
  8064. // check pattern
  8065. var name = getComponentName(componentOptions);
  8066. var ref = this;
  8067. var include = ref.include;
  8068. var exclude = ref.exclude;
  8069. if (
  8070. // not included
  8071. (include && (!name || !matches(include, name))) ||
  8072. // excluded
  8073. (exclude && name && matches(exclude, name))
  8074. ) {
  8075. return vnode
  8076. }
  8077. var ref$1 = this;
  8078. var cache = ref$1.cache;
  8079. var keys = ref$1.keys;
  8080. var key = vnode.key == null
  8081. // same constructor may get registered as different local components
  8082. // so cid alone is not enough (#3269)
  8083. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  8084. : vnode.key;
  8085. if (cache[key]) {
  8086. vnode.componentInstance = cache[key].componentInstance;
  8087. // make current key freshest
  8088. remove(keys, key);
  8089. keys.push(key);
  8090. } else {
  8091. cache[key] = vnode;
  8092. keys.push(key);
  8093. // prune oldest entry
  8094. if (this.max && keys.length > parseInt(this.max)) {
  8095. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  8096. }
  8097. }
  8098. vnode.data.keepAlive = true;
  8099. }
  8100. return vnode || (slot && slot[0])
  8101. }
  8102. };
  8103. var builtInComponents = {
  8104. KeepAlive: KeepAlive
  8105. };
  8106. /* */
  8107. function initGlobalAPI (Vue) {
  8108. // config
  8109. var configDef = {};
  8110. configDef.get = function () { return config; };
  8111. if (true) {
  8112. configDef.set = function () {
  8113. warn(
  8114. 'Do not replace the Vue.config object, set individual fields instead.'
  8115. );
  8116. };
  8117. }
  8118. Object.defineProperty(Vue, 'config', configDef);
  8119. // exposed util methods.
  8120. // NOTE: these are not considered part of the public API - avoid relying on
  8121. // them unless you are aware of the risk.
  8122. Vue.util = {
  8123. warn: warn,
  8124. extend: extend,
  8125. mergeOptions: mergeOptions,
  8126. defineReactive: defineReactive$$1
  8127. };
  8128. Vue.set = set;
  8129. Vue.delete = del;
  8130. Vue.nextTick = nextTick;
  8131. // 2.6 explicit observable API
  8132. Vue.observable = function (obj) {
  8133. observe(obj);
  8134. return obj
  8135. };
  8136. Vue.options = Object.create(null);
  8137. ASSET_TYPES.forEach(function (type) {
  8138. Vue.options[type + 's'] = Object.create(null);
  8139. });
  8140. // this is used to identify the "base" constructor to extend all plain-object
  8141. // components with in Weex's multi-instance scenarios.
  8142. Vue.options._base = Vue;
  8143. extend(Vue.options.components, builtInComponents);
  8144. initUse(Vue);
  8145. initMixin$1(Vue);
  8146. initExtend(Vue);
  8147. initAssetRegisters(Vue);
  8148. }
  8149. initGlobalAPI(Vue);
  8150. Object.defineProperty(Vue.prototype, '$isServer', {
  8151. get: isServerRendering
  8152. });
  8153. Object.defineProperty(Vue.prototype, '$ssrContext', {
  8154. get: function get () {
  8155. /* istanbul ignore next */
  8156. return this.$vnode && this.$vnode.ssrContext
  8157. }
  8158. });
  8159. // expose FunctionalRenderContext for ssr runtime helper installation
  8160. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  8161. value: FunctionalRenderContext
  8162. });
  8163. Vue.version = '2.6.11';
  8164. /**
  8165. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  8166. */
  8167. var ARRAYTYPE = '[object Array]';
  8168. var OBJECTTYPE = '[object Object]';
  8169. var NULLTYPE = '[object Null]';
  8170. var UNDEFINEDTYPE = '[object Undefined]';
  8171. // const FUNCTIONTYPE = '[object Function]'
  8172. function diff(current, pre) {
  8173. var result = {};
  8174. syncKeys(current, pre);
  8175. _diff(current, pre, '', result);
  8176. return result
  8177. }
  8178. function syncKeys(current, pre) {
  8179. if (current === pre) { return }
  8180. var rootCurrentType = type(current);
  8181. var rootPreType = type(pre);
  8182. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  8183. if(Object.keys(current).length >= Object.keys(pre).length){
  8184. for (var key in pre) {
  8185. var currentValue = current[key];
  8186. if (currentValue === undefined) {
  8187. current[key] = null;
  8188. } else {
  8189. syncKeys(currentValue, pre[key]);
  8190. }
  8191. }
  8192. }
  8193. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  8194. if (current.length >= pre.length) {
  8195. pre.forEach(function (item, index) {
  8196. syncKeys(current[index], item);
  8197. });
  8198. }
  8199. }
  8200. }
  8201. function nullOrUndefined(currentType, preType) {
  8202. if(
  8203. (currentType === NULLTYPE || currentType === UNDEFINEDTYPE) &&
  8204. (preType === NULLTYPE || preType === UNDEFINEDTYPE)
  8205. ) {
  8206. return false
  8207. }
  8208. return true
  8209. }
  8210. function _diff(current, pre, path, result) {
  8211. if (current === pre) { return }
  8212. var rootCurrentType = type(current);
  8213. var rootPreType = type(pre);
  8214. if (rootCurrentType == OBJECTTYPE) {
  8215. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  8216. setResult(result, path, current);
  8217. } else {
  8218. var loop = function ( key ) {
  8219. var currentValue = current[key];
  8220. var preValue = pre[key];
  8221. var currentType = type(currentValue);
  8222. var preType = type(preValue);
  8223. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  8224. if (currentValue !== pre[key] && nullOrUndefined(currentType, preType)) {
  8225. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8226. }
  8227. } else if (currentType == ARRAYTYPE) {
  8228. if (preType != ARRAYTYPE) {
  8229. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8230. } else {
  8231. if (currentValue.length < preValue.length) {
  8232. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8233. } else {
  8234. currentValue.forEach(function (item, index) {
  8235. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  8236. });
  8237. }
  8238. }
  8239. } else if (currentType == OBJECTTYPE) {
  8240. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  8241. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8242. } else {
  8243. for (var subKey in currentValue) {
  8244. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  8245. }
  8246. }
  8247. }
  8248. };
  8249. for (var key in current) loop( key );
  8250. }
  8251. } else if (rootCurrentType == ARRAYTYPE) {
  8252. if (rootPreType != ARRAYTYPE) {
  8253. setResult(result, path, current);
  8254. } else {
  8255. if (current.length < pre.length) {
  8256. setResult(result, path, current);
  8257. } else {
  8258. current.forEach(function (item, index) {
  8259. _diff(item, pre[index], path + '[' + index + ']', result);
  8260. });
  8261. }
  8262. }
  8263. } else {
  8264. setResult(result, path, current);
  8265. }
  8266. }
  8267. function setResult(result, k, v) {
  8268. // if (type(v) != FUNCTIONTYPE) {
  8269. result[k] = v;
  8270. // }
  8271. }
  8272. function type(obj) {
  8273. return Object.prototype.toString.call(obj)
  8274. }
  8275. /* */
  8276. function flushCallbacks$1(vm) {
  8277. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  8278. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"益智游戏","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  8279. var mpInstance = vm.$scope;
  8280. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  8281. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  8282. }
  8283. var copies = vm.__next_tick_callbacks.slice(0);
  8284. vm.__next_tick_callbacks.length = 0;
  8285. for (var i = 0; i < copies.length; i++) {
  8286. copies[i]();
  8287. }
  8288. }
  8289. }
  8290. function hasRenderWatcher(vm) {
  8291. return queue.find(function (watcher) { return vm._watcher === watcher; })
  8292. }
  8293. function nextTick$1(vm, cb) {
  8294. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  8295. //2.nextTick 之前存在 render watcher
  8296. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  8297. if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"益智游戏","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  8298. var mpInstance = vm.$scope;
  8299. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  8300. ']:nextVueTick');
  8301. }
  8302. return nextTick(cb, vm)
  8303. }else{
  8304. if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"益智游戏","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  8305. var mpInstance$1 = vm.$scope;
  8306. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  8307. ']:nextMPTick');
  8308. }
  8309. }
  8310. var _resolve;
  8311. if (!vm.__next_tick_callbacks) {
  8312. vm.__next_tick_callbacks = [];
  8313. }
  8314. vm.__next_tick_callbacks.push(function () {
  8315. if (cb) {
  8316. try {
  8317. cb.call(vm);
  8318. } catch (e) {
  8319. handleError(e, vm, 'nextTick');
  8320. }
  8321. } else if (_resolve) {
  8322. _resolve(vm);
  8323. }
  8324. });
  8325. // $flow-disable-line
  8326. if (!cb && typeof Promise !== 'undefined') {
  8327. return new Promise(function (resolve) {
  8328. _resolve = resolve;
  8329. })
  8330. }
  8331. }
  8332. /* */
  8333. function clearInstance(key, value) {
  8334. // 简易去除 Vue 和小程序组件实例
  8335. if (value) {
  8336. if (value._isVue || value.__v_isMPComponent) {
  8337. return {}
  8338. }
  8339. }
  8340. return value
  8341. }
  8342. function cloneWithData(vm) {
  8343. // 确保当前 vm 所有数据被同步
  8344. var ret = Object.create(null);
  8345. var dataKeys = [].concat(
  8346. Object.keys(vm._data || {}),
  8347. Object.keys(vm._computedWatchers || {}));
  8348. dataKeys.reduce(function(ret, key) {
  8349. ret[key] = vm[key];
  8350. return ret
  8351. }, ret);
  8352. // vue-composition-api
  8353. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  8354. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  8355. if (rawBindings) {
  8356. Object.keys(rawBindings).forEach(function (key) {
  8357. ret[key] = vm[key];
  8358. });
  8359. }
  8360. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  8361. Object.assign(ret, vm.$mp.data || {});
  8362. if (
  8363. Array.isArray(vm.$options.behaviors) &&
  8364. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  8365. ) { //form-field
  8366. ret['name'] = vm.name;
  8367. ret['value'] = vm.value;
  8368. }
  8369. return JSON.parse(JSON.stringify(ret, clearInstance))
  8370. }
  8371. var patch = function(oldVnode, vnode) {
  8372. var this$1 = this;
  8373. if (vnode === null) { //destroy
  8374. return
  8375. }
  8376. if (this.mpType === 'page' || this.mpType === 'component') {
  8377. var mpInstance = this.$scope;
  8378. var data = Object.create(null);
  8379. try {
  8380. data = cloneWithData(this);
  8381. } catch (err) {
  8382. console.error(err);
  8383. }
  8384. data.__webviewId__ = mpInstance.data.__webviewId__;
  8385. var mpData = Object.create(null);
  8386. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  8387. mpData[key] = mpInstance.data[key];
  8388. });
  8389. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  8390. if (Object.keys(diffData).length) {
  8391. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"益智游戏","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  8392. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  8393. ']差量更新',
  8394. JSON.stringify(diffData));
  8395. }
  8396. this.__next_tick_pending = true;
  8397. mpInstance.setData(diffData, function () {
  8398. this$1.__next_tick_pending = false;
  8399. flushCallbacks$1(this$1);
  8400. });
  8401. } else {
  8402. flushCallbacks$1(this);
  8403. }
  8404. }
  8405. };
  8406. /* */
  8407. function createEmptyRender() {
  8408. }
  8409. function mountComponent$1(
  8410. vm,
  8411. el,
  8412. hydrating
  8413. ) {
  8414. if (!vm.mpType) {//main.js 中的 new Vue
  8415. return vm
  8416. }
  8417. if (vm.mpType === 'app') {
  8418. vm.$options.render = createEmptyRender;
  8419. }
  8420. if (!vm.$options.render) {
  8421. vm.$options.render = createEmptyRender;
  8422. if (true) {
  8423. /* istanbul ignore if */
  8424. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  8425. vm.$options.el || el) {
  8426. warn(
  8427. 'You are using the runtime-only build of Vue where the template ' +
  8428. 'compiler is not available. Either pre-compile the templates into ' +
  8429. 'render functions, or use the compiler-included build.',
  8430. vm
  8431. );
  8432. } else {
  8433. warn(
  8434. 'Failed to mount component: template or render function not defined.',
  8435. vm
  8436. );
  8437. }
  8438. }
  8439. }
  8440. !vm._$fallback && callHook(vm, 'beforeMount');
  8441. var updateComponent = function () {
  8442. vm._update(vm._render(), hydrating);
  8443. };
  8444. // we set this to vm._watcher inside the watcher's constructor
  8445. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  8446. // component's mounted hook), which relies on vm._watcher being already defined
  8447. new Watcher(vm, updateComponent, noop, {
  8448. before: function before() {
  8449. if (vm._isMounted && !vm._isDestroyed) {
  8450. callHook(vm, 'beforeUpdate');
  8451. }
  8452. }
  8453. }, true /* isRenderWatcher */);
  8454. hydrating = false;
  8455. return vm
  8456. }
  8457. /* */
  8458. function renderClass (
  8459. staticClass,
  8460. dynamicClass
  8461. ) {
  8462. if (isDef(staticClass) || isDef(dynamicClass)) {
  8463. return concat(staticClass, stringifyClass(dynamicClass))
  8464. }
  8465. /* istanbul ignore next */
  8466. return ''
  8467. }
  8468. function concat (a, b) {
  8469. return a ? b ? (a + ' ' + b) : a : (b || '')
  8470. }
  8471. function stringifyClass (value) {
  8472. if (Array.isArray(value)) {
  8473. return stringifyArray(value)
  8474. }
  8475. if (isObject(value)) {
  8476. return stringifyObject(value)
  8477. }
  8478. if (typeof value === 'string') {
  8479. return value
  8480. }
  8481. /* istanbul ignore next */
  8482. return ''
  8483. }
  8484. function stringifyArray (value) {
  8485. var res = '';
  8486. var stringified;
  8487. for (var i = 0, l = value.length; i < l; i++) {
  8488. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  8489. if (res) { res += ' '; }
  8490. res += stringified;
  8491. }
  8492. }
  8493. return res
  8494. }
  8495. function stringifyObject (value) {
  8496. var res = '';
  8497. for (var key in value) {
  8498. if (value[key]) {
  8499. if (res) { res += ' '; }
  8500. res += key;
  8501. }
  8502. }
  8503. return res
  8504. }
  8505. /* */
  8506. var parseStyleText = cached(function (cssText) {
  8507. var res = {};
  8508. var listDelimiter = /;(?![^(]*\))/g;
  8509. var propertyDelimiter = /:(.+)/;
  8510. cssText.split(listDelimiter).forEach(function (item) {
  8511. if (item) {
  8512. var tmp = item.split(propertyDelimiter);
  8513. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  8514. }
  8515. });
  8516. return res
  8517. });
  8518. // normalize possible array / string values into Object
  8519. function normalizeStyleBinding (bindingStyle) {
  8520. if (Array.isArray(bindingStyle)) {
  8521. return toObject(bindingStyle)
  8522. }
  8523. if (typeof bindingStyle === 'string') {
  8524. return parseStyleText(bindingStyle)
  8525. }
  8526. return bindingStyle
  8527. }
  8528. /* */
  8529. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  8530. function getTarget(obj, path) {
  8531. var parts = path.split('.');
  8532. var key = parts[0];
  8533. if (key.indexOf('__$n') === 0) { //number index
  8534. key = parseInt(key.replace('__$n', ''));
  8535. }
  8536. if (parts.length === 1) {
  8537. return obj[key]
  8538. }
  8539. return getTarget(obj[key], parts.slice(1).join('.'))
  8540. }
  8541. function internalMixin(Vue) {
  8542. Vue.config.errorHandler = function(err, vm, info) {
  8543. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  8544. console.error(err);
  8545. /* eslint-disable no-undef */
  8546. var app = typeof getApp === 'function' && getApp();
  8547. if (app && app.onError) {
  8548. app.onError(err);
  8549. }
  8550. };
  8551. var oldEmit = Vue.prototype.$emit;
  8552. Vue.prototype.$emit = function(event) {
  8553. if (this.$scope && event) {
  8554. var triggerEvent = this.$scope['_triggerEvent'] || this.$scope['triggerEvent'];
  8555. if (triggerEvent) {
  8556. try {
  8557. triggerEvent.call(this.$scope, event, {
  8558. __args__: toArray(arguments, 1)
  8559. });
  8560. } catch (error) {
  8561. }
  8562. }
  8563. }
  8564. return oldEmit.apply(this, arguments)
  8565. };
  8566. Vue.prototype.$nextTick = function(fn) {
  8567. return nextTick$1(this, fn)
  8568. };
  8569. MP_METHODS.forEach(function (method) {
  8570. Vue.prototype[method] = function(args) {
  8571. if (this.$scope && this.$scope[method]) {
  8572. return this.$scope[method](args)
  8573. }
  8574. // mp-alipay
  8575. if (typeof my === 'undefined') {
  8576. return
  8577. }
  8578. if (method === 'createSelectorQuery') {
  8579. /* eslint-disable no-undef */
  8580. return my.createSelectorQuery(args)
  8581. } else if (method === 'createIntersectionObserver') {
  8582. /* eslint-disable no-undef */
  8583. return my.createIntersectionObserver(args)
  8584. }
  8585. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  8586. };
  8587. });
  8588. Vue.prototype.__init_provide = initProvide;
  8589. Vue.prototype.__init_injections = initInjections;
  8590. Vue.prototype.__call_hook = function(hook, args) {
  8591. var vm = this;
  8592. // #7573 disable dep collection when invoking lifecycle hooks
  8593. pushTarget();
  8594. var handlers = vm.$options[hook];
  8595. var info = hook + " hook";
  8596. var ret;
  8597. if (handlers) {
  8598. for (var i = 0, j = handlers.length; i < j; i++) {
  8599. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  8600. }
  8601. }
  8602. if (vm._hasHookEvent) {
  8603. vm.$emit('hook:' + hook, args);
  8604. }
  8605. popTarget();
  8606. return ret
  8607. };
  8608. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  8609. if (Array.isArray(modifiers)) {
  8610. if (modifiers.indexOf('trim') !== -1) {
  8611. value = value.trim();
  8612. }
  8613. if (modifiers.indexOf('number') !== -1) {
  8614. value = this._n(value);
  8615. }
  8616. }
  8617. if (!target) {
  8618. target = this;
  8619. }
  8620. // 解决动态属性添加
  8621. Vue.set(target, key, value);
  8622. };
  8623. Vue.prototype.__set_sync = function(target, key, value) {
  8624. if (!target) {
  8625. target = this;
  8626. }
  8627. // 解决动态属性添加
  8628. Vue.set(target, key, value);
  8629. };
  8630. Vue.prototype.__get_orig = function(item) {
  8631. if (isPlainObject(item)) {
  8632. return item['$orig'] || item
  8633. }
  8634. return item
  8635. };
  8636. Vue.prototype.__get_value = function(dataPath, target) {
  8637. return getTarget(target || this, dataPath)
  8638. };
  8639. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  8640. return renderClass(staticClass, dynamicClass)
  8641. };
  8642. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  8643. if (!dynamicStyle && !staticStyle) {
  8644. return ''
  8645. }
  8646. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  8647. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  8648. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  8649. };
  8650. Vue.prototype.__map = function(val, iteratee) {
  8651. //TODO 暂不考虑 string
  8652. var ret, i, l, keys, key;
  8653. if (Array.isArray(val)) {
  8654. ret = new Array(val.length);
  8655. for (i = 0, l = val.length; i < l; i++) {
  8656. ret[i] = iteratee(val[i], i);
  8657. }
  8658. return ret
  8659. } else if (isObject(val)) {
  8660. keys = Object.keys(val);
  8661. ret = Object.create(null);
  8662. for (i = 0, l = keys.length; i < l; i++) {
  8663. key = keys[i];
  8664. ret[key] = iteratee(val[key], key, i);
  8665. }
  8666. return ret
  8667. } else if (typeof val === 'number') {
  8668. ret = new Array(val);
  8669. for (i = 0, l = val; i < l; i++) {
  8670. // 第一个参数暂时仍和小程序一致
  8671. ret[i] = iteratee(i, i);
  8672. }
  8673. return ret
  8674. }
  8675. return []
  8676. };
  8677. }
  8678. /* */
  8679. var LIFECYCLE_HOOKS$1 = [
  8680. //App
  8681. 'onLaunch',
  8682. 'onShow',
  8683. 'onHide',
  8684. 'onUniNViewMessage',
  8685. 'onPageNotFound',
  8686. 'onThemeChange',
  8687. 'onError',
  8688. 'onUnhandledRejection',
  8689. //Page
  8690. 'onInit',
  8691. 'onLoad',
  8692. // 'onShow',
  8693. 'onReady',
  8694. // 'onHide',
  8695. 'onUnload',
  8696. 'onPullDownRefresh',
  8697. 'onReachBottom',
  8698. 'onTabItemTap',
  8699. 'onAddToFavorites',
  8700. 'onShareTimeline',
  8701. 'onShareAppMessage',
  8702. 'onResize',
  8703. 'onPageScroll',
  8704. 'onNavigationBarButtonTap',
  8705. 'onBackPress',
  8706. 'onNavigationBarSearchInputChanged',
  8707. 'onNavigationBarSearchInputConfirmed',
  8708. 'onNavigationBarSearchInputClicked',
  8709. //Component
  8710. // 'onReady', // 兼容旧版本,应该移除该事件
  8711. 'onPageShow',
  8712. 'onPageHide',
  8713. 'onPageResize',
  8714. 'onUploadDouyinVideo'
  8715. ];
  8716. function lifecycleMixin$1(Vue) {
  8717. //fixed vue-class-component
  8718. var oldExtend = Vue.extend;
  8719. Vue.extend = function(extendOptions) {
  8720. extendOptions = extendOptions || {};
  8721. var methods = extendOptions.methods;
  8722. if (methods) {
  8723. Object.keys(methods).forEach(function (methodName) {
  8724. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  8725. extendOptions[methodName] = methods[methodName];
  8726. delete methods[methodName];
  8727. }
  8728. });
  8729. }
  8730. return oldExtend.call(this, extendOptions)
  8731. };
  8732. var strategies = Vue.config.optionMergeStrategies;
  8733. var mergeHook = strategies.created;
  8734. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  8735. strategies[hook] = mergeHook;
  8736. });
  8737. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  8738. }
  8739. /* */
  8740. // install platform patch function
  8741. Vue.prototype.__patch__ = patch;
  8742. // public mount method
  8743. Vue.prototype.$mount = function(
  8744. el ,
  8745. hydrating
  8746. ) {
  8747. return mountComponent$1(this, el, hydrating)
  8748. };
  8749. lifecycleMixin$1(Vue);
  8750. internalMixin(Vue);
  8751. /* */
  8752. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  8753. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  8754. /***/ }),
  8755. /* 26 */
  8756. /*!*****************************************!*\
  8757. !*** D:/project/项目模板/uniapp/pages.json ***!
  8758. \*****************************************/
  8759. /*! no static exports found */
  8760. /***/ (function(module, exports) {
  8761. /***/ }),
  8762. /* 27 */,
  8763. /* 28 */,
  8764. /* 29 */,
  8765. /* 30 */,
  8766. /* 31 */,
  8767. /* 32 */
  8768. /*!**********************************************************************************************************!*\
  8769. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  8770. \**********************************************************************************************************/
  8771. /*! exports provided: default */
  8772. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8773. "use strict";
  8774. __webpack_require__.r(__webpack_exports__);
  8775. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  8776. /* globals __VUE_SSR_CONTEXT__ */
  8777. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  8778. // This module is a runtime utility for cleaner component module output and will
  8779. // be included in the final webpack user bundle.
  8780. function normalizeComponent (
  8781. scriptExports,
  8782. render,
  8783. staticRenderFns,
  8784. functionalTemplate,
  8785. injectStyles,
  8786. scopeId,
  8787. moduleIdentifier, /* server only */
  8788. shadowMode, /* vue-cli only */
  8789. components, // fixed by xxxxxx auto components
  8790. renderjs // fixed by xxxxxx renderjs
  8791. ) {
  8792. // Vue.extend constructor export interop
  8793. var options = typeof scriptExports === 'function'
  8794. ? scriptExports.options
  8795. : scriptExports
  8796. // fixed by xxxxxx auto components
  8797. if (components) {
  8798. if (!options.components) {
  8799. options.components = {}
  8800. }
  8801. var hasOwn = Object.prototype.hasOwnProperty
  8802. for (var name in components) {
  8803. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  8804. options.components[name] = components[name]
  8805. }
  8806. }
  8807. }
  8808. // fixed by xxxxxx renderjs
  8809. if (renderjs) {
  8810. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  8811. this[renderjs.__module] = this
  8812. });
  8813. (options.mixins || (options.mixins = [])).push(renderjs)
  8814. }
  8815. // render functions
  8816. if (render) {
  8817. options.render = render
  8818. options.staticRenderFns = staticRenderFns
  8819. options._compiled = true
  8820. }
  8821. // functional template
  8822. if (functionalTemplate) {
  8823. options.functional = true
  8824. }
  8825. // scopedId
  8826. if (scopeId) {
  8827. options._scopeId = 'data-v-' + scopeId
  8828. }
  8829. var hook
  8830. if (moduleIdentifier) { // server build
  8831. hook = function (context) {
  8832. // 2.3 injection
  8833. context =
  8834. context || // cached call
  8835. (this.$vnode && this.$vnode.ssrContext) || // stateful
  8836. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  8837. // 2.2 with runInNewContext: true
  8838. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  8839. context = __VUE_SSR_CONTEXT__
  8840. }
  8841. // inject component styles
  8842. if (injectStyles) {
  8843. injectStyles.call(this, context)
  8844. }
  8845. // register component module identifier for async chunk inferrence
  8846. if (context && context._registeredComponents) {
  8847. context._registeredComponents.add(moduleIdentifier)
  8848. }
  8849. }
  8850. // used by ssr in case component is cached and beforeCreate
  8851. // never gets called
  8852. options._ssrRegister = hook
  8853. } else if (injectStyles) {
  8854. hook = shadowMode
  8855. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  8856. : injectStyles
  8857. }
  8858. if (hook) {
  8859. if (options.functional) {
  8860. // for template-only hot-reload because in that case the render fn doesn't
  8861. // go through the normalizer
  8862. options._injectStyles = hook
  8863. // register for functioal component in vue file
  8864. var originalRender = options.render
  8865. options.render = function renderWithStyleInjection (h, context) {
  8866. hook.call(context)
  8867. return originalRender(h, context)
  8868. }
  8869. } else {
  8870. // inject component registration as beforeCreate hook
  8871. var existing = options.beforeCreate
  8872. options.beforeCreate = existing
  8873. ? [].concat(existing, hook)
  8874. : [hook]
  8875. }
  8876. }
  8877. return {
  8878. exports: scriptExports,
  8879. options: options
  8880. }
  8881. }
  8882. /***/ }),
  8883. /* 33 */
  8884. /*!***********************************************!*\
  8885. !*** D:/project/项目模板/uniapp/common/config.js ***!
  8886. \***********************************************/
  8887. /*! no static exports found */
  8888. /***/ (function(module, exports, __webpack_require__) {
  8889. "use strict";
  8890. /* WEBPACK VAR INJECTION */(function(uni) {
  8891. Object.defineProperty(exports, "__esModule", {
  8892. value: true
  8893. });
  8894. exports.default = void 0;
  8895. var _default = {
  8896. // 接口地址
  8897. serverUrl: "http://192.168.1.144:10102",
  8898. //http://47.93.34.200 http://www.freeskyghw.cn http://192.168.1.144:10102
  8899. wechatUrl: "http://47.93.34.200",
  8900. // 设备信息
  8901. system: uni.getSystemInfoSync(),
  8902. // 节目类型
  8903. pro_type: [
  8904. //
  8905. {
  8906. dict_label: '电视节目',
  8907. dict_value: '0'
  8908. }, {
  8909. dict_label: '电影节目',
  8910. dict_value: '1'
  8911. }]
  8912. };
  8913. exports.default = _default;
  8914. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  8915. /***/ }),
  8916. /* 34 */
  8917. /*!********************************************!*\
  8918. !*** D:/project/项目模板/uniapp/common/api.js ***!
  8919. \********************************************/
  8920. /*! no static exports found */
  8921. /***/ (function(module, exports, __webpack_require__) {
  8922. "use strict";
  8923. /* WEBPACK VAR INJECTION */(function(uni) {
  8924. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  8925. Object.defineProperty(exports, "__esModule", {
  8926. value: true
  8927. });
  8928. exports.requestFile = exports.requestBase = void 0;
  8929. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 35));
  8930. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 37));
  8931. var _config = _interopRequireDefault(__webpack_require__(/*! ../common/config */ 33));
  8932. var getDomain = function getDomain(uri, type) {
  8933. var serverUrl = _config.default.serverUrl,
  8934. wechatUrl = _config.default.wechatUrl;
  8935. // 自定义
  8936. if (uri.includes("http")) return uri;
  8937. // 微信
  8938. if (uri.startsWith("/wechat/api")) return wechatUrl + uri;
  8939. // 地址前缀
  8940. else if (type) return serverUrl + "/projectadmin/".concat(type, "/api/") + uri;
  8941. // 常规
  8942. return serverUrl + "/projectadmin/api/" + uri;
  8943. };
  8944. // 常规请求
  8945. var requestBase = /*#__PURE__*/function () {
  8946. var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(uri) {
  8947. var method,
  8948. data,
  8949. type,
  8950. baseUrl,
  8951. header,
  8952. token,
  8953. _args = arguments;
  8954. return _regenerator.default.wrap(function _callee$(_context) {
  8955. while (1) {
  8956. switch (_context.prev = _context.next) {
  8957. case 0:
  8958. method = _args.length > 1 && _args[1] !== undefined ? _args[1] : "GET";
  8959. data = _args.length > 2 ? _args[2] : undefined;
  8960. type = _args.length > 3 ? _args[3] : undefined;
  8961. // 请求地址
  8962. baseUrl = getDomain(uri, type); // 请求头
  8963. header = {}; // 用户信息
  8964. token = "";
  8965. if (token) header.token = token;
  8966. return _context.abrupt("return", new Promise(function (resolve, reject) {
  8967. uni.request({
  8968. url: baseUrl,
  8969. method: method,
  8970. data: data,
  8971. header: header,
  8972. success: function success(res) {
  8973. return toResolve(resolve, res);
  8974. },
  8975. fail: function fail(err) {
  8976. console.log(err);
  8977. }
  8978. });
  8979. }));
  8980. case 8:
  8981. case "end":
  8982. return _context.stop();
  8983. }
  8984. }
  8985. }, _callee);
  8986. }));
  8987. return function requestBase(_x) {
  8988. return _ref.apply(this, arguments);
  8989. };
  8990. }();
  8991. // 图片请求
  8992. exports.requestBase = requestBase;
  8993. var requestFile = function requestFile(uri, method, data, type) {
  8994. // 请求地址
  8995. var baseUrl = getDomain(uri, type);
  8996. return new Promise(function (resolve, reject) {
  8997. uni.uploadFile({
  8998. url: "https://broadcast.waityou24.cn/".concat(uri),
  8999. filePath: data,
  9000. name: 'file',
  9001. formData: {},
  9002. success: function success(res) {
  9003. return toResolve(resolve, res);
  9004. },
  9005. error: function error(e) {
  9006. return toReject(reject, e);
  9007. }
  9008. });
  9009. });
  9010. };
  9011. exports.requestFile = requestFile;
  9012. var toResolve = function toResolve(resolve, result) {
  9013. if (result.statusCode === 200) resolve(result.data);
  9014. };
  9015. var toReject = function toReject(reject, result) {
  9016. reject(result);
  9017. };
  9018. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  9019. /***/ }),
  9020. /* 35 */
  9021. /*!************************************************************************************************!*\
  9022. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/@babel/runtime/regenerator/index.js ***!
  9023. \************************************************************************************************/
  9024. /*! no static exports found */
  9025. /***/ (function(module, exports, __webpack_require__) {
  9026. // TODO(Babel 8): Remove this file.
  9027. var runtime = __webpack_require__(/*! @babel/runtime/helpers/regeneratorRuntime */ 36)();
  9028. module.exports = runtime;
  9029. /***/ }),
  9030. /* 36 */
  9031. /*!*******************************************************************!*\
  9032. !*** ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
  9033. \*******************************************************************/
  9034. /*! no static exports found */
  9035. /***/ (function(module, exports, __webpack_require__) {
  9036. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  9037. function _regeneratorRuntime() {
  9038. "use strict";
  9039. /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
  9040. module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
  9041. return exports;
  9042. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  9043. var exports = {},
  9044. Op = Object.prototype,
  9045. hasOwn = Op.hasOwnProperty,
  9046. defineProperty = Object.defineProperty || function (obj, key, desc) {
  9047. obj[key] = desc.value;
  9048. },
  9049. $Symbol = "function" == typeof Symbol ? Symbol : {},
  9050. iteratorSymbol = $Symbol.iterator || "@@iterator",
  9051. asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
  9052. toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  9053. function define(obj, key, value) {
  9054. return Object.defineProperty(obj, key, {
  9055. value: value,
  9056. enumerable: !0,
  9057. configurable: !0,
  9058. writable: !0
  9059. }), obj[key];
  9060. }
  9061. try {
  9062. define({}, "");
  9063. } catch (err) {
  9064. define = function define(obj, key, value) {
  9065. return obj[key] = value;
  9066. };
  9067. }
  9068. function wrap(innerFn, outerFn, self, tryLocsList) {
  9069. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
  9070. generator = Object.create(protoGenerator.prototype),
  9071. context = new Context(tryLocsList || []);
  9072. return defineProperty(generator, "_invoke", {
  9073. value: makeInvokeMethod(innerFn, self, context)
  9074. }), generator;
  9075. }
  9076. function tryCatch(fn, obj, arg) {
  9077. try {
  9078. return {
  9079. type: "normal",
  9080. arg: fn.call(obj, arg)
  9081. };
  9082. } catch (err) {
  9083. return {
  9084. type: "throw",
  9085. arg: err
  9086. };
  9087. }
  9088. }
  9089. exports.wrap = wrap;
  9090. var ContinueSentinel = {};
  9091. function Generator() {}
  9092. function GeneratorFunction() {}
  9093. function GeneratorFunctionPrototype() {}
  9094. var IteratorPrototype = {};
  9095. define(IteratorPrototype, iteratorSymbol, function () {
  9096. return this;
  9097. });
  9098. var getProto = Object.getPrototypeOf,
  9099. NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  9100. NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
  9101. var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
  9102. function defineIteratorMethods(prototype) {
  9103. ["next", "throw", "return"].forEach(function (method) {
  9104. define(prototype, method, function (arg) {
  9105. return this._invoke(method, arg);
  9106. });
  9107. });
  9108. }
  9109. function AsyncIterator(generator, PromiseImpl) {
  9110. function invoke(method, arg, resolve, reject) {
  9111. var record = tryCatch(generator[method], generator, arg);
  9112. if ("throw" !== record.type) {
  9113. var result = record.arg,
  9114. value = result.value;
  9115. return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
  9116. invoke("next", value, resolve, reject);
  9117. }, function (err) {
  9118. invoke("throw", err, resolve, reject);
  9119. }) : PromiseImpl.resolve(value).then(function (unwrapped) {
  9120. result.value = unwrapped, resolve(result);
  9121. }, function (error) {
  9122. return invoke("throw", error, resolve, reject);
  9123. });
  9124. }
  9125. reject(record.arg);
  9126. }
  9127. var previousPromise;
  9128. defineProperty(this, "_invoke", {
  9129. value: function value(method, arg) {
  9130. function callInvokeWithMethodAndArg() {
  9131. return new PromiseImpl(function (resolve, reject) {
  9132. invoke(method, arg, resolve, reject);
  9133. });
  9134. }
  9135. return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
  9136. }
  9137. });
  9138. }
  9139. function makeInvokeMethod(innerFn, self, context) {
  9140. var state = "suspendedStart";
  9141. return function (method, arg) {
  9142. if ("executing" === state) throw new Error("Generator is already running");
  9143. if ("completed" === state) {
  9144. if ("throw" === method) throw arg;
  9145. return doneResult();
  9146. }
  9147. for (context.method = method, context.arg = arg;;) {
  9148. var delegate = context.delegate;
  9149. if (delegate) {
  9150. var delegateResult = maybeInvokeDelegate(delegate, context);
  9151. if (delegateResult) {
  9152. if (delegateResult === ContinueSentinel) continue;
  9153. return delegateResult;
  9154. }
  9155. }
  9156. if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
  9157. if ("suspendedStart" === state) throw state = "completed", context.arg;
  9158. context.dispatchException(context.arg);
  9159. } else "return" === context.method && context.abrupt("return", context.arg);
  9160. state = "executing";
  9161. var record = tryCatch(innerFn, self, context);
  9162. if ("normal" === record.type) {
  9163. if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
  9164. return {
  9165. value: record.arg,
  9166. done: context.done
  9167. };
  9168. }
  9169. "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
  9170. }
  9171. };
  9172. }
  9173. function maybeInvokeDelegate(delegate, context) {
  9174. var methodName = context.method,
  9175. method = delegate.iterator[methodName];
  9176. if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
  9177. var record = tryCatch(method, delegate.iterator, context.arg);
  9178. if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
  9179. var info = record.arg;
  9180. return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
  9181. }
  9182. function pushTryEntry(locs) {
  9183. var entry = {
  9184. tryLoc: locs[0]
  9185. };
  9186. 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
  9187. }
  9188. function resetTryEntry(entry) {
  9189. var record = entry.completion || {};
  9190. record.type = "normal", delete record.arg, entry.completion = record;
  9191. }
  9192. function Context(tryLocsList) {
  9193. this.tryEntries = [{
  9194. tryLoc: "root"
  9195. }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
  9196. }
  9197. function values(iterable) {
  9198. if (iterable) {
  9199. var iteratorMethod = iterable[iteratorSymbol];
  9200. if (iteratorMethod) return iteratorMethod.call(iterable);
  9201. if ("function" == typeof iterable.next) return iterable;
  9202. if (!isNaN(iterable.length)) {
  9203. var i = -1,
  9204. next = function next() {
  9205. for (; ++i < iterable.length;) {
  9206. if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
  9207. }
  9208. return next.value = undefined, next.done = !0, next;
  9209. };
  9210. return next.next = next;
  9211. }
  9212. }
  9213. return {
  9214. next: doneResult
  9215. };
  9216. }
  9217. function doneResult() {
  9218. return {
  9219. value: undefined,
  9220. done: !0
  9221. };
  9222. }
  9223. return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
  9224. value: GeneratorFunctionPrototype,
  9225. configurable: !0
  9226. }), defineProperty(GeneratorFunctionPrototype, "constructor", {
  9227. value: GeneratorFunction,
  9228. configurable: !0
  9229. }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
  9230. var ctor = "function" == typeof genFun && genFun.constructor;
  9231. return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
  9232. }, exports.mark = function (genFun) {
  9233. return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
  9234. }, exports.awrap = function (arg) {
  9235. return {
  9236. __await: arg
  9237. };
  9238. }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
  9239. return this;
  9240. }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
  9241. void 0 === PromiseImpl && (PromiseImpl = Promise);
  9242. var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
  9243. return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
  9244. return result.done ? result.value : iter.next();
  9245. });
  9246. }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
  9247. return this;
  9248. }), define(Gp, "toString", function () {
  9249. return "[object Generator]";
  9250. }), exports.keys = function (val) {
  9251. var object = Object(val),
  9252. keys = [];
  9253. for (var key in object) {
  9254. keys.push(key);
  9255. }
  9256. return keys.reverse(), function next() {
  9257. for (; keys.length;) {
  9258. var key = keys.pop();
  9259. if (key in object) return next.value = key, next.done = !1, next;
  9260. }
  9261. return next.done = !0, next;
  9262. };
  9263. }, exports.values = values, Context.prototype = {
  9264. constructor: Context,
  9265. reset: function reset(skipTempReset) {
  9266. if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) {
  9267. "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
  9268. }
  9269. },
  9270. stop: function stop() {
  9271. this.done = !0;
  9272. var rootRecord = this.tryEntries[0].completion;
  9273. if ("throw" === rootRecord.type) throw rootRecord.arg;
  9274. return this.rval;
  9275. },
  9276. dispatchException: function dispatchException(exception) {
  9277. if (this.done) throw exception;
  9278. var context = this;
  9279. function handle(loc, caught) {
  9280. return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
  9281. }
  9282. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9283. var entry = this.tryEntries[i],
  9284. record = entry.completion;
  9285. if ("root" === entry.tryLoc) return handle("end");
  9286. if (entry.tryLoc <= this.prev) {
  9287. var hasCatch = hasOwn.call(entry, "catchLoc"),
  9288. hasFinally = hasOwn.call(entry, "finallyLoc");
  9289. if (hasCatch && hasFinally) {
  9290. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  9291. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  9292. } else if (hasCatch) {
  9293. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  9294. } else {
  9295. if (!hasFinally) throw new Error("try statement without catch or finally");
  9296. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  9297. }
  9298. }
  9299. }
  9300. },
  9301. abrupt: function abrupt(type, arg) {
  9302. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9303. var entry = this.tryEntries[i];
  9304. if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
  9305. var finallyEntry = entry;
  9306. break;
  9307. }
  9308. }
  9309. finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
  9310. var record = finallyEntry ? finallyEntry.completion : {};
  9311. return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
  9312. },
  9313. complete: function complete(record, afterLoc) {
  9314. if ("throw" === record.type) throw record.arg;
  9315. return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
  9316. },
  9317. finish: function finish(finallyLoc) {
  9318. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9319. var entry = this.tryEntries[i];
  9320. if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
  9321. }
  9322. },
  9323. "catch": function _catch(tryLoc) {
  9324. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9325. var entry = this.tryEntries[i];
  9326. if (entry.tryLoc === tryLoc) {
  9327. var record = entry.completion;
  9328. if ("throw" === record.type) {
  9329. var thrown = record.arg;
  9330. resetTryEntry(entry);
  9331. }
  9332. return thrown;
  9333. }
  9334. }
  9335. throw new Error("illegal catch attempt");
  9336. },
  9337. delegateYield: function delegateYield(iterable, resultName, nextLoc) {
  9338. return this.delegate = {
  9339. iterator: values(iterable),
  9340. resultName: resultName,
  9341. nextLoc: nextLoc
  9342. }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
  9343. }
  9344. }, exports;
  9345. }
  9346. module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
  9347. /***/ }),
  9348. /* 37 */
  9349. /*!*****************************************************************!*\
  9350. !*** ./node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
  9351. \*****************************************************************/
  9352. /*! no static exports found */
  9353. /***/ (function(module, exports) {
  9354. function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
  9355. try {
  9356. var info = gen[key](arg);
  9357. var value = info.value;
  9358. } catch (error) {
  9359. reject(error);
  9360. return;
  9361. }
  9362. if (info.done) {
  9363. resolve(value);
  9364. } else {
  9365. Promise.resolve(value).then(_next, _throw);
  9366. }
  9367. }
  9368. function _asyncToGenerator(fn) {
  9369. return function () {
  9370. var self = this,
  9371. args = arguments;
  9372. return new Promise(function (resolve, reject) {
  9373. var gen = fn.apply(self, args);
  9374. function _next(value) {
  9375. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
  9376. }
  9377. function _throw(err) {
  9378. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
  9379. }
  9380. _next(undefined);
  9381. });
  9382. };
  9383. }
  9384. module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
  9385. /***/ }),
  9386. /* 38 */,
  9387. /* 39 */,
  9388. /* 40 */,
  9389. /* 41 */,
  9390. /* 42 */,
  9391. /* 43 */,
  9392. /* 44 */,
  9393. /* 45 */,
  9394. /* 46 */,
  9395. /* 47 */,
  9396. /* 48 */,
  9397. /* 49 */,
  9398. /* 50 */,
  9399. /* 51 */,
  9400. /* 52 */,
  9401. /* 53 */,
  9402. /* 54 */,
  9403. /* 55 */,
  9404. /* 56 */,
  9405. /* 57 */,
  9406. /* 58 */,
  9407. /* 59 */,
  9408. /* 60 */,
  9409. /* 61 */,
  9410. /* 62 */,
  9411. /* 63 */,
  9412. /* 64 */,
  9413. /* 65 */,
  9414. /* 66 */,
  9415. /* 67 */,
  9416. /* 68 */,
  9417. /* 69 */,
  9418. /* 70 */,
  9419. /* 71 */,
  9420. /* 72 */,
  9421. /* 73 */,
  9422. /* 74 */,
  9423. /* 75 */,
  9424. /* 76 */,
  9425. /* 77 */,
  9426. /* 78 */,
  9427. /* 79 */,
  9428. /* 80 */,
  9429. /* 81 */,
  9430. /* 82 */,
  9431. /* 83 */,
  9432. /* 84 */,
  9433. /* 85 */,
  9434. /* 86 */,
  9435. /* 87 */,
  9436. /* 88 */,
  9437. /* 89 */,
  9438. /* 90 */,
  9439. /* 91 */,
  9440. /* 92 */,
  9441. /* 93 */,
  9442. /* 94 */,
  9443. /* 95 */,
  9444. /* 96 */,
  9445. /* 97 */,
  9446. /* 98 */,
  9447. /* 99 */,
  9448. /* 100 */,
  9449. /* 101 */,
  9450. /* 102 */,
  9451. /* 103 */,
  9452. /* 104 */,
  9453. /* 105 */,
  9454. /* 106 */,
  9455. /* 107 */,
  9456. /* 108 */,
  9457. /* 109 */,
  9458. /* 110 */,
  9459. /* 111 */,
  9460. /* 112 */,
  9461. /* 113 */,
  9462. /* 114 */,
  9463. /* 115 */,
  9464. /* 116 */,
  9465. /* 117 */,
  9466. /* 118 */
  9467. /*!**********************************************************************************!*\
  9468. !*** D:/project/项目模板/uniapp/uni_modules/uni-icons/components/uni-icons/icons.js ***!
  9469. \**********************************************************************************/
  9470. /*! no static exports found */
  9471. /***/ (function(module, exports, __webpack_require__) {
  9472. "use strict";
  9473. Object.defineProperty(exports, "__esModule", {
  9474. value: true
  9475. });
  9476. exports.default = void 0;
  9477. var _default = {
  9478. "id": "2852637",
  9479. "name": "uniui图标库",
  9480. "font_family": "uniicons",
  9481. "css_prefix_text": "uniui-",
  9482. "description": "",
  9483. "glyphs": [{
  9484. "icon_id": "25027049",
  9485. "name": "yanse",
  9486. "font_class": "color",
  9487. "unicode": "e6cf",
  9488. "unicode_decimal": 59087
  9489. }, {
  9490. "icon_id": "25027048",
  9491. "name": "wallet",
  9492. "font_class": "wallet",
  9493. "unicode": "e6b1",
  9494. "unicode_decimal": 59057
  9495. }, {
  9496. "icon_id": "25015720",
  9497. "name": "settings-filled",
  9498. "font_class": "settings-filled",
  9499. "unicode": "e6ce",
  9500. "unicode_decimal": 59086
  9501. }, {
  9502. "icon_id": "25015434",
  9503. "name": "shimingrenzheng-filled",
  9504. "font_class": "auth-filled",
  9505. "unicode": "e6cc",
  9506. "unicode_decimal": 59084
  9507. }, {
  9508. "icon_id": "24934246",
  9509. "name": "shop-filled",
  9510. "font_class": "shop-filled",
  9511. "unicode": "e6cd",
  9512. "unicode_decimal": 59085
  9513. }, {
  9514. "icon_id": "24934159",
  9515. "name": "staff-filled-01",
  9516. "font_class": "staff-filled",
  9517. "unicode": "e6cb",
  9518. "unicode_decimal": 59083
  9519. }, {
  9520. "icon_id": "24932461",
  9521. "name": "VIP-filled",
  9522. "font_class": "vip-filled",
  9523. "unicode": "e6c6",
  9524. "unicode_decimal": 59078
  9525. }, {
  9526. "icon_id": "24932462",
  9527. "name": "plus_circle_fill",
  9528. "font_class": "plus-filled",
  9529. "unicode": "e6c7",
  9530. "unicode_decimal": 59079
  9531. }, {
  9532. "icon_id": "24932463",
  9533. "name": "folder_add-filled",
  9534. "font_class": "folder-add-filled",
  9535. "unicode": "e6c8",
  9536. "unicode_decimal": 59080
  9537. }, {
  9538. "icon_id": "24932464",
  9539. "name": "yanse-filled",
  9540. "font_class": "color-filled",
  9541. "unicode": "e6c9",
  9542. "unicode_decimal": 59081
  9543. }, {
  9544. "icon_id": "24932465",
  9545. "name": "tune-filled",
  9546. "font_class": "tune-filled",
  9547. "unicode": "e6ca",
  9548. "unicode_decimal": 59082
  9549. }, {
  9550. "icon_id": "24932455",
  9551. "name": "a-rilidaka-filled",
  9552. "font_class": "calendar-filled",
  9553. "unicode": "e6c0",
  9554. "unicode_decimal": 59072
  9555. }, {
  9556. "icon_id": "24932456",
  9557. "name": "notification-filled",
  9558. "font_class": "notification-filled",
  9559. "unicode": "e6c1",
  9560. "unicode_decimal": 59073
  9561. }, {
  9562. "icon_id": "24932457",
  9563. "name": "wallet-filled",
  9564. "font_class": "wallet-filled",
  9565. "unicode": "e6c2",
  9566. "unicode_decimal": 59074
  9567. }, {
  9568. "icon_id": "24932458",
  9569. "name": "paihangbang-filled",
  9570. "font_class": "medal-filled",
  9571. "unicode": "e6c3",
  9572. "unicode_decimal": 59075
  9573. }, {
  9574. "icon_id": "24932459",
  9575. "name": "gift-filled",
  9576. "font_class": "gift-filled",
  9577. "unicode": "e6c4",
  9578. "unicode_decimal": 59076
  9579. }, {
  9580. "icon_id": "24932460",
  9581. "name": "fire-filled",
  9582. "font_class": "fire-filled",
  9583. "unicode": "e6c5",
  9584. "unicode_decimal": 59077
  9585. }, {
  9586. "icon_id": "24928001",
  9587. "name": "refreshempty",
  9588. "font_class": "refreshempty",
  9589. "unicode": "e6bf",
  9590. "unicode_decimal": 59071
  9591. }, {
  9592. "icon_id": "24926853",
  9593. "name": "location-ellipse",
  9594. "font_class": "location-filled",
  9595. "unicode": "e6af",
  9596. "unicode_decimal": 59055
  9597. }, {
  9598. "icon_id": "24926735",
  9599. "name": "person-filled",
  9600. "font_class": "person-filled",
  9601. "unicode": "e69d",
  9602. "unicode_decimal": 59037
  9603. }, {
  9604. "icon_id": "24926703",
  9605. "name": "personadd-filled",
  9606. "font_class": "personadd-filled",
  9607. "unicode": "e698",
  9608. "unicode_decimal": 59032
  9609. }, {
  9610. "icon_id": "24923351",
  9611. "name": "back",
  9612. "font_class": "back",
  9613. "unicode": "e6b9",
  9614. "unicode_decimal": 59065
  9615. }, {
  9616. "icon_id": "24923352",
  9617. "name": "forward",
  9618. "font_class": "forward",
  9619. "unicode": "e6ba",
  9620. "unicode_decimal": 59066
  9621. }, {
  9622. "icon_id": "24923353",
  9623. "name": "arrowthinright",
  9624. "font_class": "arrow-right",
  9625. "unicode": "e6bb",
  9626. "unicode_decimal": 59067
  9627. }, {
  9628. "icon_id": "24923353",
  9629. "name": "arrowthinright",
  9630. "font_class": "arrowthinright",
  9631. "unicode": "e6bb",
  9632. "unicode_decimal": 59067
  9633. }, {
  9634. "icon_id": "24923354",
  9635. "name": "arrowthinleft",
  9636. "font_class": "arrow-left",
  9637. "unicode": "e6bc",
  9638. "unicode_decimal": 59068
  9639. }, {
  9640. "icon_id": "24923354",
  9641. "name": "arrowthinleft",
  9642. "font_class": "arrowthinleft",
  9643. "unicode": "e6bc",
  9644. "unicode_decimal": 59068
  9645. }, {
  9646. "icon_id": "24923355",
  9647. "name": "arrowthinup",
  9648. "font_class": "arrow-up",
  9649. "unicode": "e6bd",
  9650. "unicode_decimal": 59069
  9651. }, {
  9652. "icon_id": "24923355",
  9653. "name": "arrowthinup",
  9654. "font_class": "arrowthinup",
  9655. "unicode": "e6bd",
  9656. "unicode_decimal": 59069
  9657. }, {
  9658. "icon_id": "24923356",
  9659. "name": "arrowthindown",
  9660. "font_class": "arrow-down",
  9661. "unicode": "e6be",
  9662. "unicode_decimal": 59070
  9663. }, {
  9664. "icon_id": "24923356",
  9665. "name": "arrowthindown",
  9666. "font_class": "arrowthindown",
  9667. "unicode": "e6be",
  9668. "unicode_decimal": 59070
  9669. }, {
  9670. "icon_id": "24923349",
  9671. "name": "arrowdown",
  9672. "font_class": "bottom",
  9673. "unicode": "e6b8",
  9674. "unicode_decimal": 59064
  9675. }, {
  9676. "icon_id": "24923349",
  9677. "name": "arrowdown",
  9678. "font_class": "arrowdown",
  9679. "unicode": "e6b8",
  9680. "unicode_decimal": 59064
  9681. }, {
  9682. "icon_id": "24923346",
  9683. "name": "arrowright",
  9684. "font_class": "right",
  9685. "unicode": "e6b5",
  9686. "unicode_decimal": 59061
  9687. }, {
  9688. "icon_id": "24923346",
  9689. "name": "arrowright",
  9690. "font_class": "arrowright",
  9691. "unicode": "e6b5",
  9692. "unicode_decimal": 59061
  9693. }, {
  9694. "icon_id": "24923347",
  9695. "name": "arrowup",
  9696. "font_class": "top",
  9697. "unicode": "e6b6",
  9698. "unicode_decimal": 59062
  9699. }, {
  9700. "icon_id": "24923347",
  9701. "name": "arrowup",
  9702. "font_class": "arrowup",
  9703. "unicode": "e6b6",
  9704. "unicode_decimal": 59062
  9705. }, {
  9706. "icon_id": "24923348",
  9707. "name": "arrowleft",
  9708. "font_class": "left",
  9709. "unicode": "e6b7",
  9710. "unicode_decimal": 59063
  9711. }, {
  9712. "icon_id": "24923348",
  9713. "name": "arrowleft",
  9714. "font_class": "arrowleft",
  9715. "unicode": "e6b7",
  9716. "unicode_decimal": 59063
  9717. }, {
  9718. "icon_id": "24923334",
  9719. "name": "eye",
  9720. "font_class": "eye",
  9721. "unicode": "e651",
  9722. "unicode_decimal": 58961
  9723. }, {
  9724. "icon_id": "24923335",
  9725. "name": "eye-filled",
  9726. "font_class": "eye-filled",
  9727. "unicode": "e66a",
  9728. "unicode_decimal": 58986
  9729. }, {
  9730. "icon_id": "24923336",
  9731. "name": "eye-slash",
  9732. "font_class": "eye-slash",
  9733. "unicode": "e6b3",
  9734. "unicode_decimal": 59059
  9735. }, {
  9736. "icon_id": "24923337",
  9737. "name": "eye-slash-filled",
  9738. "font_class": "eye-slash-filled",
  9739. "unicode": "e6b4",
  9740. "unicode_decimal": 59060
  9741. }, {
  9742. "icon_id": "24923305",
  9743. "name": "info-filled",
  9744. "font_class": "info-filled",
  9745. "unicode": "e649",
  9746. "unicode_decimal": 58953
  9747. }, {
  9748. "icon_id": "24923299",
  9749. "name": "reload-01",
  9750. "font_class": "reload",
  9751. "unicode": "e6b2",
  9752. "unicode_decimal": 59058
  9753. }, {
  9754. "icon_id": "24923195",
  9755. "name": "mic_slash_fill",
  9756. "font_class": "micoff-filled",
  9757. "unicode": "e6b0",
  9758. "unicode_decimal": 59056
  9759. }, {
  9760. "icon_id": "24923165",
  9761. "name": "map-pin-ellipse",
  9762. "font_class": "map-pin-ellipse",
  9763. "unicode": "e6ac",
  9764. "unicode_decimal": 59052
  9765. }, {
  9766. "icon_id": "24923166",
  9767. "name": "map-pin",
  9768. "font_class": "map-pin",
  9769. "unicode": "e6ad",
  9770. "unicode_decimal": 59053
  9771. }, {
  9772. "icon_id": "24923167",
  9773. "name": "location",
  9774. "font_class": "location",
  9775. "unicode": "e6ae",
  9776. "unicode_decimal": 59054
  9777. }, {
  9778. "icon_id": "24923064",
  9779. "name": "starhalf",
  9780. "font_class": "starhalf",
  9781. "unicode": "e683",
  9782. "unicode_decimal": 59011
  9783. }, {
  9784. "icon_id": "24923065",
  9785. "name": "star",
  9786. "font_class": "star",
  9787. "unicode": "e688",
  9788. "unicode_decimal": 59016
  9789. }, {
  9790. "icon_id": "24923066",
  9791. "name": "star-filled",
  9792. "font_class": "star-filled",
  9793. "unicode": "e68f",
  9794. "unicode_decimal": 59023
  9795. }, {
  9796. "icon_id": "24899646",
  9797. "name": "a-rilidaka",
  9798. "font_class": "calendar",
  9799. "unicode": "e6a0",
  9800. "unicode_decimal": 59040
  9801. }, {
  9802. "icon_id": "24899647",
  9803. "name": "fire",
  9804. "font_class": "fire",
  9805. "unicode": "e6a1",
  9806. "unicode_decimal": 59041
  9807. }, {
  9808. "icon_id": "24899648",
  9809. "name": "paihangbang",
  9810. "font_class": "medal",
  9811. "unicode": "e6a2",
  9812. "unicode_decimal": 59042
  9813. }, {
  9814. "icon_id": "24899649",
  9815. "name": "font",
  9816. "font_class": "font",
  9817. "unicode": "e6a3",
  9818. "unicode_decimal": 59043
  9819. }, {
  9820. "icon_id": "24899650",
  9821. "name": "gift",
  9822. "font_class": "gift",
  9823. "unicode": "e6a4",
  9824. "unicode_decimal": 59044
  9825. }, {
  9826. "icon_id": "24899651",
  9827. "name": "link",
  9828. "font_class": "link",
  9829. "unicode": "e6a5",
  9830. "unicode_decimal": 59045
  9831. }, {
  9832. "icon_id": "24899652",
  9833. "name": "notification",
  9834. "font_class": "notification",
  9835. "unicode": "e6a6",
  9836. "unicode_decimal": 59046
  9837. }, {
  9838. "icon_id": "24899653",
  9839. "name": "staff",
  9840. "font_class": "staff",
  9841. "unicode": "e6a7",
  9842. "unicode_decimal": 59047
  9843. }, {
  9844. "icon_id": "24899654",
  9845. "name": "VIP",
  9846. "font_class": "vip",
  9847. "unicode": "e6a8",
  9848. "unicode_decimal": 59048
  9849. }, {
  9850. "icon_id": "24899655",
  9851. "name": "folder_add",
  9852. "font_class": "folder-add",
  9853. "unicode": "e6a9",
  9854. "unicode_decimal": 59049
  9855. }, {
  9856. "icon_id": "24899656",
  9857. "name": "tune",
  9858. "font_class": "tune",
  9859. "unicode": "e6aa",
  9860. "unicode_decimal": 59050
  9861. }, {
  9862. "icon_id": "24899657",
  9863. "name": "shimingrenzheng",
  9864. "font_class": "auth",
  9865. "unicode": "e6ab",
  9866. "unicode_decimal": 59051
  9867. }, {
  9868. "icon_id": "24899565",
  9869. "name": "person",
  9870. "font_class": "person",
  9871. "unicode": "e699",
  9872. "unicode_decimal": 59033
  9873. }, {
  9874. "icon_id": "24899566",
  9875. "name": "email-filled",
  9876. "font_class": "email-filled",
  9877. "unicode": "e69a",
  9878. "unicode_decimal": 59034
  9879. }, {
  9880. "icon_id": "24899567",
  9881. "name": "phone-filled",
  9882. "font_class": "phone-filled",
  9883. "unicode": "e69b",
  9884. "unicode_decimal": 59035
  9885. }, {
  9886. "icon_id": "24899568",
  9887. "name": "phone",
  9888. "font_class": "phone",
  9889. "unicode": "e69c",
  9890. "unicode_decimal": 59036
  9891. }, {
  9892. "icon_id": "24899570",
  9893. "name": "email",
  9894. "font_class": "email",
  9895. "unicode": "e69e",
  9896. "unicode_decimal": 59038
  9897. }, {
  9898. "icon_id": "24899571",
  9899. "name": "personadd",
  9900. "font_class": "personadd",
  9901. "unicode": "e69f",
  9902. "unicode_decimal": 59039
  9903. }, {
  9904. "icon_id": "24899558",
  9905. "name": "chatboxes-filled",
  9906. "font_class": "chatboxes-filled",
  9907. "unicode": "e692",
  9908. "unicode_decimal": 59026
  9909. }, {
  9910. "icon_id": "24899559",
  9911. "name": "contact",
  9912. "font_class": "contact",
  9913. "unicode": "e693",
  9914. "unicode_decimal": 59027
  9915. }, {
  9916. "icon_id": "24899560",
  9917. "name": "chatbubble-filled",
  9918. "font_class": "chatbubble-filled",
  9919. "unicode": "e694",
  9920. "unicode_decimal": 59028
  9921. }, {
  9922. "icon_id": "24899561",
  9923. "name": "contact-filled",
  9924. "font_class": "contact-filled",
  9925. "unicode": "e695",
  9926. "unicode_decimal": 59029
  9927. }, {
  9928. "icon_id": "24899562",
  9929. "name": "chatboxes",
  9930. "font_class": "chatboxes",
  9931. "unicode": "e696",
  9932. "unicode_decimal": 59030
  9933. }, {
  9934. "icon_id": "24899563",
  9935. "name": "chatbubble",
  9936. "font_class": "chatbubble",
  9937. "unicode": "e697",
  9938. "unicode_decimal": 59031
  9939. }, {
  9940. "icon_id": "24881290",
  9941. "name": "upload-filled",
  9942. "font_class": "upload-filled",
  9943. "unicode": "e68e",
  9944. "unicode_decimal": 59022
  9945. }, {
  9946. "icon_id": "24881292",
  9947. "name": "upload",
  9948. "font_class": "upload",
  9949. "unicode": "e690",
  9950. "unicode_decimal": 59024
  9951. }, {
  9952. "icon_id": "24881293",
  9953. "name": "weixin",
  9954. "font_class": "weixin",
  9955. "unicode": "e691",
  9956. "unicode_decimal": 59025
  9957. }, {
  9958. "icon_id": "24881274",
  9959. "name": "compose",
  9960. "font_class": "compose",
  9961. "unicode": "e67f",
  9962. "unicode_decimal": 59007
  9963. }, {
  9964. "icon_id": "24881275",
  9965. "name": "qq",
  9966. "font_class": "qq",
  9967. "unicode": "e680",
  9968. "unicode_decimal": 59008
  9969. }, {
  9970. "icon_id": "24881276",
  9971. "name": "download-filled",
  9972. "font_class": "download-filled",
  9973. "unicode": "e681",
  9974. "unicode_decimal": 59009
  9975. }, {
  9976. "icon_id": "24881277",
  9977. "name": "pengyouquan",
  9978. "font_class": "pyq",
  9979. "unicode": "e682",
  9980. "unicode_decimal": 59010
  9981. }, {
  9982. "icon_id": "24881279",
  9983. "name": "sound",
  9984. "font_class": "sound",
  9985. "unicode": "e684",
  9986. "unicode_decimal": 59012
  9987. }, {
  9988. "icon_id": "24881280",
  9989. "name": "trash-filled",
  9990. "font_class": "trash-filled",
  9991. "unicode": "e685",
  9992. "unicode_decimal": 59013
  9993. }, {
  9994. "icon_id": "24881281",
  9995. "name": "sound-filled",
  9996. "font_class": "sound-filled",
  9997. "unicode": "e686",
  9998. "unicode_decimal": 59014
  9999. }, {
  10000. "icon_id": "24881282",
  10001. "name": "trash",
  10002. "font_class": "trash",
  10003. "unicode": "e687",
  10004. "unicode_decimal": 59015
  10005. }, {
  10006. "icon_id": "24881284",
  10007. "name": "videocam-filled",
  10008. "font_class": "videocam-filled",
  10009. "unicode": "e689",
  10010. "unicode_decimal": 59017
  10011. }, {
  10012. "icon_id": "24881285",
  10013. "name": "spinner-cycle",
  10014. "font_class": "spinner-cycle",
  10015. "unicode": "e68a",
  10016. "unicode_decimal": 59018
  10017. }, {
  10018. "icon_id": "24881286",
  10019. "name": "weibo",
  10020. "font_class": "weibo",
  10021. "unicode": "e68b",
  10022. "unicode_decimal": 59019
  10023. }, {
  10024. "icon_id": "24881288",
  10025. "name": "videocam",
  10026. "font_class": "videocam",
  10027. "unicode": "e68c",
  10028. "unicode_decimal": 59020
  10029. }, {
  10030. "icon_id": "24881289",
  10031. "name": "download",
  10032. "font_class": "download",
  10033. "unicode": "e68d",
  10034. "unicode_decimal": 59021
  10035. }, {
  10036. "icon_id": "24879601",
  10037. "name": "help",
  10038. "font_class": "help",
  10039. "unicode": "e679",
  10040. "unicode_decimal": 59001
  10041. }, {
  10042. "icon_id": "24879602",
  10043. "name": "navigate-filled",
  10044. "font_class": "navigate-filled",
  10045. "unicode": "e67a",
  10046. "unicode_decimal": 59002
  10047. }, {
  10048. "icon_id": "24879603",
  10049. "name": "plusempty",
  10050. "font_class": "plusempty",
  10051. "unicode": "e67b",
  10052. "unicode_decimal": 59003
  10053. }, {
  10054. "icon_id": "24879604",
  10055. "name": "smallcircle",
  10056. "font_class": "smallcircle",
  10057. "unicode": "e67c",
  10058. "unicode_decimal": 59004
  10059. }, {
  10060. "icon_id": "24879605",
  10061. "name": "minus-filled",
  10062. "font_class": "minus-filled",
  10063. "unicode": "e67d",
  10064. "unicode_decimal": 59005
  10065. }, {
  10066. "icon_id": "24879606",
  10067. "name": "micoff",
  10068. "font_class": "micoff",
  10069. "unicode": "e67e",
  10070. "unicode_decimal": 59006
  10071. }, {
  10072. "icon_id": "24879588",
  10073. "name": "closeempty",
  10074. "font_class": "closeempty",
  10075. "unicode": "e66c",
  10076. "unicode_decimal": 58988
  10077. }, {
  10078. "icon_id": "24879589",
  10079. "name": "clear",
  10080. "font_class": "clear",
  10081. "unicode": "e66d",
  10082. "unicode_decimal": 58989
  10083. }, {
  10084. "icon_id": "24879590",
  10085. "name": "navigate",
  10086. "font_class": "navigate",
  10087. "unicode": "e66e",
  10088. "unicode_decimal": 58990
  10089. }, {
  10090. "icon_id": "24879591",
  10091. "name": "minus",
  10092. "font_class": "minus",
  10093. "unicode": "e66f",
  10094. "unicode_decimal": 58991
  10095. }, {
  10096. "icon_id": "24879592",
  10097. "name": "image",
  10098. "font_class": "image",
  10099. "unicode": "e670",
  10100. "unicode_decimal": 58992
  10101. }, {
  10102. "icon_id": "24879593",
  10103. "name": "mic",
  10104. "font_class": "mic",
  10105. "unicode": "e671",
  10106. "unicode_decimal": 58993
  10107. }, {
  10108. "icon_id": "24879594",
  10109. "name": "paperplane",
  10110. "font_class": "paperplane",
  10111. "unicode": "e672",
  10112. "unicode_decimal": 58994
  10113. }, {
  10114. "icon_id": "24879595",
  10115. "name": "close",
  10116. "font_class": "close",
  10117. "unicode": "e673",
  10118. "unicode_decimal": 58995
  10119. }, {
  10120. "icon_id": "24879596",
  10121. "name": "help-filled",
  10122. "font_class": "help-filled",
  10123. "unicode": "e674",
  10124. "unicode_decimal": 58996
  10125. }, {
  10126. "icon_id": "24879597",
  10127. "name": "plus-filled",
  10128. "font_class": "paperplane-filled",
  10129. "unicode": "e675",
  10130. "unicode_decimal": 58997
  10131. }, {
  10132. "icon_id": "24879598",
  10133. "name": "plus",
  10134. "font_class": "plus",
  10135. "unicode": "e676",
  10136. "unicode_decimal": 58998
  10137. }, {
  10138. "icon_id": "24879599",
  10139. "name": "mic-filled",
  10140. "font_class": "mic-filled",
  10141. "unicode": "e677",
  10142. "unicode_decimal": 58999
  10143. }, {
  10144. "icon_id": "24879600",
  10145. "name": "image-filled",
  10146. "font_class": "image-filled",
  10147. "unicode": "e678",
  10148. "unicode_decimal": 59000
  10149. }, {
  10150. "icon_id": "24855900",
  10151. "name": "locked-filled",
  10152. "font_class": "locked-filled",
  10153. "unicode": "e668",
  10154. "unicode_decimal": 58984
  10155. }, {
  10156. "icon_id": "24855901",
  10157. "name": "info",
  10158. "font_class": "info",
  10159. "unicode": "e669",
  10160. "unicode_decimal": 58985
  10161. }, {
  10162. "icon_id": "24855903",
  10163. "name": "locked",
  10164. "font_class": "locked",
  10165. "unicode": "e66b",
  10166. "unicode_decimal": 58987
  10167. }, {
  10168. "icon_id": "24855884",
  10169. "name": "camera-filled",
  10170. "font_class": "camera-filled",
  10171. "unicode": "e658",
  10172. "unicode_decimal": 58968
  10173. }, {
  10174. "icon_id": "24855885",
  10175. "name": "chat-filled",
  10176. "font_class": "chat-filled",
  10177. "unicode": "e659",
  10178. "unicode_decimal": 58969
  10179. }, {
  10180. "icon_id": "24855886",
  10181. "name": "camera",
  10182. "font_class": "camera",
  10183. "unicode": "e65a",
  10184. "unicode_decimal": 58970
  10185. }, {
  10186. "icon_id": "24855887",
  10187. "name": "circle",
  10188. "font_class": "circle",
  10189. "unicode": "e65b",
  10190. "unicode_decimal": 58971
  10191. }, {
  10192. "icon_id": "24855888",
  10193. "name": "checkmarkempty",
  10194. "font_class": "checkmarkempty",
  10195. "unicode": "e65c",
  10196. "unicode_decimal": 58972
  10197. }, {
  10198. "icon_id": "24855889",
  10199. "name": "chat",
  10200. "font_class": "chat",
  10201. "unicode": "e65d",
  10202. "unicode_decimal": 58973
  10203. }, {
  10204. "icon_id": "24855890",
  10205. "name": "circle-filled",
  10206. "font_class": "circle-filled",
  10207. "unicode": "e65e",
  10208. "unicode_decimal": 58974
  10209. }, {
  10210. "icon_id": "24855891",
  10211. "name": "flag",
  10212. "font_class": "flag",
  10213. "unicode": "e65f",
  10214. "unicode_decimal": 58975
  10215. }, {
  10216. "icon_id": "24855892",
  10217. "name": "flag-filled",
  10218. "font_class": "flag-filled",
  10219. "unicode": "e660",
  10220. "unicode_decimal": 58976
  10221. }, {
  10222. "icon_id": "24855893",
  10223. "name": "gear-filled",
  10224. "font_class": "gear-filled",
  10225. "unicode": "e661",
  10226. "unicode_decimal": 58977
  10227. }, {
  10228. "icon_id": "24855894",
  10229. "name": "home",
  10230. "font_class": "home",
  10231. "unicode": "e662",
  10232. "unicode_decimal": 58978
  10233. }, {
  10234. "icon_id": "24855895",
  10235. "name": "home-filled",
  10236. "font_class": "home-filled",
  10237. "unicode": "e663",
  10238. "unicode_decimal": 58979
  10239. }, {
  10240. "icon_id": "24855896",
  10241. "name": "gear",
  10242. "font_class": "gear",
  10243. "unicode": "e664",
  10244. "unicode_decimal": 58980
  10245. }, {
  10246. "icon_id": "24855897",
  10247. "name": "smallcircle-filled",
  10248. "font_class": "smallcircle-filled",
  10249. "unicode": "e665",
  10250. "unicode_decimal": 58981
  10251. }, {
  10252. "icon_id": "24855898",
  10253. "name": "map-filled",
  10254. "font_class": "map-filled",
  10255. "unicode": "e666",
  10256. "unicode_decimal": 58982
  10257. }, {
  10258. "icon_id": "24855899",
  10259. "name": "map",
  10260. "font_class": "map",
  10261. "unicode": "e667",
  10262. "unicode_decimal": 58983
  10263. }, {
  10264. "icon_id": "24855825",
  10265. "name": "refresh-filled",
  10266. "font_class": "refresh-filled",
  10267. "unicode": "e656",
  10268. "unicode_decimal": 58966
  10269. }, {
  10270. "icon_id": "24855826",
  10271. "name": "refresh",
  10272. "font_class": "refresh",
  10273. "unicode": "e657",
  10274. "unicode_decimal": 58967
  10275. }, {
  10276. "icon_id": "24855808",
  10277. "name": "cloud-upload",
  10278. "font_class": "cloud-upload",
  10279. "unicode": "e645",
  10280. "unicode_decimal": 58949
  10281. }, {
  10282. "icon_id": "24855809",
  10283. "name": "cloud-download-filled",
  10284. "font_class": "cloud-download-filled",
  10285. "unicode": "e646",
  10286. "unicode_decimal": 58950
  10287. }, {
  10288. "icon_id": "24855810",
  10289. "name": "cloud-download",
  10290. "font_class": "cloud-download",
  10291. "unicode": "e647",
  10292. "unicode_decimal": 58951
  10293. }, {
  10294. "icon_id": "24855811",
  10295. "name": "cloud-upload-filled",
  10296. "font_class": "cloud-upload-filled",
  10297. "unicode": "e648",
  10298. "unicode_decimal": 58952
  10299. }, {
  10300. "icon_id": "24855813",
  10301. "name": "redo",
  10302. "font_class": "redo",
  10303. "unicode": "e64a",
  10304. "unicode_decimal": 58954
  10305. }, {
  10306. "icon_id": "24855814",
  10307. "name": "images-filled",
  10308. "font_class": "images-filled",
  10309. "unicode": "e64b",
  10310. "unicode_decimal": 58955
  10311. }, {
  10312. "icon_id": "24855815",
  10313. "name": "undo-filled",
  10314. "font_class": "undo-filled",
  10315. "unicode": "e64c",
  10316. "unicode_decimal": 58956
  10317. }, {
  10318. "icon_id": "24855816",
  10319. "name": "more",
  10320. "font_class": "more",
  10321. "unicode": "e64d",
  10322. "unicode_decimal": 58957
  10323. }, {
  10324. "icon_id": "24855817",
  10325. "name": "more-filled",
  10326. "font_class": "more-filled",
  10327. "unicode": "e64e",
  10328. "unicode_decimal": 58958
  10329. }, {
  10330. "icon_id": "24855818",
  10331. "name": "undo",
  10332. "font_class": "undo",
  10333. "unicode": "e64f",
  10334. "unicode_decimal": 58959
  10335. }, {
  10336. "icon_id": "24855819",
  10337. "name": "images",
  10338. "font_class": "images",
  10339. "unicode": "e650",
  10340. "unicode_decimal": 58960
  10341. }, {
  10342. "icon_id": "24855821",
  10343. "name": "paperclip",
  10344. "font_class": "paperclip",
  10345. "unicode": "e652",
  10346. "unicode_decimal": 58962
  10347. }, {
  10348. "icon_id": "24855822",
  10349. "name": "settings",
  10350. "font_class": "settings",
  10351. "unicode": "e653",
  10352. "unicode_decimal": 58963
  10353. }, {
  10354. "icon_id": "24855823",
  10355. "name": "search",
  10356. "font_class": "search",
  10357. "unicode": "e654",
  10358. "unicode_decimal": 58964
  10359. }, {
  10360. "icon_id": "24855824",
  10361. "name": "redo-filled",
  10362. "font_class": "redo-filled",
  10363. "unicode": "e655",
  10364. "unicode_decimal": 58965
  10365. }, {
  10366. "icon_id": "24841702",
  10367. "name": "list",
  10368. "font_class": "list",
  10369. "unicode": "e644",
  10370. "unicode_decimal": 58948
  10371. }, {
  10372. "icon_id": "24841489",
  10373. "name": "mail-open-filled",
  10374. "font_class": "mail-open-filled",
  10375. "unicode": "e63a",
  10376. "unicode_decimal": 58938
  10377. }, {
  10378. "icon_id": "24841491",
  10379. "name": "hand-thumbsdown-filled",
  10380. "font_class": "hand-down-filled",
  10381. "unicode": "e63c",
  10382. "unicode_decimal": 58940
  10383. }, {
  10384. "icon_id": "24841492",
  10385. "name": "hand-thumbsdown",
  10386. "font_class": "hand-down",
  10387. "unicode": "e63d",
  10388. "unicode_decimal": 58941
  10389. }, {
  10390. "icon_id": "24841493",
  10391. "name": "hand-thumbsup-filled",
  10392. "font_class": "hand-up-filled",
  10393. "unicode": "e63e",
  10394. "unicode_decimal": 58942
  10395. }, {
  10396. "icon_id": "24841494",
  10397. "name": "hand-thumbsup",
  10398. "font_class": "hand-up",
  10399. "unicode": "e63f",
  10400. "unicode_decimal": 58943
  10401. }, {
  10402. "icon_id": "24841496",
  10403. "name": "heart-filled",
  10404. "font_class": "heart-filled",
  10405. "unicode": "e641",
  10406. "unicode_decimal": 58945
  10407. }, {
  10408. "icon_id": "24841498",
  10409. "name": "mail-open",
  10410. "font_class": "mail-open",
  10411. "unicode": "e643",
  10412. "unicode_decimal": 58947
  10413. }, {
  10414. "icon_id": "24841488",
  10415. "name": "heart",
  10416. "font_class": "heart",
  10417. "unicode": "e639",
  10418. "unicode_decimal": 58937
  10419. }, {
  10420. "icon_id": "24839963",
  10421. "name": "loop",
  10422. "font_class": "loop",
  10423. "unicode": "e633",
  10424. "unicode_decimal": 58931
  10425. }, {
  10426. "icon_id": "24839866",
  10427. "name": "pulldown",
  10428. "font_class": "pulldown",
  10429. "unicode": "e632",
  10430. "unicode_decimal": 58930
  10431. }, {
  10432. "icon_id": "24813798",
  10433. "name": "scan",
  10434. "font_class": "scan",
  10435. "unicode": "e62a",
  10436. "unicode_decimal": 58922
  10437. }, {
  10438. "icon_id": "24813786",
  10439. "name": "bars",
  10440. "font_class": "bars",
  10441. "unicode": "e627",
  10442. "unicode_decimal": 58919
  10443. }, {
  10444. "icon_id": "24813788",
  10445. "name": "cart-filled",
  10446. "font_class": "cart-filled",
  10447. "unicode": "e629",
  10448. "unicode_decimal": 58921
  10449. }, {
  10450. "icon_id": "24813790",
  10451. "name": "checkbox",
  10452. "font_class": "checkbox",
  10453. "unicode": "e62b",
  10454. "unicode_decimal": 58923
  10455. }, {
  10456. "icon_id": "24813791",
  10457. "name": "checkbox-filled",
  10458. "font_class": "checkbox-filled",
  10459. "unicode": "e62c",
  10460. "unicode_decimal": 58924
  10461. }, {
  10462. "icon_id": "24813794",
  10463. "name": "shop",
  10464. "font_class": "shop",
  10465. "unicode": "e62f",
  10466. "unicode_decimal": 58927
  10467. }, {
  10468. "icon_id": "24813795",
  10469. "name": "headphones",
  10470. "font_class": "headphones",
  10471. "unicode": "e630",
  10472. "unicode_decimal": 58928
  10473. }, {
  10474. "icon_id": "24813796",
  10475. "name": "cart",
  10476. "font_class": "cart",
  10477. "unicode": "e631",
  10478. "unicode_decimal": 58929
  10479. }]
  10480. };
  10481. exports.default = _default;
  10482. /***/ })
  10483. ]]);
  10484. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map