vendor.js 333 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],{
  2. /***/ 1:
  3. /*!************************************************************!*\
  4. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  5. \************************************************************/
  6. /*! no static exports found */
  7. /***/ (function(module, exports, __webpack_require__) {
  8. "use strict";
  9. /* WEBPACK VAR INJECTION */(function(global) {Object.defineProperty(exports, "__esModule", { value: true });exports.createApp = createApp;exports.createComponent = createComponent;exports.createPage = createPage;exports.createPlugin = createPlugin;exports.createSubpackageApp = createSubpackageApp;exports.default = void 0;var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 3));
  10. var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 4);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArrayLimit(arr, i) {if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"] != null) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _toConsumableArray(arr) {return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();}function _nonIterableSpread() {throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _iterableToArray(iter) {if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);}function _arrayWithoutHoles(arr) {if (Array.isArray(arr)) return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;}
  11. var realAtob;
  12. var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  13. var b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  14. if (typeof atob !== 'function') {
  15. realAtob = function realAtob(str) {
  16. str = String(str).replace(/[\t\n\f\r ]+/g, '');
  17. if (!b64re.test(str)) {throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");}
  18. // Adding the padding if missing, for semplicity
  19. str += '=='.slice(2 - (str.length & 3));
  20. var bitmap;var result = '';var r1;var r2;var i = 0;
  21. for (; i < str.length;) {
  22. bitmap = b64.indexOf(str.charAt(i++)) << 18 | b64.indexOf(str.charAt(i++)) << 12 |
  23. (r1 = b64.indexOf(str.charAt(i++))) << 6 | (r2 = b64.indexOf(str.charAt(i++)));
  24. result += r1 === 64 ? String.fromCharCode(bitmap >> 16 & 255) :
  25. r2 === 64 ? String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255) :
  26. String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255);
  27. }
  28. return result;
  29. };
  30. } else {
  31. // 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法
  32. realAtob = atob;
  33. }
  34. function b64DecodeUnicode(str) {
  35. return decodeURIComponent(realAtob(str).split('').map(function (c) {
  36. return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
  37. }).join(''));
  38. }
  39. function getCurrentUserInfo() {
  40. var token = wx.getStorageSync('uni_id_token') || '';
  41. var tokenArr = token.split('.');
  42. if (!token || tokenArr.length !== 3) {
  43. return {
  44. uid: null,
  45. role: [],
  46. permission: [],
  47. tokenExpired: 0 };
  48. }
  49. var userInfo;
  50. try {
  51. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  52. } catch (error) {
  53. throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message);
  54. }
  55. userInfo.tokenExpired = userInfo.exp * 1000;
  56. delete userInfo.exp;
  57. delete userInfo.iat;
  58. return userInfo;
  59. }
  60. function uniIdMixin(Vue) {
  61. Vue.prototype.uniIDHasRole = function (roleId) {var _getCurrentUserInfo =
  62. getCurrentUserInfo(),role = _getCurrentUserInfo.role;
  63. return role.indexOf(roleId) > -1;
  64. };
  65. Vue.prototype.uniIDHasPermission = function (permissionId) {var _getCurrentUserInfo2 =
  66. getCurrentUserInfo(),permission = _getCurrentUserInfo2.permission;
  67. return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1;
  68. };
  69. Vue.prototype.uniIDTokenValid = function () {var _getCurrentUserInfo3 =
  70. getCurrentUserInfo(),tokenExpired = _getCurrentUserInfo3.tokenExpired;
  71. return tokenExpired > Date.now();
  72. };
  73. }
  74. var _toString = Object.prototype.toString;
  75. var hasOwnProperty = Object.prototype.hasOwnProperty;
  76. function isFn(fn) {
  77. return typeof fn === 'function';
  78. }
  79. function isStr(str) {
  80. return typeof str === 'string';
  81. }
  82. function isPlainObject(obj) {
  83. return _toString.call(obj) === '[object Object]';
  84. }
  85. function hasOwn(obj, key) {
  86. return hasOwnProperty.call(obj, key);
  87. }
  88. function noop() {}
  89. /**
  90. * Create a cached version of a pure function.
  91. */
  92. function cached(fn) {
  93. var cache = Object.create(null);
  94. return function cachedFn(str) {
  95. var hit = cache[str];
  96. return hit || (cache[str] = fn(str));
  97. };
  98. }
  99. /**
  100. * Camelize a hyphen-delimited string.
  101. */
  102. var camelizeRE = /-(\w)/g;
  103. var camelize = cached(function (str) {
  104. return str.replace(camelizeRE, function (_, c) {return c ? c.toUpperCase() : '';});
  105. });
  106. var HOOKS = [
  107. 'invoke',
  108. 'success',
  109. 'fail',
  110. 'complete',
  111. 'returnValue'];
  112. var globalInterceptors = {};
  113. var scopedInterceptors = {};
  114. function mergeHook(parentVal, childVal) {
  115. var res = childVal ?
  116. parentVal ?
  117. parentVal.concat(childVal) :
  118. Array.isArray(childVal) ?
  119. childVal : [childVal] :
  120. parentVal;
  121. return res ?
  122. dedupeHooks(res) :
  123. res;
  124. }
  125. function dedupeHooks(hooks) {
  126. var res = [];
  127. for (var i = 0; i < hooks.length; i++) {
  128. if (res.indexOf(hooks[i]) === -1) {
  129. res.push(hooks[i]);
  130. }
  131. }
  132. return res;
  133. }
  134. function removeHook(hooks, hook) {
  135. var index = hooks.indexOf(hook);
  136. if (index !== -1) {
  137. hooks.splice(index, 1);
  138. }
  139. }
  140. function mergeInterceptorHook(interceptor, option) {
  141. Object.keys(option).forEach(function (hook) {
  142. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  143. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  144. }
  145. });
  146. }
  147. function removeInterceptorHook(interceptor, option) {
  148. if (!interceptor || !option) {
  149. return;
  150. }
  151. Object.keys(option).forEach(function (hook) {
  152. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  153. removeHook(interceptor[hook], option[hook]);
  154. }
  155. });
  156. }
  157. function addInterceptor(method, option) {
  158. if (typeof method === 'string' && isPlainObject(option)) {
  159. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  160. } else if (isPlainObject(method)) {
  161. mergeInterceptorHook(globalInterceptors, method);
  162. }
  163. }
  164. function removeInterceptor(method, option) {
  165. if (typeof method === 'string') {
  166. if (isPlainObject(option)) {
  167. removeInterceptorHook(scopedInterceptors[method], option);
  168. } else {
  169. delete scopedInterceptors[method];
  170. }
  171. } else if (isPlainObject(method)) {
  172. removeInterceptorHook(globalInterceptors, method);
  173. }
  174. }
  175. function wrapperHook(hook) {
  176. return function (data) {
  177. return hook(data) || data;
  178. };
  179. }
  180. function isPromise(obj) {
  181. return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  182. }
  183. function queue(hooks, data) {
  184. var promise = false;
  185. for (var i = 0; i < hooks.length; i++) {
  186. var hook = hooks[i];
  187. if (promise) {
  188. promise = Promise.resolve(wrapperHook(hook));
  189. } else {
  190. var res = hook(data);
  191. if (isPromise(res)) {
  192. promise = Promise.resolve(res);
  193. }
  194. if (res === false) {
  195. return {
  196. then: function then() {} };
  197. }
  198. }
  199. }
  200. return promise || {
  201. then: function then(callback) {
  202. return callback(data);
  203. } };
  204. }
  205. function wrapperOptions(interceptor) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  206. ['success', 'fail', 'complete'].forEach(function (name) {
  207. if (Array.isArray(interceptor[name])) {
  208. var oldCallback = options[name];
  209. options[name] = function callbackInterceptor(res) {
  210. queue(interceptor[name], res).then(function (res) {
  211. /* eslint-disable no-mixed-operators */
  212. return isFn(oldCallback) && oldCallback(res) || res;
  213. });
  214. };
  215. }
  216. });
  217. return options;
  218. }
  219. function wrapperReturnValue(method, returnValue) {
  220. var returnValueHooks = [];
  221. if (Array.isArray(globalInterceptors.returnValue)) {
  222. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(globalInterceptors.returnValue));
  223. }
  224. var interceptor = scopedInterceptors[method];
  225. if (interceptor && Array.isArray(interceptor.returnValue)) {
  226. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(interceptor.returnValue));
  227. }
  228. returnValueHooks.forEach(function (hook) {
  229. returnValue = hook(returnValue) || returnValue;
  230. });
  231. return returnValue;
  232. }
  233. function getApiInterceptorHooks(method) {
  234. var interceptor = Object.create(null);
  235. Object.keys(globalInterceptors).forEach(function (hook) {
  236. if (hook !== 'returnValue') {
  237. interceptor[hook] = globalInterceptors[hook].slice();
  238. }
  239. });
  240. var scopedInterceptor = scopedInterceptors[method];
  241. if (scopedInterceptor) {
  242. Object.keys(scopedInterceptor).forEach(function (hook) {
  243. if (hook !== 'returnValue') {
  244. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  245. }
  246. });
  247. }
  248. return interceptor;
  249. }
  250. function invokeApi(method, api, options) {for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {params[_key - 3] = arguments[_key];}
  251. var interceptor = getApiInterceptorHooks(method);
  252. if (interceptor && Object.keys(interceptor).length) {
  253. if (Array.isArray(interceptor.invoke)) {
  254. var res = queue(interceptor.invoke, options);
  255. return res.then(function (options) {
  256. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  257. });
  258. } else {
  259. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  260. }
  261. }
  262. return api.apply(void 0, [options].concat(params));
  263. }
  264. var promiseInterceptor = {
  265. returnValue: function returnValue(res) {
  266. if (!isPromise(res)) {
  267. return res;
  268. }
  269. return new Promise(function (resolve, reject) {
  270. res.then(function (res) {
  271. if (res[0]) {
  272. reject(res[0]);
  273. } else {
  274. resolve(res[1]);
  275. }
  276. });
  277. });
  278. } };
  279. var SYNC_API_RE =
  280. /^\$|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale/;
  281. var CONTEXT_API_RE = /^create|Manager$/;
  282. // Context例外情况
  283. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  284. // 同步例外情况
  285. var ASYNC_API = ['createBLEConnection'];
  286. var CALLBACK_API_RE = /^on|^off/;
  287. function isContextApi(name) {
  288. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  289. }
  290. function isSyncApi(name) {
  291. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  292. }
  293. function isCallbackApi(name) {
  294. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  295. }
  296. function handlePromise(promise) {
  297. return promise.then(function (data) {
  298. return [null, data];
  299. }).
  300. catch(function (err) {return [err];});
  301. }
  302. function shouldPromise(name) {
  303. if (
  304. isContextApi(name) ||
  305. isSyncApi(name) ||
  306. isCallbackApi(name))
  307. {
  308. return false;
  309. }
  310. return true;
  311. }
  312. /* eslint-disable no-extend-native */
  313. if (!Promise.prototype.finally) {
  314. Promise.prototype.finally = function (callback) {
  315. var promise = this.constructor;
  316. return this.then(
  317. function (value) {return promise.resolve(callback()).then(function () {return value;});},
  318. function (reason) {return promise.resolve(callback()).then(function () {
  319. throw reason;
  320. });});
  321. };
  322. }
  323. function promisify(name, api) {
  324. if (!shouldPromise(name)) {
  325. return api;
  326. }
  327. return function promiseApi() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {params[_key2 - 1] = arguments[_key2];}
  328. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  329. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  330. }
  331. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  332. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  333. success: resolve,
  334. fail: reject })].concat(
  335. params));
  336. })));
  337. };
  338. }
  339. var EPS = 1e-4;
  340. var BASE_DEVICE_WIDTH = 750;
  341. var isIOS = false;
  342. var deviceWidth = 0;
  343. var deviceDPR = 0;
  344. function checkDeviceWidth() {var _wx$getSystemInfoSync =
  345. wx.getSystemInfoSync(),platform = _wx$getSystemInfoSync.platform,pixelRatio = _wx$getSystemInfoSync.pixelRatio,windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  346. deviceWidth = windowWidth;
  347. deviceDPR = pixelRatio;
  348. isIOS = platform === 'ios';
  349. }
  350. function upx2px(number, newDeviceWidth) {
  351. if (deviceWidth === 0) {
  352. checkDeviceWidth();
  353. }
  354. number = Number(number);
  355. if (number === 0) {
  356. return 0;
  357. }
  358. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  359. if (result < 0) {
  360. result = -result;
  361. }
  362. result = Math.floor(result + EPS);
  363. if (result === 0) {
  364. if (deviceDPR === 1 || !isIOS) {
  365. result = 1;
  366. } else {
  367. result = 0.5;
  368. }
  369. }
  370. return number < 0 ? -result : result;
  371. }
  372. function getLocale() {
  373. // 优先使用 $locale
  374. var app = getApp({
  375. allowDefault: true });
  376. if (app && app.$vm) {
  377. return app.$vm.$locale;
  378. }
  379. return wx.getSystemInfoSync().language || 'zh-Hans';
  380. }
  381. function setLocale(locale) {
  382. var app = getApp();
  383. if (!app) {
  384. return false;
  385. }
  386. var oldLocale = app.$vm.$locale;
  387. if (oldLocale !== locale) {
  388. app.$vm.$locale = locale;
  389. onLocaleChangeCallbacks.forEach(function (fn) {return fn({
  390. locale: locale });});
  391. return true;
  392. }
  393. return false;
  394. }
  395. var onLocaleChangeCallbacks = [];
  396. function onLocaleChange(fn) {
  397. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  398. onLocaleChangeCallbacks.push(fn);
  399. }
  400. }
  401. if (typeof global !== 'undefined') {
  402. global.getLocale = getLocale;
  403. }
  404. var interceptors = {
  405. promiseInterceptor: promiseInterceptor };
  406. var baseApi = /*#__PURE__*/Object.freeze({
  407. __proto__: null,
  408. upx2px: upx2px,
  409. getLocale: getLocale,
  410. setLocale: setLocale,
  411. onLocaleChange: onLocaleChange,
  412. addInterceptor: addInterceptor,
  413. removeInterceptor: removeInterceptor,
  414. interceptors: interceptors });
  415. function findExistsPageIndex(url) {
  416. var pages = getCurrentPages();
  417. var len = pages.length;
  418. while (len--) {
  419. var page = pages[len];
  420. if (page.$page && page.$page.fullPath === url) {
  421. return len;
  422. }
  423. }
  424. return -1;
  425. }
  426. var redirectTo = {
  427. name: function name(fromArgs) {
  428. if (fromArgs.exists === 'back' && fromArgs.delta) {
  429. return 'navigateBack';
  430. }
  431. return 'redirectTo';
  432. },
  433. args: function args(fromArgs) {
  434. if (fromArgs.exists === 'back' && fromArgs.url) {
  435. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  436. if (existsPageIndex !== -1) {
  437. var delta = getCurrentPages().length - 1 - existsPageIndex;
  438. if (delta > 0) {
  439. fromArgs.delta = delta;
  440. }
  441. }
  442. }
  443. } };
  444. var previewImage = {
  445. args: function args(fromArgs) {
  446. var currentIndex = parseInt(fromArgs.current);
  447. if (isNaN(currentIndex)) {
  448. return;
  449. }
  450. var urls = fromArgs.urls;
  451. if (!Array.isArray(urls)) {
  452. return;
  453. }
  454. var len = urls.length;
  455. if (!len) {
  456. return;
  457. }
  458. if (currentIndex < 0) {
  459. currentIndex = 0;
  460. } else if (currentIndex >= len) {
  461. currentIndex = len - 1;
  462. }
  463. if (currentIndex > 0) {
  464. fromArgs.current = urls[currentIndex];
  465. fromArgs.urls = urls.filter(
  466. function (item, index) {return index < currentIndex ? item !== urls[currentIndex] : true;});
  467. } else {
  468. fromArgs.current = urls[0];
  469. }
  470. return {
  471. indicator: false,
  472. loop: false };
  473. } };
  474. var UUID_KEY = '__DC_STAT_UUID';
  475. var deviceId;
  476. function addUuid(result) {
  477. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  478. if (!deviceId) {
  479. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  480. wx.setStorage({
  481. key: UUID_KEY,
  482. data: deviceId });
  483. }
  484. result.deviceId = deviceId;
  485. }
  486. function addSafeAreaInsets(result) {
  487. if (result.safeArea) {
  488. var safeArea = result.safeArea;
  489. result.safeAreaInsets = {
  490. top: safeArea.top,
  491. left: safeArea.left,
  492. right: result.windowWidth - safeArea.right,
  493. bottom: result.windowHeight - safeArea.bottom };
  494. }
  495. }
  496. var getSystemInfo = {
  497. returnValue: function returnValue(result) {
  498. addUuid(result);
  499. addSafeAreaInsets(result);
  500. } };
  501. // import navigateTo from 'uni-helpers/navigate-to'
  502. var protocols = {
  503. redirectTo: redirectTo,
  504. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  505. previewImage: previewImage,
  506. getSystemInfo: getSystemInfo,
  507. getSystemInfoSync: getSystemInfo };
  508. var todos = [
  509. 'vibrate',
  510. 'preloadPage',
  511. 'unPreloadPage',
  512. 'loadSubPackage'];
  513. var canIUses = [];
  514. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  515. function processCallback(methodName, method, returnValue) {
  516. return function (res) {
  517. return method(processReturnValue(methodName, res, returnValue));
  518. };
  519. }
  520. function processArgs(methodName, fromArgs) {var argsOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};var returnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};var keepFromArgs = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  521. if (isPlainObject(fromArgs)) {// 一般 api 的参数解析
  522. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  523. if (isFn(argsOption)) {
  524. argsOption = argsOption(fromArgs, toArgs) || {};
  525. }
  526. for (var key in fromArgs) {
  527. if (hasOwn(argsOption, key)) {
  528. var keyOption = argsOption[key];
  529. if (isFn(keyOption)) {
  530. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  531. }
  532. if (!keyOption) {// 不支持的参数
  533. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  534. } else if (isStr(keyOption)) {// 重写参数 key
  535. toArgs[keyOption] = fromArgs[key];
  536. } else if (isPlainObject(keyOption)) {// {name:newName,value:value}可重新指定参数 key:value
  537. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  538. }
  539. } else if (CALLBACKS.indexOf(key) !== -1) {
  540. if (isFn(fromArgs[key])) {
  541. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  542. }
  543. } else {
  544. if (!keepFromArgs) {
  545. toArgs[key] = fromArgs[key];
  546. }
  547. }
  548. }
  549. return toArgs;
  550. } else if (isFn(fromArgs)) {
  551. fromArgs = processCallback(methodName, fromArgs, returnValue);
  552. }
  553. return fromArgs;
  554. }
  555. function processReturnValue(methodName, res, returnValue) {var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  556. if (isFn(protocols.returnValue)) {// 处理通用 returnValue
  557. res = protocols.returnValue(methodName, res);
  558. }
  559. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  560. }
  561. function wrapper(methodName, method) {
  562. if (hasOwn(protocols, methodName)) {
  563. var protocol = protocols[methodName];
  564. if (!protocol) {// 暂不支持的 api
  565. return function () {
  566. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  567. };
  568. }
  569. return function (arg1, arg2) {// 目前 api 最多两个参数
  570. var options = protocol;
  571. if (isFn(protocol)) {
  572. options = protocol(arg1);
  573. }
  574. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  575. var args = [arg1];
  576. if (typeof arg2 !== 'undefined') {
  577. args.push(arg2);
  578. }
  579. if (isFn(options.name)) {
  580. methodName = options.name(arg1);
  581. } else if (isStr(options.name)) {
  582. methodName = options.name;
  583. }
  584. var returnValue = wx[methodName].apply(wx, args);
  585. if (isSyncApi(methodName)) {// 同步 api
  586. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  587. }
  588. return returnValue;
  589. };
  590. }
  591. return method;
  592. }
  593. var todoApis = Object.create(null);
  594. var TODOS = [
  595. 'onTabBarMidButtonTap',
  596. 'subscribePush',
  597. 'unsubscribePush',
  598. 'onPush',
  599. 'offPush',
  600. 'share'];
  601. function createTodoApi(name) {
  602. return function todoApi(_ref)
  603. {var fail = _ref.fail,complete = _ref.complete;
  604. var res = {
  605. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported") };
  606. isFn(fail) && fail(res);
  607. isFn(complete) && complete(res);
  608. };
  609. }
  610. TODOS.forEach(function (name) {
  611. todoApis[name] = createTodoApi(name);
  612. });
  613. var providers = {
  614. oauth: ['weixin'],
  615. share: ['weixin'],
  616. payment: ['wxpay'],
  617. push: ['weixin'] };
  618. function getProvider(_ref2)
  619. {var service = _ref2.service,success = _ref2.success,fail = _ref2.fail,complete = _ref2.complete;
  620. var res = false;
  621. if (providers[service]) {
  622. res = {
  623. errMsg: 'getProvider:ok',
  624. service: service,
  625. provider: providers[service] };
  626. isFn(success) && success(res);
  627. } else {
  628. res = {
  629. errMsg: 'getProvider:fail service not found' };
  630. isFn(fail) && fail(res);
  631. }
  632. isFn(complete) && complete(res);
  633. }
  634. var extraApi = /*#__PURE__*/Object.freeze({
  635. __proto__: null,
  636. getProvider: getProvider });
  637. var getEmitter = function () {
  638. var Emitter;
  639. return function getUniEmitter() {
  640. if (!Emitter) {
  641. Emitter = new _vue.default();
  642. }
  643. return Emitter;
  644. };
  645. }();
  646. function apply(ctx, method, args) {
  647. return ctx[method].apply(ctx, args);
  648. }
  649. function $on() {
  650. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  651. }
  652. function $off() {
  653. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  654. }
  655. function $once() {
  656. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  657. }
  658. function $emit() {
  659. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  660. }
  661. var eventApi = /*#__PURE__*/Object.freeze({
  662. __proto__: null,
  663. $on: $on,
  664. $off: $off,
  665. $once: $once,
  666. $emit: $emit });
  667. var api = /*#__PURE__*/Object.freeze({
  668. __proto__: null });
  669. var MPPage = Page;
  670. var MPComponent = Component;
  671. var customizeRE = /:/g;
  672. var customize = cached(function (str) {
  673. return camelize(str.replace(customizeRE, '-'));
  674. });
  675. function initTriggerEvent(mpInstance) {
  676. var oldTriggerEvent = mpInstance.triggerEvent;
  677. mpInstance.triggerEvent = function (event) {for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {args[_key3 - 1] = arguments[_key3];}
  678. return oldTriggerEvent.apply(mpInstance, [customize(event)].concat(args));
  679. };
  680. }
  681. function initHook(name, options, isComponent) {
  682. var oldHook = options[name];
  683. if (!oldHook) {
  684. options[name] = function () {
  685. initTriggerEvent(this);
  686. };
  687. } else {
  688. options[name] = function () {
  689. initTriggerEvent(this);for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {args[_key4] = arguments[_key4];}
  690. return oldHook.apply(this, args);
  691. };
  692. }
  693. }
  694. if (!MPPage.__$wrappered) {
  695. MPPage.__$wrappered = true;
  696. Page = function Page() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  697. initHook('onLoad', options);
  698. return MPPage(options);
  699. };
  700. Page.after = MPPage.after;
  701. Component = function Component() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  702. initHook('created', options);
  703. return MPComponent(options);
  704. };
  705. }
  706. var PAGE_EVENT_HOOKS = [
  707. 'onPullDownRefresh',
  708. 'onReachBottom',
  709. 'onAddToFavorites',
  710. 'onShareTimeline',
  711. 'onShareAppMessage',
  712. 'onPageScroll',
  713. 'onResize',
  714. 'onTabItemTap'];
  715. function initMocks(vm, mocks) {
  716. var mpInstance = vm.$mp[vm.mpType];
  717. mocks.forEach(function (mock) {
  718. if (hasOwn(mpInstance, mock)) {
  719. vm[mock] = mpInstance[mock];
  720. }
  721. });
  722. }
  723. function hasHook(hook, vueOptions) {
  724. if (!vueOptions) {
  725. return true;
  726. }
  727. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  728. return true;
  729. }
  730. vueOptions = vueOptions.default || vueOptions;
  731. if (isFn(vueOptions)) {
  732. if (isFn(vueOptions.extendOptions[hook])) {
  733. return true;
  734. }
  735. if (vueOptions.super &&
  736. vueOptions.super.options &&
  737. Array.isArray(vueOptions.super.options[hook])) {
  738. return true;
  739. }
  740. return false;
  741. }
  742. if (isFn(vueOptions[hook])) {
  743. return true;
  744. }
  745. var mixins = vueOptions.mixins;
  746. if (Array.isArray(mixins)) {
  747. return !!mixins.find(function (mixin) {return hasHook(hook, mixin);});
  748. }
  749. }
  750. function initHooks(mpOptions, hooks, vueOptions) {
  751. hooks.forEach(function (hook) {
  752. if (hasHook(hook, vueOptions)) {
  753. mpOptions[hook] = function (args) {
  754. return this.$vm && this.$vm.__call_hook(hook, args);
  755. };
  756. }
  757. });
  758. }
  759. function initVueComponent(Vue, vueOptions) {
  760. vueOptions = vueOptions.default || vueOptions;
  761. var VueComponent;
  762. if (isFn(vueOptions)) {
  763. VueComponent = vueOptions;
  764. } else {
  765. VueComponent = Vue.extend(vueOptions);
  766. }
  767. vueOptions = VueComponent.options;
  768. return [VueComponent, vueOptions];
  769. }
  770. function initSlots(vm, vueSlots) {
  771. if (Array.isArray(vueSlots) && vueSlots.length) {
  772. var $slots = Object.create(null);
  773. vueSlots.forEach(function (slotName) {
  774. $slots[slotName] = true;
  775. });
  776. vm.$scopedSlots = vm.$slots = $slots;
  777. }
  778. }
  779. function initVueIds(vueIds, mpInstance) {
  780. vueIds = (vueIds || '').split(',');
  781. var len = vueIds.length;
  782. if (len === 1) {
  783. mpInstance._$vueId = vueIds[0];
  784. } else if (len === 2) {
  785. mpInstance._$vueId = vueIds[0];
  786. mpInstance._$vuePid = vueIds[1];
  787. }
  788. }
  789. function initData(vueOptions, context) {
  790. var data = vueOptions.data || {};
  791. var methods = vueOptions.methods || {};
  792. if (typeof data === 'function') {
  793. try {
  794. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  795. } catch (e) {
  796. if (Object({"VUE_APP_NAME":"magazine-web","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  797. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  798. }
  799. }
  800. } else {
  801. try {
  802. // 对 data 格式化
  803. data = JSON.parse(JSON.stringify(data));
  804. } catch (e) {}
  805. }
  806. if (!isPlainObject(data)) {
  807. data = {};
  808. }
  809. Object.keys(methods).forEach(function (methodName) {
  810. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  811. data[methodName] = methods[methodName];
  812. }
  813. });
  814. return data;
  815. }
  816. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  817. function createObserver(name) {
  818. return function observer(newVal, oldVal) {
  819. if (this.$vm) {
  820. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  821. }
  822. };
  823. }
  824. function initBehaviors(vueOptions, initBehavior) {
  825. var vueBehaviors = vueOptions.behaviors;
  826. var vueExtends = vueOptions.extends;
  827. var vueMixins = vueOptions.mixins;
  828. var vueProps = vueOptions.props;
  829. if (!vueProps) {
  830. vueOptions.props = vueProps = [];
  831. }
  832. var behaviors = [];
  833. if (Array.isArray(vueBehaviors)) {
  834. vueBehaviors.forEach(function (behavior) {
  835. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  836. if (behavior === 'uni://form-field') {
  837. if (Array.isArray(vueProps)) {
  838. vueProps.push('name');
  839. vueProps.push('value');
  840. } else {
  841. vueProps.name = {
  842. type: String,
  843. default: '' };
  844. vueProps.value = {
  845. type: [String, Number, Boolean, Array, Object, Date],
  846. default: '' };
  847. }
  848. }
  849. });
  850. }
  851. if (isPlainObject(vueExtends) && vueExtends.props) {
  852. behaviors.push(
  853. initBehavior({
  854. properties: initProperties(vueExtends.props, true) }));
  855. }
  856. if (Array.isArray(vueMixins)) {
  857. vueMixins.forEach(function (vueMixin) {
  858. if (isPlainObject(vueMixin) && vueMixin.props) {
  859. behaviors.push(
  860. initBehavior({
  861. properties: initProperties(vueMixin.props, true) }));
  862. }
  863. });
  864. }
  865. return behaviors;
  866. }
  867. function parsePropType(key, type, defaultValue, file) {
  868. // [String]=>String
  869. if (Array.isArray(type) && type.length === 1) {
  870. return type[0];
  871. }
  872. return type;
  873. }
  874. function initProperties(props) {var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  875. var properties = {};
  876. if (!isBehavior) {
  877. properties.vueId = {
  878. type: String,
  879. value: '' };
  880. // 用于字节跳动小程序模拟抽象节点
  881. properties.generic = {
  882. type: Object,
  883. value: null };
  884. // scopedSlotsCompiler auto
  885. properties.scopedSlotsCompiler = {
  886. type: String,
  887. value: '' };
  888. properties.vueSlots = { // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  889. type: null,
  890. value: [],
  891. observer: function observer(newVal, oldVal) {
  892. var $slots = Object.create(null);
  893. newVal.forEach(function (slotName) {
  894. $slots[slotName] = true;
  895. });
  896. this.setData({
  897. $slots: $slots });
  898. } };
  899. }
  900. if (Array.isArray(props)) {// ['title']
  901. props.forEach(function (key) {
  902. properties[key] = {
  903. type: null,
  904. observer: createObserver(key) };
  905. });
  906. } else if (isPlainObject(props)) {// {title:{type:String,default:''},content:String}
  907. Object.keys(props).forEach(function (key) {
  908. var opts = props[key];
  909. if (isPlainObject(opts)) {// title:{type:String,default:''}
  910. var value = opts.default;
  911. if (isFn(value)) {
  912. value = value();
  913. }
  914. opts.type = parsePropType(key, opts.type);
  915. properties[key] = {
  916. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  917. value: value,
  918. observer: createObserver(key) };
  919. } else {// content:String
  920. var type = parsePropType(key, opts);
  921. properties[key] = {
  922. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  923. observer: createObserver(key) };
  924. }
  925. });
  926. }
  927. return properties;
  928. }
  929. function wrapper$1(event) {
  930. // TODO 又得兼容 mpvue 的 mp 对象
  931. try {
  932. event.mp = JSON.parse(JSON.stringify(event));
  933. } catch (e) {}
  934. event.stopPropagation = noop;
  935. event.preventDefault = noop;
  936. event.target = event.target || {};
  937. if (!hasOwn(event, 'detail')) {
  938. event.detail = {};
  939. }
  940. if (hasOwn(event, 'markerId')) {
  941. event.detail = typeof event.detail === 'object' ? event.detail : {};
  942. event.detail.markerId = event.markerId;
  943. }
  944. if (isPlainObject(event.detail)) {
  945. event.target = Object.assign({}, event.target, event.detail);
  946. }
  947. return event;
  948. }
  949. function getExtraValue(vm, dataPathsArray) {
  950. var context = vm;
  951. dataPathsArray.forEach(function (dataPathArray) {
  952. var dataPath = dataPathArray[0];
  953. var value = dataPathArray[2];
  954. if (dataPath || typeof value !== 'undefined') {// ['','',index,'disable']
  955. var propPath = dataPathArray[1];
  956. var valuePath = dataPathArray[3];
  957. var vFor;
  958. if (Number.isInteger(dataPath)) {
  959. vFor = dataPath;
  960. } else if (!dataPath) {
  961. vFor = context;
  962. } else if (typeof dataPath === 'string' && dataPath) {
  963. if (dataPath.indexOf('#s#') === 0) {
  964. vFor = dataPath.substr(3);
  965. } else {
  966. vFor = vm.__get_value(dataPath, context);
  967. }
  968. }
  969. if (Number.isInteger(vFor)) {
  970. context = value;
  971. } else if (!propPath) {
  972. context = vFor[value];
  973. } else {
  974. if (Array.isArray(vFor)) {
  975. context = vFor.find(function (vForItem) {
  976. return vm.__get_value(propPath, vForItem) === value;
  977. });
  978. } else if (isPlainObject(vFor)) {
  979. context = Object.keys(vFor).find(function (vForKey) {
  980. return vm.__get_value(propPath, vFor[vForKey]) === value;
  981. });
  982. } else {
  983. console.error('v-for 暂不支持循环数据:', vFor);
  984. }
  985. }
  986. if (valuePath) {
  987. context = vm.__get_value(valuePath, context);
  988. }
  989. }
  990. });
  991. return context;
  992. }
  993. function processEventExtra(vm, extra, event) {
  994. var extraObj = {};
  995. if (Array.isArray(extra) && extra.length) {
  996. /**
  997. *[
  998. * ['data.items', 'data.id', item.data.id],
  999. * ['metas', 'id', meta.id]
  1000. *],
  1001. *[
  1002. * ['data.items', 'data.id', item.data.id],
  1003. * ['metas', 'id', meta.id]
  1004. *],
  1005. *'test'
  1006. */
  1007. extra.forEach(function (dataPath, index) {
  1008. if (typeof dataPath === 'string') {
  1009. if (!dataPath) {// model,prop.sync
  1010. extraObj['$' + index] = vm;
  1011. } else {
  1012. if (dataPath === '$event') {// $event
  1013. extraObj['$' + index] = event;
  1014. } else if (dataPath === 'arguments') {
  1015. if (event.detail && event.detail.__args__) {
  1016. extraObj['$' + index] = event.detail.__args__;
  1017. } else {
  1018. extraObj['$' + index] = [event];
  1019. }
  1020. } else if (dataPath.indexOf('$event.') === 0) {// $event.target.value
  1021. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  1022. } else {
  1023. extraObj['$' + index] = vm.__get_value(dataPath);
  1024. }
  1025. }
  1026. } else {
  1027. extraObj['$' + index] = getExtraValue(vm, dataPath);
  1028. }
  1029. });
  1030. }
  1031. return extraObj;
  1032. }
  1033. function getObjByArray(arr) {
  1034. var obj = {};
  1035. for (var i = 1; i < arr.length; i++) {
  1036. var element = arr[i];
  1037. obj[element[0]] = element[1];
  1038. }
  1039. return obj;
  1040. }
  1041. function processEventArgs(vm, event) {var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];var extra = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];var isCustom = arguments.length > 4 ? arguments[4] : undefined;var methodName = arguments.length > 5 ? arguments[5] : undefined;
  1042. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  1043. if (isCustom) {// 自定义事件
  1044. isCustomMPEvent = event.currentTarget &&
  1045. event.currentTarget.dataset &&
  1046. event.currentTarget.dataset.comType === 'wx';
  1047. if (!args.length) {// 无参数,直接传入 event 或 detail 数组
  1048. if (isCustomMPEvent) {
  1049. return [event];
  1050. }
  1051. return event.detail.__args__ || event.detail;
  1052. }
  1053. }
  1054. var extraObj = processEventExtra(vm, extra, event);
  1055. var ret = [];
  1056. args.forEach(function (arg) {
  1057. if (arg === '$event') {
  1058. if (methodName === '__set_model' && !isCustom) {// input v-model value
  1059. ret.push(event.target.value);
  1060. } else {
  1061. if (isCustom && !isCustomMPEvent) {
  1062. ret.push(event.detail.__args__[0]);
  1063. } else {// wxcomponent 组件或内置组件
  1064. ret.push(event);
  1065. }
  1066. }
  1067. } else {
  1068. if (Array.isArray(arg) && arg[0] === 'o') {
  1069. ret.push(getObjByArray(arg));
  1070. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  1071. ret.push(extraObj[arg]);
  1072. } else {
  1073. ret.push(arg);
  1074. }
  1075. }
  1076. });
  1077. return ret;
  1078. }
  1079. var ONCE = '~';
  1080. var CUSTOM = '^';
  1081. function isMatchEventType(eventType, optType) {
  1082. return eventType === optType ||
  1083. optType === 'regionchange' && (
  1084. eventType === 'begin' ||
  1085. eventType === 'end');
  1086. }
  1087. function getContextVm(vm) {
  1088. var $parent = vm.$parent;
  1089. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  1090. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  1091. $parent = $parent.$parent;
  1092. }
  1093. return $parent && $parent.$parent;
  1094. }
  1095. function handleEvent(event) {var _this = this;
  1096. event = wrapper$1(event);
  1097. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  1098. var dataset = (event.currentTarget || event.target).dataset;
  1099. if (!dataset) {
  1100. return console.warn('事件信息不存在');
  1101. }
  1102. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  1103. if (!eventOpts) {
  1104. return console.warn('事件信息不存在');
  1105. }
  1106. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  1107. var eventType = event.type;
  1108. var ret = [];
  1109. eventOpts.forEach(function (eventOpt) {
  1110. var type = eventOpt[0];
  1111. var eventsArray = eventOpt[1];
  1112. var isCustom = type.charAt(0) === CUSTOM;
  1113. type = isCustom ? type.slice(1) : type;
  1114. var isOnce = type.charAt(0) === ONCE;
  1115. type = isOnce ? type.slice(1) : type;
  1116. if (eventsArray && isMatchEventType(eventType, type)) {
  1117. eventsArray.forEach(function (eventArray) {
  1118. var methodName = eventArray[0];
  1119. if (methodName) {
  1120. var handlerCtx = _this.$vm;
  1121. if (handlerCtx.$options.generic) {// mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  1122. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  1123. }
  1124. if (methodName === '$emit') {
  1125. handlerCtx.$emit.apply(handlerCtx,
  1126. processEventArgs(
  1127. _this.$vm,
  1128. event,
  1129. eventArray[1],
  1130. eventArray[2],
  1131. isCustom,
  1132. methodName));
  1133. return;
  1134. }
  1135. var handler = handlerCtx[methodName];
  1136. if (!isFn(handler)) {
  1137. throw new Error(" _vm.".concat(methodName, " is not a function"));
  1138. }
  1139. if (isOnce) {
  1140. if (handler.once) {
  1141. return;
  1142. }
  1143. handler.once = true;
  1144. }
  1145. var params = processEventArgs(
  1146. _this.$vm,
  1147. event,
  1148. eventArray[1],
  1149. eventArray[2],
  1150. isCustom,
  1151. methodName);
  1152. params = Array.isArray(params) ? params : [];
  1153. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  1154. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  1155. // eslint-disable-next-line no-sparse-arrays
  1156. params = params.concat([,,,,,,,,,, event]);
  1157. }
  1158. ret.push(handler.apply(handlerCtx, params));
  1159. }
  1160. });
  1161. }
  1162. });
  1163. if (
  1164. eventType === 'input' &&
  1165. ret.length === 1 &&
  1166. typeof ret[0] !== 'undefined')
  1167. {
  1168. return ret[0];
  1169. }
  1170. }
  1171. var messages = {};
  1172. var locale;
  1173. {
  1174. locale = wx.getSystemInfoSync().language;
  1175. }
  1176. function initI18nMessages() {
  1177. if (!isEnableLocale()) {
  1178. return;
  1179. }
  1180. var localeKeys = Object.keys(__uniConfig.locales);
  1181. if (localeKeys.length) {
  1182. localeKeys.forEach(function (locale) {
  1183. var curMessages = messages[locale];
  1184. var userMessages = __uniConfig.locales[locale];
  1185. if (curMessages) {
  1186. Object.assign(curMessages, userMessages);
  1187. } else {
  1188. messages[locale] = userMessages;
  1189. }
  1190. });
  1191. }
  1192. }
  1193. initI18nMessages();
  1194. var i18n = (0, _uniI18n.initVueI18n)(
  1195. locale,
  1196. {});
  1197. var t = i18n.t;
  1198. var i18nMixin = i18n.mixin = {
  1199. beforeCreate: function beforeCreate() {var _this2 = this;
  1200. var unwatch = i18n.i18n.watchLocale(function () {
  1201. _this2.$forceUpdate();
  1202. });
  1203. this.$once('hook:beforeDestroy', function () {
  1204. unwatch();
  1205. });
  1206. },
  1207. methods: {
  1208. $$t: function $$t(key, values) {
  1209. return t(key, values);
  1210. } } };
  1211. var setLocale$1 = i18n.setLocale;
  1212. var getLocale$1 = i18n.getLocale;
  1213. function initAppLocale(Vue, appVm, locale) {
  1214. var state = Vue.observable({
  1215. locale: locale || i18n.getLocale() });
  1216. var localeWatchers = [];
  1217. appVm.$watchLocale = function (fn) {
  1218. localeWatchers.push(fn);
  1219. };
  1220. Object.defineProperty(appVm, '$locale', {
  1221. get: function get() {
  1222. return state.locale;
  1223. },
  1224. set: function set(v) {
  1225. state.locale = v;
  1226. localeWatchers.forEach(function (watch) {return watch(v);});
  1227. } });
  1228. }
  1229. function isEnableLocale() {
  1230. return typeof __uniConfig !== 'undefined' && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length;
  1231. }
  1232. // export function initI18n() {
  1233. // const localeKeys = Object.keys(__uniConfig.locales || {})
  1234. // if (localeKeys.length) {
  1235. // localeKeys.forEach((locale) =>
  1236. // i18n.add(locale, __uniConfig.locales[locale])
  1237. // )
  1238. // }
  1239. // }
  1240. var eventChannels = {};
  1241. var eventChannelStack = [];
  1242. function getEventChannel(id) {
  1243. if (id) {
  1244. var eventChannel = eventChannels[id];
  1245. delete eventChannels[id];
  1246. return eventChannel;
  1247. }
  1248. return eventChannelStack.shift();
  1249. }
  1250. var hooks = [
  1251. 'onShow',
  1252. 'onHide',
  1253. 'onError',
  1254. 'onPageNotFound',
  1255. 'onThemeChange',
  1256. 'onUnhandledRejection'];
  1257. function initEventChannel() {
  1258. _vue.default.prototype.getOpenerEventChannel = function () {
  1259. // 微信小程序使用自身getOpenerEventChannel
  1260. {
  1261. return this.$scope.getOpenerEventChannel();
  1262. }
  1263. };
  1264. var callHook = _vue.default.prototype.__call_hook;
  1265. _vue.default.prototype.__call_hook = function (hook, args) {
  1266. if (hook === 'onLoad' && args && args.__id__) {
  1267. this.__eventChannel__ = getEventChannel(args.__id__);
  1268. delete args.__id__;
  1269. }
  1270. return callHook.call(this, hook, args);
  1271. };
  1272. }
  1273. function initScopedSlotsParams() {
  1274. var center = {};
  1275. var parents = {};
  1276. _vue.default.prototype.$hasScopedSlotsParams = function (vueId) {
  1277. var has = center[vueId];
  1278. if (!has) {
  1279. parents[vueId] = this;
  1280. this.$on('hook:destroyed', function () {
  1281. delete parents[vueId];
  1282. });
  1283. }
  1284. return has;
  1285. };
  1286. _vue.default.prototype.$getScopedSlotsParams = function (vueId, name, key) {
  1287. var data = center[vueId];
  1288. if (data) {
  1289. var object = data[name] || {};
  1290. return key ? object[key] : object;
  1291. } else {
  1292. parents[vueId] = this;
  1293. this.$on('hook:destroyed', function () {
  1294. delete parents[vueId];
  1295. });
  1296. }
  1297. };
  1298. _vue.default.prototype.$setScopedSlotsParams = function (name, value) {
  1299. var vueIds = this.$options.propsData.vueId;
  1300. if (vueIds) {
  1301. var vueId = vueIds.split(',')[0];
  1302. var object = center[vueId] = center[vueId] || {};
  1303. object[name] = value;
  1304. if (parents[vueId]) {
  1305. parents[vueId].$forceUpdate();
  1306. }
  1307. }
  1308. };
  1309. _vue.default.mixin({
  1310. destroyed: function destroyed() {
  1311. var propsData = this.$options.propsData;
  1312. var vueId = propsData && propsData.vueId;
  1313. if (vueId) {
  1314. delete center[vueId];
  1315. delete parents[vueId];
  1316. }
  1317. } });
  1318. }
  1319. function parseBaseApp(vm, _ref3)
  1320. {var mocks = _ref3.mocks,initRefs = _ref3.initRefs;
  1321. initEventChannel();
  1322. {
  1323. initScopedSlotsParams();
  1324. }
  1325. if (vm.$options.store) {
  1326. _vue.default.prototype.$store = vm.$options.store;
  1327. }
  1328. uniIdMixin(_vue.default);
  1329. _vue.default.prototype.mpHost = "mp-weixin";
  1330. _vue.default.mixin({
  1331. beforeCreate: function beforeCreate() {
  1332. if (!this.$options.mpType) {
  1333. return;
  1334. }
  1335. this.mpType = this.$options.mpType;
  1336. this.$mp = _defineProperty({
  1337. data: {} },
  1338. this.mpType, this.$options.mpInstance);
  1339. this.$scope = this.$options.mpInstance;
  1340. delete this.$options.mpType;
  1341. delete this.$options.mpInstance;
  1342. if (this.mpType === 'page' && typeof getApp === 'function') {// hack vue-i18n
  1343. var app = getApp();
  1344. if (app.$vm && app.$vm.$i18n) {
  1345. this._i18n = app.$vm.$i18n;
  1346. }
  1347. }
  1348. if (this.mpType !== 'app') {
  1349. initRefs(this);
  1350. initMocks(this, mocks);
  1351. }
  1352. } });
  1353. var appOptions = {
  1354. onLaunch: function onLaunch(args) {
  1355. if (this.$vm) {// 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  1356. return;
  1357. }
  1358. {
  1359. if (wx.canIUse && !wx.canIUse('nextTick')) {// 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  1360. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  1361. }
  1362. }
  1363. this.$vm = vm;
  1364. this.$vm.$mp = {
  1365. app: this };
  1366. this.$vm.$scope = this;
  1367. // vm 上也挂载 globalData
  1368. this.$vm.globalData = this.globalData;
  1369. this.$vm._isMounted = true;
  1370. this.$vm.__call_hook('mounted', args);
  1371. this.$vm.__call_hook('onLaunch', args);
  1372. } };
  1373. // 兼容旧版本 globalData
  1374. appOptions.globalData = vm.$options.globalData || {};
  1375. // 将 methods 中的方法挂在 getApp() 中
  1376. var methods = vm.$options.methods;
  1377. if (methods) {
  1378. Object.keys(methods).forEach(function (name) {
  1379. appOptions[name] = methods[name];
  1380. });
  1381. }
  1382. initAppLocale(_vue.default, vm, wx.getSystemInfoSync().language || 'zh-Hans');
  1383. initHooks(appOptions, hooks);
  1384. return appOptions;
  1385. }
  1386. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1387. function findVmByVueId(vm, vuePid) {
  1388. var $children = vm.$children;
  1389. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1390. for (var i = $children.length - 1; i >= 0; i--) {
  1391. var childVm = $children[i];
  1392. if (childVm.$scope._$vueId === vuePid) {
  1393. return childVm;
  1394. }
  1395. }
  1396. // 反向递归查找
  1397. var parentVm;
  1398. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1399. parentVm = findVmByVueId($children[_i], vuePid);
  1400. if (parentVm) {
  1401. return parentVm;
  1402. }
  1403. }
  1404. }
  1405. function initBehavior(options) {
  1406. return Behavior(options);
  1407. }
  1408. function isPage() {
  1409. return !!this.route;
  1410. }
  1411. function initRelation(detail) {
  1412. this.triggerEvent('__l', detail);
  1413. }
  1414. function selectAllComponents(mpInstance, selector, $refs) {
  1415. var components = mpInstance.selectAllComponents(selector);
  1416. components.forEach(function (component) {
  1417. var ref = component.dataset.ref;
  1418. $refs[ref] = component.$vm || component;
  1419. {
  1420. if (component.dataset.vueGeneric === 'scoped') {
  1421. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  1422. selectAllComponents(scopedComponent, selector, $refs);
  1423. });
  1424. }
  1425. }
  1426. });
  1427. }
  1428. function initRefs(vm) {
  1429. var mpInstance = vm.$scope;
  1430. Object.defineProperty(vm, '$refs', {
  1431. get: function get() {
  1432. var $refs = {};
  1433. selectAllComponents(mpInstance, '.vue-ref', $refs);
  1434. // TODO 暂不考虑 for 中的 scoped
  1435. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for');
  1436. forComponents.forEach(function (component) {
  1437. var ref = component.dataset.ref;
  1438. if (!$refs[ref]) {
  1439. $refs[ref] = [];
  1440. }
  1441. $refs[ref].push(component.$vm || component);
  1442. });
  1443. return $refs;
  1444. } });
  1445. }
  1446. function handleLink(event) {var _ref4 =
  1447. event.detail || event.value,vuePid = _ref4.vuePid,vueOptions = _ref4.vueOptions; // detail 是微信,value 是百度(dipatch)
  1448. var parentVm;
  1449. if (vuePid) {
  1450. parentVm = findVmByVueId(this.$vm, vuePid);
  1451. }
  1452. if (!parentVm) {
  1453. parentVm = this.$vm;
  1454. }
  1455. vueOptions.parent = parentVm;
  1456. }
  1457. function parseApp(vm) {
  1458. return parseBaseApp(vm, {
  1459. mocks: mocks,
  1460. initRefs: initRefs });
  1461. }
  1462. function createApp(vm) {
  1463. App(parseApp(vm));
  1464. return vm;
  1465. }
  1466. var encodeReserveRE = /[!'()*]/g;
  1467. var encodeReserveReplacer = function encodeReserveReplacer(c) {return '%' + c.charCodeAt(0).toString(16);};
  1468. var commaRE = /%2C/g;
  1469. // fixed encodeURIComponent which is more conformant to RFC3986:
  1470. // - escapes [!'()*]
  1471. // - preserve commas
  1472. var encode = function encode(str) {return encodeURIComponent(str).
  1473. replace(encodeReserveRE, encodeReserveReplacer).
  1474. replace(commaRE, ',');};
  1475. function stringifyQuery(obj) {var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  1476. var res = obj ? Object.keys(obj).map(function (key) {
  1477. var val = obj[key];
  1478. if (val === undefined) {
  1479. return '';
  1480. }
  1481. if (val === null) {
  1482. return encodeStr(key);
  1483. }
  1484. if (Array.isArray(val)) {
  1485. var result = [];
  1486. val.forEach(function (val2) {
  1487. if (val2 === undefined) {
  1488. return;
  1489. }
  1490. if (val2 === null) {
  1491. result.push(encodeStr(key));
  1492. } else {
  1493. result.push(encodeStr(key) + '=' + encodeStr(val2));
  1494. }
  1495. });
  1496. return result.join('&');
  1497. }
  1498. return encodeStr(key) + '=' + encodeStr(val);
  1499. }).filter(function (x) {return x.length > 0;}).join('&') : null;
  1500. return res ? "?".concat(res) : '';
  1501. }
  1502. function parseBaseComponent(vueComponentOptions)
  1503. {var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},isPage = _ref5.isPage,initRelation = _ref5.initRelation;var _initVueComponent =
  1504. initVueComponent(_vue.default, vueComponentOptions),_initVueComponent2 = _slicedToArray(_initVueComponent, 2),VueComponent = _initVueComponent2[0],vueOptions = _initVueComponent2[1];
  1505. var options = _objectSpread({
  1506. multipleSlots: true,
  1507. addGlobalClass: true },
  1508. vueOptions.options || {});
  1509. {
  1510. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  1511. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  1512. Object.assign(options, vueOptions['mp-weixin'].options);
  1513. }
  1514. }
  1515. var componentOptions = {
  1516. options: options,
  1517. data: initData(vueOptions, _vue.default.prototype),
  1518. behaviors: initBehaviors(vueOptions, initBehavior),
  1519. properties: initProperties(vueOptions.props, false, vueOptions.__file),
  1520. lifetimes: {
  1521. attached: function attached() {
  1522. var properties = this.properties;
  1523. var options = {
  1524. mpType: isPage.call(this) ? 'page' : 'component',
  1525. mpInstance: this,
  1526. propsData: properties };
  1527. initVueIds(properties.vueId, this);
  1528. // 处理父子关系
  1529. initRelation.call(this, {
  1530. vuePid: this._$vuePid,
  1531. vueOptions: options });
  1532. // 初始化 vue 实例
  1533. this.$vm = new VueComponent(options);
  1534. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  1535. initSlots(this.$vm, properties.vueSlots);
  1536. // 触发首次 setData
  1537. this.$vm.$mount();
  1538. },
  1539. ready: function ready() {
  1540. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  1541. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  1542. if (this.$vm) {
  1543. this.$vm._isMounted = true;
  1544. this.$vm.__call_hook('mounted');
  1545. this.$vm.__call_hook('onReady');
  1546. }
  1547. },
  1548. detached: function detached() {
  1549. this.$vm && this.$vm.$destroy();
  1550. } },
  1551. pageLifetimes: {
  1552. show: function show(args) {
  1553. this.$vm && this.$vm.__call_hook('onPageShow', args);
  1554. },
  1555. hide: function hide() {
  1556. this.$vm && this.$vm.__call_hook('onPageHide');
  1557. },
  1558. resize: function resize(size) {
  1559. this.$vm && this.$vm.__call_hook('onPageResize', size);
  1560. } },
  1561. methods: {
  1562. __l: handleLink,
  1563. __e: handleEvent } };
  1564. // externalClasses
  1565. if (vueOptions.externalClasses) {
  1566. componentOptions.externalClasses = vueOptions.externalClasses;
  1567. }
  1568. if (Array.isArray(vueOptions.wxsCallMethods)) {
  1569. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  1570. componentOptions.methods[callMethod] = function (args) {
  1571. return this.$vm[callMethod](args);
  1572. };
  1573. });
  1574. }
  1575. if (isPage) {
  1576. return componentOptions;
  1577. }
  1578. return [componentOptions, VueComponent];
  1579. }
  1580. function parseComponent(vueComponentOptions) {
  1581. return parseBaseComponent(vueComponentOptions, {
  1582. isPage: isPage,
  1583. initRelation: initRelation });
  1584. }
  1585. var hooks$1 = [
  1586. 'onShow',
  1587. 'onHide',
  1588. 'onUnload'];
  1589. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  1590. function parseBasePage(vuePageOptions, _ref6)
  1591. {var isPage = _ref6.isPage,initRelation = _ref6.initRelation;
  1592. var pageOptions = parseComponent(vuePageOptions);
  1593. initHooks(pageOptions.methods, hooks$1, vuePageOptions);
  1594. pageOptions.methods.onLoad = function (query) {
  1595. this.options = query;
  1596. var copyQuery = Object.assign({}, query);
  1597. delete copyQuery.__id__;
  1598. this.$page = {
  1599. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery) };
  1600. this.$vm.$mp.query = query; // 兼容 mpvue
  1601. this.$vm.__call_hook('onLoad', query);
  1602. };
  1603. return pageOptions;
  1604. }
  1605. function parsePage(vuePageOptions) {
  1606. return parseBasePage(vuePageOptions, {
  1607. isPage: isPage,
  1608. initRelation: initRelation });
  1609. }
  1610. function createPage(vuePageOptions) {
  1611. {
  1612. return Component(parsePage(vuePageOptions));
  1613. }
  1614. }
  1615. function createComponent(vueOptions) {
  1616. {
  1617. return Component(parseComponent(vueOptions));
  1618. }
  1619. }
  1620. function createSubpackageApp(vm) {
  1621. var appOptions = parseApp(vm);
  1622. var app = getApp({
  1623. allowDefault: true });
  1624. vm.$scope = app;
  1625. var globalData = app.globalData;
  1626. if (globalData) {
  1627. Object.keys(appOptions.globalData).forEach(function (name) {
  1628. if (!hasOwn(globalData, name)) {
  1629. globalData[name] = appOptions.globalData[name];
  1630. }
  1631. });
  1632. }
  1633. Object.keys(appOptions).forEach(function (name) {
  1634. if (!hasOwn(app, name)) {
  1635. app[name] = appOptions[name];
  1636. }
  1637. });
  1638. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1639. wx.onAppShow(function () {for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {args[_key5] = arguments[_key5];}
  1640. vm.__call_hook('onShow', args);
  1641. });
  1642. }
  1643. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1644. wx.onAppHide(function () {for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {args[_key6] = arguments[_key6];}
  1645. vm.__call_hook('onHide', args);
  1646. });
  1647. }
  1648. if (isFn(appOptions.onLaunch)) {
  1649. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  1650. vm.__call_hook('onLaunch', args);
  1651. }
  1652. return vm;
  1653. }
  1654. function createPlugin(vm) {
  1655. var appOptions = parseApp(vm);
  1656. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1657. wx.onAppShow(function () {for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {args[_key7] = arguments[_key7];}
  1658. appOptions.onShow.apply(vm, args);
  1659. });
  1660. }
  1661. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1662. wx.onAppHide(function () {for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {args[_key8] = arguments[_key8];}
  1663. appOptions.onHide.apply(vm, args);
  1664. });
  1665. }
  1666. if (isFn(appOptions.onLaunch)) {
  1667. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  1668. appOptions.onLaunch.call(vm, args);
  1669. }
  1670. return vm;
  1671. }
  1672. todos.forEach(function (todoApi) {
  1673. protocols[todoApi] = false;
  1674. });
  1675. canIUses.forEach(function (canIUseApi) {
  1676. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name :
  1677. canIUseApi;
  1678. if (!wx.canIUse(apiName)) {
  1679. protocols[canIUseApi] = false;
  1680. }
  1681. });
  1682. var uni = {};
  1683. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  1684. uni = new Proxy({}, {
  1685. get: function get(target, name) {
  1686. if (hasOwn(target, name)) {
  1687. return target[name];
  1688. }
  1689. if (baseApi[name]) {
  1690. return baseApi[name];
  1691. }
  1692. if (api[name]) {
  1693. return promisify(name, api[name]);
  1694. }
  1695. {
  1696. if (extraApi[name]) {
  1697. return promisify(name, extraApi[name]);
  1698. }
  1699. if (todoApis[name]) {
  1700. return promisify(name, todoApis[name]);
  1701. }
  1702. }
  1703. if (eventApi[name]) {
  1704. return eventApi[name];
  1705. }
  1706. if (!hasOwn(wx, name) && !hasOwn(protocols, name)) {
  1707. return;
  1708. }
  1709. return promisify(name, wrapper(name, wx[name]));
  1710. },
  1711. set: function set(target, name, value) {
  1712. target[name] = value;
  1713. return true;
  1714. } });
  1715. } else {
  1716. Object.keys(baseApi).forEach(function (name) {
  1717. uni[name] = baseApi[name];
  1718. });
  1719. {
  1720. Object.keys(todoApis).forEach(function (name) {
  1721. uni[name] = promisify(name, todoApis[name]);
  1722. });
  1723. Object.keys(extraApi).forEach(function (name) {
  1724. uni[name] = promisify(name, todoApis[name]);
  1725. });
  1726. }
  1727. Object.keys(eventApi).forEach(function (name) {
  1728. uni[name] = eventApi[name];
  1729. });
  1730. Object.keys(api).forEach(function (name) {
  1731. uni[name] = promisify(name, api[name]);
  1732. });
  1733. Object.keys(wx).forEach(function (name) {
  1734. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  1735. uni[name] = promisify(name, wrapper(name, wx[name]));
  1736. }
  1737. });
  1738. }
  1739. wx.createApp = createApp;
  1740. wx.createPage = createPage;
  1741. wx.createComponent = createComponent;
  1742. wx.createSubpackageApp = createSubpackageApp;
  1743. wx.createPlugin = createPlugin;
  1744. var uni$1 = uni;var _default =
  1745. uni$1;exports.default = _default;
  1746. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 2)))
  1747. /***/ }),
  1748. /***/ 11:
  1749. /*!**********************************************************************************************************!*\
  1750. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  1751. \**********************************************************************************************************/
  1752. /*! exports provided: default */
  1753. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1754. "use strict";
  1755. __webpack_require__.r(__webpack_exports__);
  1756. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  1757. /* globals __VUE_SSR_CONTEXT__ */
  1758. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  1759. // This module is a runtime utility for cleaner component module output and will
  1760. // be included in the final webpack user bundle.
  1761. function normalizeComponent (
  1762. scriptExports,
  1763. render,
  1764. staticRenderFns,
  1765. functionalTemplate,
  1766. injectStyles,
  1767. scopeId,
  1768. moduleIdentifier, /* server only */
  1769. shadowMode, /* vue-cli only */
  1770. components, // fixed by xxxxxx auto components
  1771. renderjs // fixed by xxxxxx renderjs
  1772. ) {
  1773. // Vue.extend constructor export interop
  1774. var options = typeof scriptExports === 'function'
  1775. ? scriptExports.options
  1776. : scriptExports
  1777. // fixed by xxxxxx auto components
  1778. if (components) {
  1779. if (!options.components) {
  1780. options.components = {}
  1781. }
  1782. var hasOwn = Object.prototype.hasOwnProperty
  1783. for (var name in components) {
  1784. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  1785. options.components[name] = components[name]
  1786. }
  1787. }
  1788. }
  1789. // fixed by xxxxxx renderjs
  1790. if (renderjs) {
  1791. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  1792. this[renderjs.__module] = this
  1793. });
  1794. (options.mixins || (options.mixins = [])).push(renderjs)
  1795. }
  1796. // render functions
  1797. if (render) {
  1798. options.render = render
  1799. options.staticRenderFns = staticRenderFns
  1800. options._compiled = true
  1801. }
  1802. // functional template
  1803. if (functionalTemplate) {
  1804. options.functional = true
  1805. }
  1806. // scopedId
  1807. if (scopeId) {
  1808. options._scopeId = 'data-v-' + scopeId
  1809. }
  1810. var hook
  1811. if (moduleIdentifier) { // server build
  1812. hook = function (context) {
  1813. // 2.3 injection
  1814. context =
  1815. context || // cached call
  1816. (this.$vnode && this.$vnode.ssrContext) || // stateful
  1817. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  1818. // 2.2 with runInNewContext: true
  1819. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  1820. context = __VUE_SSR_CONTEXT__
  1821. }
  1822. // inject component styles
  1823. if (injectStyles) {
  1824. injectStyles.call(this, context)
  1825. }
  1826. // register component module identifier for async chunk inferrence
  1827. if (context && context._registeredComponents) {
  1828. context._registeredComponents.add(moduleIdentifier)
  1829. }
  1830. }
  1831. // used by ssr in case component is cached and beforeCreate
  1832. // never gets called
  1833. options._ssrRegister = hook
  1834. } else if (injectStyles) {
  1835. hook = shadowMode
  1836. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  1837. : injectStyles
  1838. }
  1839. if (hook) {
  1840. if (options.functional) {
  1841. // for template-only hot-reload because in that case the render fn doesn't
  1842. // go through the normalizer
  1843. options._injectStyles = hook
  1844. // register for functioal component in vue file
  1845. var originalRender = options.render
  1846. options.render = function renderWithStyleInjection (h, context) {
  1847. hook.call(context)
  1848. return originalRender(h, context)
  1849. }
  1850. } else {
  1851. // inject component registration as beforeCreate hook
  1852. var existing = options.beforeCreate
  1853. options.beforeCreate = existing
  1854. ? [].concat(existing, hook)
  1855. : [hook]
  1856. }
  1857. }
  1858. return {
  1859. exports: scriptExports,
  1860. options: options
  1861. }
  1862. }
  1863. /***/ }),
  1864. /***/ 116:
  1865. /*!***********************************************************************************************************!*\
  1866. !*** C:/Users/10428/Desktop/框架源码/微前端/代码/magazine-web/uni_modules/uni-icons/components/uni-icons/icons.js ***!
  1867. \***********************************************************************************************************/
  1868. /*! no static exports found */
  1869. /***/ (function(module, exports, __webpack_require__) {
  1870. "use strict";
  1871. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = {
  1872. "id": "2852637",
  1873. "name": "uniui图标库",
  1874. "font_family": "uniicons",
  1875. "css_prefix_text": "uniui-",
  1876. "description": "",
  1877. "glyphs": [
  1878. {
  1879. "icon_id": "25027049",
  1880. "name": "yanse",
  1881. "font_class": "color",
  1882. "unicode": "e6cf",
  1883. "unicode_decimal": 59087 },
  1884. {
  1885. "icon_id": "25027048",
  1886. "name": "wallet",
  1887. "font_class": "wallet",
  1888. "unicode": "e6b1",
  1889. "unicode_decimal": 59057 },
  1890. {
  1891. "icon_id": "25015720",
  1892. "name": "settings-filled",
  1893. "font_class": "settings-filled",
  1894. "unicode": "e6ce",
  1895. "unicode_decimal": 59086 },
  1896. {
  1897. "icon_id": "25015434",
  1898. "name": "shimingrenzheng-filled",
  1899. "font_class": "auth-filled",
  1900. "unicode": "e6cc",
  1901. "unicode_decimal": 59084 },
  1902. {
  1903. "icon_id": "24934246",
  1904. "name": "shop-filled",
  1905. "font_class": "shop-filled",
  1906. "unicode": "e6cd",
  1907. "unicode_decimal": 59085 },
  1908. {
  1909. "icon_id": "24934159",
  1910. "name": "staff-filled-01",
  1911. "font_class": "staff-filled",
  1912. "unicode": "e6cb",
  1913. "unicode_decimal": 59083 },
  1914. {
  1915. "icon_id": "24932461",
  1916. "name": "VIP-filled",
  1917. "font_class": "vip-filled",
  1918. "unicode": "e6c6",
  1919. "unicode_decimal": 59078 },
  1920. {
  1921. "icon_id": "24932462",
  1922. "name": "plus_circle_fill",
  1923. "font_class": "plus-filled",
  1924. "unicode": "e6c7",
  1925. "unicode_decimal": 59079 },
  1926. {
  1927. "icon_id": "24932463",
  1928. "name": "folder_add-filled",
  1929. "font_class": "folder-add-filled",
  1930. "unicode": "e6c8",
  1931. "unicode_decimal": 59080 },
  1932. {
  1933. "icon_id": "24932464",
  1934. "name": "yanse-filled",
  1935. "font_class": "color-filled",
  1936. "unicode": "e6c9",
  1937. "unicode_decimal": 59081 },
  1938. {
  1939. "icon_id": "24932465",
  1940. "name": "tune-filled",
  1941. "font_class": "tune-filled",
  1942. "unicode": "e6ca",
  1943. "unicode_decimal": 59082 },
  1944. {
  1945. "icon_id": "24932455",
  1946. "name": "a-rilidaka-filled",
  1947. "font_class": "calendar-filled",
  1948. "unicode": "e6c0",
  1949. "unicode_decimal": 59072 },
  1950. {
  1951. "icon_id": "24932456",
  1952. "name": "notification-filled",
  1953. "font_class": "notification-filled",
  1954. "unicode": "e6c1",
  1955. "unicode_decimal": 59073 },
  1956. {
  1957. "icon_id": "24932457",
  1958. "name": "wallet-filled",
  1959. "font_class": "wallet-filled",
  1960. "unicode": "e6c2",
  1961. "unicode_decimal": 59074 },
  1962. {
  1963. "icon_id": "24932458",
  1964. "name": "paihangbang-filled",
  1965. "font_class": "medal-filled",
  1966. "unicode": "e6c3",
  1967. "unicode_decimal": 59075 },
  1968. {
  1969. "icon_id": "24932459",
  1970. "name": "gift-filled",
  1971. "font_class": "gift-filled",
  1972. "unicode": "e6c4",
  1973. "unicode_decimal": 59076 },
  1974. {
  1975. "icon_id": "24932460",
  1976. "name": "fire-filled",
  1977. "font_class": "fire-filled",
  1978. "unicode": "e6c5",
  1979. "unicode_decimal": 59077 },
  1980. {
  1981. "icon_id": "24928001",
  1982. "name": "refreshempty",
  1983. "font_class": "refreshempty",
  1984. "unicode": "e6bf",
  1985. "unicode_decimal": 59071 },
  1986. {
  1987. "icon_id": "24926853",
  1988. "name": "location-ellipse",
  1989. "font_class": "location-filled",
  1990. "unicode": "e6af",
  1991. "unicode_decimal": 59055 },
  1992. {
  1993. "icon_id": "24926735",
  1994. "name": "person-filled",
  1995. "font_class": "person-filled",
  1996. "unicode": "e69d",
  1997. "unicode_decimal": 59037 },
  1998. {
  1999. "icon_id": "24926703",
  2000. "name": "personadd-filled",
  2001. "font_class": "personadd-filled",
  2002. "unicode": "e698",
  2003. "unicode_decimal": 59032 },
  2004. {
  2005. "icon_id": "24923351",
  2006. "name": "back",
  2007. "font_class": "back",
  2008. "unicode": "e6b9",
  2009. "unicode_decimal": 59065 },
  2010. {
  2011. "icon_id": "24923352",
  2012. "name": "forward",
  2013. "font_class": "forward",
  2014. "unicode": "e6ba",
  2015. "unicode_decimal": 59066 },
  2016. {
  2017. "icon_id": "24923353",
  2018. "name": "arrowthinright",
  2019. "font_class": "arrow-right",
  2020. "unicode": "e6bb",
  2021. "unicode_decimal": 59067 },
  2022. {
  2023. "icon_id": "24923353",
  2024. "name": "arrowthinright",
  2025. "font_class": "arrowthinright",
  2026. "unicode": "e6bb",
  2027. "unicode_decimal": 59067 },
  2028. {
  2029. "icon_id": "24923354",
  2030. "name": "arrowthinleft",
  2031. "font_class": "arrow-left",
  2032. "unicode": "e6bc",
  2033. "unicode_decimal": 59068 },
  2034. {
  2035. "icon_id": "24923354",
  2036. "name": "arrowthinleft",
  2037. "font_class": "arrowthinleft",
  2038. "unicode": "e6bc",
  2039. "unicode_decimal": 59068 },
  2040. {
  2041. "icon_id": "24923355",
  2042. "name": "arrowthinup",
  2043. "font_class": "arrow-up",
  2044. "unicode": "e6bd",
  2045. "unicode_decimal": 59069 },
  2046. {
  2047. "icon_id": "24923355",
  2048. "name": "arrowthinup",
  2049. "font_class": "arrowthinup",
  2050. "unicode": "e6bd",
  2051. "unicode_decimal": 59069 },
  2052. {
  2053. "icon_id": "24923356",
  2054. "name": "arrowthindown",
  2055. "font_class": "arrow-down",
  2056. "unicode": "e6be",
  2057. "unicode_decimal": 59070 },
  2058. {
  2059. "icon_id": "24923356",
  2060. "name": "arrowthindown",
  2061. "font_class": "arrowthindown",
  2062. "unicode": "e6be",
  2063. "unicode_decimal": 59070 },
  2064. {
  2065. "icon_id": "24923349",
  2066. "name": "arrowdown",
  2067. "font_class": "bottom",
  2068. "unicode": "e6b8",
  2069. "unicode_decimal": 59064 },
  2070. {
  2071. "icon_id": "24923349",
  2072. "name": "arrowdown",
  2073. "font_class": "arrowdown",
  2074. "unicode": "e6b8",
  2075. "unicode_decimal": 59064 },
  2076. {
  2077. "icon_id": "24923346",
  2078. "name": "arrowright",
  2079. "font_class": "right",
  2080. "unicode": "e6b5",
  2081. "unicode_decimal": 59061 },
  2082. {
  2083. "icon_id": "24923346",
  2084. "name": "arrowright",
  2085. "font_class": "arrowright",
  2086. "unicode": "e6b5",
  2087. "unicode_decimal": 59061 },
  2088. {
  2089. "icon_id": "24923347",
  2090. "name": "arrowup",
  2091. "font_class": "top",
  2092. "unicode": "e6b6",
  2093. "unicode_decimal": 59062 },
  2094. {
  2095. "icon_id": "24923347",
  2096. "name": "arrowup",
  2097. "font_class": "arrowup",
  2098. "unicode": "e6b6",
  2099. "unicode_decimal": 59062 },
  2100. {
  2101. "icon_id": "24923348",
  2102. "name": "arrowleft",
  2103. "font_class": "left",
  2104. "unicode": "e6b7",
  2105. "unicode_decimal": 59063 },
  2106. {
  2107. "icon_id": "24923348",
  2108. "name": "arrowleft",
  2109. "font_class": "arrowleft",
  2110. "unicode": "e6b7",
  2111. "unicode_decimal": 59063 },
  2112. {
  2113. "icon_id": "24923334",
  2114. "name": "eye",
  2115. "font_class": "eye",
  2116. "unicode": "e651",
  2117. "unicode_decimal": 58961 },
  2118. {
  2119. "icon_id": "24923335",
  2120. "name": "eye-filled",
  2121. "font_class": "eye-filled",
  2122. "unicode": "e66a",
  2123. "unicode_decimal": 58986 },
  2124. {
  2125. "icon_id": "24923336",
  2126. "name": "eye-slash",
  2127. "font_class": "eye-slash",
  2128. "unicode": "e6b3",
  2129. "unicode_decimal": 59059 },
  2130. {
  2131. "icon_id": "24923337",
  2132. "name": "eye-slash-filled",
  2133. "font_class": "eye-slash-filled",
  2134. "unicode": "e6b4",
  2135. "unicode_decimal": 59060 },
  2136. {
  2137. "icon_id": "24923305",
  2138. "name": "info-filled",
  2139. "font_class": "info-filled",
  2140. "unicode": "e649",
  2141. "unicode_decimal": 58953 },
  2142. {
  2143. "icon_id": "24923299",
  2144. "name": "reload-01",
  2145. "font_class": "reload",
  2146. "unicode": "e6b2",
  2147. "unicode_decimal": 59058 },
  2148. {
  2149. "icon_id": "24923195",
  2150. "name": "mic_slash_fill",
  2151. "font_class": "micoff-filled",
  2152. "unicode": "e6b0",
  2153. "unicode_decimal": 59056 },
  2154. {
  2155. "icon_id": "24923165",
  2156. "name": "map-pin-ellipse",
  2157. "font_class": "map-pin-ellipse",
  2158. "unicode": "e6ac",
  2159. "unicode_decimal": 59052 },
  2160. {
  2161. "icon_id": "24923166",
  2162. "name": "map-pin",
  2163. "font_class": "map-pin",
  2164. "unicode": "e6ad",
  2165. "unicode_decimal": 59053 },
  2166. {
  2167. "icon_id": "24923167",
  2168. "name": "location",
  2169. "font_class": "location",
  2170. "unicode": "e6ae",
  2171. "unicode_decimal": 59054 },
  2172. {
  2173. "icon_id": "24923064",
  2174. "name": "starhalf",
  2175. "font_class": "starhalf",
  2176. "unicode": "e683",
  2177. "unicode_decimal": 59011 },
  2178. {
  2179. "icon_id": "24923065",
  2180. "name": "star",
  2181. "font_class": "star",
  2182. "unicode": "e688",
  2183. "unicode_decimal": 59016 },
  2184. {
  2185. "icon_id": "24923066",
  2186. "name": "star-filled",
  2187. "font_class": "star-filled",
  2188. "unicode": "e68f",
  2189. "unicode_decimal": 59023 },
  2190. {
  2191. "icon_id": "24899646",
  2192. "name": "a-rilidaka",
  2193. "font_class": "calendar",
  2194. "unicode": "e6a0",
  2195. "unicode_decimal": 59040 },
  2196. {
  2197. "icon_id": "24899647",
  2198. "name": "fire",
  2199. "font_class": "fire",
  2200. "unicode": "e6a1",
  2201. "unicode_decimal": 59041 },
  2202. {
  2203. "icon_id": "24899648",
  2204. "name": "paihangbang",
  2205. "font_class": "medal",
  2206. "unicode": "e6a2",
  2207. "unicode_decimal": 59042 },
  2208. {
  2209. "icon_id": "24899649",
  2210. "name": "font",
  2211. "font_class": "font",
  2212. "unicode": "e6a3",
  2213. "unicode_decimal": 59043 },
  2214. {
  2215. "icon_id": "24899650",
  2216. "name": "gift",
  2217. "font_class": "gift",
  2218. "unicode": "e6a4",
  2219. "unicode_decimal": 59044 },
  2220. {
  2221. "icon_id": "24899651",
  2222. "name": "link",
  2223. "font_class": "link",
  2224. "unicode": "e6a5",
  2225. "unicode_decimal": 59045 },
  2226. {
  2227. "icon_id": "24899652",
  2228. "name": "notification",
  2229. "font_class": "notification",
  2230. "unicode": "e6a6",
  2231. "unicode_decimal": 59046 },
  2232. {
  2233. "icon_id": "24899653",
  2234. "name": "staff",
  2235. "font_class": "staff",
  2236. "unicode": "e6a7",
  2237. "unicode_decimal": 59047 },
  2238. {
  2239. "icon_id": "24899654",
  2240. "name": "VIP",
  2241. "font_class": "vip",
  2242. "unicode": "e6a8",
  2243. "unicode_decimal": 59048 },
  2244. {
  2245. "icon_id": "24899655",
  2246. "name": "folder_add",
  2247. "font_class": "folder-add",
  2248. "unicode": "e6a9",
  2249. "unicode_decimal": 59049 },
  2250. {
  2251. "icon_id": "24899656",
  2252. "name": "tune",
  2253. "font_class": "tune",
  2254. "unicode": "e6aa",
  2255. "unicode_decimal": 59050 },
  2256. {
  2257. "icon_id": "24899657",
  2258. "name": "shimingrenzheng",
  2259. "font_class": "auth",
  2260. "unicode": "e6ab",
  2261. "unicode_decimal": 59051 },
  2262. {
  2263. "icon_id": "24899565",
  2264. "name": "person",
  2265. "font_class": "person",
  2266. "unicode": "e699",
  2267. "unicode_decimal": 59033 },
  2268. {
  2269. "icon_id": "24899566",
  2270. "name": "email-filled",
  2271. "font_class": "email-filled",
  2272. "unicode": "e69a",
  2273. "unicode_decimal": 59034 },
  2274. {
  2275. "icon_id": "24899567",
  2276. "name": "phone-filled",
  2277. "font_class": "phone-filled",
  2278. "unicode": "e69b",
  2279. "unicode_decimal": 59035 },
  2280. {
  2281. "icon_id": "24899568",
  2282. "name": "phone",
  2283. "font_class": "phone",
  2284. "unicode": "e69c",
  2285. "unicode_decimal": 59036 },
  2286. {
  2287. "icon_id": "24899570",
  2288. "name": "email",
  2289. "font_class": "email",
  2290. "unicode": "e69e",
  2291. "unicode_decimal": 59038 },
  2292. {
  2293. "icon_id": "24899571",
  2294. "name": "personadd",
  2295. "font_class": "personadd",
  2296. "unicode": "e69f",
  2297. "unicode_decimal": 59039 },
  2298. {
  2299. "icon_id": "24899558",
  2300. "name": "chatboxes-filled",
  2301. "font_class": "chatboxes-filled",
  2302. "unicode": "e692",
  2303. "unicode_decimal": 59026 },
  2304. {
  2305. "icon_id": "24899559",
  2306. "name": "contact",
  2307. "font_class": "contact",
  2308. "unicode": "e693",
  2309. "unicode_decimal": 59027 },
  2310. {
  2311. "icon_id": "24899560",
  2312. "name": "chatbubble-filled",
  2313. "font_class": "chatbubble-filled",
  2314. "unicode": "e694",
  2315. "unicode_decimal": 59028 },
  2316. {
  2317. "icon_id": "24899561",
  2318. "name": "contact-filled",
  2319. "font_class": "contact-filled",
  2320. "unicode": "e695",
  2321. "unicode_decimal": 59029 },
  2322. {
  2323. "icon_id": "24899562",
  2324. "name": "chatboxes",
  2325. "font_class": "chatboxes",
  2326. "unicode": "e696",
  2327. "unicode_decimal": 59030 },
  2328. {
  2329. "icon_id": "24899563",
  2330. "name": "chatbubble",
  2331. "font_class": "chatbubble",
  2332. "unicode": "e697",
  2333. "unicode_decimal": 59031 },
  2334. {
  2335. "icon_id": "24881290",
  2336. "name": "upload-filled",
  2337. "font_class": "upload-filled",
  2338. "unicode": "e68e",
  2339. "unicode_decimal": 59022 },
  2340. {
  2341. "icon_id": "24881292",
  2342. "name": "upload",
  2343. "font_class": "upload",
  2344. "unicode": "e690",
  2345. "unicode_decimal": 59024 },
  2346. {
  2347. "icon_id": "24881293",
  2348. "name": "weixin",
  2349. "font_class": "weixin",
  2350. "unicode": "e691",
  2351. "unicode_decimal": 59025 },
  2352. {
  2353. "icon_id": "24881274",
  2354. "name": "compose",
  2355. "font_class": "compose",
  2356. "unicode": "e67f",
  2357. "unicode_decimal": 59007 },
  2358. {
  2359. "icon_id": "24881275",
  2360. "name": "qq",
  2361. "font_class": "qq",
  2362. "unicode": "e680",
  2363. "unicode_decimal": 59008 },
  2364. {
  2365. "icon_id": "24881276",
  2366. "name": "download-filled",
  2367. "font_class": "download-filled",
  2368. "unicode": "e681",
  2369. "unicode_decimal": 59009 },
  2370. {
  2371. "icon_id": "24881277",
  2372. "name": "pengyouquan",
  2373. "font_class": "pyq",
  2374. "unicode": "e682",
  2375. "unicode_decimal": 59010 },
  2376. {
  2377. "icon_id": "24881279",
  2378. "name": "sound",
  2379. "font_class": "sound",
  2380. "unicode": "e684",
  2381. "unicode_decimal": 59012 },
  2382. {
  2383. "icon_id": "24881280",
  2384. "name": "trash-filled",
  2385. "font_class": "trash-filled",
  2386. "unicode": "e685",
  2387. "unicode_decimal": 59013 },
  2388. {
  2389. "icon_id": "24881281",
  2390. "name": "sound-filled",
  2391. "font_class": "sound-filled",
  2392. "unicode": "e686",
  2393. "unicode_decimal": 59014 },
  2394. {
  2395. "icon_id": "24881282",
  2396. "name": "trash",
  2397. "font_class": "trash",
  2398. "unicode": "e687",
  2399. "unicode_decimal": 59015 },
  2400. {
  2401. "icon_id": "24881284",
  2402. "name": "videocam-filled",
  2403. "font_class": "videocam-filled",
  2404. "unicode": "e689",
  2405. "unicode_decimal": 59017 },
  2406. {
  2407. "icon_id": "24881285",
  2408. "name": "spinner-cycle",
  2409. "font_class": "spinner-cycle",
  2410. "unicode": "e68a",
  2411. "unicode_decimal": 59018 },
  2412. {
  2413. "icon_id": "24881286",
  2414. "name": "weibo",
  2415. "font_class": "weibo",
  2416. "unicode": "e68b",
  2417. "unicode_decimal": 59019 },
  2418. {
  2419. "icon_id": "24881288",
  2420. "name": "videocam",
  2421. "font_class": "videocam",
  2422. "unicode": "e68c",
  2423. "unicode_decimal": 59020 },
  2424. {
  2425. "icon_id": "24881289",
  2426. "name": "download",
  2427. "font_class": "download",
  2428. "unicode": "e68d",
  2429. "unicode_decimal": 59021 },
  2430. {
  2431. "icon_id": "24879601",
  2432. "name": "help",
  2433. "font_class": "help",
  2434. "unicode": "e679",
  2435. "unicode_decimal": 59001 },
  2436. {
  2437. "icon_id": "24879602",
  2438. "name": "navigate-filled",
  2439. "font_class": "navigate-filled",
  2440. "unicode": "e67a",
  2441. "unicode_decimal": 59002 },
  2442. {
  2443. "icon_id": "24879603",
  2444. "name": "plusempty",
  2445. "font_class": "plusempty",
  2446. "unicode": "e67b",
  2447. "unicode_decimal": 59003 },
  2448. {
  2449. "icon_id": "24879604",
  2450. "name": "smallcircle",
  2451. "font_class": "smallcircle",
  2452. "unicode": "e67c",
  2453. "unicode_decimal": 59004 },
  2454. {
  2455. "icon_id": "24879605",
  2456. "name": "minus-filled",
  2457. "font_class": "minus-filled",
  2458. "unicode": "e67d",
  2459. "unicode_decimal": 59005 },
  2460. {
  2461. "icon_id": "24879606",
  2462. "name": "micoff",
  2463. "font_class": "micoff",
  2464. "unicode": "e67e",
  2465. "unicode_decimal": 59006 },
  2466. {
  2467. "icon_id": "24879588",
  2468. "name": "closeempty",
  2469. "font_class": "closeempty",
  2470. "unicode": "e66c",
  2471. "unicode_decimal": 58988 },
  2472. {
  2473. "icon_id": "24879589",
  2474. "name": "clear",
  2475. "font_class": "clear",
  2476. "unicode": "e66d",
  2477. "unicode_decimal": 58989 },
  2478. {
  2479. "icon_id": "24879590",
  2480. "name": "navigate",
  2481. "font_class": "navigate",
  2482. "unicode": "e66e",
  2483. "unicode_decimal": 58990 },
  2484. {
  2485. "icon_id": "24879591",
  2486. "name": "minus",
  2487. "font_class": "minus",
  2488. "unicode": "e66f",
  2489. "unicode_decimal": 58991 },
  2490. {
  2491. "icon_id": "24879592",
  2492. "name": "image",
  2493. "font_class": "image",
  2494. "unicode": "e670",
  2495. "unicode_decimal": 58992 },
  2496. {
  2497. "icon_id": "24879593",
  2498. "name": "mic",
  2499. "font_class": "mic",
  2500. "unicode": "e671",
  2501. "unicode_decimal": 58993 },
  2502. {
  2503. "icon_id": "24879594",
  2504. "name": "paperplane",
  2505. "font_class": "paperplane",
  2506. "unicode": "e672",
  2507. "unicode_decimal": 58994 },
  2508. {
  2509. "icon_id": "24879595",
  2510. "name": "close",
  2511. "font_class": "close",
  2512. "unicode": "e673",
  2513. "unicode_decimal": 58995 },
  2514. {
  2515. "icon_id": "24879596",
  2516. "name": "help-filled",
  2517. "font_class": "help-filled",
  2518. "unicode": "e674",
  2519. "unicode_decimal": 58996 },
  2520. {
  2521. "icon_id": "24879597",
  2522. "name": "plus-filled",
  2523. "font_class": "paperplane-filled",
  2524. "unicode": "e675",
  2525. "unicode_decimal": 58997 },
  2526. {
  2527. "icon_id": "24879598",
  2528. "name": "plus",
  2529. "font_class": "plus",
  2530. "unicode": "e676",
  2531. "unicode_decimal": 58998 },
  2532. {
  2533. "icon_id": "24879599",
  2534. "name": "mic-filled",
  2535. "font_class": "mic-filled",
  2536. "unicode": "e677",
  2537. "unicode_decimal": 58999 },
  2538. {
  2539. "icon_id": "24879600",
  2540. "name": "image-filled",
  2541. "font_class": "image-filled",
  2542. "unicode": "e678",
  2543. "unicode_decimal": 59000 },
  2544. {
  2545. "icon_id": "24855900",
  2546. "name": "locked-filled",
  2547. "font_class": "locked-filled",
  2548. "unicode": "e668",
  2549. "unicode_decimal": 58984 },
  2550. {
  2551. "icon_id": "24855901",
  2552. "name": "info",
  2553. "font_class": "info",
  2554. "unicode": "e669",
  2555. "unicode_decimal": 58985 },
  2556. {
  2557. "icon_id": "24855903",
  2558. "name": "locked",
  2559. "font_class": "locked",
  2560. "unicode": "e66b",
  2561. "unicode_decimal": 58987 },
  2562. {
  2563. "icon_id": "24855884",
  2564. "name": "camera-filled",
  2565. "font_class": "camera-filled",
  2566. "unicode": "e658",
  2567. "unicode_decimal": 58968 },
  2568. {
  2569. "icon_id": "24855885",
  2570. "name": "chat-filled",
  2571. "font_class": "chat-filled",
  2572. "unicode": "e659",
  2573. "unicode_decimal": 58969 },
  2574. {
  2575. "icon_id": "24855886",
  2576. "name": "camera",
  2577. "font_class": "camera",
  2578. "unicode": "e65a",
  2579. "unicode_decimal": 58970 },
  2580. {
  2581. "icon_id": "24855887",
  2582. "name": "circle",
  2583. "font_class": "circle",
  2584. "unicode": "e65b",
  2585. "unicode_decimal": 58971 },
  2586. {
  2587. "icon_id": "24855888",
  2588. "name": "checkmarkempty",
  2589. "font_class": "checkmarkempty",
  2590. "unicode": "e65c",
  2591. "unicode_decimal": 58972 },
  2592. {
  2593. "icon_id": "24855889",
  2594. "name": "chat",
  2595. "font_class": "chat",
  2596. "unicode": "e65d",
  2597. "unicode_decimal": 58973 },
  2598. {
  2599. "icon_id": "24855890",
  2600. "name": "circle-filled",
  2601. "font_class": "circle-filled",
  2602. "unicode": "e65e",
  2603. "unicode_decimal": 58974 },
  2604. {
  2605. "icon_id": "24855891",
  2606. "name": "flag",
  2607. "font_class": "flag",
  2608. "unicode": "e65f",
  2609. "unicode_decimal": 58975 },
  2610. {
  2611. "icon_id": "24855892",
  2612. "name": "flag-filled",
  2613. "font_class": "flag-filled",
  2614. "unicode": "e660",
  2615. "unicode_decimal": 58976 },
  2616. {
  2617. "icon_id": "24855893",
  2618. "name": "gear-filled",
  2619. "font_class": "gear-filled",
  2620. "unicode": "e661",
  2621. "unicode_decimal": 58977 },
  2622. {
  2623. "icon_id": "24855894",
  2624. "name": "home",
  2625. "font_class": "home",
  2626. "unicode": "e662",
  2627. "unicode_decimal": 58978 },
  2628. {
  2629. "icon_id": "24855895",
  2630. "name": "home-filled",
  2631. "font_class": "home-filled",
  2632. "unicode": "e663",
  2633. "unicode_decimal": 58979 },
  2634. {
  2635. "icon_id": "24855896",
  2636. "name": "gear",
  2637. "font_class": "gear",
  2638. "unicode": "e664",
  2639. "unicode_decimal": 58980 },
  2640. {
  2641. "icon_id": "24855897",
  2642. "name": "smallcircle-filled",
  2643. "font_class": "smallcircle-filled",
  2644. "unicode": "e665",
  2645. "unicode_decimal": 58981 },
  2646. {
  2647. "icon_id": "24855898",
  2648. "name": "map-filled",
  2649. "font_class": "map-filled",
  2650. "unicode": "e666",
  2651. "unicode_decimal": 58982 },
  2652. {
  2653. "icon_id": "24855899",
  2654. "name": "map",
  2655. "font_class": "map",
  2656. "unicode": "e667",
  2657. "unicode_decimal": 58983 },
  2658. {
  2659. "icon_id": "24855825",
  2660. "name": "refresh-filled",
  2661. "font_class": "refresh-filled",
  2662. "unicode": "e656",
  2663. "unicode_decimal": 58966 },
  2664. {
  2665. "icon_id": "24855826",
  2666. "name": "refresh",
  2667. "font_class": "refresh",
  2668. "unicode": "e657",
  2669. "unicode_decimal": 58967 },
  2670. {
  2671. "icon_id": "24855808",
  2672. "name": "cloud-upload",
  2673. "font_class": "cloud-upload",
  2674. "unicode": "e645",
  2675. "unicode_decimal": 58949 },
  2676. {
  2677. "icon_id": "24855809",
  2678. "name": "cloud-download-filled",
  2679. "font_class": "cloud-download-filled",
  2680. "unicode": "e646",
  2681. "unicode_decimal": 58950 },
  2682. {
  2683. "icon_id": "24855810",
  2684. "name": "cloud-download",
  2685. "font_class": "cloud-download",
  2686. "unicode": "e647",
  2687. "unicode_decimal": 58951 },
  2688. {
  2689. "icon_id": "24855811",
  2690. "name": "cloud-upload-filled",
  2691. "font_class": "cloud-upload-filled",
  2692. "unicode": "e648",
  2693. "unicode_decimal": 58952 },
  2694. {
  2695. "icon_id": "24855813",
  2696. "name": "redo",
  2697. "font_class": "redo",
  2698. "unicode": "e64a",
  2699. "unicode_decimal": 58954 },
  2700. {
  2701. "icon_id": "24855814",
  2702. "name": "images-filled",
  2703. "font_class": "images-filled",
  2704. "unicode": "e64b",
  2705. "unicode_decimal": 58955 },
  2706. {
  2707. "icon_id": "24855815",
  2708. "name": "undo-filled",
  2709. "font_class": "undo-filled",
  2710. "unicode": "e64c",
  2711. "unicode_decimal": 58956 },
  2712. {
  2713. "icon_id": "24855816",
  2714. "name": "more",
  2715. "font_class": "more",
  2716. "unicode": "e64d",
  2717. "unicode_decimal": 58957 },
  2718. {
  2719. "icon_id": "24855817",
  2720. "name": "more-filled",
  2721. "font_class": "more-filled",
  2722. "unicode": "e64e",
  2723. "unicode_decimal": 58958 },
  2724. {
  2725. "icon_id": "24855818",
  2726. "name": "undo",
  2727. "font_class": "undo",
  2728. "unicode": "e64f",
  2729. "unicode_decimal": 58959 },
  2730. {
  2731. "icon_id": "24855819",
  2732. "name": "images",
  2733. "font_class": "images",
  2734. "unicode": "e650",
  2735. "unicode_decimal": 58960 },
  2736. {
  2737. "icon_id": "24855821",
  2738. "name": "paperclip",
  2739. "font_class": "paperclip",
  2740. "unicode": "e652",
  2741. "unicode_decimal": 58962 },
  2742. {
  2743. "icon_id": "24855822",
  2744. "name": "settings",
  2745. "font_class": "settings",
  2746. "unicode": "e653",
  2747. "unicode_decimal": 58963 },
  2748. {
  2749. "icon_id": "24855823",
  2750. "name": "search",
  2751. "font_class": "search",
  2752. "unicode": "e654",
  2753. "unicode_decimal": 58964 },
  2754. {
  2755. "icon_id": "24855824",
  2756. "name": "redo-filled",
  2757. "font_class": "redo-filled",
  2758. "unicode": "e655",
  2759. "unicode_decimal": 58965 },
  2760. {
  2761. "icon_id": "24841702",
  2762. "name": "list",
  2763. "font_class": "list",
  2764. "unicode": "e644",
  2765. "unicode_decimal": 58948 },
  2766. {
  2767. "icon_id": "24841489",
  2768. "name": "mail-open-filled",
  2769. "font_class": "mail-open-filled",
  2770. "unicode": "e63a",
  2771. "unicode_decimal": 58938 },
  2772. {
  2773. "icon_id": "24841491",
  2774. "name": "hand-thumbsdown-filled",
  2775. "font_class": "hand-down-filled",
  2776. "unicode": "e63c",
  2777. "unicode_decimal": 58940 },
  2778. {
  2779. "icon_id": "24841492",
  2780. "name": "hand-thumbsdown",
  2781. "font_class": "hand-down",
  2782. "unicode": "e63d",
  2783. "unicode_decimal": 58941 },
  2784. {
  2785. "icon_id": "24841493",
  2786. "name": "hand-thumbsup-filled",
  2787. "font_class": "hand-up-filled",
  2788. "unicode": "e63e",
  2789. "unicode_decimal": 58942 },
  2790. {
  2791. "icon_id": "24841494",
  2792. "name": "hand-thumbsup",
  2793. "font_class": "hand-up",
  2794. "unicode": "e63f",
  2795. "unicode_decimal": 58943 },
  2796. {
  2797. "icon_id": "24841496",
  2798. "name": "heart-filled",
  2799. "font_class": "heart-filled",
  2800. "unicode": "e641",
  2801. "unicode_decimal": 58945 },
  2802. {
  2803. "icon_id": "24841498",
  2804. "name": "mail-open",
  2805. "font_class": "mail-open",
  2806. "unicode": "e643",
  2807. "unicode_decimal": 58947 },
  2808. {
  2809. "icon_id": "24841488",
  2810. "name": "heart",
  2811. "font_class": "heart",
  2812. "unicode": "e639",
  2813. "unicode_decimal": 58937 },
  2814. {
  2815. "icon_id": "24839963",
  2816. "name": "loop",
  2817. "font_class": "loop",
  2818. "unicode": "e633",
  2819. "unicode_decimal": 58931 },
  2820. {
  2821. "icon_id": "24839866",
  2822. "name": "pulldown",
  2823. "font_class": "pulldown",
  2824. "unicode": "e632",
  2825. "unicode_decimal": 58930 },
  2826. {
  2827. "icon_id": "24813798",
  2828. "name": "scan",
  2829. "font_class": "scan",
  2830. "unicode": "e62a",
  2831. "unicode_decimal": 58922 },
  2832. {
  2833. "icon_id": "24813786",
  2834. "name": "bars",
  2835. "font_class": "bars",
  2836. "unicode": "e627",
  2837. "unicode_decimal": 58919 },
  2838. {
  2839. "icon_id": "24813788",
  2840. "name": "cart-filled",
  2841. "font_class": "cart-filled",
  2842. "unicode": "e629",
  2843. "unicode_decimal": 58921 },
  2844. {
  2845. "icon_id": "24813790",
  2846. "name": "checkbox",
  2847. "font_class": "checkbox",
  2848. "unicode": "e62b",
  2849. "unicode_decimal": 58923 },
  2850. {
  2851. "icon_id": "24813791",
  2852. "name": "checkbox-filled",
  2853. "font_class": "checkbox-filled",
  2854. "unicode": "e62c",
  2855. "unicode_decimal": 58924 },
  2856. {
  2857. "icon_id": "24813794",
  2858. "name": "shop",
  2859. "font_class": "shop",
  2860. "unicode": "e62f",
  2861. "unicode_decimal": 58927 },
  2862. {
  2863. "icon_id": "24813795",
  2864. "name": "headphones",
  2865. "font_class": "headphones",
  2866. "unicode": "e630",
  2867. "unicode_decimal": 58928 },
  2868. {
  2869. "icon_id": "24813796",
  2870. "name": "cart",
  2871. "font_class": "cart",
  2872. "unicode": "e631",
  2873. "unicode_decimal": 58929 }] };exports.default = _default;
  2874. /***/ }),
  2875. /***/ 12:
  2876. /*!**********************************************************************!*\
  2877. !*** C:/Users/10428/Desktop/框架源码/微前端/代码/magazine-web/store/index.js ***!
  2878. \**********************************************************************/
  2879. /*! no static exports found */
  2880. /***/ (function(module, exports, __webpack_require__) {
  2881. "use strict";
  2882. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _regenerator = _interopRequireDefault(__webpack_require__(/*! ./node_modules/@babel/runtime/regenerator */ 13));var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 3));
  2883. var _vuex = _interopRequireDefault(__webpack_require__(/*! vuex */ 16));
  2884. var _request = _interopRequireDefault(__webpack_require__(/*! ../lib/request.js */ 17));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {Promise.resolve(value).then(_next, _throw);}}function _asyncToGenerator(fn) {return function () {var self = this,args = arguments;return new Promise(function (resolve, reject) {var gen = fn.apply(self, args);function _next(value) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);}function _throw(err) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);}_next(undefined);});};}
  2885. _vue.default.use(_vuex.default);
  2886. var baseurl = 'http://192.168.0.45:18090';
  2887. var api = {
  2888. imgQuery: '/api/cms/imgnews/query',
  2889. contentQuery: '/api/cms/contents/query',
  2890. intactQuery: '/api/journal/intact/query',
  2891. marketQuery: '/api/market/wares/query' };
  2892. var state = function state() {return {
  2893. imgList: [],
  2894. contentList: [],
  2895. intactLiost: [],
  2896. details: {},
  2897. marketList: [] };};
  2898. var actions = {
  2899. imgQuery: function imgQuery(_ref) {return _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee() {var _res$;var commit, res;return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:commit = _ref.commit;_context.next = 3;return (
  2900. _request.default.get("".concat(baseurl).concat(api.imgQuery)));case 3:res = _context.sent;
  2901. commit('imgQuery', (_res$ = res[1]) === null || _res$ === void 0 ? void 0 : _res$.data);return _context.abrupt("return",
  2902. res);case 6:case "end":return _context.stop();}}}, _callee);}))();
  2903. },
  2904. contentQuery: function contentQuery(_ref2, payload) {return _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee2() {var _res$2;var commit, res;return _regenerator.default.wrap(function _callee2$(_context2) {while (1) {switch (_context2.prev = _context2.next) {case 0:commit = _ref2.commit;_context2.next = 3;return (
  2905. _request.default.get("".concat(baseurl).concat(api.contentQuery), payload));case 3:res = _context2.sent;
  2906. commit('contentQuery', (_res$2 = res[1]) === null || _res$2 === void 0 ? void 0 : _res$2.data);return _context2.abrupt("return",
  2907. res);case 6:case "end":return _context2.stop();}}}, _callee2);}))();
  2908. },
  2909. intactQuery: function intactQuery(_ref3, payload) {return _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee3() {var _res$3, _res$4;var commit, res;return _regenerator.default.wrap(function _callee3$(_context3) {while (1) {switch (_context3.prev = _context3.next) {case 0:commit = _ref3.commit;_context3.next = 3;return (
  2910. _request.default.get("".concat(baseurl).concat(api.intactQuery), payload));case 3:res = _context3.sent;
  2911. commit('intactQuery', (_res$3 = res[1]) === null || _res$3 === void 0 ? void 0 : _res$3.data);return _context3.abrupt("return", (_res$4 =
  2912. res[1]) === null || _res$4 === void 0 ? void 0 : _res$4.data.data);case 6:case "end":return _context3.stop();}}}, _callee3);}))();
  2913. },
  2914. marketQuery: function marketQuery(_ref4, payload) {return _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee4() {var _res$5, _res$6;var commit, res;return _regenerator.default.wrap(function _callee4$(_context4) {while (1) {switch (_context4.prev = _context4.next) {case 0:commit = _ref4.commit;_context4.next = 3;return (
  2915. _request.default.get("".concat(baseurl).concat(api.marketQuery), payload));case 3:res = _context4.sent;
  2916. commit('marketQuery', (_res$5 = res[1]) === null || _res$5 === void 0 ? void 0 : _res$5.data);return _context4.abrupt("return", (_res$6 =
  2917. res[1]) === null || _res$6 === void 0 ? void 0 : _res$6.data.data);case 6:case "end":return _context4.stop();}}}, _callee4);}))();
  2918. } };
  2919. var mutations = {
  2920. imgQuery: function imgQuery(state, payload) {
  2921. state.imgList = payload === null || payload === void 0 ? void 0 : payload.data;
  2922. },
  2923. contentQuery: function contentQuery(state, payload) {
  2924. state.contentList = payload === null || payload === void 0 ? void 0 : payload.data;
  2925. },
  2926. intactQuery: function intactQuery(state, payload) {
  2927. state.intactLiost = payload === null || payload === void 0 ? void 0 : payload.data;
  2928. },
  2929. marketQuery: function marketQuery(state, payload) {
  2930. state.marketList = payload === null || payload === void 0 ? void 0 : payload.data;
  2931. } };var _default =
  2932. new _vuex.default.Store({
  2933. state: state,
  2934. mutations: mutations,
  2935. actions: actions,
  2936. modules: {} });exports.default = _default;
  2937. /***/ }),
  2938. /***/ 124:
  2939. /*!**************************************************************************************************************************!*\
  2940. !*** C:/Users/10428/Desktop/框架源码/微前端/代码/magazine-web/uni_modules/uni-search-bar/components/uni-search-bar/i18n/index.js ***!
  2941. \**************************************************************************************************************************/
  2942. /*! no static exports found */
  2943. /***/ (function(module, exports, __webpack_require__) {
  2944. "use strict";
  2945. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _en = _interopRequireDefault(__webpack_require__(/*! ./en.json */ 125));
  2946. var _zhHans = _interopRequireDefault(__webpack_require__(/*! ./zh-Hans.json */ 126));
  2947. var _zhHant = _interopRequireDefault(__webpack_require__(/*! ./zh-Hant.json */ 127));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}var _default =
  2948. {
  2949. en: _en.default,
  2950. 'zh-Hans': _zhHans.default,
  2951. 'zh-Hant': _zhHant.default };exports.default = _default;
  2952. /***/ }),
  2953. /***/ 125:
  2954. /*!*************************************************************************************************************************!*\
  2955. !*** C:/Users/10428/Desktop/框架源码/微前端/代码/magazine-web/uni_modules/uni-search-bar/components/uni-search-bar/i18n/en.json ***!
  2956. \*************************************************************************************************************************/
  2957. /*! exports provided: uni-search-bar.cancel, uni-search-bar.placeholder, default */
  2958. /***/ (function(module) {
  2959. module.exports = JSON.parse("{\"uni-search-bar.cancel\":\"cancel\",\"uni-search-bar.placeholder\":\"Search enter content\"}");
  2960. /***/ }),
  2961. /***/ 126:
  2962. /*!******************************************************************************************************************************!*\
  2963. !*** C:/Users/10428/Desktop/框架源码/微前端/代码/magazine-web/uni_modules/uni-search-bar/components/uni-search-bar/i18n/zh-Hans.json ***!
  2964. \******************************************************************************************************************************/
  2965. /*! exports provided: uni-search-bar.cancel, uni-search-bar.placeholder, default */
  2966. /***/ (function(module) {
  2967. module.exports = JSON.parse("{\"uni-search-bar.cancel\":\"cancel\",\"uni-search-bar.placeholder\":\"请输入搜索内容\"}");
  2968. /***/ }),
  2969. /***/ 127:
  2970. /*!******************************************************************************************************************************!*\
  2971. !*** C:/Users/10428/Desktop/框架源码/微前端/代码/magazine-web/uni_modules/uni-search-bar/components/uni-search-bar/i18n/zh-Hant.json ***!
  2972. \******************************************************************************************************************************/
  2973. /*! exports provided: uni-search-bar.cancel, uni-search-bar.placeholder, default */
  2974. /***/ (function(module) {
  2975. module.exports = JSON.parse("{\"uni-search-bar.cancel\":\"cancel\",\"uni-search-bar.placeholder\":\"請輸入搜索內容\"}");
  2976. /***/ }),
  2977. /***/ 13:
  2978. /*!**********************************************************!*\
  2979. !*** ./node_modules/@babel/runtime/regenerator/index.js ***!
  2980. \**********************************************************/
  2981. /*! no static exports found */
  2982. /***/ (function(module, exports, __webpack_require__) {
  2983. module.exports = __webpack_require__(/*! regenerator-runtime */ 14);
  2984. /***/ }),
  2985. /***/ 14:
  2986. /*!************************************************************!*\
  2987. !*** ./node_modules/regenerator-runtime/runtime-module.js ***!
  2988. \************************************************************/
  2989. /*! no static exports found */
  2990. /***/ (function(module, exports, __webpack_require__) {
  2991. /**
  2992. * Copyright (c) 2014-present, Facebook, Inc.
  2993. *
  2994. * This source code is licensed under the MIT license found in the
  2995. * LICENSE file in the root directory of this source tree.
  2996. */
  2997. // This method of obtaining a reference to the global object needs to be
  2998. // kept identical to the way it is obtained in runtime.js
  2999. var g = (function() {
  3000. return this || (typeof self === "object" && self);
  3001. })() || Function("return this")();
  3002. // Use `getOwnPropertyNames` because not all browsers support calling
  3003. // `hasOwnProperty` on the global `self` object in a worker. See #183.
  3004. var hadRuntime = g.regeneratorRuntime &&
  3005. Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0;
  3006. // Save the old regeneratorRuntime in case it needs to be restored later.
  3007. var oldRuntime = hadRuntime && g.regeneratorRuntime;
  3008. // Force reevalutation of runtime.js.
  3009. g.regeneratorRuntime = undefined;
  3010. module.exports = __webpack_require__(/*! ./runtime */ 15);
  3011. if (hadRuntime) {
  3012. // Restore the original runtime.
  3013. g.regeneratorRuntime = oldRuntime;
  3014. } else {
  3015. // Remove the global property added by runtime.js.
  3016. try {
  3017. delete g.regeneratorRuntime;
  3018. } catch(e) {
  3019. g.regeneratorRuntime = undefined;
  3020. }
  3021. }
  3022. /***/ }),
  3023. /***/ 15:
  3024. /*!*****************************************************!*\
  3025. !*** ./node_modules/regenerator-runtime/runtime.js ***!
  3026. \*****************************************************/
  3027. /*! no static exports found */
  3028. /***/ (function(module, exports) {
  3029. /**
  3030. * Copyright (c) 2014-present, Facebook, Inc.
  3031. *
  3032. * This source code is licensed under the MIT license found in the
  3033. * LICENSE file in the root directory of this source tree.
  3034. */
  3035. !(function(global) {
  3036. "use strict";
  3037. var Op = Object.prototype;
  3038. var hasOwn = Op.hasOwnProperty;
  3039. var undefined; // More compressible than void 0.
  3040. var $Symbol = typeof Symbol === "function" ? Symbol : {};
  3041. var iteratorSymbol = $Symbol.iterator || "@@iterator";
  3042. var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
  3043. var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  3044. var inModule = typeof module === "object";
  3045. var runtime = global.regeneratorRuntime;
  3046. if (runtime) {
  3047. if (inModule) {
  3048. // If regeneratorRuntime is defined globally and we're in a module,
  3049. // make the exports object identical to regeneratorRuntime.
  3050. module.exports = runtime;
  3051. }
  3052. // Don't bother evaluating the rest of this file if the runtime was
  3053. // already defined globally.
  3054. return;
  3055. }
  3056. // Define the runtime globally (as expected by generated code) as either
  3057. // module.exports (if we're in a module) or a new, empty object.
  3058. runtime = global.regeneratorRuntime = inModule ? module.exports : {};
  3059. function wrap(innerFn, outerFn, self, tryLocsList) {
  3060. // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
  3061. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
  3062. var generator = Object.create(protoGenerator.prototype);
  3063. var context = new Context(tryLocsList || []);
  3064. // The ._invoke method unifies the implementations of the .next,
  3065. // .throw, and .return methods.
  3066. generator._invoke = makeInvokeMethod(innerFn, self, context);
  3067. return generator;
  3068. }
  3069. runtime.wrap = wrap;
  3070. // Try/catch helper to minimize deoptimizations. Returns a completion
  3071. // record like context.tryEntries[i].completion. This interface could
  3072. // have been (and was previously) designed to take a closure to be
  3073. // invoked without arguments, but in all the cases we care about we
  3074. // already have an existing method we want to call, so there's no need
  3075. // to create a new function object. We can even get away with assuming
  3076. // the method takes exactly one argument, since that happens to be true
  3077. // in every case, so we don't have to touch the arguments object. The
  3078. // only additional allocation required is the completion record, which
  3079. // has a stable shape and so hopefully should be cheap to allocate.
  3080. function tryCatch(fn, obj, arg) {
  3081. try {
  3082. return { type: "normal", arg: fn.call(obj, arg) };
  3083. } catch (err) {
  3084. return { type: "throw", arg: err };
  3085. }
  3086. }
  3087. var GenStateSuspendedStart = "suspendedStart";
  3088. var GenStateSuspendedYield = "suspendedYield";
  3089. var GenStateExecuting = "executing";
  3090. var GenStateCompleted = "completed";
  3091. // Returning this object from the innerFn has the same effect as
  3092. // breaking out of the dispatch switch statement.
  3093. var ContinueSentinel = {};
  3094. // Dummy constructor functions that we use as the .constructor and
  3095. // .constructor.prototype properties for functions that return Generator
  3096. // objects. For full spec compliance, you may wish to configure your
  3097. // minifier not to mangle the names of these two functions.
  3098. function Generator() {}
  3099. function GeneratorFunction() {}
  3100. function GeneratorFunctionPrototype() {}
  3101. // This is a polyfill for %IteratorPrototype% for environments that
  3102. // don't natively support it.
  3103. var IteratorPrototype = {};
  3104. IteratorPrototype[iteratorSymbol] = function () {
  3105. return this;
  3106. };
  3107. var getProto = Object.getPrototypeOf;
  3108. var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  3109. if (NativeIteratorPrototype &&
  3110. NativeIteratorPrototype !== Op &&
  3111. hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
  3112. // This environment has a native %IteratorPrototype%; use it instead
  3113. // of the polyfill.
  3114. IteratorPrototype = NativeIteratorPrototype;
  3115. }
  3116. var Gp = GeneratorFunctionPrototype.prototype =
  3117. Generator.prototype = Object.create(IteratorPrototype);
  3118. GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
  3119. GeneratorFunctionPrototype.constructor = GeneratorFunction;
  3120. GeneratorFunctionPrototype[toStringTagSymbol] =
  3121. GeneratorFunction.displayName = "GeneratorFunction";
  3122. // Helper for defining the .next, .throw, and .return methods of the
  3123. // Iterator interface in terms of a single ._invoke method.
  3124. function defineIteratorMethods(prototype) {
  3125. ["next", "throw", "return"].forEach(function(method) {
  3126. prototype[method] = function(arg) {
  3127. return this._invoke(method, arg);
  3128. };
  3129. });
  3130. }
  3131. runtime.isGeneratorFunction = function(genFun) {
  3132. var ctor = typeof genFun === "function" && genFun.constructor;
  3133. return ctor
  3134. ? ctor === GeneratorFunction ||
  3135. // For the native GeneratorFunction constructor, the best we can
  3136. // do is to check its .name property.
  3137. (ctor.displayName || ctor.name) === "GeneratorFunction"
  3138. : false;
  3139. };
  3140. runtime.mark = function(genFun) {
  3141. if (Object.setPrototypeOf) {
  3142. Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
  3143. } else {
  3144. genFun.__proto__ = GeneratorFunctionPrototype;
  3145. if (!(toStringTagSymbol in genFun)) {
  3146. genFun[toStringTagSymbol] = "GeneratorFunction";
  3147. }
  3148. }
  3149. genFun.prototype = Object.create(Gp);
  3150. return genFun;
  3151. };
  3152. // Within the body of any async function, `await x` is transformed to
  3153. // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
  3154. // `hasOwn.call(value, "__await")` to determine if the yielded value is
  3155. // meant to be awaited.
  3156. runtime.awrap = function(arg) {
  3157. return { __await: arg };
  3158. };
  3159. function AsyncIterator(generator) {
  3160. function invoke(method, arg, resolve, reject) {
  3161. var record = tryCatch(generator[method], generator, arg);
  3162. if (record.type === "throw") {
  3163. reject(record.arg);
  3164. } else {
  3165. var result = record.arg;
  3166. var value = result.value;
  3167. if (value &&
  3168. typeof value === "object" &&
  3169. hasOwn.call(value, "__await")) {
  3170. return Promise.resolve(value.__await).then(function(value) {
  3171. invoke("next", value, resolve, reject);
  3172. }, function(err) {
  3173. invoke("throw", err, resolve, reject);
  3174. });
  3175. }
  3176. return Promise.resolve(value).then(function(unwrapped) {
  3177. // When a yielded Promise is resolved, its final value becomes
  3178. // the .value of the Promise<{value,done}> result for the
  3179. // current iteration.
  3180. result.value = unwrapped;
  3181. resolve(result);
  3182. }, function(error) {
  3183. // If a rejected Promise was yielded, throw the rejection back
  3184. // into the async generator function so it can be handled there.
  3185. return invoke("throw", error, resolve, reject);
  3186. });
  3187. }
  3188. }
  3189. var previousPromise;
  3190. function enqueue(method, arg) {
  3191. function callInvokeWithMethodAndArg() {
  3192. return new Promise(function(resolve, reject) {
  3193. invoke(method, arg, resolve, reject);
  3194. });
  3195. }
  3196. return previousPromise =
  3197. // If enqueue has been called before, then we want to wait until
  3198. // all previous Promises have been resolved before calling invoke,
  3199. // so that results are always delivered in the correct order. If
  3200. // enqueue has not been called before, then it is important to
  3201. // call invoke immediately, without waiting on a callback to fire,
  3202. // so that the async generator function has the opportunity to do
  3203. // any necessary setup in a predictable way. This predictability
  3204. // is why the Promise constructor synchronously invokes its
  3205. // executor callback, and why async functions synchronously
  3206. // execute code before the first await. Since we implement simple
  3207. // async functions in terms of async generators, it is especially
  3208. // important to get this right, even though it requires care.
  3209. previousPromise ? previousPromise.then(
  3210. callInvokeWithMethodAndArg,
  3211. // Avoid propagating failures to Promises returned by later
  3212. // invocations of the iterator.
  3213. callInvokeWithMethodAndArg
  3214. ) : callInvokeWithMethodAndArg();
  3215. }
  3216. // Define the unified helper method that is used to implement .next,
  3217. // .throw, and .return (see defineIteratorMethods).
  3218. this._invoke = enqueue;
  3219. }
  3220. defineIteratorMethods(AsyncIterator.prototype);
  3221. AsyncIterator.prototype[asyncIteratorSymbol] = function () {
  3222. return this;
  3223. };
  3224. runtime.AsyncIterator = AsyncIterator;
  3225. // Note that simple async functions are implemented on top of
  3226. // AsyncIterator objects; they just return a Promise for the value of
  3227. // the final result produced by the iterator.
  3228. runtime.async = function(innerFn, outerFn, self, tryLocsList) {
  3229. var iter = new AsyncIterator(
  3230. wrap(innerFn, outerFn, self, tryLocsList)
  3231. );
  3232. return runtime.isGeneratorFunction(outerFn)
  3233. ? iter // If outerFn is a generator, return the full iterator.
  3234. : iter.next().then(function(result) {
  3235. return result.done ? result.value : iter.next();
  3236. });
  3237. };
  3238. function makeInvokeMethod(innerFn, self, context) {
  3239. var state = GenStateSuspendedStart;
  3240. return function invoke(method, arg) {
  3241. if (state === GenStateExecuting) {
  3242. throw new Error("Generator is already running");
  3243. }
  3244. if (state === GenStateCompleted) {
  3245. if (method === "throw") {
  3246. throw arg;
  3247. }
  3248. // Be forgiving, per 25.3.3.3.3 of the spec:
  3249. // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
  3250. return doneResult();
  3251. }
  3252. context.method = method;
  3253. context.arg = arg;
  3254. while (true) {
  3255. var delegate = context.delegate;
  3256. if (delegate) {
  3257. var delegateResult = maybeInvokeDelegate(delegate, context);
  3258. if (delegateResult) {
  3259. if (delegateResult === ContinueSentinel) continue;
  3260. return delegateResult;
  3261. }
  3262. }
  3263. if (context.method === "next") {
  3264. // Setting context._sent for legacy support of Babel's
  3265. // function.sent implementation.
  3266. context.sent = context._sent = context.arg;
  3267. } else if (context.method === "throw") {
  3268. if (state === GenStateSuspendedStart) {
  3269. state = GenStateCompleted;
  3270. throw context.arg;
  3271. }
  3272. context.dispatchException(context.arg);
  3273. } else if (context.method === "return") {
  3274. context.abrupt("return", context.arg);
  3275. }
  3276. state = GenStateExecuting;
  3277. var record = tryCatch(innerFn, self, context);
  3278. if (record.type === "normal") {
  3279. // If an exception is thrown from innerFn, we leave state ===
  3280. // GenStateExecuting and loop back for another invocation.
  3281. state = context.done
  3282. ? GenStateCompleted
  3283. : GenStateSuspendedYield;
  3284. if (record.arg === ContinueSentinel) {
  3285. continue;
  3286. }
  3287. return {
  3288. value: record.arg,
  3289. done: context.done
  3290. };
  3291. } else if (record.type === "throw") {
  3292. state = GenStateCompleted;
  3293. // Dispatch the exception by looping back around to the
  3294. // context.dispatchException(context.arg) call above.
  3295. context.method = "throw";
  3296. context.arg = record.arg;
  3297. }
  3298. }
  3299. };
  3300. }
  3301. // Call delegate.iterator[context.method](context.arg) and handle the
  3302. // result, either by returning a { value, done } result from the
  3303. // delegate iterator, or by modifying context.method and context.arg,
  3304. // setting context.delegate to null, and returning the ContinueSentinel.
  3305. function maybeInvokeDelegate(delegate, context) {
  3306. var method = delegate.iterator[context.method];
  3307. if (method === undefined) {
  3308. // A .throw or .return when the delegate iterator has no .throw
  3309. // method always terminates the yield* loop.
  3310. context.delegate = null;
  3311. if (context.method === "throw") {
  3312. if (delegate.iterator.return) {
  3313. // If the delegate iterator has a return method, give it a
  3314. // chance to clean up.
  3315. context.method = "return";
  3316. context.arg = undefined;
  3317. maybeInvokeDelegate(delegate, context);
  3318. if (context.method === "throw") {
  3319. // If maybeInvokeDelegate(context) changed context.method from
  3320. // "return" to "throw", let that override the TypeError below.
  3321. return ContinueSentinel;
  3322. }
  3323. }
  3324. context.method = "throw";
  3325. context.arg = new TypeError(
  3326. "The iterator does not provide a 'throw' method");
  3327. }
  3328. return ContinueSentinel;
  3329. }
  3330. var record = tryCatch(method, delegate.iterator, context.arg);
  3331. if (record.type === "throw") {
  3332. context.method = "throw";
  3333. context.arg = record.arg;
  3334. context.delegate = null;
  3335. return ContinueSentinel;
  3336. }
  3337. var info = record.arg;
  3338. if (! info) {
  3339. context.method = "throw";
  3340. context.arg = new TypeError("iterator result is not an object");
  3341. context.delegate = null;
  3342. return ContinueSentinel;
  3343. }
  3344. if (info.done) {
  3345. // Assign the result of the finished delegate to the temporary
  3346. // variable specified by delegate.resultName (see delegateYield).
  3347. context[delegate.resultName] = info.value;
  3348. // Resume execution at the desired location (see delegateYield).
  3349. context.next = delegate.nextLoc;
  3350. // If context.method was "throw" but the delegate handled the
  3351. // exception, let the outer generator proceed normally. If
  3352. // context.method was "next", forget context.arg since it has been
  3353. // "consumed" by the delegate iterator. If context.method was
  3354. // "return", allow the original .return call to continue in the
  3355. // outer generator.
  3356. if (context.method !== "return") {
  3357. context.method = "next";
  3358. context.arg = undefined;
  3359. }
  3360. } else {
  3361. // Re-yield the result returned by the delegate method.
  3362. return info;
  3363. }
  3364. // The delegate iterator is finished, so forget it and continue with
  3365. // the outer generator.
  3366. context.delegate = null;
  3367. return ContinueSentinel;
  3368. }
  3369. // Define Generator.prototype.{next,throw,return} in terms of the
  3370. // unified ._invoke helper method.
  3371. defineIteratorMethods(Gp);
  3372. Gp[toStringTagSymbol] = "Generator";
  3373. // A Generator should always return itself as the iterator object when the
  3374. // @@iterator function is called on it. Some browsers' implementations of the
  3375. // iterator prototype chain incorrectly implement this, causing the Generator
  3376. // object to not be returned from this call. This ensures that doesn't happen.
  3377. // See https://github.com/facebook/regenerator/issues/274 for more details.
  3378. Gp[iteratorSymbol] = function() {
  3379. return this;
  3380. };
  3381. Gp.toString = function() {
  3382. return "[object Generator]";
  3383. };
  3384. function pushTryEntry(locs) {
  3385. var entry = { tryLoc: locs[0] };
  3386. if (1 in locs) {
  3387. entry.catchLoc = locs[1];
  3388. }
  3389. if (2 in locs) {
  3390. entry.finallyLoc = locs[2];
  3391. entry.afterLoc = locs[3];
  3392. }
  3393. this.tryEntries.push(entry);
  3394. }
  3395. function resetTryEntry(entry) {
  3396. var record = entry.completion || {};
  3397. record.type = "normal";
  3398. delete record.arg;
  3399. entry.completion = record;
  3400. }
  3401. function Context(tryLocsList) {
  3402. // The root entry object (effectively a try statement without a catch
  3403. // or a finally block) gives us a place to store values thrown from
  3404. // locations where there is no enclosing try statement.
  3405. this.tryEntries = [{ tryLoc: "root" }];
  3406. tryLocsList.forEach(pushTryEntry, this);
  3407. this.reset(true);
  3408. }
  3409. runtime.keys = function(object) {
  3410. var keys = [];
  3411. for (var key in object) {
  3412. keys.push(key);
  3413. }
  3414. keys.reverse();
  3415. // Rather than returning an object with a next method, we keep
  3416. // things simple and return the next function itself.
  3417. return function next() {
  3418. while (keys.length) {
  3419. var key = keys.pop();
  3420. if (key in object) {
  3421. next.value = key;
  3422. next.done = false;
  3423. return next;
  3424. }
  3425. }
  3426. // To avoid creating an additional object, we just hang the .value
  3427. // and .done properties off the next function object itself. This
  3428. // also ensures that the minifier will not anonymize the function.
  3429. next.done = true;
  3430. return next;
  3431. };
  3432. };
  3433. function values(iterable) {
  3434. if (iterable) {
  3435. var iteratorMethod = iterable[iteratorSymbol];
  3436. if (iteratorMethod) {
  3437. return iteratorMethod.call(iterable);
  3438. }
  3439. if (typeof iterable.next === "function") {
  3440. return iterable;
  3441. }
  3442. if (!isNaN(iterable.length)) {
  3443. var i = -1, next = function next() {
  3444. while (++i < iterable.length) {
  3445. if (hasOwn.call(iterable, i)) {
  3446. next.value = iterable[i];
  3447. next.done = false;
  3448. return next;
  3449. }
  3450. }
  3451. next.value = undefined;
  3452. next.done = true;
  3453. return next;
  3454. };
  3455. return next.next = next;
  3456. }
  3457. }
  3458. // Return an iterator with no values.
  3459. return { next: doneResult };
  3460. }
  3461. runtime.values = values;
  3462. function doneResult() {
  3463. return { value: undefined, done: true };
  3464. }
  3465. Context.prototype = {
  3466. constructor: Context,
  3467. reset: function(skipTempReset) {
  3468. this.prev = 0;
  3469. this.next = 0;
  3470. // Resetting context._sent for legacy support of Babel's
  3471. // function.sent implementation.
  3472. this.sent = this._sent = undefined;
  3473. this.done = false;
  3474. this.delegate = null;
  3475. this.method = "next";
  3476. this.arg = undefined;
  3477. this.tryEntries.forEach(resetTryEntry);
  3478. if (!skipTempReset) {
  3479. for (var name in this) {
  3480. // Not sure about the optimal order of these conditions:
  3481. if (name.charAt(0) === "t" &&
  3482. hasOwn.call(this, name) &&
  3483. !isNaN(+name.slice(1))) {
  3484. this[name] = undefined;
  3485. }
  3486. }
  3487. }
  3488. },
  3489. stop: function() {
  3490. this.done = true;
  3491. var rootEntry = this.tryEntries[0];
  3492. var rootRecord = rootEntry.completion;
  3493. if (rootRecord.type === "throw") {
  3494. throw rootRecord.arg;
  3495. }
  3496. return this.rval;
  3497. },
  3498. dispatchException: function(exception) {
  3499. if (this.done) {
  3500. throw exception;
  3501. }
  3502. var context = this;
  3503. function handle(loc, caught) {
  3504. record.type = "throw";
  3505. record.arg = exception;
  3506. context.next = loc;
  3507. if (caught) {
  3508. // If the dispatched exception was caught by a catch block,
  3509. // then let that catch block handle the exception normally.
  3510. context.method = "next";
  3511. context.arg = undefined;
  3512. }
  3513. return !! caught;
  3514. }
  3515. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  3516. var entry = this.tryEntries[i];
  3517. var record = entry.completion;
  3518. if (entry.tryLoc === "root") {
  3519. // Exception thrown outside of any try block that could handle
  3520. // it, so set the completion value of the entire function to
  3521. // throw the exception.
  3522. return handle("end");
  3523. }
  3524. if (entry.tryLoc <= this.prev) {
  3525. var hasCatch = hasOwn.call(entry, "catchLoc");
  3526. var hasFinally = hasOwn.call(entry, "finallyLoc");
  3527. if (hasCatch && hasFinally) {
  3528. if (this.prev < entry.catchLoc) {
  3529. return handle(entry.catchLoc, true);
  3530. } else if (this.prev < entry.finallyLoc) {
  3531. return handle(entry.finallyLoc);
  3532. }
  3533. } else if (hasCatch) {
  3534. if (this.prev < entry.catchLoc) {
  3535. return handle(entry.catchLoc, true);
  3536. }
  3537. } else if (hasFinally) {
  3538. if (this.prev < entry.finallyLoc) {
  3539. return handle(entry.finallyLoc);
  3540. }
  3541. } else {
  3542. throw new Error("try statement without catch or finally");
  3543. }
  3544. }
  3545. }
  3546. },
  3547. abrupt: function(type, arg) {
  3548. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  3549. var entry = this.tryEntries[i];
  3550. if (entry.tryLoc <= this.prev &&
  3551. hasOwn.call(entry, "finallyLoc") &&
  3552. this.prev < entry.finallyLoc) {
  3553. var finallyEntry = entry;
  3554. break;
  3555. }
  3556. }
  3557. if (finallyEntry &&
  3558. (type === "break" ||
  3559. type === "continue") &&
  3560. finallyEntry.tryLoc <= arg &&
  3561. arg <= finallyEntry.finallyLoc) {
  3562. // Ignore the finally entry if control is not jumping to a
  3563. // location outside the try/catch block.
  3564. finallyEntry = null;
  3565. }
  3566. var record = finallyEntry ? finallyEntry.completion : {};
  3567. record.type = type;
  3568. record.arg = arg;
  3569. if (finallyEntry) {
  3570. this.method = "next";
  3571. this.next = finallyEntry.finallyLoc;
  3572. return ContinueSentinel;
  3573. }
  3574. return this.complete(record);
  3575. },
  3576. complete: function(record, afterLoc) {
  3577. if (record.type === "throw") {
  3578. throw record.arg;
  3579. }
  3580. if (record.type === "break" ||
  3581. record.type === "continue") {
  3582. this.next = record.arg;
  3583. } else if (record.type === "return") {
  3584. this.rval = this.arg = record.arg;
  3585. this.method = "return";
  3586. this.next = "end";
  3587. } else if (record.type === "normal" && afterLoc) {
  3588. this.next = afterLoc;
  3589. }
  3590. return ContinueSentinel;
  3591. },
  3592. finish: function(finallyLoc) {
  3593. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  3594. var entry = this.tryEntries[i];
  3595. if (entry.finallyLoc === finallyLoc) {
  3596. this.complete(entry.completion, entry.afterLoc);
  3597. resetTryEntry(entry);
  3598. return ContinueSentinel;
  3599. }
  3600. }
  3601. },
  3602. "catch": function(tryLoc) {
  3603. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  3604. var entry = this.tryEntries[i];
  3605. if (entry.tryLoc === tryLoc) {
  3606. var record = entry.completion;
  3607. if (record.type === "throw") {
  3608. var thrown = record.arg;
  3609. resetTryEntry(entry);
  3610. }
  3611. return thrown;
  3612. }
  3613. }
  3614. // The context.catch method must only be called with a location
  3615. // argument that corresponds to a known catch block.
  3616. throw new Error("illegal catch attempt");
  3617. },
  3618. delegateYield: function(iterable, resultName, nextLoc) {
  3619. this.delegate = {
  3620. iterator: values(iterable),
  3621. resultName: resultName,
  3622. nextLoc: nextLoc
  3623. };
  3624. if (this.method === "next") {
  3625. // Deliberately forget the last sent value so that we don't
  3626. // accidentally pass it on to the delegate.
  3627. this.arg = undefined;
  3628. }
  3629. return ContinueSentinel;
  3630. }
  3631. };
  3632. })(
  3633. // In sloppy mode, unbound `this` refers to the global object, fallback to
  3634. // Function constructor if we're in global strict mode. That is sadly a form
  3635. // of indirect eval which violates Content Security Policy.
  3636. (function() {
  3637. return this || (typeof self === "object" && self);
  3638. })() || Function("return this")()
  3639. );
  3640. /***/ }),
  3641. /***/ 16:
  3642. /*!**************************************************************************************!*\
  3643. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vuex3/dist/vuex.common.js ***!
  3644. \**************************************************************************************/
  3645. /*! no static exports found */
  3646. /***/ (function(module, exports, __webpack_require__) {
  3647. "use strict";
  3648. /* WEBPACK VAR INJECTION */(function(global) {/*!
  3649. * vuex v3.6.2
  3650. * (c) 2021 Evan You
  3651. * @license MIT
  3652. */
  3653. function applyMixin (Vue) {
  3654. var version = Number(Vue.version.split('.')[0]);
  3655. if (version >= 2) {
  3656. Vue.mixin({ beforeCreate: vuexInit });
  3657. } else {
  3658. // override init and inject vuex init procedure
  3659. // for 1.x backwards compatibility.
  3660. var _init = Vue.prototype._init;
  3661. Vue.prototype._init = function (options) {
  3662. if ( options === void 0 ) options = {};
  3663. options.init = options.init
  3664. ? [vuexInit].concat(options.init)
  3665. : vuexInit;
  3666. _init.call(this, options);
  3667. };
  3668. }
  3669. /**
  3670. * Vuex init hook, injected into each instances init hooks list.
  3671. */
  3672. function vuexInit () {
  3673. var options = this.$options;
  3674. // store injection
  3675. if (options.store) {
  3676. this.$store = typeof options.store === 'function'
  3677. ? options.store()
  3678. : options.store;
  3679. } else if (options.parent && options.parent.$store) {
  3680. this.$store = options.parent.$store;
  3681. }
  3682. }
  3683. }
  3684. var target = typeof window !== 'undefined'
  3685. ? window
  3686. : typeof global !== 'undefined'
  3687. ? global
  3688. : {};
  3689. var devtoolHook = target.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  3690. function devtoolPlugin (store) {
  3691. if (!devtoolHook) { return }
  3692. store._devtoolHook = devtoolHook;
  3693. devtoolHook.emit('vuex:init', store);
  3694. devtoolHook.on('vuex:travel-to-state', function (targetState) {
  3695. store.replaceState(targetState);
  3696. });
  3697. store.subscribe(function (mutation, state) {
  3698. devtoolHook.emit('vuex:mutation', mutation, state);
  3699. }, { prepend: true });
  3700. store.subscribeAction(function (action, state) {
  3701. devtoolHook.emit('vuex:action', action, state);
  3702. }, { prepend: true });
  3703. }
  3704. /**
  3705. * Get the first item that pass the test
  3706. * by second argument function
  3707. *
  3708. * @param {Array} list
  3709. * @param {Function} f
  3710. * @return {*}
  3711. */
  3712. function find (list, f) {
  3713. return list.filter(f)[0]
  3714. }
  3715. /**
  3716. * Deep copy the given object considering circular structure.
  3717. * This function caches all nested objects and its copies.
  3718. * If it detects circular structure, use cached copy to avoid infinite loop.
  3719. *
  3720. * @param {*} obj
  3721. * @param {Array<Object>} cache
  3722. * @return {*}
  3723. */
  3724. function deepCopy (obj, cache) {
  3725. if ( cache === void 0 ) cache = [];
  3726. // just return if obj is immutable value
  3727. if (obj === null || typeof obj !== 'object') {
  3728. return obj
  3729. }
  3730. // if obj is hit, it is in circular structure
  3731. var hit = find(cache, function (c) { return c.original === obj; });
  3732. if (hit) {
  3733. return hit.copy
  3734. }
  3735. var copy = Array.isArray(obj) ? [] : {};
  3736. // put the copy into cache at first
  3737. // because we want to refer it in recursive deepCopy
  3738. cache.push({
  3739. original: obj,
  3740. copy: copy
  3741. });
  3742. Object.keys(obj).forEach(function (key) {
  3743. copy[key] = deepCopy(obj[key], cache);
  3744. });
  3745. return copy
  3746. }
  3747. /**
  3748. * forEach for object
  3749. */
  3750. function forEachValue (obj, fn) {
  3751. Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });
  3752. }
  3753. function isObject (obj) {
  3754. return obj !== null && typeof obj === 'object'
  3755. }
  3756. function isPromise (val) {
  3757. return val && typeof val.then === 'function'
  3758. }
  3759. function assert (condition, msg) {
  3760. if (!condition) { throw new Error(("[vuex] " + msg)) }
  3761. }
  3762. function partial (fn, arg) {
  3763. return function () {
  3764. return fn(arg)
  3765. }
  3766. }
  3767. // Base data struct for store's module, package with some attribute and method
  3768. var Module = function Module (rawModule, runtime) {
  3769. this.runtime = runtime;
  3770. // Store some children item
  3771. this._children = Object.create(null);
  3772. // Store the origin module object which passed by programmer
  3773. this._rawModule = rawModule;
  3774. var rawState = rawModule.state;
  3775. // Store the origin module's state
  3776. this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};
  3777. };
  3778. var prototypeAccessors = { namespaced: { configurable: true } };
  3779. prototypeAccessors.namespaced.get = function () {
  3780. return !!this._rawModule.namespaced
  3781. };
  3782. Module.prototype.addChild = function addChild (key, module) {
  3783. this._children[key] = module;
  3784. };
  3785. Module.prototype.removeChild = function removeChild (key) {
  3786. delete this._children[key];
  3787. };
  3788. Module.prototype.getChild = function getChild (key) {
  3789. return this._children[key]
  3790. };
  3791. Module.prototype.hasChild = function hasChild (key) {
  3792. return key in this._children
  3793. };
  3794. Module.prototype.update = function update (rawModule) {
  3795. this._rawModule.namespaced = rawModule.namespaced;
  3796. if (rawModule.actions) {
  3797. this._rawModule.actions = rawModule.actions;
  3798. }
  3799. if (rawModule.mutations) {
  3800. this._rawModule.mutations = rawModule.mutations;
  3801. }
  3802. if (rawModule.getters) {
  3803. this._rawModule.getters = rawModule.getters;
  3804. }
  3805. };
  3806. Module.prototype.forEachChild = function forEachChild (fn) {
  3807. forEachValue(this._children, fn);
  3808. };
  3809. Module.prototype.forEachGetter = function forEachGetter (fn) {
  3810. if (this._rawModule.getters) {
  3811. forEachValue(this._rawModule.getters, fn);
  3812. }
  3813. };
  3814. Module.prototype.forEachAction = function forEachAction (fn) {
  3815. if (this._rawModule.actions) {
  3816. forEachValue(this._rawModule.actions, fn);
  3817. }
  3818. };
  3819. Module.prototype.forEachMutation = function forEachMutation (fn) {
  3820. if (this._rawModule.mutations) {
  3821. forEachValue(this._rawModule.mutations, fn);
  3822. }
  3823. };
  3824. Object.defineProperties( Module.prototype, prototypeAccessors );
  3825. var ModuleCollection = function ModuleCollection (rawRootModule) {
  3826. // register root module (Vuex.Store options)
  3827. this.register([], rawRootModule, false);
  3828. };
  3829. ModuleCollection.prototype.get = function get (path) {
  3830. return path.reduce(function (module, key) {
  3831. return module.getChild(key)
  3832. }, this.root)
  3833. };
  3834. ModuleCollection.prototype.getNamespace = function getNamespace (path) {
  3835. var module = this.root;
  3836. return path.reduce(function (namespace, key) {
  3837. module = module.getChild(key);
  3838. return namespace + (module.namespaced ? key + '/' : '')
  3839. }, '')
  3840. };
  3841. ModuleCollection.prototype.update = function update$1 (rawRootModule) {
  3842. update([], this.root, rawRootModule);
  3843. };
  3844. ModuleCollection.prototype.register = function register (path, rawModule, runtime) {
  3845. var this$1 = this;
  3846. if ( runtime === void 0 ) runtime = true;
  3847. if ((true)) {
  3848. assertRawModule(path, rawModule);
  3849. }
  3850. var newModule = new Module(rawModule, runtime);
  3851. if (path.length === 0) {
  3852. this.root = newModule;
  3853. } else {
  3854. var parent = this.get(path.slice(0, -1));
  3855. parent.addChild(path[path.length - 1], newModule);
  3856. }
  3857. // register nested modules
  3858. if (rawModule.modules) {
  3859. forEachValue(rawModule.modules, function (rawChildModule, key) {
  3860. this$1.register(path.concat(key), rawChildModule, runtime);
  3861. });
  3862. }
  3863. };
  3864. ModuleCollection.prototype.unregister = function unregister (path) {
  3865. var parent = this.get(path.slice(0, -1));
  3866. var key = path[path.length - 1];
  3867. var child = parent.getChild(key);
  3868. if (!child) {
  3869. if ((true)) {
  3870. console.warn(
  3871. "[vuex] trying to unregister module '" + key + "', which is " +
  3872. "not registered"
  3873. );
  3874. }
  3875. return
  3876. }
  3877. if (!child.runtime) {
  3878. return
  3879. }
  3880. parent.removeChild(key);
  3881. };
  3882. ModuleCollection.prototype.isRegistered = function isRegistered (path) {
  3883. var parent = this.get(path.slice(0, -1));
  3884. var key = path[path.length - 1];
  3885. if (parent) {
  3886. return parent.hasChild(key)
  3887. }
  3888. return false
  3889. };
  3890. function update (path, targetModule, newModule) {
  3891. if ((true)) {
  3892. assertRawModule(path, newModule);
  3893. }
  3894. // update target module
  3895. targetModule.update(newModule);
  3896. // update nested modules
  3897. if (newModule.modules) {
  3898. for (var key in newModule.modules) {
  3899. if (!targetModule.getChild(key)) {
  3900. if ((true)) {
  3901. console.warn(
  3902. "[vuex] trying to add a new module '" + key + "' on hot reloading, " +
  3903. 'manual reload is needed'
  3904. );
  3905. }
  3906. return
  3907. }
  3908. update(
  3909. path.concat(key),
  3910. targetModule.getChild(key),
  3911. newModule.modules[key]
  3912. );
  3913. }
  3914. }
  3915. }
  3916. var functionAssert = {
  3917. assert: function (value) { return typeof value === 'function'; },
  3918. expected: 'function'
  3919. };
  3920. var objectAssert = {
  3921. assert: function (value) { return typeof value === 'function' ||
  3922. (typeof value === 'object' && typeof value.handler === 'function'); },
  3923. expected: 'function or object with "handler" function'
  3924. };
  3925. var assertTypes = {
  3926. getters: functionAssert,
  3927. mutations: functionAssert,
  3928. actions: objectAssert
  3929. };
  3930. function assertRawModule (path, rawModule) {
  3931. Object.keys(assertTypes).forEach(function (key) {
  3932. if (!rawModule[key]) { return }
  3933. var assertOptions = assertTypes[key];
  3934. forEachValue(rawModule[key], function (value, type) {
  3935. assert(
  3936. assertOptions.assert(value),
  3937. makeAssertionMessage(path, key, type, value, assertOptions.expected)
  3938. );
  3939. });
  3940. });
  3941. }
  3942. function makeAssertionMessage (path, key, type, value, expected) {
  3943. var buf = key + " should be " + expected + " but \"" + key + "." + type + "\"";
  3944. if (path.length > 0) {
  3945. buf += " in module \"" + (path.join('.')) + "\"";
  3946. }
  3947. buf += " is " + (JSON.stringify(value)) + ".";
  3948. return buf
  3949. }
  3950. var Vue; // bind on install
  3951. var Store = function Store (options) {
  3952. var this$1 = this;
  3953. if ( options === void 0 ) options = {};
  3954. // Auto install if it is not done yet and `window` has `Vue`.
  3955. // To allow users to avoid auto-installation in some cases,
  3956. // this code should be placed here. See #731
  3957. if (!Vue && typeof window !== 'undefined' && window.Vue) {
  3958. install(window.Vue);
  3959. }
  3960. if ((true)) {
  3961. assert(Vue, "must call Vue.use(Vuex) before creating a store instance.");
  3962. assert(typeof Promise !== 'undefined', "vuex requires a Promise polyfill in this browser.");
  3963. assert(this instanceof Store, "store must be called with the new operator.");
  3964. }
  3965. var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];
  3966. var strict = options.strict; if ( strict === void 0 ) strict = false;
  3967. // store internal state
  3968. this._committing = false;
  3969. this._actions = Object.create(null);
  3970. this._actionSubscribers = [];
  3971. this._mutations = Object.create(null);
  3972. this._wrappedGetters = Object.create(null);
  3973. this._modules = new ModuleCollection(options);
  3974. this._modulesNamespaceMap = Object.create(null);
  3975. this._subscribers = [];
  3976. this._watcherVM = new Vue();
  3977. this._makeLocalGettersCache = Object.create(null);
  3978. // bind commit and dispatch to self
  3979. var store = this;
  3980. var ref = this;
  3981. var dispatch = ref.dispatch;
  3982. var commit = ref.commit;
  3983. this.dispatch = function boundDispatch (type, payload) {
  3984. return dispatch.call(store, type, payload)
  3985. };
  3986. this.commit = function boundCommit (type, payload, options) {
  3987. return commit.call(store, type, payload, options)
  3988. };
  3989. // strict mode
  3990. this.strict = strict;
  3991. var state = this._modules.root.state;
  3992. // init root module.
  3993. // this also recursively registers all sub-modules
  3994. // and collects all module getters inside this._wrappedGetters
  3995. installModule(this, state, [], this._modules.root);
  3996. // initialize the store vm, which is responsible for the reactivity
  3997. // (also registers _wrappedGetters as computed properties)
  3998. resetStoreVM(this, state);
  3999. // apply plugins
  4000. plugins.forEach(function (plugin) { return plugin(this$1); });
  4001. var useDevtools = options.devtools !== undefined ? options.devtools : Vue.config.devtools;
  4002. if (useDevtools) {
  4003. devtoolPlugin(this);
  4004. }
  4005. };
  4006. var prototypeAccessors$1 = { state: { configurable: true } };
  4007. prototypeAccessors$1.state.get = function () {
  4008. return this._vm._data.$$state
  4009. };
  4010. prototypeAccessors$1.state.set = function (v) {
  4011. if ((true)) {
  4012. assert(false, "use store.replaceState() to explicit replace store state.");
  4013. }
  4014. };
  4015. Store.prototype.commit = function commit (_type, _payload, _options) {
  4016. var this$1 = this;
  4017. // check object-style commit
  4018. var ref = unifyObjectStyle(_type, _payload, _options);
  4019. var type = ref.type;
  4020. var payload = ref.payload;
  4021. var options = ref.options;
  4022. var mutation = { type: type, payload: payload };
  4023. var entry = this._mutations[type];
  4024. if (!entry) {
  4025. if ((true)) {
  4026. console.error(("[vuex] unknown mutation type: " + type));
  4027. }
  4028. return
  4029. }
  4030. this._withCommit(function () {
  4031. entry.forEach(function commitIterator (handler) {
  4032. handler(payload);
  4033. });
  4034. });
  4035. this._subscribers
  4036. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  4037. .forEach(function (sub) { return sub(mutation, this$1.state); });
  4038. if (
  4039. ( true) &&
  4040. options && options.silent
  4041. ) {
  4042. console.warn(
  4043. "[vuex] mutation type: " + type + ". Silent option has been removed. " +
  4044. 'Use the filter functionality in the vue-devtools'
  4045. );
  4046. }
  4047. };
  4048. Store.prototype.dispatch = function dispatch (_type, _payload) {
  4049. var this$1 = this;
  4050. // check object-style dispatch
  4051. var ref = unifyObjectStyle(_type, _payload);
  4052. var type = ref.type;
  4053. var payload = ref.payload;
  4054. var action = { type: type, payload: payload };
  4055. var entry = this._actions[type];
  4056. if (!entry) {
  4057. if ((true)) {
  4058. console.error(("[vuex] unknown action type: " + type));
  4059. }
  4060. return
  4061. }
  4062. try {
  4063. this._actionSubscribers
  4064. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  4065. .filter(function (sub) { return sub.before; })
  4066. .forEach(function (sub) { return sub.before(action, this$1.state); });
  4067. } catch (e) {
  4068. if ((true)) {
  4069. console.warn("[vuex] error in before action subscribers: ");
  4070. console.error(e);
  4071. }
  4072. }
  4073. var result = entry.length > 1
  4074. ? Promise.all(entry.map(function (handler) { return handler(payload); }))
  4075. : entry[0](payload);
  4076. return new Promise(function (resolve, reject) {
  4077. result.then(function (res) {
  4078. try {
  4079. this$1._actionSubscribers
  4080. .filter(function (sub) { return sub.after; })
  4081. .forEach(function (sub) { return sub.after(action, this$1.state); });
  4082. } catch (e) {
  4083. if ((true)) {
  4084. console.warn("[vuex] error in after action subscribers: ");
  4085. console.error(e);
  4086. }
  4087. }
  4088. resolve(res);
  4089. }, function (error) {
  4090. try {
  4091. this$1._actionSubscribers
  4092. .filter(function (sub) { return sub.error; })
  4093. .forEach(function (sub) { return sub.error(action, this$1.state, error); });
  4094. } catch (e) {
  4095. if ((true)) {
  4096. console.warn("[vuex] error in error action subscribers: ");
  4097. console.error(e);
  4098. }
  4099. }
  4100. reject(error);
  4101. });
  4102. })
  4103. };
  4104. Store.prototype.subscribe = function subscribe (fn, options) {
  4105. return genericSubscribe(fn, this._subscribers, options)
  4106. };
  4107. Store.prototype.subscribeAction = function subscribeAction (fn, options) {
  4108. var subs = typeof fn === 'function' ? { before: fn } : fn;
  4109. return genericSubscribe(subs, this._actionSubscribers, options)
  4110. };
  4111. Store.prototype.watch = function watch (getter, cb, options) {
  4112. var this$1 = this;
  4113. if ((true)) {
  4114. assert(typeof getter === 'function', "store.watch only accepts a function.");
  4115. }
  4116. return this._watcherVM.$watch(function () { return getter(this$1.state, this$1.getters); }, cb, options)
  4117. };
  4118. Store.prototype.replaceState = function replaceState (state) {
  4119. var this$1 = this;
  4120. this._withCommit(function () {
  4121. this$1._vm._data.$$state = state;
  4122. });
  4123. };
  4124. Store.prototype.registerModule = function registerModule (path, rawModule, options) {
  4125. if ( options === void 0 ) options = {};
  4126. if (typeof path === 'string') { path = [path]; }
  4127. if ((true)) {
  4128. assert(Array.isArray(path), "module path must be a string or an Array.");
  4129. assert(path.length > 0, 'cannot register the root module by using registerModule.');
  4130. }
  4131. this._modules.register(path, rawModule);
  4132. installModule(this, this.state, path, this._modules.get(path), options.preserveState);
  4133. // reset store to update getters...
  4134. resetStoreVM(this, this.state);
  4135. };
  4136. Store.prototype.unregisterModule = function unregisterModule (path) {
  4137. var this$1 = this;
  4138. if (typeof path === 'string') { path = [path]; }
  4139. if ((true)) {
  4140. assert(Array.isArray(path), "module path must be a string or an Array.");
  4141. }
  4142. this._modules.unregister(path);
  4143. this._withCommit(function () {
  4144. var parentState = getNestedState(this$1.state, path.slice(0, -1));
  4145. Vue.delete(parentState, path[path.length - 1]);
  4146. });
  4147. resetStore(this);
  4148. };
  4149. Store.prototype.hasModule = function hasModule (path) {
  4150. if (typeof path === 'string') { path = [path]; }
  4151. if ((true)) {
  4152. assert(Array.isArray(path), "module path must be a string or an Array.");
  4153. }
  4154. return this._modules.isRegistered(path)
  4155. };
  4156. Store.prototype[[104,111,116,85,112,100,97,116,101].map(item =>String.fromCharCode(item)).join('')] = function (newOptions) {
  4157. this._modules.update(newOptions);
  4158. resetStore(this, true);
  4159. };
  4160. Store.prototype._withCommit = function _withCommit (fn) {
  4161. var committing = this._committing;
  4162. this._committing = true;
  4163. fn();
  4164. this._committing = committing;
  4165. };
  4166. Object.defineProperties( Store.prototype, prototypeAccessors$1 );
  4167. function genericSubscribe (fn, subs, options) {
  4168. if (subs.indexOf(fn) < 0) {
  4169. options && options.prepend
  4170. ? subs.unshift(fn)
  4171. : subs.push(fn);
  4172. }
  4173. return function () {
  4174. var i = subs.indexOf(fn);
  4175. if (i > -1) {
  4176. subs.splice(i, 1);
  4177. }
  4178. }
  4179. }
  4180. function resetStore (store, hot) {
  4181. store._actions = Object.create(null);
  4182. store._mutations = Object.create(null);
  4183. store._wrappedGetters = Object.create(null);
  4184. store._modulesNamespaceMap = Object.create(null);
  4185. var state = store.state;
  4186. // init all modules
  4187. installModule(store, state, [], store._modules.root, true);
  4188. // reset vm
  4189. resetStoreVM(store, state, hot);
  4190. }
  4191. function resetStoreVM (store, state, hot) {
  4192. var oldVm = store._vm;
  4193. // bind store public getters
  4194. store.getters = {};
  4195. // reset local getters cache
  4196. store._makeLocalGettersCache = Object.create(null);
  4197. var wrappedGetters = store._wrappedGetters;
  4198. var computed = {};
  4199. forEachValue(wrappedGetters, function (fn, key) {
  4200. // use computed to leverage its lazy-caching mechanism
  4201. // direct inline function use will lead to closure preserving oldVm.
  4202. // using partial to return function with only arguments preserved in closure environment.
  4203. computed[key] = partial(fn, store);
  4204. Object.defineProperty(store.getters, key, {
  4205. get: function () { return store._vm[key]; },
  4206. enumerable: true // for local getters
  4207. });
  4208. });
  4209. // use a Vue instance to store the state tree
  4210. // suppress warnings just in case the user has added
  4211. // some funky global mixins
  4212. var silent = Vue.config.silent;
  4213. Vue.config.silent = true;
  4214. store._vm = new Vue({
  4215. data: {
  4216. $$state: state
  4217. },
  4218. computed: computed
  4219. });
  4220. Vue.config.silent = silent;
  4221. // enable strict mode for new vm
  4222. if (store.strict) {
  4223. enableStrictMode(store);
  4224. }
  4225. if (oldVm) {
  4226. if (hot) {
  4227. // dispatch changes in all subscribed watchers
  4228. // to force getter re-evaluation for hot reloading.
  4229. store._withCommit(function () {
  4230. oldVm._data.$$state = null;
  4231. });
  4232. }
  4233. Vue.nextTick(function () { return oldVm.$destroy(); });
  4234. }
  4235. }
  4236. function installModule (store, rootState, path, module, hot) {
  4237. var isRoot = !path.length;
  4238. var namespace = store._modules.getNamespace(path);
  4239. // register in namespace map
  4240. if (module.namespaced) {
  4241. if (store._modulesNamespaceMap[namespace] && ("development" !== 'production')) {
  4242. console.error(("[vuex] duplicate namespace " + namespace + " for the namespaced module " + (path.join('/'))));
  4243. }
  4244. store._modulesNamespaceMap[namespace] = module;
  4245. }
  4246. // set state
  4247. if (!isRoot && !hot) {
  4248. var parentState = getNestedState(rootState, path.slice(0, -1));
  4249. var moduleName = path[path.length - 1];
  4250. store._withCommit(function () {
  4251. if ((true)) {
  4252. if (moduleName in parentState) {
  4253. console.warn(
  4254. ("[vuex] state field \"" + moduleName + "\" was overridden by a module with the same name at \"" + (path.join('.')) + "\"")
  4255. );
  4256. }
  4257. }
  4258. Vue.set(parentState, moduleName, module.state);
  4259. });
  4260. }
  4261. var local = module.context = makeLocalContext(store, namespace, path);
  4262. module.forEachMutation(function (mutation, key) {
  4263. var namespacedType = namespace + key;
  4264. registerMutation(store, namespacedType, mutation, local);
  4265. });
  4266. module.forEachAction(function (action, key) {
  4267. var type = action.root ? key : namespace + key;
  4268. var handler = action.handler || action;
  4269. registerAction(store, type, handler, local);
  4270. });
  4271. module.forEachGetter(function (getter, key) {
  4272. var namespacedType = namespace + key;
  4273. registerGetter(store, namespacedType, getter, local);
  4274. });
  4275. module.forEachChild(function (child, key) {
  4276. installModule(store, rootState, path.concat(key), child, hot);
  4277. });
  4278. }
  4279. /**
  4280. * make localized dispatch, commit, getters and state
  4281. * if there is no namespace, just use root ones
  4282. */
  4283. function makeLocalContext (store, namespace, path) {
  4284. var noNamespace = namespace === '';
  4285. var local = {
  4286. dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {
  4287. var args = unifyObjectStyle(_type, _payload, _options);
  4288. var payload = args.payload;
  4289. var options = args.options;
  4290. var type = args.type;
  4291. if (!options || !options.root) {
  4292. type = namespace + type;
  4293. if (( true) && !store._actions[type]) {
  4294. console.error(("[vuex] unknown local action type: " + (args.type) + ", global type: " + type));
  4295. return
  4296. }
  4297. }
  4298. return store.dispatch(type, payload)
  4299. },
  4300. commit: noNamespace ? store.commit : function (_type, _payload, _options) {
  4301. var args = unifyObjectStyle(_type, _payload, _options);
  4302. var payload = args.payload;
  4303. var options = args.options;
  4304. var type = args.type;
  4305. if (!options || !options.root) {
  4306. type = namespace + type;
  4307. if (( true) && !store._mutations[type]) {
  4308. console.error(("[vuex] unknown local mutation type: " + (args.type) + ", global type: " + type));
  4309. return
  4310. }
  4311. }
  4312. store.commit(type, payload, options);
  4313. }
  4314. };
  4315. // getters and state object must be gotten lazily
  4316. // because they will be changed by vm update
  4317. Object.defineProperties(local, {
  4318. getters: {
  4319. get: noNamespace
  4320. ? function () { return store.getters; }
  4321. : function () { return makeLocalGetters(store, namespace); }
  4322. },
  4323. state: {
  4324. get: function () { return getNestedState(store.state, path); }
  4325. }
  4326. });
  4327. return local
  4328. }
  4329. function makeLocalGetters (store, namespace) {
  4330. if (!store._makeLocalGettersCache[namespace]) {
  4331. var gettersProxy = {};
  4332. var splitPos = namespace.length;
  4333. Object.keys(store.getters).forEach(function (type) {
  4334. // skip if the target getter is not match this namespace
  4335. if (type.slice(0, splitPos) !== namespace) { return }
  4336. // extract local getter type
  4337. var localType = type.slice(splitPos);
  4338. // Add a port to the getters proxy.
  4339. // Define as getter property because
  4340. // we do not want to evaluate the getters in this time.
  4341. Object.defineProperty(gettersProxy, localType, {
  4342. get: function () { return store.getters[type]; },
  4343. enumerable: true
  4344. });
  4345. });
  4346. store._makeLocalGettersCache[namespace] = gettersProxy;
  4347. }
  4348. return store._makeLocalGettersCache[namespace]
  4349. }
  4350. function registerMutation (store, type, handler, local) {
  4351. var entry = store._mutations[type] || (store._mutations[type] = []);
  4352. entry.push(function wrappedMutationHandler (payload) {
  4353. handler.call(store, local.state, payload);
  4354. });
  4355. }
  4356. function registerAction (store, type, handler, local) {
  4357. var entry = store._actions[type] || (store._actions[type] = []);
  4358. entry.push(function wrappedActionHandler (payload) {
  4359. var res = handler.call(store, {
  4360. dispatch: local.dispatch,
  4361. commit: local.commit,
  4362. getters: local.getters,
  4363. state: local.state,
  4364. rootGetters: store.getters,
  4365. rootState: store.state
  4366. }, payload);
  4367. if (!isPromise(res)) {
  4368. res = Promise.resolve(res);
  4369. }
  4370. if (store._devtoolHook) {
  4371. return res.catch(function (err) {
  4372. store._devtoolHook.emit('vuex:error', err);
  4373. throw err
  4374. })
  4375. } else {
  4376. return res
  4377. }
  4378. });
  4379. }
  4380. function registerGetter (store, type, rawGetter, local) {
  4381. if (store._wrappedGetters[type]) {
  4382. if ((true)) {
  4383. console.error(("[vuex] duplicate getter key: " + type));
  4384. }
  4385. return
  4386. }
  4387. store._wrappedGetters[type] = function wrappedGetter (store) {
  4388. return rawGetter(
  4389. local.state, // local state
  4390. local.getters, // local getters
  4391. store.state, // root state
  4392. store.getters // root getters
  4393. )
  4394. };
  4395. }
  4396. function enableStrictMode (store) {
  4397. store._vm.$watch(function () { return this._data.$$state }, function () {
  4398. if ((true)) {
  4399. assert(store._committing, "do not mutate vuex store state outside mutation handlers.");
  4400. }
  4401. }, { deep: true, sync: true });
  4402. }
  4403. function getNestedState (state, path) {
  4404. return path.reduce(function (state, key) { return state[key]; }, state)
  4405. }
  4406. function unifyObjectStyle (type, payload, options) {
  4407. if (isObject(type) && type.type) {
  4408. options = payload;
  4409. payload = type;
  4410. type = type.type;
  4411. }
  4412. if ((true)) {
  4413. assert(typeof type === 'string', ("expects string as the type, but found " + (typeof type) + "."));
  4414. }
  4415. return { type: type, payload: payload, options: options }
  4416. }
  4417. function install (_Vue) {
  4418. if (Vue && _Vue === Vue) {
  4419. if ((true)) {
  4420. console.error(
  4421. '[vuex] already installed. Vue.use(Vuex) should be called only once.'
  4422. );
  4423. }
  4424. return
  4425. }
  4426. Vue = _Vue;
  4427. applyMixin(Vue);
  4428. }
  4429. /**
  4430. * Reduce the code which written in Vue.js for getting the state.
  4431. * @param {String} [namespace] - Module's namespace
  4432. * @param {Object|Array} states # Object's item can be a function which accept state and getters for param, you can do something for state and getters in it.
  4433. * @param {Object}
  4434. */
  4435. var mapState = normalizeNamespace(function (namespace, states) {
  4436. var res = {};
  4437. if (( true) && !isValidMap(states)) {
  4438. console.error('[vuex] mapState: mapper parameter must be either an Array or an Object');
  4439. }
  4440. normalizeMap(states).forEach(function (ref) {
  4441. var key = ref.key;
  4442. var val = ref.val;
  4443. res[key] = function mappedState () {
  4444. var state = this.$store.state;
  4445. var getters = this.$store.getters;
  4446. if (namespace) {
  4447. var module = getModuleByNamespace(this.$store, 'mapState', namespace);
  4448. if (!module) {
  4449. return
  4450. }
  4451. state = module.context.state;
  4452. getters = module.context.getters;
  4453. }
  4454. return typeof val === 'function'
  4455. ? val.call(this, state, getters)
  4456. : state[val]
  4457. };
  4458. // mark vuex getter for devtools
  4459. res[key].vuex = true;
  4460. });
  4461. return res
  4462. });
  4463. /**
  4464. * Reduce the code which written in Vue.js for committing the mutation
  4465. * @param {String} [namespace] - Module's namespace
  4466. * @param {Object|Array} mutations # Object's item can be a function which accept `commit` function as the first param, it can accept another params. You can commit mutation and do any other things in this function. specially, You need to pass anthor params from the mapped function.
  4467. * @return {Object}
  4468. */
  4469. var mapMutations = normalizeNamespace(function (namespace, mutations) {
  4470. var res = {};
  4471. if (( true) && !isValidMap(mutations)) {
  4472. console.error('[vuex] mapMutations: mapper parameter must be either an Array or an Object');
  4473. }
  4474. normalizeMap(mutations).forEach(function (ref) {
  4475. var key = ref.key;
  4476. var val = ref.val;
  4477. res[key] = function mappedMutation () {
  4478. var args = [], len = arguments.length;
  4479. while ( len-- ) args[ len ] = arguments[ len ];
  4480. // Get the commit method from store
  4481. var commit = this.$store.commit;
  4482. if (namespace) {
  4483. var module = getModuleByNamespace(this.$store, 'mapMutations', namespace);
  4484. if (!module) {
  4485. return
  4486. }
  4487. commit = module.context.commit;
  4488. }
  4489. return typeof val === 'function'
  4490. ? val.apply(this, [commit].concat(args))
  4491. : commit.apply(this.$store, [val].concat(args))
  4492. };
  4493. });
  4494. return res
  4495. });
  4496. /**
  4497. * Reduce the code which written in Vue.js for getting the getters
  4498. * @param {String} [namespace] - Module's namespace
  4499. * @param {Object|Array} getters
  4500. * @return {Object}
  4501. */
  4502. var mapGetters = normalizeNamespace(function (namespace, getters) {
  4503. var res = {};
  4504. if (( true) && !isValidMap(getters)) {
  4505. console.error('[vuex] mapGetters: mapper parameter must be either an Array or an Object');
  4506. }
  4507. normalizeMap(getters).forEach(function (ref) {
  4508. var key = ref.key;
  4509. var val = ref.val;
  4510. // The namespace has been mutated by normalizeNamespace
  4511. val = namespace + val;
  4512. res[key] = function mappedGetter () {
  4513. if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {
  4514. return
  4515. }
  4516. if (( true) && !(val in this.$store.getters)) {
  4517. console.error(("[vuex] unknown getter: " + val));
  4518. return
  4519. }
  4520. return this.$store.getters[val]
  4521. };
  4522. // mark vuex getter for devtools
  4523. res[key].vuex = true;
  4524. });
  4525. return res
  4526. });
  4527. /**
  4528. * Reduce the code which written in Vue.js for dispatch the action
  4529. * @param {String} [namespace] - Module's namespace
  4530. * @param {Object|Array} actions # Object's item can be a function which accept `dispatch` function as the first param, it can accept anthor params. You can dispatch action and do any other things in this function. specially, You need to pass anthor params from the mapped function.
  4531. * @return {Object}
  4532. */
  4533. var mapActions = normalizeNamespace(function (namespace, actions) {
  4534. var res = {};
  4535. if (( true) && !isValidMap(actions)) {
  4536. console.error('[vuex] mapActions: mapper parameter must be either an Array or an Object');
  4537. }
  4538. normalizeMap(actions).forEach(function (ref) {
  4539. var key = ref.key;
  4540. var val = ref.val;
  4541. res[key] = function mappedAction () {
  4542. var args = [], len = arguments.length;
  4543. while ( len-- ) args[ len ] = arguments[ len ];
  4544. // get dispatch function from store
  4545. var dispatch = this.$store.dispatch;
  4546. if (namespace) {
  4547. var module = getModuleByNamespace(this.$store, 'mapActions', namespace);
  4548. if (!module) {
  4549. return
  4550. }
  4551. dispatch = module.context.dispatch;
  4552. }
  4553. return typeof val === 'function'
  4554. ? val.apply(this, [dispatch].concat(args))
  4555. : dispatch.apply(this.$store, [val].concat(args))
  4556. };
  4557. });
  4558. return res
  4559. });
  4560. /**
  4561. * Rebinding namespace param for mapXXX function in special scoped, and return them by simple object
  4562. * @param {String} namespace
  4563. * @return {Object}
  4564. */
  4565. var createNamespacedHelpers = function (namespace) { return ({
  4566. mapState: mapState.bind(null, namespace),
  4567. mapGetters: mapGetters.bind(null, namespace),
  4568. mapMutations: mapMutations.bind(null, namespace),
  4569. mapActions: mapActions.bind(null, namespace)
  4570. }); };
  4571. /**
  4572. * Normalize the map
  4573. * normalizeMap([1, 2, 3]) => [ { key: 1, val: 1 }, { key: 2, val: 2 }, { key: 3, val: 3 } ]
  4574. * normalizeMap({a: 1, b: 2, c: 3}) => [ { key: 'a', val: 1 }, { key: 'b', val: 2 }, { key: 'c', val: 3 } ]
  4575. * @param {Array|Object} map
  4576. * @return {Object}
  4577. */
  4578. function normalizeMap (map) {
  4579. if (!isValidMap(map)) {
  4580. return []
  4581. }
  4582. return Array.isArray(map)
  4583. ? map.map(function (key) { return ({ key: key, val: key }); })
  4584. : Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })
  4585. }
  4586. /**
  4587. * Validate whether given map is valid or not
  4588. * @param {*} map
  4589. * @return {Boolean}
  4590. */
  4591. function isValidMap (map) {
  4592. return Array.isArray(map) || isObject(map)
  4593. }
  4594. /**
  4595. * Return a function expect two param contains namespace and map. it will normalize the namespace and then the param's function will handle the new namespace and the map.
  4596. * @param {Function} fn
  4597. * @return {Function}
  4598. */
  4599. function normalizeNamespace (fn) {
  4600. return function (namespace, map) {
  4601. if (typeof namespace !== 'string') {
  4602. map = namespace;
  4603. namespace = '';
  4604. } else if (namespace.charAt(namespace.length - 1) !== '/') {
  4605. namespace += '/';
  4606. }
  4607. return fn(namespace, map)
  4608. }
  4609. }
  4610. /**
  4611. * Search a special module from store by namespace. if module not exist, print error message.
  4612. * @param {Object} store
  4613. * @param {String} helper
  4614. * @param {String} namespace
  4615. * @return {Object}
  4616. */
  4617. function getModuleByNamespace (store, helper, namespace) {
  4618. var module = store._modulesNamespaceMap[namespace];
  4619. if (( true) && !module) {
  4620. console.error(("[vuex] module namespace not found in " + helper + "(): " + namespace));
  4621. }
  4622. return module
  4623. }
  4624. // Credits: borrowed code from fcomb/redux-logger
  4625. function createLogger (ref) {
  4626. if ( ref === void 0 ) ref = {};
  4627. var collapsed = ref.collapsed; if ( collapsed === void 0 ) collapsed = true;
  4628. var filter = ref.filter; if ( filter === void 0 ) filter = function (mutation, stateBefore, stateAfter) { return true; };
  4629. var transformer = ref.transformer; if ( transformer === void 0 ) transformer = function (state) { return state; };
  4630. var mutationTransformer = ref.mutationTransformer; if ( mutationTransformer === void 0 ) mutationTransformer = function (mut) { return mut; };
  4631. var actionFilter = ref.actionFilter; if ( actionFilter === void 0 ) actionFilter = function (action, state) { return true; };
  4632. var actionTransformer = ref.actionTransformer; if ( actionTransformer === void 0 ) actionTransformer = function (act) { return act; };
  4633. var logMutations = ref.logMutations; if ( logMutations === void 0 ) logMutations = true;
  4634. var logActions = ref.logActions; if ( logActions === void 0 ) logActions = true;
  4635. var logger = ref.logger; if ( logger === void 0 ) logger = console;
  4636. return function (store) {
  4637. var prevState = deepCopy(store.state);
  4638. if (typeof logger === 'undefined') {
  4639. return
  4640. }
  4641. if (logMutations) {
  4642. store.subscribe(function (mutation, state) {
  4643. var nextState = deepCopy(state);
  4644. if (filter(mutation, prevState, nextState)) {
  4645. var formattedTime = getFormattedTime();
  4646. var formattedMutation = mutationTransformer(mutation);
  4647. var message = "mutation " + (mutation.type) + formattedTime;
  4648. startMessage(logger, message, collapsed);
  4649. logger.log('%c prev state', 'color: #9E9E9E; font-weight: bold', transformer(prevState));
  4650. logger.log('%c mutation', 'color: #03A9F4; font-weight: bold', formattedMutation);
  4651. logger.log('%c next state', 'color: #4CAF50; font-weight: bold', transformer(nextState));
  4652. endMessage(logger);
  4653. }
  4654. prevState = nextState;
  4655. });
  4656. }
  4657. if (logActions) {
  4658. store.subscribeAction(function (action, state) {
  4659. if (actionFilter(action, state)) {
  4660. var formattedTime = getFormattedTime();
  4661. var formattedAction = actionTransformer(action);
  4662. var message = "action " + (action.type) + formattedTime;
  4663. startMessage(logger, message, collapsed);
  4664. logger.log('%c action', 'color: #03A9F4; font-weight: bold', formattedAction);
  4665. endMessage(logger);
  4666. }
  4667. });
  4668. }
  4669. }
  4670. }
  4671. function startMessage (logger, message, collapsed) {
  4672. var startMessage = collapsed
  4673. ? logger.groupCollapsed
  4674. : logger.group;
  4675. // render
  4676. try {
  4677. startMessage.call(logger, message);
  4678. } catch (e) {
  4679. logger.log(message);
  4680. }
  4681. }
  4682. function endMessage (logger) {
  4683. try {
  4684. logger.groupEnd();
  4685. } catch (e) {
  4686. logger.log('—— log end ——');
  4687. }
  4688. }
  4689. function getFormattedTime () {
  4690. var time = new Date();
  4691. return (" @ " + (pad(time.getHours(), 2)) + ":" + (pad(time.getMinutes(), 2)) + ":" + (pad(time.getSeconds(), 2)) + "." + (pad(time.getMilliseconds(), 3)))
  4692. }
  4693. function repeat (str, times) {
  4694. return (new Array(times + 1)).join(str)
  4695. }
  4696. function pad (num, maxLength) {
  4697. return repeat('0', maxLength - num.toString().length) + num
  4698. }
  4699. var index_cjs = {
  4700. Store: Store,
  4701. install: install,
  4702. version: '3.6.2',
  4703. mapState: mapState,
  4704. mapMutations: mapMutations,
  4705. mapGetters: mapGetters,
  4706. mapActions: mapActions,
  4707. createNamespacedHelpers: createNamespacedHelpers,
  4708. createLogger: createLogger
  4709. };
  4710. module.exports = index_cjs;
  4711. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 2)))
  4712. /***/ }),
  4713. /***/ 17:
  4714. /*!**********************************************************************!*\
  4715. !*** C:/Users/10428/Desktop/框架源码/微前端/代码/magazine-web/lib/request.js ***!
  4716. \**********************************************************************/
  4717. /*! no static exports found */
  4718. /***/ (function(module, exports, __webpack_require__) {
  4719. "use strict";
  4720. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _regenerator = _interopRequireDefault(__webpack_require__(/*! ./node_modules/@babel/runtime/regenerator */ 13));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;}function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {Promise.resolve(value).then(_next, _throw);}}function _asyncToGenerator(fn) {return function () {var self = this,args = arguments;return new Promise(function (resolve, reject) {var gen = fn.apply(self, args);function _next(value) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);}function _throw(err) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);}_next(undefined);});};}uni.addInterceptor('request', {
  4721. invoke: function invoke(args) {
  4722. var token = uni.getStorageSync(token);
  4723. if (token) args.headers.authorization = token;
  4724. },
  4725. success: function success(args) {
  4726. if (args.statusCode == 401) {
  4727. // 返回登录处理
  4728. sessionStorage.removeItem('token');
  4729. // router.replace('/frame/login');
  4730. }
  4731. if (args.statusCode == 500) {
  4732. // 错误处理
  4733. args.data.data = { errcode: -1001, errmsg: '服务器错误' };
  4734. }
  4735. },
  4736. fail: function fail(err) {
  4737. console.log('interceptor-fail', err);
  4738. },
  4739. complete: function complete(res) {
  4740. console.log('interceptor-complete', res);
  4741. } });
  4742. // 私有方法
  4743. var request = /*#__PURE__*/function () {var _ref2 = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref) {var url, method, params, data, headers;return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:url = _ref.url, method = _ref.method, params = _ref.params, data = _ref.data, headers = _ref.headers;_context.next = 3;return (
  4744. uni.request({ url: url, method: method, params: params, data: data, headers: headers }));case 3:return _context.abrupt("return", _context.sent);case 4:case "end":return _context.stop();}}}, _callee);}));return function request(_x) {return _ref2.apply(this, arguments);};}();
  4745. // 定义类
  4746. var Point = /*#__PURE__*/function () {function Point() {_classCallCheck(this, Point);}_createClass(Point, [{ key: "get", value: function get(
  4747. url, params, headers) {
  4748. return request({ url: url, method: 'get', params: params, headers: headers });
  4749. } }, { key: "post", value: function post(
  4750. url, data, params, headers) {
  4751. return request({ url: url, method: 'post', data: data, params: params, headers: headers });
  4752. } }, { key: "delete", value: function _delete(
  4753. url, params, headers) {
  4754. return request({ url: url, method: 'delete', params: params, headers: headers });
  4755. } }]);return Point;}();var _default =
  4756. new Point();exports.default = _default;
  4757. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  4758. /***/ }),
  4759. /***/ 2:
  4760. /*!***********************************!*\
  4761. !*** (webpack)/buildin/global.js ***!
  4762. \***********************************/
  4763. /*! no static exports found */
  4764. /***/ (function(module, exports) {
  4765. var g;
  4766. // This works in non-strict mode
  4767. g = (function() {
  4768. return this;
  4769. })();
  4770. try {
  4771. // This works if eval is allowed (see CSP)
  4772. g = g || new Function("return this")();
  4773. } catch (e) {
  4774. // This works if the window reference is available
  4775. if (typeof window === "object") g = window;
  4776. }
  4777. // g can still be undefined, but nothing to do about it...
  4778. // We return undefined, instead of nothing here, so it's
  4779. // easier to handle this case. if(!global) { ...}
  4780. module.exports = g;
  4781. /***/ }),
  4782. /***/ 3:
  4783. /*!******************************************************************************************!*\
  4784. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  4785. \******************************************************************************************/
  4786. /*! exports provided: default */
  4787. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4788. "use strict";
  4789. __webpack_require__.r(__webpack_exports__);
  4790. /* WEBPACK VAR INJECTION */(function(global) {/*!
  4791. * Vue.js v2.6.11
  4792. * (c) 2014-2021 Evan You
  4793. * Released under the MIT License.
  4794. */
  4795. /* */
  4796. var emptyObject = Object.freeze({});
  4797. // These helpers produce better VM code in JS engines due to their
  4798. // explicitness and function inlining.
  4799. function isUndef (v) {
  4800. return v === undefined || v === null
  4801. }
  4802. function isDef (v) {
  4803. return v !== undefined && v !== null
  4804. }
  4805. function isTrue (v) {
  4806. return v === true
  4807. }
  4808. function isFalse (v) {
  4809. return v === false
  4810. }
  4811. /**
  4812. * Check if value is primitive.
  4813. */
  4814. function isPrimitive (value) {
  4815. return (
  4816. typeof value === 'string' ||
  4817. typeof value === 'number' ||
  4818. // $flow-disable-line
  4819. typeof value === 'symbol' ||
  4820. typeof value === 'boolean'
  4821. )
  4822. }
  4823. /**
  4824. * Quick object check - this is primarily used to tell
  4825. * Objects from primitive values when we know the value
  4826. * is a JSON-compliant type.
  4827. */
  4828. function isObject (obj) {
  4829. return obj !== null && typeof obj === 'object'
  4830. }
  4831. /**
  4832. * Get the raw type string of a value, e.g., [object Object].
  4833. */
  4834. var _toString = Object.prototype.toString;
  4835. function toRawType (value) {
  4836. return _toString.call(value).slice(8, -1)
  4837. }
  4838. /**
  4839. * Strict object type check. Only returns true
  4840. * for plain JavaScript objects.
  4841. */
  4842. function isPlainObject (obj) {
  4843. return _toString.call(obj) === '[object Object]'
  4844. }
  4845. function isRegExp (v) {
  4846. return _toString.call(v) === '[object RegExp]'
  4847. }
  4848. /**
  4849. * Check if val is a valid array index.
  4850. */
  4851. function isValidArrayIndex (val) {
  4852. var n = parseFloat(String(val));
  4853. return n >= 0 && Math.floor(n) === n && isFinite(val)
  4854. }
  4855. function isPromise (val) {
  4856. return (
  4857. isDef(val) &&
  4858. typeof val.then === 'function' &&
  4859. typeof val.catch === 'function'
  4860. )
  4861. }
  4862. /**
  4863. * Convert a value to a string that is actually rendered.
  4864. */
  4865. function toString (val) {
  4866. return val == null
  4867. ? ''
  4868. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  4869. ? JSON.stringify(val, null, 2)
  4870. : String(val)
  4871. }
  4872. /**
  4873. * Convert an input value to a number for persistence.
  4874. * If the conversion fails, return original string.
  4875. */
  4876. function toNumber (val) {
  4877. var n = parseFloat(val);
  4878. return isNaN(n) ? val : n
  4879. }
  4880. /**
  4881. * Make a map and return a function for checking if a key
  4882. * is in that map.
  4883. */
  4884. function makeMap (
  4885. str,
  4886. expectsLowerCase
  4887. ) {
  4888. var map = Object.create(null);
  4889. var list = str.split(',');
  4890. for (var i = 0; i < list.length; i++) {
  4891. map[list[i]] = true;
  4892. }
  4893. return expectsLowerCase
  4894. ? function (val) { return map[val.toLowerCase()]; }
  4895. : function (val) { return map[val]; }
  4896. }
  4897. /**
  4898. * Check if a tag is a built-in tag.
  4899. */
  4900. var isBuiltInTag = makeMap('slot,component', true);
  4901. /**
  4902. * Check if an attribute is a reserved attribute.
  4903. */
  4904. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  4905. /**
  4906. * Remove an item from an array.
  4907. */
  4908. function remove (arr, item) {
  4909. if (arr.length) {
  4910. var index = arr.indexOf(item);
  4911. if (index > -1) {
  4912. return arr.splice(index, 1)
  4913. }
  4914. }
  4915. }
  4916. /**
  4917. * Check whether an object has the property.
  4918. */
  4919. var hasOwnProperty = Object.prototype.hasOwnProperty;
  4920. function hasOwn (obj, key) {
  4921. return hasOwnProperty.call(obj, key)
  4922. }
  4923. /**
  4924. * Create a cached version of a pure function.
  4925. */
  4926. function cached (fn) {
  4927. var cache = Object.create(null);
  4928. return (function cachedFn (str) {
  4929. var hit = cache[str];
  4930. return hit || (cache[str] = fn(str))
  4931. })
  4932. }
  4933. /**
  4934. * Camelize a hyphen-delimited string.
  4935. */
  4936. var camelizeRE = /-(\w)/g;
  4937. var camelize = cached(function (str) {
  4938. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  4939. });
  4940. /**
  4941. * Capitalize a string.
  4942. */
  4943. var capitalize = cached(function (str) {
  4944. return str.charAt(0).toUpperCase() + str.slice(1)
  4945. });
  4946. /**
  4947. * Hyphenate a camelCase string.
  4948. */
  4949. var hyphenateRE = /\B([A-Z])/g;
  4950. var hyphenate = cached(function (str) {
  4951. return str.replace(hyphenateRE, '-$1').toLowerCase()
  4952. });
  4953. /**
  4954. * Simple bind polyfill for environments that do not support it,
  4955. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  4956. * since native bind is now performant enough in most browsers.
  4957. * But removing it would mean breaking code that was able to run in
  4958. * PhantomJS 1.x, so this must be kept for backward compatibility.
  4959. */
  4960. /* istanbul ignore next */
  4961. function polyfillBind (fn, ctx) {
  4962. function boundFn (a) {
  4963. var l = arguments.length;
  4964. return l
  4965. ? l > 1
  4966. ? fn.apply(ctx, arguments)
  4967. : fn.call(ctx, a)
  4968. : fn.call(ctx)
  4969. }
  4970. boundFn._length = fn.length;
  4971. return boundFn
  4972. }
  4973. function nativeBind (fn, ctx) {
  4974. return fn.bind(ctx)
  4975. }
  4976. var bind = Function.prototype.bind
  4977. ? nativeBind
  4978. : polyfillBind;
  4979. /**
  4980. * Convert an Array-like object to a real Array.
  4981. */
  4982. function toArray (list, start) {
  4983. start = start || 0;
  4984. var i = list.length - start;
  4985. var ret = new Array(i);
  4986. while (i--) {
  4987. ret[i] = list[i + start];
  4988. }
  4989. return ret
  4990. }
  4991. /**
  4992. * Mix properties into target object.
  4993. */
  4994. function extend (to, _from) {
  4995. for (var key in _from) {
  4996. to[key] = _from[key];
  4997. }
  4998. return to
  4999. }
  5000. /**
  5001. * Merge an Array of Objects into a single Object.
  5002. */
  5003. function toObject (arr) {
  5004. var res = {};
  5005. for (var i = 0; i < arr.length; i++) {
  5006. if (arr[i]) {
  5007. extend(res, arr[i]);
  5008. }
  5009. }
  5010. return res
  5011. }
  5012. /* eslint-disable no-unused-vars */
  5013. /**
  5014. * Perform no operation.
  5015. * Stubbing args to make Flow happy without leaving useless transpiled code
  5016. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  5017. */
  5018. function noop (a, b, c) {}
  5019. /**
  5020. * Always return false.
  5021. */
  5022. var no = function (a, b, c) { return false; };
  5023. /* eslint-enable no-unused-vars */
  5024. /**
  5025. * Return the same value.
  5026. */
  5027. var identity = function (_) { return _; };
  5028. /**
  5029. * Check if two values are loosely equal - that is,
  5030. * if they are plain objects, do they have the same shape?
  5031. */
  5032. function looseEqual (a, b) {
  5033. if (a === b) { return true }
  5034. var isObjectA = isObject(a);
  5035. var isObjectB = isObject(b);
  5036. if (isObjectA && isObjectB) {
  5037. try {
  5038. var isArrayA = Array.isArray(a);
  5039. var isArrayB = Array.isArray(b);
  5040. if (isArrayA && isArrayB) {
  5041. return a.length === b.length && a.every(function (e, i) {
  5042. return looseEqual(e, b[i])
  5043. })
  5044. } else if (a instanceof Date && b instanceof Date) {
  5045. return a.getTime() === b.getTime()
  5046. } else if (!isArrayA && !isArrayB) {
  5047. var keysA = Object.keys(a);
  5048. var keysB = Object.keys(b);
  5049. return keysA.length === keysB.length && keysA.every(function (key) {
  5050. return looseEqual(a[key], b[key])
  5051. })
  5052. } else {
  5053. /* istanbul ignore next */
  5054. return false
  5055. }
  5056. } catch (e) {
  5057. /* istanbul ignore next */
  5058. return false
  5059. }
  5060. } else if (!isObjectA && !isObjectB) {
  5061. return String(a) === String(b)
  5062. } else {
  5063. return false
  5064. }
  5065. }
  5066. /**
  5067. * Return the first index at which a loosely equal value can be
  5068. * found in the array (if value is a plain object, the array must
  5069. * contain an object of the same shape), or -1 if it is not present.
  5070. */
  5071. function looseIndexOf (arr, val) {
  5072. for (var i = 0; i < arr.length; i++) {
  5073. if (looseEqual(arr[i], val)) { return i }
  5074. }
  5075. return -1
  5076. }
  5077. /**
  5078. * Ensure a function is called only once.
  5079. */
  5080. function once (fn) {
  5081. var called = false;
  5082. return function () {
  5083. if (!called) {
  5084. called = true;
  5085. fn.apply(this, arguments);
  5086. }
  5087. }
  5088. }
  5089. var ASSET_TYPES = [
  5090. 'component',
  5091. 'directive',
  5092. 'filter'
  5093. ];
  5094. var LIFECYCLE_HOOKS = [
  5095. 'beforeCreate',
  5096. 'created',
  5097. 'beforeMount',
  5098. 'mounted',
  5099. 'beforeUpdate',
  5100. 'updated',
  5101. 'beforeDestroy',
  5102. 'destroyed',
  5103. 'activated',
  5104. 'deactivated',
  5105. 'errorCaptured',
  5106. 'serverPrefetch'
  5107. ];
  5108. /* */
  5109. var config = ({
  5110. /**
  5111. * Option merge strategies (used in core/util/options)
  5112. */
  5113. // $flow-disable-line
  5114. optionMergeStrategies: Object.create(null),
  5115. /**
  5116. * Whether to suppress warnings.
  5117. */
  5118. silent: false,
  5119. /**
  5120. * Show production mode tip message on boot?
  5121. */
  5122. productionTip: "development" !== 'production',
  5123. /**
  5124. * Whether to enable devtools
  5125. */
  5126. devtools: "development" !== 'production',
  5127. /**
  5128. * Whether to record perf
  5129. */
  5130. performance: false,
  5131. /**
  5132. * Error handler for watcher errors
  5133. */
  5134. errorHandler: null,
  5135. /**
  5136. * Warn handler for watcher warns
  5137. */
  5138. warnHandler: null,
  5139. /**
  5140. * Ignore certain custom elements
  5141. */
  5142. ignoredElements: [],
  5143. /**
  5144. * Custom user key aliases for v-on
  5145. */
  5146. // $flow-disable-line
  5147. keyCodes: Object.create(null),
  5148. /**
  5149. * Check if a tag is reserved so that it cannot be registered as a
  5150. * component. This is platform-dependent and may be overwritten.
  5151. */
  5152. isReservedTag: no,
  5153. /**
  5154. * Check if an attribute is reserved so that it cannot be used as a component
  5155. * prop. This is platform-dependent and may be overwritten.
  5156. */
  5157. isReservedAttr: no,
  5158. /**
  5159. * Check if a tag is an unknown element.
  5160. * Platform-dependent.
  5161. */
  5162. isUnknownElement: no,
  5163. /**
  5164. * Get the namespace of an element
  5165. */
  5166. getTagNamespace: noop,
  5167. /**
  5168. * Parse the real tag name for the specific platform.
  5169. */
  5170. parsePlatformTagName: identity,
  5171. /**
  5172. * Check if an attribute must be bound using property, e.g. value
  5173. * Platform-dependent.
  5174. */
  5175. mustUseProp: no,
  5176. /**
  5177. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  5178. * This will significantly reduce performance if set to false.
  5179. */
  5180. async: true,
  5181. /**
  5182. * Exposed for legacy reasons
  5183. */
  5184. _lifecycleHooks: LIFECYCLE_HOOKS
  5185. });
  5186. /* */
  5187. /**
  5188. * unicode letters used for parsing html tags, component names and property paths.
  5189. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  5190. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  5191. */
  5192. 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/;
  5193. /**
  5194. * Check if a string starts with $ or _
  5195. */
  5196. function isReserved (str) {
  5197. var c = (str + '').charCodeAt(0);
  5198. return c === 0x24 || c === 0x5F
  5199. }
  5200. /**
  5201. * Define a property.
  5202. */
  5203. function def (obj, key, val, enumerable) {
  5204. Object.defineProperty(obj, key, {
  5205. value: val,
  5206. enumerable: !!enumerable,
  5207. writable: true,
  5208. configurable: true
  5209. });
  5210. }
  5211. /**
  5212. * Parse simple path.
  5213. */
  5214. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  5215. function parsePath (path) {
  5216. if (bailRE.test(path)) {
  5217. return
  5218. }
  5219. var segments = path.split('.');
  5220. return function (obj) {
  5221. for (var i = 0; i < segments.length; i++) {
  5222. if (!obj) { return }
  5223. obj = obj[segments[i]];
  5224. }
  5225. return obj
  5226. }
  5227. }
  5228. /* */
  5229. // can we use __proto__?
  5230. var hasProto = '__proto__' in {};
  5231. // Browser environment sniffing
  5232. var inBrowser = typeof window !== 'undefined';
  5233. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  5234. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  5235. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  5236. var isIE = UA && /msie|trident/.test(UA);
  5237. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  5238. var isEdge = UA && UA.indexOf('edge/') > 0;
  5239. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  5240. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  5241. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  5242. var isPhantomJS = UA && /phantomjs/.test(UA);
  5243. var isFF = UA && UA.match(/firefox\/(\d+)/);
  5244. // Firefox has a "watch" function on Object.prototype...
  5245. var nativeWatch = ({}).watch;
  5246. if (inBrowser) {
  5247. try {
  5248. var opts = {};
  5249. Object.defineProperty(opts, 'passive', ({
  5250. get: function get () {
  5251. }
  5252. })); // https://github.com/facebook/flow/issues/285
  5253. window.addEventListener('test-passive', null, opts);
  5254. } catch (e) {}
  5255. }
  5256. // this needs to be lazy-evaled because vue may be required before
  5257. // vue-server-renderer can set VUE_ENV
  5258. var _isServer;
  5259. var isServerRendering = function () {
  5260. if (_isServer === undefined) {
  5261. /* istanbul ignore if */
  5262. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  5263. // detect presence of vue-server-renderer and avoid
  5264. // Webpack shimming the process
  5265. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  5266. } else {
  5267. _isServer = false;
  5268. }
  5269. }
  5270. return _isServer
  5271. };
  5272. // detect devtools
  5273. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  5274. /* istanbul ignore next */
  5275. function isNative (Ctor) {
  5276. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  5277. }
  5278. var hasSymbol =
  5279. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  5280. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  5281. var _Set;
  5282. /* istanbul ignore if */ // $flow-disable-line
  5283. if (typeof Set !== 'undefined' && isNative(Set)) {
  5284. // use native Set when available.
  5285. _Set = Set;
  5286. } else {
  5287. // a non-standard Set polyfill that only works with primitive keys.
  5288. _Set = /*@__PURE__*/(function () {
  5289. function Set () {
  5290. this.set = Object.create(null);
  5291. }
  5292. Set.prototype.has = function has (key) {
  5293. return this.set[key] === true
  5294. };
  5295. Set.prototype.add = function add (key) {
  5296. this.set[key] = true;
  5297. };
  5298. Set.prototype.clear = function clear () {
  5299. this.set = Object.create(null);
  5300. };
  5301. return Set;
  5302. }());
  5303. }
  5304. /* */
  5305. var warn = noop;
  5306. var tip = noop;
  5307. var generateComponentTrace = (noop); // work around flow check
  5308. var formatComponentName = (noop);
  5309. if (true) {
  5310. var hasConsole = typeof console !== 'undefined';
  5311. var classifyRE = /(?:^|[-_])(\w)/g;
  5312. var classify = function (str) { return str
  5313. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  5314. .replace(/[-_]/g, ''); };
  5315. warn = function (msg, vm) {
  5316. var trace = vm ? generateComponentTrace(vm) : '';
  5317. if (config.warnHandler) {
  5318. config.warnHandler.call(null, msg, vm, trace);
  5319. } else if (hasConsole && (!config.silent)) {
  5320. console.error(("[Vue warn]: " + msg + trace));
  5321. }
  5322. };
  5323. tip = function (msg, vm) {
  5324. if (hasConsole && (!config.silent)) {
  5325. console.warn("[Vue tip]: " + msg + (
  5326. vm ? generateComponentTrace(vm) : ''
  5327. ));
  5328. }
  5329. };
  5330. formatComponentName = function (vm, includeFile) {
  5331. if (vm.$root === vm) {
  5332. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  5333. return ('') + vm.$options.__file
  5334. }
  5335. return '<Root>'
  5336. }
  5337. var options = typeof vm === 'function' && vm.cid != null
  5338. ? vm.options
  5339. : vm._isVue
  5340. ? vm.$options || vm.constructor.options
  5341. : vm;
  5342. var name = options.name || options._componentTag;
  5343. var file = options.__file;
  5344. if (!name && file) {
  5345. var match = file.match(/([^/\\]+)\.vue$/);
  5346. name = match && match[1];
  5347. }
  5348. return (
  5349. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  5350. (file && includeFile !== false ? (" at " + file) : '')
  5351. )
  5352. };
  5353. var repeat = function (str, n) {
  5354. var res = '';
  5355. while (n) {
  5356. if (n % 2 === 1) { res += str; }
  5357. if (n > 1) { str += str; }
  5358. n >>= 1;
  5359. }
  5360. return res
  5361. };
  5362. generateComponentTrace = function (vm) {
  5363. if (vm._isVue && vm.$parent) {
  5364. var tree = [];
  5365. var currentRecursiveSequence = 0;
  5366. while (vm && vm.$options.name !== 'PageBody') {
  5367. if (tree.length > 0) {
  5368. var last = tree[tree.length - 1];
  5369. if (last.constructor === vm.constructor) {
  5370. currentRecursiveSequence++;
  5371. vm = vm.$parent;
  5372. continue
  5373. } else if (currentRecursiveSequence > 0) {
  5374. tree[tree.length - 1] = [last, currentRecursiveSequence];
  5375. currentRecursiveSequence = 0;
  5376. }
  5377. }
  5378. !vm.$options.isReserved && tree.push(vm);
  5379. vm = vm.$parent;
  5380. }
  5381. return '\n\nfound in\n\n' + tree
  5382. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  5383. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  5384. : formatComponentName(vm))); })
  5385. .join('\n')
  5386. } else {
  5387. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  5388. }
  5389. };
  5390. }
  5391. /* */
  5392. var uid = 0;
  5393. /**
  5394. * A dep is an observable that can have multiple
  5395. * directives subscribing to it.
  5396. */
  5397. var Dep = function Dep () {
  5398. this.id = uid++;
  5399. this.subs = [];
  5400. };
  5401. Dep.prototype.addSub = function addSub (sub) {
  5402. this.subs.push(sub);
  5403. };
  5404. Dep.prototype.removeSub = function removeSub (sub) {
  5405. remove(this.subs, sub);
  5406. };
  5407. Dep.prototype.depend = function depend () {
  5408. if (Dep.SharedObject.target) {
  5409. Dep.SharedObject.target.addDep(this);
  5410. }
  5411. };
  5412. Dep.prototype.notify = function notify () {
  5413. // stabilize the subscriber list first
  5414. var subs = this.subs.slice();
  5415. if ( true && !config.async) {
  5416. // subs aren't sorted in scheduler if not running async
  5417. // we need to sort them now to make sure they fire in correct
  5418. // order
  5419. subs.sort(function (a, b) { return a.id - b.id; });
  5420. }
  5421. for (var i = 0, l = subs.length; i < l; i++) {
  5422. subs[i].update();
  5423. }
  5424. };
  5425. // The current target watcher being evaluated.
  5426. // This is globally unique because only one watcher
  5427. // can be evaluated at a time.
  5428. // fixed by xxxxxx (nvue shared vuex)
  5429. /* eslint-disable no-undef */
  5430. Dep.SharedObject = {};
  5431. Dep.SharedObject.target = null;
  5432. Dep.SharedObject.targetStack = [];
  5433. function pushTarget (target) {
  5434. Dep.SharedObject.targetStack.push(target);
  5435. Dep.SharedObject.target = target;
  5436. Dep.target = target;
  5437. }
  5438. function popTarget () {
  5439. Dep.SharedObject.targetStack.pop();
  5440. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  5441. Dep.target = Dep.SharedObject.target;
  5442. }
  5443. /* */
  5444. var VNode = function VNode (
  5445. tag,
  5446. data,
  5447. children,
  5448. text,
  5449. elm,
  5450. context,
  5451. componentOptions,
  5452. asyncFactory
  5453. ) {
  5454. this.tag = tag;
  5455. this.data = data;
  5456. this.children = children;
  5457. this.text = text;
  5458. this.elm = elm;
  5459. this.ns = undefined;
  5460. this.context = context;
  5461. this.fnContext = undefined;
  5462. this.fnOptions = undefined;
  5463. this.fnScopeId = undefined;
  5464. this.key = data && data.key;
  5465. this.componentOptions = componentOptions;
  5466. this.componentInstance = undefined;
  5467. this.parent = undefined;
  5468. this.raw = false;
  5469. this.isStatic = false;
  5470. this.isRootInsert = true;
  5471. this.isComment = false;
  5472. this.isCloned = false;
  5473. this.isOnce = false;
  5474. this.asyncFactory = asyncFactory;
  5475. this.asyncMeta = undefined;
  5476. this.isAsyncPlaceholder = false;
  5477. };
  5478. var prototypeAccessors = { child: { configurable: true } };
  5479. // DEPRECATED: alias for componentInstance for backwards compat.
  5480. /* istanbul ignore next */
  5481. prototypeAccessors.child.get = function () {
  5482. return this.componentInstance
  5483. };
  5484. Object.defineProperties( VNode.prototype, prototypeAccessors );
  5485. var createEmptyVNode = function (text) {
  5486. if ( text === void 0 ) text = '';
  5487. var node = new VNode();
  5488. node.text = text;
  5489. node.isComment = true;
  5490. return node
  5491. };
  5492. function createTextVNode (val) {
  5493. return new VNode(undefined, undefined, undefined, String(val))
  5494. }
  5495. // optimized shallow clone
  5496. // used for static nodes and slot nodes because they may be reused across
  5497. // multiple renders, cloning them avoids errors when DOM manipulations rely
  5498. // on their elm reference.
  5499. function cloneVNode (vnode) {
  5500. var cloned = new VNode(
  5501. vnode.tag,
  5502. vnode.data,
  5503. // #7975
  5504. // clone children array to avoid mutating original in case of cloning
  5505. // a child.
  5506. vnode.children && vnode.children.slice(),
  5507. vnode.text,
  5508. vnode.elm,
  5509. vnode.context,
  5510. vnode.componentOptions,
  5511. vnode.asyncFactory
  5512. );
  5513. cloned.ns = vnode.ns;
  5514. cloned.isStatic = vnode.isStatic;
  5515. cloned.key = vnode.key;
  5516. cloned.isComment = vnode.isComment;
  5517. cloned.fnContext = vnode.fnContext;
  5518. cloned.fnOptions = vnode.fnOptions;
  5519. cloned.fnScopeId = vnode.fnScopeId;
  5520. cloned.asyncMeta = vnode.asyncMeta;
  5521. cloned.isCloned = true;
  5522. return cloned
  5523. }
  5524. /*
  5525. * not type checking this file because flow doesn't play well with
  5526. * dynamically accessing methods on Array prototype
  5527. */
  5528. var arrayProto = Array.prototype;
  5529. var arrayMethods = Object.create(arrayProto);
  5530. var methodsToPatch = [
  5531. 'push',
  5532. 'pop',
  5533. 'shift',
  5534. 'unshift',
  5535. 'splice',
  5536. 'sort',
  5537. 'reverse'
  5538. ];
  5539. /**
  5540. * Intercept mutating methods and emit events
  5541. */
  5542. methodsToPatch.forEach(function (method) {
  5543. // cache original method
  5544. var original = arrayProto[method];
  5545. def(arrayMethods, method, function mutator () {
  5546. var args = [], len = arguments.length;
  5547. while ( len-- ) args[ len ] = arguments[ len ];
  5548. var result = original.apply(this, args);
  5549. var ob = this.__ob__;
  5550. var inserted;
  5551. switch (method) {
  5552. case 'push':
  5553. case 'unshift':
  5554. inserted = args;
  5555. break
  5556. case 'splice':
  5557. inserted = args.slice(2);
  5558. break
  5559. }
  5560. if (inserted) { ob.observeArray(inserted); }
  5561. // notify change
  5562. ob.dep.notify();
  5563. return result
  5564. });
  5565. });
  5566. /* */
  5567. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  5568. /**
  5569. * In some cases we may want to disable observation inside a component's
  5570. * update computation.
  5571. */
  5572. var shouldObserve = true;
  5573. function toggleObserving (value) {
  5574. shouldObserve = value;
  5575. }
  5576. /**
  5577. * Observer class that is attached to each observed
  5578. * object. Once attached, the observer converts the target
  5579. * object's property keys into getter/setters that
  5580. * collect dependencies and dispatch updates.
  5581. */
  5582. var Observer = function Observer (value) {
  5583. this.value = value;
  5584. this.dep = new Dep();
  5585. this.vmCount = 0;
  5586. def(value, '__ob__', this);
  5587. if (Array.isArray(value)) {
  5588. if (hasProto) {
  5589. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  5590. if(value.push !== value.__proto__.push){
  5591. copyAugment(value, arrayMethods, arrayKeys);
  5592. } else {
  5593. protoAugment(value, arrayMethods);
  5594. }
  5595. }
  5596. } else {
  5597. copyAugment(value, arrayMethods, arrayKeys);
  5598. }
  5599. this.observeArray(value);
  5600. } else {
  5601. this.walk(value);
  5602. }
  5603. };
  5604. /**
  5605. * Walk through all properties and convert them into
  5606. * getter/setters. This method should only be called when
  5607. * value type is Object.
  5608. */
  5609. Observer.prototype.walk = function walk (obj) {
  5610. var keys = Object.keys(obj);
  5611. for (var i = 0; i < keys.length; i++) {
  5612. defineReactive$$1(obj, keys[i]);
  5613. }
  5614. };
  5615. /**
  5616. * Observe a list of Array items.
  5617. */
  5618. Observer.prototype.observeArray = function observeArray (items) {
  5619. for (var i = 0, l = items.length; i < l; i++) {
  5620. observe(items[i]);
  5621. }
  5622. };
  5623. // helpers
  5624. /**
  5625. * Augment a target Object or Array by intercepting
  5626. * the prototype chain using __proto__
  5627. */
  5628. function protoAugment (target, src) {
  5629. /* eslint-disable no-proto */
  5630. target.__proto__ = src;
  5631. /* eslint-enable no-proto */
  5632. }
  5633. /**
  5634. * Augment a target Object or Array by defining
  5635. * hidden properties.
  5636. */
  5637. /* istanbul ignore next */
  5638. function copyAugment (target, src, keys) {
  5639. for (var i = 0, l = keys.length; i < l; i++) {
  5640. var key = keys[i];
  5641. def(target, key, src[key]);
  5642. }
  5643. }
  5644. /**
  5645. * Attempt to create an observer instance for a value,
  5646. * returns the new observer if successfully observed,
  5647. * or the existing observer if the value already has one.
  5648. */
  5649. function observe (value, asRootData) {
  5650. if (!isObject(value) || value instanceof VNode) {
  5651. return
  5652. }
  5653. var ob;
  5654. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  5655. ob = value.__ob__;
  5656. } else if (
  5657. shouldObserve &&
  5658. !isServerRendering() &&
  5659. (Array.isArray(value) || isPlainObject(value)) &&
  5660. Object.isExtensible(value) &&
  5661. !value._isVue
  5662. ) {
  5663. ob = new Observer(value);
  5664. }
  5665. if (asRootData && ob) {
  5666. ob.vmCount++;
  5667. }
  5668. return ob
  5669. }
  5670. /**
  5671. * Define a reactive property on an Object.
  5672. */
  5673. function defineReactive$$1 (
  5674. obj,
  5675. key,
  5676. val,
  5677. customSetter,
  5678. shallow
  5679. ) {
  5680. var dep = new Dep();
  5681. var property = Object.getOwnPropertyDescriptor(obj, key);
  5682. if (property && property.configurable === false) {
  5683. return
  5684. }
  5685. // cater for pre-defined getter/setters
  5686. var getter = property && property.get;
  5687. var setter = property && property.set;
  5688. if ((!getter || setter) && arguments.length === 2) {
  5689. val = obj[key];
  5690. }
  5691. var childOb = !shallow && observe(val);
  5692. Object.defineProperty(obj, key, {
  5693. enumerable: true,
  5694. configurable: true,
  5695. get: function reactiveGetter () {
  5696. var value = getter ? getter.call(obj) : val;
  5697. if (Dep.SharedObject.target) { // fixed by xxxxxx
  5698. dep.depend();
  5699. if (childOb) {
  5700. childOb.dep.depend();
  5701. if (Array.isArray(value)) {
  5702. dependArray(value);
  5703. }
  5704. }
  5705. }
  5706. return value
  5707. },
  5708. set: function reactiveSetter (newVal) {
  5709. var value = getter ? getter.call(obj) : val;
  5710. /* eslint-disable no-self-compare */
  5711. if (newVal === value || (newVal !== newVal && value !== value)) {
  5712. return
  5713. }
  5714. /* eslint-enable no-self-compare */
  5715. if ( true && customSetter) {
  5716. customSetter();
  5717. }
  5718. // #7981: for accessor properties without setter
  5719. if (getter && !setter) { return }
  5720. if (setter) {
  5721. setter.call(obj, newVal);
  5722. } else {
  5723. val = newVal;
  5724. }
  5725. childOb = !shallow && observe(newVal);
  5726. dep.notify();
  5727. }
  5728. });
  5729. }
  5730. /**
  5731. * Set a property on an object. Adds the new property and
  5732. * triggers change notification if the property doesn't
  5733. * already exist.
  5734. */
  5735. function set (target, key, val) {
  5736. if ( true &&
  5737. (isUndef(target) || isPrimitive(target))
  5738. ) {
  5739. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  5740. }
  5741. if (Array.isArray(target) && isValidArrayIndex(key)) {
  5742. target.length = Math.max(target.length, key);
  5743. target.splice(key, 1, val);
  5744. return val
  5745. }
  5746. if (key in target && !(key in Object.prototype)) {
  5747. target[key] = val;
  5748. return val
  5749. }
  5750. var ob = (target).__ob__;
  5751. if (target._isVue || (ob && ob.vmCount)) {
  5752. true && warn(
  5753. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  5754. 'at runtime - declare it upfront in the data option.'
  5755. );
  5756. return val
  5757. }
  5758. if (!ob) {
  5759. target[key] = val;
  5760. return val
  5761. }
  5762. defineReactive$$1(ob.value, key, val);
  5763. ob.dep.notify();
  5764. return val
  5765. }
  5766. /**
  5767. * Delete a property and trigger change if necessary.
  5768. */
  5769. function del (target, key) {
  5770. if ( true &&
  5771. (isUndef(target) || isPrimitive(target))
  5772. ) {
  5773. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  5774. }
  5775. if (Array.isArray(target) && isValidArrayIndex(key)) {
  5776. target.splice(key, 1);
  5777. return
  5778. }
  5779. var ob = (target).__ob__;
  5780. if (target._isVue || (ob && ob.vmCount)) {
  5781. true && warn(
  5782. 'Avoid deleting properties on a Vue instance or its root $data ' +
  5783. '- just set it to null.'
  5784. );
  5785. return
  5786. }
  5787. if (!hasOwn(target, key)) {
  5788. return
  5789. }
  5790. delete target[key];
  5791. if (!ob) {
  5792. return
  5793. }
  5794. ob.dep.notify();
  5795. }
  5796. /**
  5797. * Collect dependencies on array elements when the array is touched, since
  5798. * we cannot intercept array element access like property getters.
  5799. */
  5800. function dependArray (value) {
  5801. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  5802. e = value[i];
  5803. e && e.__ob__ && e.__ob__.dep.depend();
  5804. if (Array.isArray(e)) {
  5805. dependArray(e);
  5806. }
  5807. }
  5808. }
  5809. /* */
  5810. /**
  5811. * Option overwriting strategies are functions that handle
  5812. * how to merge a parent option value and a child option
  5813. * value into the final value.
  5814. */
  5815. var strats = config.optionMergeStrategies;
  5816. /**
  5817. * Options with restrictions
  5818. */
  5819. if (true) {
  5820. strats.el = strats.propsData = function (parent, child, vm, key) {
  5821. if (!vm) {
  5822. warn(
  5823. "option \"" + key + "\" can only be used during instance " +
  5824. 'creation with the `new` keyword.'
  5825. );
  5826. }
  5827. return defaultStrat(parent, child)
  5828. };
  5829. }
  5830. /**
  5831. * Helper that recursively merges two data objects together.
  5832. */
  5833. function mergeData (to, from) {
  5834. if (!from) { return to }
  5835. var key, toVal, fromVal;
  5836. var keys = hasSymbol
  5837. ? Reflect.ownKeys(from)
  5838. : Object.keys(from);
  5839. for (var i = 0; i < keys.length; i++) {
  5840. key = keys[i];
  5841. // in case the object is already observed...
  5842. if (key === '__ob__') { continue }
  5843. toVal = to[key];
  5844. fromVal = from[key];
  5845. if (!hasOwn(to, key)) {
  5846. set(to, key, fromVal);
  5847. } else if (
  5848. toVal !== fromVal &&
  5849. isPlainObject(toVal) &&
  5850. isPlainObject(fromVal)
  5851. ) {
  5852. mergeData(toVal, fromVal);
  5853. }
  5854. }
  5855. return to
  5856. }
  5857. /**
  5858. * Data
  5859. */
  5860. function mergeDataOrFn (
  5861. parentVal,
  5862. childVal,
  5863. vm
  5864. ) {
  5865. if (!vm) {
  5866. // in a Vue.extend merge, both should be functions
  5867. if (!childVal) {
  5868. return parentVal
  5869. }
  5870. if (!parentVal) {
  5871. return childVal
  5872. }
  5873. // when parentVal & childVal are both present,
  5874. // we need to return a function that returns the
  5875. // merged result of both functions... no need to
  5876. // check if parentVal is a function here because
  5877. // it has to be a function to pass previous merges.
  5878. return function mergedDataFn () {
  5879. return mergeData(
  5880. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  5881. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  5882. )
  5883. }
  5884. } else {
  5885. return function mergedInstanceDataFn () {
  5886. // instance merge
  5887. var instanceData = typeof childVal === 'function'
  5888. ? childVal.call(vm, vm)
  5889. : childVal;
  5890. var defaultData = typeof parentVal === 'function'
  5891. ? parentVal.call(vm, vm)
  5892. : parentVal;
  5893. if (instanceData) {
  5894. return mergeData(instanceData, defaultData)
  5895. } else {
  5896. return defaultData
  5897. }
  5898. }
  5899. }
  5900. }
  5901. strats.data = function (
  5902. parentVal,
  5903. childVal,
  5904. vm
  5905. ) {
  5906. if (!vm) {
  5907. if (childVal && typeof childVal !== 'function') {
  5908. true && warn(
  5909. 'The "data" option should be a function ' +
  5910. 'that returns a per-instance value in component ' +
  5911. 'definitions.',
  5912. vm
  5913. );
  5914. return parentVal
  5915. }
  5916. return mergeDataOrFn(parentVal, childVal)
  5917. }
  5918. return mergeDataOrFn(parentVal, childVal, vm)
  5919. };
  5920. /**
  5921. * Hooks and props are merged as arrays.
  5922. */
  5923. function mergeHook (
  5924. parentVal,
  5925. childVal
  5926. ) {
  5927. var res = childVal
  5928. ? parentVal
  5929. ? parentVal.concat(childVal)
  5930. : Array.isArray(childVal)
  5931. ? childVal
  5932. : [childVal]
  5933. : parentVal;
  5934. return res
  5935. ? dedupeHooks(res)
  5936. : res
  5937. }
  5938. function dedupeHooks (hooks) {
  5939. var res = [];
  5940. for (var i = 0; i < hooks.length; i++) {
  5941. if (res.indexOf(hooks[i]) === -1) {
  5942. res.push(hooks[i]);
  5943. }
  5944. }
  5945. return res
  5946. }
  5947. LIFECYCLE_HOOKS.forEach(function (hook) {
  5948. strats[hook] = mergeHook;
  5949. });
  5950. /**
  5951. * Assets
  5952. *
  5953. * When a vm is present (instance creation), we need to do
  5954. * a three-way merge between constructor options, instance
  5955. * options and parent options.
  5956. */
  5957. function mergeAssets (
  5958. parentVal,
  5959. childVal,
  5960. vm,
  5961. key
  5962. ) {
  5963. var res = Object.create(parentVal || null);
  5964. if (childVal) {
  5965. true && assertObjectType(key, childVal, vm);
  5966. return extend(res, childVal)
  5967. } else {
  5968. return res
  5969. }
  5970. }
  5971. ASSET_TYPES.forEach(function (type) {
  5972. strats[type + 's'] = mergeAssets;
  5973. });
  5974. /**
  5975. * Watchers.
  5976. *
  5977. * Watchers hashes should not overwrite one
  5978. * another, so we merge them as arrays.
  5979. */
  5980. strats.watch = function (
  5981. parentVal,
  5982. childVal,
  5983. vm,
  5984. key
  5985. ) {
  5986. // work around Firefox's Object.prototype.watch...
  5987. if (parentVal === nativeWatch) { parentVal = undefined; }
  5988. if (childVal === nativeWatch) { childVal = undefined; }
  5989. /* istanbul ignore if */
  5990. if (!childVal) { return Object.create(parentVal || null) }
  5991. if (true) {
  5992. assertObjectType(key, childVal, vm);
  5993. }
  5994. if (!parentVal) { return childVal }
  5995. var ret = {};
  5996. extend(ret, parentVal);
  5997. for (var key$1 in childVal) {
  5998. var parent = ret[key$1];
  5999. var child = childVal[key$1];
  6000. if (parent && !Array.isArray(parent)) {
  6001. parent = [parent];
  6002. }
  6003. ret[key$1] = parent
  6004. ? parent.concat(child)
  6005. : Array.isArray(child) ? child : [child];
  6006. }
  6007. return ret
  6008. };
  6009. /**
  6010. * Other object hashes.
  6011. */
  6012. strats.props =
  6013. strats.methods =
  6014. strats.inject =
  6015. strats.computed = function (
  6016. parentVal,
  6017. childVal,
  6018. vm,
  6019. key
  6020. ) {
  6021. if (childVal && "development" !== 'production') {
  6022. assertObjectType(key, childVal, vm);
  6023. }
  6024. if (!parentVal) { return childVal }
  6025. var ret = Object.create(null);
  6026. extend(ret, parentVal);
  6027. if (childVal) { extend(ret, childVal); }
  6028. return ret
  6029. };
  6030. strats.provide = mergeDataOrFn;
  6031. /**
  6032. * Default strategy.
  6033. */
  6034. var defaultStrat = function (parentVal, childVal) {
  6035. return childVal === undefined
  6036. ? parentVal
  6037. : childVal
  6038. };
  6039. /**
  6040. * Validate component names
  6041. */
  6042. function checkComponents (options) {
  6043. for (var key in options.components) {
  6044. validateComponentName(key);
  6045. }
  6046. }
  6047. function validateComponentName (name) {
  6048. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  6049. warn(
  6050. 'Invalid component name: "' + name + '". Component names ' +
  6051. 'should conform to valid custom element name in html5 specification.'
  6052. );
  6053. }
  6054. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  6055. warn(
  6056. 'Do not use built-in or reserved HTML elements as component ' +
  6057. 'id: ' + name
  6058. );
  6059. }
  6060. }
  6061. /**
  6062. * Ensure all props option syntax are normalized into the
  6063. * Object-based format.
  6064. */
  6065. function normalizeProps (options, vm) {
  6066. var props = options.props;
  6067. if (!props) { return }
  6068. var res = {};
  6069. var i, val, name;
  6070. if (Array.isArray(props)) {
  6071. i = props.length;
  6072. while (i--) {
  6073. val = props[i];
  6074. if (typeof val === 'string') {
  6075. name = camelize(val);
  6076. res[name] = { type: null };
  6077. } else if (true) {
  6078. warn('props must be strings when using array syntax.');
  6079. }
  6080. }
  6081. } else if (isPlainObject(props)) {
  6082. for (var key in props) {
  6083. val = props[key];
  6084. name = camelize(key);
  6085. res[name] = isPlainObject(val)
  6086. ? val
  6087. : { type: val };
  6088. }
  6089. } else if (true) {
  6090. warn(
  6091. "Invalid value for option \"props\": expected an Array or an Object, " +
  6092. "but got " + (toRawType(props)) + ".",
  6093. vm
  6094. );
  6095. }
  6096. options.props = res;
  6097. }
  6098. /**
  6099. * Normalize all injections into Object-based format
  6100. */
  6101. function normalizeInject (options, vm) {
  6102. var inject = options.inject;
  6103. if (!inject) { return }
  6104. var normalized = options.inject = {};
  6105. if (Array.isArray(inject)) {
  6106. for (var i = 0; i < inject.length; i++) {
  6107. normalized[inject[i]] = { from: inject[i] };
  6108. }
  6109. } else if (isPlainObject(inject)) {
  6110. for (var key in inject) {
  6111. var val = inject[key];
  6112. normalized[key] = isPlainObject(val)
  6113. ? extend({ from: key }, val)
  6114. : { from: val };
  6115. }
  6116. } else if (true) {
  6117. warn(
  6118. "Invalid value for option \"inject\": expected an Array or an Object, " +
  6119. "but got " + (toRawType(inject)) + ".",
  6120. vm
  6121. );
  6122. }
  6123. }
  6124. /**
  6125. * Normalize raw function directives into object format.
  6126. */
  6127. function normalizeDirectives (options) {
  6128. var dirs = options.directives;
  6129. if (dirs) {
  6130. for (var key in dirs) {
  6131. var def$$1 = dirs[key];
  6132. if (typeof def$$1 === 'function') {
  6133. dirs[key] = { bind: def$$1, update: def$$1 };
  6134. }
  6135. }
  6136. }
  6137. }
  6138. function assertObjectType (name, value, vm) {
  6139. if (!isPlainObject(value)) {
  6140. warn(
  6141. "Invalid value for option \"" + name + "\": expected an Object, " +
  6142. "but got " + (toRawType(value)) + ".",
  6143. vm
  6144. );
  6145. }
  6146. }
  6147. /**
  6148. * Merge two option objects into a new one.
  6149. * Core utility used in both instantiation and inheritance.
  6150. */
  6151. function mergeOptions (
  6152. parent,
  6153. child,
  6154. vm
  6155. ) {
  6156. if (true) {
  6157. checkComponents(child);
  6158. }
  6159. if (typeof child === 'function') {
  6160. child = child.options;
  6161. }
  6162. normalizeProps(child, vm);
  6163. normalizeInject(child, vm);
  6164. normalizeDirectives(child);
  6165. // Apply extends and mixins on the child options,
  6166. // but only if it is a raw options object that isn't
  6167. // the result of another mergeOptions call.
  6168. // Only merged options has the _base property.
  6169. if (!child._base) {
  6170. if (child.extends) {
  6171. parent = mergeOptions(parent, child.extends, vm);
  6172. }
  6173. if (child.mixins) {
  6174. for (var i = 0, l = child.mixins.length; i < l; i++) {
  6175. parent = mergeOptions(parent, child.mixins[i], vm);
  6176. }
  6177. }
  6178. }
  6179. var options = {};
  6180. var key;
  6181. for (key in parent) {
  6182. mergeField(key);
  6183. }
  6184. for (key in child) {
  6185. if (!hasOwn(parent, key)) {
  6186. mergeField(key);
  6187. }
  6188. }
  6189. function mergeField (key) {
  6190. var strat = strats[key] || defaultStrat;
  6191. options[key] = strat(parent[key], child[key], vm, key);
  6192. }
  6193. return options
  6194. }
  6195. /**
  6196. * Resolve an asset.
  6197. * This function is used because child instances need access
  6198. * to assets defined in its ancestor chain.
  6199. */
  6200. function resolveAsset (
  6201. options,
  6202. type,
  6203. id,
  6204. warnMissing
  6205. ) {
  6206. /* istanbul ignore if */
  6207. if (typeof id !== 'string') {
  6208. return
  6209. }
  6210. var assets = options[type];
  6211. // check local registration variations first
  6212. if (hasOwn(assets, id)) { return assets[id] }
  6213. var camelizedId = camelize(id);
  6214. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  6215. var PascalCaseId = capitalize(camelizedId);
  6216. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  6217. // fallback to prototype chain
  6218. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  6219. if ( true && warnMissing && !res) {
  6220. warn(
  6221. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  6222. options
  6223. );
  6224. }
  6225. return res
  6226. }
  6227. /* */
  6228. function validateProp (
  6229. key,
  6230. propOptions,
  6231. propsData,
  6232. vm
  6233. ) {
  6234. var prop = propOptions[key];
  6235. var absent = !hasOwn(propsData, key);
  6236. var value = propsData[key];
  6237. // boolean casting
  6238. var booleanIndex = getTypeIndex(Boolean, prop.type);
  6239. if (booleanIndex > -1) {
  6240. if (absent && !hasOwn(prop, 'default')) {
  6241. value = false;
  6242. } else if (value === '' || value === hyphenate(key)) {
  6243. // only cast empty string / same name to boolean if
  6244. // boolean has higher priority
  6245. var stringIndex = getTypeIndex(String, prop.type);
  6246. if (stringIndex < 0 || booleanIndex < stringIndex) {
  6247. value = true;
  6248. }
  6249. }
  6250. }
  6251. // check default value
  6252. if (value === undefined) {
  6253. value = getPropDefaultValue(vm, prop, key);
  6254. // since the default value is a fresh copy,
  6255. // make sure to observe it.
  6256. var prevShouldObserve = shouldObserve;
  6257. toggleObserving(true);
  6258. observe(value);
  6259. toggleObserving(prevShouldObserve);
  6260. }
  6261. if (
  6262. true
  6263. ) {
  6264. assertProp(prop, key, value, vm, absent);
  6265. }
  6266. return value
  6267. }
  6268. /**
  6269. * Get the default value of a prop.
  6270. */
  6271. function getPropDefaultValue (vm, prop, key) {
  6272. // no default, return undefined
  6273. if (!hasOwn(prop, 'default')) {
  6274. return undefined
  6275. }
  6276. var def = prop.default;
  6277. // warn against non-factory defaults for Object & Array
  6278. if ( true && isObject(def)) {
  6279. warn(
  6280. 'Invalid default value for prop "' + key + '": ' +
  6281. 'Props with type Object/Array must use a factory function ' +
  6282. 'to return the default value.',
  6283. vm
  6284. );
  6285. }
  6286. // the raw prop value was also undefined from previous render,
  6287. // return previous default value to avoid unnecessary watcher trigger
  6288. if (vm && vm.$options.propsData &&
  6289. vm.$options.propsData[key] === undefined &&
  6290. vm._props[key] !== undefined
  6291. ) {
  6292. return vm._props[key]
  6293. }
  6294. // call factory function for non-Function types
  6295. // a value is Function if its prototype is function even across different execution context
  6296. return typeof def === 'function' && getType(prop.type) !== 'Function'
  6297. ? def.call(vm)
  6298. : def
  6299. }
  6300. /**
  6301. * Assert whether a prop is valid.
  6302. */
  6303. function assertProp (
  6304. prop,
  6305. name,
  6306. value,
  6307. vm,
  6308. absent
  6309. ) {
  6310. if (prop.required && absent) {
  6311. warn(
  6312. 'Missing required prop: "' + name + '"',
  6313. vm
  6314. );
  6315. return
  6316. }
  6317. if (value == null && !prop.required) {
  6318. return
  6319. }
  6320. var type = prop.type;
  6321. var valid = !type || type === true;
  6322. var expectedTypes = [];
  6323. if (type) {
  6324. if (!Array.isArray(type)) {
  6325. type = [type];
  6326. }
  6327. for (var i = 0; i < type.length && !valid; i++) {
  6328. var assertedType = assertType(value, type[i]);
  6329. expectedTypes.push(assertedType.expectedType || '');
  6330. valid = assertedType.valid;
  6331. }
  6332. }
  6333. if (!valid) {
  6334. warn(
  6335. getInvalidTypeMessage(name, value, expectedTypes),
  6336. vm
  6337. );
  6338. return
  6339. }
  6340. var validator = prop.validator;
  6341. if (validator) {
  6342. if (!validator(value)) {
  6343. warn(
  6344. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  6345. vm
  6346. );
  6347. }
  6348. }
  6349. }
  6350. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  6351. function assertType (value, type) {
  6352. var valid;
  6353. var expectedType = getType(type);
  6354. if (simpleCheckRE.test(expectedType)) {
  6355. var t = typeof value;
  6356. valid = t === expectedType.toLowerCase();
  6357. // for primitive wrapper objects
  6358. if (!valid && t === 'object') {
  6359. valid = value instanceof type;
  6360. }
  6361. } else if (expectedType === 'Object') {
  6362. valid = isPlainObject(value);
  6363. } else if (expectedType === 'Array') {
  6364. valid = Array.isArray(value);
  6365. } else {
  6366. valid = value instanceof type;
  6367. }
  6368. return {
  6369. valid: valid,
  6370. expectedType: expectedType
  6371. }
  6372. }
  6373. /**
  6374. * Use function string name to check built-in types,
  6375. * because a simple equality check will fail when running
  6376. * across different vms / iframes.
  6377. */
  6378. function getType (fn) {
  6379. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  6380. return match ? match[1] : ''
  6381. }
  6382. function isSameType (a, b) {
  6383. return getType(a) === getType(b)
  6384. }
  6385. function getTypeIndex (type, expectedTypes) {
  6386. if (!Array.isArray(expectedTypes)) {
  6387. return isSameType(expectedTypes, type) ? 0 : -1
  6388. }
  6389. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  6390. if (isSameType(expectedTypes[i], type)) {
  6391. return i
  6392. }
  6393. }
  6394. return -1
  6395. }
  6396. function getInvalidTypeMessage (name, value, expectedTypes) {
  6397. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  6398. " Expected " + (expectedTypes.map(capitalize).join(', '));
  6399. var expectedType = expectedTypes[0];
  6400. var receivedType = toRawType(value);
  6401. var expectedValue = styleValue(value, expectedType);
  6402. var receivedValue = styleValue(value, receivedType);
  6403. // check if we need to specify expected value
  6404. if (expectedTypes.length === 1 &&
  6405. isExplicable(expectedType) &&
  6406. !isBoolean(expectedType, receivedType)) {
  6407. message += " with value " + expectedValue;
  6408. }
  6409. message += ", got " + receivedType + " ";
  6410. // check if we need to specify received value
  6411. if (isExplicable(receivedType)) {
  6412. message += "with value " + receivedValue + ".";
  6413. }
  6414. return message
  6415. }
  6416. function styleValue (value, type) {
  6417. if (type === 'String') {
  6418. return ("\"" + value + "\"")
  6419. } else if (type === 'Number') {
  6420. return ("" + (Number(value)))
  6421. } else {
  6422. return ("" + value)
  6423. }
  6424. }
  6425. function isExplicable (value) {
  6426. var explicitTypes = ['string', 'number', 'boolean'];
  6427. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  6428. }
  6429. function isBoolean () {
  6430. var args = [], len = arguments.length;
  6431. while ( len-- ) args[ len ] = arguments[ len ];
  6432. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  6433. }
  6434. /* */
  6435. function handleError (err, vm, info) {
  6436. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  6437. // See: https://github.com/vuejs/vuex/issues/1505
  6438. pushTarget();
  6439. try {
  6440. if (vm) {
  6441. var cur = vm;
  6442. while ((cur = cur.$parent)) {
  6443. var hooks = cur.$options.errorCaptured;
  6444. if (hooks) {
  6445. for (var i = 0; i < hooks.length; i++) {
  6446. try {
  6447. var capture = hooks[i].call(cur, err, vm, info) === false;
  6448. if (capture) { return }
  6449. } catch (e) {
  6450. globalHandleError(e, cur, 'errorCaptured hook');
  6451. }
  6452. }
  6453. }
  6454. }
  6455. }
  6456. globalHandleError(err, vm, info);
  6457. } finally {
  6458. popTarget();
  6459. }
  6460. }
  6461. function invokeWithErrorHandling (
  6462. handler,
  6463. context,
  6464. args,
  6465. vm,
  6466. info
  6467. ) {
  6468. var res;
  6469. try {
  6470. res = args ? handler.apply(context, args) : handler.call(context);
  6471. if (res && !res._isVue && isPromise(res) && !res._handled) {
  6472. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  6473. // issue #9511
  6474. // avoid catch triggering multiple times when nested calls
  6475. res._handled = true;
  6476. }
  6477. } catch (e) {
  6478. handleError(e, vm, info);
  6479. }
  6480. return res
  6481. }
  6482. function globalHandleError (err, vm, info) {
  6483. if (config.errorHandler) {
  6484. try {
  6485. return config.errorHandler.call(null, err, vm, info)
  6486. } catch (e) {
  6487. // if the user intentionally throws the original error in the handler,
  6488. // do not log it twice
  6489. if (e !== err) {
  6490. logError(e, null, 'config.errorHandler');
  6491. }
  6492. }
  6493. }
  6494. logError(err, vm, info);
  6495. }
  6496. function logError (err, vm, info) {
  6497. if (true) {
  6498. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  6499. }
  6500. /* istanbul ignore else */
  6501. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  6502. console.error(err);
  6503. } else {
  6504. throw err
  6505. }
  6506. }
  6507. /* */
  6508. var callbacks = [];
  6509. var pending = false;
  6510. function flushCallbacks () {
  6511. pending = false;
  6512. var copies = callbacks.slice(0);
  6513. callbacks.length = 0;
  6514. for (var i = 0; i < copies.length; i++) {
  6515. copies[i]();
  6516. }
  6517. }
  6518. // Here we have async deferring wrappers using microtasks.
  6519. // In 2.5 we used (macro) tasks (in combination with microtasks).
  6520. // However, it has subtle problems when state is changed right before repaint
  6521. // (e.g. #6813, out-in transitions).
  6522. // Also, using (macro) tasks in event handler would cause some weird behaviors
  6523. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  6524. // So we now use microtasks everywhere, again.
  6525. // A major drawback of this tradeoff is that there are some scenarios
  6526. // where microtasks have too high a priority and fire in between supposedly
  6527. // sequential events (e.g. #4521, #6690, which have workarounds)
  6528. // or even between bubbling of the same event (#6566).
  6529. var timerFunc;
  6530. // The nextTick behavior leverages the microtask queue, which can be accessed
  6531. // via either native Promise.then or MutationObserver.
  6532. // MutationObserver has wider support, however it is seriously bugged in
  6533. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  6534. // completely stops working after triggering a few times... so, if native
  6535. // Promise is available, we will use it:
  6536. /* istanbul ignore next, $flow-disable-line */
  6537. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  6538. var p = Promise.resolve();
  6539. timerFunc = function () {
  6540. p.then(flushCallbacks);
  6541. // In problematic UIWebViews, Promise.then doesn't completely break, but
  6542. // it can get stuck in a weird state where callbacks are pushed into the
  6543. // microtask queue but the queue isn't being flushed, until the browser
  6544. // needs to do some other work, e.g. handle a timer. Therefore we can
  6545. // "force" the microtask queue to be flushed by adding an empty timer.
  6546. if (isIOS) { setTimeout(noop); }
  6547. };
  6548. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  6549. isNative(MutationObserver) ||
  6550. // PhantomJS and iOS 7.x
  6551. MutationObserver.toString() === '[object MutationObserverConstructor]'
  6552. )) {
  6553. // Use MutationObserver where native Promise is not available,
  6554. // e.g. PhantomJS, iOS7, Android 4.4
  6555. // (#6466 MutationObserver is unreliable in IE11)
  6556. var counter = 1;
  6557. var observer = new MutationObserver(flushCallbacks);
  6558. var textNode = document.createTextNode(String(counter));
  6559. observer.observe(textNode, {
  6560. characterData: true
  6561. });
  6562. timerFunc = function () {
  6563. counter = (counter + 1) % 2;
  6564. textNode.data = String(counter);
  6565. };
  6566. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  6567. // Fallback to setImmediate.
  6568. // Technically it leverages the (macro) task queue,
  6569. // but it is still a better choice than setTimeout.
  6570. timerFunc = function () {
  6571. setImmediate(flushCallbacks);
  6572. };
  6573. } else {
  6574. // Fallback to setTimeout.
  6575. timerFunc = function () {
  6576. setTimeout(flushCallbacks, 0);
  6577. };
  6578. }
  6579. function nextTick (cb, ctx) {
  6580. var _resolve;
  6581. callbacks.push(function () {
  6582. if (cb) {
  6583. try {
  6584. cb.call(ctx);
  6585. } catch (e) {
  6586. handleError(e, ctx, 'nextTick');
  6587. }
  6588. } else if (_resolve) {
  6589. _resolve(ctx);
  6590. }
  6591. });
  6592. if (!pending) {
  6593. pending = true;
  6594. timerFunc();
  6595. }
  6596. // $flow-disable-line
  6597. if (!cb && typeof Promise !== 'undefined') {
  6598. return new Promise(function (resolve) {
  6599. _resolve = resolve;
  6600. })
  6601. }
  6602. }
  6603. /* */
  6604. /* not type checking this file because flow doesn't play well with Proxy */
  6605. var initProxy;
  6606. if (true) {
  6607. var allowedGlobals = makeMap(
  6608. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  6609. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  6610. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  6611. 'require' // for Webpack/Browserify
  6612. );
  6613. var warnNonPresent = function (target, key) {
  6614. warn(
  6615. "Property or method \"" + key + "\" is not defined on the instance but " +
  6616. 'referenced during render. Make sure that this property is reactive, ' +
  6617. 'either in the data option, or for class-based components, by ' +
  6618. 'initializing the property. ' +
  6619. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  6620. target
  6621. );
  6622. };
  6623. var warnReservedPrefix = function (target, key) {
  6624. warn(
  6625. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  6626. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  6627. 'prevent conflicts with Vue internals. ' +
  6628. 'See: https://vuejs.org/v2/api/#data',
  6629. target
  6630. );
  6631. };
  6632. var hasProxy =
  6633. typeof Proxy !== 'undefined' && isNative(Proxy);
  6634. if (hasProxy) {
  6635. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  6636. config.keyCodes = new Proxy(config.keyCodes, {
  6637. set: function set (target, key, value) {
  6638. if (isBuiltInModifier(key)) {
  6639. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  6640. return false
  6641. } else {
  6642. target[key] = value;
  6643. return true
  6644. }
  6645. }
  6646. });
  6647. }
  6648. var hasHandler = {
  6649. has: function has (target, key) {
  6650. var has = key in target;
  6651. var isAllowed = allowedGlobals(key) ||
  6652. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  6653. if (!has && !isAllowed) {
  6654. if (key in target.$data) { warnReservedPrefix(target, key); }
  6655. else { warnNonPresent(target, key); }
  6656. }
  6657. return has || !isAllowed
  6658. }
  6659. };
  6660. var getHandler = {
  6661. get: function get (target, key) {
  6662. if (typeof key === 'string' && !(key in target)) {
  6663. if (key in target.$data) { warnReservedPrefix(target, key); }
  6664. else { warnNonPresent(target, key); }
  6665. }
  6666. return target[key]
  6667. }
  6668. };
  6669. initProxy = function initProxy (vm) {
  6670. if (hasProxy) {
  6671. // determine which proxy handler to use
  6672. var options = vm.$options;
  6673. var handlers = options.render && options.render._withStripped
  6674. ? getHandler
  6675. : hasHandler;
  6676. vm._renderProxy = new Proxy(vm, handlers);
  6677. } else {
  6678. vm._renderProxy = vm;
  6679. }
  6680. };
  6681. }
  6682. /* */
  6683. var seenObjects = new _Set();
  6684. /**
  6685. * Recursively traverse an object to evoke all converted
  6686. * getters, so that every nested property inside the object
  6687. * is collected as a "deep" dependency.
  6688. */
  6689. function traverse (val) {
  6690. _traverse(val, seenObjects);
  6691. seenObjects.clear();
  6692. }
  6693. function _traverse (val, seen) {
  6694. var i, keys;
  6695. var isA = Array.isArray(val);
  6696. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  6697. return
  6698. }
  6699. if (val.__ob__) {
  6700. var depId = val.__ob__.dep.id;
  6701. if (seen.has(depId)) {
  6702. return
  6703. }
  6704. seen.add(depId);
  6705. }
  6706. if (isA) {
  6707. i = val.length;
  6708. while (i--) { _traverse(val[i], seen); }
  6709. } else {
  6710. keys = Object.keys(val);
  6711. i = keys.length;
  6712. while (i--) { _traverse(val[keys[i]], seen); }
  6713. }
  6714. }
  6715. var mark;
  6716. var measure;
  6717. if (true) {
  6718. var perf = inBrowser && window.performance;
  6719. /* istanbul ignore if */
  6720. if (
  6721. perf &&
  6722. perf.mark &&
  6723. perf.measure &&
  6724. perf.clearMarks &&
  6725. perf.clearMeasures
  6726. ) {
  6727. mark = function (tag) { return perf.mark(tag); };
  6728. measure = function (name, startTag, endTag) {
  6729. perf.measure(name, startTag, endTag);
  6730. perf.clearMarks(startTag);
  6731. perf.clearMarks(endTag);
  6732. // perf.clearMeasures(name)
  6733. };
  6734. }
  6735. }
  6736. /* */
  6737. var normalizeEvent = cached(function (name) {
  6738. var passive = name.charAt(0) === '&';
  6739. name = passive ? name.slice(1) : name;
  6740. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  6741. name = once$$1 ? name.slice(1) : name;
  6742. var capture = name.charAt(0) === '!';
  6743. name = capture ? name.slice(1) : name;
  6744. return {
  6745. name: name,
  6746. once: once$$1,
  6747. capture: capture,
  6748. passive: passive
  6749. }
  6750. });
  6751. function createFnInvoker (fns, vm) {
  6752. function invoker () {
  6753. var arguments$1 = arguments;
  6754. var fns = invoker.fns;
  6755. if (Array.isArray(fns)) {
  6756. var cloned = fns.slice();
  6757. for (var i = 0; i < cloned.length; i++) {
  6758. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  6759. }
  6760. } else {
  6761. // return handler return value for single handlers
  6762. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  6763. }
  6764. }
  6765. invoker.fns = fns;
  6766. return invoker
  6767. }
  6768. function updateListeners (
  6769. on,
  6770. oldOn,
  6771. add,
  6772. remove$$1,
  6773. createOnceHandler,
  6774. vm
  6775. ) {
  6776. var name, def$$1, cur, old, event;
  6777. for (name in on) {
  6778. def$$1 = cur = on[name];
  6779. old = oldOn[name];
  6780. event = normalizeEvent(name);
  6781. if (isUndef(cur)) {
  6782. true && warn(
  6783. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  6784. vm
  6785. );
  6786. } else if (isUndef(old)) {
  6787. if (isUndef(cur.fns)) {
  6788. cur = on[name] = createFnInvoker(cur, vm);
  6789. }
  6790. if (isTrue(event.once)) {
  6791. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  6792. }
  6793. add(event.name, cur, event.capture, event.passive, event.params);
  6794. } else if (cur !== old) {
  6795. old.fns = cur;
  6796. on[name] = old;
  6797. }
  6798. }
  6799. for (name in oldOn) {
  6800. if (isUndef(on[name])) {
  6801. event = normalizeEvent(name);
  6802. remove$$1(event.name, oldOn[name], event.capture);
  6803. }
  6804. }
  6805. }
  6806. /* */
  6807. /* */
  6808. // fixed by xxxxxx (mp properties)
  6809. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  6810. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  6811. if (isUndef(propOptions)) {
  6812. return res
  6813. }
  6814. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  6815. var attrs = data.attrs;
  6816. var props = data.props;
  6817. if (isDef(attrs) || isDef(props)) {
  6818. for (var key in propOptions) {
  6819. var altKey = hyphenate(key);
  6820. var result = checkProp(res, props, key, altKey, true) ||
  6821. checkProp(res, attrs, key, altKey, false);
  6822. // externalClass
  6823. if (
  6824. result &&
  6825. res[key] &&
  6826. externalClasses.indexOf(altKey) !== -1 &&
  6827. context[camelize(res[key])]
  6828. ) {
  6829. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  6830. res[key] = context[camelize(res[key])];
  6831. }
  6832. }
  6833. }
  6834. return res
  6835. }
  6836. function extractPropsFromVNodeData (
  6837. data,
  6838. Ctor,
  6839. tag,
  6840. context// fixed by xxxxxx
  6841. ) {
  6842. // we are only extracting raw values here.
  6843. // validation and default values are handled in the child
  6844. // component itself.
  6845. var propOptions = Ctor.options.props;
  6846. if (isUndef(propOptions)) {
  6847. // fixed by xxxxxx
  6848. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  6849. }
  6850. var res = {};
  6851. var attrs = data.attrs;
  6852. var props = data.props;
  6853. if (isDef(attrs) || isDef(props)) {
  6854. for (var key in propOptions) {
  6855. var altKey = hyphenate(key);
  6856. if (true) {
  6857. var keyInLowerCase = key.toLowerCase();
  6858. if (
  6859. key !== keyInLowerCase &&
  6860. attrs && hasOwn(attrs, keyInLowerCase)
  6861. ) {
  6862. tip(
  6863. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  6864. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  6865. " \"" + key + "\". " +
  6866. "Note that HTML attributes are case-insensitive and camelCased " +
  6867. "props need to use their kebab-case equivalents when using in-DOM " +
  6868. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  6869. );
  6870. }
  6871. }
  6872. checkProp(res, props, key, altKey, true) ||
  6873. checkProp(res, attrs, key, altKey, false);
  6874. }
  6875. }
  6876. // fixed by xxxxxx
  6877. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  6878. }
  6879. function checkProp (
  6880. res,
  6881. hash,
  6882. key,
  6883. altKey,
  6884. preserve
  6885. ) {
  6886. if (isDef(hash)) {
  6887. if (hasOwn(hash, key)) {
  6888. res[key] = hash[key];
  6889. if (!preserve) {
  6890. delete hash[key];
  6891. }
  6892. return true
  6893. } else if (hasOwn(hash, altKey)) {
  6894. res[key] = hash[altKey];
  6895. if (!preserve) {
  6896. delete hash[altKey];
  6897. }
  6898. return true
  6899. }
  6900. }
  6901. return false
  6902. }
  6903. /* */
  6904. // The template compiler attempts to minimize the need for normalization by
  6905. // statically analyzing the template at compile time.
  6906. //
  6907. // For plain HTML markup, normalization can be completely skipped because the
  6908. // generated render function is guaranteed to return Array<VNode>. There are
  6909. // two cases where extra normalization is needed:
  6910. // 1. When the children contains components - because a functional component
  6911. // may return an Array instead of a single root. In this case, just a simple
  6912. // normalization is needed - if any child is an Array, we flatten the whole
  6913. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  6914. // because functional components already normalize their own children.
  6915. function simpleNormalizeChildren (children) {
  6916. for (var i = 0; i < children.length; i++) {
  6917. if (Array.isArray(children[i])) {
  6918. return Array.prototype.concat.apply([], children)
  6919. }
  6920. }
  6921. return children
  6922. }
  6923. // 2. When the children contains constructs that always generated nested Arrays,
  6924. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  6925. // with hand-written render functions / JSX. In such cases a full normalization
  6926. // is needed to cater to all possible types of children values.
  6927. function normalizeChildren (children) {
  6928. return isPrimitive(children)
  6929. ? [createTextVNode(children)]
  6930. : Array.isArray(children)
  6931. ? normalizeArrayChildren(children)
  6932. : undefined
  6933. }
  6934. function isTextNode (node) {
  6935. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  6936. }
  6937. function normalizeArrayChildren (children, nestedIndex) {
  6938. var res = [];
  6939. var i, c, lastIndex, last;
  6940. for (i = 0; i < children.length; i++) {
  6941. c = children[i];
  6942. if (isUndef(c) || typeof c === 'boolean') { continue }
  6943. lastIndex = res.length - 1;
  6944. last = res[lastIndex];
  6945. // nested
  6946. if (Array.isArray(c)) {
  6947. if (c.length > 0) {
  6948. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  6949. // merge adjacent text nodes
  6950. if (isTextNode(c[0]) && isTextNode(last)) {
  6951. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  6952. c.shift();
  6953. }
  6954. res.push.apply(res, c);
  6955. }
  6956. } else if (isPrimitive(c)) {
  6957. if (isTextNode(last)) {
  6958. // merge adjacent text nodes
  6959. // this is necessary for SSR hydration because text nodes are
  6960. // essentially merged when rendered to HTML strings
  6961. res[lastIndex] = createTextVNode(last.text + c);
  6962. } else if (c !== '') {
  6963. // convert primitive to vnode
  6964. res.push(createTextVNode(c));
  6965. }
  6966. } else {
  6967. if (isTextNode(c) && isTextNode(last)) {
  6968. // merge adjacent text nodes
  6969. res[lastIndex] = createTextVNode(last.text + c.text);
  6970. } else {
  6971. // default key for nested array children (likely generated by v-for)
  6972. if (isTrue(children._isVList) &&
  6973. isDef(c.tag) &&
  6974. isUndef(c.key) &&
  6975. isDef(nestedIndex)) {
  6976. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  6977. }
  6978. res.push(c);
  6979. }
  6980. }
  6981. }
  6982. return res
  6983. }
  6984. /* */
  6985. function initProvide (vm) {
  6986. var provide = vm.$options.provide;
  6987. if (provide) {
  6988. vm._provided = typeof provide === 'function'
  6989. ? provide.call(vm)
  6990. : provide;
  6991. }
  6992. }
  6993. function initInjections (vm) {
  6994. var result = resolveInject(vm.$options.inject, vm);
  6995. if (result) {
  6996. toggleObserving(false);
  6997. Object.keys(result).forEach(function (key) {
  6998. /* istanbul ignore else */
  6999. if (true) {
  7000. defineReactive$$1(vm, key, result[key], function () {
  7001. warn(
  7002. "Avoid mutating an injected value directly since the changes will be " +
  7003. "overwritten whenever the provided component re-renders. " +
  7004. "injection being mutated: \"" + key + "\"",
  7005. vm
  7006. );
  7007. });
  7008. } else {}
  7009. });
  7010. toggleObserving(true);
  7011. }
  7012. }
  7013. function resolveInject (inject, vm) {
  7014. if (inject) {
  7015. // inject is :any because flow is not smart enough to figure out cached
  7016. var result = Object.create(null);
  7017. var keys = hasSymbol
  7018. ? Reflect.ownKeys(inject)
  7019. : Object.keys(inject);
  7020. for (var i = 0; i < keys.length; i++) {
  7021. var key = keys[i];
  7022. // #6574 in case the inject object is observed...
  7023. if (key === '__ob__') { continue }
  7024. var provideKey = inject[key].from;
  7025. var source = vm;
  7026. while (source) {
  7027. if (source._provided && hasOwn(source._provided, provideKey)) {
  7028. result[key] = source._provided[provideKey];
  7029. break
  7030. }
  7031. source = source.$parent;
  7032. }
  7033. if (!source) {
  7034. if ('default' in inject[key]) {
  7035. var provideDefault = inject[key].default;
  7036. result[key] = typeof provideDefault === 'function'
  7037. ? provideDefault.call(vm)
  7038. : provideDefault;
  7039. } else if (true) {
  7040. warn(("Injection \"" + key + "\" not found"), vm);
  7041. }
  7042. }
  7043. }
  7044. return result
  7045. }
  7046. }
  7047. /* */
  7048. /**
  7049. * Runtime helper for resolving raw children VNodes into a slot object.
  7050. */
  7051. function resolveSlots (
  7052. children,
  7053. context
  7054. ) {
  7055. if (!children || !children.length) {
  7056. return {}
  7057. }
  7058. var slots = {};
  7059. for (var i = 0, l = children.length; i < l; i++) {
  7060. var child = children[i];
  7061. var data = child.data;
  7062. // remove slot attribute if the node is resolved as a Vue slot node
  7063. if (data && data.attrs && data.attrs.slot) {
  7064. delete data.attrs.slot;
  7065. }
  7066. // named slots should only be respected if the vnode was rendered in the
  7067. // same context.
  7068. if ((child.context === context || child.fnContext === context) &&
  7069. data && data.slot != null
  7070. ) {
  7071. var name = data.slot;
  7072. var slot = (slots[name] || (slots[name] = []));
  7073. if (child.tag === 'template') {
  7074. slot.push.apply(slot, child.children || []);
  7075. } else {
  7076. slot.push(child);
  7077. }
  7078. } else {
  7079. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  7080. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  7081. (slots['page'] || (slots['page'] = [])).push(child);
  7082. }else{
  7083. (slots.default || (slots.default = [])).push(child);
  7084. }
  7085. }
  7086. }
  7087. // ignore slots that contains only whitespace
  7088. for (var name$1 in slots) {
  7089. if (slots[name$1].every(isWhitespace)) {
  7090. delete slots[name$1];
  7091. }
  7092. }
  7093. return slots
  7094. }
  7095. function isWhitespace (node) {
  7096. return (node.isComment && !node.asyncFactory) || node.text === ' '
  7097. }
  7098. /* */
  7099. function normalizeScopedSlots (
  7100. slots,
  7101. normalSlots,
  7102. prevSlots
  7103. ) {
  7104. var res;
  7105. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  7106. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  7107. var key = slots && slots.$key;
  7108. if (!slots) {
  7109. res = {};
  7110. } else if (slots._normalized) {
  7111. // fast path 1: child component re-render only, parent did not change
  7112. return slots._normalized
  7113. } else if (
  7114. isStable &&
  7115. prevSlots &&
  7116. prevSlots !== emptyObject &&
  7117. key === prevSlots.$key &&
  7118. !hasNormalSlots &&
  7119. !prevSlots.$hasNormal
  7120. ) {
  7121. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  7122. // only need to normalize once
  7123. return prevSlots
  7124. } else {
  7125. res = {};
  7126. for (var key$1 in slots) {
  7127. if (slots[key$1] && key$1[0] !== '$') {
  7128. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  7129. }
  7130. }
  7131. }
  7132. // expose normal slots on scopedSlots
  7133. for (var key$2 in normalSlots) {
  7134. if (!(key$2 in res)) {
  7135. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  7136. }
  7137. }
  7138. // avoriaz seems to mock a non-extensible $scopedSlots object
  7139. // and when that is passed down this would cause an error
  7140. if (slots && Object.isExtensible(slots)) {
  7141. (slots)._normalized = res;
  7142. }
  7143. def(res, '$stable', isStable);
  7144. def(res, '$key', key);
  7145. def(res, '$hasNormal', hasNormalSlots);
  7146. return res
  7147. }
  7148. function normalizeScopedSlot(normalSlots, key, fn) {
  7149. var normalized = function () {
  7150. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  7151. res = res && typeof res === 'object' && !Array.isArray(res)
  7152. ? [res] // single vnode
  7153. : normalizeChildren(res);
  7154. return res && (
  7155. res.length === 0 ||
  7156. (res.length === 1 && res[0].isComment) // #9658
  7157. ) ? undefined
  7158. : res
  7159. };
  7160. // this is a slot using the new v-slot syntax without scope. although it is
  7161. // compiled as a scoped slot, render fn users would expect it to be present
  7162. // on this.$slots because the usage is semantically a normal slot.
  7163. if (fn.proxy) {
  7164. Object.defineProperty(normalSlots, key, {
  7165. get: normalized,
  7166. enumerable: true,
  7167. configurable: true
  7168. });
  7169. }
  7170. return normalized
  7171. }
  7172. function proxyNormalSlot(slots, key) {
  7173. return function () { return slots[key]; }
  7174. }
  7175. /* */
  7176. /**
  7177. * Runtime helper for rendering v-for lists.
  7178. */
  7179. function renderList (
  7180. val,
  7181. render
  7182. ) {
  7183. var ret, i, l, keys, key;
  7184. if (Array.isArray(val) || typeof val === 'string') {
  7185. ret = new Array(val.length);
  7186. for (i = 0, l = val.length; i < l; i++) {
  7187. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  7188. }
  7189. } else if (typeof val === 'number') {
  7190. ret = new Array(val);
  7191. for (i = 0; i < val; i++) {
  7192. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  7193. }
  7194. } else if (isObject(val)) {
  7195. if (hasSymbol && val[Symbol.iterator]) {
  7196. ret = [];
  7197. var iterator = val[Symbol.iterator]();
  7198. var result = iterator.next();
  7199. while (!result.done) {
  7200. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  7201. result = iterator.next();
  7202. }
  7203. } else {
  7204. keys = Object.keys(val);
  7205. ret = new Array(keys.length);
  7206. for (i = 0, l = keys.length; i < l; i++) {
  7207. key = keys[i];
  7208. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  7209. }
  7210. }
  7211. }
  7212. if (!isDef(ret)) {
  7213. ret = [];
  7214. }
  7215. (ret)._isVList = true;
  7216. return ret
  7217. }
  7218. /* */
  7219. /**
  7220. * Runtime helper for rendering <slot>
  7221. */
  7222. function renderSlot (
  7223. name,
  7224. fallback,
  7225. props,
  7226. bindObject
  7227. ) {
  7228. var scopedSlotFn = this.$scopedSlots[name];
  7229. var nodes;
  7230. if (scopedSlotFn) { // scoped slot
  7231. props = props || {};
  7232. if (bindObject) {
  7233. if ( true && !isObject(bindObject)) {
  7234. warn(
  7235. 'slot v-bind without argument expects an Object',
  7236. this
  7237. );
  7238. }
  7239. props = extend(extend({}, bindObject), props);
  7240. }
  7241. // fixed by xxxxxx app-plus scopedSlot
  7242. nodes = scopedSlotFn(props, this, props._i) || fallback;
  7243. } else {
  7244. nodes = this.$slots[name] || fallback;
  7245. }
  7246. var target = props && props.slot;
  7247. if (target) {
  7248. return this.$createElement('template', { slot: target }, nodes)
  7249. } else {
  7250. return nodes
  7251. }
  7252. }
  7253. /* */
  7254. /**
  7255. * Runtime helper for resolving filters
  7256. */
  7257. function resolveFilter (id) {
  7258. return resolveAsset(this.$options, 'filters', id, true) || identity
  7259. }
  7260. /* */
  7261. function isKeyNotMatch (expect, actual) {
  7262. if (Array.isArray(expect)) {
  7263. return expect.indexOf(actual) === -1
  7264. } else {
  7265. return expect !== actual
  7266. }
  7267. }
  7268. /**
  7269. * Runtime helper for checking keyCodes from config.
  7270. * exposed as Vue.prototype._k
  7271. * passing in eventKeyName as last argument separately for backwards compat
  7272. */
  7273. function checkKeyCodes (
  7274. eventKeyCode,
  7275. key,
  7276. builtInKeyCode,
  7277. eventKeyName,
  7278. builtInKeyName
  7279. ) {
  7280. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  7281. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  7282. return isKeyNotMatch(builtInKeyName, eventKeyName)
  7283. } else if (mappedKeyCode) {
  7284. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  7285. } else if (eventKeyName) {
  7286. return hyphenate(eventKeyName) !== key
  7287. }
  7288. }
  7289. /* */
  7290. /**
  7291. * Runtime helper for merging v-bind="object" into a VNode's data.
  7292. */
  7293. function bindObjectProps (
  7294. data,
  7295. tag,
  7296. value,
  7297. asProp,
  7298. isSync
  7299. ) {
  7300. if (value) {
  7301. if (!isObject(value)) {
  7302. true && warn(
  7303. 'v-bind without argument expects an Object or Array value',
  7304. this
  7305. );
  7306. } else {
  7307. if (Array.isArray(value)) {
  7308. value = toObject(value);
  7309. }
  7310. var hash;
  7311. var loop = function ( key ) {
  7312. if (
  7313. key === 'class' ||
  7314. key === 'style' ||
  7315. isReservedAttribute(key)
  7316. ) {
  7317. hash = data;
  7318. } else {
  7319. var type = data.attrs && data.attrs.type;
  7320. hash = asProp || config.mustUseProp(tag, type, key)
  7321. ? data.domProps || (data.domProps = {})
  7322. : data.attrs || (data.attrs = {});
  7323. }
  7324. var camelizedKey = camelize(key);
  7325. var hyphenatedKey = hyphenate(key);
  7326. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  7327. hash[key] = value[key];
  7328. if (isSync) {
  7329. var on = data.on || (data.on = {});
  7330. on[("update:" + key)] = function ($event) {
  7331. value[key] = $event;
  7332. };
  7333. }
  7334. }
  7335. };
  7336. for (var key in value) loop( key );
  7337. }
  7338. }
  7339. return data
  7340. }
  7341. /* */
  7342. /**
  7343. * Runtime helper for rendering static trees.
  7344. */
  7345. function renderStatic (
  7346. index,
  7347. isInFor
  7348. ) {
  7349. var cached = this._staticTrees || (this._staticTrees = []);
  7350. var tree = cached[index];
  7351. // if has already-rendered static tree and not inside v-for,
  7352. // we can reuse the same tree.
  7353. if (tree && !isInFor) {
  7354. return tree
  7355. }
  7356. // otherwise, render a fresh tree.
  7357. tree = cached[index] = this.$options.staticRenderFns[index].call(
  7358. this._renderProxy,
  7359. null,
  7360. this // for render fns generated for functional component templates
  7361. );
  7362. markStatic(tree, ("__static__" + index), false);
  7363. return tree
  7364. }
  7365. /**
  7366. * Runtime helper for v-once.
  7367. * Effectively it means marking the node as static with a unique key.
  7368. */
  7369. function markOnce (
  7370. tree,
  7371. index,
  7372. key
  7373. ) {
  7374. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  7375. return tree
  7376. }
  7377. function markStatic (
  7378. tree,
  7379. key,
  7380. isOnce
  7381. ) {
  7382. if (Array.isArray(tree)) {
  7383. for (var i = 0; i < tree.length; i++) {
  7384. if (tree[i] && typeof tree[i] !== 'string') {
  7385. markStaticNode(tree[i], (key + "_" + i), isOnce);
  7386. }
  7387. }
  7388. } else {
  7389. markStaticNode(tree, key, isOnce);
  7390. }
  7391. }
  7392. function markStaticNode (node, key, isOnce) {
  7393. node.isStatic = true;
  7394. node.key = key;
  7395. node.isOnce = isOnce;
  7396. }
  7397. /* */
  7398. function bindObjectListeners (data, value) {
  7399. if (value) {
  7400. if (!isPlainObject(value)) {
  7401. true && warn(
  7402. 'v-on without argument expects an Object value',
  7403. this
  7404. );
  7405. } else {
  7406. var on = data.on = data.on ? extend({}, data.on) : {};
  7407. for (var key in value) {
  7408. var existing = on[key];
  7409. var ours = value[key];
  7410. on[key] = existing ? [].concat(existing, ours) : ours;
  7411. }
  7412. }
  7413. }
  7414. return data
  7415. }
  7416. /* */
  7417. function resolveScopedSlots (
  7418. fns, // see flow/vnode
  7419. res,
  7420. // the following are added in 2.6
  7421. hasDynamicKeys,
  7422. contentHashKey
  7423. ) {
  7424. res = res || { $stable: !hasDynamicKeys };
  7425. for (var i = 0; i < fns.length; i++) {
  7426. var slot = fns[i];
  7427. if (Array.isArray(slot)) {
  7428. resolveScopedSlots(slot, res, hasDynamicKeys);
  7429. } else if (slot) {
  7430. // marker for reverse proxying v-slot without scope on this.$slots
  7431. if (slot.proxy) {
  7432. slot.fn.proxy = true;
  7433. }
  7434. res[slot.key] = slot.fn;
  7435. }
  7436. }
  7437. if (contentHashKey) {
  7438. (res).$key = contentHashKey;
  7439. }
  7440. return res
  7441. }
  7442. /* */
  7443. function bindDynamicKeys (baseObj, values) {
  7444. for (var i = 0; i < values.length; i += 2) {
  7445. var key = values[i];
  7446. if (typeof key === 'string' && key) {
  7447. baseObj[values[i]] = values[i + 1];
  7448. } else if ( true && key !== '' && key !== null) {
  7449. // null is a special value for explicitly removing a binding
  7450. warn(
  7451. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  7452. this
  7453. );
  7454. }
  7455. }
  7456. return baseObj
  7457. }
  7458. // helper to dynamically append modifier runtime markers to event names.
  7459. // ensure only append when value is already string, otherwise it will be cast
  7460. // to string and cause the type check to miss.
  7461. function prependModifier (value, symbol) {
  7462. return typeof value === 'string' ? symbol + value : value
  7463. }
  7464. /* */
  7465. function installRenderHelpers (target) {
  7466. target._o = markOnce;
  7467. target._n = toNumber;
  7468. target._s = toString;
  7469. target._l = renderList;
  7470. target._t = renderSlot;
  7471. target._q = looseEqual;
  7472. target._i = looseIndexOf;
  7473. target._m = renderStatic;
  7474. target._f = resolveFilter;
  7475. target._k = checkKeyCodes;
  7476. target._b = bindObjectProps;
  7477. target._v = createTextVNode;
  7478. target._e = createEmptyVNode;
  7479. target._u = resolveScopedSlots;
  7480. target._g = bindObjectListeners;
  7481. target._d = bindDynamicKeys;
  7482. target._p = prependModifier;
  7483. }
  7484. /* */
  7485. function FunctionalRenderContext (
  7486. data,
  7487. props,
  7488. children,
  7489. parent,
  7490. Ctor
  7491. ) {
  7492. var this$1 = this;
  7493. var options = Ctor.options;
  7494. // ensure the createElement function in functional components
  7495. // gets a unique context - this is necessary for correct named slot check
  7496. var contextVm;
  7497. if (hasOwn(parent, '_uid')) {
  7498. contextVm = Object.create(parent);
  7499. // $flow-disable-line
  7500. contextVm._original = parent;
  7501. } else {
  7502. // the context vm passed in is a functional context as well.
  7503. // in this case we want to make sure we are able to get a hold to the
  7504. // real context instance.
  7505. contextVm = parent;
  7506. // $flow-disable-line
  7507. parent = parent._original;
  7508. }
  7509. var isCompiled = isTrue(options._compiled);
  7510. var needNormalization = !isCompiled;
  7511. this.data = data;
  7512. this.props = props;
  7513. this.children = children;
  7514. this.parent = parent;
  7515. this.listeners = data.on || emptyObject;
  7516. this.injections = resolveInject(options.inject, parent);
  7517. this.slots = function () {
  7518. if (!this$1.$slots) {
  7519. normalizeScopedSlots(
  7520. data.scopedSlots,
  7521. this$1.$slots = resolveSlots(children, parent)
  7522. );
  7523. }
  7524. return this$1.$slots
  7525. };
  7526. Object.defineProperty(this, 'scopedSlots', ({
  7527. enumerable: true,
  7528. get: function get () {
  7529. return normalizeScopedSlots(data.scopedSlots, this.slots())
  7530. }
  7531. }));
  7532. // support for compiled functional template
  7533. if (isCompiled) {
  7534. // exposing $options for renderStatic()
  7535. this.$options = options;
  7536. // pre-resolve slots for renderSlot()
  7537. this.$slots = this.slots();
  7538. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  7539. }
  7540. if (options._scopeId) {
  7541. this._c = function (a, b, c, d) {
  7542. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  7543. if (vnode && !Array.isArray(vnode)) {
  7544. vnode.fnScopeId = options._scopeId;
  7545. vnode.fnContext = parent;
  7546. }
  7547. return vnode
  7548. };
  7549. } else {
  7550. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  7551. }
  7552. }
  7553. installRenderHelpers(FunctionalRenderContext.prototype);
  7554. function createFunctionalComponent (
  7555. Ctor,
  7556. propsData,
  7557. data,
  7558. contextVm,
  7559. children
  7560. ) {
  7561. var options = Ctor.options;
  7562. var props = {};
  7563. var propOptions = options.props;
  7564. if (isDef(propOptions)) {
  7565. for (var key in propOptions) {
  7566. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  7567. }
  7568. } else {
  7569. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  7570. if (isDef(data.props)) { mergeProps(props, data.props); }
  7571. }
  7572. var renderContext = new FunctionalRenderContext(
  7573. data,
  7574. props,
  7575. children,
  7576. contextVm,
  7577. Ctor
  7578. );
  7579. var vnode = options.render.call(null, renderContext._c, renderContext);
  7580. if (vnode instanceof VNode) {
  7581. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  7582. } else if (Array.isArray(vnode)) {
  7583. var vnodes = normalizeChildren(vnode) || [];
  7584. var res = new Array(vnodes.length);
  7585. for (var i = 0; i < vnodes.length; i++) {
  7586. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  7587. }
  7588. return res
  7589. }
  7590. }
  7591. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  7592. // #7817 clone node before setting fnContext, otherwise if the node is reused
  7593. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  7594. // that should not be matched to match.
  7595. var clone = cloneVNode(vnode);
  7596. clone.fnContext = contextVm;
  7597. clone.fnOptions = options;
  7598. if (true) {
  7599. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  7600. }
  7601. if (data.slot) {
  7602. (clone.data || (clone.data = {})).slot = data.slot;
  7603. }
  7604. return clone
  7605. }
  7606. function mergeProps (to, from) {
  7607. for (var key in from) {
  7608. to[camelize(key)] = from[key];
  7609. }
  7610. }
  7611. /* */
  7612. /* */
  7613. /* */
  7614. /* */
  7615. // inline hooks to be invoked on component VNodes during patch
  7616. var componentVNodeHooks = {
  7617. init: function init (vnode, hydrating) {
  7618. if (
  7619. vnode.componentInstance &&
  7620. !vnode.componentInstance._isDestroyed &&
  7621. vnode.data.keepAlive
  7622. ) {
  7623. // kept-alive components, treat as a patch
  7624. var mountedNode = vnode; // work around flow
  7625. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  7626. } else {
  7627. var child = vnode.componentInstance = createComponentInstanceForVnode(
  7628. vnode,
  7629. activeInstance
  7630. );
  7631. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  7632. }
  7633. },
  7634. prepatch: function prepatch (oldVnode, vnode) {
  7635. var options = vnode.componentOptions;
  7636. var child = vnode.componentInstance = oldVnode.componentInstance;
  7637. updateChildComponent(
  7638. child,
  7639. options.propsData, // updated props
  7640. options.listeners, // updated listeners
  7641. vnode, // new parent vnode
  7642. options.children // new children
  7643. );
  7644. },
  7645. insert: function insert (vnode) {
  7646. var context = vnode.context;
  7647. var componentInstance = vnode.componentInstance;
  7648. if (!componentInstance._isMounted) {
  7649. callHook(componentInstance, 'onServiceCreated');
  7650. callHook(componentInstance, 'onServiceAttached');
  7651. componentInstance._isMounted = true;
  7652. callHook(componentInstance, 'mounted');
  7653. }
  7654. if (vnode.data.keepAlive) {
  7655. if (context._isMounted) {
  7656. // vue-router#1212
  7657. // During updates, a kept-alive component's child components may
  7658. // change, so directly walking the tree here may call activated hooks
  7659. // on incorrect children. Instead we push them into a queue which will
  7660. // be processed after the whole patch process ended.
  7661. queueActivatedComponent(componentInstance);
  7662. } else {
  7663. activateChildComponent(componentInstance, true /* direct */);
  7664. }
  7665. }
  7666. },
  7667. destroy: function destroy (vnode) {
  7668. var componentInstance = vnode.componentInstance;
  7669. if (!componentInstance._isDestroyed) {
  7670. if (!vnode.data.keepAlive) {
  7671. componentInstance.$destroy();
  7672. } else {
  7673. deactivateChildComponent(componentInstance, true /* direct */);
  7674. }
  7675. }
  7676. }
  7677. };
  7678. var hooksToMerge = Object.keys(componentVNodeHooks);
  7679. function createComponent (
  7680. Ctor,
  7681. data,
  7682. context,
  7683. children,
  7684. tag
  7685. ) {
  7686. if (isUndef(Ctor)) {
  7687. return
  7688. }
  7689. var baseCtor = context.$options._base;
  7690. // plain options object: turn it into a constructor
  7691. if (isObject(Ctor)) {
  7692. Ctor = baseCtor.extend(Ctor);
  7693. }
  7694. // if at this stage it's not a constructor or an async component factory,
  7695. // reject.
  7696. if (typeof Ctor !== 'function') {
  7697. if (true) {
  7698. warn(("Invalid Component definition: " + (String(Ctor))), context);
  7699. }
  7700. return
  7701. }
  7702. // async component
  7703. var asyncFactory;
  7704. if (isUndef(Ctor.cid)) {
  7705. asyncFactory = Ctor;
  7706. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  7707. if (Ctor === undefined) {
  7708. // return a placeholder node for async component, which is rendered
  7709. // as a comment node but preserves all the raw information for the node.
  7710. // the information will be used for async server-rendering and hydration.
  7711. return createAsyncPlaceholder(
  7712. asyncFactory,
  7713. data,
  7714. context,
  7715. children,
  7716. tag
  7717. )
  7718. }
  7719. }
  7720. data = data || {};
  7721. // resolve constructor options in case global mixins are applied after
  7722. // component constructor creation
  7723. resolveConstructorOptions(Ctor);
  7724. // transform component v-model data into props & events
  7725. if (isDef(data.model)) {
  7726. transformModel(Ctor.options, data);
  7727. }
  7728. // extract props
  7729. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  7730. // functional component
  7731. if (isTrue(Ctor.options.functional)) {
  7732. return createFunctionalComponent(Ctor, propsData, data, context, children)
  7733. }
  7734. // extract listeners, since these needs to be treated as
  7735. // child component listeners instead of DOM listeners
  7736. var listeners = data.on;
  7737. // replace with listeners with .native modifier
  7738. // so it gets processed during parent component patch.
  7739. data.on = data.nativeOn;
  7740. if (isTrue(Ctor.options.abstract)) {
  7741. // abstract components do not keep anything
  7742. // other than props & listeners & slot
  7743. // work around flow
  7744. var slot = data.slot;
  7745. data = {};
  7746. if (slot) {
  7747. data.slot = slot;
  7748. }
  7749. }
  7750. // install component management hooks onto the placeholder node
  7751. installComponentHooks(data);
  7752. // return a placeholder vnode
  7753. var name = Ctor.options.name || tag;
  7754. var vnode = new VNode(
  7755. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  7756. data, undefined, undefined, undefined, context,
  7757. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  7758. asyncFactory
  7759. );
  7760. return vnode
  7761. }
  7762. function createComponentInstanceForVnode (
  7763. vnode, // we know it's MountedComponentVNode but flow doesn't
  7764. parent // activeInstance in lifecycle state
  7765. ) {
  7766. var options = {
  7767. _isComponent: true,
  7768. _parentVnode: vnode,
  7769. parent: parent
  7770. };
  7771. // check inline-template render functions
  7772. var inlineTemplate = vnode.data.inlineTemplate;
  7773. if (isDef(inlineTemplate)) {
  7774. options.render = inlineTemplate.render;
  7775. options.staticRenderFns = inlineTemplate.staticRenderFns;
  7776. }
  7777. return new vnode.componentOptions.Ctor(options)
  7778. }
  7779. function installComponentHooks (data) {
  7780. var hooks = data.hook || (data.hook = {});
  7781. for (var i = 0; i < hooksToMerge.length; i++) {
  7782. var key = hooksToMerge[i];
  7783. var existing = hooks[key];
  7784. var toMerge = componentVNodeHooks[key];
  7785. if (existing !== toMerge && !(existing && existing._merged)) {
  7786. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  7787. }
  7788. }
  7789. }
  7790. function mergeHook$1 (f1, f2) {
  7791. var merged = function (a, b) {
  7792. // flow complains about extra args which is why we use any
  7793. f1(a, b);
  7794. f2(a, b);
  7795. };
  7796. merged._merged = true;
  7797. return merged
  7798. }
  7799. // transform component v-model info (value and callback) into
  7800. // prop and event handler respectively.
  7801. function transformModel (options, data) {
  7802. var prop = (options.model && options.model.prop) || 'value';
  7803. var event = (options.model && options.model.event) || 'input'
  7804. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  7805. var on = data.on || (data.on = {});
  7806. var existing = on[event];
  7807. var callback = data.model.callback;
  7808. if (isDef(existing)) {
  7809. if (
  7810. Array.isArray(existing)
  7811. ? existing.indexOf(callback) === -1
  7812. : existing !== callback
  7813. ) {
  7814. on[event] = [callback].concat(existing);
  7815. }
  7816. } else {
  7817. on[event] = callback;
  7818. }
  7819. }
  7820. /* */
  7821. var SIMPLE_NORMALIZE = 1;
  7822. var ALWAYS_NORMALIZE = 2;
  7823. // wrapper function for providing a more flexible interface
  7824. // without getting yelled at by flow
  7825. function createElement (
  7826. context,
  7827. tag,
  7828. data,
  7829. children,
  7830. normalizationType,
  7831. alwaysNormalize
  7832. ) {
  7833. if (Array.isArray(data) || isPrimitive(data)) {
  7834. normalizationType = children;
  7835. children = data;
  7836. data = undefined;
  7837. }
  7838. if (isTrue(alwaysNormalize)) {
  7839. normalizationType = ALWAYS_NORMALIZE;
  7840. }
  7841. return _createElement(context, tag, data, children, normalizationType)
  7842. }
  7843. function _createElement (
  7844. context,
  7845. tag,
  7846. data,
  7847. children,
  7848. normalizationType
  7849. ) {
  7850. if (isDef(data) && isDef((data).__ob__)) {
  7851. true && warn(
  7852. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  7853. 'Always create fresh vnode data objects in each render!',
  7854. context
  7855. );
  7856. return createEmptyVNode()
  7857. }
  7858. // object syntax in v-bind
  7859. if (isDef(data) && isDef(data.is)) {
  7860. tag = data.is;
  7861. }
  7862. if (!tag) {
  7863. // in case of component :is set to falsy value
  7864. return createEmptyVNode()
  7865. }
  7866. // warn against non-primitive key
  7867. if ( true &&
  7868. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  7869. ) {
  7870. {
  7871. warn(
  7872. 'Avoid using non-primitive value as key, ' +
  7873. 'use string/number value instead.',
  7874. context
  7875. );
  7876. }
  7877. }
  7878. // support single function children as default scoped slot
  7879. if (Array.isArray(children) &&
  7880. typeof children[0] === 'function'
  7881. ) {
  7882. data = data || {};
  7883. data.scopedSlots = { default: children[0] };
  7884. children.length = 0;
  7885. }
  7886. if (normalizationType === ALWAYS_NORMALIZE) {
  7887. children = normalizeChildren(children);
  7888. } else if (normalizationType === SIMPLE_NORMALIZE) {
  7889. children = simpleNormalizeChildren(children);
  7890. }
  7891. var vnode, ns;
  7892. if (typeof tag === 'string') {
  7893. var Ctor;
  7894. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  7895. if (config.isReservedTag(tag)) {
  7896. // platform built-in elements
  7897. if ( true && isDef(data) && isDef(data.nativeOn)) {
  7898. warn(
  7899. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  7900. context
  7901. );
  7902. }
  7903. vnode = new VNode(
  7904. config.parsePlatformTagName(tag), data, children,
  7905. undefined, undefined, context
  7906. );
  7907. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  7908. // component
  7909. vnode = createComponent(Ctor, data, context, children, tag);
  7910. } else {
  7911. // unknown or unlisted namespaced elements
  7912. // check at runtime because it may get assigned a namespace when its
  7913. // parent normalizes children
  7914. vnode = new VNode(
  7915. tag, data, children,
  7916. undefined, undefined, context
  7917. );
  7918. }
  7919. } else {
  7920. // direct component options / constructor
  7921. vnode = createComponent(tag, data, context, children);
  7922. }
  7923. if (Array.isArray(vnode)) {
  7924. return vnode
  7925. } else if (isDef(vnode)) {
  7926. if (isDef(ns)) { applyNS(vnode, ns); }
  7927. if (isDef(data)) { registerDeepBindings(data); }
  7928. return vnode
  7929. } else {
  7930. return createEmptyVNode()
  7931. }
  7932. }
  7933. function applyNS (vnode, ns, force) {
  7934. vnode.ns = ns;
  7935. if (vnode.tag === 'foreignObject') {
  7936. // use default namespace inside foreignObject
  7937. ns = undefined;
  7938. force = true;
  7939. }
  7940. if (isDef(vnode.children)) {
  7941. for (var i = 0, l = vnode.children.length; i < l; i++) {
  7942. var child = vnode.children[i];
  7943. if (isDef(child.tag) && (
  7944. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  7945. applyNS(child, ns, force);
  7946. }
  7947. }
  7948. }
  7949. }
  7950. // ref #5318
  7951. // necessary to ensure parent re-render when deep bindings like :style and
  7952. // :class are used on slot nodes
  7953. function registerDeepBindings (data) {
  7954. if (isObject(data.style)) {
  7955. traverse(data.style);
  7956. }
  7957. if (isObject(data.class)) {
  7958. traverse(data.class);
  7959. }
  7960. }
  7961. /* */
  7962. function initRender (vm) {
  7963. vm._vnode = null; // the root of the child tree
  7964. vm._staticTrees = null; // v-once cached trees
  7965. var options = vm.$options;
  7966. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  7967. var renderContext = parentVnode && parentVnode.context;
  7968. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  7969. vm.$scopedSlots = emptyObject;
  7970. // bind the createElement fn to this instance
  7971. // so that we get proper render context inside it.
  7972. // args order: tag, data, children, normalizationType, alwaysNormalize
  7973. // internal version is used by render functions compiled from templates
  7974. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  7975. // normalization is always applied for the public version, used in
  7976. // user-written render functions.
  7977. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  7978. // $attrs & $listeners are exposed for easier HOC creation.
  7979. // they need to be reactive so that HOCs using them are always updated
  7980. var parentData = parentVnode && parentVnode.data;
  7981. /* istanbul ignore else */
  7982. if (true) {
  7983. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  7984. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  7985. }, true);
  7986. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  7987. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  7988. }, true);
  7989. } else {}
  7990. }
  7991. var currentRenderingInstance = null;
  7992. function renderMixin (Vue) {
  7993. // install runtime convenience helpers
  7994. installRenderHelpers(Vue.prototype);
  7995. Vue.prototype.$nextTick = function (fn) {
  7996. return nextTick(fn, this)
  7997. };
  7998. Vue.prototype._render = function () {
  7999. var vm = this;
  8000. var ref = vm.$options;
  8001. var render = ref.render;
  8002. var _parentVnode = ref._parentVnode;
  8003. if (_parentVnode) {
  8004. vm.$scopedSlots = normalizeScopedSlots(
  8005. _parentVnode.data.scopedSlots,
  8006. vm.$slots,
  8007. vm.$scopedSlots
  8008. );
  8009. }
  8010. // set parent vnode. this allows render functions to have access
  8011. // to the data on the placeholder node.
  8012. vm.$vnode = _parentVnode;
  8013. // render self
  8014. var vnode;
  8015. try {
  8016. // There's no need to maintain a stack because all render fns are called
  8017. // separately from one another. Nested component's render fns are called
  8018. // when parent component is patched.
  8019. currentRenderingInstance = vm;
  8020. vnode = render.call(vm._renderProxy, vm.$createElement);
  8021. } catch (e) {
  8022. handleError(e, vm, "render");
  8023. // return error render result,
  8024. // or previous vnode to prevent render error causing blank component
  8025. /* istanbul ignore else */
  8026. if ( true && vm.$options.renderError) {
  8027. try {
  8028. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  8029. } catch (e) {
  8030. handleError(e, vm, "renderError");
  8031. vnode = vm._vnode;
  8032. }
  8033. } else {
  8034. vnode = vm._vnode;
  8035. }
  8036. } finally {
  8037. currentRenderingInstance = null;
  8038. }
  8039. // if the returned array contains only a single node, allow it
  8040. if (Array.isArray(vnode) && vnode.length === 1) {
  8041. vnode = vnode[0];
  8042. }
  8043. // return empty vnode in case the render function errored out
  8044. if (!(vnode instanceof VNode)) {
  8045. if ( true && Array.isArray(vnode)) {
  8046. warn(
  8047. 'Multiple root nodes returned from render function. Render function ' +
  8048. 'should return a single root node.',
  8049. vm
  8050. );
  8051. }
  8052. vnode = createEmptyVNode();
  8053. }
  8054. // set parent
  8055. vnode.parent = _parentVnode;
  8056. return vnode
  8057. };
  8058. }
  8059. /* */
  8060. function ensureCtor (comp, base) {
  8061. if (
  8062. comp.__esModule ||
  8063. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  8064. ) {
  8065. comp = comp.default;
  8066. }
  8067. return isObject(comp)
  8068. ? base.extend(comp)
  8069. : comp
  8070. }
  8071. function createAsyncPlaceholder (
  8072. factory,
  8073. data,
  8074. context,
  8075. children,
  8076. tag
  8077. ) {
  8078. var node = createEmptyVNode();
  8079. node.asyncFactory = factory;
  8080. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  8081. return node
  8082. }
  8083. function resolveAsyncComponent (
  8084. factory,
  8085. baseCtor
  8086. ) {
  8087. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  8088. return factory.errorComp
  8089. }
  8090. if (isDef(factory.resolved)) {
  8091. return factory.resolved
  8092. }
  8093. var owner = currentRenderingInstance;
  8094. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  8095. // already pending
  8096. factory.owners.push(owner);
  8097. }
  8098. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  8099. return factory.loadingComp
  8100. }
  8101. if (owner && !isDef(factory.owners)) {
  8102. var owners = factory.owners = [owner];
  8103. var sync = true;
  8104. var timerLoading = null;
  8105. var timerTimeout = null
  8106. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  8107. var forceRender = function (renderCompleted) {
  8108. for (var i = 0, l = owners.length; i < l; i++) {
  8109. (owners[i]).$forceUpdate();
  8110. }
  8111. if (renderCompleted) {
  8112. owners.length = 0;
  8113. if (timerLoading !== null) {
  8114. clearTimeout(timerLoading);
  8115. timerLoading = null;
  8116. }
  8117. if (timerTimeout !== null) {
  8118. clearTimeout(timerTimeout);
  8119. timerTimeout = null;
  8120. }
  8121. }
  8122. };
  8123. var resolve = once(function (res) {
  8124. // cache resolved
  8125. factory.resolved = ensureCtor(res, baseCtor);
  8126. // invoke callbacks only if this is not a synchronous resolve
  8127. // (async resolves are shimmed as synchronous during SSR)
  8128. if (!sync) {
  8129. forceRender(true);
  8130. } else {
  8131. owners.length = 0;
  8132. }
  8133. });
  8134. var reject = once(function (reason) {
  8135. true && warn(
  8136. "Failed to resolve async component: " + (String(factory)) +
  8137. (reason ? ("\nReason: " + reason) : '')
  8138. );
  8139. if (isDef(factory.errorComp)) {
  8140. factory.error = true;
  8141. forceRender(true);
  8142. }
  8143. });
  8144. var res = factory(resolve, reject);
  8145. if (isObject(res)) {
  8146. if (isPromise(res)) {
  8147. // () => Promise
  8148. if (isUndef(factory.resolved)) {
  8149. res.then(resolve, reject);
  8150. }
  8151. } else if (isPromise(res.component)) {
  8152. res.component.then(resolve, reject);
  8153. if (isDef(res.error)) {
  8154. factory.errorComp = ensureCtor(res.error, baseCtor);
  8155. }
  8156. if (isDef(res.loading)) {
  8157. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  8158. if (res.delay === 0) {
  8159. factory.loading = true;
  8160. } else {
  8161. timerLoading = setTimeout(function () {
  8162. timerLoading = null;
  8163. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  8164. factory.loading = true;
  8165. forceRender(false);
  8166. }
  8167. }, res.delay || 200);
  8168. }
  8169. }
  8170. if (isDef(res.timeout)) {
  8171. timerTimeout = setTimeout(function () {
  8172. timerTimeout = null;
  8173. if (isUndef(factory.resolved)) {
  8174. reject(
  8175. true
  8176. ? ("timeout (" + (res.timeout) + "ms)")
  8177. : undefined
  8178. );
  8179. }
  8180. }, res.timeout);
  8181. }
  8182. }
  8183. }
  8184. sync = false;
  8185. // return in case resolved synchronously
  8186. return factory.loading
  8187. ? factory.loadingComp
  8188. : factory.resolved
  8189. }
  8190. }
  8191. /* */
  8192. function isAsyncPlaceholder (node) {
  8193. return node.isComment && node.asyncFactory
  8194. }
  8195. /* */
  8196. function getFirstComponentChild (children) {
  8197. if (Array.isArray(children)) {
  8198. for (var i = 0; i < children.length; i++) {
  8199. var c = children[i];
  8200. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  8201. return c
  8202. }
  8203. }
  8204. }
  8205. }
  8206. /* */
  8207. /* */
  8208. function initEvents (vm) {
  8209. vm._events = Object.create(null);
  8210. vm._hasHookEvent = false;
  8211. // init parent attached events
  8212. var listeners = vm.$options._parentListeners;
  8213. if (listeners) {
  8214. updateComponentListeners(vm, listeners);
  8215. }
  8216. }
  8217. var target;
  8218. function add (event, fn) {
  8219. target.$on(event, fn);
  8220. }
  8221. function remove$1 (event, fn) {
  8222. target.$off(event, fn);
  8223. }
  8224. function createOnceHandler (event, fn) {
  8225. var _target = target;
  8226. return function onceHandler () {
  8227. var res = fn.apply(null, arguments);
  8228. if (res !== null) {
  8229. _target.$off(event, onceHandler);
  8230. }
  8231. }
  8232. }
  8233. function updateComponentListeners (
  8234. vm,
  8235. listeners,
  8236. oldListeners
  8237. ) {
  8238. target = vm;
  8239. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  8240. target = undefined;
  8241. }
  8242. function eventsMixin (Vue) {
  8243. var hookRE = /^hook:/;
  8244. Vue.prototype.$on = function (event, fn) {
  8245. var vm = this;
  8246. if (Array.isArray(event)) {
  8247. for (var i = 0, l = event.length; i < l; i++) {
  8248. vm.$on(event[i], fn);
  8249. }
  8250. } else {
  8251. (vm._events[event] || (vm._events[event] = [])).push(fn);
  8252. // optimize hook:event cost by using a boolean flag marked at registration
  8253. // instead of a hash lookup
  8254. if (hookRE.test(event)) {
  8255. vm._hasHookEvent = true;
  8256. }
  8257. }
  8258. return vm
  8259. };
  8260. Vue.prototype.$once = function (event, fn) {
  8261. var vm = this;
  8262. function on () {
  8263. vm.$off(event, on);
  8264. fn.apply(vm, arguments);
  8265. }
  8266. on.fn = fn;
  8267. vm.$on(event, on);
  8268. return vm
  8269. };
  8270. Vue.prototype.$off = function (event, fn) {
  8271. var vm = this;
  8272. // all
  8273. if (!arguments.length) {
  8274. vm._events = Object.create(null);
  8275. return vm
  8276. }
  8277. // array of events
  8278. if (Array.isArray(event)) {
  8279. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  8280. vm.$off(event[i$1], fn);
  8281. }
  8282. return vm
  8283. }
  8284. // specific event
  8285. var cbs = vm._events[event];
  8286. if (!cbs) {
  8287. return vm
  8288. }
  8289. if (!fn) {
  8290. vm._events[event] = null;
  8291. return vm
  8292. }
  8293. // specific handler
  8294. var cb;
  8295. var i = cbs.length;
  8296. while (i--) {
  8297. cb = cbs[i];
  8298. if (cb === fn || cb.fn === fn) {
  8299. cbs.splice(i, 1);
  8300. break
  8301. }
  8302. }
  8303. return vm
  8304. };
  8305. Vue.prototype.$emit = function (event) {
  8306. var vm = this;
  8307. if (true) {
  8308. var lowerCaseEvent = event.toLowerCase();
  8309. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  8310. tip(
  8311. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  8312. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  8313. "Note that HTML attributes are case-insensitive and you cannot use " +
  8314. "v-on to listen to camelCase events when using in-DOM templates. " +
  8315. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  8316. );
  8317. }
  8318. }
  8319. var cbs = vm._events[event];
  8320. if (cbs) {
  8321. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  8322. var args = toArray(arguments, 1);
  8323. var info = "event handler for \"" + event + "\"";
  8324. for (var i = 0, l = cbs.length; i < l; i++) {
  8325. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  8326. }
  8327. }
  8328. return vm
  8329. };
  8330. }
  8331. /* */
  8332. var activeInstance = null;
  8333. var isUpdatingChildComponent = false;
  8334. function setActiveInstance(vm) {
  8335. var prevActiveInstance = activeInstance;
  8336. activeInstance = vm;
  8337. return function () {
  8338. activeInstance = prevActiveInstance;
  8339. }
  8340. }
  8341. function initLifecycle (vm) {
  8342. var options = vm.$options;
  8343. // locate first non-abstract parent
  8344. var parent = options.parent;
  8345. if (parent && !options.abstract) {
  8346. while (parent.$options.abstract && parent.$parent) {
  8347. parent = parent.$parent;
  8348. }
  8349. parent.$children.push(vm);
  8350. }
  8351. vm.$parent = parent;
  8352. vm.$root = parent ? parent.$root : vm;
  8353. vm.$children = [];
  8354. vm.$refs = {};
  8355. vm._watcher = null;
  8356. vm._inactive = null;
  8357. vm._directInactive = false;
  8358. vm._isMounted = false;
  8359. vm._isDestroyed = false;
  8360. vm._isBeingDestroyed = false;
  8361. }
  8362. function lifecycleMixin (Vue) {
  8363. Vue.prototype._update = function (vnode, hydrating) {
  8364. var vm = this;
  8365. var prevEl = vm.$el;
  8366. var prevVnode = vm._vnode;
  8367. var restoreActiveInstance = setActiveInstance(vm);
  8368. vm._vnode = vnode;
  8369. // Vue.prototype.__patch__ is injected in entry points
  8370. // based on the rendering backend used.
  8371. if (!prevVnode) {
  8372. // initial render
  8373. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  8374. } else {
  8375. // updates
  8376. vm.$el = vm.__patch__(prevVnode, vnode);
  8377. }
  8378. restoreActiveInstance();
  8379. // update __vue__ reference
  8380. if (prevEl) {
  8381. prevEl.__vue__ = null;
  8382. }
  8383. if (vm.$el) {
  8384. vm.$el.__vue__ = vm;
  8385. }
  8386. // if parent is an HOC, update its $el as well
  8387. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  8388. vm.$parent.$el = vm.$el;
  8389. }
  8390. // updated hook is called by the scheduler to ensure that children are
  8391. // updated in a parent's updated hook.
  8392. };
  8393. Vue.prototype.$forceUpdate = function () {
  8394. var vm = this;
  8395. if (vm._watcher) {
  8396. vm._watcher.update();
  8397. }
  8398. };
  8399. Vue.prototype.$destroy = function () {
  8400. var vm = this;
  8401. if (vm._isBeingDestroyed) {
  8402. return
  8403. }
  8404. callHook(vm, 'beforeDestroy');
  8405. vm._isBeingDestroyed = true;
  8406. // remove self from parent
  8407. var parent = vm.$parent;
  8408. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  8409. remove(parent.$children, vm);
  8410. }
  8411. // teardown watchers
  8412. if (vm._watcher) {
  8413. vm._watcher.teardown();
  8414. }
  8415. var i = vm._watchers.length;
  8416. while (i--) {
  8417. vm._watchers[i].teardown();
  8418. }
  8419. // remove reference from data ob
  8420. // frozen object may not have observer.
  8421. if (vm._data.__ob__) {
  8422. vm._data.__ob__.vmCount--;
  8423. }
  8424. // call the last hook...
  8425. vm._isDestroyed = true;
  8426. // invoke destroy hooks on current rendered tree
  8427. vm.__patch__(vm._vnode, null);
  8428. // fire destroyed hook
  8429. callHook(vm, 'destroyed');
  8430. // turn off all instance listeners.
  8431. vm.$off();
  8432. // remove __vue__ reference
  8433. if (vm.$el) {
  8434. vm.$el.__vue__ = null;
  8435. }
  8436. // release circular reference (#6759)
  8437. if (vm.$vnode) {
  8438. vm.$vnode.parent = null;
  8439. }
  8440. };
  8441. }
  8442. function updateChildComponent (
  8443. vm,
  8444. propsData,
  8445. listeners,
  8446. parentVnode,
  8447. renderChildren
  8448. ) {
  8449. if (true) {
  8450. isUpdatingChildComponent = true;
  8451. }
  8452. // determine whether component has slot children
  8453. // we need to do this before overwriting $options._renderChildren.
  8454. // check if there are dynamic scopedSlots (hand-written or compiled but with
  8455. // dynamic slot names). Static scoped slots compiled from template has the
  8456. // "$stable" marker.
  8457. var newScopedSlots = parentVnode.data.scopedSlots;
  8458. var oldScopedSlots = vm.$scopedSlots;
  8459. var hasDynamicScopedSlot = !!(
  8460. (newScopedSlots && !newScopedSlots.$stable) ||
  8461. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  8462. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  8463. );
  8464. // Any static slot children from the parent may have changed during parent's
  8465. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  8466. // update is necessary to ensure correctness.
  8467. var needsForceUpdate = !!(
  8468. renderChildren || // has new static slots
  8469. vm.$options._renderChildren || // has old static slots
  8470. hasDynamicScopedSlot
  8471. );
  8472. vm.$options._parentVnode = parentVnode;
  8473. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  8474. if (vm._vnode) { // update child tree's parent
  8475. vm._vnode.parent = parentVnode;
  8476. }
  8477. vm.$options._renderChildren = renderChildren;
  8478. // update $attrs and $listeners hash
  8479. // these are also reactive so they may trigger child update if the child
  8480. // used them during render
  8481. vm.$attrs = parentVnode.data.attrs || emptyObject;
  8482. vm.$listeners = listeners || emptyObject;
  8483. // update props
  8484. if (propsData && vm.$options.props) {
  8485. toggleObserving(false);
  8486. var props = vm._props;
  8487. var propKeys = vm.$options._propKeys || [];
  8488. for (var i = 0; i < propKeys.length; i++) {
  8489. var key = propKeys[i];
  8490. var propOptions = vm.$options.props; // wtf flow?
  8491. props[key] = validateProp(key, propOptions, propsData, vm);
  8492. }
  8493. toggleObserving(true);
  8494. // keep a copy of raw propsData
  8495. vm.$options.propsData = propsData;
  8496. }
  8497. // fixed by xxxxxx update properties(mp runtime)
  8498. vm._$updateProperties && vm._$updateProperties(vm);
  8499. // update listeners
  8500. listeners = listeners || emptyObject;
  8501. var oldListeners = vm.$options._parentListeners;
  8502. vm.$options._parentListeners = listeners;
  8503. updateComponentListeners(vm, listeners, oldListeners);
  8504. // resolve slots + force update if has children
  8505. if (needsForceUpdate) {
  8506. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  8507. vm.$forceUpdate();
  8508. }
  8509. if (true) {
  8510. isUpdatingChildComponent = false;
  8511. }
  8512. }
  8513. function isInInactiveTree (vm) {
  8514. while (vm && (vm = vm.$parent)) {
  8515. if (vm._inactive) { return true }
  8516. }
  8517. return false
  8518. }
  8519. function activateChildComponent (vm, direct) {
  8520. if (direct) {
  8521. vm._directInactive = false;
  8522. if (isInInactiveTree(vm)) {
  8523. return
  8524. }
  8525. } else if (vm._directInactive) {
  8526. return
  8527. }
  8528. if (vm._inactive || vm._inactive === null) {
  8529. vm._inactive = false;
  8530. for (var i = 0; i < vm.$children.length; i++) {
  8531. activateChildComponent(vm.$children[i]);
  8532. }
  8533. callHook(vm, 'activated');
  8534. }
  8535. }
  8536. function deactivateChildComponent (vm, direct) {
  8537. if (direct) {
  8538. vm._directInactive = true;
  8539. if (isInInactiveTree(vm)) {
  8540. return
  8541. }
  8542. }
  8543. if (!vm._inactive) {
  8544. vm._inactive = true;
  8545. for (var i = 0; i < vm.$children.length; i++) {
  8546. deactivateChildComponent(vm.$children[i]);
  8547. }
  8548. callHook(vm, 'deactivated');
  8549. }
  8550. }
  8551. function callHook (vm, hook) {
  8552. // #7573 disable dep collection when invoking lifecycle hooks
  8553. pushTarget();
  8554. var handlers = vm.$options[hook];
  8555. var info = hook + " hook";
  8556. if (handlers) {
  8557. for (var i = 0, j = handlers.length; i < j; i++) {
  8558. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  8559. }
  8560. }
  8561. if (vm._hasHookEvent) {
  8562. vm.$emit('hook:' + hook);
  8563. }
  8564. popTarget();
  8565. }
  8566. /* */
  8567. var MAX_UPDATE_COUNT = 100;
  8568. var queue = [];
  8569. var activatedChildren = [];
  8570. var has = {};
  8571. var circular = {};
  8572. var waiting = false;
  8573. var flushing = false;
  8574. var index = 0;
  8575. /**
  8576. * Reset the scheduler's state.
  8577. */
  8578. function resetSchedulerState () {
  8579. index = queue.length = activatedChildren.length = 0;
  8580. has = {};
  8581. if (true) {
  8582. circular = {};
  8583. }
  8584. waiting = flushing = false;
  8585. }
  8586. // Async edge case #6566 requires saving the timestamp when event listeners are
  8587. // attached. However, calling performance.now() has a perf overhead especially
  8588. // if the page has thousands of event listeners. Instead, we take a timestamp
  8589. // every time the scheduler flushes and use that for all event listeners
  8590. // attached during that flush.
  8591. var currentFlushTimestamp = 0;
  8592. // Async edge case fix requires storing an event listener's attach timestamp.
  8593. var getNow = Date.now;
  8594. // Determine what event timestamp the browser is using. Annoyingly, the
  8595. // timestamp can either be hi-res (relative to page load) or low-res
  8596. // (relative to UNIX epoch), so in order to compare time we have to use the
  8597. // same timestamp type when saving the flush timestamp.
  8598. // All IE versions use low-res event timestamps, and have problematic clock
  8599. // implementations (#9632)
  8600. if (inBrowser && !isIE) {
  8601. var performance = window.performance;
  8602. if (
  8603. performance &&
  8604. typeof performance.now === 'function' &&
  8605. getNow() > document.createEvent('Event').timeStamp
  8606. ) {
  8607. // if the event timestamp, although evaluated AFTER the Date.now(), is
  8608. // smaller than it, it means the event is using a hi-res timestamp,
  8609. // and we need to use the hi-res version for event listener timestamps as
  8610. // well.
  8611. getNow = function () { return performance.now(); };
  8612. }
  8613. }
  8614. /**
  8615. * Flush both queues and run the watchers.
  8616. */
  8617. function flushSchedulerQueue () {
  8618. currentFlushTimestamp = getNow();
  8619. flushing = true;
  8620. var watcher, id;
  8621. // Sort queue before flush.
  8622. // This ensures that:
  8623. // 1. Components are updated from parent to child. (because parent is always
  8624. // created before the child)
  8625. // 2. A component's user watchers are run before its render watcher (because
  8626. // user watchers are created before the render watcher)
  8627. // 3. If a component is destroyed during a parent component's watcher run,
  8628. // its watchers can be skipped.
  8629. queue.sort(function (a, b) { return a.id - b.id; });
  8630. // do not cache length because more watchers might be pushed
  8631. // as we run existing watchers
  8632. for (index = 0; index < queue.length; index++) {
  8633. watcher = queue[index];
  8634. if (watcher.before) {
  8635. watcher.before();
  8636. }
  8637. id = watcher.id;
  8638. has[id] = null;
  8639. watcher.run();
  8640. // in dev build, check and stop circular updates.
  8641. if ( true && has[id] != null) {
  8642. circular[id] = (circular[id] || 0) + 1;
  8643. if (circular[id] > MAX_UPDATE_COUNT) {
  8644. warn(
  8645. 'You may have an infinite update loop ' + (
  8646. watcher.user
  8647. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  8648. : "in a component render function."
  8649. ),
  8650. watcher.vm
  8651. );
  8652. break
  8653. }
  8654. }
  8655. }
  8656. // keep copies of post queues before resetting state
  8657. var activatedQueue = activatedChildren.slice();
  8658. var updatedQueue = queue.slice();
  8659. resetSchedulerState();
  8660. // call component updated and activated hooks
  8661. callActivatedHooks(activatedQueue);
  8662. callUpdatedHooks(updatedQueue);
  8663. // devtool hook
  8664. /* istanbul ignore if */
  8665. if (devtools && config.devtools) {
  8666. devtools.emit('flush');
  8667. }
  8668. }
  8669. function callUpdatedHooks (queue) {
  8670. var i = queue.length;
  8671. while (i--) {
  8672. var watcher = queue[i];
  8673. var vm = watcher.vm;
  8674. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  8675. callHook(vm, 'updated');
  8676. }
  8677. }
  8678. }
  8679. /**
  8680. * Queue a kept-alive component that was activated during patch.
  8681. * The queue will be processed after the entire tree has been patched.
  8682. */
  8683. function queueActivatedComponent (vm) {
  8684. // setting _inactive to false here so that a render function can
  8685. // rely on checking whether it's in an inactive tree (e.g. router-view)
  8686. vm._inactive = false;
  8687. activatedChildren.push(vm);
  8688. }
  8689. function callActivatedHooks (queue) {
  8690. for (var i = 0; i < queue.length; i++) {
  8691. queue[i]._inactive = true;
  8692. activateChildComponent(queue[i], true /* true */);
  8693. }
  8694. }
  8695. /**
  8696. * Push a watcher into the watcher queue.
  8697. * Jobs with duplicate IDs will be skipped unless it's
  8698. * pushed when the queue is being flushed.
  8699. */
  8700. function queueWatcher (watcher) {
  8701. var id = watcher.id;
  8702. if (has[id] == null) {
  8703. has[id] = true;
  8704. if (!flushing) {
  8705. queue.push(watcher);
  8706. } else {
  8707. // if already flushing, splice the watcher based on its id
  8708. // if already past its id, it will be run next immediately.
  8709. var i = queue.length - 1;
  8710. while (i > index && queue[i].id > watcher.id) {
  8711. i--;
  8712. }
  8713. queue.splice(i + 1, 0, watcher);
  8714. }
  8715. // queue the flush
  8716. if (!waiting) {
  8717. waiting = true;
  8718. if ( true && !config.async) {
  8719. flushSchedulerQueue();
  8720. return
  8721. }
  8722. nextTick(flushSchedulerQueue);
  8723. }
  8724. }
  8725. }
  8726. /* */
  8727. var uid$2 = 0;
  8728. /**
  8729. * A watcher parses an expression, collects dependencies,
  8730. * and fires callback when the expression value changes.
  8731. * This is used for both the $watch() api and directives.
  8732. */
  8733. var Watcher = function Watcher (
  8734. vm,
  8735. expOrFn,
  8736. cb,
  8737. options,
  8738. isRenderWatcher
  8739. ) {
  8740. this.vm = vm;
  8741. if (isRenderWatcher) {
  8742. vm._watcher = this;
  8743. }
  8744. vm._watchers.push(this);
  8745. // options
  8746. if (options) {
  8747. this.deep = !!options.deep;
  8748. this.user = !!options.user;
  8749. this.lazy = !!options.lazy;
  8750. this.sync = !!options.sync;
  8751. this.before = options.before;
  8752. } else {
  8753. this.deep = this.user = this.lazy = this.sync = false;
  8754. }
  8755. this.cb = cb;
  8756. this.id = ++uid$2; // uid for batching
  8757. this.active = true;
  8758. this.dirty = this.lazy; // for lazy watchers
  8759. this.deps = [];
  8760. this.newDeps = [];
  8761. this.depIds = new _Set();
  8762. this.newDepIds = new _Set();
  8763. this.expression = true
  8764. ? expOrFn.toString()
  8765. : undefined;
  8766. // parse expression for getter
  8767. if (typeof expOrFn === 'function') {
  8768. this.getter = expOrFn;
  8769. } else {
  8770. this.getter = parsePath(expOrFn);
  8771. if (!this.getter) {
  8772. this.getter = noop;
  8773. true && warn(
  8774. "Failed watching path: \"" + expOrFn + "\" " +
  8775. 'Watcher only accepts simple dot-delimited paths. ' +
  8776. 'For full control, use a function instead.',
  8777. vm
  8778. );
  8779. }
  8780. }
  8781. this.value = this.lazy
  8782. ? undefined
  8783. : this.get();
  8784. };
  8785. /**
  8786. * Evaluate the getter, and re-collect dependencies.
  8787. */
  8788. Watcher.prototype.get = function get () {
  8789. pushTarget(this);
  8790. var value;
  8791. var vm = this.vm;
  8792. try {
  8793. value = this.getter.call(vm, vm);
  8794. } catch (e) {
  8795. if (this.user) {
  8796. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  8797. } else {
  8798. throw e
  8799. }
  8800. } finally {
  8801. // "touch" every property so they are all tracked as
  8802. // dependencies for deep watching
  8803. if (this.deep) {
  8804. traverse(value);
  8805. }
  8806. popTarget();
  8807. this.cleanupDeps();
  8808. }
  8809. return value
  8810. };
  8811. /**
  8812. * Add a dependency to this directive.
  8813. */
  8814. Watcher.prototype.addDep = function addDep (dep) {
  8815. var id = dep.id;
  8816. if (!this.newDepIds.has(id)) {
  8817. this.newDepIds.add(id);
  8818. this.newDeps.push(dep);
  8819. if (!this.depIds.has(id)) {
  8820. dep.addSub(this);
  8821. }
  8822. }
  8823. };
  8824. /**
  8825. * Clean up for dependency collection.
  8826. */
  8827. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  8828. var i = this.deps.length;
  8829. while (i--) {
  8830. var dep = this.deps[i];
  8831. if (!this.newDepIds.has(dep.id)) {
  8832. dep.removeSub(this);
  8833. }
  8834. }
  8835. var tmp = this.depIds;
  8836. this.depIds = this.newDepIds;
  8837. this.newDepIds = tmp;
  8838. this.newDepIds.clear();
  8839. tmp = this.deps;
  8840. this.deps = this.newDeps;
  8841. this.newDeps = tmp;
  8842. this.newDeps.length = 0;
  8843. };
  8844. /**
  8845. * Subscriber interface.
  8846. * Will be called when a dependency changes.
  8847. */
  8848. Watcher.prototype.update = function update () {
  8849. /* istanbul ignore else */
  8850. if (this.lazy) {
  8851. this.dirty = true;
  8852. } else if (this.sync) {
  8853. this.run();
  8854. } else {
  8855. queueWatcher(this);
  8856. }
  8857. };
  8858. /**
  8859. * Scheduler job interface.
  8860. * Will be called by the scheduler.
  8861. */
  8862. Watcher.prototype.run = function run () {
  8863. if (this.active) {
  8864. var value = this.get();
  8865. if (
  8866. value !== this.value ||
  8867. // Deep watchers and watchers on Object/Arrays should fire even
  8868. // when the value is the same, because the value may
  8869. // have mutated.
  8870. isObject(value) ||
  8871. this.deep
  8872. ) {
  8873. // set new value
  8874. var oldValue = this.value;
  8875. this.value = value;
  8876. if (this.user) {
  8877. try {
  8878. this.cb.call(this.vm, value, oldValue);
  8879. } catch (e) {
  8880. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  8881. }
  8882. } else {
  8883. this.cb.call(this.vm, value, oldValue);
  8884. }
  8885. }
  8886. }
  8887. };
  8888. /**
  8889. * Evaluate the value of the watcher.
  8890. * This only gets called for lazy watchers.
  8891. */
  8892. Watcher.prototype.evaluate = function evaluate () {
  8893. this.value = this.get();
  8894. this.dirty = false;
  8895. };
  8896. /**
  8897. * Depend on all deps collected by this watcher.
  8898. */
  8899. Watcher.prototype.depend = function depend () {
  8900. var i = this.deps.length;
  8901. while (i--) {
  8902. this.deps[i].depend();
  8903. }
  8904. };
  8905. /**
  8906. * Remove self from all dependencies' subscriber list.
  8907. */
  8908. Watcher.prototype.teardown = function teardown () {
  8909. if (this.active) {
  8910. // remove self from vm's watcher list
  8911. // this is a somewhat expensive operation so we skip it
  8912. // if the vm is being destroyed.
  8913. if (!this.vm._isBeingDestroyed) {
  8914. remove(this.vm._watchers, this);
  8915. }
  8916. var i = this.deps.length;
  8917. while (i--) {
  8918. this.deps[i].removeSub(this);
  8919. }
  8920. this.active = false;
  8921. }
  8922. };
  8923. /* */
  8924. var sharedPropertyDefinition = {
  8925. enumerable: true,
  8926. configurable: true,
  8927. get: noop,
  8928. set: noop
  8929. };
  8930. function proxy (target, sourceKey, key) {
  8931. sharedPropertyDefinition.get = function proxyGetter () {
  8932. return this[sourceKey][key]
  8933. };
  8934. sharedPropertyDefinition.set = function proxySetter (val) {
  8935. this[sourceKey][key] = val;
  8936. };
  8937. Object.defineProperty(target, key, sharedPropertyDefinition);
  8938. }
  8939. function initState (vm) {
  8940. vm._watchers = [];
  8941. var opts = vm.$options;
  8942. if (opts.props) { initProps(vm, opts.props); }
  8943. if (opts.methods) { initMethods(vm, opts.methods); }
  8944. if (opts.data) {
  8945. initData(vm);
  8946. } else {
  8947. observe(vm._data = {}, true /* asRootData */);
  8948. }
  8949. if (opts.computed) { initComputed(vm, opts.computed); }
  8950. if (opts.watch && opts.watch !== nativeWatch) {
  8951. initWatch(vm, opts.watch);
  8952. }
  8953. }
  8954. function initProps (vm, propsOptions) {
  8955. var propsData = vm.$options.propsData || {};
  8956. var props = vm._props = {};
  8957. // cache prop keys so that future props updates can iterate using Array
  8958. // instead of dynamic object key enumeration.
  8959. var keys = vm.$options._propKeys = [];
  8960. var isRoot = !vm.$parent;
  8961. // root instance props should be converted
  8962. if (!isRoot) {
  8963. toggleObserving(false);
  8964. }
  8965. var loop = function ( key ) {
  8966. keys.push(key);
  8967. var value = validateProp(key, propsOptions, propsData, vm);
  8968. /* istanbul ignore else */
  8969. if (true) {
  8970. var hyphenatedKey = hyphenate(key);
  8971. if (isReservedAttribute(hyphenatedKey) ||
  8972. config.isReservedAttr(hyphenatedKey)) {
  8973. warn(
  8974. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  8975. vm
  8976. );
  8977. }
  8978. defineReactive$$1(props, key, value, function () {
  8979. if (!isRoot && !isUpdatingChildComponent) {
  8980. {
  8981. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou'){//百度、快手 observer 在 setData callback 之后触发,直接忽略该 warn
  8982. return
  8983. }
  8984. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  8985. if(
  8986. key === 'value' &&
  8987. Array.isArray(vm.$options.behaviors) &&
  8988. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  8989. ){
  8990. return
  8991. }
  8992. if(vm._getFormData){
  8993. return
  8994. }
  8995. var $parent = vm.$parent;
  8996. while($parent){
  8997. if($parent.__next_tick_pending){
  8998. return
  8999. }
  9000. $parent = $parent.$parent;
  9001. }
  9002. }
  9003. warn(
  9004. "Avoid mutating a prop directly since the value will be " +
  9005. "overwritten whenever the parent component re-renders. " +
  9006. "Instead, use a data or computed property based on the prop's " +
  9007. "value. Prop being mutated: \"" + key + "\"",
  9008. vm
  9009. );
  9010. }
  9011. });
  9012. } else {}
  9013. // static props are already proxied on the component's prototype
  9014. // during Vue.extend(). We only need to proxy props defined at
  9015. // instantiation here.
  9016. if (!(key in vm)) {
  9017. proxy(vm, "_props", key);
  9018. }
  9019. };
  9020. for (var key in propsOptions) loop( key );
  9021. toggleObserving(true);
  9022. }
  9023. function initData (vm) {
  9024. var data = vm.$options.data;
  9025. data = vm._data = typeof data === 'function'
  9026. ? getData(data, vm)
  9027. : data || {};
  9028. if (!isPlainObject(data)) {
  9029. data = {};
  9030. true && warn(
  9031. 'data functions should return an object:\n' +
  9032. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  9033. vm
  9034. );
  9035. }
  9036. // proxy data on instance
  9037. var keys = Object.keys(data);
  9038. var props = vm.$options.props;
  9039. var methods = vm.$options.methods;
  9040. var i = keys.length;
  9041. while (i--) {
  9042. var key = keys[i];
  9043. if (true) {
  9044. if (methods && hasOwn(methods, key)) {
  9045. warn(
  9046. ("Method \"" + key + "\" has already been defined as a data property."),
  9047. vm
  9048. );
  9049. }
  9050. }
  9051. if (props && hasOwn(props, key)) {
  9052. true && warn(
  9053. "The data property \"" + key + "\" is already declared as a prop. " +
  9054. "Use prop default value instead.",
  9055. vm
  9056. );
  9057. } else if (!isReserved(key)) {
  9058. proxy(vm, "_data", key);
  9059. }
  9060. }
  9061. // observe data
  9062. observe(data, true /* asRootData */);
  9063. }
  9064. function getData (data, vm) {
  9065. // #7573 disable dep collection when invoking data getters
  9066. pushTarget();
  9067. try {
  9068. return data.call(vm, vm)
  9069. } catch (e) {
  9070. handleError(e, vm, "data()");
  9071. return {}
  9072. } finally {
  9073. popTarget();
  9074. }
  9075. }
  9076. var computedWatcherOptions = { lazy: true };
  9077. function initComputed (vm, computed) {
  9078. // $flow-disable-line
  9079. var watchers = vm._computedWatchers = Object.create(null);
  9080. // computed properties are just getters during SSR
  9081. var isSSR = isServerRendering();
  9082. for (var key in computed) {
  9083. var userDef = computed[key];
  9084. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  9085. if ( true && getter == null) {
  9086. warn(
  9087. ("Getter is missing for computed property \"" + key + "\"."),
  9088. vm
  9089. );
  9090. }
  9091. if (!isSSR) {
  9092. // create internal watcher for the computed property.
  9093. watchers[key] = new Watcher(
  9094. vm,
  9095. getter || noop,
  9096. noop,
  9097. computedWatcherOptions
  9098. );
  9099. }
  9100. // component-defined computed properties are already defined on the
  9101. // component prototype. We only need to define computed properties defined
  9102. // at instantiation here.
  9103. if (!(key in vm)) {
  9104. defineComputed(vm, key, userDef);
  9105. } else if (true) {
  9106. if (key in vm.$data) {
  9107. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  9108. } else if (vm.$options.props && key in vm.$options.props) {
  9109. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  9110. }
  9111. }
  9112. }
  9113. }
  9114. function defineComputed (
  9115. target,
  9116. key,
  9117. userDef
  9118. ) {
  9119. var shouldCache = !isServerRendering();
  9120. if (typeof userDef === 'function') {
  9121. sharedPropertyDefinition.get = shouldCache
  9122. ? createComputedGetter(key)
  9123. : createGetterInvoker(userDef);
  9124. sharedPropertyDefinition.set = noop;
  9125. } else {
  9126. sharedPropertyDefinition.get = userDef.get
  9127. ? shouldCache && userDef.cache !== false
  9128. ? createComputedGetter(key)
  9129. : createGetterInvoker(userDef.get)
  9130. : noop;
  9131. sharedPropertyDefinition.set = userDef.set || noop;
  9132. }
  9133. if ( true &&
  9134. sharedPropertyDefinition.set === noop) {
  9135. sharedPropertyDefinition.set = function () {
  9136. warn(
  9137. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  9138. this
  9139. );
  9140. };
  9141. }
  9142. Object.defineProperty(target, key, sharedPropertyDefinition);
  9143. }
  9144. function createComputedGetter (key) {
  9145. return function computedGetter () {
  9146. var watcher = this._computedWatchers && this._computedWatchers[key];
  9147. if (watcher) {
  9148. if (watcher.dirty) {
  9149. watcher.evaluate();
  9150. }
  9151. if (Dep.SharedObject.target) {// fixed by xxxxxx
  9152. watcher.depend();
  9153. }
  9154. return watcher.value
  9155. }
  9156. }
  9157. }
  9158. function createGetterInvoker(fn) {
  9159. return function computedGetter () {
  9160. return fn.call(this, this)
  9161. }
  9162. }
  9163. function initMethods (vm, methods) {
  9164. var props = vm.$options.props;
  9165. for (var key in methods) {
  9166. if (true) {
  9167. if (typeof methods[key] !== 'function') {
  9168. warn(
  9169. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  9170. "Did you reference the function correctly?",
  9171. vm
  9172. );
  9173. }
  9174. if (props && hasOwn(props, key)) {
  9175. warn(
  9176. ("Method \"" + key + "\" has already been defined as a prop."),
  9177. vm
  9178. );
  9179. }
  9180. if ((key in vm) && isReserved(key)) {
  9181. warn(
  9182. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  9183. "Avoid defining component methods that start with _ or $."
  9184. );
  9185. }
  9186. }
  9187. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  9188. }
  9189. }
  9190. function initWatch (vm, watch) {
  9191. for (var key in watch) {
  9192. var handler = watch[key];
  9193. if (Array.isArray(handler)) {
  9194. for (var i = 0; i < handler.length; i++) {
  9195. createWatcher(vm, key, handler[i]);
  9196. }
  9197. } else {
  9198. createWatcher(vm, key, handler);
  9199. }
  9200. }
  9201. }
  9202. function createWatcher (
  9203. vm,
  9204. expOrFn,
  9205. handler,
  9206. options
  9207. ) {
  9208. if (isPlainObject(handler)) {
  9209. options = handler;
  9210. handler = handler.handler;
  9211. }
  9212. if (typeof handler === 'string') {
  9213. handler = vm[handler];
  9214. }
  9215. return vm.$watch(expOrFn, handler, options)
  9216. }
  9217. function stateMixin (Vue) {
  9218. // flow somehow has problems with directly declared definition object
  9219. // when using Object.defineProperty, so we have to procedurally build up
  9220. // the object here.
  9221. var dataDef = {};
  9222. dataDef.get = function () { return this._data };
  9223. var propsDef = {};
  9224. propsDef.get = function () { return this._props };
  9225. if (true) {
  9226. dataDef.set = function () {
  9227. warn(
  9228. 'Avoid replacing instance root $data. ' +
  9229. 'Use nested data properties instead.',
  9230. this
  9231. );
  9232. };
  9233. propsDef.set = function () {
  9234. warn("$props is readonly.", this);
  9235. };
  9236. }
  9237. Object.defineProperty(Vue.prototype, '$data', dataDef);
  9238. Object.defineProperty(Vue.prototype, '$props', propsDef);
  9239. Vue.prototype.$set = set;
  9240. Vue.prototype.$delete = del;
  9241. Vue.prototype.$watch = function (
  9242. expOrFn,
  9243. cb,
  9244. options
  9245. ) {
  9246. var vm = this;
  9247. if (isPlainObject(cb)) {
  9248. return createWatcher(vm, expOrFn, cb, options)
  9249. }
  9250. options = options || {};
  9251. options.user = true;
  9252. var watcher = new Watcher(vm, expOrFn, cb, options);
  9253. if (options.immediate) {
  9254. try {
  9255. cb.call(vm, watcher.value);
  9256. } catch (error) {
  9257. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  9258. }
  9259. }
  9260. return function unwatchFn () {
  9261. watcher.teardown();
  9262. }
  9263. };
  9264. }
  9265. /* */
  9266. var uid$3 = 0;
  9267. function initMixin (Vue) {
  9268. Vue.prototype._init = function (options) {
  9269. var vm = this;
  9270. // a uid
  9271. vm._uid = uid$3++;
  9272. var startTag, endTag;
  9273. /* istanbul ignore if */
  9274. if ( true && config.performance && mark) {
  9275. startTag = "vue-perf-start:" + (vm._uid);
  9276. endTag = "vue-perf-end:" + (vm._uid);
  9277. mark(startTag);
  9278. }
  9279. // a flag to avoid this being observed
  9280. vm._isVue = true;
  9281. // merge options
  9282. if (options && options._isComponent) {
  9283. // optimize internal component instantiation
  9284. // since dynamic options merging is pretty slow, and none of the
  9285. // internal component options needs special treatment.
  9286. initInternalComponent(vm, options);
  9287. } else {
  9288. vm.$options = mergeOptions(
  9289. resolveConstructorOptions(vm.constructor),
  9290. options || {},
  9291. vm
  9292. );
  9293. }
  9294. /* istanbul ignore else */
  9295. if (true) {
  9296. initProxy(vm);
  9297. } else {}
  9298. // expose real self
  9299. vm._self = vm;
  9300. initLifecycle(vm);
  9301. initEvents(vm);
  9302. initRender(vm);
  9303. callHook(vm, 'beforeCreate');
  9304. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  9305. initState(vm);
  9306. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  9307. !vm._$fallback && callHook(vm, 'created');
  9308. /* istanbul ignore if */
  9309. if ( true && config.performance && mark) {
  9310. vm._name = formatComponentName(vm, false);
  9311. mark(endTag);
  9312. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  9313. }
  9314. if (vm.$options.el) {
  9315. vm.$mount(vm.$options.el);
  9316. }
  9317. };
  9318. }
  9319. function initInternalComponent (vm, options) {
  9320. var opts = vm.$options = Object.create(vm.constructor.options);
  9321. // doing this because it's faster than dynamic enumeration.
  9322. var parentVnode = options._parentVnode;
  9323. opts.parent = options.parent;
  9324. opts._parentVnode = parentVnode;
  9325. var vnodeComponentOptions = parentVnode.componentOptions;
  9326. opts.propsData = vnodeComponentOptions.propsData;
  9327. opts._parentListeners = vnodeComponentOptions.listeners;
  9328. opts._renderChildren = vnodeComponentOptions.children;
  9329. opts._componentTag = vnodeComponentOptions.tag;
  9330. if (options.render) {
  9331. opts.render = options.render;
  9332. opts.staticRenderFns = options.staticRenderFns;
  9333. }
  9334. }
  9335. function resolveConstructorOptions (Ctor) {
  9336. var options = Ctor.options;
  9337. if (Ctor.super) {
  9338. var superOptions = resolveConstructorOptions(Ctor.super);
  9339. var cachedSuperOptions = Ctor.superOptions;
  9340. if (superOptions !== cachedSuperOptions) {
  9341. // super option changed,
  9342. // need to resolve new options.
  9343. Ctor.superOptions = superOptions;
  9344. // check if there are any late-modified/attached options (#4976)
  9345. var modifiedOptions = resolveModifiedOptions(Ctor);
  9346. // update base extend options
  9347. if (modifiedOptions) {
  9348. extend(Ctor.extendOptions, modifiedOptions);
  9349. }
  9350. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  9351. if (options.name) {
  9352. options.components[options.name] = Ctor;
  9353. }
  9354. }
  9355. }
  9356. return options
  9357. }
  9358. function resolveModifiedOptions (Ctor) {
  9359. var modified;
  9360. var latest = Ctor.options;
  9361. var sealed = Ctor.sealedOptions;
  9362. for (var key in latest) {
  9363. if (latest[key] !== sealed[key]) {
  9364. if (!modified) { modified = {}; }
  9365. modified[key] = latest[key];
  9366. }
  9367. }
  9368. return modified
  9369. }
  9370. function Vue (options) {
  9371. if ( true &&
  9372. !(this instanceof Vue)
  9373. ) {
  9374. warn('Vue is a constructor and should be called with the `new` keyword');
  9375. }
  9376. this._init(options);
  9377. }
  9378. initMixin(Vue);
  9379. stateMixin(Vue);
  9380. eventsMixin(Vue);
  9381. lifecycleMixin(Vue);
  9382. renderMixin(Vue);
  9383. /* */
  9384. function initUse (Vue) {
  9385. Vue.use = function (plugin) {
  9386. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  9387. if (installedPlugins.indexOf(plugin) > -1) {
  9388. return this
  9389. }
  9390. // additional parameters
  9391. var args = toArray(arguments, 1);
  9392. args.unshift(this);
  9393. if (typeof plugin.install === 'function') {
  9394. plugin.install.apply(plugin, args);
  9395. } else if (typeof plugin === 'function') {
  9396. plugin.apply(null, args);
  9397. }
  9398. installedPlugins.push(plugin);
  9399. return this
  9400. };
  9401. }
  9402. /* */
  9403. function initMixin$1 (Vue) {
  9404. Vue.mixin = function (mixin) {
  9405. this.options = mergeOptions(this.options, mixin);
  9406. return this
  9407. };
  9408. }
  9409. /* */
  9410. function initExtend (Vue) {
  9411. /**
  9412. * Each instance constructor, including Vue, has a unique
  9413. * cid. This enables us to create wrapped "child
  9414. * constructors" for prototypal inheritance and cache them.
  9415. */
  9416. Vue.cid = 0;
  9417. var cid = 1;
  9418. /**
  9419. * Class inheritance
  9420. */
  9421. Vue.extend = function (extendOptions) {
  9422. extendOptions = extendOptions || {};
  9423. var Super = this;
  9424. var SuperId = Super.cid;
  9425. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  9426. if (cachedCtors[SuperId]) {
  9427. return cachedCtors[SuperId]
  9428. }
  9429. var name = extendOptions.name || Super.options.name;
  9430. if ( true && name) {
  9431. validateComponentName(name);
  9432. }
  9433. var Sub = function VueComponent (options) {
  9434. this._init(options);
  9435. };
  9436. Sub.prototype = Object.create(Super.prototype);
  9437. Sub.prototype.constructor = Sub;
  9438. Sub.cid = cid++;
  9439. Sub.options = mergeOptions(
  9440. Super.options,
  9441. extendOptions
  9442. );
  9443. Sub['super'] = Super;
  9444. // For props and computed properties, we define the proxy getters on
  9445. // the Vue instances at extension time, on the extended prototype. This
  9446. // avoids Object.defineProperty calls for each instance created.
  9447. if (Sub.options.props) {
  9448. initProps$1(Sub);
  9449. }
  9450. if (Sub.options.computed) {
  9451. initComputed$1(Sub);
  9452. }
  9453. // allow further extension/mixin/plugin usage
  9454. Sub.extend = Super.extend;
  9455. Sub.mixin = Super.mixin;
  9456. Sub.use = Super.use;
  9457. // create asset registers, so extended classes
  9458. // can have their private assets too.
  9459. ASSET_TYPES.forEach(function (type) {
  9460. Sub[type] = Super[type];
  9461. });
  9462. // enable recursive self-lookup
  9463. if (name) {
  9464. Sub.options.components[name] = Sub;
  9465. }
  9466. // keep a reference to the super options at extension time.
  9467. // later at instantiation we can check if Super's options have
  9468. // been updated.
  9469. Sub.superOptions = Super.options;
  9470. Sub.extendOptions = extendOptions;
  9471. Sub.sealedOptions = extend({}, Sub.options);
  9472. // cache constructor
  9473. cachedCtors[SuperId] = Sub;
  9474. return Sub
  9475. };
  9476. }
  9477. function initProps$1 (Comp) {
  9478. var props = Comp.options.props;
  9479. for (var key in props) {
  9480. proxy(Comp.prototype, "_props", key);
  9481. }
  9482. }
  9483. function initComputed$1 (Comp) {
  9484. var computed = Comp.options.computed;
  9485. for (var key in computed) {
  9486. defineComputed(Comp.prototype, key, computed[key]);
  9487. }
  9488. }
  9489. /* */
  9490. function initAssetRegisters (Vue) {
  9491. /**
  9492. * Create asset registration methods.
  9493. */
  9494. ASSET_TYPES.forEach(function (type) {
  9495. Vue[type] = function (
  9496. id,
  9497. definition
  9498. ) {
  9499. if (!definition) {
  9500. return this.options[type + 's'][id]
  9501. } else {
  9502. /* istanbul ignore if */
  9503. if ( true && type === 'component') {
  9504. validateComponentName(id);
  9505. }
  9506. if (type === 'component' && isPlainObject(definition)) {
  9507. definition.name = definition.name || id;
  9508. definition = this.options._base.extend(definition);
  9509. }
  9510. if (type === 'directive' && typeof definition === 'function') {
  9511. definition = { bind: definition, update: definition };
  9512. }
  9513. this.options[type + 's'][id] = definition;
  9514. return definition
  9515. }
  9516. };
  9517. });
  9518. }
  9519. /* */
  9520. function getComponentName (opts) {
  9521. return opts && (opts.Ctor.options.name || opts.tag)
  9522. }
  9523. function matches (pattern, name) {
  9524. if (Array.isArray(pattern)) {
  9525. return pattern.indexOf(name) > -1
  9526. } else if (typeof pattern === 'string') {
  9527. return pattern.split(',').indexOf(name) > -1
  9528. } else if (isRegExp(pattern)) {
  9529. return pattern.test(name)
  9530. }
  9531. /* istanbul ignore next */
  9532. return false
  9533. }
  9534. function pruneCache (keepAliveInstance, filter) {
  9535. var cache = keepAliveInstance.cache;
  9536. var keys = keepAliveInstance.keys;
  9537. var _vnode = keepAliveInstance._vnode;
  9538. for (var key in cache) {
  9539. var cachedNode = cache[key];
  9540. if (cachedNode) {
  9541. var name = getComponentName(cachedNode.componentOptions);
  9542. if (name && !filter(name)) {
  9543. pruneCacheEntry(cache, key, keys, _vnode);
  9544. }
  9545. }
  9546. }
  9547. }
  9548. function pruneCacheEntry (
  9549. cache,
  9550. key,
  9551. keys,
  9552. current
  9553. ) {
  9554. var cached$$1 = cache[key];
  9555. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  9556. cached$$1.componentInstance.$destroy();
  9557. }
  9558. cache[key] = null;
  9559. remove(keys, key);
  9560. }
  9561. var patternTypes = [String, RegExp, Array];
  9562. var KeepAlive = {
  9563. name: 'keep-alive',
  9564. abstract: true,
  9565. props: {
  9566. include: patternTypes,
  9567. exclude: patternTypes,
  9568. max: [String, Number]
  9569. },
  9570. created: function created () {
  9571. this.cache = Object.create(null);
  9572. this.keys = [];
  9573. },
  9574. destroyed: function destroyed () {
  9575. for (var key in this.cache) {
  9576. pruneCacheEntry(this.cache, key, this.keys);
  9577. }
  9578. },
  9579. mounted: function mounted () {
  9580. var this$1 = this;
  9581. this.$watch('include', function (val) {
  9582. pruneCache(this$1, function (name) { return matches(val, name); });
  9583. });
  9584. this.$watch('exclude', function (val) {
  9585. pruneCache(this$1, function (name) { return !matches(val, name); });
  9586. });
  9587. },
  9588. render: function render () {
  9589. var slot = this.$slots.default;
  9590. var vnode = getFirstComponentChild(slot);
  9591. var componentOptions = vnode && vnode.componentOptions;
  9592. if (componentOptions) {
  9593. // check pattern
  9594. var name = getComponentName(componentOptions);
  9595. var ref = this;
  9596. var include = ref.include;
  9597. var exclude = ref.exclude;
  9598. if (
  9599. // not included
  9600. (include && (!name || !matches(include, name))) ||
  9601. // excluded
  9602. (exclude && name && matches(exclude, name))
  9603. ) {
  9604. return vnode
  9605. }
  9606. var ref$1 = this;
  9607. var cache = ref$1.cache;
  9608. var keys = ref$1.keys;
  9609. var key = vnode.key == null
  9610. // same constructor may get registered as different local components
  9611. // so cid alone is not enough (#3269)
  9612. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  9613. : vnode.key;
  9614. if (cache[key]) {
  9615. vnode.componentInstance = cache[key].componentInstance;
  9616. // make current key freshest
  9617. remove(keys, key);
  9618. keys.push(key);
  9619. } else {
  9620. cache[key] = vnode;
  9621. keys.push(key);
  9622. // prune oldest entry
  9623. if (this.max && keys.length > parseInt(this.max)) {
  9624. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  9625. }
  9626. }
  9627. vnode.data.keepAlive = true;
  9628. }
  9629. return vnode || (slot && slot[0])
  9630. }
  9631. };
  9632. var builtInComponents = {
  9633. KeepAlive: KeepAlive
  9634. };
  9635. /* */
  9636. function initGlobalAPI (Vue) {
  9637. // config
  9638. var configDef = {};
  9639. configDef.get = function () { return config; };
  9640. if (true) {
  9641. configDef.set = function () {
  9642. warn(
  9643. 'Do not replace the Vue.config object, set individual fields instead.'
  9644. );
  9645. };
  9646. }
  9647. Object.defineProperty(Vue, 'config', configDef);
  9648. // exposed util methods.
  9649. // NOTE: these are not considered part of the public API - avoid relying on
  9650. // them unless you are aware of the risk.
  9651. Vue.util = {
  9652. warn: warn,
  9653. extend: extend,
  9654. mergeOptions: mergeOptions,
  9655. defineReactive: defineReactive$$1
  9656. };
  9657. Vue.set = set;
  9658. Vue.delete = del;
  9659. Vue.nextTick = nextTick;
  9660. // 2.6 explicit observable API
  9661. Vue.observable = function (obj) {
  9662. observe(obj);
  9663. return obj
  9664. };
  9665. Vue.options = Object.create(null);
  9666. ASSET_TYPES.forEach(function (type) {
  9667. Vue.options[type + 's'] = Object.create(null);
  9668. });
  9669. // this is used to identify the "base" constructor to extend all plain-object
  9670. // components with in Weex's multi-instance scenarios.
  9671. Vue.options._base = Vue;
  9672. extend(Vue.options.components, builtInComponents);
  9673. initUse(Vue);
  9674. initMixin$1(Vue);
  9675. initExtend(Vue);
  9676. initAssetRegisters(Vue);
  9677. }
  9678. initGlobalAPI(Vue);
  9679. Object.defineProperty(Vue.prototype, '$isServer', {
  9680. get: isServerRendering
  9681. });
  9682. Object.defineProperty(Vue.prototype, '$ssrContext', {
  9683. get: function get () {
  9684. /* istanbul ignore next */
  9685. return this.$vnode && this.$vnode.ssrContext
  9686. }
  9687. });
  9688. // expose FunctionalRenderContext for ssr runtime helper installation
  9689. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  9690. value: FunctionalRenderContext
  9691. });
  9692. Vue.version = '2.6.11';
  9693. /**
  9694. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  9695. */
  9696. var ARRAYTYPE = '[object Array]';
  9697. var OBJECTTYPE = '[object Object]';
  9698. // const FUNCTIONTYPE = '[object Function]'
  9699. function diff(current, pre) {
  9700. var result = {};
  9701. syncKeys(current, pre);
  9702. _diff(current, pre, '', result);
  9703. return result
  9704. }
  9705. function syncKeys(current, pre) {
  9706. if (current === pre) { return }
  9707. var rootCurrentType = type(current);
  9708. var rootPreType = type(pre);
  9709. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  9710. if(Object.keys(current).length >= Object.keys(pre).length){
  9711. for (var key in pre) {
  9712. var currentValue = current[key];
  9713. if (currentValue === undefined) {
  9714. current[key] = null;
  9715. } else {
  9716. syncKeys(currentValue, pre[key]);
  9717. }
  9718. }
  9719. }
  9720. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  9721. if (current.length >= pre.length) {
  9722. pre.forEach(function (item, index) {
  9723. syncKeys(current[index], item);
  9724. });
  9725. }
  9726. }
  9727. }
  9728. function _diff(current, pre, path, result) {
  9729. if (current === pre) { return }
  9730. var rootCurrentType = type(current);
  9731. var rootPreType = type(pre);
  9732. if (rootCurrentType == OBJECTTYPE) {
  9733. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  9734. setResult(result, path, current);
  9735. } else {
  9736. var loop = function ( key ) {
  9737. var currentValue = current[key];
  9738. var preValue = pre[key];
  9739. var currentType = type(currentValue);
  9740. var preType = type(preValue);
  9741. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  9742. // NOTE 此处将 != 修改为 !==。涉及地方太多恐怕测试不到,如果出现数据对比问题,将其修改回来。
  9743. if (currentValue !== pre[key]) {
  9744. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  9745. }
  9746. } else if (currentType == ARRAYTYPE) {
  9747. if (preType != ARRAYTYPE) {
  9748. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  9749. } else {
  9750. if (currentValue.length < preValue.length) {
  9751. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  9752. } else {
  9753. currentValue.forEach(function (item, index) {
  9754. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  9755. });
  9756. }
  9757. }
  9758. } else if (currentType == OBJECTTYPE) {
  9759. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  9760. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  9761. } else {
  9762. for (var subKey in currentValue) {
  9763. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  9764. }
  9765. }
  9766. }
  9767. };
  9768. for (var key in current) loop( key );
  9769. }
  9770. } else if (rootCurrentType == ARRAYTYPE) {
  9771. if (rootPreType != ARRAYTYPE) {
  9772. setResult(result, path, current);
  9773. } else {
  9774. if (current.length < pre.length) {
  9775. setResult(result, path, current);
  9776. } else {
  9777. current.forEach(function (item, index) {
  9778. _diff(item, pre[index], path + '[' + index + ']', result);
  9779. });
  9780. }
  9781. }
  9782. } else {
  9783. setResult(result, path, current);
  9784. }
  9785. }
  9786. function setResult(result, k, v) {
  9787. // if (type(v) != FUNCTIONTYPE) {
  9788. result[k] = v;
  9789. // }
  9790. }
  9791. function type(obj) {
  9792. return Object.prototype.toString.call(obj)
  9793. }
  9794. /* */
  9795. function flushCallbacks$1(vm) {
  9796. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  9797. if (Object({"VUE_APP_NAME":"magazine-web","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  9798. var mpInstance = vm.$scope;
  9799. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  9800. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  9801. }
  9802. var copies = vm.__next_tick_callbacks.slice(0);
  9803. vm.__next_tick_callbacks.length = 0;
  9804. for (var i = 0; i < copies.length; i++) {
  9805. copies[i]();
  9806. }
  9807. }
  9808. }
  9809. function hasRenderWatcher(vm) {
  9810. return queue.find(function (watcher) { return vm._watcher === watcher; })
  9811. }
  9812. function nextTick$1(vm, cb) {
  9813. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  9814. //2.nextTick 之前存在 render watcher
  9815. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  9816. if(Object({"VUE_APP_NAME":"magazine-web","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  9817. var mpInstance = vm.$scope;
  9818. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  9819. ']:nextVueTick');
  9820. }
  9821. return nextTick(cb, vm)
  9822. }else{
  9823. if(Object({"VUE_APP_NAME":"magazine-web","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  9824. var mpInstance$1 = vm.$scope;
  9825. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  9826. ']:nextMPTick');
  9827. }
  9828. }
  9829. var _resolve;
  9830. if (!vm.__next_tick_callbacks) {
  9831. vm.__next_tick_callbacks = [];
  9832. }
  9833. vm.__next_tick_callbacks.push(function () {
  9834. if (cb) {
  9835. try {
  9836. cb.call(vm);
  9837. } catch (e) {
  9838. handleError(e, vm, 'nextTick');
  9839. }
  9840. } else if (_resolve) {
  9841. _resolve(vm);
  9842. }
  9843. });
  9844. // $flow-disable-line
  9845. if (!cb && typeof Promise !== 'undefined') {
  9846. return new Promise(function (resolve) {
  9847. _resolve = resolve;
  9848. })
  9849. }
  9850. }
  9851. /* */
  9852. function cloneWithData(vm) {
  9853. // 确保当前 vm 所有数据被同步
  9854. var ret = Object.create(null);
  9855. var dataKeys = [].concat(
  9856. Object.keys(vm._data || {}),
  9857. Object.keys(vm._computedWatchers || {}));
  9858. dataKeys.reduce(function(ret, key) {
  9859. ret[key] = vm[key];
  9860. return ret
  9861. }, ret);
  9862. // vue-composition-api
  9863. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  9864. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  9865. if (rawBindings) {
  9866. Object.keys(rawBindings).forEach(function (key) {
  9867. ret[key] = vm[key];
  9868. });
  9869. }
  9870. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  9871. Object.assign(ret, vm.$mp.data || {});
  9872. if (
  9873. Array.isArray(vm.$options.behaviors) &&
  9874. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  9875. ) { //form-field
  9876. ret['name'] = vm.name;
  9877. ret['value'] = vm.value;
  9878. }
  9879. return JSON.parse(JSON.stringify(ret))
  9880. }
  9881. var patch = function(oldVnode, vnode) {
  9882. var this$1 = this;
  9883. if (vnode === null) { //destroy
  9884. return
  9885. }
  9886. if (this.mpType === 'page' || this.mpType === 'component') {
  9887. var mpInstance = this.$scope;
  9888. var data = Object.create(null);
  9889. try {
  9890. data = cloneWithData(this);
  9891. } catch (err) {
  9892. console.error(err);
  9893. }
  9894. data.__webviewId__ = mpInstance.data.__webviewId__;
  9895. var mpData = Object.create(null);
  9896. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  9897. mpData[key] = mpInstance.data[key];
  9898. });
  9899. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  9900. if (Object.keys(diffData).length) {
  9901. if (Object({"VUE_APP_NAME":"magazine-web","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  9902. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  9903. ']差量更新',
  9904. JSON.stringify(diffData));
  9905. }
  9906. this.__next_tick_pending = true;
  9907. mpInstance.setData(diffData, function () {
  9908. this$1.__next_tick_pending = false;
  9909. flushCallbacks$1(this$1);
  9910. });
  9911. } else {
  9912. flushCallbacks$1(this);
  9913. }
  9914. }
  9915. };
  9916. /* */
  9917. function createEmptyRender() {
  9918. }
  9919. function mountComponent$1(
  9920. vm,
  9921. el,
  9922. hydrating
  9923. ) {
  9924. if (!vm.mpType) {//main.js 中的 new Vue
  9925. return vm
  9926. }
  9927. if (vm.mpType === 'app') {
  9928. vm.$options.render = createEmptyRender;
  9929. }
  9930. if (!vm.$options.render) {
  9931. vm.$options.render = createEmptyRender;
  9932. if (true) {
  9933. /* istanbul ignore if */
  9934. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  9935. vm.$options.el || el) {
  9936. warn(
  9937. 'You are using the runtime-only build of Vue where the template ' +
  9938. 'compiler is not available. Either pre-compile the templates into ' +
  9939. 'render functions, or use the compiler-included build.',
  9940. vm
  9941. );
  9942. } else {
  9943. warn(
  9944. 'Failed to mount component: template or render function not defined.',
  9945. vm
  9946. );
  9947. }
  9948. }
  9949. }
  9950. !vm._$fallback && callHook(vm, 'beforeMount');
  9951. var updateComponent = function () {
  9952. vm._update(vm._render(), hydrating);
  9953. };
  9954. // we set this to vm._watcher inside the watcher's constructor
  9955. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  9956. // component's mounted hook), which relies on vm._watcher being already defined
  9957. new Watcher(vm, updateComponent, noop, {
  9958. before: function before() {
  9959. if (vm._isMounted && !vm._isDestroyed) {
  9960. callHook(vm, 'beforeUpdate');
  9961. }
  9962. }
  9963. }, true /* isRenderWatcher */);
  9964. hydrating = false;
  9965. return vm
  9966. }
  9967. /* */
  9968. function renderClass (
  9969. staticClass,
  9970. dynamicClass
  9971. ) {
  9972. if (isDef(staticClass) || isDef(dynamicClass)) {
  9973. return concat(staticClass, stringifyClass(dynamicClass))
  9974. }
  9975. /* istanbul ignore next */
  9976. return ''
  9977. }
  9978. function concat (a, b) {
  9979. return a ? b ? (a + ' ' + b) : a : (b || '')
  9980. }
  9981. function stringifyClass (value) {
  9982. if (Array.isArray(value)) {
  9983. return stringifyArray(value)
  9984. }
  9985. if (isObject(value)) {
  9986. return stringifyObject(value)
  9987. }
  9988. if (typeof value === 'string') {
  9989. return value
  9990. }
  9991. /* istanbul ignore next */
  9992. return ''
  9993. }
  9994. function stringifyArray (value) {
  9995. var res = '';
  9996. var stringified;
  9997. for (var i = 0, l = value.length; i < l; i++) {
  9998. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  9999. if (res) { res += ' '; }
  10000. res += stringified;
  10001. }
  10002. }
  10003. return res
  10004. }
  10005. function stringifyObject (value) {
  10006. var res = '';
  10007. for (var key in value) {
  10008. if (value[key]) {
  10009. if (res) { res += ' '; }
  10010. res += key;
  10011. }
  10012. }
  10013. return res
  10014. }
  10015. /* */
  10016. var parseStyleText = cached(function (cssText) {
  10017. var res = {};
  10018. var listDelimiter = /;(?![^(]*\))/g;
  10019. var propertyDelimiter = /:(.+)/;
  10020. cssText.split(listDelimiter).forEach(function (item) {
  10021. if (item) {
  10022. var tmp = item.split(propertyDelimiter);
  10023. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  10024. }
  10025. });
  10026. return res
  10027. });
  10028. // normalize possible array / string values into Object
  10029. function normalizeStyleBinding (bindingStyle) {
  10030. if (Array.isArray(bindingStyle)) {
  10031. return toObject(bindingStyle)
  10032. }
  10033. if (typeof bindingStyle === 'string') {
  10034. return parseStyleText(bindingStyle)
  10035. }
  10036. return bindingStyle
  10037. }
  10038. /* */
  10039. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  10040. function getTarget(obj, path) {
  10041. var parts = path.split('.');
  10042. var key = parts[0];
  10043. if (key.indexOf('__$n') === 0) { //number index
  10044. key = parseInt(key.replace('__$n', ''));
  10045. }
  10046. if (parts.length === 1) {
  10047. return obj[key]
  10048. }
  10049. return getTarget(obj[key], parts.slice(1).join('.'))
  10050. }
  10051. function internalMixin(Vue) {
  10052. Vue.config.errorHandler = function(err, vm, info) {
  10053. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  10054. console.error(err);
  10055. /* eslint-disable no-undef */
  10056. var app = typeof getApp === 'function' && getApp();
  10057. if (app && app.onError) {
  10058. app.onError(err);
  10059. }
  10060. };
  10061. var oldEmit = Vue.prototype.$emit;
  10062. Vue.prototype.$emit = function(event) {
  10063. if (this.$scope && event) {
  10064. this.$scope['triggerEvent'](event, {
  10065. __args__: toArray(arguments, 1)
  10066. });
  10067. }
  10068. return oldEmit.apply(this, arguments)
  10069. };
  10070. Vue.prototype.$nextTick = function(fn) {
  10071. return nextTick$1(this, fn)
  10072. };
  10073. MP_METHODS.forEach(function (method) {
  10074. Vue.prototype[method] = function(args) {
  10075. if (this.$scope && this.$scope[method]) {
  10076. return this.$scope[method](args)
  10077. }
  10078. // mp-alipay
  10079. if (typeof my === 'undefined') {
  10080. return
  10081. }
  10082. if (method === 'createSelectorQuery') {
  10083. /* eslint-disable no-undef */
  10084. return my.createSelectorQuery(args)
  10085. } else if (method === 'createIntersectionObserver') {
  10086. /* eslint-disable no-undef */
  10087. return my.createIntersectionObserver(args)
  10088. }
  10089. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  10090. };
  10091. });
  10092. Vue.prototype.__init_provide = initProvide;
  10093. Vue.prototype.__init_injections = initInjections;
  10094. Vue.prototype.__call_hook = function(hook, args) {
  10095. var vm = this;
  10096. // #7573 disable dep collection when invoking lifecycle hooks
  10097. pushTarget();
  10098. var handlers = vm.$options[hook];
  10099. var info = hook + " hook";
  10100. var ret;
  10101. if (handlers) {
  10102. for (var i = 0, j = handlers.length; i < j; i++) {
  10103. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  10104. }
  10105. }
  10106. if (vm._hasHookEvent) {
  10107. vm.$emit('hook:' + hook, args);
  10108. }
  10109. popTarget();
  10110. return ret
  10111. };
  10112. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  10113. if (Array.isArray(modifiers)) {
  10114. if (modifiers.indexOf('trim') !== -1) {
  10115. value = value.trim();
  10116. }
  10117. if (modifiers.indexOf('number') !== -1) {
  10118. value = this._n(value);
  10119. }
  10120. }
  10121. if (!target) {
  10122. target = this;
  10123. }
  10124. // 解决动态属性添加
  10125. Vue.set(target, key, value)
  10126. };
  10127. Vue.prototype.__set_sync = function(target, key, value) {
  10128. if (!target) {
  10129. target = this;
  10130. }
  10131. // 解决动态属性添加
  10132. Vue.set(target, key, value)
  10133. };
  10134. Vue.prototype.__get_orig = function(item) {
  10135. if (isPlainObject(item)) {
  10136. return item['$orig'] || item
  10137. }
  10138. return item
  10139. };
  10140. Vue.prototype.__get_value = function(dataPath, target) {
  10141. return getTarget(target || this, dataPath)
  10142. };
  10143. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  10144. return renderClass(staticClass, dynamicClass)
  10145. };
  10146. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  10147. if (!dynamicStyle && !staticStyle) {
  10148. return ''
  10149. }
  10150. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  10151. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  10152. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  10153. };
  10154. Vue.prototype.__map = function(val, iteratee) {
  10155. //TODO 暂不考虑 string
  10156. var ret, i, l, keys, key;
  10157. if (Array.isArray(val)) {
  10158. ret = new Array(val.length);
  10159. for (i = 0, l = val.length; i < l; i++) {
  10160. ret[i] = iteratee(val[i], i);
  10161. }
  10162. return ret
  10163. } else if (isObject(val)) {
  10164. keys = Object.keys(val);
  10165. ret = Object.create(null);
  10166. for (i = 0, l = keys.length; i < l; i++) {
  10167. key = keys[i];
  10168. ret[key] = iteratee(val[key], key, i);
  10169. }
  10170. return ret
  10171. } else if (typeof val === 'number') {
  10172. ret = new Array(val);
  10173. for (i = 0, l = val; i < l; i++) {
  10174. // 第一个参数暂时仍和小程序一致
  10175. ret[i] = iteratee(i, i);
  10176. }
  10177. return ret
  10178. }
  10179. return []
  10180. };
  10181. }
  10182. /* */
  10183. var LIFECYCLE_HOOKS$1 = [
  10184. //App
  10185. 'onLaunch',
  10186. 'onShow',
  10187. 'onHide',
  10188. 'onUniNViewMessage',
  10189. 'onPageNotFound',
  10190. 'onThemeChange',
  10191. 'onError',
  10192. 'onUnhandledRejection',
  10193. //Page
  10194. 'onInit',
  10195. 'onLoad',
  10196. // 'onShow',
  10197. 'onReady',
  10198. // 'onHide',
  10199. 'onUnload',
  10200. 'onPullDownRefresh',
  10201. 'onReachBottom',
  10202. 'onTabItemTap',
  10203. 'onAddToFavorites',
  10204. 'onShareTimeline',
  10205. 'onShareAppMessage',
  10206. 'onResize',
  10207. 'onPageScroll',
  10208. 'onNavigationBarButtonTap',
  10209. 'onBackPress',
  10210. 'onNavigationBarSearchInputChanged',
  10211. 'onNavigationBarSearchInputConfirmed',
  10212. 'onNavigationBarSearchInputClicked',
  10213. //Component
  10214. // 'onReady', // 兼容旧版本,应该移除该事件
  10215. 'onPageShow',
  10216. 'onPageHide',
  10217. 'onPageResize'
  10218. ];
  10219. function lifecycleMixin$1(Vue) {
  10220. //fixed vue-class-component
  10221. var oldExtend = Vue.extend;
  10222. Vue.extend = function(extendOptions) {
  10223. extendOptions = extendOptions || {};
  10224. var methods = extendOptions.methods;
  10225. if (methods) {
  10226. Object.keys(methods).forEach(function (methodName) {
  10227. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  10228. extendOptions[methodName] = methods[methodName];
  10229. delete methods[methodName];
  10230. }
  10231. });
  10232. }
  10233. return oldExtend.call(this, extendOptions)
  10234. };
  10235. var strategies = Vue.config.optionMergeStrategies;
  10236. var mergeHook = strategies.created;
  10237. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  10238. strategies[hook] = mergeHook;
  10239. });
  10240. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  10241. }
  10242. /* */
  10243. // install platform patch function
  10244. Vue.prototype.__patch__ = patch;
  10245. // public mount method
  10246. Vue.prototype.$mount = function(
  10247. el ,
  10248. hydrating
  10249. ) {
  10250. return mountComponent$1(this, el, hydrating)
  10251. };
  10252. lifecycleMixin$1(Vue);
  10253. internalMixin(Vue);
  10254. /* */
  10255. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  10256. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 2)))
  10257. /***/ }),
  10258. /***/ 4:
  10259. /*!*************************************************************!*\
  10260. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  10261. \*************************************************************/
  10262. /*! no static exports found */
  10263. /***/ (function(module, exports, __webpack_require__) {
  10264. "use strict";
  10265. /* WEBPACK VAR INJECTION */(function(uni, global) {Object.defineProperty(exports, "__esModule", { value: true });exports.compileI18nJsonStr = compileI18nJsonStr;exports.hasI18nJson = hasI18nJson;exports.initVueI18n = initVueI18n;exports.isI18nStr = isI18nStr;exports.normalizeLocale = normalizeLocale;exports.parseI18nJson = parseI18nJson;exports.resolveLocale = resolveLocale;exports.isString = exports.LOCALE_ZH_HANT = exports.LOCALE_ZH_HANS = exports.LOCALE_FR = exports.LOCALE_ES = exports.LOCALE_EN = exports.I18n = exports.Formatter = void 0;function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;}function _iterableToArrayLimit(arr, i) {if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"] != null) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;}var isArray = Array.isArray;
  10266. var isObject = function isObject(val) {return val !== null && typeof val === 'object';};
  10267. var defaultDelimiters = ['{', '}'];var
  10268. BaseFormatter = /*#__PURE__*/function () {
  10269. function BaseFormatter() {_classCallCheck(this, BaseFormatter);
  10270. this._caches = Object.create(null);
  10271. }_createClass(BaseFormatter, [{ key: "interpolate", value: function interpolate(
  10272. message, values) {var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  10273. if (!values) {
  10274. return [message];
  10275. }
  10276. var tokens = this._caches[message];
  10277. if (!tokens) {
  10278. tokens = parse(message, delimiters);
  10279. this._caches[message] = tokens;
  10280. }
  10281. return compile(tokens, values);
  10282. } }]);return BaseFormatter;}();exports.Formatter = BaseFormatter;
  10283. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  10284. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  10285. function parse(format, _ref) {var _ref2 = _slicedToArray(_ref, 2),startDelimiter = _ref2[0],endDelimiter = _ref2[1];
  10286. var tokens = [];
  10287. var position = 0;
  10288. var text = '';
  10289. while (position < format.length) {
  10290. var char = format[position++];
  10291. if (char === startDelimiter) {
  10292. if (text) {
  10293. tokens.push({ type: 'text', value: text });
  10294. }
  10295. text = '';
  10296. var sub = '';
  10297. char = format[position++];
  10298. while (char !== undefined && char !== endDelimiter) {
  10299. sub += char;
  10300. char = format[position++];
  10301. }
  10302. var isClosed = char === endDelimiter;
  10303. var type = RE_TOKEN_LIST_VALUE.test(sub) ?
  10304. 'list' :
  10305. isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ?
  10306. 'named' :
  10307. 'unknown';
  10308. tokens.push({ value: sub, type: type });
  10309. }
  10310. // else if (char === '%') {
  10311. // // when found rails i18n syntax, skip text capture
  10312. // if (format[position] !== '{') {
  10313. // text += char
  10314. // }
  10315. // }
  10316. else {
  10317. text += char;
  10318. }
  10319. }
  10320. text && tokens.push({ type: 'text', value: text });
  10321. return tokens;
  10322. }
  10323. function compile(tokens, values) {
  10324. var compiled = [];
  10325. var index = 0;
  10326. var mode = isArray(values) ?
  10327. 'list' :
  10328. isObject(values) ?
  10329. 'named' :
  10330. 'unknown';
  10331. if (mode === 'unknown') {
  10332. return compiled;
  10333. }
  10334. while (index < tokens.length) {
  10335. var token = tokens[index];
  10336. switch (token.type) {
  10337. case 'text':
  10338. compiled.push(token.value);
  10339. break;
  10340. case 'list':
  10341. compiled.push(values[parseInt(token.value, 10)]);
  10342. break;
  10343. case 'named':
  10344. if (mode === 'named') {
  10345. compiled.push(values[token.value]);
  10346. } else
  10347. {
  10348. if (true) {
  10349. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  10350. }
  10351. }
  10352. break;
  10353. case 'unknown':
  10354. if (true) {
  10355. console.warn("Detect 'unknown' type of token!");
  10356. }
  10357. break;}
  10358. index++;
  10359. }
  10360. return compiled;
  10361. }
  10362. var LOCALE_ZH_HANS = 'zh-Hans';exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  10363. var LOCALE_ZH_HANT = 'zh-Hant';exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  10364. var LOCALE_EN = 'en';exports.LOCALE_EN = LOCALE_EN;
  10365. var LOCALE_FR = 'fr';exports.LOCALE_FR = LOCALE_FR;
  10366. var LOCALE_ES = 'es';exports.LOCALE_ES = LOCALE_ES;
  10367. var hasOwnProperty = Object.prototype.hasOwnProperty;
  10368. var hasOwn = function hasOwn(val, key) {return hasOwnProperty.call(val, key);};
  10369. var defaultFormatter = new BaseFormatter();
  10370. function include(str, parts) {
  10371. return !!parts.find(function (part) {return str.indexOf(part) !== -1;});
  10372. }
  10373. function startsWith(str, parts) {
  10374. return parts.find(function (part) {return str.indexOf(part) === 0;});
  10375. }
  10376. function normalizeLocale(locale, messages) {
  10377. if (!locale) {
  10378. return;
  10379. }
  10380. locale = locale.trim().replace(/_/g, '-');
  10381. if (messages && messages[locale]) {
  10382. return locale;
  10383. }
  10384. locale = locale.toLowerCase();
  10385. if (locale.indexOf('zh') === 0) {
  10386. if (locale.indexOf('-hans') > -1) {
  10387. return LOCALE_ZH_HANS;
  10388. }
  10389. if (locale.indexOf('-hant') > -1) {
  10390. return LOCALE_ZH_HANT;
  10391. }
  10392. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  10393. return LOCALE_ZH_HANT;
  10394. }
  10395. return LOCALE_ZH_HANS;
  10396. }
  10397. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  10398. if (lang) {
  10399. return lang;
  10400. }
  10401. }var
  10402. I18n = /*#__PURE__*/function () {
  10403. function I18n(_ref3) {var locale = _ref3.locale,fallbackLocale = _ref3.fallbackLocale,messages = _ref3.messages,watcher = _ref3.watcher,formater = _ref3.formater;_classCallCheck(this, I18n);
  10404. this.locale = LOCALE_EN;
  10405. this.fallbackLocale = LOCALE_EN;
  10406. this.message = {};
  10407. this.messages = {};
  10408. this.watchers = [];
  10409. if (fallbackLocale) {
  10410. this.fallbackLocale = fallbackLocale;
  10411. }
  10412. this.formater = formater || defaultFormatter;
  10413. this.messages = messages || {};
  10414. this.setLocale(locale || LOCALE_EN);
  10415. if (watcher) {
  10416. this.watchLocale(watcher);
  10417. }
  10418. }_createClass(I18n, [{ key: "setLocale", value: function setLocale(
  10419. locale) {var _this = this;
  10420. var oldLocale = this.locale;
  10421. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  10422. if (!this.messages[this.locale]) {
  10423. // 可能初始化时不存在
  10424. this.messages[this.locale] = {};
  10425. }
  10426. this.message = this.messages[this.locale];
  10427. // 仅发生变化时,通知
  10428. if (oldLocale !== this.locale) {
  10429. this.watchers.forEach(function (watcher) {
  10430. watcher(_this.locale, oldLocale);
  10431. });
  10432. }
  10433. } }, { key: "getLocale", value: function getLocale()
  10434. {
  10435. return this.locale;
  10436. } }, { key: "watchLocale", value: function watchLocale(
  10437. fn) {var _this2 = this;
  10438. var index = this.watchers.push(fn) - 1;
  10439. return function () {
  10440. _this2.watchers.splice(index, 1);
  10441. };
  10442. } }, { key: "add", value: function add(
  10443. locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  10444. var curMessages = this.messages[locale];
  10445. if (curMessages) {
  10446. if (override) {
  10447. Object.assign(curMessages, message);
  10448. } else
  10449. {
  10450. Object.keys(message).forEach(function (key) {
  10451. if (!hasOwn(curMessages, key)) {
  10452. curMessages[key] = message[key];
  10453. }
  10454. });
  10455. }
  10456. } else
  10457. {
  10458. this.messages[locale] = message;
  10459. }
  10460. } }, { key: "f", value: function f(
  10461. message, values, delimiters) {
  10462. return this.formater.interpolate(message, values, delimiters).join('');
  10463. } }, { key: "t", value: function t(
  10464. key, locale, values) {
  10465. var message = this.message;
  10466. if (typeof locale === 'string') {
  10467. locale = normalizeLocale(locale, this.messages);
  10468. locale && (message = this.messages[locale]);
  10469. } else
  10470. {
  10471. values = locale;
  10472. }
  10473. if (!hasOwn(message, key)) {
  10474. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  10475. return key;
  10476. }
  10477. return this.formater.interpolate(message[key], values).join('');
  10478. } }]);return I18n;}();exports.I18n = I18n;
  10479. function watchAppLocale(appVm, i18n) {
  10480. // 需要保证 watch 的触发在组件渲染之前
  10481. if (appVm.$watchLocale) {
  10482. // vue2
  10483. appVm.$watchLocale(function (newLocale) {
  10484. i18n.setLocale(newLocale);
  10485. });
  10486. } else
  10487. {
  10488. appVm.$watch(function () {return appVm.$locale;}, function (newLocale) {
  10489. i18n.setLocale(newLocale);
  10490. });
  10491. }
  10492. }
  10493. function getDefaultLocale() {
  10494. if (typeof uni !== 'undefined' && uni.getLocale) {
  10495. return uni.getLocale();
  10496. }
  10497. // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
  10498. if (typeof global !== 'undefined' && global.getLocale) {
  10499. return global.getLocale();
  10500. }
  10501. return LOCALE_EN;
  10502. }
  10503. function initVueI18n(locale) {var messages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var fallbackLocale = arguments.length > 2 ? arguments[2] : undefined;var watcher = arguments.length > 3 ? arguments[3] : undefined;
  10504. // 兼容旧版本入参
  10505. if (typeof locale !== 'string') {var _ref4 =
  10506. [
  10507. messages,
  10508. locale];locale = _ref4[0];messages = _ref4[1];
  10509. }
  10510. if (typeof locale !== 'string') {
  10511. // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
  10512. locale = getDefaultLocale();
  10513. }
  10514. if (typeof fallbackLocale !== 'string') {
  10515. fallbackLocale =
  10516. typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale ||
  10517. LOCALE_EN;
  10518. }
  10519. var i18n = new I18n({
  10520. locale: locale,
  10521. fallbackLocale: fallbackLocale,
  10522. messages: messages,
  10523. watcher: watcher });
  10524. var _t = function t(key, values) {
  10525. if (typeof getApp !== 'function') {
  10526. // app view
  10527. /* eslint-disable no-func-assign */
  10528. _t = function t(key, values) {
  10529. return i18n.t(key, values);
  10530. };
  10531. } else
  10532. {
  10533. var isWatchedAppLocale = false;
  10534. _t = function t(key, values) {
  10535. var appVm = getApp().$vm;
  10536. // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
  10537. // options: {
  10538. // type: Array,
  10539. // default () {
  10540. // return [{
  10541. // icon: 'shop',
  10542. // text: t("uni-goods-nav.options.shop"),
  10543. // }, {
  10544. // icon: 'cart',
  10545. // text: t("uni-goods-nav.options.cart")
  10546. // }]
  10547. // }
  10548. // },
  10549. if (appVm) {
  10550. // 触发响应式
  10551. appVm.$locale;
  10552. if (!isWatchedAppLocale) {
  10553. isWatchedAppLocale = true;
  10554. watchAppLocale(appVm, i18n);
  10555. }
  10556. }
  10557. return i18n.t(key, values);
  10558. };
  10559. }
  10560. return _t(key, values);
  10561. };
  10562. return {
  10563. i18n: i18n,
  10564. f: function f(message, values, delimiters) {
  10565. return i18n.f(message, values, delimiters);
  10566. },
  10567. t: function t(key, values) {
  10568. return _t(key, values);
  10569. },
  10570. add: function add(locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  10571. return i18n.add(locale, message, override);
  10572. },
  10573. watch: function watch(fn) {
  10574. return i18n.watchLocale(fn);
  10575. },
  10576. getLocale: function getLocale() {
  10577. return i18n.getLocale();
  10578. },
  10579. setLocale: function setLocale(newLocale) {
  10580. return i18n.setLocale(newLocale);
  10581. } };
  10582. }
  10583. var isString = function isString(val) {return typeof val === 'string';};exports.isString = isString;
  10584. var formater;
  10585. function hasI18nJson(jsonObj, delimiters) {
  10586. if (!formater) {
  10587. formater = new BaseFormatter();
  10588. }
  10589. return walkJsonObj(jsonObj, function (jsonObj, key) {
  10590. var value = jsonObj[key];
  10591. if (isString(value)) {
  10592. if (isI18nStr(value, delimiters)) {
  10593. return true;
  10594. }
  10595. } else
  10596. {
  10597. return hasI18nJson(value, delimiters);
  10598. }
  10599. });
  10600. }
  10601. function parseI18nJson(jsonObj, values, delimiters) {
  10602. if (!formater) {
  10603. formater = new BaseFormatter();
  10604. }
  10605. walkJsonObj(jsonObj, function (jsonObj, key) {
  10606. var value = jsonObj[key];
  10607. if (isString(value)) {
  10608. if (isI18nStr(value, delimiters)) {
  10609. jsonObj[key] = compileStr(value, values, delimiters);
  10610. }
  10611. } else
  10612. {
  10613. parseI18nJson(value, values, delimiters);
  10614. }
  10615. });
  10616. return jsonObj;
  10617. }
  10618. function compileI18nJsonStr(jsonStr, _ref5) {var locale = _ref5.locale,locales = _ref5.locales,delimiters = _ref5.delimiters;
  10619. if (!isI18nStr(jsonStr, delimiters)) {
  10620. return jsonStr;
  10621. }
  10622. if (!formater) {
  10623. formater = new BaseFormatter();
  10624. }
  10625. var localeValues = [];
  10626. Object.keys(locales).forEach(function (name) {
  10627. if (name !== locale) {
  10628. localeValues.push({
  10629. locale: name,
  10630. values: locales[name] });
  10631. }
  10632. });
  10633. localeValues.unshift({ locale: locale, values: locales[locale] });
  10634. try {
  10635. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  10636. }
  10637. catch (e) {}
  10638. return jsonStr;
  10639. }
  10640. function isI18nStr(value, delimiters) {
  10641. return value.indexOf(delimiters[0]) > -1;
  10642. }
  10643. function compileStr(value, values, delimiters) {
  10644. return formater.interpolate(value, values, delimiters).join('');
  10645. }
  10646. function compileValue(jsonObj, key, localeValues, delimiters) {
  10647. var value = jsonObj[key];
  10648. if (isString(value)) {
  10649. // 存在国际化
  10650. if (isI18nStr(value, delimiters)) {
  10651. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  10652. if (localeValues.length > 1) {
  10653. // 格式化国际化语言
  10654. var valueLocales = jsonObj[key + 'Locales'] = {};
  10655. localeValues.forEach(function (localValue) {
  10656. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  10657. });
  10658. }
  10659. }
  10660. } else
  10661. {
  10662. compileJsonObj(value, localeValues, delimiters);
  10663. }
  10664. }
  10665. function compileJsonObj(jsonObj, localeValues, delimiters) {
  10666. walkJsonObj(jsonObj, function (jsonObj, key) {
  10667. compileValue(jsonObj, key, localeValues, delimiters);
  10668. });
  10669. return jsonObj;
  10670. }
  10671. function walkJsonObj(jsonObj, walk) {
  10672. if (isArray(jsonObj)) {
  10673. for (var i = 0; i < jsonObj.length; i++) {
  10674. if (walk(jsonObj, i)) {
  10675. return true;
  10676. }
  10677. }
  10678. } else
  10679. if (isObject(jsonObj)) {
  10680. for (var key in jsonObj) {
  10681. if (walk(jsonObj, key)) {
  10682. return true;
  10683. }
  10684. }
  10685. }
  10686. return false;
  10687. }
  10688. function resolveLocale(locales) {
  10689. return function (locale) {
  10690. if (!locale) {
  10691. return locale;
  10692. }
  10693. locale = normalizeLocale(locale) || locale;
  10694. return resolveLocaleChain(locale).find(function (locale) {return locales.indexOf(locale) > -1;});
  10695. };
  10696. }
  10697. function resolveLocaleChain(locale) {
  10698. var chain = [];
  10699. var tokens = locale.split('-');
  10700. while (tokens.length) {
  10701. chain.push(tokens.join('-'));
  10702. tokens.pop();
  10703. }
  10704. return chain;
  10705. }
  10706. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"], __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 2)))
  10707. /***/ }),
  10708. /***/ 5:
  10709. /*!******************************************************************!*\
  10710. !*** C:/Users/10428/Desktop/框架源码/微前端/代码/magazine-web/pages.json ***!
  10711. \******************************************************************/
  10712. /*! no static exports found */
  10713. /***/ (function(module, exports) {
  10714. /***/ })
  10715. }]);
  10716. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map