vendor.js 248 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325
  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. Object.defineProperty(exports, "__esModule", { value: true });exports.createApp = createApp;exports.createComponent = createComponent;exports.createPage = createPage;exports.default = void 0;var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 2));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function 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 _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 _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;}
  10. var _toString = Object.prototype.toString;
  11. var hasOwnProperty = Object.prototype.hasOwnProperty;
  12. function isFn(fn) {
  13. return typeof fn === 'function';
  14. }
  15. function isStr(str) {
  16. return typeof str === 'string';
  17. }
  18. function isPlainObject(obj) {
  19. return _toString.call(obj) === '[object Object]';
  20. }
  21. function hasOwn(obj, key) {
  22. return hasOwnProperty.call(obj, key);
  23. }
  24. function noop() {}
  25. /**
  26. * Create a cached version of a pure function.
  27. */
  28. function cached(fn) {
  29. var cache = Object.create(null);
  30. return function cachedFn(str) {
  31. var hit = cache[str];
  32. return hit || (cache[str] = fn(str));
  33. };
  34. }
  35. /**
  36. * Camelize a hyphen-delimited string.
  37. */
  38. var camelizeRE = /-(\w)/g;
  39. var camelize = cached(function (str) {
  40. return str.replace(camelizeRE, function (_, c) {return c ? c.toUpperCase() : '';});
  41. });
  42. var HOOKS = [
  43. 'invoke',
  44. 'success',
  45. 'fail',
  46. 'complete',
  47. 'returnValue'];
  48. var globalInterceptors = {};
  49. var scopedInterceptors = {};
  50. function mergeHook(parentVal, childVal) {
  51. var res = childVal ?
  52. parentVal ?
  53. parentVal.concat(childVal) :
  54. Array.isArray(childVal) ?
  55. childVal : [childVal] :
  56. parentVal;
  57. return res ?
  58. dedupeHooks(res) :
  59. res;
  60. }
  61. function dedupeHooks(hooks) {
  62. var res = [];
  63. for (var i = 0; i < hooks.length; i++) {
  64. if (res.indexOf(hooks[i]) === -1) {
  65. res.push(hooks[i]);
  66. }
  67. }
  68. return res;
  69. }
  70. function removeHook(hooks, hook) {
  71. var index = hooks.indexOf(hook);
  72. if (index !== -1) {
  73. hooks.splice(index, 1);
  74. }
  75. }
  76. function mergeInterceptorHook(interceptor, option) {
  77. Object.keys(option).forEach(function (hook) {
  78. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  79. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  80. }
  81. });
  82. }
  83. function removeInterceptorHook(interceptor, option) {
  84. if (!interceptor || !option) {
  85. return;
  86. }
  87. Object.keys(option).forEach(function (hook) {
  88. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  89. removeHook(interceptor[hook], option[hook]);
  90. }
  91. });
  92. }
  93. function addInterceptor(method, option) {
  94. if (typeof method === 'string' && isPlainObject(option)) {
  95. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  96. } else if (isPlainObject(method)) {
  97. mergeInterceptorHook(globalInterceptors, method);
  98. }
  99. }
  100. function removeInterceptor(method, option) {
  101. if (typeof method === 'string') {
  102. if (isPlainObject(option)) {
  103. removeInterceptorHook(scopedInterceptors[method], option);
  104. } else {
  105. delete scopedInterceptors[method];
  106. }
  107. } else if (isPlainObject(method)) {
  108. removeInterceptorHook(globalInterceptors, method);
  109. }
  110. }
  111. function wrapperHook(hook) {
  112. return function (data) {
  113. return hook(data) || data;
  114. };
  115. }
  116. function isPromise(obj) {
  117. return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  118. }
  119. function queue(hooks, data) {
  120. var promise = false;
  121. for (var i = 0; i < hooks.length; i++) {
  122. var hook = hooks[i];
  123. if (promise) {
  124. promise = Promise.resolve(wrapperHook(hook));
  125. } else {
  126. var res = hook(data);
  127. if (isPromise(res)) {
  128. promise = Promise.resolve(res);
  129. }
  130. if (res === false) {
  131. return {
  132. then: function then() {} };
  133. }
  134. }
  135. }
  136. return promise || {
  137. then: function then(callback) {
  138. return callback(data);
  139. } };
  140. }
  141. function wrapperOptions(interceptor) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  142. ['success', 'fail', 'complete'].forEach(function (name) {
  143. if (Array.isArray(interceptor[name])) {
  144. var oldCallback = options[name];
  145. options[name] = function callbackInterceptor(res) {
  146. queue(interceptor[name], res).then(function (res) {
  147. /* eslint-disable no-mixed-operators */
  148. return isFn(oldCallback) && oldCallback(res) || res;
  149. });
  150. };
  151. }
  152. });
  153. return options;
  154. }
  155. function wrapperReturnValue(method, returnValue) {
  156. var returnValueHooks = [];
  157. if (Array.isArray(globalInterceptors.returnValue)) {
  158. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(globalInterceptors.returnValue));
  159. }
  160. var interceptor = scopedInterceptors[method];
  161. if (interceptor && Array.isArray(interceptor.returnValue)) {
  162. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(interceptor.returnValue));
  163. }
  164. returnValueHooks.forEach(function (hook) {
  165. returnValue = hook(returnValue) || returnValue;
  166. });
  167. return returnValue;
  168. }
  169. function getApiInterceptorHooks(method) {
  170. var interceptor = Object.create(null);
  171. Object.keys(globalInterceptors).forEach(function (hook) {
  172. if (hook !== 'returnValue') {
  173. interceptor[hook] = globalInterceptors[hook].slice();
  174. }
  175. });
  176. var scopedInterceptor = scopedInterceptors[method];
  177. if (scopedInterceptor) {
  178. Object.keys(scopedInterceptor).forEach(function (hook) {
  179. if (hook !== 'returnValue') {
  180. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  181. }
  182. });
  183. }
  184. return interceptor;
  185. }
  186. 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];}
  187. var interceptor = getApiInterceptorHooks(method);
  188. if (interceptor && Object.keys(interceptor).length) {
  189. if (Array.isArray(interceptor.invoke)) {
  190. var res = queue(interceptor.invoke, options);
  191. return res.then(function (options) {
  192. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  193. });
  194. } else {
  195. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  196. }
  197. }
  198. return api.apply(void 0, [options].concat(params));
  199. }
  200. var promiseInterceptor = {
  201. returnValue: function returnValue(res) {
  202. if (!isPromise(res)) {
  203. return res;
  204. }
  205. return res.then(function (res) {
  206. return res[1];
  207. }).catch(function (res) {
  208. return res[0];
  209. });
  210. } };
  211. var SYNC_API_RE =
  212. /^\$|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/;
  213. var CONTEXT_API_RE = /^create|Manager$/;
  214. // Context例外情况
  215. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  216. // 同步例外情况
  217. var ASYNC_API = ['createBLEConnection'];
  218. var CALLBACK_API_RE = /^on|^off/;
  219. function isContextApi(name) {
  220. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  221. }
  222. function isSyncApi(name) {
  223. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  224. }
  225. function isCallbackApi(name) {
  226. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  227. }
  228. function handlePromise(promise) {
  229. return promise.then(function (data) {
  230. return [null, data];
  231. }).
  232. catch(function (err) {return [err];});
  233. }
  234. function shouldPromise(name) {
  235. if (
  236. isContextApi(name) ||
  237. isSyncApi(name) ||
  238. isCallbackApi(name))
  239. {
  240. return false;
  241. }
  242. return true;
  243. }
  244. /* eslint-disable no-extend-native */
  245. if (!Promise.prototype.finally) {
  246. Promise.prototype.finally = function (callback) {
  247. var promise = this.constructor;
  248. return this.then(
  249. function (value) {return promise.resolve(callback()).then(function () {return value;});},
  250. function (reason) {return promise.resolve(callback()).then(function () {
  251. throw reason;
  252. });});
  253. };
  254. }
  255. function promisify(name, api) {
  256. if (!shouldPromise(name)) {
  257. return api;
  258. }
  259. 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];}
  260. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  261. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  262. }
  263. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  264. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  265. success: resolve,
  266. fail: reject })].concat(
  267. params));
  268. })));
  269. };
  270. }
  271. var EPS = 1e-4;
  272. var BASE_DEVICE_WIDTH = 750;
  273. var isIOS = false;
  274. var deviceWidth = 0;
  275. var deviceDPR = 0;
  276. function checkDeviceWidth() {var _wx$getSystemInfoSync =
  277. wx.getSystemInfoSync(),platform = _wx$getSystemInfoSync.platform,pixelRatio = _wx$getSystemInfoSync.pixelRatio,windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  278. deviceWidth = windowWidth;
  279. deviceDPR = pixelRatio;
  280. isIOS = platform === 'ios';
  281. }
  282. function upx2px(number, newDeviceWidth) {
  283. if (deviceWidth === 0) {
  284. checkDeviceWidth();
  285. }
  286. number = Number(number);
  287. if (number === 0) {
  288. return 0;
  289. }
  290. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  291. if (result < 0) {
  292. result = -result;
  293. }
  294. result = Math.floor(result + EPS);
  295. if (result === 0) {
  296. if (deviceDPR === 1 || !isIOS) {
  297. result = 1;
  298. } else {
  299. result = 0.5;
  300. }
  301. }
  302. return number < 0 ? -result : result;
  303. }
  304. var interceptors = {
  305. promiseInterceptor: promiseInterceptor };
  306. var baseApi = /*#__PURE__*/Object.freeze({
  307. __proto__: null,
  308. upx2px: upx2px,
  309. addInterceptor: addInterceptor,
  310. removeInterceptor: removeInterceptor,
  311. interceptors: interceptors });var
  312. EventChannel = /*#__PURE__*/function () {
  313. function EventChannel(id, events) {var _this = this;_classCallCheck(this, EventChannel);
  314. this.id = id;
  315. this.listener = {};
  316. this.emitCache = {};
  317. if (events) {
  318. Object.keys(events).forEach(function (name) {
  319. _this.on(name, events[name]);
  320. });
  321. }
  322. }_createClass(EventChannel, [{ key: "emit", value: function emit(
  323. eventName) {for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {args[_key3 - 1] = arguments[_key3];}
  324. var fns = this.listener[eventName];
  325. if (!fns) {
  326. return (this.emitCache[eventName] || (this.emitCache[eventName] = [])).push(args);
  327. }
  328. fns.forEach(function (opt) {
  329. opt.fn.apply(opt.fn, args);
  330. });
  331. this.listener[eventName] = fns.filter(function (opt) {return opt.type !== 'once';});
  332. } }, { key: "on", value: function on(
  333. eventName, fn) {
  334. this._addListener(eventName, 'on', fn);
  335. this._clearCache(eventName);
  336. } }, { key: "once", value: function once(
  337. eventName, fn) {
  338. this._addListener(eventName, 'once', fn);
  339. this._clearCache(eventName);
  340. } }, { key: "off", value: function off(
  341. eventName, fn) {
  342. var fns = this.listener[eventName];
  343. if (!fns) {
  344. return;
  345. }
  346. if (fn) {
  347. for (var i = 0; i < fns.length;) {
  348. if (fns[i].fn === fn) {
  349. fns.splice(i, 1);
  350. i--;
  351. }
  352. i++;
  353. }
  354. } else {
  355. delete this.listener[eventName];
  356. }
  357. } }, { key: "_clearCache", value: function _clearCache(
  358. eventName) {
  359. var cacheArgs = this.emitCache[eventName];
  360. if (cacheArgs) {
  361. for (; cacheArgs.length > 0;) {
  362. this.emit.apply(this, [eventName].concat(cacheArgs.shift()));
  363. }
  364. }
  365. } }, { key: "_addListener", value: function _addListener(
  366. eventName, type, fn) {
  367. (this.listener[eventName] || (this.listener[eventName] = [])).push({
  368. fn: fn,
  369. type: type });
  370. } }]);return EventChannel;}();
  371. var eventChannels = {};
  372. var eventChannelStack = [];
  373. var id = 0;
  374. function initEventChannel(events) {var cache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  375. id++;
  376. var eventChannel = new EventChannel(id, events);
  377. if (cache) {
  378. eventChannels[id] = eventChannel;
  379. eventChannelStack.push(eventChannel);
  380. }
  381. return eventChannel;
  382. }
  383. function getEventChannel(id) {
  384. if (id) {
  385. var eventChannel = eventChannels[id];
  386. delete eventChannels[id];
  387. return eventChannel;
  388. }
  389. return eventChannelStack.shift();
  390. }
  391. var navigateTo = {
  392. args: function args(fromArgs, toArgs) {
  393. var id = initEventChannel(fromArgs.events).id;
  394. if (fromArgs.url) {
  395. fromArgs.url = fromArgs.url + (fromArgs.url.indexOf('?') === -1 ? '?' : '&') + '__id__=' + id;
  396. }
  397. },
  398. returnValue: function returnValue(fromRes, toRes) {
  399. fromRes.eventChannel = getEventChannel();
  400. } };
  401. function findExistsPageIndex(url) {
  402. var pages = getCurrentPages();
  403. var len = pages.length;
  404. while (len--) {
  405. var page = pages[len];
  406. if (page.$page && page.$page.fullPath === url) {
  407. return len;
  408. }
  409. }
  410. return -1;
  411. }
  412. var redirectTo = {
  413. name: function name(fromArgs) {
  414. if (fromArgs.exists === 'back' && fromArgs.delta) {
  415. return 'navigateBack';
  416. }
  417. return 'redirectTo';
  418. },
  419. args: function args(fromArgs) {
  420. if (fromArgs.exists === 'back' && fromArgs.url) {
  421. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  422. if (existsPageIndex !== -1) {
  423. var delta = getCurrentPages().length - 1 - existsPageIndex;
  424. if (delta > 0) {
  425. fromArgs.delta = delta;
  426. }
  427. }
  428. }
  429. } };
  430. var previewImage = {
  431. args: function args(fromArgs) {
  432. var currentIndex = parseInt(fromArgs.current);
  433. if (isNaN(currentIndex)) {
  434. return;
  435. }
  436. var urls = fromArgs.urls;
  437. if (!Array.isArray(urls)) {
  438. return;
  439. }
  440. var len = urls.length;
  441. if (!len) {
  442. return;
  443. }
  444. if (currentIndex < 0) {
  445. currentIndex = 0;
  446. } else if (currentIndex >= len) {
  447. currentIndex = len - 1;
  448. }
  449. if (currentIndex > 0) {
  450. fromArgs.current = urls[currentIndex];
  451. fromArgs.urls = urls.filter(
  452. function (item, index) {return index < currentIndex ? item !== urls[currentIndex] : true;});
  453. } else {
  454. fromArgs.current = urls[0];
  455. }
  456. return {
  457. indicator: false,
  458. loop: false };
  459. } };
  460. function addSafeAreaInsets(result) {
  461. if (result.safeArea) {
  462. var safeArea = result.safeArea;
  463. result.safeAreaInsets = {
  464. top: safeArea.top,
  465. left: safeArea.left,
  466. right: result.windowWidth - safeArea.right,
  467. bottom: result.windowHeight - safeArea.bottom };
  468. }
  469. }
  470. var protocols = {
  471. redirectTo: redirectTo,
  472. navigateTo: navigateTo,
  473. previewImage: previewImage,
  474. getSystemInfo: {
  475. returnValue: addSafeAreaInsets },
  476. getSystemInfoSync: {
  477. returnValue: addSafeAreaInsets } };
  478. var todos = [
  479. 'vibrate',
  480. 'preloadPage',
  481. 'unPreloadPage',
  482. 'loadSubPackage'];
  483. var canIUses = [];
  484. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  485. function processCallback(methodName, method, returnValue) {
  486. return function (res) {
  487. return method(processReturnValue(methodName, res, returnValue));
  488. };
  489. }
  490. 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;
  491. if (isPlainObject(fromArgs)) {// 一般 api 的参数解析
  492. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  493. if (isFn(argsOption)) {
  494. argsOption = argsOption(fromArgs, toArgs) || {};
  495. }
  496. for (var key in fromArgs) {
  497. if (hasOwn(argsOption, key)) {
  498. var keyOption = argsOption[key];
  499. if (isFn(keyOption)) {
  500. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  501. }
  502. if (!keyOption) {// 不支持的参数
  503. console.warn("\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F ".concat(methodName, "\u6682\u4E0D\u652F\u6301").concat(key));
  504. } else if (isStr(keyOption)) {// 重写参数 key
  505. toArgs[keyOption] = fromArgs[key];
  506. } else if (isPlainObject(keyOption)) {// {name:newName,value:value}可重新指定参数 key:value
  507. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  508. }
  509. } else if (CALLBACKS.indexOf(key) !== -1) {
  510. if (isFn(fromArgs[key])) {
  511. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  512. }
  513. } else {
  514. if (!keepFromArgs) {
  515. toArgs[key] = fromArgs[key];
  516. }
  517. }
  518. }
  519. return toArgs;
  520. } else if (isFn(fromArgs)) {
  521. fromArgs = processCallback(methodName, fromArgs, returnValue);
  522. }
  523. return fromArgs;
  524. }
  525. function processReturnValue(methodName, res, returnValue) {var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  526. if (isFn(protocols.returnValue)) {// 处理通用 returnValue
  527. res = protocols.returnValue(methodName, res);
  528. }
  529. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  530. }
  531. function wrapper(methodName, method) {
  532. if (hasOwn(protocols, methodName)) {
  533. var protocol = protocols[methodName];
  534. if (!protocol) {// 暂不支持的 api
  535. return function () {
  536. console.error("\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F \u6682\u4E0D\u652F\u6301".concat(methodName));
  537. };
  538. }
  539. return function (arg1, arg2) {// 目前 api 最多两个参数
  540. var options = protocol;
  541. if (isFn(protocol)) {
  542. options = protocol(arg1);
  543. }
  544. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  545. var args = [arg1];
  546. if (typeof arg2 !== 'undefined') {
  547. args.push(arg2);
  548. }
  549. if (isFn(options.name)) {
  550. methodName = options.name(arg1);
  551. } else if (isStr(options.name)) {
  552. methodName = options.name;
  553. }
  554. var returnValue = wx[methodName].apply(wx, args);
  555. if (isSyncApi(methodName)) {// 同步 api
  556. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  557. }
  558. return returnValue;
  559. };
  560. }
  561. return method;
  562. }
  563. var todoApis = Object.create(null);
  564. var TODOS = [
  565. 'onTabBarMidButtonTap',
  566. 'subscribePush',
  567. 'unsubscribePush',
  568. 'onPush',
  569. 'offPush',
  570. 'share'];
  571. function createTodoApi(name) {
  572. return function todoApi(_ref)
  573. {var fail = _ref.fail,complete = _ref.complete;
  574. var res = {
  575. errMsg: "".concat(name, ":fail:\u6682\u4E0D\u652F\u6301 ").concat(name, " \u65B9\u6CD5") };
  576. isFn(fail) && fail(res);
  577. isFn(complete) && complete(res);
  578. };
  579. }
  580. TODOS.forEach(function (name) {
  581. todoApis[name] = createTodoApi(name);
  582. });
  583. var providers = {
  584. oauth: ['weixin'],
  585. share: ['weixin'],
  586. payment: ['wxpay'],
  587. push: ['weixin'] };
  588. function getProvider(_ref2)
  589. {var service = _ref2.service,success = _ref2.success,fail = _ref2.fail,complete = _ref2.complete;
  590. var res = false;
  591. if (providers[service]) {
  592. res = {
  593. errMsg: 'getProvider:ok',
  594. service: service,
  595. provider: providers[service] };
  596. isFn(success) && success(res);
  597. } else {
  598. res = {
  599. errMsg: 'getProvider:fail:服务[' + service + ']不存在' };
  600. isFn(fail) && fail(res);
  601. }
  602. isFn(complete) && complete(res);
  603. }
  604. var extraApi = /*#__PURE__*/Object.freeze({
  605. __proto__: null,
  606. getProvider: getProvider });
  607. var getEmitter = function () {
  608. var Emitter;
  609. return function getUniEmitter() {
  610. if (!Emitter) {
  611. Emitter = new _vue.default();
  612. }
  613. return Emitter;
  614. };
  615. }();
  616. function apply(ctx, method, args) {
  617. return ctx[method].apply(ctx, args);
  618. }
  619. function $on() {
  620. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  621. }
  622. function $off() {
  623. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  624. }
  625. function $once() {
  626. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  627. }
  628. function $emit() {
  629. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  630. }
  631. var eventApi = /*#__PURE__*/Object.freeze({
  632. __proto__: null,
  633. $on: $on,
  634. $off: $off,
  635. $once: $once,
  636. $emit: $emit });
  637. var api = /*#__PURE__*/Object.freeze({
  638. __proto__: null });
  639. var MPPage = Page;
  640. var MPComponent = Component;
  641. var customizeRE = /:/g;
  642. var customize = cached(function (str) {
  643. return camelize(str.replace(customizeRE, '-'));
  644. });
  645. function initTriggerEvent(mpInstance) {
  646. {
  647. if (!wx.canIUse('nextTick')) {
  648. return;
  649. }
  650. }
  651. var oldTriggerEvent = mpInstance.triggerEvent;
  652. mpInstance.triggerEvent = function (event) {for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {args[_key4 - 1] = arguments[_key4];}
  653. return oldTriggerEvent.apply(mpInstance, [customize(event)].concat(args));
  654. };
  655. }
  656. function initHook(name, options) {
  657. var oldHook = options[name];
  658. if (!oldHook) {
  659. options[name] = function () {
  660. initTriggerEvent(this);
  661. };
  662. } else {
  663. options[name] = function () {
  664. initTriggerEvent(this);for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {args[_key5] = arguments[_key5];}
  665. return oldHook.apply(this, args);
  666. };
  667. }
  668. }
  669. Page = function Page() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  670. initHook('onLoad', options);
  671. return MPPage(options);
  672. };
  673. Component = function Component() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  674. initHook('created', options);
  675. return MPComponent(options);
  676. };
  677. var PAGE_EVENT_HOOKS = [
  678. 'onPullDownRefresh',
  679. 'onReachBottom',
  680. 'onAddToFavorites',
  681. 'onShareTimeline',
  682. 'onShareAppMessage',
  683. 'onPageScroll',
  684. 'onResize',
  685. 'onTabItemTap'];
  686. function initMocks(vm, mocks) {
  687. var mpInstance = vm.$mp[vm.mpType];
  688. mocks.forEach(function (mock) {
  689. if (hasOwn(mpInstance, mock)) {
  690. vm[mock] = mpInstance[mock];
  691. }
  692. });
  693. }
  694. function hasHook(hook, vueOptions) {
  695. if (!vueOptions) {
  696. return true;
  697. }
  698. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  699. return true;
  700. }
  701. vueOptions = vueOptions.default || vueOptions;
  702. if (isFn(vueOptions)) {
  703. if (isFn(vueOptions.extendOptions[hook])) {
  704. return true;
  705. }
  706. if (vueOptions.super &&
  707. vueOptions.super.options &&
  708. Array.isArray(vueOptions.super.options[hook])) {
  709. return true;
  710. }
  711. return false;
  712. }
  713. if (isFn(vueOptions[hook])) {
  714. return true;
  715. }
  716. var mixins = vueOptions.mixins;
  717. if (Array.isArray(mixins)) {
  718. return !!mixins.find(function (mixin) {return hasHook(hook, mixin);});
  719. }
  720. }
  721. function initHooks(mpOptions, hooks, vueOptions) {
  722. hooks.forEach(function (hook) {
  723. if (hasHook(hook, vueOptions)) {
  724. mpOptions[hook] = function (args) {
  725. return this.$vm && this.$vm.__call_hook(hook, args);
  726. };
  727. }
  728. });
  729. }
  730. function initVueComponent(Vue, vueOptions) {
  731. vueOptions = vueOptions.default || vueOptions;
  732. var VueComponent;
  733. if (isFn(vueOptions)) {
  734. VueComponent = vueOptions;
  735. } else {
  736. VueComponent = Vue.extend(vueOptions);
  737. }
  738. vueOptions = VueComponent.options;
  739. return [VueComponent, vueOptions];
  740. }
  741. function initSlots(vm, vueSlots) {
  742. if (Array.isArray(vueSlots) && vueSlots.length) {
  743. var $slots = Object.create(null);
  744. vueSlots.forEach(function (slotName) {
  745. $slots[slotName] = true;
  746. });
  747. vm.$scopedSlots = vm.$slots = $slots;
  748. }
  749. }
  750. function initVueIds(vueIds, mpInstance) {
  751. vueIds = (vueIds || '').split(',');
  752. var len = vueIds.length;
  753. if (len === 1) {
  754. mpInstance._$vueId = vueIds[0];
  755. } else if (len === 2) {
  756. mpInstance._$vueId = vueIds[0];
  757. mpInstance._$vuePid = vueIds[1];
  758. }
  759. }
  760. function initData(vueOptions, context) {
  761. var data = vueOptions.data || {};
  762. var methods = vueOptions.methods || {};
  763. if (typeof data === 'function') {
  764. try {
  765. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  766. } catch (e) {
  767. if (Object({"NODE_ENV":"development","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  768. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  769. }
  770. }
  771. } else {
  772. try {
  773. // 对 data 格式化
  774. data = JSON.parse(JSON.stringify(data));
  775. } catch (e) {}
  776. }
  777. if (!isPlainObject(data)) {
  778. data = {};
  779. }
  780. Object.keys(methods).forEach(function (methodName) {
  781. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  782. data[methodName] = methods[methodName];
  783. }
  784. });
  785. return data;
  786. }
  787. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  788. function createObserver(name) {
  789. return function observer(newVal, oldVal) {
  790. if (this.$vm) {
  791. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  792. }
  793. };
  794. }
  795. function initBehaviors(vueOptions, initBehavior) {
  796. var vueBehaviors = vueOptions.behaviors;
  797. var vueExtends = vueOptions.extends;
  798. var vueMixins = vueOptions.mixins;
  799. var vueProps = vueOptions.props;
  800. if (!vueProps) {
  801. vueOptions.props = vueProps = [];
  802. }
  803. var behaviors = [];
  804. if (Array.isArray(vueBehaviors)) {
  805. vueBehaviors.forEach(function (behavior) {
  806. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  807. if (behavior === 'uni://form-field') {
  808. if (Array.isArray(vueProps)) {
  809. vueProps.push('name');
  810. vueProps.push('value');
  811. } else {
  812. vueProps.name = {
  813. type: String,
  814. default: '' };
  815. vueProps.value = {
  816. type: [String, Number, Boolean, Array, Object, Date],
  817. default: '' };
  818. }
  819. }
  820. });
  821. }
  822. if (isPlainObject(vueExtends) && vueExtends.props) {
  823. behaviors.push(
  824. initBehavior({
  825. properties: initProperties(vueExtends.props, true) }));
  826. }
  827. if (Array.isArray(vueMixins)) {
  828. vueMixins.forEach(function (vueMixin) {
  829. if (isPlainObject(vueMixin) && vueMixin.props) {
  830. behaviors.push(
  831. initBehavior({
  832. properties: initProperties(vueMixin.props, true) }));
  833. }
  834. });
  835. }
  836. return behaviors;
  837. }
  838. function parsePropType(key, type, defaultValue, file) {
  839. // [String]=>String
  840. if (Array.isArray(type) && type.length === 1) {
  841. return type[0];
  842. }
  843. return type;
  844. }
  845. function initProperties(props) {var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  846. var properties = {};
  847. if (!isBehavior) {
  848. properties.vueId = {
  849. type: String,
  850. value: '' };
  851. // 用于字节跳动小程序模拟抽象节点
  852. properties.generic = {
  853. type: Object,
  854. value: null };
  855. properties.vueSlots = { // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  856. type: null,
  857. value: [],
  858. observer: function observer(newVal, oldVal) {
  859. var $slots = Object.create(null);
  860. newVal.forEach(function (slotName) {
  861. $slots[slotName] = true;
  862. });
  863. this.setData({
  864. $slots: $slots });
  865. } };
  866. }
  867. if (Array.isArray(props)) {// ['title']
  868. props.forEach(function (key) {
  869. properties[key] = {
  870. type: null,
  871. observer: createObserver(key) };
  872. });
  873. } else if (isPlainObject(props)) {// {title:{type:String,default:''},content:String}
  874. Object.keys(props).forEach(function (key) {
  875. var opts = props[key];
  876. if (isPlainObject(opts)) {// title:{type:String,default:''}
  877. var value = opts.default;
  878. if (isFn(value)) {
  879. value = value();
  880. }
  881. opts.type = parsePropType(key, opts.type);
  882. properties[key] = {
  883. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  884. value: value,
  885. observer: createObserver(key) };
  886. } else {// content:String
  887. var type = parsePropType(key, opts);
  888. properties[key] = {
  889. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  890. observer: createObserver(key) };
  891. }
  892. });
  893. }
  894. return properties;
  895. }
  896. function wrapper$1(event) {
  897. // TODO 又得兼容 mpvue 的 mp 对象
  898. try {
  899. event.mp = JSON.parse(JSON.stringify(event));
  900. } catch (e) {}
  901. event.stopPropagation = noop;
  902. event.preventDefault = noop;
  903. event.target = event.target || {};
  904. if (!hasOwn(event, 'detail')) {
  905. event.detail = {};
  906. }
  907. if (hasOwn(event, 'markerId')) {
  908. event.detail = typeof event.detail === 'object' ? event.detail : {};
  909. event.detail.markerId = event.markerId;
  910. }
  911. if (isPlainObject(event.detail)) {
  912. event.target = Object.assign({}, event.target, event.detail);
  913. }
  914. return event;
  915. }
  916. function getExtraValue(vm, dataPathsArray) {
  917. var context = vm;
  918. dataPathsArray.forEach(function (dataPathArray) {
  919. var dataPath = dataPathArray[0];
  920. var value = dataPathArray[2];
  921. if (dataPath || typeof value !== 'undefined') {// ['','',index,'disable']
  922. var propPath = dataPathArray[1];
  923. var valuePath = dataPathArray[3];
  924. var vFor;
  925. if (Number.isInteger(dataPath)) {
  926. vFor = dataPath;
  927. } else if (!dataPath) {
  928. vFor = context;
  929. } else if (typeof dataPath === 'string' && dataPath) {
  930. if (dataPath.indexOf('#s#') === 0) {
  931. vFor = dataPath.substr(3);
  932. } else {
  933. vFor = vm.__get_value(dataPath, context);
  934. }
  935. }
  936. if (Number.isInteger(vFor)) {
  937. context = value;
  938. } else if (!propPath) {
  939. context = vFor[value];
  940. } else {
  941. if (Array.isArray(vFor)) {
  942. context = vFor.find(function (vForItem) {
  943. return vm.__get_value(propPath, vForItem) === value;
  944. });
  945. } else if (isPlainObject(vFor)) {
  946. context = Object.keys(vFor).find(function (vForKey) {
  947. return vm.__get_value(propPath, vFor[vForKey]) === value;
  948. });
  949. } else {
  950. console.error('v-for 暂不支持循环数据:', vFor);
  951. }
  952. }
  953. if (valuePath) {
  954. context = vm.__get_value(valuePath, context);
  955. }
  956. }
  957. });
  958. return context;
  959. }
  960. function processEventExtra(vm, extra, event) {
  961. var extraObj = {};
  962. if (Array.isArray(extra) && extra.length) {
  963. /**
  964. *[
  965. * ['data.items', 'data.id', item.data.id],
  966. * ['metas', 'id', meta.id]
  967. *],
  968. *[
  969. * ['data.items', 'data.id', item.data.id],
  970. * ['metas', 'id', meta.id]
  971. *],
  972. *'test'
  973. */
  974. extra.forEach(function (dataPath, index) {
  975. if (typeof dataPath === 'string') {
  976. if (!dataPath) {// model,prop.sync
  977. extraObj['$' + index] = vm;
  978. } else {
  979. if (dataPath === '$event') {// $event
  980. extraObj['$' + index] = event;
  981. } else if (dataPath === 'arguments') {
  982. if (event.detail && event.detail.__args__) {
  983. extraObj['$' + index] = event.detail.__args__;
  984. } else {
  985. extraObj['$' + index] = [event];
  986. }
  987. } else if (dataPath.indexOf('$event.') === 0) {// $event.target.value
  988. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  989. } else {
  990. extraObj['$' + index] = vm.__get_value(dataPath);
  991. }
  992. }
  993. } else {
  994. extraObj['$' + index] = getExtraValue(vm, dataPath);
  995. }
  996. });
  997. }
  998. return extraObj;
  999. }
  1000. function getObjByArray(arr) {
  1001. var obj = {};
  1002. for (var i = 1; i < arr.length; i++) {
  1003. var element = arr[i];
  1004. obj[element[0]] = element[1];
  1005. }
  1006. return obj;
  1007. }
  1008. 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;
  1009. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  1010. if (isCustom) {// 自定义事件
  1011. isCustomMPEvent = event.currentTarget &&
  1012. event.currentTarget.dataset &&
  1013. event.currentTarget.dataset.comType === 'wx';
  1014. if (!args.length) {// 无参数,直接传入 event 或 detail 数组
  1015. if (isCustomMPEvent) {
  1016. return [event];
  1017. }
  1018. return event.detail.__args__ || event.detail;
  1019. }
  1020. }
  1021. var extraObj = processEventExtra(vm, extra, event);
  1022. var ret = [];
  1023. args.forEach(function (arg) {
  1024. if (arg === '$event') {
  1025. if (methodName === '__set_model' && !isCustom) {// input v-model value
  1026. ret.push(event.target.value);
  1027. } else {
  1028. if (isCustom && !isCustomMPEvent) {
  1029. ret.push(event.detail.__args__[0]);
  1030. } else {// wxcomponent 组件或内置组件
  1031. ret.push(event);
  1032. }
  1033. }
  1034. } else {
  1035. if (Array.isArray(arg) && arg[0] === 'o') {
  1036. ret.push(getObjByArray(arg));
  1037. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  1038. ret.push(extraObj[arg]);
  1039. } else {
  1040. ret.push(arg);
  1041. }
  1042. }
  1043. });
  1044. return ret;
  1045. }
  1046. var ONCE = '~';
  1047. var CUSTOM = '^';
  1048. function isMatchEventType(eventType, optType) {
  1049. return eventType === optType ||
  1050. optType === 'regionchange' && (
  1051. eventType === 'begin' ||
  1052. eventType === 'end');
  1053. }
  1054. function getContextVm(vm) {
  1055. var $parent = vm.$parent;
  1056. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  1057. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  1058. $parent = $parent.$parent;
  1059. }
  1060. return $parent && $parent.$parent;
  1061. }
  1062. function handleEvent(event) {var _this2 = this;
  1063. event = wrapper$1(event);
  1064. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  1065. var dataset = (event.currentTarget || event.target).dataset;
  1066. if (!dataset) {
  1067. return console.warn('事件信息不存在');
  1068. }
  1069. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  1070. if (!eventOpts) {
  1071. return console.warn('事件信息不存在');
  1072. }
  1073. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  1074. var eventType = event.type;
  1075. var ret = [];
  1076. eventOpts.forEach(function (eventOpt) {
  1077. var type = eventOpt[0];
  1078. var eventsArray = eventOpt[1];
  1079. var isCustom = type.charAt(0) === CUSTOM;
  1080. type = isCustom ? type.slice(1) : type;
  1081. var isOnce = type.charAt(0) === ONCE;
  1082. type = isOnce ? type.slice(1) : type;
  1083. if (eventsArray && isMatchEventType(eventType, type)) {
  1084. eventsArray.forEach(function (eventArray) {
  1085. var methodName = eventArray[0];
  1086. if (methodName) {
  1087. var handlerCtx = _this2.$vm;
  1088. if (handlerCtx.$options.generic) {// mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  1089. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  1090. }
  1091. if (methodName === '$emit') {
  1092. handlerCtx.$emit.apply(handlerCtx,
  1093. processEventArgs(
  1094. _this2.$vm,
  1095. event,
  1096. eventArray[1],
  1097. eventArray[2],
  1098. isCustom,
  1099. methodName));
  1100. return;
  1101. }
  1102. var handler = handlerCtx[methodName];
  1103. if (!isFn(handler)) {
  1104. throw new Error(" _vm.".concat(methodName, " is not a function"));
  1105. }
  1106. if (isOnce) {
  1107. if (handler.once) {
  1108. return;
  1109. }
  1110. handler.once = true;
  1111. }
  1112. var params = processEventArgs(
  1113. _this2.$vm,
  1114. event,
  1115. eventArray[1],
  1116. eventArray[2],
  1117. isCustom,
  1118. methodName);
  1119. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  1120. // eslint-disable-next-line no-sparse-arrays
  1121. ret.push(handler.apply(handlerCtx, (Array.isArray(params) ? params : []).concat([,,,,,,,,,, event])));
  1122. }
  1123. });
  1124. }
  1125. });
  1126. if (
  1127. eventType === 'input' &&
  1128. ret.length === 1 &&
  1129. typeof ret[0] !== 'undefined')
  1130. {
  1131. return ret[0];
  1132. }
  1133. }
  1134. var hooks = [
  1135. 'onShow',
  1136. 'onHide',
  1137. 'onError',
  1138. 'onPageNotFound',
  1139. 'onThemeChange',
  1140. 'onUnhandledRejection'];
  1141. function parseBaseApp(vm, _ref3)
  1142. {var mocks = _ref3.mocks,initRefs = _ref3.initRefs;
  1143. if (vm.$options.store) {
  1144. _vue.default.prototype.$store = vm.$options.store;
  1145. }
  1146. _vue.default.prototype.mpHost = "mp-weixin";
  1147. _vue.default.mixin({
  1148. beforeCreate: function beforeCreate() {
  1149. if (!this.$options.mpType) {
  1150. return;
  1151. }
  1152. this.mpType = this.$options.mpType;
  1153. this.$mp = _defineProperty({
  1154. data: {} },
  1155. this.mpType, this.$options.mpInstance);
  1156. this.$scope = this.$options.mpInstance;
  1157. delete this.$options.mpType;
  1158. delete this.$options.mpInstance;
  1159. if (this.mpType !== 'app') {
  1160. initRefs(this);
  1161. initMocks(this, mocks);
  1162. }
  1163. } });
  1164. var appOptions = {
  1165. onLaunch: function onLaunch(args) {
  1166. if (this.$vm) {// 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  1167. return;
  1168. }
  1169. {
  1170. if (!wx.canIUse('nextTick')) {// 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  1171. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  1172. }
  1173. }
  1174. this.$vm = vm;
  1175. this.$vm.$mp = {
  1176. app: this };
  1177. this.$vm.$scope = this;
  1178. // vm 上也挂载 globalData
  1179. this.$vm.globalData = this.globalData;
  1180. this.$vm._isMounted = true;
  1181. this.$vm.__call_hook('mounted', args);
  1182. this.$vm.__call_hook('onLaunch', args);
  1183. } };
  1184. // 兼容旧版本 globalData
  1185. appOptions.globalData = vm.$options.globalData || {};
  1186. // 将 methods 中的方法挂在 getApp() 中
  1187. var methods = vm.$options.methods;
  1188. if (methods) {
  1189. Object.keys(methods).forEach(function (name) {
  1190. appOptions[name] = methods[name];
  1191. });
  1192. }
  1193. initHooks(appOptions, hooks);
  1194. return appOptions;
  1195. }
  1196. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1197. function findVmByVueId(vm, vuePid) {
  1198. var $children = vm.$children;
  1199. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1200. for (var i = $children.length - 1; i >= 0; i--) {
  1201. var childVm = $children[i];
  1202. if (childVm.$scope._$vueId === vuePid) {
  1203. return childVm;
  1204. }
  1205. }
  1206. // 反向递归查找
  1207. var parentVm;
  1208. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1209. parentVm = findVmByVueId($children[_i], vuePid);
  1210. if (parentVm) {
  1211. return parentVm;
  1212. }
  1213. }
  1214. }
  1215. function initBehavior(options) {
  1216. return Behavior(options);
  1217. }
  1218. function isPage() {
  1219. return !!this.route;
  1220. }
  1221. function initRelation(detail) {
  1222. this.triggerEvent('__l', detail);
  1223. }
  1224. function initRefs(vm) {
  1225. var mpInstance = vm.$scope;
  1226. Object.defineProperty(vm, '$refs', {
  1227. get: function get() {
  1228. var $refs = {};
  1229. var components = mpInstance.selectAllComponents('.vue-ref');
  1230. components.forEach(function (component) {
  1231. var ref = component.dataset.ref;
  1232. $refs[ref] = component.$vm || component;
  1233. });
  1234. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for');
  1235. forComponents.forEach(function (component) {
  1236. var ref = component.dataset.ref;
  1237. if (!$refs[ref]) {
  1238. $refs[ref] = [];
  1239. }
  1240. $refs[ref].push(component.$vm || component);
  1241. });
  1242. return $refs;
  1243. } });
  1244. }
  1245. function handleLink(event) {var _ref4 =
  1246. event.detail || event.value,vuePid = _ref4.vuePid,vueOptions = _ref4.vueOptions; // detail 是微信,value 是百度(dipatch)
  1247. var parentVm;
  1248. if (vuePid) {
  1249. parentVm = findVmByVueId(this.$vm, vuePid);
  1250. }
  1251. if (!parentVm) {
  1252. parentVm = this.$vm;
  1253. }
  1254. vueOptions.parent = parentVm;
  1255. }
  1256. function parseApp(vm) {
  1257. return parseBaseApp(vm, {
  1258. mocks: mocks,
  1259. initRefs: initRefs });
  1260. }
  1261. function createApp(vm) {
  1262. _vue.default.prototype.getOpenerEventChannel = function () {
  1263. if (!this.__eventChannel__) {
  1264. this.__eventChannel__ = new EventChannel();
  1265. }
  1266. return this.__eventChannel__;
  1267. };
  1268. var callHook = _vue.default.prototype.__call_hook;
  1269. _vue.default.prototype.__call_hook = function (hook, args) {
  1270. if (hook === 'onLoad' && args && args.__id__) {
  1271. this.__eventChannel__ = getEventChannel(args.__id__);
  1272. delete args.__id__;
  1273. }
  1274. return callHook.call(this, hook, args);
  1275. };
  1276. App(parseApp(vm));
  1277. return vm;
  1278. }
  1279. var encodeReserveRE = /[!'()*]/g;
  1280. var encodeReserveReplacer = function encodeReserveReplacer(c) {return '%' + c.charCodeAt(0).toString(16);};
  1281. var commaRE = /%2C/g;
  1282. // fixed encodeURIComponent which is more conformant to RFC3986:
  1283. // - escapes [!'()*]
  1284. // - preserve commas
  1285. var encode = function encode(str) {return encodeURIComponent(str).
  1286. replace(encodeReserveRE, encodeReserveReplacer).
  1287. replace(commaRE, ',');};
  1288. function stringifyQuery(obj) {var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  1289. var res = obj ? Object.keys(obj).map(function (key) {
  1290. var val = obj[key];
  1291. if (val === undefined) {
  1292. return '';
  1293. }
  1294. if (val === null) {
  1295. return encodeStr(key);
  1296. }
  1297. if (Array.isArray(val)) {
  1298. var result = [];
  1299. val.forEach(function (val2) {
  1300. if (val2 === undefined) {
  1301. return;
  1302. }
  1303. if (val2 === null) {
  1304. result.push(encodeStr(key));
  1305. } else {
  1306. result.push(encodeStr(key) + '=' + encodeStr(val2));
  1307. }
  1308. });
  1309. return result.join('&');
  1310. }
  1311. return encodeStr(key) + '=' + encodeStr(val);
  1312. }).filter(function (x) {return x.length > 0;}).join('&') : null;
  1313. return res ? "?".concat(res) : '';
  1314. }
  1315. function parseBaseComponent(vueComponentOptions)
  1316. {var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},isPage = _ref5.isPage,initRelation = _ref5.initRelation;var _initVueComponent =
  1317. initVueComponent(_vue.default, vueComponentOptions),_initVueComponent2 = _slicedToArray(_initVueComponent, 2),VueComponent = _initVueComponent2[0],vueOptions = _initVueComponent2[1];
  1318. var options = _objectSpread({
  1319. multipleSlots: true,
  1320. addGlobalClass: true },
  1321. vueOptions.options || {});
  1322. {
  1323. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  1324. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  1325. Object.assign(options, vueOptions['mp-weixin'].options);
  1326. }
  1327. }
  1328. var componentOptions = {
  1329. options: options,
  1330. data: initData(vueOptions, _vue.default.prototype),
  1331. behaviors: initBehaviors(vueOptions, initBehavior),
  1332. properties: initProperties(vueOptions.props, false, vueOptions.__file),
  1333. lifetimes: {
  1334. attached: function attached() {
  1335. var properties = this.properties;
  1336. var options = {
  1337. mpType: isPage.call(this) ? 'page' : 'component',
  1338. mpInstance: this,
  1339. propsData: properties };
  1340. initVueIds(properties.vueId, this);
  1341. // 处理父子关系
  1342. initRelation.call(this, {
  1343. vuePid: this._$vuePid,
  1344. vueOptions: options });
  1345. // 初始化 vue 实例
  1346. this.$vm = new VueComponent(options);
  1347. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  1348. initSlots(this.$vm, properties.vueSlots);
  1349. // 触发首次 setData
  1350. this.$vm.$mount();
  1351. },
  1352. ready: function ready() {
  1353. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  1354. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  1355. if (this.$vm) {
  1356. this.$vm._isMounted = true;
  1357. this.$vm.__call_hook('mounted');
  1358. this.$vm.__call_hook('onReady');
  1359. }
  1360. },
  1361. detached: function detached() {
  1362. this.$vm && this.$vm.$destroy();
  1363. } },
  1364. pageLifetimes: {
  1365. show: function show(args) {
  1366. this.$vm && this.$vm.__call_hook('onPageShow', args);
  1367. },
  1368. hide: function hide() {
  1369. this.$vm && this.$vm.__call_hook('onPageHide');
  1370. },
  1371. resize: function resize(size) {
  1372. this.$vm && this.$vm.__call_hook('onPageResize', size);
  1373. } },
  1374. methods: {
  1375. __l: handleLink,
  1376. __e: handleEvent } };
  1377. // externalClasses
  1378. if (vueOptions.externalClasses) {
  1379. componentOptions.externalClasses = vueOptions.externalClasses;
  1380. }
  1381. if (Array.isArray(vueOptions.wxsCallMethods)) {
  1382. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  1383. componentOptions.methods[callMethod] = function (args) {
  1384. return this.$vm[callMethod](args);
  1385. };
  1386. });
  1387. }
  1388. if (isPage) {
  1389. return componentOptions;
  1390. }
  1391. return [componentOptions, VueComponent];
  1392. }
  1393. function parseComponent(vueComponentOptions) {
  1394. return parseBaseComponent(vueComponentOptions, {
  1395. isPage: isPage,
  1396. initRelation: initRelation });
  1397. }
  1398. var hooks$1 = [
  1399. 'onShow',
  1400. 'onHide',
  1401. 'onUnload'];
  1402. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  1403. function parseBasePage(vuePageOptions, _ref6)
  1404. {var isPage = _ref6.isPage,initRelation = _ref6.initRelation;
  1405. var pageOptions = parseComponent(vuePageOptions);
  1406. initHooks(pageOptions.methods, hooks$1, vuePageOptions);
  1407. pageOptions.methods.onLoad = function (query) {
  1408. this.options = query;
  1409. var copyQuery = Object.assign({}, query);
  1410. delete copyQuery.__id__;
  1411. this.$page = {
  1412. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery) };
  1413. this.$vm.$mp.query = query; // 兼容 mpvue
  1414. this.$vm.__call_hook('onLoad', query);
  1415. };
  1416. return pageOptions;
  1417. }
  1418. function parsePage(vuePageOptions) {
  1419. return parseBasePage(vuePageOptions, {
  1420. isPage: isPage,
  1421. initRelation: initRelation });
  1422. }
  1423. function createPage(vuePageOptions) {
  1424. {
  1425. return Component(parsePage(vuePageOptions));
  1426. }
  1427. }
  1428. function createComponent(vueOptions) {
  1429. {
  1430. return Component(parseComponent(vueOptions));
  1431. }
  1432. }
  1433. todos.forEach(function (todoApi) {
  1434. protocols[todoApi] = false;
  1435. });
  1436. canIUses.forEach(function (canIUseApi) {
  1437. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name :
  1438. canIUseApi;
  1439. if (!wx.canIUse(apiName)) {
  1440. protocols[canIUseApi] = false;
  1441. }
  1442. });
  1443. var uni = {};
  1444. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  1445. uni = new Proxy({}, {
  1446. get: function get(target, name) {
  1447. if (hasOwn(target, name)) {
  1448. return target[name];
  1449. }
  1450. if (baseApi[name]) {
  1451. return baseApi[name];
  1452. }
  1453. if (api[name]) {
  1454. return promisify(name, api[name]);
  1455. }
  1456. {
  1457. if (extraApi[name]) {
  1458. return promisify(name, extraApi[name]);
  1459. }
  1460. if (todoApis[name]) {
  1461. return promisify(name, todoApis[name]);
  1462. }
  1463. }
  1464. if (eventApi[name]) {
  1465. return eventApi[name];
  1466. }
  1467. if (!hasOwn(wx, name) && !hasOwn(protocols, name)) {
  1468. return;
  1469. }
  1470. return promisify(name, wrapper(name, wx[name]));
  1471. },
  1472. set: function set(target, name, value) {
  1473. target[name] = value;
  1474. return true;
  1475. } });
  1476. } else {
  1477. Object.keys(baseApi).forEach(function (name) {
  1478. uni[name] = baseApi[name];
  1479. });
  1480. {
  1481. Object.keys(todoApis).forEach(function (name) {
  1482. uni[name] = promisify(name, todoApis[name]);
  1483. });
  1484. Object.keys(extraApi).forEach(function (name) {
  1485. uni[name] = promisify(name, todoApis[name]);
  1486. });
  1487. }
  1488. Object.keys(eventApi).forEach(function (name) {
  1489. uni[name] = eventApi[name];
  1490. });
  1491. Object.keys(api).forEach(function (name) {
  1492. uni[name] = promisify(name, api[name]);
  1493. });
  1494. Object.keys(wx).forEach(function (name) {
  1495. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  1496. uni[name] = promisify(name, wrapper(name, wx[name]));
  1497. }
  1498. });
  1499. }
  1500. wx.createApp = createApp;
  1501. wx.createPage = createPage;
  1502. wx.createComponent = createComponent;
  1503. var uni$1 = uni;var _default =
  1504. uni$1;exports.default = _default;
  1505. /***/ }),
  1506. /***/ 10:
  1507. /*!**********************************************************************************************************!*\
  1508. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  1509. \**********************************************************************************************************/
  1510. /*! exports provided: default */
  1511. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1512. "use strict";
  1513. __webpack_require__.r(__webpack_exports__);
  1514. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  1515. /* globals __VUE_SSR_CONTEXT__ */
  1516. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  1517. // This module is a runtime utility for cleaner component module output and will
  1518. // be included in the final webpack user bundle.
  1519. function normalizeComponent (
  1520. scriptExports,
  1521. render,
  1522. staticRenderFns,
  1523. functionalTemplate,
  1524. injectStyles,
  1525. scopeId,
  1526. moduleIdentifier, /* server only */
  1527. shadowMode, /* vue-cli only */
  1528. components, // fixed by xxxxxx auto components
  1529. renderjs // fixed by xxxxxx renderjs
  1530. ) {
  1531. // Vue.extend constructor export interop
  1532. var options = typeof scriptExports === 'function'
  1533. ? scriptExports.options
  1534. : scriptExports
  1535. // fixed by xxxxxx auto components
  1536. if (components) {
  1537. if (!options.components) {
  1538. options.components = {}
  1539. }
  1540. var hasOwn = Object.prototype.hasOwnProperty
  1541. for (var name in components) {
  1542. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  1543. options.components[name] = components[name]
  1544. }
  1545. }
  1546. }
  1547. // fixed by xxxxxx renderjs
  1548. if (renderjs) {
  1549. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  1550. this[renderjs.__module] = this
  1551. });
  1552. (options.mixins || (options.mixins = [])).push(renderjs)
  1553. }
  1554. // render functions
  1555. if (render) {
  1556. options.render = render
  1557. options.staticRenderFns = staticRenderFns
  1558. options._compiled = true
  1559. }
  1560. // functional template
  1561. if (functionalTemplate) {
  1562. options.functional = true
  1563. }
  1564. // scopedId
  1565. if (scopeId) {
  1566. options._scopeId = 'data-v-' + scopeId
  1567. }
  1568. var hook
  1569. if (moduleIdentifier) { // server build
  1570. hook = function (context) {
  1571. // 2.3 injection
  1572. context =
  1573. context || // cached call
  1574. (this.$vnode && this.$vnode.ssrContext) || // stateful
  1575. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  1576. // 2.2 with runInNewContext: true
  1577. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  1578. context = __VUE_SSR_CONTEXT__
  1579. }
  1580. // inject component styles
  1581. if (injectStyles) {
  1582. injectStyles.call(this, context)
  1583. }
  1584. // register component module identifier for async chunk inferrence
  1585. if (context && context._registeredComponents) {
  1586. context._registeredComponents.add(moduleIdentifier)
  1587. }
  1588. }
  1589. // used by ssr in case component is cached and beforeCreate
  1590. // never gets called
  1591. options._ssrRegister = hook
  1592. } else if (injectStyles) {
  1593. hook = shadowMode
  1594. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  1595. : injectStyles
  1596. }
  1597. if (hook) {
  1598. if (options.functional) {
  1599. // for template-only hot-reload because in that case the render fn doesn't
  1600. // go through the normalizer
  1601. options._injectStyles = hook
  1602. // register for functioal component in vue file
  1603. var originalRender = options.render
  1604. options.render = function renderWithStyleInjection (h, context) {
  1605. hook.call(context)
  1606. return originalRender(h, context)
  1607. }
  1608. } else {
  1609. // inject component registration as beforeCreate hook
  1610. var existing = options.beforeCreate
  1611. options.beforeCreate = existing
  1612. ? [].concat(existing, hook)
  1613. : [hook]
  1614. }
  1615. }
  1616. return {
  1617. exports: scriptExports,
  1618. options: options
  1619. }
  1620. }
  1621. /***/ }),
  1622. /***/ 11:
  1623. /*!*************************************************!*\
  1624. !*** D:/h5Views/qjd-user-uniapp/store/index.js ***!
  1625. \*************************************************/
  1626. /*! no static exports found */
  1627. /***/ (function(module, exports, __webpack_require__) {
  1628. "use strict";
  1629. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  1630. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 2));
  1631. var _vuex = _interopRequireDefault(__webpack_require__(/*! vuex */ 12));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} //引入vue和vuex
  1632. _vue.default.use(_vuex.default);
  1633. var store = new _vuex.default.Store({ //全局变量定义
  1634. state: {
  1635. forcedLogin: false, //是否需要强制登录
  1636. userLoginFlag: false, //用户是否登录
  1637. userinfo: {} //存放用户账号数据
  1638. },
  1639. mutations: {
  1640. // 登录
  1641. login: function login(state, provider) {
  1642. state.userLoginFlag = true;
  1643. state.userInfo = provider;
  1644. uni.setStorage({ // 异步缓存用户信息
  1645. key: "userinfo",
  1646. data: provider });
  1647. console.log(state.userInfo);
  1648. },
  1649. // 退出
  1650. logout: function logout(state) {
  1651. state.userLoginFlag = false;
  1652. state.userInfo = {};
  1653. uni.removeStorage({ // 清除用户信息
  1654. key: "userinfo" });
  1655. } } });var _default =
  1656. store;exports.default = _default;
  1657. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  1658. /***/ }),
  1659. /***/ 12:
  1660. /*!********************************************!*\
  1661. !*** ./node_modules/vuex/dist/vuex.esm.js ***!
  1662. \********************************************/
  1663. /*! exports provided: default, Store, createNamespacedHelpers, install, mapActions, mapGetters, mapMutations, mapState */
  1664. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1665. "use strict";
  1666. __webpack_require__.r(__webpack_exports__);
  1667. /* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Store", function() { return Store; });
  1668. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createNamespacedHelpers", function() { return createNamespacedHelpers; });
  1669. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "install", function() { return install; });
  1670. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapActions", function() { return mapActions; });
  1671. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapGetters", function() { return mapGetters; });
  1672. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapMutations", function() { return mapMutations; });
  1673. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapState", function() { return mapState; });
  1674. /*!
  1675. * vuex v3.4.0
  1676. * (c) 2020 Evan You
  1677. * @license MIT
  1678. */
  1679. function applyMixin (Vue) {
  1680. var version = Number(Vue.version.split('.')[0]);
  1681. if (version >= 2) {
  1682. Vue.mixin({ beforeCreate: vuexInit });
  1683. } else {
  1684. // override init and inject vuex init procedure
  1685. // for 1.x backwards compatibility.
  1686. var _init = Vue.prototype._init;
  1687. Vue.prototype._init = function (options) {
  1688. if ( options === void 0 ) options = {};
  1689. options.init = options.init
  1690. ? [vuexInit].concat(options.init)
  1691. : vuexInit;
  1692. _init.call(this, options);
  1693. };
  1694. }
  1695. /**
  1696. * Vuex init hook, injected into each instances init hooks list.
  1697. */
  1698. function vuexInit () {
  1699. var options = this.$options;
  1700. // store injection
  1701. if (options.store) {
  1702. this.$store = typeof options.store === 'function'
  1703. ? options.store()
  1704. : options.store;
  1705. } else if (options.parent && options.parent.$store) {
  1706. this.$store = options.parent.$store;
  1707. }
  1708. }
  1709. }
  1710. var target = typeof window !== 'undefined'
  1711. ? window
  1712. : typeof global !== 'undefined'
  1713. ? global
  1714. : {};
  1715. var devtoolHook = target.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  1716. function devtoolPlugin (store) {
  1717. if (!devtoolHook) { return }
  1718. store._devtoolHook = devtoolHook;
  1719. devtoolHook.emit('vuex:init', store);
  1720. devtoolHook.on('vuex:travel-to-state', function (targetState) {
  1721. store.replaceState(targetState);
  1722. });
  1723. store.subscribe(function (mutation, state) {
  1724. devtoolHook.emit('vuex:mutation', mutation, state);
  1725. }, { prepend: true });
  1726. store.subscribeAction(function (action, state) {
  1727. devtoolHook.emit('vuex:action', action, state);
  1728. }, { prepend: true });
  1729. }
  1730. /**
  1731. * Get the first item that pass the test
  1732. * by second argument function
  1733. *
  1734. * @param {Array} list
  1735. * @param {Function} f
  1736. * @return {*}
  1737. */
  1738. /**
  1739. * forEach for object
  1740. */
  1741. function forEachValue (obj, fn) {
  1742. Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });
  1743. }
  1744. function isObject (obj) {
  1745. return obj !== null && typeof obj === 'object'
  1746. }
  1747. function isPromise (val) {
  1748. return val && typeof val.then === 'function'
  1749. }
  1750. function assert (condition, msg) {
  1751. if (!condition) { throw new Error(("[vuex] " + msg)) }
  1752. }
  1753. function partial (fn, arg) {
  1754. return function () {
  1755. return fn(arg)
  1756. }
  1757. }
  1758. // Base data struct for store's module, package with some attribute and method
  1759. var Module = function Module (rawModule, runtime) {
  1760. this.runtime = runtime;
  1761. // Store some children item
  1762. this._children = Object.create(null);
  1763. // Store the origin module object which passed by programmer
  1764. this._rawModule = rawModule;
  1765. var rawState = rawModule.state;
  1766. // Store the origin module's state
  1767. this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};
  1768. };
  1769. var prototypeAccessors = { namespaced: { configurable: true } };
  1770. prototypeAccessors.namespaced.get = function () {
  1771. return !!this._rawModule.namespaced
  1772. };
  1773. Module.prototype.addChild = function addChild (key, module) {
  1774. this._children[key] = module;
  1775. };
  1776. Module.prototype.removeChild = function removeChild (key) {
  1777. delete this._children[key];
  1778. };
  1779. Module.prototype.getChild = function getChild (key) {
  1780. return this._children[key]
  1781. };
  1782. Module.prototype.hasChild = function hasChild (key) {
  1783. return key in this._children
  1784. };
  1785. Module.prototype.update = function update (rawModule) {
  1786. this._rawModule.namespaced = rawModule.namespaced;
  1787. if (rawModule.actions) {
  1788. this._rawModule.actions = rawModule.actions;
  1789. }
  1790. if (rawModule.mutations) {
  1791. this._rawModule.mutations = rawModule.mutations;
  1792. }
  1793. if (rawModule.getters) {
  1794. this._rawModule.getters = rawModule.getters;
  1795. }
  1796. };
  1797. Module.prototype.forEachChild = function forEachChild (fn) {
  1798. forEachValue(this._children, fn);
  1799. };
  1800. Module.prototype.forEachGetter = function forEachGetter (fn) {
  1801. if (this._rawModule.getters) {
  1802. forEachValue(this._rawModule.getters, fn);
  1803. }
  1804. };
  1805. Module.prototype.forEachAction = function forEachAction (fn) {
  1806. if (this._rawModule.actions) {
  1807. forEachValue(this._rawModule.actions, fn);
  1808. }
  1809. };
  1810. Module.prototype.forEachMutation = function forEachMutation (fn) {
  1811. if (this._rawModule.mutations) {
  1812. forEachValue(this._rawModule.mutations, fn);
  1813. }
  1814. };
  1815. Object.defineProperties( Module.prototype, prototypeAccessors );
  1816. var ModuleCollection = function ModuleCollection (rawRootModule) {
  1817. // register root module (Vuex.Store options)
  1818. this.register([], rawRootModule, false);
  1819. };
  1820. ModuleCollection.prototype.get = function get (path) {
  1821. return path.reduce(function (module, key) {
  1822. return module.getChild(key)
  1823. }, this.root)
  1824. };
  1825. ModuleCollection.prototype.getNamespace = function getNamespace (path) {
  1826. var module = this.root;
  1827. return path.reduce(function (namespace, key) {
  1828. module = module.getChild(key);
  1829. return namespace + (module.namespaced ? key + '/' : '')
  1830. }, '')
  1831. };
  1832. ModuleCollection.prototype.update = function update$1 (rawRootModule) {
  1833. update([], this.root, rawRootModule);
  1834. };
  1835. ModuleCollection.prototype.register = function register (path, rawModule, runtime) {
  1836. var this$1 = this;
  1837. if ( runtime === void 0 ) runtime = true;
  1838. if ((true)) {
  1839. assertRawModule(path, rawModule);
  1840. }
  1841. var newModule = new Module(rawModule, runtime);
  1842. if (path.length === 0) {
  1843. this.root = newModule;
  1844. } else {
  1845. var parent = this.get(path.slice(0, -1));
  1846. parent.addChild(path[path.length - 1], newModule);
  1847. }
  1848. // register nested modules
  1849. if (rawModule.modules) {
  1850. forEachValue(rawModule.modules, function (rawChildModule, key) {
  1851. this$1.register(path.concat(key), rawChildModule, runtime);
  1852. });
  1853. }
  1854. };
  1855. ModuleCollection.prototype.unregister = function unregister (path) {
  1856. var parent = this.get(path.slice(0, -1));
  1857. var key = path[path.length - 1];
  1858. if (!parent.getChild(key).runtime) { return }
  1859. parent.removeChild(key);
  1860. };
  1861. ModuleCollection.prototype.isRegistered = function isRegistered (path) {
  1862. var parent = this.get(path.slice(0, -1));
  1863. var key = path[path.length - 1];
  1864. return parent.hasChild(key)
  1865. };
  1866. function update (path, targetModule, newModule) {
  1867. if ((true)) {
  1868. assertRawModule(path, newModule);
  1869. }
  1870. // update target module
  1871. targetModule.update(newModule);
  1872. // update nested modules
  1873. if (newModule.modules) {
  1874. for (var key in newModule.modules) {
  1875. if (!targetModule.getChild(key)) {
  1876. if ((true)) {
  1877. console.warn(
  1878. "[vuex] trying to add a new module '" + key + "' on hot reloading, " +
  1879. 'manual reload is needed'
  1880. );
  1881. }
  1882. return
  1883. }
  1884. update(
  1885. path.concat(key),
  1886. targetModule.getChild(key),
  1887. newModule.modules[key]
  1888. );
  1889. }
  1890. }
  1891. }
  1892. var functionAssert = {
  1893. assert: function (value) { return typeof value === 'function'; },
  1894. expected: 'function'
  1895. };
  1896. var objectAssert = {
  1897. assert: function (value) { return typeof value === 'function' ||
  1898. (typeof value === 'object' && typeof value.handler === 'function'); },
  1899. expected: 'function or object with "handler" function'
  1900. };
  1901. var assertTypes = {
  1902. getters: functionAssert,
  1903. mutations: functionAssert,
  1904. actions: objectAssert
  1905. };
  1906. function assertRawModule (path, rawModule) {
  1907. Object.keys(assertTypes).forEach(function (key) {
  1908. if (!rawModule[key]) { return }
  1909. var assertOptions = assertTypes[key];
  1910. forEachValue(rawModule[key], function (value, type) {
  1911. assert(
  1912. assertOptions.assert(value),
  1913. makeAssertionMessage(path, key, type, value, assertOptions.expected)
  1914. );
  1915. });
  1916. });
  1917. }
  1918. function makeAssertionMessage (path, key, type, value, expected) {
  1919. var buf = key + " should be " + expected + " but \"" + key + "." + type + "\"";
  1920. if (path.length > 0) {
  1921. buf += " in module \"" + (path.join('.')) + "\"";
  1922. }
  1923. buf += " is " + (JSON.stringify(value)) + ".";
  1924. return buf
  1925. }
  1926. var Vue; // bind on install
  1927. var Store = function Store (options) {
  1928. var this$1 = this;
  1929. if ( options === void 0 ) options = {};
  1930. // Auto install if it is not done yet and `window` has `Vue`.
  1931. // To allow users to avoid auto-installation in some cases,
  1932. // this code should be placed here. See #731
  1933. if (!Vue && typeof window !== 'undefined' && window.Vue) {
  1934. install(window.Vue);
  1935. }
  1936. if ((true)) {
  1937. assert(Vue, "must call Vue.use(Vuex) before creating a store instance.");
  1938. assert(typeof Promise !== 'undefined', "vuex requires a Promise polyfill in this browser.");
  1939. assert(this instanceof Store, "store must be called with the new operator.");
  1940. }
  1941. var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];
  1942. var strict = options.strict; if ( strict === void 0 ) strict = false;
  1943. // store internal state
  1944. this._committing = false;
  1945. this._actions = Object.create(null);
  1946. this._actionSubscribers = [];
  1947. this._mutations = Object.create(null);
  1948. this._wrappedGetters = Object.create(null);
  1949. this._modules = new ModuleCollection(options);
  1950. this._modulesNamespaceMap = Object.create(null);
  1951. this._subscribers = [];
  1952. this._watcherVM = new Vue();
  1953. this._makeLocalGettersCache = Object.create(null);
  1954. // bind commit and dispatch to self
  1955. var store = this;
  1956. var ref = this;
  1957. var dispatch = ref.dispatch;
  1958. var commit = ref.commit;
  1959. this.dispatch = function boundDispatch (type, payload) {
  1960. return dispatch.call(store, type, payload)
  1961. };
  1962. this.commit = function boundCommit (type, payload, options) {
  1963. return commit.call(store, type, payload, options)
  1964. };
  1965. // strict mode
  1966. this.strict = strict;
  1967. var state = this._modules.root.state;
  1968. // init root module.
  1969. // this also recursively registers all sub-modules
  1970. // and collects all module getters inside this._wrappedGetters
  1971. installModule(this, state, [], this._modules.root);
  1972. // initialize the store vm, which is responsible for the reactivity
  1973. // (also registers _wrappedGetters as computed properties)
  1974. resetStoreVM(this, state);
  1975. // apply plugins
  1976. plugins.forEach(function (plugin) { return plugin(this$1); });
  1977. var useDevtools = options.devtools !== undefined ? options.devtools : Vue.config.devtools;
  1978. if (useDevtools) {
  1979. devtoolPlugin(this);
  1980. }
  1981. };
  1982. var prototypeAccessors$1 = { state: { configurable: true } };
  1983. prototypeAccessors$1.state.get = function () {
  1984. return this._vm._data.$$state
  1985. };
  1986. prototypeAccessors$1.state.set = function (v) {
  1987. if ((true)) {
  1988. assert(false, "use store.replaceState() to explicit replace store state.");
  1989. }
  1990. };
  1991. Store.prototype.commit = function commit (_type, _payload, _options) {
  1992. var this$1 = this;
  1993. // check object-style commit
  1994. var ref = unifyObjectStyle(_type, _payload, _options);
  1995. var type = ref.type;
  1996. var payload = ref.payload;
  1997. var options = ref.options;
  1998. var mutation = { type: type, payload: payload };
  1999. var entry = this._mutations[type];
  2000. if (!entry) {
  2001. if ((true)) {
  2002. console.error(("[vuex] unknown mutation type: " + type));
  2003. }
  2004. return
  2005. }
  2006. this._withCommit(function () {
  2007. entry.forEach(function commitIterator (handler) {
  2008. handler(payload);
  2009. });
  2010. });
  2011. this._subscribers
  2012. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  2013. .forEach(function (sub) { return sub(mutation, this$1.state); });
  2014. if (
  2015. ( true) &&
  2016. options && options.silent
  2017. ) {
  2018. console.warn(
  2019. "[vuex] mutation type: " + type + ". Silent option has been removed. " +
  2020. 'Use the filter functionality in the vue-devtools'
  2021. );
  2022. }
  2023. };
  2024. Store.prototype.dispatch = function dispatch (_type, _payload) {
  2025. var this$1 = this;
  2026. // check object-style dispatch
  2027. var ref = unifyObjectStyle(_type, _payload);
  2028. var type = ref.type;
  2029. var payload = ref.payload;
  2030. var action = { type: type, payload: payload };
  2031. var entry = this._actions[type];
  2032. if (!entry) {
  2033. if ((true)) {
  2034. console.error(("[vuex] unknown action type: " + type));
  2035. }
  2036. return
  2037. }
  2038. try {
  2039. this._actionSubscribers
  2040. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  2041. .filter(function (sub) { return sub.before; })
  2042. .forEach(function (sub) { return sub.before(action, this$1.state); });
  2043. } catch (e) {
  2044. if ((true)) {
  2045. console.warn("[vuex] error in before action subscribers: ");
  2046. console.error(e);
  2047. }
  2048. }
  2049. var result = entry.length > 1
  2050. ? Promise.all(entry.map(function (handler) { return handler(payload); }))
  2051. : entry[0](payload);
  2052. return new Promise(function (resolve, reject) {
  2053. result.then(function (res) {
  2054. try {
  2055. this$1._actionSubscribers
  2056. .filter(function (sub) { return sub.after; })
  2057. .forEach(function (sub) { return sub.after(action, this$1.state); });
  2058. } catch (e) {
  2059. if ((true)) {
  2060. console.warn("[vuex] error in after action subscribers: ");
  2061. console.error(e);
  2062. }
  2063. }
  2064. resolve(res);
  2065. }, function (error) {
  2066. try {
  2067. this$1._actionSubscribers
  2068. .filter(function (sub) { return sub.error; })
  2069. .forEach(function (sub) { return sub.error(action, this$1.state, error); });
  2070. } catch (e) {
  2071. if ((true)) {
  2072. console.warn("[vuex] error in error action subscribers: ");
  2073. console.error(e);
  2074. }
  2075. }
  2076. reject(error);
  2077. });
  2078. })
  2079. };
  2080. Store.prototype.subscribe = function subscribe (fn, options) {
  2081. return genericSubscribe(fn, this._subscribers, options)
  2082. };
  2083. Store.prototype.subscribeAction = function subscribeAction (fn, options) {
  2084. var subs = typeof fn === 'function' ? { before: fn } : fn;
  2085. return genericSubscribe(subs, this._actionSubscribers, options)
  2086. };
  2087. Store.prototype.watch = function watch (getter, cb, options) {
  2088. var this$1 = this;
  2089. if ((true)) {
  2090. assert(typeof getter === 'function', "store.watch only accepts a function.");
  2091. }
  2092. return this._watcherVM.$watch(function () { return getter(this$1.state, this$1.getters); }, cb, options)
  2093. };
  2094. Store.prototype.replaceState = function replaceState (state) {
  2095. var this$1 = this;
  2096. this._withCommit(function () {
  2097. this$1._vm._data.$$state = state;
  2098. });
  2099. };
  2100. Store.prototype.registerModule = function registerModule (path, rawModule, options) {
  2101. if ( options === void 0 ) options = {};
  2102. if (typeof path === 'string') { path = [path]; }
  2103. if ((true)) {
  2104. assert(Array.isArray(path), "module path must be a string or an Array.");
  2105. assert(path.length > 0, 'cannot register the root module by using registerModule.');
  2106. }
  2107. this._modules.register(path, rawModule);
  2108. installModule(this, this.state, path, this._modules.get(path), options.preserveState);
  2109. // reset store to update getters...
  2110. resetStoreVM(this, this.state);
  2111. };
  2112. Store.prototype.unregisterModule = function unregisterModule (path) {
  2113. var this$1 = this;
  2114. if (typeof path === 'string') { path = [path]; }
  2115. if ((true)) {
  2116. assert(Array.isArray(path), "module path must be a string or an Array.");
  2117. }
  2118. this._modules.unregister(path);
  2119. this._withCommit(function () {
  2120. var parentState = getNestedState(this$1.state, path.slice(0, -1));
  2121. Vue.delete(parentState, path[path.length - 1]);
  2122. });
  2123. resetStore(this);
  2124. };
  2125. Store.prototype.hasModule = function hasModule (path) {
  2126. if (typeof path === 'string') { path = [path]; }
  2127. if ((true)) {
  2128. assert(Array.isArray(path), "module path must be a string or an Array.");
  2129. }
  2130. return this._modules.isRegistered(path)
  2131. };
  2132. Store.prototype.hotUpdate = function hotUpdate (newOptions) {
  2133. this._modules.update(newOptions);
  2134. resetStore(this, true);
  2135. };
  2136. Store.prototype._withCommit = function _withCommit (fn) {
  2137. var committing = this._committing;
  2138. this._committing = true;
  2139. fn();
  2140. this._committing = committing;
  2141. };
  2142. Object.defineProperties( Store.prototype, prototypeAccessors$1 );
  2143. function genericSubscribe (fn, subs, options) {
  2144. if (subs.indexOf(fn) < 0) {
  2145. options && options.prepend
  2146. ? subs.unshift(fn)
  2147. : subs.push(fn);
  2148. }
  2149. return function () {
  2150. var i = subs.indexOf(fn);
  2151. if (i > -1) {
  2152. subs.splice(i, 1);
  2153. }
  2154. }
  2155. }
  2156. function resetStore (store, hot) {
  2157. store._actions = Object.create(null);
  2158. store._mutations = Object.create(null);
  2159. store._wrappedGetters = Object.create(null);
  2160. store._modulesNamespaceMap = Object.create(null);
  2161. var state = store.state;
  2162. // init all modules
  2163. installModule(store, state, [], store._modules.root, true);
  2164. // reset vm
  2165. resetStoreVM(store, state, hot);
  2166. }
  2167. function resetStoreVM (store, state, hot) {
  2168. var oldVm = store._vm;
  2169. // bind store public getters
  2170. store.getters = {};
  2171. // reset local getters cache
  2172. store._makeLocalGettersCache = Object.create(null);
  2173. var wrappedGetters = store._wrappedGetters;
  2174. var computed = {};
  2175. forEachValue(wrappedGetters, function (fn, key) {
  2176. // use computed to leverage its lazy-caching mechanism
  2177. // direct inline function use will lead to closure preserving oldVm.
  2178. // using partial to return function with only arguments preserved in closure environment.
  2179. computed[key] = partial(fn, store);
  2180. Object.defineProperty(store.getters, key, {
  2181. get: function () { return store._vm[key]; },
  2182. enumerable: true // for local getters
  2183. });
  2184. });
  2185. // use a Vue instance to store the state tree
  2186. // suppress warnings just in case the user has added
  2187. // some funky global mixins
  2188. var silent = Vue.config.silent;
  2189. Vue.config.silent = true;
  2190. store._vm = new Vue({
  2191. data: {
  2192. $$state: state
  2193. },
  2194. computed: computed
  2195. });
  2196. Vue.config.silent = silent;
  2197. // enable strict mode for new vm
  2198. if (store.strict) {
  2199. enableStrictMode(store);
  2200. }
  2201. if (oldVm) {
  2202. if (hot) {
  2203. // dispatch changes in all subscribed watchers
  2204. // to force getter re-evaluation for hot reloading.
  2205. store._withCommit(function () {
  2206. oldVm._data.$$state = null;
  2207. });
  2208. }
  2209. Vue.nextTick(function () { return oldVm.$destroy(); });
  2210. }
  2211. }
  2212. function installModule (store, rootState, path, module, hot) {
  2213. var isRoot = !path.length;
  2214. var namespace = store._modules.getNamespace(path);
  2215. // register in namespace map
  2216. if (module.namespaced) {
  2217. if (store._modulesNamespaceMap[namespace] && ("development" !== 'production')) {
  2218. console.error(("[vuex] duplicate namespace " + namespace + " for the namespaced module " + (path.join('/'))));
  2219. }
  2220. store._modulesNamespaceMap[namespace] = module;
  2221. }
  2222. // set state
  2223. if (!isRoot && !hot) {
  2224. var parentState = getNestedState(rootState, path.slice(0, -1));
  2225. var moduleName = path[path.length - 1];
  2226. store._withCommit(function () {
  2227. if ((true)) {
  2228. if (moduleName in parentState) {
  2229. console.warn(
  2230. ("[vuex] state field \"" + moduleName + "\" was overridden by a module with the same name at \"" + (path.join('.')) + "\"")
  2231. );
  2232. }
  2233. }
  2234. Vue.set(parentState, moduleName, module.state);
  2235. });
  2236. }
  2237. var local = module.context = makeLocalContext(store, namespace, path);
  2238. module.forEachMutation(function (mutation, key) {
  2239. var namespacedType = namespace + key;
  2240. registerMutation(store, namespacedType, mutation, local);
  2241. });
  2242. module.forEachAction(function (action, key) {
  2243. var type = action.root ? key : namespace + key;
  2244. var handler = action.handler || action;
  2245. registerAction(store, type, handler, local);
  2246. });
  2247. module.forEachGetter(function (getter, key) {
  2248. var namespacedType = namespace + key;
  2249. registerGetter(store, namespacedType, getter, local);
  2250. });
  2251. module.forEachChild(function (child, key) {
  2252. installModule(store, rootState, path.concat(key), child, hot);
  2253. });
  2254. }
  2255. /**
  2256. * make localized dispatch, commit, getters and state
  2257. * if there is no namespace, just use root ones
  2258. */
  2259. function makeLocalContext (store, namespace, path) {
  2260. var noNamespace = namespace === '';
  2261. var local = {
  2262. dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {
  2263. var args = unifyObjectStyle(_type, _payload, _options);
  2264. var payload = args.payload;
  2265. var options = args.options;
  2266. var type = args.type;
  2267. if (!options || !options.root) {
  2268. type = namespace + type;
  2269. if (( true) && !store._actions[type]) {
  2270. console.error(("[vuex] unknown local action type: " + (args.type) + ", global type: " + type));
  2271. return
  2272. }
  2273. }
  2274. return store.dispatch(type, payload)
  2275. },
  2276. commit: noNamespace ? store.commit : function (_type, _payload, _options) {
  2277. var args = unifyObjectStyle(_type, _payload, _options);
  2278. var payload = args.payload;
  2279. var options = args.options;
  2280. var type = args.type;
  2281. if (!options || !options.root) {
  2282. type = namespace + type;
  2283. if (( true) && !store._mutations[type]) {
  2284. console.error(("[vuex] unknown local mutation type: " + (args.type) + ", global type: " + type));
  2285. return
  2286. }
  2287. }
  2288. store.commit(type, payload, options);
  2289. }
  2290. };
  2291. // getters and state object must be gotten lazily
  2292. // because they will be changed by vm update
  2293. Object.defineProperties(local, {
  2294. getters: {
  2295. get: noNamespace
  2296. ? function () { return store.getters; }
  2297. : function () { return makeLocalGetters(store, namespace); }
  2298. },
  2299. state: {
  2300. get: function () { return getNestedState(store.state, path); }
  2301. }
  2302. });
  2303. return local
  2304. }
  2305. function makeLocalGetters (store, namespace) {
  2306. if (!store._makeLocalGettersCache[namespace]) {
  2307. var gettersProxy = {};
  2308. var splitPos = namespace.length;
  2309. Object.keys(store.getters).forEach(function (type) {
  2310. // skip if the target getter is not match this namespace
  2311. if (type.slice(0, splitPos) !== namespace) { return }
  2312. // extract local getter type
  2313. var localType = type.slice(splitPos);
  2314. // Add a port to the getters proxy.
  2315. // Define as getter property because
  2316. // we do not want to evaluate the getters in this time.
  2317. Object.defineProperty(gettersProxy, localType, {
  2318. get: function () { return store.getters[type]; },
  2319. enumerable: true
  2320. });
  2321. });
  2322. store._makeLocalGettersCache[namespace] = gettersProxy;
  2323. }
  2324. return store._makeLocalGettersCache[namespace]
  2325. }
  2326. function registerMutation (store, type, handler, local) {
  2327. var entry = store._mutations[type] || (store._mutations[type] = []);
  2328. entry.push(function wrappedMutationHandler (payload) {
  2329. handler.call(store, local.state, payload);
  2330. });
  2331. }
  2332. function registerAction (store, type, handler, local) {
  2333. var entry = store._actions[type] || (store._actions[type] = []);
  2334. entry.push(function wrappedActionHandler (payload) {
  2335. var res = handler.call(store, {
  2336. dispatch: local.dispatch,
  2337. commit: local.commit,
  2338. getters: local.getters,
  2339. state: local.state,
  2340. rootGetters: store.getters,
  2341. rootState: store.state
  2342. }, payload);
  2343. if (!isPromise(res)) {
  2344. res = Promise.resolve(res);
  2345. }
  2346. if (store._devtoolHook) {
  2347. return res.catch(function (err) {
  2348. store._devtoolHook.emit('vuex:error', err);
  2349. throw err
  2350. })
  2351. } else {
  2352. return res
  2353. }
  2354. });
  2355. }
  2356. function registerGetter (store, type, rawGetter, local) {
  2357. if (store._wrappedGetters[type]) {
  2358. if ((true)) {
  2359. console.error(("[vuex] duplicate getter key: " + type));
  2360. }
  2361. return
  2362. }
  2363. store._wrappedGetters[type] = function wrappedGetter (store) {
  2364. return rawGetter(
  2365. local.state, // local state
  2366. local.getters, // local getters
  2367. store.state, // root state
  2368. store.getters // root getters
  2369. )
  2370. };
  2371. }
  2372. function enableStrictMode (store) {
  2373. store._vm.$watch(function () { return this._data.$$state }, function () {
  2374. if ((true)) {
  2375. assert(store._committing, "do not mutate vuex store state outside mutation handlers.");
  2376. }
  2377. }, { deep: true, sync: true });
  2378. }
  2379. function getNestedState (state, path) {
  2380. return path.reduce(function (state, key) { return state[key]; }, state)
  2381. }
  2382. function unifyObjectStyle (type, payload, options) {
  2383. if (isObject(type) && type.type) {
  2384. options = payload;
  2385. payload = type;
  2386. type = type.type;
  2387. }
  2388. if ((true)) {
  2389. assert(typeof type === 'string', ("expects string as the type, but found " + (typeof type) + "."));
  2390. }
  2391. return { type: type, payload: payload, options: options }
  2392. }
  2393. function install (_Vue) {
  2394. if (Vue && _Vue === Vue) {
  2395. if ((true)) {
  2396. console.error(
  2397. '[vuex] already installed. Vue.use(Vuex) should be called only once.'
  2398. );
  2399. }
  2400. return
  2401. }
  2402. Vue = _Vue;
  2403. applyMixin(Vue);
  2404. }
  2405. /**
  2406. * Reduce the code which written in Vue.js for getting the state.
  2407. * @param {String} [namespace] - Module's namespace
  2408. * @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.
  2409. * @param {Object}
  2410. */
  2411. var mapState = normalizeNamespace(function (namespace, states) {
  2412. var res = {};
  2413. if (( true) && !isValidMap(states)) {
  2414. console.error('[vuex] mapState: mapper parameter must be either an Array or an Object');
  2415. }
  2416. normalizeMap(states).forEach(function (ref) {
  2417. var key = ref.key;
  2418. var val = ref.val;
  2419. res[key] = function mappedState () {
  2420. var state = this.$store.state;
  2421. var getters = this.$store.getters;
  2422. if (namespace) {
  2423. var module = getModuleByNamespace(this.$store, 'mapState', namespace);
  2424. if (!module) {
  2425. return
  2426. }
  2427. state = module.context.state;
  2428. getters = module.context.getters;
  2429. }
  2430. return typeof val === 'function'
  2431. ? val.call(this, state, getters)
  2432. : state[val]
  2433. };
  2434. // mark vuex getter for devtools
  2435. res[key].vuex = true;
  2436. });
  2437. return res
  2438. });
  2439. /**
  2440. * Reduce the code which written in Vue.js for committing the mutation
  2441. * @param {String} [namespace] - Module's namespace
  2442. * @param {Object|Array} mutations # Object's item can be a function which accept `commit` function as the first param, it can accept anthor params. You can commit mutation and do any other things in this function. specially, You need to pass anthor params from the mapped function.
  2443. * @return {Object}
  2444. */
  2445. var mapMutations = normalizeNamespace(function (namespace, mutations) {
  2446. var res = {};
  2447. if (( true) && !isValidMap(mutations)) {
  2448. console.error('[vuex] mapMutations: mapper parameter must be either an Array or an Object');
  2449. }
  2450. normalizeMap(mutations).forEach(function (ref) {
  2451. var key = ref.key;
  2452. var val = ref.val;
  2453. res[key] = function mappedMutation () {
  2454. var args = [], len = arguments.length;
  2455. while ( len-- ) args[ len ] = arguments[ len ];
  2456. // Get the commit method from store
  2457. var commit = this.$store.commit;
  2458. if (namespace) {
  2459. var module = getModuleByNamespace(this.$store, 'mapMutations', namespace);
  2460. if (!module) {
  2461. return
  2462. }
  2463. commit = module.context.commit;
  2464. }
  2465. return typeof val === 'function'
  2466. ? val.apply(this, [commit].concat(args))
  2467. : commit.apply(this.$store, [val].concat(args))
  2468. };
  2469. });
  2470. return res
  2471. });
  2472. /**
  2473. * Reduce the code which written in Vue.js for getting the getters
  2474. * @param {String} [namespace] - Module's namespace
  2475. * @param {Object|Array} getters
  2476. * @return {Object}
  2477. */
  2478. var mapGetters = normalizeNamespace(function (namespace, getters) {
  2479. var res = {};
  2480. if (( true) && !isValidMap(getters)) {
  2481. console.error('[vuex] mapGetters: mapper parameter must be either an Array or an Object');
  2482. }
  2483. normalizeMap(getters).forEach(function (ref) {
  2484. var key = ref.key;
  2485. var val = ref.val;
  2486. // The namespace has been mutated by normalizeNamespace
  2487. val = namespace + val;
  2488. res[key] = function mappedGetter () {
  2489. if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {
  2490. return
  2491. }
  2492. if (( true) && !(val in this.$store.getters)) {
  2493. console.error(("[vuex] unknown getter: " + val));
  2494. return
  2495. }
  2496. return this.$store.getters[val]
  2497. };
  2498. // mark vuex getter for devtools
  2499. res[key].vuex = true;
  2500. });
  2501. return res
  2502. });
  2503. /**
  2504. * Reduce the code which written in Vue.js for dispatch the action
  2505. * @param {String} [namespace] - Module's namespace
  2506. * @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.
  2507. * @return {Object}
  2508. */
  2509. var mapActions = normalizeNamespace(function (namespace, actions) {
  2510. var res = {};
  2511. if (( true) && !isValidMap(actions)) {
  2512. console.error('[vuex] mapActions: mapper parameter must be either an Array or an Object');
  2513. }
  2514. normalizeMap(actions).forEach(function (ref) {
  2515. var key = ref.key;
  2516. var val = ref.val;
  2517. res[key] = function mappedAction () {
  2518. var args = [], len = arguments.length;
  2519. while ( len-- ) args[ len ] = arguments[ len ];
  2520. // get dispatch function from store
  2521. var dispatch = this.$store.dispatch;
  2522. if (namespace) {
  2523. var module = getModuleByNamespace(this.$store, 'mapActions', namespace);
  2524. if (!module) {
  2525. return
  2526. }
  2527. dispatch = module.context.dispatch;
  2528. }
  2529. return typeof val === 'function'
  2530. ? val.apply(this, [dispatch].concat(args))
  2531. : dispatch.apply(this.$store, [val].concat(args))
  2532. };
  2533. });
  2534. return res
  2535. });
  2536. /**
  2537. * Rebinding namespace param for mapXXX function in special scoped, and return them by simple object
  2538. * @param {String} namespace
  2539. * @return {Object}
  2540. */
  2541. var createNamespacedHelpers = function (namespace) { return ({
  2542. mapState: mapState.bind(null, namespace),
  2543. mapGetters: mapGetters.bind(null, namespace),
  2544. mapMutations: mapMutations.bind(null, namespace),
  2545. mapActions: mapActions.bind(null, namespace)
  2546. }); };
  2547. /**
  2548. * Normalize the map
  2549. * normalizeMap([1, 2, 3]) => [ { key: 1, val: 1 }, { key: 2, val: 2 }, { key: 3, val: 3 } ]
  2550. * normalizeMap({a: 1, b: 2, c: 3}) => [ { key: 'a', val: 1 }, { key: 'b', val: 2 }, { key: 'c', val: 3 } ]
  2551. * @param {Array|Object} map
  2552. * @return {Object}
  2553. */
  2554. function normalizeMap (map) {
  2555. if (!isValidMap(map)) {
  2556. return []
  2557. }
  2558. return Array.isArray(map)
  2559. ? map.map(function (key) { return ({ key: key, val: key }); })
  2560. : Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })
  2561. }
  2562. /**
  2563. * Validate whether given map is valid or not
  2564. * @param {*} map
  2565. * @return {Boolean}
  2566. */
  2567. function isValidMap (map) {
  2568. return Array.isArray(map) || isObject(map)
  2569. }
  2570. /**
  2571. * 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.
  2572. * @param {Function} fn
  2573. * @return {Function}
  2574. */
  2575. function normalizeNamespace (fn) {
  2576. return function (namespace, map) {
  2577. if (typeof namespace !== 'string') {
  2578. map = namespace;
  2579. namespace = '';
  2580. } else if (namespace.charAt(namespace.length - 1) !== '/') {
  2581. namespace += '/';
  2582. }
  2583. return fn(namespace, map)
  2584. }
  2585. }
  2586. /**
  2587. * Search a special module from store by namespace. if module not exist, print error message.
  2588. * @param {Object} store
  2589. * @param {String} helper
  2590. * @param {String} namespace
  2591. * @return {Object}
  2592. */
  2593. function getModuleByNamespace (store, helper, namespace) {
  2594. var module = store._modulesNamespaceMap[namespace];
  2595. if (( true) && !module) {
  2596. console.error(("[vuex] module namespace not found in " + helper + "(): " + namespace));
  2597. }
  2598. return module
  2599. }
  2600. var index = {
  2601. Store: Store,
  2602. install: install,
  2603. version: '3.4.0',
  2604. mapState: mapState,
  2605. mapMutations: mapMutations,
  2606. mapGetters: mapGetters,
  2607. mapActions: mapActions,
  2608. createNamespacedHelpers: createNamespacedHelpers
  2609. };
  2610. /* harmony default export */ __webpack_exports__["default"] = (index);
  2611. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ 3)))
  2612. /***/ }),
  2613. /***/ 2:
  2614. /*!******************************************************************************************!*\
  2615. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  2616. \******************************************************************************************/
  2617. /*! exports provided: default */
  2618. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2619. "use strict";
  2620. __webpack_require__.r(__webpack_exports__);
  2621. /* WEBPACK VAR INJECTION */(function(global) {/*!
  2622. * Vue.js v2.6.11
  2623. * (c) 2014-2020 Evan You
  2624. * Released under the MIT License.
  2625. */
  2626. /* */
  2627. var emptyObject = Object.freeze({});
  2628. // These helpers produce better VM code in JS engines due to their
  2629. // explicitness and function inlining.
  2630. function isUndef (v) {
  2631. return v === undefined || v === null
  2632. }
  2633. function isDef (v) {
  2634. return v !== undefined && v !== null
  2635. }
  2636. function isTrue (v) {
  2637. return v === true
  2638. }
  2639. function isFalse (v) {
  2640. return v === false
  2641. }
  2642. /**
  2643. * Check if value is primitive.
  2644. */
  2645. function isPrimitive (value) {
  2646. return (
  2647. typeof value === 'string' ||
  2648. typeof value === 'number' ||
  2649. // $flow-disable-line
  2650. typeof value === 'symbol' ||
  2651. typeof value === 'boolean'
  2652. )
  2653. }
  2654. /**
  2655. * Quick object check - this is primarily used to tell
  2656. * Objects from primitive values when we know the value
  2657. * is a JSON-compliant type.
  2658. */
  2659. function isObject (obj) {
  2660. return obj !== null && typeof obj === 'object'
  2661. }
  2662. /**
  2663. * Get the raw type string of a value, e.g., [object Object].
  2664. */
  2665. var _toString = Object.prototype.toString;
  2666. function toRawType (value) {
  2667. return _toString.call(value).slice(8, -1)
  2668. }
  2669. /**
  2670. * Strict object type check. Only returns true
  2671. * for plain JavaScript objects.
  2672. */
  2673. function isPlainObject (obj) {
  2674. return _toString.call(obj) === '[object Object]'
  2675. }
  2676. function isRegExp (v) {
  2677. return _toString.call(v) === '[object RegExp]'
  2678. }
  2679. /**
  2680. * Check if val is a valid array index.
  2681. */
  2682. function isValidArrayIndex (val) {
  2683. var n = parseFloat(String(val));
  2684. return n >= 0 && Math.floor(n) === n && isFinite(val)
  2685. }
  2686. function isPromise (val) {
  2687. return (
  2688. isDef(val) &&
  2689. typeof val.then === 'function' &&
  2690. typeof val.catch === 'function'
  2691. )
  2692. }
  2693. /**
  2694. * Convert a value to a string that is actually rendered.
  2695. */
  2696. function toString (val) {
  2697. return val == null
  2698. ? ''
  2699. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  2700. ? JSON.stringify(val, null, 2)
  2701. : String(val)
  2702. }
  2703. /**
  2704. * Convert an input value to a number for persistence.
  2705. * If the conversion fails, return original string.
  2706. */
  2707. function toNumber (val) {
  2708. var n = parseFloat(val);
  2709. return isNaN(n) ? val : n
  2710. }
  2711. /**
  2712. * Make a map and return a function for checking if a key
  2713. * is in that map.
  2714. */
  2715. function makeMap (
  2716. str,
  2717. expectsLowerCase
  2718. ) {
  2719. var map = Object.create(null);
  2720. var list = str.split(',');
  2721. for (var i = 0; i < list.length; i++) {
  2722. map[list[i]] = true;
  2723. }
  2724. return expectsLowerCase
  2725. ? function (val) { return map[val.toLowerCase()]; }
  2726. : function (val) { return map[val]; }
  2727. }
  2728. /**
  2729. * Check if a tag is a built-in tag.
  2730. */
  2731. var isBuiltInTag = makeMap('slot,component', true);
  2732. /**
  2733. * Check if an attribute is a reserved attribute.
  2734. */
  2735. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  2736. /**
  2737. * Remove an item from an array.
  2738. */
  2739. function remove (arr, item) {
  2740. if (arr.length) {
  2741. var index = arr.indexOf(item);
  2742. if (index > -1) {
  2743. return arr.splice(index, 1)
  2744. }
  2745. }
  2746. }
  2747. /**
  2748. * Check whether an object has the property.
  2749. */
  2750. var hasOwnProperty = Object.prototype.hasOwnProperty;
  2751. function hasOwn (obj, key) {
  2752. return hasOwnProperty.call(obj, key)
  2753. }
  2754. /**
  2755. * Create a cached version of a pure function.
  2756. */
  2757. function cached (fn) {
  2758. var cache = Object.create(null);
  2759. return (function cachedFn (str) {
  2760. var hit = cache[str];
  2761. return hit || (cache[str] = fn(str))
  2762. })
  2763. }
  2764. /**
  2765. * Camelize a hyphen-delimited string.
  2766. */
  2767. var camelizeRE = /-(\w)/g;
  2768. var camelize = cached(function (str) {
  2769. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  2770. });
  2771. /**
  2772. * Capitalize a string.
  2773. */
  2774. var capitalize = cached(function (str) {
  2775. return str.charAt(0).toUpperCase() + str.slice(1)
  2776. });
  2777. /**
  2778. * Hyphenate a camelCase string.
  2779. */
  2780. var hyphenateRE = /\B([A-Z])/g;
  2781. var hyphenate = cached(function (str) {
  2782. return str.replace(hyphenateRE, '-$1').toLowerCase()
  2783. });
  2784. /**
  2785. * Simple bind polyfill for environments that do not support it,
  2786. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  2787. * since native bind is now performant enough in most browsers.
  2788. * But removing it would mean breaking code that was able to run in
  2789. * PhantomJS 1.x, so this must be kept for backward compatibility.
  2790. */
  2791. /* istanbul ignore next */
  2792. function polyfillBind (fn, ctx) {
  2793. function boundFn (a) {
  2794. var l = arguments.length;
  2795. return l
  2796. ? l > 1
  2797. ? fn.apply(ctx, arguments)
  2798. : fn.call(ctx, a)
  2799. : fn.call(ctx)
  2800. }
  2801. boundFn._length = fn.length;
  2802. return boundFn
  2803. }
  2804. function nativeBind (fn, ctx) {
  2805. return fn.bind(ctx)
  2806. }
  2807. var bind = Function.prototype.bind
  2808. ? nativeBind
  2809. : polyfillBind;
  2810. /**
  2811. * Convert an Array-like object to a real Array.
  2812. */
  2813. function toArray (list, start) {
  2814. start = start || 0;
  2815. var i = list.length - start;
  2816. var ret = new Array(i);
  2817. while (i--) {
  2818. ret[i] = list[i + start];
  2819. }
  2820. return ret
  2821. }
  2822. /**
  2823. * Mix properties into target object.
  2824. */
  2825. function extend (to, _from) {
  2826. for (var key in _from) {
  2827. to[key] = _from[key];
  2828. }
  2829. return to
  2830. }
  2831. /**
  2832. * Merge an Array of Objects into a single Object.
  2833. */
  2834. function toObject (arr) {
  2835. var res = {};
  2836. for (var i = 0; i < arr.length; i++) {
  2837. if (arr[i]) {
  2838. extend(res, arr[i]);
  2839. }
  2840. }
  2841. return res
  2842. }
  2843. /* eslint-disable no-unused-vars */
  2844. /**
  2845. * Perform no operation.
  2846. * Stubbing args to make Flow happy without leaving useless transpiled code
  2847. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  2848. */
  2849. function noop (a, b, c) {}
  2850. /**
  2851. * Always return false.
  2852. */
  2853. var no = function (a, b, c) { return false; };
  2854. /* eslint-enable no-unused-vars */
  2855. /**
  2856. * Return the same value.
  2857. */
  2858. var identity = function (_) { return _; };
  2859. /**
  2860. * Check if two values are loosely equal - that is,
  2861. * if they are plain objects, do they have the same shape?
  2862. */
  2863. function looseEqual (a, b) {
  2864. if (a === b) { return true }
  2865. var isObjectA = isObject(a);
  2866. var isObjectB = isObject(b);
  2867. if (isObjectA && isObjectB) {
  2868. try {
  2869. var isArrayA = Array.isArray(a);
  2870. var isArrayB = Array.isArray(b);
  2871. if (isArrayA && isArrayB) {
  2872. return a.length === b.length && a.every(function (e, i) {
  2873. return looseEqual(e, b[i])
  2874. })
  2875. } else if (a instanceof Date && b instanceof Date) {
  2876. return a.getTime() === b.getTime()
  2877. } else if (!isArrayA && !isArrayB) {
  2878. var keysA = Object.keys(a);
  2879. var keysB = Object.keys(b);
  2880. return keysA.length === keysB.length && keysA.every(function (key) {
  2881. return looseEqual(a[key], b[key])
  2882. })
  2883. } else {
  2884. /* istanbul ignore next */
  2885. return false
  2886. }
  2887. } catch (e) {
  2888. /* istanbul ignore next */
  2889. return false
  2890. }
  2891. } else if (!isObjectA && !isObjectB) {
  2892. return String(a) === String(b)
  2893. } else {
  2894. return false
  2895. }
  2896. }
  2897. /**
  2898. * Return the first index at which a loosely equal value can be
  2899. * found in the array (if value is a plain object, the array must
  2900. * contain an object of the same shape), or -1 if it is not present.
  2901. */
  2902. function looseIndexOf (arr, val) {
  2903. for (var i = 0; i < arr.length; i++) {
  2904. if (looseEqual(arr[i], val)) { return i }
  2905. }
  2906. return -1
  2907. }
  2908. /**
  2909. * Ensure a function is called only once.
  2910. */
  2911. function once (fn) {
  2912. var called = false;
  2913. return function () {
  2914. if (!called) {
  2915. called = true;
  2916. fn.apply(this, arguments);
  2917. }
  2918. }
  2919. }
  2920. var ASSET_TYPES = [
  2921. 'component',
  2922. 'directive',
  2923. 'filter'
  2924. ];
  2925. var LIFECYCLE_HOOKS = [
  2926. 'beforeCreate',
  2927. 'created',
  2928. 'beforeMount',
  2929. 'mounted',
  2930. 'beforeUpdate',
  2931. 'updated',
  2932. 'beforeDestroy',
  2933. 'destroyed',
  2934. 'activated',
  2935. 'deactivated',
  2936. 'errorCaptured',
  2937. 'serverPrefetch'
  2938. ];
  2939. /* */
  2940. var config = ({
  2941. /**
  2942. * Option merge strategies (used in core/util/options)
  2943. */
  2944. // $flow-disable-line
  2945. optionMergeStrategies: Object.create(null),
  2946. /**
  2947. * Whether to suppress warnings.
  2948. */
  2949. silent: false,
  2950. /**
  2951. * Show production mode tip message on boot?
  2952. */
  2953. productionTip: "development" !== 'production',
  2954. /**
  2955. * Whether to enable devtools
  2956. */
  2957. devtools: "development" !== 'production',
  2958. /**
  2959. * Whether to record perf
  2960. */
  2961. performance: false,
  2962. /**
  2963. * Error handler for watcher errors
  2964. */
  2965. errorHandler: null,
  2966. /**
  2967. * Warn handler for watcher warns
  2968. */
  2969. warnHandler: null,
  2970. /**
  2971. * Ignore certain custom elements
  2972. */
  2973. ignoredElements: [],
  2974. /**
  2975. * Custom user key aliases for v-on
  2976. */
  2977. // $flow-disable-line
  2978. keyCodes: Object.create(null),
  2979. /**
  2980. * Check if a tag is reserved so that it cannot be registered as a
  2981. * component. This is platform-dependent and may be overwritten.
  2982. */
  2983. isReservedTag: no,
  2984. /**
  2985. * Check if an attribute is reserved so that it cannot be used as a component
  2986. * prop. This is platform-dependent and may be overwritten.
  2987. */
  2988. isReservedAttr: no,
  2989. /**
  2990. * Check if a tag is an unknown element.
  2991. * Platform-dependent.
  2992. */
  2993. isUnknownElement: no,
  2994. /**
  2995. * Get the namespace of an element
  2996. */
  2997. getTagNamespace: noop,
  2998. /**
  2999. * Parse the real tag name for the specific platform.
  3000. */
  3001. parsePlatformTagName: identity,
  3002. /**
  3003. * Check if an attribute must be bound using property, e.g. value
  3004. * Platform-dependent.
  3005. */
  3006. mustUseProp: no,
  3007. /**
  3008. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  3009. * This will significantly reduce performance if set to false.
  3010. */
  3011. async: true,
  3012. /**
  3013. * Exposed for legacy reasons
  3014. */
  3015. _lifecycleHooks: LIFECYCLE_HOOKS
  3016. });
  3017. /* */
  3018. /**
  3019. * unicode letters used for parsing html tags, component names and property paths.
  3020. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  3021. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  3022. */
  3023. 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/;
  3024. /**
  3025. * Check if a string starts with $ or _
  3026. */
  3027. function isReserved (str) {
  3028. var c = (str + '').charCodeAt(0);
  3029. return c === 0x24 || c === 0x5F
  3030. }
  3031. /**
  3032. * Define a property.
  3033. */
  3034. function def (obj, key, val, enumerable) {
  3035. Object.defineProperty(obj, key, {
  3036. value: val,
  3037. enumerable: !!enumerable,
  3038. writable: true,
  3039. configurable: true
  3040. });
  3041. }
  3042. /**
  3043. * Parse simple path.
  3044. */
  3045. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  3046. function parsePath (path) {
  3047. if (bailRE.test(path)) {
  3048. return
  3049. }
  3050. var segments = path.split('.');
  3051. return function (obj) {
  3052. for (var i = 0; i < segments.length; i++) {
  3053. if (!obj) { return }
  3054. obj = obj[segments[i]];
  3055. }
  3056. return obj
  3057. }
  3058. }
  3059. /* */
  3060. // can we use __proto__?
  3061. var hasProto = '__proto__' in {};
  3062. // Browser environment sniffing
  3063. var inBrowser = typeof window !== 'undefined';
  3064. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  3065. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  3066. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  3067. var isIE = UA && /msie|trident/.test(UA);
  3068. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  3069. var isEdge = UA && UA.indexOf('edge/') > 0;
  3070. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  3071. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  3072. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  3073. var isPhantomJS = UA && /phantomjs/.test(UA);
  3074. var isFF = UA && UA.match(/firefox\/(\d+)/);
  3075. // Firefox has a "watch" function on Object.prototype...
  3076. var nativeWatch = ({}).watch;
  3077. if (inBrowser) {
  3078. try {
  3079. var opts = {};
  3080. Object.defineProperty(opts, 'passive', ({
  3081. get: function get () {
  3082. }
  3083. })); // https://github.com/facebook/flow/issues/285
  3084. window.addEventListener('test-passive', null, opts);
  3085. } catch (e) {}
  3086. }
  3087. // this needs to be lazy-evaled because vue may be required before
  3088. // vue-server-renderer can set VUE_ENV
  3089. var _isServer;
  3090. var isServerRendering = function () {
  3091. if (_isServer === undefined) {
  3092. /* istanbul ignore if */
  3093. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  3094. // detect presence of vue-server-renderer and avoid
  3095. // Webpack shimming the process
  3096. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  3097. } else {
  3098. _isServer = false;
  3099. }
  3100. }
  3101. return _isServer
  3102. };
  3103. // detect devtools
  3104. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  3105. /* istanbul ignore next */
  3106. function isNative (Ctor) {
  3107. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  3108. }
  3109. var hasSymbol =
  3110. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  3111. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  3112. var _Set;
  3113. /* istanbul ignore if */ // $flow-disable-line
  3114. if (typeof Set !== 'undefined' && isNative(Set)) {
  3115. // use native Set when available.
  3116. _Set = Set;
  3117. } else {
  3118. // a non-standard Set polyfill that only works with primitive keys.
  3119. _Set = /*@__PURE__*/(function () {
  3120. function Set () {
  3121. this.set = Object.create(null);
  3122. }
  3123. Set.prototype.has = function has (key) {
  3124. return this.set[key] === true
  3125. };
  3126. Set.prototype.add = function add (key) {
  3127. this.set[key] = true;
  3128. };
  3129. Set.prototype.clear = function clear () {
  3130. this.set = Object.create(null);
  3131. };
  3132. return Set;
  3133. }());
  3134. }
  3135. /* */
  3136. var warn = noop;
  3137. var tip = noop;
  3138. var generateComponentTrace = (noop); // work around flow check
  3139. var formatComponentName = (noop);
  3140. if (true) {
  3141. var hasConsole = typeof console !== 'undefined';
  3142. var classifyRE = /(?:^|[-_])(\w)/g;
  3143. var classify = function (str) { return str
  3144. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  3145. .replace(/[-_]/g, ''); };
  3146. warn = function (msg, vm) {
  3147. var trace = vm ? generateComponentTrace(vm) : '';
  3148. if (config.warnHandler) {
  3149. config.warnHandler.call(null, msg, vm, trace);
  3150. } else if (hasConsole && (!config.silent)) {
  3151. console.error(("[Vue warn]: " + msg + trace));
  3152. }
  3153. };
  3154. tip = function (msg, vm) {
  3155. if (hasConsole && (!config.silent)) {
  3156. console.warn("[Vue tip]: " + msg + (
  3157. vm ? generateComponentTrace(vm) : ''
  3158. ));
  3159. }
  3160. };
  3161. formatComponentName = function (vm, includeFile) {
  3162. if (vm.$root === vm) {
  3163. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  3164. return ('') + vm.$options.__file
  3165. }
  3166. return '<Root>'
  3167. }
  3168. var options = typeof vm === 'function' && vm.cid != null
  3169. ? vm.options
  3170. : vm._isVue
  3171. ? vm.$options || vm.constructor.options
  3172. : vm;
  3173. var name = options.name || options._componentTag;
  3174. var file = options.__file;
  3175. if (!name && file) {
  3176. var match = file.match(/([^/\\]+)\.vue$/);
  3177. name = match && match[1];
  3178. }
  3179. return (
  3180. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  3181. (file && includeFile !== false ? (" at " + file) : '')
  3182. )
  3183. };
  3184. var repeat = function (str, n) {
  3185. var res = '';
  3186. while (n) {
  3187. if (n % 2 === 1) { res += str; }
  3188. if (n > 1) { str += str; }
  3189. n >>= 1;
  3190. }
  3191. return res
  3192. };
  3193. generateComponentTrace = function (vm) {
  3194. if (vm._isVue && vm.$parent) {
  3195. var tree = [];
  3196. var currentRecursiveSequence = 0;
  3197. while (vm && vm.$options.name !== 'PageBody') {
  3198. if (tree.length > 0) {
  3199. var last = tree[tree.length - 1];
  3200. if (last.constructor === vm.constructor) {
  3201. currentRecursiveSequence++;
  3202. vm = vm.$parent;
  3203. continue
  3204. } else if (currentRecursiveSequence > 0) {
  3205. tree[tree.length - 1] = [last, currentRecursiveSequence];
  3206. currentRecursiveSequence = 0;
  3207. }
  3208. }
  3209. !vm.$options.isReserved && tree.push(vm);
  3210. vm = vm.$parent;
  3211. }
  3212. return '\n\nfound in\n\n' + tree
  3213. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  3214. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  3215. : formatComponentName(vm))); })
  3216. .join('\n')
  3217. } else {
  3218. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  3219. }
  3220. };
  3221. }
  3222. /* */
  3223. var uid = 0;
  3224. /**
  3225. * A dep is an observable that can have multiple
  3226. * directives subscribing to it.
  3227. */
  3228. var Dep = function Dep () {
  3229. this.id = uid++;
  3230. this.subs = [];
  3231. };
  3232. Dep.prototype.addSub = function addSub (sub) {
  3233. this.subs.push(sub);
  3234. };
  3235. Dep.prototype.removeSub = function removeSub (sub) {
  3236. remove(this.subs, sub);
  3237. };
  3238. Dep.prototype.depend = function depend () {
  3239. if (Dep.SharedObject.target) {
  3240. Dep.SharedObject.target.addDep(this);
  3241. }
  3242. };
  3243. Dep.prototype.notify = function notify () {
  3244. // stabilize the subscriber list first
  3245. var subs = this.subs.slice();
  3246. if ( true && !config.async) {
  3247. // subs aren't sorted in scheduler if not running async
  3248. // we need to sort them now to make sure they fire in correct
  3249. // order
  3250. subs.sort(function (a, b) { return a.id - b.id; });
  3251. }
  3252. for (var i = 0, l = subs.length; i < l; i++) {
  3253. subs[i].update();
  3254. }
  3255. };
  3256. // The current target watcher being evaluated.
  3257. // This is globally unique because only one watcher
  3258. // can be evaluated at a time.
  3259. // fixed by xxxxxx (nvue shared vuex)
  3260. /* eslint-disable no-undef */
  3261. Dep.SharedObject = {};
  3262. Dep.SharedObject.target = null;
  3263. Dep.SharedObject.targetStack = [];
  3264. function pushTarget (target) {
  3265. Dep.SharedObject.targetStack.push(target);
  3266. Dep.SharedObject.target = target;
  3267. }
  3268. function popTarget () {
  3269. Dep.SharedObject.targetStack.pop();
  3270. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  3271. }
  3272. /* */
  3273. var VNode = function VNode (
  3274. tag,
  3275. data,
  3276. children,
  3277. text,
  3278. elm,
  3279. context,
  3280. componentOptions,
  3281. asyncFactory
  3282. ) {
  3283. this.tag = tag;
  3284. this.data = data;
  3285. this.children = children;
  3286. this.text = text;
  3287. this.elm = elm;
  3288. this.ns = undefined;
  3289. this.context = context;
  3290. this.fnContext = undefined;
  3291. this.fnOptions = undefined;
  3292. this.fnScopeId = undefined;
  3293. this.key = data && data.key;
  3294. this.componentOptions = componentOptions;
  3295. this.componentInstance = undefined;
  3296. this.parent = undefined;
  3297. this.raw = false;
  3298. this.isStatic = false;
  3299. this.isRootInsert = true;
  3300. this.isComment = false;
  3301. this.isCloned = false;
  3302. this.isOnce = false;
  3303. this.asyncFactory = asyncFactory;
  3304. this.asyncMeta = undefined;
  3305. this.isAsyncPlaceholder = false;
  3306. };
  3307. var prototypeAccessors = { child: { configurable: true } };
  3308. // DEPRECATED: alias for componentInstance for backwards compat.
  3309. /* istanbul ignore next */
  3310. prototypeAccessors.child.get = function () {
  3311. return this.componentInstance
  3312. };
  3313. Object.defineProperties( VNode.prototype, prototypeAccessors );
  3314. var createEmptyVNode = function (text) {
  3315. if ( text === void 0 ) text = '';
  3316. var node = new VNode();
  3317. node.text = text;
  3318. node.isComment = true;
  3319. return node
  3320. };
  3321. function createTextVNode (val) {
  3322. return new VNode(undefined, undefined, undefined, String(val))
  3323. }
  3324. // optimized shallow clone
  3325. // used for static nodes and slot nodes because they may be reused across
  3326. // multiple renders, cloning them avoids errors when DOM manipulations rely
  3327. // on their elm reference.
  3328. function cloneVNode (vnode) {
  3329. var cloned = new VNode(
  3330. vnode.tag,
  3331. vnode.data,
  3332. // #7975
  3333. // clone children array to avoid mutating original in case of cloning
  3334. // a child.
  3335. vnode.children && vnode.children.slice(),
  3336. vnode.text,
  3337. vnode.elm,
  3338. vnode.context,
  3339. vnode.componentOptions,
  3340. vnode.asyncFactory
  3341. );
  3342. cloned.ns = vnode.ns;
  3343. cloned.isStatic = vnode.isStatic;
  3344. cloned.key = vnode.key;
  3345. cloned.isComment = vnode.isComment;
  3346. cloned.fnContext = vnode.fnContext;
  3347. cloned.fnOptions = vnode.fnOptions;
  3348. cloned.fnScopeId = vnode.fnScopeId;
  3349. cloned.asyncMeta = vnode.asyncMeta;
  3350. cloned.isCloned = true;
  3351. return cloned
  3352. }
  3353. /*
  3354. * not type checking this file because flow doesn't play well with
  3355. * dynamically accessing methods on Array prototype
  3356. */
  3357. var arrayProto = Array.prototype;
  3358. var arrayMethods = Object.create(arrayProto);
  3359. var methodsToPatch = [
  3360. 'push',
  3361. 'pop',
  3362. 'shift',
  3363. 'unshift',
  3364. 'splice',
  3365. 'sort',
  3366. 'reverse'
  3367. ];
  3368. /**
  3369. * Intercept mutating methods and emit events
  3370. */
  3371. methodsToPatch.forEach(function (method) {
  3372. // cache original method
  3373. var original = arrayProto[method];
  3374. def(arrayMethods, method, function mutator () {
  3375. var args = [], len = arguments.length;
  3376. while ( len-- ) args[ len ] = arguments[ len ];
  3377. var result = original.apply(this, args);
  3378. var ob = this.__ob__;
  3379. var inserted;
  3380. switch (method) {
  3381. case 'push':
  3382. case 'unshift':
  3383. inserted = args;
  3384. break
  3385. case 'splice':
  3386. inserted = args.slice(2);
  3387. break
  3388. }
  3389. if (inserted) { ob.observeArray(inserted); }
  3390. // notify change
  3391. ob.dep.notify();
  3392. return result
  3393. });
  3394. });
  3395. /* */
  3396. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  3397. /**
  3398. * In some cases we may want to disable observation inside a component's
  3399. * update computation.
  3400. */
  3401. var shouldObserve = true;
  3402. function toggleObserving (value) {
  3403. shouldObserve = value;
  3404. }
  3405. /**
  3406. * Observer class that is attached to each observed
  3407. * object. Once attached, the observer converts the target
  3408. * object's property keys into getter/setters that
  3409. * collect dependencies and dispatch updates.
  3410. */
  3411. var Observer = function Observer (value) {
  3412. this.value = value;
  3413. this.dep = new Dep();
  3414. this.vmCount = 0;
  3415. def(value, '__ob__', this);
  3416. if (Array.isArray(value)) {
  3417. if (hasProto) {
  3418. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  3419. if(value.push !== value.__proto__.push){
  3420. copyAugment(value, arrayMethods, arrayKeys);
  3421. } else {
  3422. protoAugment(value, arrayMethods);
  3423. }
  3424. }
  3425. } else {
  3426. copyAugment(value, arrayMethods, arrayKeys);
  3427. }
  3428. this.observeArray(value);
  3429. } else {
  3430. this.walk(value);
  3431. }
  3432. };
  3433. /**
  3434. * Walk through all properties and convert them into
  3435. * getter/setters. This method should only be called when
  3436. * value type is Object.
  3437. */
  3438. Observer.prototype.walk = function walk (obj) {
  3439. var keys = Object.keys(obj);
  3440. for (var i = 0; i < keys.length; i++) {
  3441. defineReactive$$1(obj, keys[i]);
  3442. }
  3443. };
  3444. /**
  3445. * Observe a list of Array items.
  3446. */
  3447. Observer.prototype.observeArray = function observeArray (items) {
  3448. for (var i = 0, l = items.length; i < l; i++) {
  3449. observe(items[i]);
  3450. }
  3451. };
  3452. // helpers
  3453. /**
  3454. * Augment a target Object or Array by intercepting
  3455. * the prototype chain using __proto__
  3456. */
  3457. function protoAugment (target, src) {
  3458. /* eslint-disable no-proto */
  3459. target.__proto__ = src;
  3460. /* eslint-enable no-proto */
  3461. }
  3462. /**
  3463. * Augment a target Object or Array by defining
  3464. * hidden properties.
  3465. */
  3466. /* istanbul ignore next */
  3467. function copyAugment (target, src, keys) {
  3468. for (var i = 0, l = keys.length; i < l; i++) {
  3469. var key = keys[i];
  3470. def(target, key, src[key]);
  3471. }
  3472. }
  3473. /**
  3474. * Attempt to create an observer instance for a value,
  3475. * returns the new observer if successfully observed,
  3476. * or the existing observer if the value already has one.
  3477. */
  3478. function observe (value, asRootData) {
  3479. if (!isObject(value) || value instanceof VNode) {
  3480. return
  3481. }
  3482. var ob;
  3483. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  3484. ob = value.__ob__;
  3485. } else if (
  3486. shouldObserve &&
  3487. !isServerRendering() &&
  3488. (Array.isArray(value) || isPlainObject(value)) &&
  3489. Object.isExtensible(value) &&
  3490. !value._isVue
  3491. ) {
  3492. ob = new Observer(value);
  3493. }
  3494. if (asRootData && ob) {
  3495. ob.vmCount++;
  3496. }
  3497. return ob
  3498. }
  3499. /**
  3500. * Define a reactive property on an Object.
  3501. */
  3502. function defineReactive$$1 (
  3503. obj,
  3504. key,
  3505. val,
  3506. customSetter,
  3507. shallow
  3508. ) {
  3509. var dep = new Dep();
  3510. var property = Object.getOwnPropertyDescriptor(obj, key);
  3511. if (property && property.configurable === false) {
  3512. return
  3513. }
  3514. // cater for pre-defined getter/setters
  3515. var getter = property && property.get;
  3516. var setter = property && property.set;
  3517. if ((!getter || setter) && arguments.length === 2) {
  3518. val = obj[key];
  3519. }
  3520. var childOb = !shallow && observe(val);
  3521. Object.defineProperty(obj, key, {
  3522. enumerable: true,
  3523. configurable: true,
  3524. get: function reactiveGetter () {
  3525. var value = getter ? getter.call(obj) : val;
  3526. if (Dep.SharedObject.target) { // fixed by xxxxxx
  3527. dep.depend();
  3528. if (childOb) {
  3529. childOb.dep.depend();
  3530. if (Array.isArray(value)) {
  3531. dependArray(value);
  3532. }
  3533. }
  3534. }
  3535. return value
  3536. },
  3537. set: function reactiveSetter (newVal) {
  3538. var value = getter ? getter.call(obj) : val;
  3539. /* eslint-disable no-self-compare */
  3540. if (newVal === value || (newVal !== newVal && value !== value)) {
  3541. return
  3542. }
  3543. /* eslint-enable no-self-compare */
  3544. if ( true && customSetter) {
  3545. customSetter();
  3546. }
  3547. // #7981: for accessor properties without setter
  3548. if (getter && !setter) { return }
  3549. if (setter) {
  3550. setter.call(obj, newVal);
  3551. } else {
  3552. val = newVal;
  3553. }
  3554. childOb = !shallow && observe(newVal);
  3555. dep.notify();
  3556. }
  3557. });
  3558. }
  3559. /**
  3560. * Set a property on an object. Adds the new property and
  3561. * triggers change notification if the property doesn't
  3562. * already exist.
  3563. */
  3564. function set (target, key, val) {
  3565. if ( true &&
  3566. (isUndef(target) || isPrimitive(target))
  3567. ) {
  3568. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  3569. }
  3570. if (Array.isArray(target) && isValidArrayIndex(key)) {
  3571. target.length = Math.max(target.length, key);
  3572. target.splice(key, 1, val);
  3573. return val
  3574. }
  3575. if (key in target && !(key in Object.prototype)) {
  3576. target[key] = val;
  3577. return val
  3578. }
  3579. var ob = (target).__ob__;
  3580. if (target._isVue || (ob && ob.vmCount)) {
  3581. true && warn(
  3582. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  3583. 'at runtime - declare it upfront in the data option.'
  3584. );
  3585. return val
  3586. }
  3587. if (!ob) {
  3588. target[key] = val;
  3589. return val
  3590. }
  3591. defineReactive$$1(ob.value, key, val);
  3592. ob.dep.notify();
  3593. return val
  3594. }
  3595. /**
  3596. * Delete a property and trigger change if necessary.
  3597. */
  3598. function del (target, key) {
  3599. if ( true &&
  3600. (isUndef(target) || isPrimitive(target))
  3601. ) {
  3602. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  3603. }
  3604. if (Array.isArray(target) && isValidArrayIndex(key)) {
  3605. target.splice(key, 1);
  3606. return
  3607. }
  3608. var ob = (target).__ob__;
  3609. if (target._isVue || (ob && ob.vmCount)) {
  3610. true && warn(
  3611. 'Avoid deleting properties on a Vue instance or its root $data ' +
  3612. '- just set it to null.'
  3613. );
  3614. return
  3615. }
  3616. if (!hasOwn(target, key)) {
  3617. return
  3618. }
  3619. delete target[key];
  3620. if (!ob) {
  3621. return
  3622. }
  3623. ob.dep.notify();
  3624. }
  3625. /**
  3626. * Collect dependencies on array elements when the array is touched, since
  3627. * we cannot intercept array element access like property getters.
  3628. */
  3629. function dependArray (value) {
  3630. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  3631. e = value[i];
  3632. e && e.__ob__ && e.__ob__.dep.depend();
  3633. if (Array.isArray(e)) {
  3634. dependArray(e);
  3635. }
  3636. }
  3637. }
  3638. /* */
  3639. /**
  3640. * Option overwriting strategies are functions that handle
  3641. * how to merge a parent option value and a child option
  3642. * value into the final value.
  3643. */
  3644. var strats = config.optionMergeStrategies;
  3645. /**
  3646. * Options with restrictions
  3647. */
  3648. if (true) {
  3649. strats.el = strats.propsData = function (parent, child, vm, key) {
  3650. if (!vm) {
  3651. warn(
  3652. "option \"" + key + "\" can only be used during instance " +
  3653. 'creation with the `new` keyword.'
  3654. );
  3655. }
  3656. return defaultStrat(parent, child)
  3657. };
  3658. }
  3659. /**
  3660. * Helper that recursively merges two data objects together.
  3661. */
  3662. function mergeData (to, from) {
  3663. if (!from) { return to }
  3664. var key, toVal, fromVal;
  3665. var keys = hasSymbol
  3666. ? Reflect.ownKeys(from)
  3667. : Object.keys(from);
  3668. for (var i = 0; i < keys.length; i++) {
  3669. key = keys[i];
  3670. // in case the object is already observed...
  3671. if (key === '__ob__') { continue }
  3672. toVal = to[key];
  3673. fromVal = from[key];
  3674. if (!hasOwn(to, key)) {
  3675. set(to, key, fromVal);
  3676. } else if (
  3677. toVal !== fromVal &&
  3678. isPlainObject(toVal) &&
  3679. isPlainObject(fromVal)
  3680. ) {
  3681. mergeData(toVal, fromVal);
  3682. }
  3683. }
  3684. return to
  3685. }
  3686. /**
  3687. * Data
  3688. */
  3689. function mergeDataOrFn (
  3690. parentVal,
  3691. childVal,
  3692. vm
  3693. ) {
  3694. if (!vm) {
  3695. // in a Vue.extend merge, both should be functions
  3696. if (!childVal) {
  3697. return parentVal
  3698. }
  3699. if (!parentVal) {
  3700. return childVal
  3701. }
  3702. // when parentVal & childVal are both present,
  3703. // we need to return a function that returns the
  3704. // merged result of both functions... no need to
  3705. // check if parentVal is a function here because
  3706. // it has to be a function to pass previous merges.
  3707. return function mergedDataFn () {
  3708. return mergeData(
  3709. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  3710. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  3711. )
  3712. }
  3713. } else {
  3714. return function mergedInstanceDataFn () {
  3715. // instance merge
  3716. var instanceData = typeof childVal === 'function'
  3717. ? childVal.call(vm, vm)
  3718. : childVal;
  3719. var defaultData = typeof parentVal === 'function'
  3720. ? parentVal.call(vm, vm)
  3721. : parentVal;
  3722. if (instanceData) {
  3723. return mergeData(instanceData, defaultData)
  3724. } else {
  3725. return defaultData
  3726. }
  3727. }
  3728. }
  3729. }
  3730. strats.data = function (
  3731. parentVal,
  3732. childVal,
  3733. vm
  3734. ) {
  3735. if (!vm) {
  3736. if (childVal && typeof childVal !== 'function') {
  3737. true && warn(
  3738. 'The "data" option should be a function ' +
  3739. 'that returns a per-instance value in component ' +
  3740. 'definitions.',
  3741. vm
  3742. );
  3743. return parentVal
  3744. }
  3745. return mergeDataOrFn(parentVal, childVal)
  3746. }
  3747. return mergeDataOrFn(parentVal, childVal, vm)
  3748. };
  3749. /**
  3750. * Hooks and props are merged as arrays.
  3751. */
  3752. function mergeHook (
  3753. parentVal,
  3754. childVal
  3755. ) {
  3756. var res = childVal
  3757. ? parentVal
  3758. ? parentVal.concat(childVal)
  3759. : Array.isArray(childVal)
  3760. ? childVal
  3761. : [childVal]
  3762. : parentVal;
  3763. return res
  3764. ? dedupeHooks(res)
  3765. : res
  3766. }
  3767. function dedupeHooks (hooks) {
  3768. var res = [];
  3769. for (var i = 0; i < hooks.length; i++) {
  3770. if (res.indexOf(hooks[i]) === -1) {
  3771. res.push(hooks[i]);
  3772. }
  3773. }
  3774. return res
  3775. }
  3776. LIFECYCLE_HOOKS.forEach(function (hook) {
  3777. strats[hook] = mergeHook;
  3778. });
  3779. /**
  3780. * Assets
  3781. *
  3782. * When a vm is present (instance creation), we need to do
  3783. * a three-way merge between constructor options, instance
  3784. * options and parent options.
  3785. */
  3786. function mergeAssets (
  3787. parentVal,
  3788. childVal,
  3789. vm,
  3790. key
  3791. ) {
  3792. var res = Object.create(parentVal || null);
  3793. if (childVal) {
  3794. true && assertObjectType(key, childVal, vm);
  3795. return extend(res, childVal)
  3796. } else {
  3797. return res
  3798. }
  3799. }
  3800. ASSET_TYPES.forEach(function (type) {
  3801. strats[type + 's'] = mergeAssets;
  3802. });
  3803. /**
  3804. * Watchers.
  3805. *
  3806. * Watchers hashes should not overwrite one
  3807. * another, so we merge them as arrays.
  3808. */
  3809. strats.watch = function (
  3810. parentVal,
  3811. childVal,
  3812. vm,
  3813. key
  3814. ) {
  3815. // work around Firefox's Object.prototype.watch...
  3816. if (parentVal === nativeWatch) { parentVal = undefined; }
  3817. if (childVal === nativeWatch) { childVal = undefined; }
  3818. /* istanbul ignore if */
  3819. if (!childVal) { return Object.create(parentVal || null) }
  3820. if (true) {
  3821. assertObjectType(key, childVal, vm);
  3822. }
  3823. if (!parentVal) { return childVal }
  3824. var ret = {};
  3825. extend(ret, parentVal);
  3826. for (var key$1 in childVal) {
  3827. var parent = ret[key$1];
  3828. var child = childVal[key$1];
  3829. if (parent && !Array.isArray(parent)) {
  3830. parent = [parent];
  3831. }
  3832. ret[key$1] = parent
  3833. ? parent.concat(child)
  3834. : Array.isArray(child) ? child : [child];
  3835. }
  3836. return ret
  3837. };
  3838. /**
  3839. * Other object hashes.
  3840. */
  3841. strats.props =
  3842. strats.methods =
  3843. strats.inject =
  3844. strats.computed = function (
  3845. parentVal,
  3846. childVal,
  3847. vm,
  3848. key
  3849. ) {
  3850. if (childVal && "development" !== 'production') {
  3851. assertObjectType(key, childVal, vm);
  3852. }
  3853. if (!parentVal) { return childVal }
  3854. var ret = Object.create(null);
  3855. extend(ret, parentVal);
  3856. if (childVal) { extend(ret, childVal); }
  3857. return ret
  3858. };
  3859. strats.provide = mergeDataOrFn;
  3860. /**
  3861. * Default strategy.
  3862. */
  3863. var defaultStrat = function (parentVal, childVal) {
  3864. return childVal === undefined
  3865. ? parentVal
  3866. : childVal
  3867. };
  3868. /**
  3869. * Validate component names
  3870. */
  3871. function checkComponents (options) {
  3872. for (var key in options.components) {
  3873. validateComponentName(key);
  3874. }
  3875. }
  3876. function validateComponentName (name) {
  3877. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  3878. warn(
  3879. 'Invalid component name: "' + name + '". Component names ' +
  3880. 'should conform to valid custom element name in html5 specification.'
  3881. );
  3882. }
  3883. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  3884. warn(
  3885. 'Do not use built-in or reserved HTML elements as component ' +
  3886. 'id: ' + name
  3887. );
  3888. }
  3889. }
  3890. /**
  3891. * Ensure all props option syntax are normalized into the
  3892. * Object-based format.
  3893. */
  3894. function normalizeProps (options, vm) {
  3895. var props = options.props;
  3896. if (!props) { return }
  3897. var res = {};
  3898. var i, val, name;
  3899. if (Array.isArray(props)) {
  3900. i = props.length;
  3901. while (i--) {
  3902. val = props[i];
  3903. if (typeof val === 'string') {
  3904. name = camelize(val);
  3905. res[name] = { type: null };
  3906. } else if (true) {
  3907. warn('props must be strings when using array syntax.');
  3908. }
  3909. }
  3910. } else if (isPlainObject(props)) {
  3911. for (var key in props) {
  3912. val = props[key];
  3913. name = camelize(key);
  3914. res[name] = isPlainObject(val)
  3915. ? val
  3916. : { type: val };
  3917. }
  3918. } else if (true) {
  3919. warn(
  3920. "Invalid value for option \"props\": expected an Array or an Object, " +
  3921. "but got " + (toRawType(props)) + ".",
  3922. vm
  3923. );
  3924. }
  3925. options.props = res;
  3926. }
  3927. /**
  3928. * Normalize all injections into Object-based format
  3929. */
  3930. function normalizeInject (options, vm) {
  3931. var inject = options.inject;
  3932. if (!inject) { return }
  3933. var normalized = options.inject = {};
  3934. if (Array.isArray(inject)) {
  3935. for (var i = 0; i < inject.length; i++) {
  3936. normalized[inject[i]] = { from: inject[i] };
  3937. }
  3938. } else if (isPlainObject(inject)) {
  3939. for (var key in inject) {
  3940. var val = inject[key];
  3941. normalized[key] = isPlainObject(val)
  3942. ? extend({ from: key }, val)
  3943. : { from: val };
  3944. }
  3945. } else if (true) {
  3946. warn(
  3947. "Invalid value for option \"inject\": expected an Array or an Object, " +
  3948. "but got " + (toRawType(inject)) + ".",
  3949. vm
  3950. );
  3951. }
  3952. }
  3953. /**
  3954. * Normalize raw function directives into object format.
  3955. */
  3956. function normalizeDirectives (options) {
  3957. var dirs = options.directives;
  3958. if (dirs) {
  3959. for (var key in dirs) {
  3960. var def$$1 = dirs[key];
  3961. if (typeof def$$1 === 'function') {
  3962. dirs[key] = { bind: def$$1, update: def$$1 };
  3963. }
  3964. }
  3965. }
  3966. }
  3967. function assertObjectType (name, value, vm) {
  3968. if (!isPlainObject(value)) {
  3969. warn(
  3970. "Invalid value for option \"" + name + "\": expected an Object, " +
  3971. "but got " + (toRawType(value)) + ".",
  3972. vm
  3973. );
  3974. }
  3975. }
  3976. /**
  3977. * Merge two option objects into a new one.
  3978. * Core utility used in both instantiation and inheritance.
  3979. */
  3980. function mergeOptions (
  3981. parent,
  3982. child,
  3983. vm
  3984. ) {
  3985. if (true) {
  3986. checkComponents(child);
  3987. }
  3988. if (typeof child === 'function') {
  3989. child = child.options;
  3990. }
  3991. normalizeProps(child, vm);
  3992. normalizeInject(child, vm);
  3993. normalizeDirectives(child);
  3994. // Apply extends and mixins on the child options,
  3995. // but only if it is a raw options object that isn't
  3996. // the result of another mergeOptions call.
  3997. // Only merged options has the _base property.
  3998. if (!child._base) {
  3999. if (child.extends) {
  4000. parent = mergeOptions(parent, child.extends, vm);
  4001. }
  4002. if (child.mixins) {
  4003. for (var i = 0, l = child.mixins.length; i < l; i++) {
  4004. parent = mergeOptions(parent, child.mixins[i], vm);
  4005. }
  4006. }
  4007. }
  4008. var options = {};
  4009. var key;
  4010. for (key in parent) {
  4011. mergeField(key);
  4012. }
  4013. for (key in child) {
  4014. if (!hasOwn(parent, key)) {
  4015. mergeField(key);
  4016. }
  4017. }
  4018. function mergeField (key) {
  4019. var strat = strats[key] || defaultStrat;
  4020. options[key] = strat(parent[key], child[key], vm, key);
  4021. }
  4022. return options
  4023. }
  4024. /**
  4025. * Resolve an asset.
  4026. * This function is used because child instances need access
  4027. * to assets defined in its ancestor chain.
  4028. */
  4029. function resolveAsset (
  4030. options,
  4031. type,
  4032. id,
  4033. warnMissing
  4034. ) {
  4035. /* istanbul ignore if */
  4036. if (typeof id !== 'string') {
  4037. return
  4038. }
  4039. var assets = options[type];
  4040. // check local registration variations first
  4041. if (hasOwn(assets, id)) { return assets[id] }
  4042. var camelizedId = camelize(id);
  4043. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  4044. var PascalCaseId = capitalize(camelizedId);
  4045. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  4046. // fallback to prototype chain
  4047. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  4048. if ( true && warnMissing && !res) {
  4049. warn(
  4050. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  4051. options
  4052. );
  4053. }
  4054. return res
  4055. }
  4056. /* */
  4057. function validateProp (
  4058. key,
  4059. propOptions,
  4060. propsData,
  4061. vm
  4062. ) {
  4063. var prop = propOptions[key];
  4064. var absent = !hasOwn(propsData, key);
  4065. var value = propsData[key];
  4066. // boolean casting
  4067. var booleanIndex = getTypeIndex(Boolean, prop.type);
  4068. if (booleanIndex > -1) {
  4069. if (absent && !hasOwn(prop, 'default')) {
  4070. value = false;
  4071. } else if (value === '' || value === hyphenate(key)) {
  4072. // only cast empty string / same name to boolean if
  4073. // boolean has higher priority
  4074. var stringIndex = getTypeIndex(String, prop.type);
  4075. if (stringIndex < 0 || booleanIndex < stringIndex) {
  4076. value = true;
  4077. }
  4078. }
  4079. }
  4080. // check default value
  4081. if (value === undefined) {
  4082. value = getPropDefaultValue(vm, prop, key);
  4083. // since the default value is a fresh copy,
  4084. // make sure to observe it.
  4085. var prevShouldObserve = shouldObserve;
  4086. toggleObserving(true);
  4087. observe(value);
  4088. toggleObserving(prevShouldObserve);
  4089. }
  4090. if (
  4091. true
  4092. ) {
  4093. assertProp(prop, key, value, vm, absent);
  4094. }
  4095. return value
  4096. }
  4097. /**
  4098. * Get the default value of a prop.
  4099. */
  4100. function getPropDefaultValue (vm, prop, key) {
  4101. // no default, return undefined
  4102. if (!hasOwn(prop, 'default')) {
  4103. return undefined
  4104. }
  4105. var def = prop.default;
  4106. // warn against non-factory defaults for Object & Array
  4107. if ( true && isObject(def)) {
  4108. warn(
  4109. 'Invalid default value for prop "' + key + '": ' +
  4110. 'Props with type Object/Array must use a factory function ' +
  4111. 'to return the default value.',
  4112. vm
  4113. );
  4114. }
  4115. // the raw prop value was also undefined from previous render,
  4116. // return previous default value to avoid unnecessary watcher trigger
  4117. if (vm && vm.$options.propsData &&
  4118. vm.$options.propsData[key] === undefined &&
  4119. vm._props[key] !== undefined
  4120. ) {
  4121. return vm._props[key]
  4122. }
  4123. // call factory function for non-Function types
  4124. // a value is Function if its prototype is function even across different execution context
  4125. return typeof def === 'function' && getType(prop.type) !== 'Function'
  4126. ? def.call(vm)
  4127. : def
  4128. }
  4129. /**
  4130. * Assert whether a prop is valid.
  4131. */
  4132. function assertProp (
  4133. prop,
  4134. name,
  4135. value,
  4136. vm,
  4137. absent
  4138. ) {
  4139. if (prop.required && absent) {
  4140. warn(
  4141. 'Missing required prop: "' + name + '"',
  4142. vm
  4143. );
  4144. return
  4145. }
  4146. if (value == null && !prop.required) {
  4147. return
  4148. }
  4149. var type = prop.type;
  4150. var valid = !type || type === true;
  4151. var expectedTypes = [];
  4152. if (type) {
  4153. if (!Array.isArray(type)) {
  4154. type = [type];
  4155. }
  4156. for (var i = 0; i < type.length && !valid; i++) {
  4157. var assertedType = assertType(value, type[i]);
  4158. expectedTypes.push(assertedType.expectedType || '');
  4159. valid = assertedType.valid;
  4160. }
  4161. }
  4162. if (!valid) {
  4163. warn(
  4164. getInvalidTypeMessage(name, value, expectedTypes),
  4165. vm
  4166. );
  4167. return
  4168. }
  4169. var validator = prop.validator;
  4170. if (validator) {
  4171. if (!validator(value)) {
  4172. warn(
  4173. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  4174. vm
  4175. );
  4176. }
  4177. }
  4178. }
  4179. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  4180. function assertType (value, type) {
  4181. var valid;
  4182. var expectedType = getType(type);
  4183. if (simpleCheckRE.test(expectedType)) {
  4184. var t = typeof value;
  4185. valid = t === expectedType.toLowerCase();
  4186. // for primitive wrapper objects
  4187. if (!valid && t === 'object') {
  4188. valid = value instanceof type;
  4189. }
  4190. } else if (expectedType === 'Object') {
  4191. valid = isPlainObject(value);
  4192. } else if (expectedType === 'Array') {
  4193. valid = Array.isArray(value);
  4194. } else {
  4195. valid = value instanceof type;
  4196. }
  4197. return {
  4198. valid: valid,
  4199. expectedType: expectedType
  4200. }
  4201. }
  4202. /**
  4203. * Use function string name to check built-in types,
  4204. * because a simple equality check will fail when running
  4205. * across different vms / iframes.
  4206. */
  4207. function getType (fn) {
  4208. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  4209. return match ? match[1] : ''
  4210. }
  4211. function isSameType (a, b) {
  4212. return getType(a) === getType(b)
  4213. }
  4214. function getTypeIndex (type, expectedTypes) {
  4215. if (!Array.isArray(expectedTypes)) {
  4216. return isSameType(expectedTypes, type) ? 0 : -1
  4217. }
  4218. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  4219. if (isSameType(expectedTypes[i], type)) {
  4220. return i
  4221. }
  4222. }
  4223. return -1
  4224. }
  4225. function getInvalidTypeMessage (name, value, expectedTypes) {
  4226. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  4227. " Expected " + (expectedTypes.map(capitalize).join(', '));
  4228. var expectedType = expectedTypes[0];
  4229. var receivedType = toRawType(value);
  4230. var expectedValue = styleValue(value, expectedType);
  4231. var receivedValue = styleValue(value, receivedType);
  4232. // check if we need to specify expected value
  4233. if (expectedTypes.length === 1 &&
  4234. isExplicable(expectedType) &&
  4235. !isBoolean(expectedType, receivedType)) {
  4236. message += " with value " + expectedValue;
  4237. }
  4238. message += ", got " + receivedType + " ";
  4239. // check if we need to specify received value
  4240. if (isExplicable(receivedType)) {
  4241. message += "with value " + receivedValue + ".";
  4242. }
  4243. return message
  4244. }
  4245. function styleValue (value, type) {
  4246. if (type === 'String') {
  4247. return ("\"" + value + "\"")
  4248. } else if (type === 'Number') {
  4249. return ("" + (Number(value)))
  4250. } else {
  4251. return ("" + value)
  4252. }
  4253. }
  4254. function isExplicable (value) {
  4255. var explicitTypes = ['string', 'number', 'boolean'];
  4256. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  4257. }
  4258. function isBoolean () {
  4259. var args = [], len = arguments.length;
  4260. while ( len-- ) args[ len ] = arguments[ len ];
  4261. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  4262. }
  4263. /* */
  4264. function handleError (err, vm, info) {
  4265. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  4266. // See: https://github.com/vuejs/vuex/issues/1505
  4267. pushTarget();
  4268. try {
  4269. if (vm) {
  4270. var cur = vm;
  4271. while ((cur = cur.$parent)) {
  4272. var hooks = cur.$options.errorCaptured;
  4273. if (hooks) {
  4274. for (var i = 0; i < hooks.length; i++) {
  4275. try {
  4276. var capture = hooks[i].call(cur, err, vm, info) === false;
  4277. if (capture) { return }
  4278. } catch (e) {
  4279. globalHandleError(e, cur, 'errorCaptured hook');
  4280. }
  4281. }
  4282. }
  4283. }
  4284. }
  4285. globalHandleError(err, vm, info);
  4286. } finally {
  4287. popTarget();
  4288. }
  4289. }
  4290. function invokeWithErrorHandling (
  4291. handler,
  4292. context,
  4293. args,
  4294. vm,
  4295. info
  4296. ) {
  4297. var res;
  4298. try {
  4299. res = args ? handler.apply(context, args) : handler.call(context);
  4300. if (res && !res._isVue && isPromise(res) && !res._handled) {
  4301. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  4302. // issue #9511
  4303. // avoid catch triggering multiple times when nested calls
  4304. res._handled = true;
  4305. }
  4306. } catch (e) {
  4307. handleError(e, vm, info);
  4308. }
  4309. return res
  4310. }
  4311. function globalHandleError (err, vm, info) {
  4312. if (config.errorHandler) {
  4313. try {
  4314. return config.errorHandler.call(null, err, vm, info)
  4315. } catch (e) {
  4316. // if the user intentionally throws the original error in the handler,
  4317. // do not log it twice
  4318. if (e !== err) {
  4319. logError(e, null, 'config.errorHandler');
  4320. }
  4321. }
  4322. }
  4323. logError(err, vm, info);
  4324. }
  4325. function logError (err, vm, info) {
  4326. if (true) {
  4327. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  4328. }
  4329. /* istanbul ignore else */
  4330. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  4331. console.error(err);
  4332. } else {
  4333. throw err
  4334. }
  4335. }
  4336. /* */
  4337. var callbacks = [];
  4338. var pending = false;
  4339. function flushCallbacks () {
  4340. pending = false;
  4341. var copies = callbacks.slice(0);
  4342. callbacks.length = 0;
  4343. for (var i = 0; i < copies.length; i++) {
  4344. copies[i]();
  4345. }
  4346. }
  4347. // Here we have async deferring wrappers using microtasks.
  4348. // In 2.5 we used (macro) tasks (in combination with microtasks).
  4349. // However, it has subtle problems when state is changed right before repaint
  4350. // (e.g. #6813, out-in transitions).
  4351. // Also, using (macro) tasks in event handler would cause some weird behaviors
  4352. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  4353. // So we now use microtasks everywhere, again.
  4354. // A major drawback of this tradeoff is that there are some scenarios
  4355. // where microtasks have too high a priority and fire in between supposedly
  4356. // sequential events (e.g. #4521, #6690, which have workarounds)
  4357. // or even between bubbling of the same event (#6566).
  4358. var timerFunc;
  4359. // The nextTick behavior leverages the microtask queue, which can be accessed
  4360. // via either native Promise.then or MutationObserver.
  4361. // MutationObserver has wider support, however it is seriously bugged in
  4362. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  4363. // completely stops working after triggering a few times... so, if native
  4364. // Promise is available, we will use it:
  4365. /* istanbul ignore next, $flow-disable-line */
  4366. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  4367. var p = Promise.resolve();
  4368. timerFunc = function () {
  4369. p.then(flushCallbacks);
  4370. // In problematic UIWebViews, Promise.then doesn't completely break, but
  4371. // it can get stuck in a weird state where callbacks are pushed into the
  4372. // microtask queue but the queue isn't being flushed, until the browser
  4373. // needs to do some other work, e.g. handle a timer. Therefore we can
  4374. // "force" the microtask queue to be flushed by adding an empty timer.
  4375. if (isIOS) { setTimeout(noop); }
  4376. };
  4377. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  4378. isNative(MutationObserver) ||
  4379. // PhantomJS and iOS 7.x
  4380. MutationObserver.toString() === '[object MutationObserverConstructor]'
  4381. )) {
  4382. // Use MutationObserver where native Promise is not available,
  4383. // e.g. PhantomJS, iOS7, Android 4.4
  4384. // (#6466 MutationObserver is unreliable in IE11)
  4385. var counter = 1;
  4386. var observer = new MutationObserver(flushCallbacks);
  4387. var textNode = document.createTextNode(String(counter));
  4388. observer.observe(textNode, {
  4389. characterData: true
  4390. });
  4391. timerFunc = function () {
  4392. counter = (counter + 1) % 2;
  4393. textNode.data = String(counter);
  4394. };
  4395. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  4396. // Fallback to setImmediate.
  4397. // Technically it leverages the (macro) task queue,
  4398. // but it is still a better choice than setTimeout.
  4399. timerFunc = function () {
  4400. setImmediate(flushCallbacks);
  4401. };
  4402. } else {
  4403. // Fallback to setTimeout.
  4404. timerFunc = function () {
  4405. setTimeout(flushCallbacks, 0);
  4406. };
  4407. }
  4408. function nextTick (cb, ctx) {
  4409. var _resolve;
  4410. callbacks.push(function () {
  4411. if (cb) {
  4412. try {
  4413. cb.call(ctx);
  4414. } catch (e) {
  4415. handleError(e, ctx, 'nextTick');
  4416. }
  4417. } else if (_resolve) {
  4418. _resolve(ctx);
  4419. }
  4420. });
  4421. if (!pending) {
  4422. pending = true;
  4423. timerFunc();
  4424. }
  4425. // $flow-disable-line
  4426. if (!cb && typeof Promise !== 'undefined') {
  4427. return new Promise(function (resolve) {
  4428. _resolve = resolve;
  4429. })
  4430. }
  4431. }
  4432. /* */
  4433. /* not type checking this file because flow doesn't play well with Proxy */
  4434. var initProxy;
  4435. if (true) {
  4436. var allowedGlobals = makeMap(
  4437. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  4438. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  4439. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  4440. 'require' // for Webpack/Browserify
  4441. );
  4442. var warnNonPresent = function (target, key) {
  4443. warn(
  4444. "Property or method \"" + key + "\" is not defined on the instance but " +
  4445. 'referenced during render. Make sure that this property is reactive, ' +
  4446. 'either in the data option, or for class-based components, by ' +
  4447. 'initializing the property. ' +
  4448. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  4449. target
  4450. );
  4451. };
  4452. var warnReservedPrefix = function (target, key) {
  4453. warn(
  4454. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  4455. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  4456. 'prevent conflicts with Vue internals. ' +
  4457. 'See: https://vuejs.org/v2/api/#data',
  4458. target
  4459. );
  4460. };
  4461. var hasProxy =
  4462. typeof Proxy !== 'undefined' && isNative(Proxy);
  4463. if (hasProxy) {
  4464. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  4465. config.keyCodes = new Proxy(config.keyCodes, {
  4466. set: function set (target, key, value) {
  4467. if (isBuiltInModifier(key)) {
  4468. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  4469. return false
  4470. } else {
  4471. target[key] = value;
  4472. return true
  4473. }
  4474. }
  4475. });
  4476. }
  4477. var hasHandler = {
  4478. has: function has (target, key) {
  4479. var has = key in target;
  4480. var isAllowed = allowedGlobals(key) ||
  4481. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  4482. if (!has && !isAllowed) {
  4483. if (key in target.$data) { warnReservedPrefix(target, key); }
  4484. else { warnNonPresent(target, key); }
  4485. }
  4486. return has || !isAllowed
  4487. }
  4488. };
  4489. var getHandler = {
  4490. get: function get (target, key) {
  4491. if (typeof key === 'string' && !(key in target)) {
  4492. if (key in target.$data) { warnReservedPrefix(target, key); }
  4493. else { warnNonPresent(target, key); }
  4494. }
  4495. return target[key]
  4496. }
  4497. };
  4498. initProxy = function initProxy (vm) {
  4499. if (hasProxy) {
  4500. // determine which proxy handler to use
  4501. var options = vm.$options;
  4502. var handlers = options.render && options.render._withStripped
  4503. ? getHandler
  4504. : hasHandler;
  4505. vm._renderProxy = new Proxy(vm, handlers);
  4506. } else {
  4507. vm._renderProxy = vm;
  4508. }
  4509. };
  4510. }
  4511. /* */
  4512. var seenObjects = new _Set();
  4513. /**
  4514. * Recursively traverse an object to evoke all converted
  4515. * getters, so that every nested property inside the object
  4516. * is collected as a "deep" dependency.
  4517. */
  4518. function traverse (val) {
  4519. _traverse(val, seenObjects);
  4520. seenObjects.clear();
  4521. }
  4522. function _traverse (val, seen) {
  4523. var i, keys;
  4524. var isA = Array.isArray(val);
  4525. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  4526. return
  4527. }
  4528. if (val.__ob__) {
  4529. var depId = val.__ob__.dep.id;
  4530. if (seen.has(depId)) {
  4531. return
  4532. }
  4533. seen.add(depId);
  4534. }
  4535. if (isA) {
  4536. i = val.length;
  4537. while (i--) { _traverse(val[i], seen); }
  4538. } else {
  4539. keys = Object.keys(val);
  4540. i = keys.length;
  4541. while (i--) { _traverse(val[keys[i]], seen); }
  4542. }
  4543. }
  4544. var mark;
  4545. var measure;
  4546. if (true) {
  4547. var perf = inBrowser && window.performance;
  4548. /* istanbul ignore if */
  4549. if (
  4550. perf &&
  4551. perf.mark &&
  4552. perf.measure &&
  4553. perf.clearMarks &&
  4554. perf.clearMeasures
  4555. ) {
  4556. mark = function (tag) { return perf.mark(tag); };
  4557. measure = function (name, startTag, endTag) {
  4558. perf.measure(name, startTag, endTag);
  4559. perf.clearMarks(startTag);
  4560. perf.clearMarks(endTag);
  4561. // perf.clearMeasures(name)
  4562. };
  4563. }
  4564. }
  4565. /* */
  4566. var normalizeEvent = cached(function (name) {
  4567. var passive = name.charAt(0) === '&';
  4568. name = passive ? name.slice(1) : name;
  4569. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  4570. name = once$$1 ? name.slice(1) : name;
  4571. var capture = name.charAt(0) === '!';
  4572. name = capture ? name.slice(1) : name;
  4573. return {
  4574. name: name,
  4575. once: once$$1,
  4576. capture: capture,
  4577. passive: passive
  4578. }
  4579. });
  4580. function createFnInvoker (fns, vm) {
  4581. function invoker () {
  4582. var arguments$1 = arguments;
  4583. var fns = invoker.fns;
  4584. if (Array.isArray(fns)) {
  4585. var cloned = fns.slice();
  4586. for (var i = 0; i < cloned.length; i++) {
  4587. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  4588. }
  4589. } else {
  4590. // return handler return value for single handlers
  4591. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  4592. }
  4593. }
  4594. invoker.fns = fns;
  4595. return invoker
  4596. }
  4597. function updateListeners (
  4598. on,
  4599. oldOn,
  4600. add,
  4601. remove$$1,
  4602. createOnceHandler,
  4603. vm
  4604. ) {
  4605. var name, def$$1, cur, old, event;
  4606. for (name in on) {
  4607. def$$1 = cur = on[name];
  4608. old = oldOn[name];
  4609. event = normalizeEvent(name);
  4610. if (isUndef(cur)) {
  4611. true && warn(
  4612. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  4613. vm
  4614. );
  4615. } else if (isUndef(old)) {
  4616. if (isUndef(cur.fns)) {
  4617. cur = on[name] = createFnInvoker(cur, vm);
  4618. }
  4619. if (isTrue(event.once)) {
  4620. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  4621. }
  4622. add(event.name, cur, event.capture, event.passive, event.params);
  4623. } else if (cur !== old) {
  4624. old.fns = cur;
  4625. on[name] = old;
  4626. }
  4627. }
  4628. for (name in oldOn) {
  4629. if (isUndef(on[name])) {
  4630. event = normalizeEvent(name);
  4631. remove$$1(event.name, oldOn[name], event.capture);
  4632. }
  4633. }
  4634. }
  4635. /* */
  4636. /* */
  4637. // fixed by xxxxxx (mp properties)
  4638. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  4639. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  4640. if (isUndef(propOptions)) {
  4641. return res
  4642. }
  4643. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  4644. var attrs = data.attrs;
  4645. var props = data.props;
  4646. if (isDef(attrs) || isDef(props)) {
  4647. for (var key in propOptions) {
  4648. var altKey = hyphenate(key);
  4649. var result = checkProp(res, props, key, altKey, true) ||
  4650. checkProp(res, attrs, key, altKey, false);
  4651. // externalClass
  4652. if (
  4653. result &&
  4654. res[key] &&
  4655. externalClasses.indexOf(altKey) !== -1 &&
  4656. context[camelize(res[key])]
  4657. ) {
  4658. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  4659. res[key] = context[camelize(res[key])];
  4660. }
  4661. }
  4662. }
  4663. return res
  4664. }
  4665. function extractPropsFromVNodeData (
  4666. data,
  4667. Ctor,
  4668. tag,
  4669. context// fixed by xxxxxx
  4670. ) {
  4671. // we are only extracting raw values here.
  4672. // validation and default values are handled in the child
  4673. // component itself.
  4674. var propOptions = Ctor.options.props;
  4675. if (isUndef(propOptions)) {
  4676. // fixed by xxxxxx
  4677. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  4678. }
  4679. var res = {};
  4680. var attrs = data.attrs;
  4681. var props = data.props;
  4682. if (isDef(attrs) || isDef(props)) {
  4683. for (var key in propOptions) {
  4684. var altKey = hyphenate(key);
  4685. if (true) {
  4686. var keyInLowerCase = key.toLowerCase();
  4687. if (
  4688. key !== keyInLowerCase &&
  4689. attrs && hasOwn(attrs, keyInLowerCase)
  4690. ) {
  4691. tip(
  4692. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  4693. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  4694. " \"" + key + "\". " +
  4695. "Note that HTML attributes are case-insensitive and camelCased " +
  4696. "props need to use their kebab-case equivalents when using in-DOM " +
  4697. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  4698. );
  4699. }
  4700. }
  4701. checkProp(res, props, key, altKey, true) ||
  4702. checkProp(res, attrs, key, altKey, false);
  4703. }
  4704. }
  4705. // fixed by xxxxxx
  4706. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  4707. }
  4708. function checkProp (
  4709. res,
  4710. hash,
  4711. key,
  4712. altKey,
  4713. preserve
  4714. ) {
  4715. if (isDef(hash)) {
  4716. if (hasOwn(hash, key)) {
  4717. res[key] = hash[key];
  4718. if (!preserve) {
  4719. delete hash[key];
  4720. }
  4721. return true
  4722. } else if (hasOwn(hash, altKey)) {
  4723. res[key] = hash[altKey];
  4724. if (!preserve) {
  4725. delete hash[altKey];
  4726. }
  4727. return true
  4728. }
  4729. }
  4730. return false
  4731. }
  4732. /* */
  4733. // The template compiler attempts to minimize the need for normalization by
  4734. // statically analyzing the template at compile time.
  4735. //
  4736. // For plain HTML markup, normalization can be completely skipped because the
  4737. // generated render function is guaranteed to return Array<VNode>. There are
  4738. // two cases where extra normalization is needed:
  4739. // 1. When the children contains components - because a functional component
  4740. // may return an Array instead of a single root. In this case, just a simple
  4741. // normalization is needed - if any child is an Array, we flatten the whole
  4742. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  4743. // because functional components already normalize their own children.
  4744. function simpleNormalizeChildren (children) {
  4745. for (var i = 0; i < children.length; i++) {
  4746. if (Array.isArray(children[i])) {
  4747. return Array.prototype.concat.apply([], children)
  4748. }
  4749. }
  4750. return children
  4751. }
  4752. // 2. When the children contains constructs that always generated nested Arrays,
  4753. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  4754. // with hand-written render functions / JSX. In such cases a full normalization
  4755. // is needed to cater to all possible types of children values.
  4756. function normalizeChildren (children) {
  4757. return isPrimitive(children)
  4758. ? [createTextVNode(children)]
  4759. : Array.isArray(children)
  4760. ? normalizeArrayChildren(children)
  4761. : undefined
  4762. }
  4763. function isTextNode (node) {
  4764. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  4765. }
  4766. function normalizeArrayChildren (children, nestedIndex) {
  4767. var res = [];
  4768. var i, c, lastIndex, last;
  4769. for (i = 0; i < children.length; i++) {
  4770. c = children[i];
  4771. if (isUndef(c) || typeof c === 'boolean') { continue }
  4772. lastIndex = res.length - 1;
  4773. last = res[lastIndex];
  4774. // nested
  4775. if (Array.isArray(c)) {
  4776. if (c.length > 0) {
  4777. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  4778. // merge adjacent text nodes
  4779. if (isTextNode(c[0]) && isTextNode(last)) {
  4780. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  4781. c.shift();
  4782. }
  4783. res.push.apply(res, c);
  4784. }
  4785. } else if (isPrimitive(c)) {
  4786. if (isTextNode(last)) {
  4787. // merge adjacent text nodes
  4788. // this is necessary for SSR hydration because text nodes are
  4789. // essentially merged when rendered to HTML strings
  4790. res[lastIndex] = createTextVNode(last.text + c);
  4791. } else if (c !== '') {
  4792. // convert primitive to vnode
  4793. res.push(createTextVNode(c));
  4794. }
  4795. } else {
  4796. if (isTextNode(c) && isTextNode(last)) {
  4797. // merge adjacent text nodes
  4798. res[lastIndex] = createTextVNode(last.text + c.text);
  4799. } else {
  4800. // default key for nested array children (likely generated by v-for)
  4801. if (isTrue(children._isVList) &&
  4802. isDef(c.tag) &&
  4803. isUndef(c.key) &&
  4804. isDef(nestedIndex)) {
  4805. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  4806. }
  4807. res.push(c);
  4808. }
  4809. }
  4810. }
  4811. return res
  4812. }
  4813. /* */
  4814. function initProvide (vm) {
  4815. var provide = vm.$options.provide;
  4816. if (provide) {
  4817. vm._provided = typeof provide === 'function'
  4818. ? provide.call(vm)
  4819. : provide;
  4820. }
  4821. }
  4822. function initInjections (vm) {
  4823. var result = resolveInject(vm.$options.inject, vm);
  4824. if (result) {
  4825. toggleObserving(false);
  4826. Object.keys(result).forEach(function (key) {
  4827. /* istanbul ignore else */
  4828. if (true) {
  4829. defineReactive$$1(vm, key, result[key], function () {
  4830. warn(
  4831. "Avoid mutating an injected value directly since the changes will be " +
  4832. "overwritten whenever the provided component re-renders. " +
  4833. "injection being mutated: \"" + key + "\"",
  4834. vm
  4835. );
  4836. });
  4837. } else {}
  4838. });
  4839. toggleObserving(true);
  4840. }
  4841. }
  4842. function resolveInject (inject, vm) {
  4843. if (inject) {
  4844. // inject is :any because flow is not smart enough to figure out cached
  4845. var result = Object.create(null);
  4846. var keys = hasSymbol
  4847. ? Reflect.ownKeys(inject)
  4848. : Object.keys(inject);
  4849. for (var i = 0; i < keys.length; i++) {
  4850. var key = keys[i];
  4851. // #6574 in case the inject object is observed...
  4852. if (key === '__ob__') { continue }
  4853. var provideKey = inject[key].from;
  4854. var source = vm;
  4855. while (source) {
  4856. if (source._provided && hasOwn(source._provided, provideKey)) {
  4857. result[key] = source._provided[provideKey];
  4858. break
  4859. }
  4860. source = source.$parent;
  4861. }
  4862. if (!source) {
  4863. if ('default' in inject[key]) {
  4864. var provideDefault = inject[key].default;
  4865. result[key] = typeof provideDefault === 'function'
  4866. ? provideDefault.call(vm)
  4867. : provideDefault;
  4868. } else if (true) {
  4869. warn(("Injection \"" + key + "\" not found"), vm);
  4870. }
  4871. }
  4872. }
  4873. return result
  4874. }
  4875. }
  4876. /* */
  4877. /**
  4878. * Runtime helper for resolving raw children VNodes into a slot object.
  4879. */
  4880. function resolveSlots (
  4881. children,
  4882. context
  4883. ) {
  4884. if (!children || !children.length) {
  4885. return {}
  4886. }
  4887. var slots = {};
  4888. for (var i = 0, l = children.length; i < l; i++) {
  4889. var child = children[i];
  4890. var data = child.data;
  4891. // remove slot attribute if the node is resolved as a Vue slot node
  4892. if (data && data.attrs && data.attrs.slot) {
  4893. delete data.attrs.slot;
  4894. }
  4895. // named slots should only be respected if the vnode was rendered in the
  4896. // same context.
  4897. if ((child.context === context || child.fnContext === context) &&
  4898. data && data.slot != null
  4899. ) {
  4900. var name = data.slot;
  4901. var slot = (slots[name] || (slots[name] = []));
  4902. if (child.tag === 'template') {
  4903. slot.push.apply(slot, child.children || []);
  4904. } else {
  4905. slot.push(child);
  4906. }
  4907. } else {
  4908. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  4909. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  4910. (slots['page'] || (slots['page'] = [])).push(child);
  4911. }else{
  4912. (slots.default || (slots.default = [])).push(child);
  4913. }
  4914. }
  4915. }
  4916. // ignore slots that contains only whitespace
  4917. for (var name$1 in slots) {
  4918. if (slots[name$1].every(isWhitespace)) {
  4919. delete slots[name$1];
  4920. }
  4921. }
  4922. return slots
  4923. }
  4924. function isWhitespace (node) {
  4925. return (node.isComment && !node.asyncFactory) || node.text === ' '
  4926. }
  4927. /* */
  4928. function normalizeScopedSlots (
  4929. slots,
  4930. normalSlots,
  4931. prevSlots
  4932. ) {
  4933. var res;
  4934. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  4935. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  4936. var key = slots && slots.$key;
  4937. if (!slots) {
  4938. res = {};
  4939. } else if (slots._normalized) {
  4940. // fast path 1: child component re-render only, parent did not change
  4941. return slots._normalized
  4942. } else if (
  4943. isStable &&
  4944. prevSlots &&
  4945. prevSlots !== emptyObject &&
  4946. key === prevSlots.$key &&
  4947. !hasNormalSlots &&
  4948. !prevSlots.$hasNormal
  4949. ) {
  4950. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  4951. // only need to normalize once
  4952. return prevSlots
  4953. } else {
  4954. res = {};
  4955. for (var key$1 in slots) {
  4956. if (slots[key$1] && key$1[0] !== '$') {
  4957. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  4958. }
  4959. }
  4960. }
  4961. // expose normal slots on scopedSlots
  4962. for (var key$2 in normalSlots) {
  4963. if (!(key$2 in res)) {
  4964. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  4965. }
  4966. }
  4967. // avoriaz seems to mock a non-extensible $scopedSlots object
  4968. // and when that is passed down this would cause an error
  4969. if (slots && Object.isExtensible(slots)) {
  4970. (slots)._normalized = res;
  4971. }
  4972. def(res, '$stable', isStable);
  4973. def(res, '$key', key);
  4974. def(res, '$hasNormal', hasNormalSlots);
  4975. return res
  4976. }
  4977. function normalizeScopedSlot(normalSlots, key, fn) {
  4978. var normalized = function () {
  4979. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  4980. res = res && typeof res === 'object' && !Array.isArray(res)
  4981. ? [res] // single vnode
  4982. : normalizeChildren(res);
  4983. return res && (
  4984. res.length === 0 ||
  4985. (res.length === 1 && res[0].isComment) // #9658
  4986. ) ? undefined
  4987. : res
  4988. };
  4989. // this is a slot using the new v-slot syntax without scope. although it is
  4990. // compiled as a scoped slot, render fn users would expect it to be present
  4991. // on this.$slots because the usage is semantically a normal slot.
  4992. if (fn.proxy) {
  4993. Object.defineProperty(normalSlots, key, {
  4994. get: normalized,
  4995. enumerable: true,
  4996. configurable: true
  4997. });
  4998. }
  4999. return normalized
  5000. }
  5001. function proxyNormalSlot(slots, key) {
  5002. return function () { return slots[key]; }
  5003. }
  5004. /* */
  5005. /**
  5006. * Runtime helper for rendering v-for lists.
  5007. */
  5008. function renderList (
  5009. val,
  5010. render
  5011. ) {
  5012. var ret, i, l, keys, key;
  5013. if (Array.isArray(val) || typeof val === 'string') {
  5014. ret = new Array(val.length);
  5015. for (i = 0, l = val.length; i < l; i++) {
  5016. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  5017. }
  5018. } else if (typeof val === 'number') {
  5019. ret = new Array(val);
  5020. for (i = 0; i < val; i++) {
  5021. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  5022. }
  5023. } else if (isObject(val)) {
  5024. if (hasSymbol && val[Symbol.iterator]) {
  5025. ret = [];
  5026. var iterator = val[Symbol.iterator]();
  5027. var result = iterator.next();
  5028. while (!result.done) {
  5029. ret.push(render(result.value, ret.length, i++, i)); // fixed by xxxxxx
  5030. result = iterator.next();
  5031. }
  5032. } else {
  5033. keys = Object.keys(val);
  5034. ret = new Array(keys.length);
  5035. for (i = 0, l = keys.length; i < l; i++) {
  5036. key = keys[i];
  5037. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  5038. }
  5039. }
  5040. }
  5041. if (!isDef(ret)) {
  5042. ret = [];
  5043. }
  5044. (ret)._isVList = true;
  5045. return ret
  5046. }
  5047. /* */
  5048. /**
  5049. * Runtime helper for rendering <slot>
  5050. */
  5051. function renderSlot (
  5052. name,
  5053. fallback,
  5054. props,
  5055. bindObject
  5056. ) {
  5057. var scopedSlotFn = this.$scopedSlots[name];
  5058. var nodes;
  5059. if (scopedSlotFn) { // scoped slot
  5060. props = props || {};
  5061. if (bindObject) {
  5062. if ( true && !isObject(bindObject)) {
  5063. warn(
  5064. 'slot v-bind without argument expects an Object',
  5065. this
  5066. );
  5067. }
  5068. props = extend(extend({}, bindObject), props);
  5069. }
  5070. // fixed by xxxxxx app-plus scopedSlot
  5071. nodes = scopedSlotFn(props, this, props._i) || fallback;
  5072. } else {
  5073. nodes = this.$slots[name] || fallback;
  5074. }
  5075. var target = props && props.slot;
  5076. if (target) {
  5077. return this.$createElement('template', { slot: target }, nodes)
  5078. } else {
  5079. return nodes
  5080. }
  5081. }
  5082. /* */
  5083. /**
  5084. * Runtime helper for resolving filters
  5085. */
  5086. function resolveFilter (id) {
  5087. return resolveAsset(this.$options, 'filters', id, true) || identity
  5088. }
  5089. /* */
  5090. function isKeyNotMatch (expect, actual) {
  5091. if (Array.isArray(expect)) {
  5092. return expect.indexOf(actual) === -1
  5093. } else {
  5094. return expect !== actual
  5095. }
  5096. }
  5097. /**
  5098. * Runtime helper for checking keyCodes from config.
  5099. * exposed as Vue.prototype._k
  5100. * passing in eventKeyName as last argument separately for backwards compat
  5101. */
  5102. function checkKeyCodes (
  5103. eventKeyCode,
  5104. key,
  5105. builtInKeyCode,
  5106. eventKeyName,
  5107. builtInKeyName
  5108. ) {
  5109. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  5110. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  5111. return isKeyNotMatch(builtInKeyName, eventKeyName)
  5112. } else if (mappedKeyCode) {
  5113. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  5114. } else if (eventKeyName) {
  5115. return hyphenate(eventKeyName) !== key
  5116. }
  5117. }
  5118. /* */
  5119. /**
  5120. * Runtime helper for merging v-bind="object" into a VNode's data.
  5121. */
  5122. function bindObjectProps (
  5123. data,
  5124. tag,
  5125. value,
  5126. asProp,
  5127. isSync
  5128. ) {
  5129. if (value) {
  5130. if (!isObject(value)) {
  5131. true && warn(
  5132. 'v-bind without argument expects an Object or Array value',
  5133. this
  5134. );
  5135. } else {
  5136. if (Array.isArray(value)) {
  5137. value = toObject(value);
  5138. }
  5139. var hash;
  5140. var loop = function ( key ) {
  5141. if (
  5142. key === 'class' ||
  5143. key === 'style' ||
  5144. isReservedAttribute(key)
  5145. ) {
  5146. hash = data;
  5147. } else {
  5148. var type = data.attrs && data.attrs.type;
  5149. hash = asProp || config.mustUseProp(tag, type, key)
  5150. ? data.domProps || (data.domProps = {})
  5151. : data.attrs || (data.attrs = {});
  5152. }
  5153. var camelizedKey = camelize(key);
  5154. var hyphenatedKey = hyphenate(key);
  5155. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  5156. hash[key] = value[key];
  5157. if (isSync) {
  5158. var on = data.on || (data.on = {});
  5159. on[("update:" + key)] = function ($event) {
  5160. value[key] = $event;
  5161. };
  5162. }
  5163. }
  5164. };
  5165. for (var key in value) loop( key );
  5166. }
  5167. }
  5168. return data
  5169. }
  5170. /* */
  5171. /**
  5172. * Runtime helper for rendering static trees.
  5173. */
  5174. function renderStatic (
  5175. index,
  5176. isInFor
  5177. ) {
  5178. var cached = this._staticTrees || (this._staticTrees = []);
  5179. var tree = cached[index];
  5180. // if has already-rendered static tree and not inside v-for,
  5181. // we can reuse the same tree.
  5182. if (tree && !isInFor) {
  5183. return tree
  5184. }
  5185. // otherwise, render a fresh tree.
  5186. tree = cached[index] = this.$options.staticRenderFns[index].call(
  5187. this._renderProxy,
  5188. null,
  5189. this // for render fns generated for functional component templates
  5190. );
  5191. markStatic(tree, ("__static__" + index), false);
  5192. return tree
  5193. }
  5194. /**
  5195. * Runtime helper for v-once.
  5196. * Effectively it means marking the node as static with a unique key.
  5197. */
  5198. function markOnce (
  5199. tree,
  5200. index,
  5201. key
  5202. ) {
  5203. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  5204. return tree
  5205. }
  5206. function markStatic (
  5207. tree,
  5208. key,
  5209. isOnce
  5210. ) {
  5211. if (Array.isArray(tree)) {
  5212. for (var i = 0; i < tree.length; i++) {
  5213. if (tree[i] && typeof tree[i] !== 'string') {
  5214. markStaticNode(tree[i], (key + "_" + i), isOnce);
  5215. }
  5216. }
  5217. } else {
  5218. markStaticNode(tree, key, isOnce);
  5219. }
  5220. }
  5221. function markStaticNode (node, key, isOnce) {
  5222. node.isStatic = true;
  5223. node.key = key;
  5224. node.isOnce = isOnce;
  5225. }
  5226. /* */
  5227. function bindObjectListeners (data, value) {
  5228. if (value) {
  5229. if (!isPlainObject(value)) {
  5230. true && warn(
  5231. 'v-on without argument expects an Object value',
  5232. this
  5233. );
  5234. } else {
  5235. var on = data.on = data.on ? extend({}, data.on) : {};
  5236. for (var key in value) {
  5237. var existing = on[key];
  5238. var ours = value[key];
  5239. on[key] = existing ? [].concat(existing, ours) : ours;
  5240. }
  5241. }
  5242. }
  5243. return data
  5244. }
  5245. /* */
  5246. function resolveScopedSlots (
  5247. fns, // see flow/vnode
  5248. res,
  5249. // the following are added in 2.6
  5250. hasDynamicKeys,
  5251. contentHashKey
  5252. ) {
  5253. res = res || { $stable: !hasDynamicKeys };
  5254. for (var i = 0; i < fns.length; i++) {
  5255. var slot = fns[i];
  5256. if (Array.isArray(slot)) {
  5257. resolveScopedSlots(slot, res, hasDynamicKeys);
  5258. } else if (slot) {
  5259. // marker for reverse proxying v-slot without scope on this.$slots
  5260. if (slot.proxy) {
  5261. slot.fn.proxy = true;
  5262. }
  5263. res[slot.key] = slot.fn;
  5264. }
  5265. }
  5266. if (contentHashKey) {
  5267. (res).$key = contentHashKey;
  5268. }
  5269. return res
  5270. }
  5271. /* */
  5272. function bindDynamicKeys (baseObj, values) {
  5273. for (var i = 0; i < values.length; i += 2) {
  5274. var key = values[i];
  5275. if (typeof key === 'string' && key) {
  5276. baseObj[values[i]] = values[i + 1];
  5277. } else if ( true && key !== '' && key !== null) {
  5278. // null is a special value for explicitly removing a binding
  5279. warn(
  5280. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  5281. this
  5282. );
  5283. }
  5284. }
  5285. return baseObj
  5286. }
  5287. // helper to dynamically append modifier runtime markers to event names.
  5288. // ensure only append when value is already string, otherwise it will be cast
  5289. // to string and cause the type check to miss.
  5290. function prependModifier (value, symbol) {
  5291. return typeof value === 'string' ? symbol + value : value
  5292. }
  5293. /* */
  5294. function installRenderHelpers (target) {
  5295. target._o = markOnce;
  5296. target._n = toNumber;
  5297. target._s = toString;
  5298. target._l = renderList;
  5299. target._t = renderSlot;
  5300. target._q = looseEqual;
  5301. target._i = looseIndexOf;
  5302. target._m = renderStatic;
  5303. target._f = resolveFilter;
  5304. target._k = checkKeyCodes;
  5305. target._b = bindObjectProps;
  5306. target._v = createTextVNode;
  5307. target._e = createEmptyVNode;
  5308. target._u = resolveScopedSlots;
  5309. target._g = bindObjectListeners;
  5310. target._d = bindDynamicKeys;
  5311. target._p = prependModifier;
  5312. }
  5313. /* */
  5314. function FunctionalRenderContext (
  5315. data,
  5316. props,
  5317. children,
  5318. parent,
  5319. Ctor
  5320. ) {
  5321. var this$1 = this;
  5322. var options = Ctor.options;
  5323. // ensure the createElement function in functional components
  5324. // gets a unique context - this is necessary for correct named slot check
  5325. var contextVm;
  5326. if (hasOwn(parent, '_uid')) {
  5327. contextVm = Object.create(parent);
  5328. // $flow-disable-line
  5329. contextVm._original = parent;
  5330. } else {
  5331. // the context vm passed in is a functional context as well.
  5332. // in this case we want to make sure we are able to get a hold to the
  5333. // real context instance.
  5334. contextVm = parent;
  5335. // $flow-disable-line
  5336. parent = parent._original;
  5337. }
  5338. var isCompiled = isTrue(options._compiled);
  5339. var needNormalization = !isCompiled;
  5340. this.data = data;
  5341. this.props = props;
  5342. this.children = children;
  5343. this.parent = parent;
  5344. this.listeners = data.on || emptyObject;
  5345. this.injections = resolveInject(options.inject, parent);
  5346. this.slots = function () {
  5347. if (!this$1.$slots) {
  5348. normalizeScopedSlots(
  5349. data.scopedSlots,
  5350. this$1.$slots = resolveSlots(children, parent)
  5351. );
  5352. }
  5353. return this$1.$slots
  5354. };
  5355. Object.defineProperty(this, 'scopedSlots', ({
  5356. enumerable: true,
  5357. get: function get () {
  5358. return normalizeScopedSlots(data.scopedSlots, this.slots())
  5359. }
  5360. }));
  5361. // support for compiled functional template
  5362. if (isCompiled) {
  5363. // exposing $options for renderStatic()
  5364. this.$options = options;
  5365. // pre-resolve slots for renderSlot()
  5366. this.$slots = this.slots();
  5367. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  5368. }
  5369. if (options._scopeId) {
  5370. this._c = function (a, b, c, d) {
  5371. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  5372. if (vnode && !Array.isArray(vnode)) {
  5373. vnode.fnScopeId = options._scopeId;
  5374. vnode.fnContext = parent;
  5375. }
  5376. return vnode
  5377. };
  5378. } else {
  5379. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  5380. }
  5381. }
  5382. installRenderHelpers(FunctionalRenderContext.prototype);
  5383. function createFunctionalComponent (
  5384. Ctor,
  5385. propsData,
  5386. data,
  5387. contextVm,
  5388. children
  5389. ) {
  5390. var options = Ctor.options;
  5391. var props = {};
  5392. var propOptions = options.props;
  5393. if (isDef(propOptions)) {
  5394. for (var key in propOptions) {
  5395. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  5396. }
  5397. } else {
  5398. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  5399. if (isDef(data.props)) { mergeProps(props, data.props); }
  5400. }
  5401. var renderContext = new FunctionalRenderContext(
  5402. data,
  5403. props,
  5404. children,
  5405. contextVm,
  5406. Ctor
  5407. );
  5408. var vnode = options.render.call(null, renderContext._c, renderContext);
  5409. if (vnode instanceof VNode) {
  5410. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  5411. } else if (Array.isArray(vnode)) {
  5412. var vnodes = normalizeChildren(vnode) || [];
  5413. var res = new Array(vnodes.length);
  5414. for (var i = 0; i < vnodes.length; i++) {
  5415. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  5416. }
  5417. return res
  5418. }
  5419. }
  5420. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  5421. // #7817 clone node before setting fnContext, otherwise if the node is reused
  5422. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  5423. // that should not be matched to match.
  5424. var clone = cloneVNode(vnode);
  5425. clone.fnContext = contextVm;
  5426. clone.fnOptions = options;
  5427. if (true) {
  5428. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  5429. }
  5430. if (data.slot) {
  5431. (clone.data || (clone.data = {})).slot = data.slot;
  5432. }
  5433. return clone
  5434. }
  5435. function mergeProps (to, from) {
  5436. for (var key in from) {
  5437. to[camelize(key)] = from[key];
  5438. }
  5439. }
  5440. /* */
  5441. /* */
  5442. /* */
  5443. /* */
  5444. // inline hooks to be invoked on component VNodes during patch
  5445. var componentVNodeHooks = {
  5446. init: function init (vnode, hydrating) {
  5447. if (
  5448. vnode.componentInstance &&
  5449. !vnode.componentInstance._isDestroyed &&
  5450. vnode.data.keepAlive
  5451. ) {
  5452. // kept-alive components, treat as a patch
  5453. var mountedNode = vnode; // work around flow
  5454. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  5455. } else {
  5456. var child = vnode.componentInstance = createComponentInstanceForVnode(
  5457. vnode,
  5458. activeInstance
  5459. );
  5460. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  5461. }
  5462. },
  5463. prepatch: function prepatch (oldVnode, vnode) {
  5464. var options = vnode.componentOptions;
  5465. var child = vnode.componentInstance = oldVnode.componentInstance;
  5466. updateChildComponent(
  5467. child,
  5468. options.propsData, // updated props
  5469. options.listeners, // updated listeners
  5470. vnode, // new parent vnode
  5471. options.children // new children
  5472. );
  5473. },
  5474. insert: function insert (vnode) {
  5475. var context = vnode.context;
  5476. var componentInstance = vnode.componentInstance;
  5477. if (!componentInstance._isMounted) {
  5478. callHook(componentInstance, 'onServiceCreated');
  5479. callHook(componentInstance, 'onServiceAttached');
  5480. componentInstance._isMounted = true;
  5481. callHook(componentInstance, 'mounted');
  5482. }
  5483. if (vnode.data.keepAlive) {
  5484. if (context._isMounted) {
  5485. // vue-router#1212
  5486. // During updates, a kept-alive component's child components may
  5487. // change, so directly walking the tree here may call activated hooks
  5488. // on incorrect children. Instead we push them into a queue which will
  5489. // be processed after the whole patch process ended.
  5490. queueActivatedComponent(componentInstance);
  5491. } else {
  5492. activateChildComponent(componentInstance, true /* direct */);
  5493. }
  5494. }
  5495. },
  5496. destroy: function destroy (vnode) {
  5497. var componentInstance = vnode.componentInstance;
  5498. if (!componentInstance._isDestroyed) {
  5499. if (!vnode.data.keepAlive) {
  5500. componentInstance.$destroy();
  5501. } else {
  5502. deactivateChildComponent(componentInstance, true /* direct */);
  5503. }
  5504. }
  5505. }
  5506. };
  5507. var hooksToMerge = Object.keys(componentVNodeHooks);
  5508. function createComponent (
  5509. Ctor,
  5510. data,
  5511. context,
  5512. children,
  5513. tag
  5514. ) {
  5515. if (isUndef(Ctor)) {
  5516. return
  5517. }
  5518. var baseCtor = context.$options._base;
  5519. // plain options object: turn it into a constructor
  5520. if (isObject(Ctor)) {
  5521. Ctor = baseCtor.extend(Ctor);
  5522. }
  5523. // if at this stage it's not a constructor or an async component factory,
  5524. // reject.
  5525. if (typeof Ctor !== 'function') {
  5526. if (true) {
  5527. warn(("Invalid Component definition: " + (String(Ctor))), context);
  5528. }
  5529. return
  5530. }
  5531. // async component
  5532. var asyncFactory;
  5533. if (isUndef(Ctor.cid)) {
  5534. asyncFactory = Ctor;
  5535. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  5536. if (Ctor === undefined) {
  5537. // return a placeholder node for async component, which is rendered
  5538. // as a comment node but preserves all the raw information for the node.
  5539. // the information will be used for async server-rendering and hydration.
  5540. return createAsyncPlaceholder(
  5541. asyncFactory,
  5542. data,
  5543. context,
  5544. children,
  5545. tag
  5546. )
  5547. }
  5548. }
  5549. data = data || {};
  5550. // resolve constructor options in case global mixins are applied after
  5551. // component constructor creation
  5552. resolveConstructorOptions(Ctor);
  5553. // transform component v-model data into props & events
  5554. if (isDef(data.model)) {
  5555. transformModel(Ctor.options, data);
  5556. }
  5557. // extract props
  5558. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  5559. // functional component
  5560. if (isTrue(Ctor.options.functional)) {
  5561. return createFunctionalComponent(Ctor, propsData, data, context, children)
  5562. }
  5563. // extract listeners, since these needs to be treated as
  5564. // child component listeners instead of DOM listeners
  5565. var listeners = data.on;
  5566. // replace with listeners with .native modifier
  5567. // so it gets processed during parent component patch.
  5568. data.on = data.nativeOn;
  5569. if (isTrue(Ctor.options.abstract)) {
  5570. // abstract components do not keep anything
  5571. // other than props & listeners & slot
  5572. // work around flow
  5573. var slot = data.slot;
  5574. data = {};
  5575. if (slot) {
  5576. data.slot = slot;
  5577. }
  5578. }
  5579. // install component management hooks onto the placeholder node
  5580. installComponentHooks(data);
  5581. // return a placeholder vnode
  5582. var name = Ctor.options.name || tag;
  5583. var vnode = new VNode(
  5584. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  5585. data, undefined, undefined, undefined, context,
  5586. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  5587. asyncFactory
  5588. );
  5589. return vnode
  5590. }
  5591. function createComponentInstanceForVnode (
  5592. vnode, // we know it's MountedComponentVNode but flow doesn't
  5593. parent // activeInstance in lifecycle state
  5594. ) {
  5595. var options = {
  5596. _isComponent: true,
  5597. _parentVnode: vnode,
  5598. parent: parent
  5599. };
  5600. // check inline-template render functions
  5601. var inlineTemplate = vnode.data.inlineTemplate;
  5602. if (isDef(inlineTemplate)) {
  5603. options.render = inlineTemplate.render;
  5604. options.staticRenderFns = inlineTemplate.staticRenderFns;
  5605. }
  5606. return new vnode.componentOptions.Ctor(options)
  5607. }
  5608. function installComponentHooks (data) {
  5609. var hooks = data.hook || (data.hook = {});
  5610. for (var i = 0; i < hooksToMerge.length; i++) {
  5611. var key = hooksToMerge[i];
  5612. var existing = hooks[key];
  5613. var toMerge = componentVNodeHooks[key];
  5614. if (existing !== toMerge && !(existing && existing._merged)) {
  5615. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  5616. }
  5617. }
  5618. }
  5619. function mergeHook$1 (f1, f2) {
  5620. var merged = function (a, b) {
  5621. // flow complains about extra args which is why we use any
  5622. f1(a, b);
  5623. f2(a, b);
  5624. };
  5625. merged._merged = true;
  5626. return merged
  5627. }
  5628. // transform component v-model info (value and callback) into
  5629. // prop and event handler respectively.
  5630. function transformModel (options, data) {
  5631. var prop = (options.model && options.model.prop) || 'value';
  5632. var event = (options.model && options.model.event) || 'input'
  5633. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  5634. var on = data.on || (data.on = {});
  5635. var existing = on[event];
  5636. var callback = data.model.callback;
  5637. if (isDef(existing)) {
  5638. if (
  5639. Array.isArray(existing)
  5640. ? existing.indexOf(callback) === -1
  5641. : existing !== callback
  5642. ) {
  5643. on[event] = [callback].concat(existing);
  5644. }
  5645. } else {
  5646. on[event] = callback;
  5647. }
  5648. }
  5649. /* */
  5650. var SIMPLE_NORMALIZE = 1;
  5651. var ALWAYS_NORMALIZE = 2;
  5652. // wrapper function for providing a more flexible interface
  5653. // without getting yelled at by flow
  5654. function createElement (
  5655. context,
  5656. tag,
  5657. data,
  5658. children,
  5659. normalizationType,
  5660. alwaysNormalize
  5661. ) {
  5662. if (Array.isArray(data) || isPrimitive(data)) {
  5663. normalizationType = children;
  5664. children = data;
  5665. data = undefined;
  5666. }
  5667. if (isTrue(alwaysNormalize)) {
  5668. normalizationType = ALWAYS_NORMALIZE;
  5669. }
  5670. return _createElement(context, tag, data, children, normalizationType)
  5671. }
  5672. function _createElement (
  5673. context,
  5674. tag,
  5675. data,
  5676. children,
  5677. normalizationType
  5678. ) {
  5679. if (isDef(data) && isDef((data).__ob__)) {
  5680. true && warn(
  5681. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  5682. 'Always create fresh vnode data objects in each render!',
  5683. context
  5684. );
  5685. return createEmptyVNode()
  5686. }
  5687. // object syntax in v-bind
  5688. if (isDef(data) && isDef(data.is)) {
  5689. tag = data.is;
  5690. }
  5691. if (!tag) {
  5692. // in case of component :is set to falsy value
  5693. return createEmptyVNode()
  5694. }
  5695. // warn against non-primitive key
  5696. if ( true &&
  5697. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  5698. ) {
  5699. {
  5700. warn(
  5701. 'Avoid using non-primitive value as key, ' +
  5702. 'use string/number value instead.',
  5703. context
  5704. );
  5705. }
  5706. }
  5707. // support single function children as default scoped slot
  5708. if (Array.isArray(children) &&
  5709. typeof children[0] === 'function'
  5710. ) {
  5711. data = data || {};
  5712. data.scopedSlots = { default: children[0] };
  5713. children.length = 0;
  5714. }
  5715. if (normalizationType === ALWAYS_NORMALIZE) {
  5716. children = normalizeChildren(children);
  5717. } else if (normalizationType === SIMPLE_NORMALIZE) {
  5718. children = simpleNormalizeChildren(children);
  5719. }
  5720. var vnode, ns;
  5721. if (typeof tag === 'string') {
  5722. var Ctor;
  5723. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  5724. if (config.isReservedTag(tag)) {
  5725. // platform built-in elements
  5726. if ( true && isDef(data) && isDef(data.nativeOn)) {
  5727. warn(
  5728. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  5729. context
  5730. );
  5731. }
  5732. vnode = new VNode(
  5733. config.parsePlatformTagName(tag), data, children,
  5734. undefined, undefined, context
  5735. );
  5736. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  5737. // component
  5738. vnode = createComponent(Ctor, data, context, children, tag);
  5739. } else {
  5740. // unknown or unlisted namespaced elements
  5741. // check at runtime because it may get assigned a namespace when its
  5742. // parent normalizes children
  5743. vnode = new VNode(
  5744. tag, data, children,
  5745. undefined, undefined, context
  5746. );
  5747. }
  5748. } else {
  5749. // direct component options / constructor
  5750. vnode = createComponent(tag, data, context, children);
  5751. }
  5752. if (Array.isArray(vnode)) {
  5753. return vnode
  5754. } else if (isDef(vnode)) {
  5755. if (isDef(ns)) { applyNS(vnode, ns); }
  5756. if (isDef(data)) { registerDeepBindings(data); }
  5757. return vnode
  5758. } else {
  5759. return createEmptyVNode()
  5760. }
  5761. }
  5762. function applyNS (vnode, ns, force) {
  5763. vnode.ns = ns;
  5764. if (vnode.tag === 'foreignObject') {
  5765. // use default namespace inside foreignObject
  5766. ns = undefined;
  5767. force = true;
  5768. }
  5769. if (isDef(vnode.children)) {
  5770. for (var i = 0, l = vnode.children.length; i < l; i++) {
  5771. var child = vnode.children[i];
  5772. if (isDef(child.tag) && (
  5773. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  5774. applyNS(child, ns, force);
  5775. }
  5776. }
  5777. }
  5778. }
  5779. // ref #5318
  5780. // necessary to ensure parent re-render when deep bindings like :style and
  5781. // :class are used on slot nodes
  5782. function registerDeepBindings (data) {
  5783. if (isObject(data.style)) {
  5784. traverse(data.style);
  5785. }
  5786. if (isObject(data.class)) {
  5787. traverse(data.class);
  5788. }
  5789. }
  5790. /* */
  5791. function initRender (vm) {
  5792. vm._vnode = null; // the root of the child tree
  5793. vm._staticTrees = null; // v-once cached trees
  5794. var options = vm.$options;
  5795. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  5796. var renderContext = parentVnode && parentVnode.context;
  5797. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  5798. vm.$scopedSlots = emptyObject;
  5799. // bind the createElement fn to this instance
  5800. // so that we get proper render context inside it.
  5801. // args order: tag, data, children, normalizationType, alwaysNormalize
  5802. // internal version is used by render functions compiled from templates
  5803. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  5804. // normalization is always applied for the public version, used in
  5805. // user-written render functions.
  5806. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  5807. // $attrs & $listeners are exposed for easier HOC creation.
  5808. // they need to be reactive so that HOCs using them are always updated
  5809. var parentData = parentVnode && parentVnode.data;
  5810. /* istanbul ignore else */
  5811. if (true) {
  5812. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  5813. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  5814. }, true);
  5815. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  5816. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  5817. }, true);
  5818. } else {}
  5819. }
  5820. var currentRenderingInstance = null;
  5821. function renderMixin (Vue) {
  5822. // install runtime convenience helpers
  5823. installRenderHelpers(Vue.prototype);
  5824. Vue.prototype.$nextTick = function (fn) {
  5825. return nextTick(fn, this)
  5826. };
  5827. Vue.prototype._render = function () {
  5828. var vm = this;
  5829. var ref = vm.$options;
  5830. var render = ref.render;
  5831. var _parentVnode = ref._parentVnode;
  5832. if (_parentVnode) {
  5833. vm.$scopedSlots = normalizeScopedSlots(
  5834. _parentVnode.data.scopedSlots,
  5835. vm.$slots,
  5836. vm.$scopedSlots
  5837. );
  5838. }
  5839. // set parent vnode. this allows render functions to have access
  5840. // to the data on the placeholder node.
  5841. vm.$vnode = _parentVnode;
  5842. // render self
  5843. var vnode;
  5844. try {
  5845. // There's no need to maintain a stack because all render fns are called
  5846. // separately from one another. Nested component's render fns are called
  5847. // when parent component is patched.
  5848. currentRenderingInstance = vm;
  5849. vnode = render.call(vm._renderProxy, vm.$createElement);
  5850. } catch (e) {
  5851. handleError(e, vm, "render");
  5852. // return error render result,
  5853. // or previous vnode to prevent render error causing blank component
  5854. /* istanbul ignore else */
  5855. if ( true && vm.$options.renderError) {
  5856. try {
  5857. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  5858. } catch (e) {
  5859. handleError(e, vm, "renderError");
  5860. vnode = vm._vnode;
  5861. }
  5862. } else {
  5863. vnode = vm._vnode;
  5864. }
  5865. } finally {
  5866. currentRenderingInstance = null;
  5867. }
  5868. // if the returned array contains only a single node, allow it
  5869. if (Array.isArray(vnode) && vnode.length === 1) {
  5870. vnode = vnode[0];
  5871. }
  5872. // return empty vnode in case the render function errored out
  5873. if (!(vnode instanceof VNode)) {
  5874. if ( true && Array.isArray(vnode)) {
  5875. warn(
  5876. 'Multiple root nodes returned from render function. Render function ' +
  5877. 'should return a single root node.',
  5878. vm
  5879. );
  5880. }
  5881. vnode = createEmptyVNode();
  5882. }
  5883. // set parent
  5884. vnode.parent = _parentVnode;
  5885. return vnode
  5886. };
  5887. }
  5888. /* */
  5889. function ensureCtor (comp, base) {
  5890. if (
  5891. comp.__esModule ||
  5892. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  5893. ) {
  5894. comp = comp.default;
  5895. }
  5896. return isObject(comp)
  5897. ? base.extend(comp)
  5898. : comp
  5899. }
  5900. function createAsyncPlaceholder (
  5901. factory,
  5902. data,
  5903. context,
  5904. children,
  5905. tag
  5906. ) {
  5907. var node = createEmptyVNode();
  5908. node.asyncFactory = factory;
  5909. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  5910. return node
  5911. }
  5912. function resolveAsyncComponent (
  5913. factory,
  5914. baseCtor
  5915. ) {
  5916. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  5917. return factory.errorComp
  5918. }
  5919. if (isDef(factory.resolved)) {
  5920. return factory.resolved
  5921. }
  5922. var owner = currentRenderingInstance;
  5923. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  5924. // already pending
  5925. factory.owners.push(owner);
  5926. }
  5927. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  5928. return factory.loadingComp
  5929. }
  5930. if (owner && !isDef(factory.owners)) {
  5931. var owners = factory.owners = [owner];
  5932. var sync = true;
  5933. var timerLoading = null;
  5934. var timerTimeout = null
  5935. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  5936. var forceRender = function (renderCompleted) {
  5937. for (var i = 0, l = owners.length; i < l; i++) {
  5938. (owners[i]).$forceUpdate();
  5939. }
  5940. if (renderCompleted) {
  5941. owners.length = 0;
  5942. if (timerLoading !== null) {
  5943. clearTimeout(timerLoading);
  5944. timerLoading = null;
  5945. }
  5946. if (timerTimeout !== null) {
  5947. clearTimeout(timerTimeout);
  5948. timerTimeout = null;
  5949. }
  5950. }
  5951. };
  5952. var resolve = once(function (res) {
  5953. // cache resolved
  5954. factory.resolved = ensureCtor(res, baseCtor);
  5955. // invoke callbacks only if this is not a synchronous resolve
  5956. // (async resolves are shimmed as synchronous during SSR)
  5957. if (!sync) {
  5958. forceRender(true);
  5959. } else {
  5960. owners.length = 0;
  5961. }
  5962. });
  5963. var reject = once(function (reason) {
  5964. true && warn(
  5965. "Failed to resolve async component: " + (String(factory)) +
  5966. (reason ? ("\nReason: " + reason) : '')
  5967. );
  5968. if (isDef(factory.errorComp)) {
  5969. factory.error = true;
  5970. forceRender(true);
  5971. }
  5972. });
  5973. var res = factory(resolve, reject);
  5974. if (isObject(res)) {
  5975. if (isPromise(res)) {
  5976. // () => Promise
  5977. if (isUndef(factory.resolved)) {
  5978. res.then(resolve, reject);
  5979. }
  5980. } else if (isPromise(res.component)) {
  5981. res.component.then(resolve, reject);
  5982. if (isDef(res.error)) {
  5983. factory.errorComp = ensureCtor(res.error, baseCtor);
  5984. }
  5985. if (isDef(res.loading)) {
  5986. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  5987. if (res.delay === 0) {
  5988. factory.loading = true;
  5989. } else {
  5990. timerLoading = setTimeout(function () {
  5991. timerLoading = null;
  5992. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  5993. factory.loading = true;
  5994. forceRender(false);
  5995. }
  5996. }, res.delay || 200);
  5997. }
  5998. }
  5999. if (isDef(res.timeout)) {
  6000. timerTimeout = setTimeout(function () {
  6001. timerTimeout = null;
  6002. if (isUndef(factory.resolved)) {
  6003. reject(
  6004. true
  6005. ? ("timeout (" + (res.timeout) + "ms)")
  6006. : undefined
  6007. );
  6008. }
  6009. }, res.timeout);
  6010. }
  6011. }
  6012. }
  6013. sync = false;
  6014. // return in case resolved synchronously
  6015. return factory.loading
  6016. ? factory.loadingComp
  6017. : factory.resolved
  6018. }
  6019. }
  6020. /* */
  6021. function isAsyncPlaceholder (node) {
  6022. return node.isComment && node.asyncFactory
  6023. }
  6024. /* */
  6025. function getFirstComponentChild (children) {
  6026. if (Array.isArray(children)) {
  6027. for (var i = 0; i < children.length; i++) {
  6028. var c = children[i];
  6029. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  6030. return c
  6031. }
  6032. }
  6033. }
  6034. }
  6035. /* */
  6036. /* */
  6037. function initEvents (vm) {
  6038. vm._events = Object.create(null);
  6039. vm._hasHookEvent = false;
  6040. // init parent attached events
  6041. var listeners = vm.$options._parentListeners;
  6042. if (listeners) {
  6043. updateComponentListeners(vm, listeners);
  6044. }
  6045. }
  6046. var target;
  6047. function add (event, fn) {
  6048. target.$on(event, fn);
  6049. }
  6050. function remove$1 (event, fn) {
  6051. target.$off(event, fn);
  6052. }
  6053. function createOnceHandler (event, fn) {
  6054. var _target = target;
  6055. return function onceHandler () {
  6056. var res = fn.apply(null, arguments);
  6057. if (res !== null) {
  6058. _target.$off(event, onceHandler);
  6059. }
  6060. }
  6061. }
  6062. function updateComponentListeners (
  6063. vm,
  6064. listeners,
  6065. oldListeners
  6066. ) {
  6067. target = vm;
  6068. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  6069. target = undefined;
  6070. }
  6071. function eventsMixin (Vue) {
  6072. var hookRE = /^hook:/;
  6073. Vue.prototype.$on = function (event, fn) {
  6074. var vm = this;
  6075. if (Array.isArray(event)) {
  6076. for (var i = 0, l = event.length; i < l; i++) {
  6077. vm.$on(event[i], fn);
  6078. }
  6079. } else {
  6080. (vm._events[event] || (vm._events[event] = [])).push(fn);
  6081. // optimize hook:event cost by using a boolean flag marked at registration
  6082. // instead of a hash lookup
  6083. if (hookRE.test(event)) {
  6084. vm._hasHookEvent = true;
  6085. }
  6086. }
  6087. return vm
  6088. };
  6089. Vue.prototype.$once = function (event, fn) {
  6090. var vm = this;
  6091. function on () {
  6092. vm.$off(event, on);
  6093. fn.apply(vm, arguments);
  6094. }
  6095. on.fn = fn;
  6096. vm.$on(event, on);
  6097. return vm
  6098. };
  6099. Vue.prototype.$off = function (event, fn) {
  6100. var vm = this;
  6101. // all
  6102. if (!arguments.length) {
  6103. vm._events = Object.create(null);
  6104. return vm
  6105. }
  6106. // array of events
  6107. if (Array.isArray(event)) {
  6108. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  6109. vm.$off(event[i$1], fn);
  6110. }
  6111. return vm
  6112. }
  6113. // specific event
  6114. var cbs = vm._events[event];
  6115. if (!cbs) {
  6116. return vm
  6117. }
  6118. if (!fn) {
  6119. vm._events[event] = null;
  6120. return vm
  6121. }
  6122. // specific handler
  6123. var cb;
  6124. var i = cbs.length;
  6125. while (i--) {
  6126. cb = cbs[i];
  6127. if (cb === fn || cb.fn === fn) {
  6128. cbs.splice(i, 1);
  6129. break
  6130. }
  6131. }
  6132. return vm
  6133. };
  6134. Vue.prototype.$emit = function (event) {
  6135. var vm = this;
  6136. if (true) {
  6137. var lowerCaseEvent = event.toLowerCase();
  6138. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  6139. tip(
  6140. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  6141. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  6142. "Note that HTML attributes are case-insensitive and you cannot use " +
  6143. "v-on to listen to camelCase events when using in-DOM templates. " +
  6144. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  6145. );
  6146. }
  6147. }
  6148. var cbs = vm._events[event];
  6149. if (cbs) {
  6150. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  6151. var args = toArray(arguments, 1);
  6152. var info = "event handler for \"" + event + "\"";
  6153. for (var i = 0, l = cbs.length; i < l; i++) {
  6154. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  6155. }
  6156. }
  6157. return vm
  6158. };
  6159. }
  6160. /* */
  6161. var activeInstance = null;
  6162. var isUpdatingChildComponent = false;
  6163. function setActiveInstance(vm) {
  6164. var prevActiveInstance = activeInstance;
  6165. activeInstance = vm;
  6166. return function () {
  6167. activeInstance = prevActiveInstance;
  6168. }
  6169. }
  6170. function initLifecycle (vm) {
  6171. var options = vm.$options;
  6172. // locate first non-abstract parent
  6173. var parent = options.parent;
  6174. if (parent && !options.abstract) {
  6175. while (parent.$options.abstract && parent.$parent) {
  6176. parent = parent.$parent;
  6177. }
  6178. parent.$children.push(vm);
  6179. }
  6180. vm.$parent = parent;
  6181. vm.$root = parent ? parent.$root : vm;
  6182. vm.$children = [];
  6183. vm.$refs = {};
  6184. vm._watcher = null;
  6185. vm._inactive = null;
  6186. vm._directInactive = false;
  6187. vm._isMounted = false;
  6188. vm._isDestroyed = false;
  6189. vm._isBeingDestroyed = false;
  6190. }
  6191. function lifecycleMixin (Vue) {
  6192. Vue.prototype._update = function (vnode, hydrating) {
  6193. var vm = this;
  6194. var prevEl = vm.$el;
  6195. var prevVnode = vm._vnode;
  6196. var restoreActiveInstance = setActiveInstance(vm);
  6197. vm._vnode = vnode;
  6198. // Vue.prototype.__patch__ is injected in entry points
  6199. // based on the rendering backend used.
  6200. if (!prevVnode) {
  6201. // initial render
  6202. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  6203. } else {
  6204. // updates
  6205. vm.$el = vm.__patch__(prevVnode, vnode);
  6206. }
  6207. restoreActiveInstance();
  6208. // update __vue__ reference
  6209. if (prevEl) {
  6210. prevEl.__vue__ = null;
  6211. }
  6212. if (vm.$el) {
  6213. vm.$el.__vue__ = vm;
  6214. }
  6215. // if parent is an HOC, update its $el as well
  6216. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  6217. vm.$parent.$el = vm.$el;
  6218. }
  6219. // updated hook is called by the scheduler to ensure that children are
  6220. // updated in a parent's updated hook.
  6221. };
  6222. Vue.prototype.$forceUpdate = function () {
  6223. var vm = this;
  6224. if (vm._watcher) {
  6225. vm._watcher.update();
  6226. }
  6227. };
  6228. Vue.prototype.$destroy = function () {
  6229. var vm = this;
  6230. if (vm._isBeingDestroyed) {
  6231. return
  6232. }
  6233. callHook(vm, 'beforeDestroy');
  6234. vm._isBeingDestroyed = true;
  6235. // remove self from parent
  6236. var parent = vm.$parent;
  6237. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  6238. remove(parent.$children, vm);
  6239. }
  6240. // teardown watchers
  6241. if (vm._watcher) {
  6242. vm._watcher.teardown();
  6243. }
  6244. var i = vm._watchers.length;
  6245. while (i--) {
  6246. vm._watchers[i].teardown();
  6247. }
  6248. // remove reference from data ob
  6249. // frozen object may not have observer.
  6250. if (vm._data.__ob__) {
  6251. vm._data.__ob__.vmCount--;
  6252. }
  6253. // call the last hook...
  6254. vm._isDestroyed = true;
  6255. // invoke destroy hooks on current rendered tree
  6256. vm.__patch__(vm._vnode, null);
  6257. // fire destroyed hook
  6258. callHook(vm, 'destroyed');
  6259. // turn off all instance listeners.
  6260. vm.$off();
  6261. // remove __vue__ reference
  6262. if (vm.$el) {
  6263. vm.$el.__vue__ = null;
  6264. }
  6265. // release circular reference (#6759)
  6266. if (vm.$vnode) {
  6267. vm.$vnode.parent = null;
  6268. }
  6269. };
  6270. }
  6271. function updateChildComponent (
  6272. vm,
  6273. propsData,
  6274. listeners,
  6275. parentVnode,
  6276. renderChildren
  6277. ) {
  6278. if (true) {
  6279. isUpdatingChildComponent = true;
  6280. }
  6281. // determine whether component has slot children
  6282. // we need to do this before overwriting $options._renderChildren.
  6283. // check if there are dynamic scopedSlots (hand-written or compiled but with
  6284. // dynamic slot names). Static scoped slots compiled from template has the
  6285. // "$stable" marker.
  6286. var newScopedSlots = parentVnode.data.scopedSlots;
  6287. var oldScopedSlots = vm.$scopedSlots;
  6288. var hasDynamicScopedSlot = !!(
  6289. (newScopedSlots && !newScopedSlots.$stable) ||
  6290. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  6291. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  6292. );
  6293. // Any static slot children from the parent may have changed during parent's
  6294. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  6295. // update is necessary to ensure correctness.
  6296. var needsForceUpdate = !!(
  6297. renderChildren || // has new static slots
  6298. vm.$options._renderChildren || // has old static slots
  6299. hasDynamicScopedSlot
  6300. );
  6301. vm.$options._parentVnode = parentVnode;
  6302. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  6303. if (vm._vnode) { // update child tree's parent
  6304. vm._vnode.parent = parentVnode;
  6305. }
  6306. vm.$options._renderChildren = renderChildren;
  6307. // update $attrs and $listeners hash
  6308. // these are also reactive so they may trigger child update if the child
  6309. // used them during render
  6310. vm.$attrs = parentVnode.data.attrs || emptyObject;
  6311. vm.$listeners = listeners || emptyObject;
  6312. // update props
  6313. if (propsData && vm.$options.props) {
  6314. toggleObserving(false);
  6315. var props = vm._props;
  6316. var propKeys = vm.$options._propKeys || [];
  6317. for (var i = 0; i < propKeys.length; i++) {
  6318. var key = propKeys[i];
  6319. var propOptions = vm.$options.props; // wtf flow?
  6320. props[key] = validateProp(key, propOptions, propsData, vm);
  6321. }
  6322. toggleObserving(true);
  6323. // keep a copy of raw propsData
  6324. vm.$options.propsData = propsData;
  6325. }
  6326. // fixed by xxxxxx update properties(mp runtime)
  6327. vm._$updateProperties && vm._$updateProperties(vm);
  6328. // update listeners
  6329. listeners = listeners || emptyObject;
  6330. var oldListeners = vm.$options._parentListeners;
  6331. vm.$options._parentListeners = listeners;
  6332. updateComponentListeners(vm, listeners, oldListeners);
  6333. // resolve slots + force update if has children
  6334. if (needsForceUpdate) {
  6335. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  6336. vm.$forceUpdate();
  6337. }
  6338. if (true) {
  6339. isUpdatingChildComponent = false;
  6340. }
  6341. }
  6342. function isInInactiveTree (vm) {
  6343. while (vm && (vm = vm.$parent)) {
  6344. if (vm._inactive) { return true }
  6345. }
  6346. return false
  6347. }
  6348. function activateChildComponent (vm, direct) {
  6349. if (direct) {
  6350. vm._directInactive = false;
  6351. if (isInInactiveTree(vm)) {
  6352. return
  6353. }
  6354. } else if (vm._directInactive) {
  6355. return
  6356. }
  6357. if (vm._inactive || vm._inactive === null) {
  6358. vm._inactive = false;
  6359. for (var i = 0; i < vm.$children.length; i++) {
  6360. activateChildComponent(vm.$children[i]);
  6361. }
  6362. callHook(vm, 'activated');
  6363. }
  6364. }
  6365. function deactivateChildComponent (vm, direct) {
  6366. if (direct) {
  6367. vm._directInactive = true;
  6368. if (isInInactiveTree(vm)) {
  6369. return
  6370. }
  6371. }
  6372. if (!vm._inactive) {
  6373. vm._inactive = true;
  6374. for (var i = 0; i < vm.$children.length; i++) {
  6375. deactivateChildComponent(vm.$children[i]);
  6376. }
  6377. callHook(vm, 'deactivated');
  6378. }
  6379. }
  6380. function callHook (vm, hook) {
  6381. // #7573 disable dep collection when invoking lifecycle hooks
  6382. pushTarget();
  6383. var handlers = vm.$options[hook];
  6384. var info = hook + " hook";
  6385. if (handlers) {
  6386. for (var i = 0, j = handlers.length; i < j; i++) {
  6387. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  6388. }
  6389. }
  6390. if (vm._hasHookEvent) {
  6391. vm.$emit('hook:' + hook);
  6392. }
  6393. popTarget();
  6394. }
  6395. /* */
  6396. var MAX_UPDATE_COUNT = 100;
  6397. var queue = [];
  6398. var activatedChildren = [];
  6399. var has = {};
  6400. var circular = {};
  6401. var waiting = false;
  6402. var flushing = false;
  6403. var index = 0;
  6404. /**
  6405. * Reset the scheduler's state.
  6406. */
  6407. function resetSchedulerState () {
  6408. index = queue.length = activatedChildren.length = 0;
  6409. has = {};
  6410. if (true) {
  6411. circular = {};
  6412. }
  6413. waiting = flushing = false;
  6414. }
  6415. // Async edge case #6566 requires saving the timestamp when event listeners are
  6416. // attached. However, calling performance.now() has a perf overhead especially
  6417. // if the page has thousands of event listeners. Instead, we take a timestamp
  6418. // every time the scheduler flushes and use that for all event listeners
  6419. // attached during that flush.
  6420. var currentFlushTimestamp = 0;
  6421. // Async edge case fix requires storing an event listener's attach timestamp.
  6422. var getNow = Date.now;
  6423. // Determine what event timestamp the browser is using. Annoyingly, the
  6424. // timestamp can either be hi-res (relative to page load) or low-res
  6425. // (relative to UNIX epoch), so in order to compare time we have to use the
  6426. // same timestamp type when saving the flush timestamp.
  6427. // All IE versions use low-res event timestamps, and have problematic clock
  6428. // implementations (#9632)
  6429. if (inBrowser && !isIE) {
  6430. var performance = window.performance;
  6431. if (
  6432. performance &&
  6433. typeof performance.now === 'function' &&
  6434. getNow() > document.createEvent('Event').timeStamp
  6435. ) {
  6436. // if the event timestamp, although evaluated AFTER the Date.now(), is
  6437. // smaller than it, it means the event is using a hi-res timestamp,
  6438. // and we need to use the hi-res version for event listener timestamps as
  6439. // well.
  6440. getNow = function () { return performance.now(); };
  6441. }
  6442. }
  6443. /**
  6444. * Flush both queues and run the watchers.
  6445. */
  6446. function flushSchedulerQueue () {
  6447. currentFlushTimestamp = getNow();
  6448. flushing = true;
  6449. var watcher, id;
  6450. // Sort queue before flush.
  6451. // This ensures that:
  6452. // 1. Components are updated from parent to child. (because parent is always
  6453. // created before the child)
  6454. // 2. A component's user watchers are run before its render watcher (because
  6455. // user watchers are created before the render watcher)
  6456. // 3. If a component is destroyed during a parent component's watcher run,
  6457. // its watchers can be skipped.
  6458. queue.sort(function (a, b) { return a.id - b.id; });
  6459. // do not cache length because more watchers might be pushed
  6460. // as we run existing watchers
  6461. for (index = 0; index < queue.length; index++) {
  6462. watcher = queue[index];
  6463. if (watcher.before) {
  6464. watcher.before();
  6465. }
  6466. id = watcher.id;
  6467. has[id] = null;
  6468. watcher.run();
  6469. // in dev build, check and stop circular updates.
  6470. if ( true && has[id] != null) {
  6471. circular[id] = (circular[id] || 0) + 1;
  6472. if (circular[id] > MAX_UPDATE_COUNT) {
  6473. warn(
  6474. 'You may have an infinite update loop ' + (
  6475. watcher.user
  6476. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  6477. : "in a component render function."
  6478. ),
  6479. watcher.vm
  6480. );
  6481. break
  6482. }
  6483. }
  6484. }
  6485. // keep copies of post queues before resetting state
  6486. var activatedQueue = activatedChildren.slice();
  6487. var updatedQueue = queue.slice();
  6488. resetSchedulerState();
  6489. // call component updated and activated hooks
  6490. callActivatedHooks(activatedQueue);
  6491. callUpdatedHooks(updatedQueue);
  6492. // devtool hook
  6493. /* istanbul ignore if */
  6494. if (devtools && config.devtools) {
  6495. devtools.emit('flush');
  6496. }
  6497. }
  6498. function callUpdatedHooks (queue) {
  6499. var i = queue.length;
  6500. while (i--) {
  6501. var watcher = queue[i];
  6502. var vm = watcher.vm;
  6503. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  6504. callHook(vm, 'updated');
  6505. }
  6506. }
  6507. }
  6508. /**
  6509. * Queue a kept-alive component that was activated during patch.
  6510. * The queue will be processed after the entire tree has been patched.
  6511. */
  6512. function queueActivatedComponent (vm) {
  6513. // setting _inactive to false here so that a render function can
  6514. // rely on checking whether it's in an inactive tree (e.g. router-view)
  6515. vm._inactive = false;
  6516. activatedChildren.push(vm);
  6517. }
  6518. function callActivatedHooks (queue) {
  6519. for (var i = 0; i < queue.length; i++) {
  6520. queue[i]._inactive = true;
  6521. activateChildComponent(queue[i], true /* true */);
  6522. }
  6523. }
  6524. /**
  6525. * Push a watcher into the watcher queue.
  6526. * Jobs with duplicate IDs will be skipped unless it's
  6527. * pushed when the queue is being flushed.
  6528. */
  6529. function queueWatcher (watcher) {
  6530. var id = watcher.id;
  6531. if (has[id] == null) {
  6532. has[id] = true;
  6533. if (!flushing) {
  6534. queue.push(watcher);
  6535. } else {
  6536. // if already flushing, splice the watcher based on its id
  6537. // if already past its id, it will be run next immediately.
  6538. var i = queue.length - 1;
  6539. while (i > index && queue[i].id > watcher.id) {
  6540. i--;
  6541. }
  6542. queue.splice(i + 1, 0, watcher);
  6543. }
  6544. // queue the flush
  6545. if (!waiting) {
  6546. waiting = true;
  6547. if ( true && !config.async) {
  6548. flushSchedulerQueue();
  6549. return
  6550. }
  6551. nextTick(flushSchedulerQueue);
  6552. }
  6553. }
  6554. }
  6555. /* */
  6556. var uid$2 = 0;
  6557. /**
  6558. * A watcher parses an expression, collects dependencies,
  6559. * and fires callback when the expression value changes.
  6560. * This is used for both the $watch() api and directives.
  6561. */
  6562. var Watcher = function Watcher (
  6563. vm,
  6564. expOrFn,
  6565. cb,
  6566. options,
  6567. isRenderWatcher
  6568. ) {
  6569. this.vm = vm;
  6570. if (isRenderWatcher) {
  6571. vm._watcher = this;
  6572. }
  6573. vm._watchers.push(this);
  6574. // options
  6575. if (options) {
  6576. this.deep = !!options.deep;
  6577. this.user = !!options.user;
  6578. this.lazy = !!options.lazy;
  6579. this.sync = !!options.sync;
  6580. this.before = options.before;
  6581. } else {
  6582. this.deep = this.user = this.lazy = this.sync = false;
  6583. }
  6584. this.cb = cb;
  6585. this.id = ++uid$2; // uid for batching
  6586. this.active = true;
  6587. this.dirty = this.lazy; // for lazy watchers
  6588. this.deps = [];
  6589. this.newDeps = [];
  6590. this.depIds = new _Set();
  6591. this.newDepIds = new _Set();
  6592. this.expression = true
  6593. ? expOrFn.toString()
  6594. : undefined;
  6595. // parse expression for getter
  6596. if (typeof expOrFn === 'function') {
  6597. this.getter = expOrFn;
  6598. } else {
  6599. this.getter = parsePath(expOrFn);
  6600. if (!this.getter) {
  6601. this.getter = noop;
  6602. true && warn(
  6603. "Failed watching path: \"" + expOrFn + "\" " +
  6604. 'Watcher only accepts simple dot-delimited paths. ' +
  6605. 'For full control, use a function instead.',
  6606. vm
  6607. );
  6608. }
  6609. }
  6610. this.value = this.lazy
  6611. ? undefined
  6612. : this.get();
  6613. };
  6614. /**
  6615. * Evaluate the getter, and re-collect dependencies.
  6616. */
  6617. Watcher.prototype.get = function get () {
  6618. pushTarget(this);
  6619. var value;
  6620. var vm = this.vm;
  6621. try {
  6622. value = this.getter.call(vm, vm);
  6623. } catch (e) {
  6624. if (this.user) {
  6625. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  6626. } else {
  6627. throw e
  6628. }
  6629. } finally {
  6630. // "touch" every property so they are all tracked as
  6631. // dependencies for deep watching
  6632. if (this.deep) {
  6633. traverse(value);
  6634. }
  6635. popTarget();
  6636. this.cleanupDeps();
  6637. }
  6638. return value
  6639. };
  6640. /**
  6641. * Add a dependency to this directive.
  6642. */
  6643. Watcher.prototype.addDep = function addDep (dep) {
  6644. var id = dep.id;
  6645. if (!this.newDepIds.has(id)) {
  6646. this.newDepIds.add(id);
  6647. this.newDeps.push(dep);
  6648. if (!this.depIds.has(id)) {
  6649. dep.addSub(this);
  6650. }
  6651. }
  6652. };
  6653. /**
  6654. * Clean up for dependency collection.
  6655. */
  6656. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  6657. var i = this.deps.length;
  6658. while (i--) {
  6659. var dep = this.deps[i];
  6660. if (!this.newDepIds.has(dep.id)) {
  6661. dep.removeSub(this);
  6662. }
  6663. }
  6664. var tmp = this.depIds;
  6665. this.depIds = this.newDepIds;
  6666. this.newDepIds = tmp;
  6667. this.newDepIds.clear();
  6668. tmp = this.deps;
  6669. this.deps = this.newDeps;
  6670. this.newDeps = tmp;
  6671. this.newDeps.length = 0;
  6672. };
  6673. /**
  6674. * Subscriber interface.
  6675. * Will be called when a dependency changes.
  6676. */
  6677. Watcher.prototype.update = function update () {
  6678. /* istanbul ignore else */
  6679. if (this.lazy) {
  6680. this.dirty = true;
  6681. } else if (this.sync) {
  6682. this.run();
  6683. } else {
  6684. queueWatcher(this);
  6685. }
  6686. };
  6687. /**
  6688. * Scheduler job interface.
  6689. * Will be called by the scheduler.
  6690. */
  6691. Watcher.prototype.run = function run () {
  6692. if (this.active) {
  6693. var value = this.get();
  6694. if (
  6695. value !== this.value ||
  6696. // Deep watchers and watchers on Object/Arrays should fire even
  6697. // when the value is the same, because the value may
  6698. // have mutated.
  6699. isObject(value) ||
  6700. this.deep
  6701. ) {
  6702. // set new value
  6703. var oldValue = this.value;
  6704. this.value = value;
  6705. if (this.user) {
  6706. try {
  6707. this.cb.call(this.vm, value, oldValue);
  6708. } catch (e) {
  6709. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  6710. }
  6711. } else {
  6712. this.cb.call(this.vm, value, oldValue);
  6713. }
  6714. }
  6715. }
  6716. };
  6717. /**
  6718. * Evaluate the value of the watcher.
  6719. * This only gets called for lazy watchers.
  6720. */
  6721. Watcher.prototype.evaluate = function evaluate () {
  6722. this.value = this.get();
  6723. this.dirty = false;
  6724. };
  6725. /**
  6726. * Depend on all deps collected by this watcher.
  6727. */
  6728. Watcher.prototype.depend = function depend () {
  6729. var i = this.deps.length;
  6730. while (i--) {
  6731. this.deps[i].depend();
  6732. }
  6733. };
  6734. /**
  6735. * Remove self from all dependencies' subscriber list.
  6736. */
  6737. Watcher.prototype.teardown = function teardown () {
  6738. if (this.active) {
  6739. // remove self from vm's watcher list
  6740. // this is a somewhat expensive operation so we skip it
  6741. // if the vm is being destroyed.
  6742. if (!this.vm._isBeingDestroyed) {
  6743. remove(this.vm._watchers, this);
  6744. }
  6745. var i = this.deps.length;
  6746. while (i--) {
  6747. this.deps[i].removeSub(this);
  6748. }
  6749. this.active = false;
  6750. }
  6751. };
  6752. /* */
  6753. var sharedPropertyDefinition = {
  6754. enumerable: true,
  6755. configurable: true,
  6756. get: noop,
  6757. set: noop
  6758. };
  6759. function proxy (target, sourceKey, key) {
  6760. sharedPropertyDefinition.get = function proxyGetter () {
  6761. return this[sourceKey][key]
  6762. };
  6763. sharedPropertyDefinition.set = function proxySetter (val) {
  6764. this[sourceKey][key] = val;
  6765. };
  6766. Object.defineProperty(target, key, sharedPropertyDefinition);
  6767. }
  6768. function initState (vm) {
  6769. vm._watchers = [];
  6770. var opts = vm.$options;
  6771. if (opts.props) { initProps(vm, opts.props); }
  6772. if (opts.methods) { initMethods(vm, opts.methods); }
  6773. if (opts.data) {
  6774. initData(vm);
  6775. } else {
  6776. observe(vm._data = {}, true /* asRootData */);
  6777. }
  6778. if (opts.computed) { initComputed(vm, opts.computed); }
  6779. if (opts.watch && opts.watch !== nativeWatch) {
  6780. initWatch(vm, opts.watch);
  6781. }
  6782. }
  6783. function initProps (vm, propsOptions) {
  6784. var propsData = vm.$options.propsData || {};
  6785. var props = vm._props = {};
  6786. // cache prop keys so that future props updates can iterate using Array
  6787. // instead of dynamic object key enumeration.
  6788. var keys = vm.$options._propKeys = [];
  6789. var isRoot = !vm.$parent;
  6790. // root instance props should be converted
  6791. if (!isRoot) {
  6792. toggleObserving(false);
  6793. }
  6794. var loop = function ( key ) {
  6795. keys.push(key);
  6796. var value = validateProp(key, propsOptions, propsData, vm);
  6797. /* istanbul ignore else */
  6798. if (true) {
  6799. var hyphenatedKey = hyphenate(key);
  6800. if (isReservedAttribute(hyphenatedKey) ||
  6801. config.isReservedAttr(hyphenatedKey)) {
  6802. warn(
  6803. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  6804. vm
  6805. );
  6806. }
  6807. defineReactive$$1(props, key, value, function () {
  6808. if (!isRoot && !isUpdatingChildComponent) {
  6809. {
  6810. if(vm.mpHost === 'mp-baidu'){//百度 observer 在 setData callback 之后触发,直接忽略该 warn
  6811. return
  6812. }
  6813. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  6814. if(
  6815. key === 'value' &&
  6816. Array.isArray(vm.$options.behaviors) &&
  6817. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  6818. ){
  6819. return
  6820. }
  6821. if(vm._getFormData){
  6822. return
  6823. }
  6824. var $parent = vm.$parent;
  6825. while($parent){
  6826. if($parent.__next_tick_pending){
  6827. return
  6828. }
  6829. $parent = $parent.$parent;
  6830. }
  6831. }
  6832. warn(
  6833. "Avoid mutating a prop directly since the value will be " +
  6834. "overwritten whenever the parent component re-renders. " +
  6835. "Instead, use a data or computed property based on the prop's " +
  6836. "value. Prop being mutated: \"" + key + "\"",
  6837. vm
  6838. );
  6839. }
  6840. });
  6841. } else {}
  6842. // static props are already proxied on the component's prototype
  6843. // during Vue.extend(). We only need to proxy props defined at
  6844. // instantiation here.
  6845. if (!(key in vm)) {
  6846. proxy(vm, "_props", key);
  6847. }
  6848. };
  6849. for (var key in propsOptions) loop( key );
  6850. toggleObserving(true);
  6851. }
  6852. function initData (vm) {
  6853. var data = vm.$options.data;
  6854. data = vm._data = typeof data === 'function'
  6855. ? getData(data, vm)
  6856. : data || {};
  6857. if (!isPlainObject(data)) {
  6858. data = {};
  6859. true && warn(
  6860. 'data functions should return an object:\n' +
  6861. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  6862. vm
  6863. );
  6864. }
  6865. // proxy data on instance
  6866. var keys = Object.keys(data);
  6867. var props = vm.$options.props;
  6868. var methods = vm.$options.methods;
  6869. var i = keys.length;
  6870. while (i--) {
  6871. var key = keys[i];
  6872. if (true) {
  6873. if (methods && hasOwn(methods, key)) {
  6874. warn(
  6875. ("Method \"" + key + "\" has already been defined as a data property."),
  6876. vm
  6877. );
  6878. }
  6879. }
  6880. if (props && hasOwn(props, key)) {
  6881. true && warn(
  6882. "The data property \"" + key + "\" is already declared as a prop. " +
  6883. "Use prop default value instead.",
  6884. vm
  6885. );
  6886. } else if (!isReserved(key)) {
  6887. proxy(vm, "_data", key);
  6888. }
  6889. }
  6890. // observe data
  6891. observe(data, true /* asRootData */);
  6892. }
  6893. function getData (data, vm) {
  6894. // #7573 disable dep collection when invoking data getters
  6895. pushTarget();
  6896. try {
  6897. return data.call(vm, vm)
  6898. } catch (e) {
  6899. handleError(e, vm, "data()");
  6900. return {}
  6901. } finally {
  6902. popTarget();
  6903. }
  6904. }
  6905. var computedWatcherOptions = { lazy: true };
  6906. function initComputed (vm, computed) {
  6907. // $flow-disable-line
  6908. var watchers = vm._computedWatchers = Object.create(null);
  6909. // computed properties are just getters during SSR
  6910. var isSSR = isServerRendering();
  6911. for (var key in computed) {
  6912. var userDef = computed[key];
  6913. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  6914. if ( true && getter == null) {
  6915. warn(
  6916. ("Getter is missing for computed property \"" + key + "\"."),
  6917. vm
  6918. );
  6919. }
  6920. if (!isSSR) {
  6921. // create internal watcher for the computed property.
  6922. watchers[key] = new Watcher(
  6923. vm,
  6924. getter || noop,
  6925. noop,
  6926. computedWatcherOptions
  6927. );
  6928. }
  6929. // component-defined computed properties are already defined on the
  6930. // component prototype. We only need to define computed properties defined
  6931. // at instantiation here.
  6932. if (!(key in vm)) {
  6933. defineComputed(vm, key, userDef);
  6934. } else if (true) {
  6935. if (key in vm.$data) {
  6936. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  6937. } else if (vm.$options.props && key in vm.$options.props) {
  6938. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  6939. }
  6940. }
  6941. }
  6942. }
  6943. function defineComputed (
  6944. target,
  6945. key,
  6946. userDef
  6947. ) {
  6948. var shouldCache = !isServerRendering();
  6949. if (typeof userDef === 'function') {
  6950. sharedPropertyDefinition.get = shouldCache
  6951. ? createComputedGetter(key)
  6952. : createGetterInvoker(userDef);
  6953. sharedPropertyDefinition.set = noop;
  6954. } else {
  6955. sharedPropertyDefinition.get = userDef.get
  6956. ? shouldCache && userDef.cache !== false
  6957. ? createComputedGetter(key)
  6958. : createGetterInvoker(userDef.get)
  6959. : noop;
  6960. sharedPropertyDefinition.set = userDef.set || noop;
  6961. }
  6962. if ( true &&
  6963. sharedPropertyDefinition.set === noop) {
  6964. sharedPropertyDefinition.set = function () {
  6965. warn(
  6966. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  6967. this
  6968. );
  6969. };
  6970. }
  6971. Object.defineProperty(target, key, sharedPropertyDefinition);
  6972. }
  6973. function createComputedGetter (key) {
  6974. return function computedGetter () {
  6975. var watcher = this._computedWatchers && this._computedWatchers[key];
  6976. if (watcher) {
  6977. if (watcher.dirty) {
  6978. watcher.evaluate();
  6979. }
  6980. if (Dep.SharedObject.target) {// fixed by xxxxxx
  6981. watcher.depend();
  6982. }
  6983. return watcher.value
  6984. }
  6985. }
  6986. }
  6987. function createGetterInvoker(fn) {
  6988. return function computedGetter () {
  6989. return fn.call(this, this)
  6990. }
  6991. }
  6992. function initMethods (vm, methods) {
  6993. var props = vm.$options.props;
  6994. for (var key in methods) {
  6995. if (true) {
  6996. if (typeof methods[key] !== 'function') {
  6997. warn(
  6998. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  6999. "Did you reference the function correctly?",
  7000. vm
  7001. );
  7002. }
  7003. if (props && hasOwn(props, key)) {
  7004. warn(
  7005. ("Method \"" + key + "\" has already been defined as a prop."),
  7006. vm
  7007. );
  7008. }
  7009. if ((key in vm) && isReserved(key)) {
  7010. warn(
  7011. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  7012. "Avoid defining component methods that start with _ or $."
  7013. );
  7014. }
  7015. }
  7016. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  7017. }
  7018. }
  7019. function initWatch (vm, watch) {
  7020. for (var key in watch) {
  7021. var handler = watch[key];
  7022. if (Array.isArray(handler)) {
  7023. for (var i = 0; i < handler.length; i++) {
  7024. createWatcher(vm, key, handler[i]);
  7025. }
  7026. } else {
  7027. createWatcher(vm, key, handler);
  7028. }
  7029. }
  7030. }
  7031. function createWatcher (
  7032. vm,
  7033. expOrFn,
  7034. handler,
  7035. options
  7036. ) {
  7037. if (isPlainObject(handler)) {
  7038. options = handler;
  7039. handler = handler.handler;
  7040. }
  7041. if (typeof handler === 'string') {
  7042. handler = vm[handler];
  7043. }
  7044. return vm.$watch(expOrFn, handler, options)
  7045. }
  7046. function stateMixin (Vue) {
  7047. // flow somehow has problems with directly declared definition object
  7048. // when using Object.defineProperty, so we have to procedurally build up
  7049. // the object here.
  7050. var dataDef = {};
  7051. dataDef.get = function () { return this._data };
  7052. var propsDef = {};
  7053. propsDef.get = function () { return this._props };
  7054. if (true) {
  7055. dataDef.set = function () {
  7056. warn(
  7057. 'Avoid replacing instance root $data. ' +
  7058. 'Use nested data properties instead.',
  7059. this
  7060. );
  7061. };
  7062. propsDef.set = function () {
  7063. warn("$props is readonly.", this);
  7064. };
  7065. }
  7066. Object.defineProperty(Vue.prototype, '$data', dataDef);
  7067. Object.defineProperty(Vue.prototype, '$props', propsDef);
  7068. Vue.prototype.$set = set;
  7069. Vue.prototype.$delete = del;
  7070. Vue.prototype.$watch = function (
  7071. expOrFn,
  7072. cb,
  7073. options
  7074. ) {
  7075. var vm = this;
  7076. if (isPlainObject(cb)) {
  7077. return createWatcher(vm, expOrFn, cb, options)
  7078. }
  7079. options = options || {};
  7080. options.user = true;
  7081. var watcher = new Watcher(vm, expOrFn, cb, options);
  7082. if (options.immediate) {
  7083. try {
  7084. cb.call(vm, watcher.value);
  7085. } catch (error) {
  7086. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  7087. }
  7088. }
  7089. return function unwatchFn () {
  7090. watcher.teardown();
  7091. }
  7092. };
  7093. }
  7094. /* */
  7095. var uid$3 = 0;
  7096. function initMixin (Vue) {
  7097. Vue.prototype._init = function (options) {
  7098. var vm = this;
  7099. // a uid
  7100. vm._uid = uid$3++;
  7101. var startTag, endTag;
  7102. /* istanbul ignore if */
  7103. if ( true && config.performance && mark) {
  7104. startTag = "vue-perf-start:" + (vm._uid);
  7105. endTag = "vue-perf-end:" + (vm._uid);
  7106. mark(startTag);
  7107. }
  7108. // a flag to avoid this being observed
  7109. vm._isVue = true;
  7110. // merge options
  7111. if (options && options._isComponent) {
  7112. // optimize internal component instantiation
  7113. // since dynamic options merging is pretty slow, and none of the
  7114. // internal component options needs special treatment.
  7115. initInternalComponent(vm, options);
  7116. } else {
  7117. vm.$options = mergeOptions(
  7118. resolveConstructorOptions(vm.constructor),
  7119. options || {},
  7120. vm
  7121. );
  7122. }
  7123. /* istanbul ignore else */
  7124. if (true) {
  7125. initProxy(vm);
  7126. } else {}
  7127. // expose real self
  7128. vm._self = vm;
  7129. initLifecycle(vm);
  7130. initEvents(vm);
  7131. initRender(vm);
  7132. callHook(vm, 'beforeCreate');
  7133. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  7134. initState(vm);
  7135. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  7136. !vm._$fallback && callHook(vm, 'created');
  7137. /* istanbul ignore if */
  7138. if ( true && config.performance && mark) {
  7139. vm._name = formatComponentName(vm, false);
  7140. mark(endTag);
  7141. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  7142. }
  7143. if (vm.$options.el) {
  7144. vm.$mount(vm.$options.el);
  7145. }
  7146. };
  7147. }
  7148. function initInternalComponent (vm, options) {
  7149. var opts = vm.$options = Object.create(vm.constructor.options);
  7150. // doing this because it's faster than dynamic enumeration.
  7151. var parentVnode = options._parentVnode;
  7152. opts.parent = options.parent;
  7153. opts._parentVnode = parentVnode;
  7154. var vnodeComponentOptions = parentVnode.componentOptions;
  7155. opts.propsData = vnodeComponentOptions.propsData;
  7156. opts._parentListeners = vnodeComponentOptions.listeners;
  7157. opts._renderChildren = vnodeComponentOptions.children;
  7158. opts._componentTag = vnodeComponentOptions.tag;
  7159. if (options.render) {
  7160. opts.render = options.render;
  7161. opts.staticRenderFns = options.staticRenderFns;
  7162. }
  7163. }
  7164. function resolveConstructorOptions (Ctor) {
  7165. var options = Ctor.options;
  7166. if (Ctor.super) {
  7167. var superOptions = resolveConstructorOptions(Ctor.super);
  7168. var cachedSuperOptions = Ctor.superOptions;
  7169. if (superOptions !== cachedSuperOptions) {
  7170. // super option changed,
  7171. // need to resolve new options.
  7172. Ctor.superOptions = superOptions;
  7173. // check if there are any late-modified/attached options (#4976)
  7174. var modifiedOptions = resolveModifiedOptions(Ctor);
  7175. // update base extend options
  7176. if (modifiedOptions) {
  7177. extend(Ctor.extendOptions, modifiedOptions);
  7178. }
  7179. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  7180. if (options.name) {
  7181. options.components[options.name] = Ctor;
  7182. }
  7183. }
  7184. }
  7185. return options
  7186. }
  7187. function resolveModifiedOptions (Ctor) {
  7188. var modified;
  7189. var latest = Ctor.options;
  7190. var sealed = Ctor.sealedOptions;
  7191. for (var key in latest) {
  7192. if (latest[key] !== sealed[key]) {
  7193. if (!modified) { modified = {}; }
  7194. modified[key] = latest[key];
  7195. }
  7196. }
  7197. return modified
  7198. }
  7199. function Vue (options) {
  7200. if ( true &&
  7201. !(this instanceof Vue)
  7202. ) {
  7203. warn('Vue is a constructor and should be called with the `new` keyword');
  7204. }
  7205. this._init(options);
  7206. }
  7207. initMixin(Vue);
  7208. stateMixin(Vue);
  7209. eventsMixin(Vue);
  7210. lifecycleMixin(Vue);
  7211. renderMixin(Vue);
  7212. /* */
  7213. function initUse (Vue) {
  7214. Vue.use = function (plugin) {
  7215. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  7216. if (installedPlugins.indexOf(plugin) > -1) {
  7217. return this
  7218. }
  7219. // additional parameters
  7220. var args = toArray(arguments, 1);
  7221. args.unshift(this);
  7222. if (typeof plugin.install === 'function') {
  7223. plugin.install.apply(plugin, args);
  7224. } else if (typeof plugin === 'function') {
  7225. plugin.apply(null, args);
  7226. }
  7227. installedPlugins.push(plugin);
  7228. return this
  7229. };
  7230. }
  7231. /* */
  7232. function initMixin$1 (Vue) {
  7233. Vue.mixin = function (mixin) {
  7234. this.options = mergeOptions(this.options, mixin);
  7235. return this
  7236. };
  7237. }
  7238. /* */
  7239. function initExtend (Vue) {
  7240. /**
  7241. * Each instance constructor, including Vue, has a unique
  7242. * cid. This enables us to create wrapped "child
  7243. * constructors" for prototypal inheritance and cache them.
  7244. */
  7245. Vue.cid = 0;
  7246. var cid = 1;
  7247. /**
  7248. * Class inheritance
  7249. */
  7250. Vue.extend = function (extendOptions) {
  7251. extendOptions = extendOptions || {};
  7252. var Super = this;
  7253. var SuperId = Super.cid;
  7254. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  7255. if (cachedCtors[SuperId]) {
  7256. return cachedCtors[SuperId]
  7257. }
  7258. var name = extendOptions.name || Super.options.name;
  7259. if ( true && name) {
  7260. validateComponentName(name);
  7261. }
  7262. var Sub = function VueComponent (options) {
  7263. this._init(options);
  7264. };
  7265. Sub.prototype = Object.create(Super.prototype);
  7266. Sub.prototype.constructor = Sub;
  7267. Sub.cid = cid++;
  7268. Sub.options = mergeOptions(
  7269. Super.options,
  7270. extendOptions
  7271. );
  7272. Sub['super'] = Super;
  7273. // For props and computed properties, we define the proxy getters on
  7274. // the Vue instances at extension time, on the extended prototype. This
  7275. // avoids Object.defineProperty calls for each instance created.
  7276. if (Sub.options.props) {
  7277. initProps$1(Sub);
  7278. }
  7279. if (Sub.options.computed) {
  7280. initComputed$1(Sub);
  7281. }
  7282. // allow further extension/mixin/plugin usage
  7283. Sub.extend = Super.extend;
  7284. Sub.mixin = Super.mixin;
  7285. Sub.use = Super.use;
  7286. // create asset registers, so extended classes
  7287. // can have their private assets too.
  7288. ASSET_TYPES.forEach(function (type) {
  7289. Sub[type] = Super[type];
  7290. });
  7291. // enable recursive self-lookup
  7292. if (name) {
  7293. Sub.options.components[name] = Sub;
  7294. }
  7295. // keep a reference to the super options at extension time.
  7296. // later at instantiation we can check if Super's options have
  7297. // been updated.
  7298. Sub.superOptions = Super.options;
  7299. Sub.extendOptions = extendOptions;
  7300. Sub.sealedOptions = extend({}, Sub.options);
  7301. // cache constructor
  7302. cachedCtors[SuperId] = Sub;
  7303. return Sub
  7304. };
  7305. }
  7306. function initProps$1 (Comp) {
  7307. var props = Comp.options.props;
  7308. for (var key in props) {
  7309. proxy(Comp.prototype, "_props", key);
  7310. }
  7311. }
  7312. function initComputed$1 (Comp) {
  7313. var computed = Comp.options.computed;
  7314. for (var key in computed) {
  7315. defineComputed(Comp.prototype, key, computed[key]);
  7316. }
  7317. }
  7318. /* */
  7319. function initAssetRegisters (Vue) {
  7320. /**
  7321. * Create asset registration methods.
  7322. */
  7323. ASSET_TYPES.forEach(function (type) {
  7324. Vue[type] = function (
  7325. id,
  7326. definition
  7327. ) {
  7328. if (!definition) {
  7329. return this.options[type + 's'][id]
  7330. } else {
  7331. /* istanbul ignore if */
  7332. if ( true && type === 'component') {
  7333. validateComponentName(id);
  7334. }
  7335. if (type === 'component' && isPlainObject(definition)) {
  7336. definition.name = definition.name || id;
  7337. definition = this.options._base.extend(definition);
  7338. }
  7339. if (type === 'directive' && typeof definition === 'function') {
  7340. definition = { bind: definition, update: definition };
  7341. }
  7342. this.options[type + 's'][id] = definition;
  7343. return definition
  7344. }
  7345. };
  7346. });
  7347. }
  7348. /* */
  7349. function getComponentName (opts) {
  7350. return opts && (opts.Ctor.options.name || opts.tag)
  7351. }
  7352. function matches (pattern, name) {
  7353. if (Array.isArray(pattern)) {
  7354. return pattern.indexOf(name) > -1
  7355. } else if (typeof pattern === 'string') {
  7356. return pattern.split(',').indexOf(name) > -1
  7357. } else if (isRegExp(pattern)) {
  7358. return pattern.test(name)
  7359. }
  7360. /* istanbul ignore next */
  7361. return false
  7362. }
  7363. function pruneCache (keepAliveInstance, filter) {
  7364. var cache = keepAliveInstance.cache;
  7365. var keys = keepAliveInstance.keys;
  7366. var _vnode = keepAliveInstance._vnode;
  7367. for (var key in cache) {
  7368. var cachedNode = cache[key];
  7369. if (cachedNode) {
  7370. var name = getComponentName(cachedNode.componentOptions);
  7371. if (name && !filter(name)) {
  7372. pruneCacheEntry(cache, key, keys, _vnode);
  7373. }
  7374. }
  7375. }
  7376. }
  7377. function pruneCacheEntry (
  7378. cache,
  7379. key,
  7380. keys,
  7381. current
  7382. ) {
  7383. var cached$$1 = cache[key];
  7384. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  7385. cached$$1.componentInstance.$destroy();
  7386. }
  7387. cache[key] = null;
  7388. remove(keys, key);
  7389. }
  7390. var patternTypes = [String, RegExp, Array];
  7391. var KeepAlive = {
  7392. name: 'keep-alive',
  7393. abstract: true,
  7394. props: {
  7395. include: patternTypes,
  7396. exclude: patternTypes,
  7397. max: [String, Number]
  7398. },
  7399. created: function created () {
  7400. this.cache = Object.create(null);
  7401. this.keys = [];
  7402. },
  7403. destroyed: function destroyed () {
  7404. for (var key in this.cache) {
  7405. pruneCacheEntry(this.cache, key, this.keys);
  7406. }
  7407. },
  7408. mounted: function mounted () {
  7409. var this$1 = this;
  7410. this.$watch('include', function (val) {
  7411. pruneCache(this$1, function (name) { return matches(val, name); });
  7412. });
  7413. this.$watch('exclude', function (val) {
  7414. pruneCache(this$1, function (name) { return !matches(val, name); });
  7415. });
  7416. },
  7417. render: function render () {
  7418. var slot = this.$slots.default;
  7419. var vnode = getFirstComponentChild(slot);
  7420. var componentOptions = vnode && vnode.componentOptions;
  7421. if (componentOptions) {
  7422. // check pattern
  7423. var name = getComponentName(componentOptions);
  7424. var ref = this;
  7425. var include = ref.include;
  7426. var exclude = ref.exclude;
  7427. if (
  7428. // not included
  7429. (include && (!name || !matches(include, name))) ||
  7430. // excluded
  7431. (exclude && name && matches(exclude, name))
  7432. ) {
  7433. return vnode
  7434. }
  7435. var ref$1 = this;
  7436. var cache = ref$1.cache;
  7437. var keys = ref$1.keys;
  7438. var key = vnode.key == null
  7439. // same constructor may get registered as different local components
  7440. // so cid alone is not enough (#3269)
  7441. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  7442. : vnode.key;
  7443. if (cache[key]) {
  7444. vnode.componentInstance = cache[key].componentInstance;
  7445. // make current key freshest
  7446. remove(keys, key);
  7447. keys.push(key);
  7448. } else {
  7449. cache[key] = vnode;
  7450. keys.push(key);
  7451. // prune oldest entry
  7452. if (this.max && keys.length > parseInt(this.max)) {
  7453. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  7454. }
  7455. }
  7456. vnode.data.keepAlive = true;
  7457. }
  7458. return vnode || (slot && slot[0])
  7459. }
  7460. };
  7461. var builtInComponents = {
  7462. KeepAlive: KeepAlive
  7463. };
  7464. /* */
  7465. function initGlobalAPI (Vue) {
  7466. // config
  7467. var configDef = {};
  7468. configDef.get = function () { return config; };
  7469. if (true) {
  7470. configDef.set = function () {
  7471. warn(
  7472. 'Do not replace the Vue.config object, set individual fields instead.'
  7473. );
  7474. };
  7475. }
  7476. Object.defineProperty(Vue, 'config', configDef);
  7477. // exposed util methods.
  7478. // NOTE: these are not considered part of the public API - avoid relying on
  7479. // them unless you are aware of the risk.
  7480. Vue.util = {
  7481. warn: warn,
  7482. extend: extend,
  7483. mergeOptions: mergeOptions,
  7484. defineReactive: defineReactive$$1
  7485. };
  7486. Vue.set = set;
  7487. Vue.delete = del;
  7488. Vue.nextTick = nextTick;
  7489. // 2.6 explicit observable API
  7490. Vue.observable = function (obj) {
  7491. observe(obj);
  7492. return obj
  7493. };
  7494. Vue.options = Object.create(null);
  7495. ASSET_TYPES.forEach(function (type) {
  7496. Vue.options[type + 's'] = Object.create(null);
  7497. });
  7498. // this is used to identify the "base" constructor to extend all plain-object
  7499. // components with in Weex's multi-instance scenarios.
  7500. Vue.options._base = Vue;
  7501. extend(Vue.options.components, builtInComponents);
  7502. initUse(Vue);
  7503. initMixin$1(Vue);
  7504. initExtend(Vue);
  7505. initAssetRegisters(Vue);
  7506. }
  7507. initGlobalAPI(Vue);
  7508. Object.defineProperty(Vue.prototype, '$isServer', {
  7509. get: isServerRendering
  7510. });
  7511. Object.defineProperty(Vue.prototype, '$ssrContext', {
  7512. get: function get () {
  7513. /* istanbul ignore next */
  7514. return this.$vnode && this.$vnode.ssrContext
  7515. }
  7516. });
  7517. // expose FunctionalRenderContext for ssr runtime helper installation
  7518. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  7519. value: FunctionalRenderContext
  7520. });
  7521. Vue.version = '2.6.11';
  7522. /**
  7523. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  7524. */
  7525. var ARRAYTYPE = '[object Array]';
  7526. var OBJECTTYPE = '[object Object]';
  7527. // const FUNCTIONTYPE = '[object Function]'
  7528. function diff(current, pre) {
  7529. var result = {};
  7530. syncKeys(current, pre);
  7531. _diff(current, pre, '', result);
  7532. return result
  7533. }
  7534. function syncKeys(current, pre) {
  7535. if (current === pre) { return }
  7536. var rootCurrentType = type(current);
  7537. var rootPreType = type(pre);
  7538. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  7539. if(Object.keys(current).length >= Object.keys(pre).length){
  7540. for (var key in pre) {
  7541. var currentValue = current[key];
  7542. if (currentValue === undefined) {
  7543. current[key] = null;
  7544. } else {
  7545. syncKeys(currentValue, pre[key]);
  7546. }
  7547. }
  7548. }
  7549. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  7550. if (current.length >= pre.length) {
  7551. pre.forEach(function (item, index) {
  7552. syncKeys(current[index], item);
  7553. });
  7554. }
  7555. }
  7556. }
  7557. function _diff(current, pre, path, result) {
  7558. if (current === pre) { return }
  7559. var rootCurrentType = type(current);
  7560. var rootPreType = type(pre);
  7561. if (rootCurrentType == OBJECTTYPE) {
  7562. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  7563. setResult(result, path, current);
  7564. } else {
  7565. var loop = function ( key ) {
  7566. var currentValue = current[key];
  7567. var preValue = pre[key];
  7568. var currentType = type(currentValue);
  7569. var preType = type(preValue);
  7570. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  7571. if (currentValue != pre[key]) {
  7572. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  7573. }
  7574. } else if (currentType == ARRAYTYPE) {
  7575. if (preType != ARRAYTYPE) {
  7576. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  7577. } else {
  7578. if (currentValue.length < preValue.length) {
  7579. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  7580. } else {
  7581. currentValue.forEach(function (item, index) {
  7582. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  7583. });
  7584. }
  7585. }
  7586. } else if (currentType == OBJECTTYPE) {
  7587. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  7588. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  7589. } else {
  7590. for (var subKey in currentValue) {
  7591. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  7592. }
  7593. }
  7594. }
  7595. };
  7596. for (var key in current) loop( key );
  7597. }
  7598. } else if (rootCurrentType == ARRAYTYPE) {
  7599. if (rootPreType != ARRAYTYPE) {
  7600. setResult(result, path, current);
  7601. } else {
  7602. if (current.length < pre.length) {
  7603. setResult(result, path, current);
  7604. } else {
  7605. current.forEach(function (item, index) {
  7606. _diff(item, pre[index], path + '[' + index + ']', result);
  7607. });
  7608. }
  7609. }
  7610. } else {
  7611. setResult(result, path, current);
  7612. }
  7613. }
  7614. function setResult(result, k, v) {
  7615. // if (type(v) != FUNCTIONTYPE) {
  7616. result[k] = v;
  7617. // }
  7618. }
  7619. function type(obj) {
  7620. return Object.prototype.toString.call(obj)
  7621. }
  7622. /* */
  7623. function flushCallbacks$1(vm) {
  7624. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  7625. if (Object({"NODE_ENV":"development","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  7626. var mpInstance = vm.$scope;
  7627. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  7628. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  7629. }
  7630. var copies = vm.__next_tick_callbacks.slice(0);
  7631. vm.__next_tick_callbacks.length = 0;
  7632. for (var i = 0; i < copies.length; i++) {
  7633. copies[i]();
  7634. }
  7635. }
  7636. }
  7637. function hasRenderWatcher(vm) {
  7638. return queue.find(function (watcher) { return vm._watcher === watcher; })
  7639. }
  7640. function nextTick$1(vm, cb) {
  7641. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  7642. //2.nextTick 之前存在 render watcher
  7643. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  7644. if(Object({"NODE_ENV":"development","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  7645. var mpInstance = vm.$scope;
  7646. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  7647. ']:nextVueTick');
  7648. }
  7649. return nextTick(cb, vm)
  7650. }else{
  7651. if(Object({"NODE_ENV":"development","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  7652. var mpInstance$1 = vm.$scope;
  7653. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  7654. ']:nextMPTick');
  7655. }
  7656. }
  7657. var _resolve;
  7658. if (!vm.__next_tick_callbacks) {
  7659. vm.__next_tick_callbacks = [];
  7660. }
  7661. vm.__next_tick_callbacks.push(function () {
  7662. if (cb) {
  7663. try {
  7664. cb.call(vm);
  7665. } catch (e) {
  7666. handleError(e, vm, 'nextTick');
  7667. }
  7668. } else if (_resolve) {
  7669. _resolve(vm);
  7670. }
  7671. });
  7672. // $flow-disable-line
  7673. if (!cb && typeof Promise !== 'undefined') {
  7674. return new Promise(function (resolve) {
  7675. _resolve = resolve;
  7676. })
  7677. }
  7678. }
  7679. /* */
  7680. function cloneWithData(vm) {
  7681. // 确保当前 vm 所有数据被同步
  7682. var ret = Object.create(null);
  7683. var dataKeys = [].concat(
  7684. Object.keys(vm._data || {}),
  7685. Object.keys(vm._computedWatchers || {}));
  7686. dataKeys.reduce(function(ret, key) {
  7687. ret[key] = vm[key];
  7688. return ret
  7689. }, ret);
  7690. // vue-composition-api
  7691. var rawBindings = vm.__secret_vfa_state__ && vm.__secret_vfa_state__.rawBindings;
  7692. if (rawBindings) {
  7693. Object.keys(rawBindings).forEach(function (key) {
  7694. ret[key] = vm[key];
  7695. });
  7696. }
  7697. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  7698. Object.assign(ret, vm.$mp.data || {});
  7699. if (
  7700. Array.isArray(vm.$options.behaviors) &&
  7701. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  7702. ) { //form-field
  7703. ret['name'] = vm.name;
  7704. ret['value'] = vm.value;
  7705. }
  7706. return JSON.parse(JSON.stringify(ret))
  7707. }
  7708. var patch = function(oldVnode, vnode) {
  7709. var this$1 = this;
  7710. if (vnode === null) { //destroy
  7711. return
  7712. }
  7713. if (this.mpType === 'page' || this.mpType === 'component') {
  7714. var mpInstance = this.$scope;
  7715. var data = Object.create(null);
  7716. try {
  7717. data = cloneWithData(this);
  7718. } catch (err) {
  7719. console.error(err);
  7720. }
  7721. data.__webviewId__ = mpInstance.data.__webviewId__;
  7722. var mpData = Object.create(null);
  7723. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  7724. mpData[key] = mpInstance.data[key];
  7725. });
  7726. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  7727. if (Object.keys(diffData).length) {
  7728. if (Object({"NODE_ENV":"development","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  7729. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  7730. ']差量更新',
  7731. JSON.stringify(diffData));
  7732. }
  7733. this.__next_tick_pending = true;
  7734. mpInstance.setData(diffData, function () {
  7735. this$1.__next_tick_pending = false;
  7736. flushCallbacks$1(this$1);
  7737. });
  7738. } else {
  7739. flushCallbacks$1(this);
  7740. }
  7741. }
  7742. };
  7743. /* */
  7744. function createEmptyRender() {
  7745. }
  7746. function mountComponent$1(
  7747. vm,
  7748. el,
  7749. hydrating
  7750. ) {
  7751. if (!vm.mpType) {//main.js 中的 new Vue
  7752. return vm
  7753. }
  7754. if (vm.mpType === 'app') {
  7755. vm.$options.render = createEmptyRender;
  7756. }
  7757. if (!vm.$options.render) {
  7758. vm.$options.render = createEmptyRender;
  7759. if (true) {
  7760. /* istanbul ignore if */
  7761. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  7762. vm.$options.el || el) {
  7763. warn(
  7764. 'You are using the runtime-only build of Vue where the template ' +
  7765. 'compiler is not available. Either pre-compile the templates into ' +
  7766. 'render functions, or use the compiler-included build.',
  7767. vm
  7768. );
  7769. } else {
  7770. warn(
  7771. 'Failed to mount component: template or render function not defined.',
  7772. vm
  7773. );
  7774. }
  7775. }
  7776. }
  7777. !vm._$fallback && callHook(vm, 'beforeMount');
  7778. var updateComponent = function () {
  7779. vm._update(vm._render(), hydrating);
  7780. };
  7781. // we set this to vm._watcher inside the watcher's constructor
  7782. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  7783. // component's mounted hook), which relies on vm._watcher being already defined
  7784. new Watcher(vm, updateComponent, noop, {
  7785. before: function before() {
  7786. if (vm._isMounted && !vm._isDestroyed) {
  7787. callHook(vm, 'beforeUpdate');
  7788. }
  7789. }
  7790. }, true /* isRenderWatcher */);
  7791. hydrating = false;
  7792. return vm
  7793. }
  7794. /* */
  7795. function renderClass (
  7796. staticClass,
  7797. dynamicClass
  7798. ) {
  7799. if (isDef(staticClass) || isDef(dynamicClass)) {
  7800. return concat(staticClass, stringifyClass(dynamicClass))
  7801. }
  7802. /* istanbul ignore next */
  7803. return ''
  7804. }
  7805. function concat (a, b) {
  7806. return a ? b ? (a + ' ' + b) : a : (b || '')
  7807. }
  7808. function stringifyClass (value) {
  7809. if (Array.isArray(value)) {
  7810. return stringifyArray(value)
  7811. }
  7812. if (isObject(value)) {
  7813. return stringifyObject(value)
  7814. }
  7815. if (typeof value === 'string') {
  7816. return value
  7817. }
  7818. /* istanbul ignore next */
  7819. return ''
  7820. }
  7821. function stringifyArray (value) {
  7822. var res = '';
  7823. var stringified;
  7824. for (var i = 0, l = value.length; i < l; i++) {
  7825. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  7826. if (res) { res += ' '; }
  7827. res += stringified;
  7828. }
  7829. }
  7830. return res
  7831. }
  7832. function stringifyObject (value) {
  7833. var res = '';
  7834. for (var key in value) {
  7835. if (value[key]) {
  7836. if (res) { res += ' '; }
  7837. res += key;
  7838. }
  7839. }
  7840. return res
  7841. }
  7842. /* */
  7843. var parseStyleText = cached(function (cssText) {
  7844. var res = {};
  7845. var listDelimiter = /;(?![^(]*\))/g;
  7846. var propertyDelimiter = /:(.+)/;
  7847. cssText.split(listDelimiter).forEach(function (item) {
  7848. if (item) {
  7849. var tmp = item.split(propertyDelimiter);
  7850. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  7851. }
  7852. });
  7853. return res
  7854. });
  7855. // normalize possible array / string values into Object
  7856. function normalizeStyleBinding (bindingStyle) {
  7857. if (Array.isArray(bindingStyle)) {
  7858. return toObject(bindingStyle)
  7859. }
  7860. if (typeof bindingStyle === 'string') {
  7861. return parseStyleText(bindingStyle)
  7862. }
  7863. return bindingStyle
  7864. }
  7865. /* */
  7866. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  7867. function getTarget(obj, path) {
  7868. var parts = path.split('.');
  7869. var key = parts[0];
  7870. if (key.indexOf('__$n') === 0) { //number index
  7871. key = parseInt(key.replace('__$n', ''));
  7872. }
  7873. if (parts.length === 1) {
  7874. return obj[key]
  7875. }
  7876. return getTarget(obj[key], parts.slice(1).join('.'))
  7877. }
  7878. function internalMixin(Vue) {
  7879. Vue.config.errorHandler = function(err, vm, info) {
  7880. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  7881. console.error(err);
  7882. /* eslint-disable no-undef */
  7883. var app = getApp();
  7884. if (app && app.onError) {
  7885. app.onError(err);
  7886. }
  7887. };
  7888. var oldEmit = Vue.prototype.$emit;
  7889. Vue.prototype.$emit = function(event) {
  7890. if (this.$scope && event) {
  7891. this.$scope['triggerEvent'](event, {
  7892. __args__: toArray(arguments, 1)
  7893. });
  7894. }
  7895. return oldEmit.apply(this, arguments)
  7896. };
  7897. Vue.prototype.$nextTick = function(fn) {
  7898. return nextTick$1(this, fn)
  7899. };
  7900. MP_METHODS.forEach(function (method) {
  7901. Vue.prototype[method] = function(args) {
  7902. if (this.$scope && this.$scope[method]) {
  7903. return this.$scope[method](args)
  7904. }
  7905. // mp-alipay
  7906. if (typeof my === 'undefined') {
  7907. return
  7908. }
  7909. if (method === 'createSelectorQuery') {
  7910. /* eslint-disable no-undef */
  7911. return my.createSelectorQuery(args)
  7912. } else if (method === 'createIntersectionObserver') {
  7913. /* eslint-disable no-undef */
  7914. return my.createIntersectionObserver(args)
  7915. }
  7916. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  7917. };
  7918. });
  7919. Vue.prototype.__init_provide = initProvide;
  7920. Vue.prototype.__init_injections = initInjections;
  7921. Vue.prototype.__call_hook = function(hook, args) {
  7922. var vm = this;
  7923. // #7573 disable dep collection when invoking lifecycle hooks
  7924. pushTarget();
  7925. var handlers = vm.$options[hook];
  7926. var info = hook + " hook";
  7927. var ret;
  7928. if (handlers) {
  7929. for (var i = 0, j = handlers.length; i < j; i++) {
  7930. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  7931. }
  7932. }
  7933. if (vm._hasHookEvent) {
  7934. vm.$emit('hook:' + hook, args);
  7935. }
  7936. popTarget();
  7937. return ret
  7938. };
  7939. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  7940. if (Array.isArray(modifiers)) {
  7941. if (modifiers.indexOf('trim') !== -1) {
  7942. value = value.trim();
  7943. }
  7944. if (modifiers.indexOf('number') !== -1) {
  7945. value = this._n(value);
  7946. }
  7947. }
  7948. if (!target) {
  7949. target = this;
  7950. }
  7951. target[key] = value;
  7952. };
  7953. Vue.prototype.__set_sync = function(target, key, value) {
  7954. if (!target) {
  7955. target = this;
  7956. }
  7957. target[key] = value;
  7958. };
  7959. Vue.prototype.__get_orig = function(item) {
  7960. if (isPlainObject(item)) {
  7961. return item['$orig'] || item
  7962. }
  7963. return item
  7964. };
  7965. Vue.prototype.__get_value = function(dataPath, target) {
  7966. return getTarget(target || this, dataPath)
  7967. };
  7968. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  7969. return renderClass(staticClass, dynamicClass)
  7970. };
  7971. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  7972. if (!dynamicStyle && !staticStyle) {
  7973. return ''
  7974. }
  7975. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  7976. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  7977. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  7978. };
  7979. Vue.prototype.__map = function(val, iteratee) {
  7980. //TODO 暂不考虑 string
  7981. var ret, i, l, keys, key;
  7982. if (Array.isArray(val)) {
  7983. ret = new Array(val.length);
  7984. for (i = 0, l = val.length; i < l; i++) {
  7985. ret[i] = iteratee(val[i], i);
  7986. }
  7987. return ret
  7988. } else if (isObject(val)) {
  7989. keys = Object.keys(val);
  7990. ret = Object.create(null);
  7991. for (i = 0, l = keys.length; i < l; i++) {
  7992. key = keys[i];
  7993. ret[key] = iteratee(val[key], key, i);
  7994. }
  7995. return ret
  7996. } else if (typeof val === 'number') {
  7997. ret = new Array(val);
  7998. for (i = 0, l = val; i < l; i++) {
  7999. // 第一个参数暂时仍和小程序一致
  8000. ret[i] = iteratee(i, i);
  8001. }
  8002. return ret
  8003. }
  8004. return []
  8005. };
  8006. }
  8007. /* */
  8008. var LIFECYCLE_HOOKS$1 = [
  8009. //App
  8010. 'onLaunch',
  8011. 'onShow',
  8012. 'onHide',
  8013. 'onUniNViewMessage',
  8014. 'onPageNotFound',
  8015. 'onThemeChange',
  8016. 'onError',
  8017. 'onUnhandledRejection',
  8018. //Page
  8019. 'onLoad',
  8020. // 'onShow',
  8021. 'onReady',
  8022. // 'onHide',
  8023. 'onUnload',
  8024. 'onPullDownRefresh',
  8025. 'onReachBottom',
  8026. 'onTabItemTap',
  8027. 'onAddToFavorites',
  8028. 'onShareTimeline',
  8029. 'onShareAppMessage',
  8030. 'onResize',
  8031. 'onPageScroll',
  8032. 'onNavigationBarButtonTap',
  8033. 'onBackPress',
  8034. 'onNavigationBarSearchInputChanged',
  8035. 'onNavigationBarSearchInputConfirmed',
  8036. 'onNavigationBarSearchInputClicked',
  8037. //Component
  8038. // 'onReady', // 兼容旧版本,应该移除该事件
  8039. 'onPageShow',
  8040. 'onPageHide',
  8041. 'onPageResize'
  8042. ];
  8043. function lifecycleMixin$1(Vue) {
  8044. //fixed vue-class-component
  8045. var oldExtend = Vue.extend;
  8046. Vue.extend = function(extendOptions) {
  8047. extendOptions = extendOptions || {};
  8048. var methods = extendOptions.methods;
  8049. if (methods) {
  8050. Object.keys(methods).forEach(function (methodName) {
  8051. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  8052. extendOptions[methodName] = methods[methodName];
  8053. delete methods[methodName];
  8054. }
  8055. });
  8056. }
  8057. return oldExtend.call(this, extendOptions)
  8058. };
  8059. var strategies = Vue.config.optionMergeStrategies;
  8060. var mergeHook = strategies.created;
  8061. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  8062. strategies[hook] = mergeHook;
  8063. });
  8064. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  8065. }
  8066. /* */
  8067. // install platform patch function
  8068. Vue.prototype.__patch__ = patch;
  8069. // public mount method
  8070. Vue.prototype.$mount = function(
  8071. el ,
  8072. hydrating
  8073. ) {
  8074. return mountComponent$1(this, el, hydrating)
  8075. };
  8076. lifecycleMixin$1(Vue);
  8077. internalMixin(Vue);
  8078. /* */
  8079. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  8080. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  8081. /***/ }),
  8082. /***/ 3:
  8083. /*!***********************************!*\
  8084. !*** (webpack)/buildin/global.js ***!
  8085. \***********************************/
  8086. /*! no static exports found */
  8087. /***/ (function(module, exports) {
  8088. var g;
  8089. // This works in non-strict mode
  8090. g = (function() {
  8091. return this;
  8092. })();
  8093. try {
  8094. // This works if eval is allowed (see CSP)
  8095. g = g || new Function("return this")();
  8096. } catch (e) {
  8097. // This works if the window reference is available
  8098. if (typeof window === "object") g = window;
  8099. }
  8100. // g can still be undefined, but nothing to do about it...
  8101. // We return undefined, instead of nothing here, so it's
  8102. // easier to handle this case. if(!global) { ...}
  8103. module.exports = g;
  8104. /***/ }),
  8105. /***/ 33:
  8106. /*!****************************************************************!*\
  8107. !*** D:/h5Views/qjd-user-uniapp/components/uni-icons/icons.js ***!
  8108. \****************************************************************/
  8109. /*! no static exports found */
  8110. /***/ (function(module, exports, __webpack_require__) {
  8111. "use strict";
  8112. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = {
  8113. "pulldown": "\uE588",
  8114. "refreshempty": "\uE461",
  8115. "back": "\uE471",
  8116. "forward": "\uE470",
  8117. "more": "\uE507",
  8118. "more-filled": "\uE537",
  8119. "scan": "\uE612",
  8120. "qq": "\uE264",
  8121. "weibo": "\uE260",
  8122. "weixin": "\uE261",
  8123. "pengyouquan": "\uE262",
  8124. "loop": "\uE565",
  8125. "refresh": "\uE407",
  8126. "refresh-filled": "\uE437",
  8127. "arrowthindown": "\uE585",
  8128. "arrowthinleft": "\uE586",
  8129. "arrowthinright": "\uE587",
  8130. "arrowthinup": "\uE584",
  8131. "undo-filled": "\uE7D6",
  8132. "undo": "\uE406",
  8133. "redo": "\uE405",
  8134. "redo-filled": "\uE7D9",
  8135. "bars": "\uE563",
  8136. "chatboxes": "\uE203",
  8137. "camera": "\uE301",
  8138. "chatboxes-filled": "\uE233",
  8139. "camera-filled": "\uE7EF",
  8140. "cart-filled": "\uE7F4",
  8141. "cart": "\uE7F5",
  8142. "checkbox-filled": "\uE442",
  8143. "checkbox": "\uE7FA",
  8144. "arrowleft": "\uE582",
  8145. "arrowdown": "\uE581",
  8146. "arrowright": "\uE583",
  8147. "smallcircle-filled": "\uE801",
  8148. "arrowup": "\uE580",
  8149. "circle": "\uE411",
  8150. "eye-filled": "\uE568",
  8151. "eye-slash-filled": "\uE822",
  8152. "eye-slash": "\uE823",
  8153. "eye": "\uE824",
  8154. "flag-filled": "\uE825",
  8155. "flag": "\uE508",
  8156. "gear-filled": "\uE532",
  8157. "reload": "\uE462",
  8158. "gear": "\uE502",
  8159. "hand-thumbsdown-filled": "\uE83B",
  8160. "hand-thumbsdown": "\uE83C",
  8161. "hand-thumbsup-filled": "\uE83D",
  8162. "heart-filled": "\uE83E",
  8163. "hand-thumbsup": "\uE83F",
  8164. "heart": "\uE840",
  8165. "home": "\uE500",
  8166. "info": "\uE504",
  8167. "home-filled": "\uE530",
  8168. "info-filled": "\uE534",
  8169. "circle-filled": "\uE441",
  8170. "chat-filled": "\uE847",
  8171. "chat": "\uE263",
  8172. "mail-open-filled": "\uE84D",
  8173. "email-filled": "\uE231",
  8174. "mail-open": "\uE84E",
  8175. "email": "\uE201",
  8176. "checkmarkempty": "\uE472",
  8177. "list": "\uE562",
  8178. "locked-filled": "\uE856",
  8179. "locked": "\uE506",
  8180. "map-filled": "\uE85C",
  8181. "map-pin": "\uE85E",
  8182. "map-pin-ellipse": "\uE864",
  8183. "map": "\uE364",
  8184. "minus-filled": "\uE440",
  8185. "mic-filled": "\uE332",
  8186. "minus": "\uE410",
  8187. "micoff": "\uE360",
  8188. "mic": "\uE302",
  8189. "clear": "\uE434",
  8190. "smallcircle": "\uE868",
  8191. "close": "\uE404",
  8192. "closeempty": "\uE460",
  8193. "paperclip": "\uE567",
  8194. "paperplane": "\uE503",
  8195. "paperplane-filled": "\uE86E",
  8196. "person-filled": "\uE131",
  8197. "contact-filled": "\uE130",
  8198. "person": "\uE101",
  8199. "contact": "\uE100",
  8200. "images-filled": "\uE87A",
  8201. "phone": "\uE200",
  8202. "images": "\uE87B",
  8203. "image": "\uE363",
  8204. "image-filled": "\uE877",
  8205. "location-filled": "\uE333",
  8206. "location": "\uE303",
  8207. "plus-filled": "\uE439",
  8208. "plus": "\uE409",
  8209. "plusempty": "\uE468",
  8210. "help-filled": "\uE535",
  8211. "help": "\uE505",
  8212. "navigate-filled": "\uE884",
  8213. "navigate": "\uE501",
  8214. "mic-slash-filled": "\uE892",
  8215. "search": "\uE466",
  8216. "settings": "\uE560",
  8217. "sound": "\uE590",
  8218. "sound-filled": "\uE8A1",
  8219. "spinner-cycle": "\uE465",
  8220. "download-filled": "\uE8A4",
  8221. "personadd-filled": "\uE132",
  8222. "videocam-filled": "\uE8AF",
  8223. "personadd": "\uE102",
  8224. "upload": "\uE402",
  8225. "upload-filled": "\uE8B1",
  8226. "starhalf": "\uE463",
  8227. "star-filled": "\uE438",
  8228. "star": "\uE408",
  8229. "trash": "\uE401",
  8230. "phone-filled": "\uE230",
  8231. "compose": "\uE400",
  8232. "videocam": "\uE300",
  8233. "trash-filled": "\uE8DC",
  8234. "download": "\uE403",
  8235. "chatbubble-filled": "\uE232",
  8236. "chatbubble": "\uE202",
  8237. "cloud-download": "\uE8E4",
  8238. "cloud-upload-filled": "\uE8E5",
  8239. "cloud-upload": "\uE8E6",
  8240. "cloud-download-filled": "\uE8E9",
  8241. "headphones": "\uE8BF",
  8242. "shop": "\uE609" };exports.default = _default;
  8243. /***/ }),
  8244. /***/ 4:
  8245. /*!*********************************************!*\
  8246. !*** D:/h5Views/qjd-user-uniapp/pages.json ***!
  8247. \*********************************************/
  8248. /*! no static exports found */
  8249. /***/ (function(module, exports) {
  8250. /***/ })
  8251. }]);
  8252. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map