vendor.js 481 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],{
  2. /***/ 1:
  3. /*!************************************************************!*\
  4. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  5. \************************************************************/
  6. /*! no static exports found */
  7. /***/ (function(module, exports, __webpack_require__) {
  8. "use strict";
  9. /* WEBPACK VAR INJECTION */(function(global) {Object.defineProperty(exports, "__esModule", { value: true });exports.createApp = createApp;exports.createComponent = createComponent;exports.createPage = createPage;exports.createPlugin = createPlugin;exports.createSubpackageApp = createSubpackageApp;exports.default = void 0;var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 3));
  10. var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 4);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArrayLimit(arr, i) {if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"] != null) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _toConsumableArray(arr) {return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();}function _nonIterableSpread() {throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _iterableToArray(iter) {if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);}function _arrayWithoutHoles(arr) {if (Array.isArray(arr)) return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;}
  11. var realAtob;
  12. var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  13. var b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  14. if (typeof atob !== 'function') {
  15. realAtob = function realAtob(str) {
  16. str = String(str).replace(/[\t\n\f\r ]+/g, '');
  17. if (!b64re.test(str)) {throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");}
  18. // Adding the padding if missing, for semplicity
  19. str += '=='.slice(2 - (str.length & 3));
  20. var bitmap;var result = '';var r1;var r2;var i = 0;
  21. for (; i < str.length;) {
  22. bitmap = b64.indexOf(str.charAt(i++)) << 18 | b64.indexOf(str.charAt(i++)) << 12 |
  23. (r1 = b64.indexOf(str.charAt(i++))) << 6 | (r2 = b64.indexOf(str.charAt(i++)));
  24. result += r1 === 64 ? String.fromCharCode(bitmap >> 16 & 255) :
  25. r2 === 64 ? String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255) :
  26. String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255);
  27. }
  28. return result;
  29. };
  30. } else {
  31. // 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法
  32. realAtob = atob;
  33. }
  34. function b64DecodeUnicode(str) {
  35. return decodeURIComponent(realAtob(str).split('').map(function (c) {
  36. return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
  37. }).join(''));
  38. }
  39. function getCurrentUserInfo() {
  40. var token = wx.getStorageSync('uni_id_token') || '';
  41. var tokenArr = token.split('.');
  42. if (!token || tokenArr.length !== 3) {
  43. return {
  44. uid: null,
  45. role: [],
  46. permission: [],
  47. tokenExpired: 0 };
  48. }
  49. var userInfo;
  50. try {
  51. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  52. } catch (error) {
  53. throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message);
  54. }
  55. userInfo.tokenExpired = userInfo.exp * 1000;
  56. delete userInfo.exp;
  57. delete userInfo.iat;
  58. return userInfo;
  59. }
  60. function uniIdMixin(Vue) {
  61. Vue.prototype.uniIDHasRole = function (roleId) {var _getCurrentUserInfo =
  62. getCurrentUserInfo(),role = _getCurrentUserInfo.role;
  63. return role.indexOf(roleId) > -1;
  64. };
  65. Vue.prototype.uniIDHasPermission = function (permissionId) {var _getCurrentUserInfo2 =
  66. getCurrentUserInfo(),permission = _getCurrentUserInfo2.permission;
  67. return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1;
  68. };
  69. Vue.prototype.uniIDTokenValid = function () {var _getCurrentUserInfo3 =
  70. getCurrentUserInfo(),tokenExpired = _getCurrentUserInfo3.tokenExpired;
  71. return tokenExpired > Date.now();
  72. };
  73. }
  74. var _toString = Object.prototype.toString;
  75. var hasOwnProperty = Object.prototype.hasOwnProperty;
  76. function isFn(fn) {
  77. return typeof fn === 'function';
  78. }
  79. function isStr(str) {
  80. return typeof str === 'string';
  81. }
  82. function isPlainObject(obj) {
  83. return _toString.call(obj) === '[object Object]';
  84. }
  85. function hasOwn(obj, key) {
  86. return hasOwnProperty.call(obj, key);
  87. }
  88. function noop() {}
  89. /**
  90. * Create a cached version of a pure function.
  91. */
  92. function cached(fn) {
  93. var cache = Object.create(null);
  94. return function cachedFn(str) {
  95. var hit = cache[str];
  96. return hit || (cache[str] = fn(str));
  97. };
  98. }
  99. /**
  100. * Camelize a hyphen-delimited string.
  101. */
  102. var camelizeRE = /-(\w)/g;
  103. var camelize = cached(function (str) {
  104. return str.replace(camelizeRE, function (_, c) {return c ? c.toUpperCase() : '';});
  105. });
  106. var HOOKS = [
  107. 'invoke',
  108. 'success',
  109. 'fail',
  110. 'complete',
  111. 'returnValue'];
  112. var globalInterceptors = {};
  113. var scopedInterceptors = {};
  114. function mergeHook(parentVal, childVal) {
  115. var res = childVal ?
  116. parentVal ?
  117. parentVal.concat(childVal) :
  118. Array.isArray(childVal) ?
  119. childVal : [childVal] :
  120. parentVal;
  121. return res ?
  122. dedupeHooks(res) :
  123. res;
  124. }
  125. function dedupeHooks(hooks) {
  126. var res = [];
  127. for (var i = 0; i < hooks.length; i++) {
  128. if (res.indexOf(hooks[i]) === -1) {
  129. res.push(hooks[i]);
  130. }
  131. }
  132. return res;
  133. }
  134. function removeHook(hooks, hook) {
  135. var index = hooks.indexOf(hook);
  136. if (index !== -1) {
  137. hooks.splice(index, 1);
  138. }
  139. }
  140. function mergeInterceptorHook(interceptor, option) {
  141. Object.keys(option).forEach(function (hook) {
  142. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  143. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  144. }
  145. });
  146. }
  147. function removeInterceptorHook(interceptor, option) {
  148. if (!interceptor || !option) {
  149. return;
  150. }
  151. Object.keys(option).forEach(function (hook) {
  152. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  153. removeHook(interceptor[hook], option[hook]);
  154. }
  155. });
  156. }
  157. function addInterceptor(method, option) {
  158. if (typeof method === 'string' && isPlainObject(option)) {
  159. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  160. } else if (isPlainObject(method)) {
  161. mergeInterceptorHook(globalInterceptors, method);
  162. }
  163. }
  164. function removeInterceptor(method, option) {
  165. if (typeof method === 'string') {
  166. if (isPlainObject(option)) {
  167. removeInterceptorHook(scopedInterceptors[method], option);
  168. } else {
  169. delete scopedInterceptors[method];
  170. }
  171. } else if (isPlainObject(method)) {
  172. removeInterceptorHook(globalInterceptors, method);
  173. }
  174. }
  175. function wrapperHook(hook) {
  176. return function (data) {
  177. return hook(data) || data;
  178. };
  179. }
  180. function isPromise(obj) {
  181. return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  182. }
  183. function queue(hooks, data) {
  184. var promise = false;
  185. for (var i = 0; i < hooks.length; i++) {
  186. var hook = hooks[i];
  187. if (promise) {
  188. promise = Promise.resolve(wrapperHook(hook));
  189. } else {
  190. var res = hook(data);
  191. if (isPromise(res)) {
  192. promise = Promise.resolve(res);
  193. }
  194. if (res === false) {
  195. return {
  196. then: function then() {} };
  197. }
  198. }
  199. }
  200. return promise || {
  201. then: function then(callback) {
  202. return callback(data);
  203. } };
  204. }
  205. function wrapperOptions(interceptor) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  206. ['success', 'fail', 'complete'].forEach(function (name) {
  207. if (Array.isArray(interceptor[name])) {
  208. var oldCallback = options[name];
  209. options[name] = function callbackInterceptor(res) {
  210. queue(interceptor[name], res).then(function (res) {
  211. /* eslint-disable no-mixed-operators */
  212. return isFn(oldCallback) && oldCallback(res) || res;
  213. });
  214. };
  215. }
  216. });
  217. return options;
  218. }
  219. function wrapperReturnValue(method, returnValue) {
  220. var returnValueHooks = [];
  221. if (Array.isArray(globalInterceptors.returnValue)) {
  222. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(globalInterceptors.returnValue));
  223. }
  224. var interceptor = scopedInterceptors[method];
  225. if (interceptor && Array.isArray(interceptor.returnValue)) {
  226. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(interceptor.returnValue));
  227. }
  228. returnValueHooks.forEach(function (hook) {
  229. returnValue = hook(returnValue) || returnValue;
  230. });
  231. return returnValue;
  232. }
  233. function getApiInterceptorHooks(method) {
  234. var interceptor = Object.create(null);
  235. Object.keys(globalInterceptors).forEach(function (hook) {
  236. if (hook !== 'returnValue') {
  237. interceptor[hook] = globalInterceptors[hook].slice();
  238. }
  239. });
  240. var scopedInterceptor = scopedInterceptors[method];
  241. if (scopedInterceptor) {
  242. Object.keys(scopedInterceptor).forEach(function (hook) {
  243. if (hook !== 'returnValue') {
  244. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  245. }
  246. });
  247. }
  248. return interceptor;
  249. }
  250. function invokeApi(method, api, options) {for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {params[_key - 3] = arguments[_key];}
  251. var interceptor = getApiInterceptorHooks(method);
  252. if (interceptor && Object.keys(interceptor).length) {
  253. if (Array.isArray(interceptor.invoke)) {
  254. var res = queue(interceptor.invoke, options);
  255. return res.then(function (options) {
  256. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  257. });
  258. } else {
  259. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  260. }
  261. }
  262. return api.apply(void 0, [options].concat(params));
  263. }
  264. var promiseInterceptor = {
  265. returnValue: function returnValue(res) {
  266. if (!isPromise(res)) {
  267. return res;
  268. }
  269. return new Promise(function (resolve, reject) {
  270. res.then(function (res) {
  271. if (res[0]) {
  272. reject(res[0]);
  273. } else {
  274. resolve(res[1]);
  275. }
  276. });
  277. });
  278. } };
  279. var SYNC_API_RE =
  280. /^\$|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale/;
  281. var CONTEXT_API_RE = /^create|Manager$/;
  282. // Context例外情况
  283. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  284. // 同步例外情况
  285. var ASYNC_API = ['createBLEConnection'];
  286. var CALLBACK_API_RE = /^on|^off/;
  287. function isContextApi(name) {
  288. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  289. }
  290. function isSyncApi(name) {
  291. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  292. }
  293. function isCallbackApi(name) {
  294. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  295. }
  296. function handlePromise(promise) {
  297. return promise.then(function (data) {
  298. return [null, data];
  299. }).
  300. catch(function (err) {return [err];});
  301. }
  302. function shouldPromise(name) {
  303. if (
  304. isContextApi(name) ||
  305. isSyncApi(name) ||
  306. isCallbackApi(name))
  307. {
  308. return false;
  309. }
  310. return true;
  311. }
  312. /* eslint-disable no-extend-native */
  313. if (!Promise.prototype.finally) {
  314. Promise.prototype.finally = function (callback) {
  315. var promise = this.constructor;
  316. return this.then(
  317. function (value) {return promise.resolve(callback()).then(function () {return value;});},
  318. function (reason) {return promise.resolve(callback()).then(function () {
  319. throw reason;
  320. });});
  321. };
  322. }
  323. function promisify(name, api) {
  324. if (!shouldPromise(name)) {
  325. return api;
  326. }
  327. return function promiseApi() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {params[_key2 - 1] = arguments[_key2];}
  328. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  329. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  330. }
  331. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  332. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  333. success: resolve,
  334. fail: reject })].concat(
  335. params));
  336. })));
  337. };
  338. }
  339. var EPS = 1e-4;
  340. var BASE_DEVICE_WIDTH = 750;
  341. var isIOS = false;
  342. var deviceWidth = 0;
  343. var deviceDPR = 0;
  344. function checkDeviceWidth() {var _wx$getSystemInfoSync =
  345. wx.getSystemInfoSync(),platform = _wx$getSystemInfoSync.platform,pixelRatio = _wx$getSystemInfoSync.pixelRatio,windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  346. deviceWidth = windowWidth;
  347. deviceDPR = pixelRatio;
  348. isIOS = platform === 'ios';
  349. }
  350. function upx2px(number, newDeviceWidth) {
  351. if (deviceWidth === 0) {
  352. checkDeviceWidth();
  353. }
  354. number = Number(number);
  355. if (number === 0) {
  356. return 0;
  357. }
  358. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  359. if (result < 0) {
  360. result = -result;
  361. }
  362. result = Math.floor(result + EPS);
  363. if (result === 0) {
  364. if (deviceDPR === 1 || !isIOS) {
  365. result = 1;
  366. } else {
  367. result = 0.5;
  368. }
  369. }
  370. return number < 0 ? -result : result;
  371. }
  372. function getLocale() {
  373. // 优先使用 $locale
  374. var app = getApp({
  375. allowDefault: true });
  376. if (app && app.$vm) {
  377. return app.$vm.$locale;
  378. }
  379. return wx.getSystemInfoSync().language || 'zh-Hans';
  380. }
  381. function setLocale(locale) {
  382. var app = getApp();
  383. if (!app) {
  384. return false;
  385. }
  386. var oldLocale = app.$vm.$locale;
  387. if (oldLocale !== locale) {
  388. app.$vm.$locale = locale;
  389. onLocaleChangeCallbacks.forEach(function (fn) {return fn({
  390. locale: locale });});
  391. return true;
  392. }
  393. return false;
  394. }
  395. var onLocaleChangeCallbacks = [];
  396. function onLocaleChange(fn) {
  397. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  398. onLocaleChangeCallbacks.push(fn);
  399. }
  400. }
  401. if (typeof global !== 'undefined') {
  402. global.getLocale = getLocale;
  403. }
  404. var interceptors = {
  405. promiseInterceptor: promiseInterceptor };
  406. var baseApi = /*#__PURE__*/Object.freeze({
  407. __proto__: null,
  408. upx2px: upx2px,
  409. getLocale: getLocale,
  410. setLocale: setLocale,
  411. onLocaleChange: onLocaleChange,
  412. addInterceptor: addInterceptor,
  413. removeInterceptor: removeInterceptor,
  414. interceptors: interceptors });
  415. function findExistsPageIndex(url) {
  416. var pages = getCurrentPages();
  417. var len = pages.length;
  418. while (len--) {
  419. var page = pages[len];
  420. if (page.$page && page.$page.fullPath === url) {
  421. return len;
  422. }
  423. }
  424. return -1;
  425. }
  426. var redirectTo = {
  427. name: function name(fromArgs) {
  428. if (fromArgs.exists === 'back' && fromArgs.delta) {
  429. return 'navigateBack';
  430. }
  431. return 'redirectTo';
  432. },
  433. args: function args(fromArgs) {
  434. if (fromArgs.exists === 'back' && fromArgs.url) {
  435. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  436. if (existsPageIndex !== -1) {
  437. var delta = getCurrentPages().length - 1 - existsPageIndex;
  438. if (delta > 0) {
  439. fromArgs.delta = delta;
  440. }
  441. }
  442. }
  443. } };
  444. var previewImage = {
  445. args: function args(fromArgs) {
  446. var currentIndex = parseInt(fromArgs.current);
  447. if (isNaN(currentIndex)) {
  448. return;
  449. }
  450. var urls = fromArgs.urls;
  451. if (!Array.isArray(urls)) {
  452. return;
  453. }
  454. var len = urls.length;
  455. if (!len) {
  456. return;
  457. }
  458. if (currentIndex < 0) {
  459. currentIndex = 0;
  460. } else if (currentIndex >= len) {
  461. currentIndex = len - 1;
  462. }
  463. if (currentIndex > 0) {
  464. fromArgs.current = urls[currentIndex];
  465. fromArgs.urls = urls.filter(
  466. function (item, index) {return index < currentIndex ? item !== urls[currentIndex] : true;});
  467. } else {
  468. fromArgs.current = urls[0];
  469. }
  470. return {
  471. indicator: false,
  472. loop: false };
  473. } };
  474. var UUID_KEY = '__DC_STAT_UUID';
  475. var deviceId;
  476. function addUuid(result) {
  477. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  478. if (!deviceId) {
  479. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  480. wx.setStorage({
  481. key: UUID_KEY,
  482. data: deviceId });
  483. }
  484. result.deviceId = deviceId;
  485. }
  486. function addSafeAreaInsets(result) {
  487. if (result.safeArea) {
  488. var safeArea = result.safeArea;
  489. result.safeAreaInsets = {
  490. top: safeArea.top,
  491. left: safeArea.left,
  492. right: result.windowWidth - safeArea.right,
  493. bottom: result.windowHeight - safeArea.bottom };
  494. }
  495. }
  496. var getSystemInfo = {
  497. returnValue: function returnValue(result) {
  498. addUuid(result);
  499. addSafeAreaInsets(result);
  500. } };
  501. // import navigateTo from 'uni-helpers/navigate-to'
  502. var protocols = {
  503. redirectTo: redirectTo,
  504. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  505. previewImage: previewImage,
  506. getSystemInfo: getSystemInfo,
  507. getSystemInfoSync: getSystemInfo };
  508. var todos = [
  509. 'vibrate',
  510. 'preloadPage',
  511. 'unPreloadPage',
  512. 'loadSubPackage'];
  513. var canIUses = [];
  514. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  515. function processCallback(methodName, method, returnValue) {
  516. return function (res) {
  517. return method(processReturnValue(methodName, res, returnValue));
  518. };
  519. }
  520. function processArgs(methodName, fromArgs) {var argsOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};var returnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};var keepFromArgs = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  521. if (isPlainObject(fromArgs)) {// 一般 api 的参数解析
  522. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  523. if (isFn(argsOption)) {
  524. argsOption = argsOption(fromArgs, toArgs) || {};
  525. }
  526. for (var key in fromArgs) {
  527. if (hasOwn(argsOption, key)) {
  528. var keyOption = argsOption[key];
  529. if (isFn(keyOption)) {
  530. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  531. }
  532. if (!keyOption) {// 不支持的参数
  533. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  534. } else if (isStr(keyOption)) {// 重写参数 key
  535. toArgs[keyOption] = fromArgs[key];
  536. } else if (isPlainObject(keyOption)) {// {name:newName,value:value}可重新指定参数 key:value
  537. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  538. }
  539. } else if (CALLBACKS.indexOf(key) !== -1) {
  540. if (isFn(fromArgs[key])) {
  541. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  542. }
  543. } else {
  544. if (!keepFromArgs) {
  545. toArgs[key] = fromArgs[key];
  546. }
  547. }
  548. }
  549. return toArgs;
  550. } else if (isFn(fromArgs)) {
  551. fromArgs = processCallback(methodName, fromArgs, returnValue);
  552. }
  553. return fromArgs;
  554. }
  555. function processReturnValue(methodName, res, returnValue) {var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  556. if (isFn(protocols.returnValue)) {// 处理通用 returnValue
  557. res = protocols.returnValue(methodName, res);
  558. }
  559. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  560. }
  561. function wrapper(methodName, method) {
  562. if (hasOwn(protocols, methodName)) {
  563. var protocol = protocols[methodName];
  564. if (!protocol) {// 暂不支持的 api
  565. return function () {
  566. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  567. };
  568. }
  569. return function (arg1, arg2) {// 目前 api 最多两个参数
  570. var options = protocol;
  571. if (isFn(protocol)) {
  572. options = protocol(arg1);
  573. }
  574. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  575. var args = [arg1];
  576. if (typeof arg2 !== 'undefined') {
  577. args.push(arg2);
  578. }
  579. if (isFn(options.name)) {
  580. methodName = options.name(arg1);
  581. } else if (isStr(options.name)) {
  582. methodName = options.name;
  583. }
  584. var returnValue = wx[methodName].apply(wx, args);
  585. if (isSyncApi(methodName)) {// 同步 api
  586. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  587. }
  588. return returnValue;
  589. };
  590. }
  591. return method;
  592. }
  593. var todoApis = Object.create(null);
  594. var TODOS = [
  595. 'onTabBarMidButtonTap',
  596. 'subscribePush',
  597. 'unsubscribePush',
  598. 'onPush',
  599. 'offPush',
  600. 'share'];
  601. function createTodoApi(name) {
  602. return function todoApi(_ref)
  603. {var fail = _ref.fail,complete = _ref.complete;
  604. var res = {
  605. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported") };
  606. isFn(fail) && fail(res);
  607. isFn(complete) && complete(res);
  608. };
  609. }
  610. TODOS.forEach(function (name) {
  611. todoApis[name] = createTodoApi(name);
  612. });
  613. var providers = {
  614. oauth: ['weixin'],
  615. share: ['weixin'],
  616. payment: ['wxpay'],
  617. push: ['weixin'] };
  618. function getProvider(_ref2)
  619. {var service = _ref2.service,success = _ref2.success,fail = _ref2.fail,complete = _ref2.complete;
  620. var res = false;
  621. if (providers[service]) {
  622. res = {
  623. errMsg: 'getProvider:ok',
  624. service: service,
  625. provider: providers[service] };
  626. isFn(success) && success(res);
  627. } else {
  628. res = {
  629. errMsg: 'getProvider:fail service not found' };
  630. isFn(fail) && fail(res);
  631. }
  632. isFn(complete) && complete(res);
  633. }
  634. var extraApi = /*#__PURE__*/Object.freeze({
  635. __proto__: null,
  636. getProvider: getProvider });
  637. var getEmitter = function () {
  638. var Emitter;
  639. return function getUniEmitter() {
  640. if (!Emitter) {
  641. Emitter = new _vue.default();
  642. }
  643. return Emitter;
  644. };
  645. }();
  646. function apply(ctx, method, args) {
  647. return ctx[method].apply(ctx, args);
  648. }
  649. function $on() {
  650. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  651. }
  652. function $off() {
  653. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  654. }
  655. function $once() {
  656. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  657. }
  658. function $emit() {
  659. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  660. }
  661. var eventApi = /*#__PURE__*/Object.freeze({
  662. __proto__: null,
  663. $on: $on,
  664. $off: $off,
  665. $once: $once,
  666. $emit: $emit });
  667. var api = /*#__PURE__*/Object.freeze({
  668. __proto__: null });
  669. var MPPage = Page;
  670. var MPComponent = Component;
  671. var customizeRE = /:/g;
  672. var customize = cached(function (str) {
  673. return camelize(str.replace(customizeRE, '-'));
  674. });
  675. function initTriggerEvent(mpInstance) {
  676. var oldTriggerEvent = mpInstance.triggerEvent;
  677. var newTriggerEvent = function newTriggerEvent(event) {for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {args[_key3 - 1] = arguments[_key3];}
  678. return oldTriggerEvent.apply(mpInstance, [customize(event)].concat(args));
  679. };
  680. try {
  681. // 京东小程序 triggerEvent 为只读
  682. mpInstance.triggerEvent = newTriggerEvent;
  683. } catch (error) {
  684. mpInstance._triggerEvent = newTriggerEvent;
  685. }
  686. }
  687. function initHook(name, options, isComponent) {
  688. var oldHook = options[name];
  689. if (!oldHook) {
  690. options[name] = function () {
  691. initTriggerEvent(this);
  692. };
  693. } else {
  694. options[name] = function () {
  695. initTriggerEvent(this);for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {args[_key4] = arguments[_key4];}
  696. return oldHook.apply(this, args);
  697. };
  698. }
  699. }
  700. if (!MPPage.__$wrappered) {
  701. MPPage.__$wrappered = true;
  702. Page = function Page() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  703. initHook('onLoad', options);
  704. return MPPage(options);
  705. };
  706. Page.after = MPPage.after;
  707. Component = function Component() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  708. initHook('created', options);
  709. return MPComponent(options);
  710. };
  711. }
  712. var PAGE_EVENT_HOOKS = [
  713. 'onPullDownRefresh',
  714. 'onReachBottom',
  715. 'onAddToFavorites',
  716. 'onShareTimeline',
  717. 'onShareAppMessage',
  718. 'onPageScroll',
  719. 'onResize',
  720. 'onTabItemTap'];
  721. function initMocks(vm, mocks) {
  722. var mpInstance = vm.$mp[vm.mpType];
  723. mocks.forEach(function (mock) {
  724. if (hasOwn(mpInstance, mock)) {
  725. vm[mock] = mpInstance[mock];
  726. }
  727. });
  728. }
  729. function hasHook(hook, vueOptions) {
  730. if (!vueOptions) {
  731. return true;
  732. }
  733. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  734. return true;
  735. }
  736. vueOptions = vueOptions.default || vueOptions;
  737. if (isFn(vueOptions)) {
  738. if (isFn(vueOptions.extendOptions[hook])) {
  739. return true;
  740. }
  741. if (vueOptions.super &&
  742. vueOptions.super.options &&
  743. Array.isArray(vueOptions.super.options[hook])) {
  744. return true;
  745. }
  746. return false;
  747. }
  748. if (isFn(vueOptions[hook])) {
  749. return true;
  750. }
  751. var mixins = vueOptions.mixins;
  752. if (Array.isArray(mixins)) {
  753. return !!mixins.find(function (mixin) {return hasHook(hook, mixin);});
  754. }
  755. }
  756. function initHooks(mpOptions, hooks, vueOptions) {
  757. hooks.forEach(function (hook) {
  758. if (hasHook(hook, vueOptions)) {
  759. mpOptions[hook] = function (args) {
  760. return this.$vm && this.$vm.__call_hook(hook, args);
  761. };
  762. }
  763. });
  764. }
  765. function initVueComponent(Vue, vueOptions) {
  766. vueOptions = vueOptions.default || vueOptions;
  767. var VueComponent;
  768. if (isFn(vueOptions)) {
  769. VueComponent = vueOptions;
  770. } else {
  771. VueComponent = Vue.extend(vueOptions);
  772. }
  773. vueOptions = VueComponent.options;
  774. return [VueComponent, vueOptions];
  775. }
  776. function initSlots(vm, vueSlots) {
  777. if (Array.isArray(vueSlots) && vueSlots.length) {
  778. var $slots = Object.create(null);
  779. vueSlots.forEach(function (slotName) {
  780. $slots[slotName] = true;
  781. });
  782. vm.$scopedSlots = vm.$slots = $slots;
  783. }
  784. }
  785. function initVueIds(vueIds, mpInstance) {
  786. vueIds = (vueIds || '').split(',');
  787. var len = vueIds.length;
  788. if (len === 1) {
  789. mpInstance._$vueId = vueIds[0];
  790. } else if (len === 2) {
  791. mpInstance._$vueId = vueIds[0];
  792. mpInstance._$vuePid = vueIds[1];
  793. }
  794. }
  795. function initData(vueOptions, context) {
  796. var data = vueOptions.data || {};
  797. var methods = vueOptions.methods || {};
  798. if (typeof data === 'function') {
  799. try {
  800. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  801. } catch (e) {
  802. if (Object({"VUE_APP_NAME":"swim-weapp","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  803. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  804. }
  805. }
  806. } else {
  807. try {
  808. // 对 data 格式化
  809. data = JSON.parse(JSON.stringify(data));
  810. } catch (e) {}
  811. }
  812. if (!isPlainObject(data)) {
  813. data = {};
  814. }
  815. Object.keys(methods).forEach(function (methodName) {
  816. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  817. data[methodName] = methods[methodName];
  818. }
  819. });
  820. return data;
  821. }
  822. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  823. function createObserver(name) {
  824. return function observer(newVal, oldVal) {
  825. if (this.$vm) {
  826. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  827. }
  828. };
  829. }
  830. function initBehaviors(vueOptions, initBehavior) {
  831. var vueBehaviors = vueOptions.behaviors;
  832. var vueExtends = vueOptions.extends;
  833. var vueMixins = vueOptions.mixins;
  834. var vueProps = vueOptions.props;
  835. if (!vueProps) {
  836. vueOptions.props = vueProps = [];
  837. }
  838. var behaviors = [];
  839. if (Array.isArray(vueBehaviors)) {
  840. vueBehaviors.forEach(function (behavior) {
  841. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  842. if (behavior === 'uni://form-field') {
  843. if (Array.isArray(vueProps)) {
  844. vueProps.push('name');
  845. vueProps.push('value');
  846. } else {
  847. vueProps.name = {
  848. type: String,
  849. default: '' };
  850. vueProps.value = {
  851. type: [String, Number, Boolean, Array, Object, Date],
  852. default: '' };
  853. }
  854. }
  855. });
  856. }
  857. if (isPlainObject(vueExtends) && vueExtends.props) {
  858. behaviors.push(
  859. initBehavior({
  860. properties: initProperties(vueExtends.props, true) }));
  861. }
  862. if (Array.isArray(vueMixins)) {
  863. vueMixins.forEach(function (vueMixin) {
  864. if (isPlainObject(vueMixin) && vueMixin.props) {
  865. behaviors.push(
  866. initBehavior({
  867. properties: initProperties(vueMixin.props, true) }));
  868. }
  869. });
  870. }
  871. return behaviors;
  872. }
  873. function parsePropType(key, type, defaultValue, file) {
  874. // [String]=>String
  875. if (Array.isArray(type) && type.length === 1) {
  876. return type[0];
  877. }
  878. return type;
  879. }
  880. function initProperties(props) {var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  881. var properties = {};
  882. if (!isBehavior) {
  883. properties.vueId = {
  884. type: String,
  885. value: '' };
  886. // 用于字节跳动小程序模拟抽象节点
  887. properties.generic = {
  888. type: Object,
  889. value: null };
  890. // scopedSlotsCompiler auto
  891. properties.scopedSlotsCompiler = {
  892. type: String,
  893. value: '' };
  894. properties.vueSlots = { // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  895. type: null,
  896. value: [],
  897. observer: function observer(newVal, oldVal) {
  898. var $slots = Object.create(null);
  899. newVal.forEach(function (slotName) {
  900. $slots[slotName] = true;
  901. });
  902. this.setData({
  903. $slots: $slots });
  904. } };
  905. }
  906. if (Array.isArray(props)) {// ['title']
  907. props.forEach(function (key) {
  908. properties[key] = {
  909. type: null,
  910. observer: createObserver(key) };
  911. });
  912. } else if (isPlainObject(props)) {// {title:{type:String,default:''},content:String}
  913. Object.keys(props).forEach(function (key) {
  914. var opts = props[key];
  915. if (isPlainObject(opts)) {// title:{type:String,default:''}
  916. var value = opts.default;
  917. if (isFn(value)) {
  918. value = value();
  919. }
  920. opts.type = parsePropType(key, opts.type);
  921. properties[key] = {
  922. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  923. value: value,
  924. observer: createObserver(key) };
  925. } else {// content:String
  926. var type = parsePropType(key, opts);
  927. properties[key] = {
  928. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  929. observer: createObserver(key) };
  930. }
  931. });
  932. }
  933. return properties;
  934. }
  935. function wrapper$1(event) {
  936. // TODO 又得兼容 mpvue 的 mp 对象
  937. try {
  938. event.mp = JSON.parse(JSON.stringify(event));
  939. } catch (e) {}
  940. event.stopPropagation = noop;
  941. event.preventDefault = noop;
  942. event.target = event.target || {};
  943. if (!hasOwn(event, 'detail')) {
  944. event.detail = {};
  945. }
  946. if (hasOwn(event, 'markerId')) {
  947. event.detail = typeof event.detail === 'object' ? event.detail : {};
  948. event.detail.markerId = event.markerId;
  949. }
  950. if (isPlainObject(event.detail)) {
  951. event.target = Object.assign({}, event.target, event.detail);
  952. }
  953. return event;
  954. }
  955. function getExtraValue(vm, dataPathsArray) {
  956. var context = vm;
  957. dataPathsArray.forEach(function (dataPathArray) {
  958. var dataPath = dataPathArray[0];
  959. var value = dataPathArray[2];
  960. if (dataPath || typeof value !== 'undefined') {// ['','',index,'disable']
  961. var propPath = dataPathArray[1];
  962. var valuePath = dataPathArray[3];
  963. var vFor;
  964. if (Number.isInteger(dataPath)) {
  965. vFor = dataPath;
  966. } else if (!dataPath) {
  967. vFor = context;
  968. } else if (typeof dataPath === 'string' && dataPath) {
  969. if (dataPath.indexOf('#s#') === 0) {
  970. vFor = dataPath.substr(3);
  971. } else {
  972. vFor = vm.__get_value(dataPath, context);
  973. }
  974. }
  975. if (Number.isInteger(vFor)) {
  976. context = value;
  977. } else if (!propPath) {
  978. context = vFor[value];
  979. } else {
  980. if (Array.isArray(vFor)) {
  981. context = vFor.find(function (vForItem) {
  982. return vm.__get_value(propPath, vForItem) === value;
  983. });
  984. } else if (isPlainObject(vFor)) {
  985. context = Object.keys(vFor).find(function (vForKey) {
  986. return vm.__get_value(propPath, vFor[vForKey]) === value;
  987. });
  988. } else {
  989. console.error('v-for 暂不支持循环数据:', vFor);
  990. }
  991. }
  992. if (valuePath) {
  993. context = vm.__get_value(valuePath, context);
  994. }
  995. }
  996. });
  997. return context;
  998. }
  999. function processEventExtra(vm, extra, event) {
  1000. var extraObj = {};
  1001. if (Array.isArray(extra) && extra.length) {
  1002. /**
  1003. *[
  1004. * ['data.items', 'data.id', item.data.id],
  1005. * ['metas', 'id', meta.id]
  1006. *],
  1007. *[
  1008. * ['data.items', 'data.id', item.data.id],
  1009. * ['metas', 'id', meta.id]
  1010. *],
  1011. *'test'
  1012. */
  1013. extra.forEach(function (dataPath, index) {
  1014. if (typeof dataPath === 'string') {
  1015. if (!dataPath) {// model,prop.sync
  1016. extraObj['$' + index] = vm;
  1017. } else {
  1018. if (dataPath === '$event') {// $event
  1019. extraObj['$' + index] = event;
  1020. } else if (dataPath === 'arguments') {
  1021. if (event.detail && event.detail.__args__) {
  1022. extraObj['$' + index] = event.detail.__args__;
  1023. } else {
  1024. extraObj['$' + index] = [event];
  1025. }
  1026. } else if (dataPath.indexOf('$event.') === 0) {// $event.target.value
  1027. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  1028. } else {
  1029. extraObj['$' + index] = vm.__get_value(dataPath);
  1030. }
  1031. }
  1032. } else {
  1033. extraObj['$' + index] = getExtraValue(vm, dataPath);
  1034. }
  1035. });
  1036. }
  1037. return extraObj;
  1038. }
  1039. function getObjByArray(arr) {
  1040. var obj = {};
  1041. for (var i = 1; i < arr.length; i++) {
  1042. var element = arr[i];
  1043. obj[element[0]] = element[1];
  1044. }
  1045. return obj;
  1046. }
  1047. 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;
  1048. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  1049. if (isCustom) {// 自定义事件
  1050. isCustomMPEvent = event.currentTarget &&
  1051. event.currentTarget.dataset &&
  1052. event.currentTarget.dataset.comType === 'wx';
  1053. if (!args.length) {// 无参数,直接传入 event 或 detail 数组
  1054. if (isCustomMPEvent) {
  1055. return [event];
  1056. }
  1057. return event.detail.__args__ || event.detail;
  1058. }
  1059. }
  1060. var extraObj = processEventExtra(vm, extra, event);
  1061. var ret = [];
  1062. args.forEach(function (arg) {
  1063. if (arg === '$event') {
  1064. if (methodName === '__set_model' && !isCustom) {// input v-model value
  1065. ret.push(event.target.value);
  1066. } else {
  1067. if (isCustom && !isCustomMPEvent) {
  1068. ret.push(event.detail.__args__[0]);
  1069. } else {// wxcomponent 组件或内置组件
  1070. ret.push(event);
  1071. }
  1072. }
  1073. } else {
  1074. if (Array.isArray(arg) && arg[0] === 'o') {
  1075. ret.push(getObjByArray(arg));
  1076. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  1077. ret.push(extraObj[arg]);
  1078. } else {
  1079. ret.push(arg);
  1080. }
  1081. }
  1082. });
  1083. return ret;
  1084. }
  1085. var ONCE = '~';
  1086. var CUSTOM = '^';
  1087. function isMatchEventType(eventType, optType) {
  1088. return eventType === optType ||
  1089. optType === 'regionchange' && (
  1090. eventType === 'begin' ||
  1091. eventType === 'end');
  1092. }
  1093. function getContextVm(vm) {
  1094. var $parent = vm.$parent;
  1095. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  1096. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  1097. $parent = $parent.$parent;
  1098. }
  1099. return $parent && $parent.$parent;
  1100. }
  1101. function handleEvent(event) {var _this = this;
  1102. event = wrapper$1(event);
  1103. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  1104. var dataset = (event.currentTarget || event.target).dataset;
  1105. if (!dataset) {
  1106. return console.warn('事件信息不存在');
  1107. }
  1108. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  1109. if (!eventOpts) {
  1110. return console.warn('事件信息不存在');
  1111. }
  1112. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  1113. var eventType = event.type;
  1114. var ret = [];
  1115. eventOpts.forEach(function (eventOpt) {
  1116. var type = eventOpt[0];
  1117. var eventsArray = eventOpt[1];
  1118. var isCustom = type.charAt(0) === CUSTOM;
  1119. type = isCustom ? type.slice(1) : type;
  1120. var isOnce = type.charAt(0) === ONCE;
  1121. type = isOnce ? type.slice(1) : type;
  1122. if (eventsArray && isMatchEventType(eventType, type)) {
  1123. eventsArray.forEach(function (eventArray) {
  1124. var methodName = eventArray[0];
  1125. if (methodName) {
  1126. var handlerCtx = _this.$vm;
  1127. if (handlerCtx.$options.generic) {// mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  1128. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  1129. }
  1130. if (methodName === '$emit') {
  1131. handlerCtx.$emit.apply(handlerCtx,
  1132. processEventArgs(
  1133. _this.$vm,
  1134. event,
  1135. eventArray[1],
  1136. eventArray[2],
  1137. isCustom,
  1138. methodName));
  1139. return;
  1140. }
  1141. var handler = handlerCtx[methodName];
  1142. if (!isFn(handler)) {
  1143. throw new Error(" _vm.".concat(methodName, " is not a function"));
  1144. }
  1145. if (isOnce) {
  1146. if (handler.once) {
  1147. return;
  1148. }
  1149. handler.once = true;
  1150. }
  1151. var params = processEventArgs(
  1152. _this.$vm,
  1153. event,
  1154. eventArray[1],
  1155. eventArray[2],
  1156. isCustom,
  1157. methodName);
  1158. params = Array.isArray(params) ? params : [];
  1159. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  1160. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  1161. // eslint-disable-next-line no-sparse-arrays
  1162. params = params.concat([,,,,,,,,,, event]);
  1163. }
  1164. ret.push(handler.apply(handlerCtx, params));
  1165. }
  1166. });
  1167. }
  1168. });
  1169. if (
  1170. eventType === 'input' &&
  1171. ret.length === 1 &&
  1172. typeof ret[0] !== 'undefined')
  1173. {
  1174. return ret[0];
  1175. }
  1176. }
  1177. var messages = {};
  1178. var locale;
  1179. {
  1180. locale = wx.getSystemInfoSync().language;
  1181. }
  1182. function initI18nMessages() {
  1183. if (!isEnableLocale()) {
  1184. return;
  1185. }
  1186. var localeKeys = Object.keys(__uniConfig.locales);
  1187. if (localeKeys.length) {
  1188. localeKeys.forEach(function (locale) {
  1189. var curMessages = messages[locale];
  1190. var userMessages = __uniConfig.locales[locale];
  1191. if (curMessages) {
  1192. Object.assign(curMessages, userMessages);
  1193. } else {
  1194. messages[locale] = userMessages;
  1195. }
  1196. });
  1197. }
  1198. }
  1199. initI18nMessages();
  1200. var i18n = (0, _uniI18n.initVueI18n)(
  1201. locale,
  1202. {});
  1203. var t = i18n.t;
  1204. var i18nMixin = i18n.mixin = {
  1205. beforeCreate: function beforeCreate() {var _this2 = this;
  1206. var unwatch = i18n.i18n.watchLocale(function () {
  1207. _this2.$forceUpdate();
  1208. });
  1209. this.$once('hook:beforeDestroy', function () {
  1210. unwatch();
  1211. });
  1212. },
  1213. methods: {
  1214. $$t: function $$t(key, values) {
  1215. return t(key, values);
  1216. } } };
  1217. var setLocale$1 = i18n.setLocale;
  1218. var getLocale$1 = i18n.getLocale;
  1219. function initAppLocale(Vue, appVm, locale) {
  1220. var state = Vue.observable({
  1221. locale: locale || i18n.getLocale() });
  1222. var localeWatchers = [];
  1223. appVm.$watchLocale = function (fn) {
  1224. localeWatchers.push(fn);
  1225. };
  1226. Object.defineProperty(appVm, '$locale', {
  1227. get: function get() {
  1228. return state.locale;
  1229. },
  1230. set: function set(v) {
  1231. state.locale = v;
  1232. localeWatchers.forEach(function (watch) {return watch(v);});
  1233. } });
  1234. }
  1235. function isEnableLocale() {
  1236. return typeof __uniConfig !== 'undefined' && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length;
  1237. }
  1238. // export function initI18n() {
  1239. // const localeKeys = Object.keys(__uniConfig.locales || {})
  1240. // if (localeKeys.length) {
  1241. // localeKeys.forEach((locale) =>
  1242. // i18n.add(locale, __uniConfig.locales[locale])
  1243. // )
  1244. // }
  1245. // }
  1246. var eventChannels = {};
  1247. var eventChannelStack = [];
  1248. function getEventChannel(id) {
  1249. if (id) {
  1250. var eventChannel = eventChannels[id];
  1251. delete eventChannels[id];
  1252. return eventChannel;
  1253. }
  1254. return eventChannelStack.shift();
  1255. }
  1256. var hooks = [
  1257. 'onShow',
  1258. 'onHide',
  1259. 'onError',
  1260. 'onPageNotFound',
  1261. 'onThemeChange',
  1262. 'onUnhandledRejection'];
  1263. function initEventChannel() {
  1264. _vue.default.prototype.getOpenerEventChannel = function () {
  1265. // 微信小程序使用自身getOpenerEventChannel
  1266. {
  1267. return this.$scope.getOpenerEventChannel();
  1268. }
  1269. };
  1270. var callHook = _vue.default.prototype.__call_hook;
  1271. _vue.default.prototype.__call_hook = function (hook, args) {
  1272. if (hook === 'onLoad' && args && args.__id__) {
  1273. this.__eventChannel__ = getEventChannel(args.__id__);
  1274. delete args.__id__;
  1275. }
  1276. return callHook.call(this, hook, args);
  1277. };
  1278. }
  1279. function initScopedSlotsParams() {
  1280. var center = {};
  1281. var parents = {};
  1282. _vue.default.prototype.$hasScopedSlotsParams = function (vueId) {
  1283. var has = center[vueId];
  1284. if (!has) {
  1285. parents[vueId] = this;
  1286. this.$on('hook:destroyed', function () {
  1287. delete parents[vueId];
  1288. });
  1289. }
  1290. return has;
  1291. };
  1292. _vue.default.prototype.$getScopedSlotsParams = function (vueId, name, key) {
  1293. var data = center[vueId];
  1294. if (data) {
  1295. var object = data[name] || {};
  1296. return key ? object[key] : object;
  1297. } else {
  1298. parents[vueId] = this;
  1299. this.$on('hook:destroyed', function () {
  1300. delete parents[vueId];
  1301. });
  1302. }
  1303. };
  1304. _vue.default.prototype.$setScopedSlotsParams = function (name, value) {
  1305. var vueIds = this.$options.propsData.vueId;
  1306. if (vueIds) {
  1307. var vueId = vueIds.split(',')[0];
  1308. var object = center[vueId] = center[vueId] || {};
  1309. object[name] = value;
  1310. if (parents[vueId]) {
  1311. parents[vueId].$forceUpdate();
  1312. }
  1313. }
  1314. };
  1315. _vue.default.mixin({
  1316. destroyed: function destroyed() {
  1317. var propsData = this.$options.propsData;
  1318. var vueId = propsData && propsData.vueId;
  1319. if (vueId) {
  1320. delete center[vueId];
  1321. delete parents[vueId];
  1322. }
  1323. } });
  1324. }
  1325. function parseBaseApp(vm, _ref3)
  1326. {var mocks = _ref3.mocks,initRefs = _ref3.initRefs;
  1327. initEventChannel();
  1328. {
  1329. initScopedSlotsParams();
  1330. }
  1331. if (vm.$options.store) {
  1332. _vue.default.prototype.$store = vm.$options.store;
  1333. }
  1334. uniIdMixin(_vue.default);
  1335. _vue.default.prototype.mpHost = "mp-weixin";
  1336. _vue.default.mixin({
  1337. beforeCreate: function beforeCreate() {
  1338. if (!this.$options.mpType) {
  1339. return;
  1340. }
  1341. this.mpType = this.$options.mpType;
  1342. this.$mp = _defineProperty({
  1343. data: {} },
  1344. this.mpType, this.$options.mpInstance);
  1345. this.$scope = this.$options.mpInstance;
  1346. delete this.$options.mpType;
  1347. delete this.$options.mpInstance;
  1348. if (this.mpType === 'page' && typeof getApp === 'function') {// hack vue-i18n
  1349. var app = getApp();
  1350. if (app.$vm && app.$vm.$i18n) {
  1351. this._i18n = app.$vm.$i18n;
  1352. }
  1353. }
  1354. if (this.mpType !== 'app') {
  1355. initRefs(this);
  1356. initMocks(this, mocks);
  1357. }
  1358. } });
  1359. var appOptions = {
  1360. onLaunch: function onLaunch(args) {
  1361. if (this.$vm) {// 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  1362. return;
  1363. }
  1364. {
  1365. if (wx.canIUse && !wx.canIUse('nextTick')) {// 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  1366. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  1367. }
  1368. }
  1369. this.$vm = vm;
  1370. this.$vm.$mp = {
  1371. app: this };
  1372. this.$vm.$scope = this;
  1373. // vm 上也挂载 globalData
  1374. this.$vm.globalData = this.globalData;
  1375. this.$vm._isMounted = true;
  1376. this.$vm.__call_hook('mounted', args);
  1377. this.$vm.__call_hook('onLaunch', args);
  1378. } };
  1379. // 兼容旧版本 globalData
  1380. appOptions.globalData = vm.$options.globalData || {};
  1381. // 将 methods 中的方法挂在 getApp() 中
  1382. var methods = vm.$options.methods;
  1383. if (methods) {
  1384. Object.keys(methods).forEach(function (name) {
  1385. appOptions[name] = methods[name];
  1386. });
  1387. }
  1388. initAppLocale(_vue.default, vm, wx.getSystemInfoSync().language || 'zh-Hans');
  1389. initHooks(appOptions, hooks);
  1390. return appOptions;
  1391. }
  1392. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1393. function findVmByVueId(vm, vuePid) {
  1394. var $children = vm.$children;
  1395. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1396. for (var i = $children.length - 1; i >= 0; i--) {
  1397. var childVm = $children[i];
  1398. if (childVm.$scope._$vueId === vuePid) {
  1399. return childVm;
  1400. }
  1401. }
  1402. // 反向递归查找
  1403. var parentVm;
  1404. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1405. parentVm = findVmByVueId($children[_i], vuePid);
  1406. if (parentVm) {
  1407. return parentVm;
  1408. }
  1409. }
  1410. }
  1411. function initBehavior(options) {
  1412. return Behavior(options);
  1413. }
  1414. function isPage() {
  1415. return !!this.route;
  1416. }
  1417. function initRelation(detail) {
  1418. this.triggerEvent('__l', detail);
  1419. }
  1420. function selectAllComponents(mpInstance, selector, $refs) {
  1421. var components = mpInstance.selectAllComponents(selector);
  1422. components.forEach(function (component) {
  1423. var ref = component.dataset.ref;
  1424. $refs[ref] = component.$vm || component;
  1425. {
  1426. if (component.dataset.vueGeneric === 'scoped') {
  1427. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  1428. selectAllComponents(scopedComponent, selector, $refs);
  1429. });
  1430. }
  1431. }
  1432. });
  1433. }
  1434. function initRefs(vm) {
  1435. var mpInstance = vm.$scope;
  1436. Object.defineProperty(vm, '$refs', {
  1437. get: function get() {
  1438. var $refs = {};
  1439. selectAllComponents(mpInstance, '.vue-ref', $refs);
  1440. // TODO 暂不考虑 for 中的 scoped
  1441. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for');
  1442. forComponents.forEach(function (component) {
  1443. var ref = component.dataset.ref;
  1444. if (!$refs[ref]) {
  1445. $refs[ref] = [];
  1446. }
  1447. $refs[ref].push(component.$vm || component);
  1448. });
  1449. return $refs;
  1450. } });
  1451. }
  1452. function handleLink(event) {var _ref4 =
  1453. event.detail || event.value,vuePid = _ref4.vuePid,vueOptions = _ref4.vueOptions; // detail 是微信,value 是百度(dipatch)
  1454. var parentVm;
  1455. if (vuePid) {
  1456. parentVm = findVmByVueId(this.$vm, vuePid);
  1457. }
  1458. if (!parentVm) {
  1459. parentVm = this.$vm;
  1460. }
  1461. vueOptions.parent = parentVm;
  1462. }
  1463. function parseApp(vm) {
  1464. return parseBaseApp(vm, {
  1465. mocks: mocks,
  1466. initRefs: initRefs });
  1467. }
  1468. function createApp(vm) {
  1469. App(parseApp(vm));
  1470. return vm;
  1471. }
  1472. var encodeReserveRE = /[!'()*]/g;
  1473. var encodeReserveReplacer = function encodeReserveReplacer(c) {return '%' + c.charCodeAt(0).toString(16);};
  1474. var commaRE = /%2C/g;
  1475. // fixed encodeURIComponent which is more conformant to RFC3986:
  1476. // - escapes [!'()*]
  1477. // - preserve commas
  1478. var encode = function encode(str) {return encodeURIComponent(str).
  1479. replace(encodeReserveRE, encodeReserveReplacer).
  1480. replace(commaRE, ',');};
  1481. function stringifyQuery(obj) {var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  1482. var res = obj ? Object.keys(obj).map(function (key) {
  1483. var val = obj[key];
  1484. if (val === undefined) {
  1485. return '';
  1486. }
  1487. if (val === null) {
  1488. return encodeStr(key);
  1489. }
  1490. if (Array.isArray(val)) {
  1491. var result = [];
  1492. val.forEach(function (val2) {
  1493. if (val2 === undefined) {
  1494. return;
  1495. }
  1496. if (val2 === null) {
  1497. result.push(encodeStr(key));
  1498. } else {
  1499. result.push(encodeStr(key) + '=' + encodeStr(val2));
  1500. }
  1501. });
  1502. return result.join('&');
  1503. }
  1504. return encodeStr(key) + '=' + encodeStr(val);
  1505. }).filter(function (x) {return x.length > 0;}).join('&') : null;
  1506. return res ? "?".concat(res) : '';
  1507. }
  1508. function parseBaseComponent(vueComponentOptions)
  1509. {var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},isPage = _ref5.isPage,initRelation = _ref5.initRelation;var _initVueComponent =
  1510. initVueComponent(_vue.default, vueComponentOptions),_initVueComponent2 = _slicedToArray(_initVueComponent, 2),VueComponent = _initVueComponent2[0],vueOptions = _initVueComponent2[1];
  1511. var options = _objectSpread({
  1512. multipleSlots: true,
  1513. addGlobalClass: true },
  1514. vueOptions.options || {});
  1515. {
  1516. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  1517. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  1518. Object.assign(options, vueOptions['mp-weixin'].options);
  1519. }
  1520. }
  1521. var componentOptions = {
  1522. options: options,
  1523. data: initData(vueOptions, _vue.default.prototype),
  1524. behaviors: initBehaviors(vueOptions, initBehavior),
  1525. properties: initProperties(vueOptions.props, false, vueOptions.__file),
  1526. lifetimes: {
  1527. attached: function attached() {
  1528. var properties = this.properties;
  1529. var options = {
  1530. mpType: isPage.call(this) ? 'page' : 'component',
  1531. mpInstance: this,
  1532. propsData: properties };
  1533. initVueIds(properties.vueId, this);
  1534. // 处理父子关系
  1535. initRelation.call(this, {
  1536. vuePid: this._$vuePid,
  1537. vueOptions: options });
  1538. // 初始化 vue 实例
  1539. this.$vm = new VueComponent(options);
  1540. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  1541. initSlots(this.$vm, properties.vueSlots);
  1542. // 触发首次 setData
  1543. this.$vm.$mount();
  1544. },
  1545. ready: function ready() {
  1546. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  1547. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  1548. if (this.$vm) {
  1549. this.$vm._isMounted = true;
  1550. this.$vm.__call_hook('mounted');
  1551. this.$vm.__call_hook('onReady');
  1552. }
  1553. },
  1554. detached: function detached() {
  1555. this.$vm && this.$vm.$destroy();
  1556. } },
  1557. pageLifetimes: {
  1558. show: function show(args) {
  1559. this.$vm && this.$vm.__call_hook('onPageShow', args);
  1560. },
  1561. hide: function hide() {
  1562. this.$vm && this.$vm.__call_hook('onPageHide');
  1563. },
  1564. resize: function resize(size) {
  1565. this.$vm && this.$vm.__call_hook('onPageResize', size);
  1566. } },
  1567. methods: {
  1568. __l: handleLink,
  1569. __e: handleEvent } };
  1570. // externalClasses
  1571. if (vueOptions.externalClasses) {
  1572. componentOptions.externalClasses = vueOptions.externalClasses;
  1573. }
  1574. if (Array.isArray(vueOptions.wxsCallMethods)) {
  1575. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  1576. componentOptions.methods[callMethod] = function (args) {
  1577. return this.$vm[callMethod](args);
  1578. };
  1579. });
  1580. }
  1581. if (isPage) {
  1582. return componentOptions;
  1583. }
  1584. return [componentOptions, VueComponent];
  1585. }
  1586. function parseComponent(vueComponentOptions) {
  1587. return parseBaseComponent(vueComponentOptions, {
  1588. isPage: isPage,
  1589. initRelation: initRelation });
  1590. }
  1591. var hooks$1 = [
  1592. 'onShow',
  1593. 'onHide',
  1594. 'onUnload'];
  1595. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  1596. function parseBasePage(vuePageOptions, _ref6)
  1597. {var isPage = _ref6.isPage,initRelation = _ref6.initRelation;
  1598. var pageOptions = parseComponent(vuePageOptions);
  1599. initHooks(pageOptions.methods, hooks$1, vuePageOptions);
  1600. pageOptions.methods.onLoad = function (query) {
  1601. this.options = query;
  1602. var copyQuery = Object.assign({}, query);
  1603. delete copyQuery.__id__;
  1604. this.$page = {
  1605. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery) };
  1606. this.$vm.$mp.query = query; // 兼容 mpvue
  1607. this.$vm.__call_hook('onLoad', query);
  1608. };
  1609. return pageOptions;
  1610. }
  1611. function parsePage(vuePageOptions) {
  1612. return parseBasePage(vuePageOptions, {
  1613. isPage: isPage,
  1614. initRelation: initRelation });
  1615. }
  1616. function createPage(vuePageOptions) {
  1617. {
  1618. return Component(parsePage(vuePageOptions));
  1619. }
  1620. }
  1621. function createComponent(vueOptions) {
  1622. {
  1623. return Component(parseComponent(vueOptions));
  1624. }
  1625. }
  1626. function createSubpackageApp(vm) {
  1627. var appOptions = parseApp(vm);
  1628. var app = getApp({
  1629. allowDefault: true });
  1630. vm.$scope = app;
  1631. var globalData = app.globalData;
  1632. if (globalData) {
  1633. Object.keys(appOptions.globalData).forEach(function (name) {
  1634. if (!hasOwn(globalData, name)) {
  1635. globalData[name] = appOptions.globalData[name];
  1636. }
  1637. });
  1638. }
  1639. Object.keys(appOptions).forEach(function (name) {
  1640. if (!hasOwn(app, name)) {
  1641. app[name] = appOptions[name];
  1642. }
  1643. });
  1644. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1645. wx.onAppShow(function () {for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {args[_key5] = arguments[_key5];}
  1646. vm.__call_hook('onShow', args);
  1647. });
  1648. }
  1649. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1650. wx.onAppHide(function () {for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {args[_key6] = arguments[_key6];}
  1651. vm.__call_hook('onHide', args);
  1652. });
  1653. }
  1654. if (isFn(appOptions.onLaunch)) {
  1655. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  1656. vm.__call_hook('onLaunch', args);
  1657. }
  1658. return vm;
  1659. }
  1660. function createPlugin(vm) {
  1661. var appOptions = parseApp(vm);
  1662. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1663. wx.onAppShow(function () {for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {args[_key7] = arguments[_key7];}
  1664. vm.__call_hook('onShow', args);
  1665. });
  1666. }
  1667. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1668. wx.onAppHide(function () {for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {args[_key8] = arguments[_key8];}
  1669. vm.__call_hook('onHide', args);
  1670. });
  1671. }
  1672. if (isFn(appOptions.onLaunch)) {
  1673. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  1674. vm.__call_hook('onLaunch', args);
  1675. }
  1676. return vm;
  1677. }
  1678. todos.forEach(function (todoApi) {
  1679. protocols[todoApi] = false;
  1680. });
  1681. canIUses.forEach(function (canIUseApi) {
  1682. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name :
  1683. canIUseApi;
  1684. if (!wx.canIUse(apiName)) {
  1685. protocols[canIUseApi] = false;
  1686. }
  1687. });
  1688. var uni = {};
  1689. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  1690. uni = new Proxy({}, {
  1691. get: function get(target, name) {
  1692. if (hasOwn(target, name)) {
  1693. return target[name];
  1694. }
  1695. if (baseApi[name]) {
  1696. return baseApi[name];
  1697. }
  1698. if (api[name]) {
  1699. return promisify(name, api[name]);
  1700. }
  1701. {
  1702. if (extraApi[name]) {
  1703. return promisify(name, extraApi[name]);
  1704. }
  1705. if (todoApis[name]) {
  1706. return promisify(name, todoApis[name]);
  1707. }
  1708. }
  1709. if (eventApi[name]) {
  1710. return eventApi[name];
  1711. }
  1712. if (!hasOwn(wx, name) && !hasOwn(protocols, name)) {
  1713. return;
  1714. }
  1715. return promisify(name, wrapper(name, wx[name]));
  1716. },
  1717. set: function set(target, name, value) {
  1718. target[name] = value;
  1719. return true;
  1720. } });
  1721. } else {
  1722. Object.keys(baseApi).forEach(function (name) {
  1723. uni[name] = baseApi[name];
  1724. });
  1725. {
  1726. Object.keys(todoApis).forEach(function (name) {
  1727. uni[name] = promisify(name, todoApis[name]);
  1728. });
  1729. Object.keys(extraApi).forEach(function (name) {
  1730. uni[name] = promisify(name, todoApis[name]);
  1731. });
  1732. }
  1733. Object.keys(eventApi).forEach(function (name) {
  1734. uni[name] = eventApi[name];
  1735. });
  1736. Object.keys(api).forEach(function (name) {
  1737. uni[name] = promisify(name, api[name]);
  1738. });
  1739. Object.keys(wx).forEach(function (name) {
  1740. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  1741. uni[name] = promisify(name, wrapper(name, wx[name]));
  1742. }
  1743. });
  1744. }
  1745. wx.createApp = createApp;
  1746. wx.createPage = createPage;
  1747. wx.createComponent = createComponent;
  1748. wx.createSubpackageApp = createSubpackageApp;
  1749. wx.createPlugin = createPlugin;
  1750. var uni$1 = uni;var _default =
  1751. uni$1;exports.default = _default;
  1752. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 2)))
  1753. /***/ }),
  1754. /***/ 11:
  1755. /*!**********************************************************************************************************!*\
  1756. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  1757. \**********************************************************************************************************/
  1758. /*! exports provided: default */
  1759. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1760. "use strict";
  1761. __webpack_require__.r(__webpack_exports__);
  1762. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  1763. /* globals __VUE_SSR_CONTEXT__ */
  1764. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  1765. // This module is a runtime utility for cleaner component module output and will
  1766. // be included in the final webpack user bundle.
  1767. function normalizeComponent (
  1768. scriptExports,
  1769. render,
  1770. staticRenderFns,
  1771. functionalTemplate,
  1772. injectStyles,
  1773. scopeId,
  1774. moduleIdentifier, /* server only */
  1775. shadowMode, /* vue-cli only */
  1776. components, // fixed by xxxxxx auto components
  1777. renderjs // fixed by xxxxxx renderjs
  1778. ) {
  1779. // Vue.extend constructor export interop
  1780. var options = typeof scriptExports === 'function'
  1781. ? scriptExports.options
  1782. : scriptExports
  1783. // fixed by xxxxxx auto components
  1784. if (components) {
  1785. if (!options.components) {
  1786. options.components = {}
  1787. }
  1788. var hasOwn = Object.prototype.hasOwnProperty
  1789. for (var name in components) {
  1790. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  1791. options.components[name] = components[name]
  1792. }
  1793. }
  1794. }
  1795. // fixed by xxxxxx renderjs
  1796. if (renderjs) {
  1797. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  1798. this[renderjs.__module] = this
  1799. });
  1800. (options.mixins || (options.mixins = [])).push(renderjs)
  1801. }
  1802. // render functions
  1803. if (render) {
  1804. options.render = render
  1805. options.staticRenderFns = staticRenderFns
  1806. options._compiled = true
  1807. }
  1808. // functional template
  1809. if (functionalTemplate) {
  1810. options.functional = true
  1811. }
  1812. // scopedId
  1813. if (scopeId) {
  1814. options._scopeId = 'data-v-' + scopeId
  1815. }
  1816. var hook
  1817. if (moduleIdentifier) { // server build
  1818. hook = function (context) {
  1819. // 2.3 injection
  1820. context =
  1821. context || // cached call
  1822. (this.$vnode && this.$vnode.ssrContext) || // stateful
  1823. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  1824. // 2.2 with runInNewContext: true
  1825. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  1826. context = __VUE_SSR_CONTEXT__
  1827. }
  1828. // inject component styles
  1829. if (injectStyles) {
  1830. injectStyles.call(this, context)
  1831. }
  1832. // register component module identifier for async chunk inferrence
  1833. if (context && context._registeredComponents) {
  1834. context._registeredComponents.add(moduleIdentifier)
  1835. }
  1836. }
  1837. // used by ssr in case component is cached and beforeCreate
  1838. // never gets called
  1839. options._ssrRegister = hook
  1840. } else if (injectStyles) {
  1841. hook = shadowMode
  1842. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  1843. : injectStyles
  1844. }
  1845. if (hook) {
  1846. if (options.functional) {
  1847. // for template-only hot-reload because in that case the render fn doesn't
  1848. // go through the normalizer
  1849. options._injectStyles = hook
  1850. // register for functioal component in vue file
  1851. var originalRender = options.render
  1852. options.render = function renderWithStyleInjection (h, context) {
  1853. hook.call(context)
  1854. return originalRender(h, context)
  1855. }
  1856. } else {
  1857. // inject component registration as beforeCreate hook
  1858. var existing = options.beforeCreate
  1859. options.beforeCreate = existing
  1860. ? [].concat(existing, hook)
  1861. : [hook]
  1862. }
  1863. }
  1864. return {
  1865. exports: scriptExports,
  1866. options: options
  1867. }
  1868. }
  1869. /***/ }),
  1870. /***/ 12:
  1871. /*!********************************************************!*\
  1872. !*** D:/HbuderX-exercise/swim-weapp/uview-ui/index.js ***!
  1873. \********************************************************/
  1874. /*! no static exports found */
  1875. /***/ (function(module, exports, __webpack_require__) {
  1876. "use strict";
  1877. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  1878. var _mixin = _interopRequireDefault(__webpack_require__(/*! ./libs/mixin/mixin.js */ 13));
  1879. var _request = _interopRequireDefault(__webpack_require__(/*! ./libs/request */ 14));
  1880. var _queryParams = _interopRequireDefault(__webpack_require__(/*! ./libs/function/queryParams.js */ 18));
  1881. var _route = _interopRequireDefault(__webpack_require__(/*! ./libs/function/route.js */ 19));
  1882. var _timeFormat = _interopRequireDefault(__webpack_require__(/*! ./libs/function/timeFormat.js */ 23));
  1883. var _timeFrom = _interopRequireDefault(__webpack_require__(/*! ./libs/function/timeFrom.js */ 24));
  1884. var _colorGradient = _interopRequireDefault(__webpack_require__(/*! ./libs/function/colorGradient.js */ 25));
  1885. var _guid = _interopRequireDefault(__webpack_require__(/*! ./libs/function/guid.js */ 26));
  1886. var _color = _interopRequireDefault(__webpack_require__(/*! ./libs/function/color.js */ 27));
  1887. var _type2icon = _interopRequireDefault(__webpack_require__(/*! ./libs/function/type2icon.js */ 28));
  1888. var _randomArray = _interopRequireDefault(__webpack_require__(/*! ./libs/function/randomArray.js */ 29));
  1889. var _deepClone = _interopRequireDefault(__webpack_require__(/*! ./libs/function/deepClone.js */ 16));
  1890. var _deepMerge = _interopRequireDefault(__webpack_require__(/*! ./libs/function/deepMerge.js */ 15));
  1891. var _addUnit = _interopRequireDefault(__webpack_require__(/*! ./libs/function/addUnit.js */ 30));
  1892. var _test = _interopRequireDefault(__webpack_require__(/*! ./libs/function/test.js */ 17));
  1893. var _random = _interopRequireDefault(__webpack_require__(/*! ./libs/function/random.js */ 31));
  1894. var _trim = _interopRequireDefault(__webpack_require__(/*! ./libs/function/trim.js */ 32));
  1895. var _toast = _interopRequireDefault(__webpack_require__(/*! ./libs/function/toast.js */ 33));
  1896. var _getParent = _interopRequireDefault(__webpack_require__(/*! ./libs/function/getParent.js */ 34));
  1897. var _$parent = _interopRequireDefault(__webpack_require__(/*! ./libs/function/$parent.js */ 35));
  1898. var _sys = __webpack_require__(/*! ./libs/function/sys.js */ 36);
  1899. var _debounce = _interopRequireDefault(__webpack_require__(/*! ./libs/function/debounce.js */ 37));
  1900. var _throttle = _interopRequireDefault(__webpack_require__(/*! ./libs/function/throttle.js */ 38));
  1901. var _config = _interopRequireDefault(__webpack_require__(/*! ./libs/config/config.js */ 39));
  1902. var _zIndex = _interopRequireDefault(__webpack_require__(/*! ./libs/config/zIndex.js */ 40));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} // 引入全局mixin
  1903. // 引入关于是否mixin集成小程序分享的配置
  1904. // import wxshare from './libs/mixin/mpShare.js'
  1905. // 全局挂载引入http相关请求拦截插件
  1906. function wranning(str) {// 开发环境进行信息输出,主要是一些报错信息
  1907. // 这个环境的来由是在程序编写时候,点击hx编辑器运行调试代码的时候,详见:
  1908. // https://uniapp.dcloud.io/frame?id=%e5%bc%80%e5%8f%91%e7%8e%af%e5%a2%83%e5%92%8c%e7%94%9f%e4%ba%a7%e7%8e%af%e5%a2%83
  1909. if (true) {console.warn(str);}} // 尝试判断在根目录的/store中是否有$u.mixin.js,此文件uView默认为需要挂在到全局的vuex的state变量
  1910. // HX2.6.11版本,放到try中,控制台依然会警告,暂时不用此方式,
  1911. // let vuexStore = {};
  1912. // try {
  1913. // vuexStore = require("@/store/$u.mixin.js");
  1914. // } catch (e) {
  1915. // //TODO handle the exception
  1916. // }
  1917. // post类型对象参数转为get类型url参数
  1918. var $u = { queryParams: _queryParams.default, route: _route.default, timeFormat: _timeFormat.default, date: _timeFormat.default, // 另名date
  1919. timeFrom: _timeFrom.default, colorGradient: _colorGradient.default.colorGradient, colorToRgba: _colorGradient.default.colorToRgba, guid: _guid.default, color: _color.default, sys: _sys.sys, os: _sys.os, type2icon: _type2icon.default, randomArray: _randomArray.default, wranning: wranning, get: _request.default.get,
  1920. post: _request.default.post,
  1921. put: _request.default.put,
  1922. 'delete': _request.default.delete,
  1923. hexToRgb: _colorGradient.default.hexToRgb,
  1924. rgbToHex: _colorGradient.default.rgbToHex,
  1925. test: _test.default,
  1926. random: _random.default,
  1927. deepClone: _deepClone.default,
  1928. deepMerge: _deepMerge.default,
  1929. getParent: _getParent.default,
  1930. $parent: _$parent.default,
  1931. addUnit: _addUnit.default,
  1932. trim: _trim.default,
  1933. type: ['primary', 'success', 'error', 'warning', 'info'],
  1934. http: _request.default,
  1935. toast: _toast.default,
  1936. config: _config.default, // uView配置信息相关,比如版本号
  1937. zIndex: _zIndex.default,
  1938. debounce: _debounce.default,
  1939. throttle: _throttle.default };
  1940. // $u挂载到uni对象上
  1941. uni.$u = $u;
  1942. var install = function install(Vue) {
  1943. Vue.mixin(_mixin.default);
  1944. if (Vue.prototype.openShare) {
  1945. Vue.mixin(mpShare);
  1946. }
  1947. // Vue.mixin(vuexStore);
  1948. // 时间格式化,同时两个名称,date和timeFormat
  1949. Vue.filter('timeFormat', function (timestamp, format) {
  1950. return (0, _timeFormat.default)(timestamp, format);
  1951. });
  1952. Vue.filter('date', function (timestamp, format) {
  1953. return (0, _timeFormat.default)(timestamp, format);
  1954. });
  1955. // 将多久以前的方法,注入到全局过滤器
  1956. Vue.filter('timeFrom', function (timestamp, format) {
  1957. return (0, _timeFrom.default)(timestamp, format);
  1958. });
  1959. Vue.prototype.$u = $u;
  1960. };var _default =
  1961. {
  1962. install: install };exports.default = _default;
  1963. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  1964. /***/ }),
  1965. /***/ 13:
  1966. /*!*******************************************************************!*\
  1967. !*** D:/HbuderX-exercise/swim-weapp/uview-ui/libs/mixin/mixin.js ***!
  1968. \*******************************************************************/
  1969. /*! no static exports found */
  1970. /***/ (function(module, exports, __webpack_require__) {
  1971. /* WEBPACK VAR INJECTION */(function(uni) {module.exports = {
  1972. data: function data() {
  1973. return {};
  1974. },
  1975. onLoad: function onLoad() {
  1976. // getRect挂载到$u上,因为这方法需要使用in(this),所以无法把它独立成一个单独的文件导出
  1977. this.$u.getRect = this.$uGetRect;
  1978. },
  1979. methods: {
  1980. // 查询节点信息
  1981. // 目前此方法在支付宝小程序中无法获取组件跟接点的尺寸,为支付宝的bug(2020-07-21)
  1982. // 解决办法为在组件根部再套一个没有任何作用的view元素
  1983. $uGetRect: function $uGetRect(selector, all) {var _this = this;
  1984. return new Promise(function (resolve) {
  1985. uni.createSelectorQuery().
  1986. in(_this)[all ? 'selectAll' : 'select'](selector).
  1987. boundingClientRect(function (rect) {
  1988. if (all && Array.isArray(rect) && rect.length) {
  1989. resolve(rect);
  1990. }
  1991. if (!all && rect) {
  1992. resolve(rect);
  1993. }
  1994. }).
  1995. exec();
  1996. });
  1997. },
  1998. getParentData: function getParentData() {var _this2 = this;var parentName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  1999. // 避免在created中去定义parent变量
  2000. if (!this.parent) this.parent = false;
  2001. // 这里的本质原理是,通过获取父组件实例(也即u-radio-group的this)
  2002. // 将父组件this中对应的参数,赋值给本组件(u-radio的this)的parentData对象中对应的属性
  2003. // 之所以需要这么做,是因为所有端中,头条小程序不支持通过this.parent.xxx去监听父组件参数的变化
  2004. this.parent = this.$u.$parent.call(this, parentName);
  2005. if (this.parent) {
  2006. // 历遍parentData中的属性,将parent中的同名属性赋值给parentData
  2007. Object.keys(this.parentData).map(function (key) {
  2008. _this2.parentData[key] = _this2.parent[key];
  2009. });
  2010. }
  2011. },
  2012. // 阻止事件冒泡
  2013. preventEvent: function preventEvent(e) {
  2014. e && e.stopPropagation && e.stopPropagation();
  2015. } },
  2016. onReachBottom: function onReachBottom() {
  2017. uni.$emit('uOnReachBottom');
  2018. },
  2019. beforeDestroy: function beforeDestroy() {var _this3 = this;
  2020. // 判断当前页面是否存在parent和chldren,一般在checkbox和checkbox-group父子联动的场景会有此情况
  2021. // 组件销毁时,移除子组件在父组件children数组中的实例,释放资源,避免数据混乱
  2022. if (this.parent && uni.$u.test.array(this.parent.children)) {
  2023. // 组件销毁时,移除父组件中的children数组中对应的实例
  2024. var childrenList = this.parent.children;
  2025. childrenList.map(function (child, index) {
  2026. // 如果相等,则移除
  2027. if (child === _this3) {
  2028. childrenList.splice(index, 1);
  2029. }
  2030. });
  2031. }
  2032. } };
  2033. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  2034. /***/ }),
  2035. /***/ 14:
  2036. /*!*********************************************************************!*\
  2037. !*** D:/HbuderX-exercise/swim-weapp/uview-ui/libs/request/index.js ***!
  2038. \*********************************************************************/
  2039. /*! no static exports found */
  2040. /***/ (function(module, exports, __webpack_require__) {
  2041. "use strict";
  2042. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _deepMerge = _interopRequireDefault(__webpack_require__(/*! ../function/deepMerge */ 15));
  2043. var _test = _interopRequireDefault(__webpack_require__(/*! ../function/test */ 17));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;}var
  2044. Request = /*#__PURE__*/function () {_createClass(Request, [{ key: "setConfig",
  2045. // 设置全局默认配置
  2046. value: function setConfig(customConfig) {
  2047. // 深度合并对象,否则会造成对象深层属性丢失
  2048. this.config = (0, _deepMerge.default)(this.config, customConfig);
  2049. }
  2050. // 主要请求部分
  2051. }, { key: "request", value: function request() {var _this = this;var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  2052. // 检查请求拦截
  2053. if (this.interceptor.request && typeof this.interceptor.request === 'function') {
  2054. var tmpConfig = {};
  2055. var interceptorRequest = this.interceptor.request(options);
  2056. if (interceptorRequest === false) {
  2057. // 返回一个处于pending状态中的Promise,来取消原promise,避免进入then()回调
  2058. return new Promise(function () {});
  2059. }
  2060. this.options = interceptorRequest;
  2061. }
  2062. options.dataType = options.dataType || this.config.dataType;
  2063. options.responseType = options.responseType || this.config.responseType;
  2064. options.url = options.url || '';
  2065. options.params = options.params || {};
  2066. options.header = Object.assign({}, this.config.header, options.header);
  2067. options.method = options.method || this.config.method;
  2068. return new Promise(function (resolve, reject) {
  2069. options.complete = function (response) {
  2070. // 请求返回后,隐藏loading(如果请求返回快的话,可能会没有loading)
  2071. uni.hideLoading();
  2072. // 清除定时器,如果请求回来了,就无需loading
  2073. clearTimeout(_this.config.timer);
  2074. _this.config.timer = null;
  2075. // 判断用户对拦截返回数据的要求,如果originalData为true,返回所有的数据(response)到拦截器,否则只返回response.data
  2076. if (_this.config.originalData) {
  2077. // 判断是否存在拦截器
  2078. if (_this.interceptor.response && typeof _this.interceptor.response === 'function') {
  2079. var resInterceptors = _this.interceptor.response(response);
  2080. // 如果拦截器不返回false,就将拦截器返回的内容给this.$u.post的then回调
  2081. if (resInterceptors !== false) {
  2082. resolve(resInterceptors);
  2083. } else {
  2084. // 如果拦截器返回false,意味着拦截器定义者认为返回有问题,直接接入catch回调
  2085. reject(response);
  2086. }
  2087. } else {
  2088. // 如果要求返回原始数据,就算没有拦截器,也返回最原始的数据
  2089. resolve(response);
  2090. }
  2091. } else {
  2092. if (response.statusCode == 200) {
  2093. if (_this.interceptor.response && typeof _this.interceptor.response === 'function') {
  2094. var _resInterceptors = _this.interceptor.response(response.data);
  2095. if (_resInterceptors !== false) {
  2096. resolve(_resInterceptors);
  2097. } else {
  2098. reject(response.data);
  2099. }
  2100. } else {
  2101. // 如果不是返回原始数据(originalData=false),且没有拦截器的情况下,返回纯数据给then回调
  2102. resolve(response.data);
  2103. }
  2104. } else {
  2105. // 不返回原始数据的情况下,服务器状态码不为200,modal弹框提示
  2106. // if(response.errMsg) {
  2107. // uni.showModal({
  2108. // title: response.errMsg
  2109. // });
  2110. // }
  2111. reject(response);
  2112. }
  2113. }
  2114. };
  2115. // 判断用户传递的URL是否/开头,如果不是,加上/,这里使用了uView的test.js验证库的url()方法
  2116. options.url = _test.default.url(options.url) ? options.url : _this.config.baseUrl + (options.url.indexOf('/') == 0 ?
  2117. options.url : '/' + options.url);
  2118. // 是否显示loading
  2119. // 加一个是否已有timer定时器的判断,否则有两个同时请求的时候,后者会清除前者的定时器id
  2120. // 而没有清除前者的定时器,导致前者超时,一直显示loading
  2121. if (_this.config.showLoading && !_this.config.timer) {
  2122. _this.config.timer = setTimeout(function () {
  2123. uni.showLoading({
  2124. title: _this.config.loadingText,
  2125. mask: _this.config.loadingMask });
  2126. _this.config.timer = null;
  2127. }, _this.config.loadingTime);
  2128. }
  2129. uni.request(options);
  2130. });
  2131. // .catch(res => {
  2132. // // 如果返回reject(),不让其进入this.$u.post().then().catch()后面的catct()
  2133. // // 因为很多人都会忘了写后面的catch(),导致报错捕获不到catch
  2134. // return new Promise(()=>{});
  2135. // })
  2136. } }]);
  2137. function Request() {var _this2 = this;_classCallCheck(this, Request);
  2138. this.config = {
  2139. baseUrl: '', // 请求的根域名
  2140. // 默认的请求头
  2141. header: {},
  2142. method: 'POST',
  2143. // 设置为json,返回后uni.request会对数据进行一次JSON.parse
  2144. dataType: 'json',
  2145. // 此参数无需处理,因为5+和支付宝小程序不支持,默认为text即可
  2146. responseType: 'text',
  2147. showLoading: true, // 是否显示请求中的loading
  2148. loadingText: '请求中...',
  2149. loadingTime: 800, // 在此时间内,请求还没回来的话,就显示加载中动画,单位ms
  2150. timer: null, // 定时器
  2151. originalData: false, // 是否在拦截器中返回服务端的原始数据,见文档说明
  2152. loadingMask: true // 展示loading的时候,是否给一个透明的蒙层,防止触摸穿透
  2153. };
  2154. // 拦截器
  2155. this.interceptor = {
  2156. // 请求前的拦截
  2157. request: null,
  2158. // 请求后的拦截
  2159. response: null };
  2160. // get请求
  2161. this.get = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  2162. return _this2.request({
  2163. method: 'GET',
  2164. url: url,
  2165. header: header,
  2166. data: data });
  2167. };
  2168. // post请求
  2169. this.post = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  2170. return _this2.request({
  2171. url: url,
  2172. method: 'POST',
  2173. header: header,
  2174. data: data });
  2175. };
  2176. // put请求,不支持支付宝小程序(HX2.6.15)
  2177. this.put = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  2178. return _this2.request({
  2179. url: url,
  2180. method: 'PUT',
  2181. header: header,
  2182. data: data });
  2183. };
  2184. // delete请求,不支持支付宝和头条小程序(HX2.6.15)
  2185. this.delete = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  2186. return _this2.request({
  2187. url: url,
  2188. method: 'DELETE',
  2189. header: header,
  2190. data: data });
  2191. };
  2192. }return Request;}();var _default =
  2193. new Request();exports.default = _default;
  2194. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  2195. /***/ }),
  2196. /***/ 15:
  2197. /*!**************************************************************************!*\
  2198. !*** D:/HbuderX-exercise/swim-weapp/uview-ui/libs/function/deepMerge.js ***!
  2199. \**************************************************************************/
  2200. /*! no static exports found */
  2201. /***/ (function(module, exports, __webpack_require__) {
  2202. "use strict";
  2203. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _deepClone = _interopRequireDefault(__webpack_require__(/*! ./deepClone */ 16));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  2204. // JS对象深度合并
  2205. function deepMerge() {var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  2206. target = (0, _deepClone.default)(target);
  2207. if (typeof target !== 'object' || typeof source !== 'object') return false;
  2208. for (var prop in source) {
  2209. if (!source.hasOwnProperty(prop)) continue;
  2210. if (prop in target) {
  2211. if (typeof target[prop] !== 'object') {
  2212. target[prop] = source[prop];
  2213. } else {
  2214. if (typeof source[prop] !== 'object') {
  2215. target[prop] = source[prop];
  2216. } else {
  2217. if (target[prop].concat && source[prop].concat) {
  2218. target[prop] = target[prop].concat(source[prop]);
  2219. } else {
  2220. target[prop] = deepMerge(target[prop], source[prop]);
  2221. }
  2222. }
  2223. }
  2224. } else {
  2225. target[prop] = source[prop];
  2226. }
  2227. }
  2228. return target;
  2229. }var _default =
  2230. deepMerge;exports.default = _default;
  2231. /***/ }),
  2232. /***/ 16:
  2233. /*!**************************************************************************!*\
  2234. !*** D:/HbuderX-exercise/swim-weapp/uview-ui/libs/function/deepClone.js ***!
  2235. \**************************************************************************/
  2236. /*! no static exports found */
  2237. /***/ (function(module, exports, __webpack_require__) {
  2238. "use strict";
  2239. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 判断arr是否为一个数组,返回一个bool值
  2240. function isArray(arr) {
  2241. return Object.prototype.toString.call(arr) === '[object Array]';
  2242. }
  2243. // 深度克隆
  2244. function deepClone(obj) {
  2245. // 对常见的“非”值,直接返回原来值
  2246. if ([null, undefined, NaN, false].includes(obj)) return obj;
  2247. if (typeof obj !== "object" && typeof obj !== 'function') {
  2248. //原始类型直接返回
  2249. return obj;
  2250. }
  2251. var o = isArray(obj) ? [] : {};
  2252. for (var i in obj) {
  2253. if (obj.hasOwnProperty(i)) {
  2254. o[i] = typeof obj[i] === "object" ? deepClone(obj[i]) : obj[i];
  2255. }
  2256. }
  2257. return o;
  2258. }var _default =
  2259. deepClone;exports.default = _default;
  2260. /***/ }),
  2261. /***/ 17:
  2262. /*!*********************************************************************!*\
  2263. !*** D:/HbuderX-exercise/swim-weapp/uview-ui/libs/function/test.js ***!
  2264. \*********************************************************************/
  2265. /*! no static exports found */
  2266. /***/ (function(module, exports, __webpack_require__) {
  2267. "use strict";
  2268. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  2269. * 验证电子邮箱格式
  2270. */
  2271. function email(value) {
  2272. return /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(value);
  2273. }
  2274. /**
  2275. * 验证手机格式
  2276. */
  2277. function mobile(value) {
  2278. return /^1[3-9]\d{9}$/.test(value);
  2279. }
  2280. /**
  2281. * 验证URL格式
  2282. */
  2283. function url(value) {
  2284. return /http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w-.\/?%&=]*)?/.test(value);
  2285. }
  2286. /**
  2287. * 验证日期格式
  2288. */
  2289. function date(value) {
  2290. return !/Invalid|NaN/.test(new Date(value).toString());
  2291. }
  2292. /**
  2293. * 验证ISO类型的日期格式
  2294. */
  2295. function dateISO(value) {
  2296. return /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value);
  2297. }
  2298. /**
  2299. * 验证十进制数字
  2300. */
  2301. function number(value) {
  2302. return /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value);
  2303. }
  2304. /**
  2305. * 验证整数
  2306. */
  2307. function digits(value) {
  2308. return /^\d+$/.test(value);
  2309. }
  2310. /**
  2311. * 验证身份证号码
  2312. */
  2313. function idCard(value) {
  2314. return /^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(
  2315. value);
  2316. }
  2317. /**
  2318. * 是否车牌号
  2319. */
  2320. function carNo(value) {
  2321. // 新能源车牌
  2322. var xreg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF]$)|([DF][A-HJ-NP-Z0-9][0-9]{4}$))/;
  2323. // 旧车牌
  2324. var creg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$/;
  2325. if (value.length === 7) {
  2326. return creg.test(value);
  2327. } else if (value.length === 8) {
  2328. return xreg.test(value);
  2329. } else {
  2330. return false;
  2331. }
  2332. }
  2333. /**
  2334. * 金额,只允许2位小数
  2335. */
  2336. function amount(value) {
  2337. //金额,只允许保留两位小数
  2338. return /^[1-9]\d*(,\d{3})*(\.\d{1,2})?$|^0\.\d{1,2}$/.test(value);
  2339. }
  2340. /**
  2341. * 中文
  2342. */
  2343. function chinese(value) {
  2344. var reg = /^[\u4e00-\u9fa5]+$/gi;
  2345. return reg.test(value);
  2346. }
  2347. /**
  2348. * 只能输入字母
  2349. */
  2350. function letter(value) {
  2351. return /^[a-zA-Z]*$/.test(value);
  2352. }
  2353. /**
  2354. * 只能是字母或者数字
  2355. */
  2356. function enOrNum(value) {
  2357. //英文或者数字
  2358. var reg = /^[0-9a-zA-Z]*$/g;
  2359. return reg.test(value);
  2360. }
  2361. /**
  2362. * 验证是否包含某个值
  2363. */
  2364. function contains(value, param) {
  2365. return value.indexOf(param) >= 0;
  2366. }
  2367. /**
  2368. * 验证一个值范围[min, max]
  2369. */
  2370. function range(value, param) {
  2371. return value >= param[0] && value <= param[1];
  2372. }
  2373. /**
  2374. * 验证一个长度范围[min, max]
  2375. */
  2376. function rangeLength(value, param) {
  2377. return value.length >= param[0] && value.length <= param[1];
  2378. }
  2379. /**
  2380. * 是否固定电话
  2381. */
  2382. function landline(value) {
  2383. var reg = /^\d{3,4}-\d{7,8}(-\d{3,4})?$/;
  2384. return reg.test(value);
  2385. }
  2386. /**
  2387. * 判断是否为空
  2388. */
  2389. function empty(value) {
  2390. switch (typeof value) {
  2391. case 'undefined':
  2392. return true;
  2393. case 'string':
  2394. if (value.replace(/(^[ \t\n\r]*)|([ \t\n\r]*$)/g, '').length == 0) return true;
  2395. break;
  2396. case 'boolean':
  2397. if (!value) return true;
  2398. break;
  2399. case 'number':
  2400. if (0 === value || isNaN(value)) return true;
  2401. break;
  2402. case 'object':
  2403. if (null === value || value.length === 0) return true;
  2404. for (var i in value) {
  2405. return false;
  2406. }
  2407. return true;}
  2408. return false;
  2409. }
  2410. /**
  2411. * 是否json字符串
  2412. */
  2413. function jsonString(value) {
  2414. if (typeof value == 'string') {
  2415. try {
  2416. var obj = JSON.parse(value);
  2417. if (typeof obj == 'object' && obj) {
  2418. return true;
  2419. } else {
  2420. return false;
  2421. }
  2422. } catch (e) {
  2423. return false;
  2424. }
  2425. }
  2426. return false;
  2427. }
  2428. /**
  2429. * 是否数组
  2430. */
  2431. function array(value) {
  2432. if (typeof Array.isArray === "function") {
  2433. return Array.isArray(value);
  2434. } else {
  2435. return Object.prototype.toString.call(value) === "[object Array]";
  2436. }
  2437. }
  2438. /**
  2439. * 是否对象
  2440. */
  2441. function object(value) {
  2442. return Object.prototype.toString.call(value) === '[object Object]';
  2443. }
  2444. /**
  2445. * 是否短信验证码
  2446. */
  2447. function code(value) {var len = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 6;
  2448. return new RegExp("^\\d{".concat(len, "}$")).test(value);
  2449. }var _default =
  2450. {
  2451. email: email,
  2452. mobile: mobile,
  2453. url: url,
  2454. date: date,
  2455. dateISO: dateISO,
  2456. number: number,
  2457. digits: digits,
  2458. idCard: idCard,
  2459. carNo: carNo,
  2460. amount: amount,
  2461. chinese: chinese,
  2462. letter: letter,
  2463. enOrNum: enOrNum,
  2464. contains: contains,
  2465. range: range,
  2466. rangeLength: rangeLength,
  2467. empty: empty,
  2468. isEmpty: empty,
  2469. jsonString: jsonString,
  2470. landline: landline,
  2471. object: object,
  2472. array: array,
  2473. code: code };exports.default = _default;
  2474. /***/ }),
  2475. /***/ 18:
  2476. /*!****************************************************************************!*\
  2477. !*** D:/HbuderX-exercise/swim-weapp/uview-ui/libs/function/queryParams.js ***!
  2478. \****************************************************************************/
  2479. /*! no static exports found */
  2480. /***/ (function(module, exports, __webpack_require__) {
  2481. "use strict";
  2482. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  2483. * 对象转url参数
  2484. * @param {*} data,对象
  2485. * @param {*} isPrefix,是否自动加上"?"
  2486. */
  2487. function queryParams() {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};var isPrefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;var arrayFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'brackets';
  2488. var prefix = isPrefix ? '?' : '';
  2489. var _result = [];
  2490. if (['indices', 'brackets', 'repeat', 'comma'].indexOf(arrayFormat) == -1) arrayFormat = 'brackets';var _loop = function _loop(
  2491. key) {
  2492. var value = data[key];
  2493. // 去掉为空的参数
  2494. if (['', undefined, null].indexOf(value) >= 0) {
  2495. return "continue";
  2496. }
  2497. // 如果值为数组,另行处理
  2498. if (value.constructor === Array) {
  2499. // e.g. {ids: [1, 2, 3]}
  2500. switch (arrayFormat) {
  2501. case 'indices':
  2502. // 结果: ids[0]=1&ids[1]=2&ids[2]=3
  2503. for (var i = 0; i < value.length; i++) {
  2504. _result.push(key + '[' + i + ']=' + value[i]);
  2505. }
  2506. break;
  2507. case 'brackets':
  2508. // 结果: ids[]=1&ids[]=2&ids[]=3
  2509. value.forEach(function (_value) {
  2510. _result.push(key + '[]=' + _value);
  2511. });
  2512. break;
  2513. case 'repeat':
  2514. // 结果: ids=1&ids=2&ids=3
  2515. value.forEach(function (_value) {
  2516. _result.push(key + '=' + _value);
  2517. });
  2518. break;
  2519. case 'comma':
  2520. // 结果: ids=1,2,3
  2521. var commaStr = "";
  2522. value.forEach(function (_value) {
  2523. commaStr += (commaStr ? "," : "") + _value;
  2524. });
  2525. _result.push(key + '=' + commaStr);
  2526. break;
  2527. default:
  2528. value.forEach(function (_value) {
  2529. _result.push(key + '[]=' + _value);
  2530. });}
  2531. } else {
  2532. _result.push(key + '=' + value);
  2533. }};for (var key in data) {var _ret = _loop(key);if (_ret === "continue") continue;
  2534. }
  2535. return _result.length ? prefix + _result.join('&') : '';
  2536. }var _default =
  2537. queryParams;exports.default = _default;
  2538. /***/ }),
  2539. /***/ 19:
  2540. /*!**********************************************************************!*\
  2541. !*** D:/HbuderX-exercise/swim-weapp/uview-ui/libs/function/route.js ***!
  2542. \**********************************************************************/
  2543. /*! no static exports found */
  2544. /***/ (function(module, exports, __webpack_require__) {
  2545. "use strict";
  2546. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _regenerator = _interopRequireDefault(__webpack_require__(/*! ./node_modules/@babel/runtime/regenerator */ 20));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {Promise.resolve(value).then(_next, _throw);}}function _asyncToGenerator(fn) {return function () {var self = this,args = arguments;return new Promise(function (resolve, reject) {var gen = fn.apply(self, args);function _next(value) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);}function _throw(err) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);}_next(undefined);});};}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;} /**
  2547. * 路由跳转方法,该方法相对于直接使用uni.xxx的好处是使用更加简单快捷
  2548. * 并且带有路由拦截功能
  2549. */var
  2550. Router = /*#__PURE__*/function () {
  2551. function Router() {_classCallCheck(this, Router);
  2552. // 原始属性定义
  2553. this.config = {
  2554. type: 'navigateTo',
  2555. url: '',
  2556. delta: 1, // navigateBack页面后退时,回退的层数
  2557. params: {}, // 传递的参数
  2558. animationType: 'pop-in', // 窗口动画,只在APP有效
  2559. animationDuration: 300, // 窗口动画持续时间,单位毫秒,只在APP有效
  2560. intercept: false // 是否需要拦截
  2561. };
  2562. // 因为route方法是需要对外赋值给另外的对象使用,同时route内部有使用this,会导致route失去上下文
  2563. // 这里在构造函数中进行this绑定
  2564. this.route = this.route.bind(this);
  2565. }
  2566. // 判断url前面是否有"/",如果没有则加上,否则无法跳转
  2567. _createClass(Router, [{ key: "addRootPath", value: function addRootPath(url) {
  2568. return url[0] === '/' ? url : "/".concat(url);
  2569. }
  2570. // 整合路由参数
  2571. }, { key: "mixinParam", value: function mixinParam(url, params) {
  2572. url = url && this.addRootPath(url);
  2573. // 使用正则匹配,主要依据是判断是否有"/","?","="等,如“/page/index/index?name=mary"
  2574. // 如果有url中有get参数,转换后无需带上"?"
  2575. var query = '';
  2576. if (/.*\/.*\?.*=.*/.test(url)) {
  2577. // object对象转为get类型的参数
  2578. query = uni.$u.queryParams(params, false);
  2579. // 因为已有get参数,所以后面拼接的参数需要带上"&"隔开
  2580. return url += "&" + query;
  2581. } else {
  2582. // 直接拼接参数,因为此处url中没有后面的query参数,也就没有"?/&"之类的符号
  2583. query = uni.$u.queryParams(params);
  2584. return url += query;
  2585. }
  2586. }
  2587. // 对外的方法名称
  2588. }, { key: "route", value: function () {var _route = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee() {var options,params,mergeConfig,isNext,_args = arguments;return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:options = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};params = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
  2589. // 合并用户的配置和内部的默认配置
  2590. mergeConfig = {};
  2591. if (typeof options === 'string') {
  2592. // 如果options为字符串,则为route(url, params)的形式
  2593. mergeConfig.url = this.mixinParam(options, params);
  2594. mergeConfig.type = 'navigateTo';
  2595. } else {
  2596. mergeConfig = uni.$u.deepClone(options, this.config);
  2597. // 否则正常使用mergeConfig中的url和params进行拼接
  2598. mergeConfig.url = this.mixinParam(options.url, options.params);
  2599. }
  2600. if (params.intercept) {
  2601. this.config.intercept = params.intercept;
  2602. }
  2603. // params参数也带给拦截器
  2604. mergeConfig.params = params;
  2605. // 合并内外部参数
  2606. mergeConfig = uni.$u.deepMerge(this.config, mergeConfig);
  2607. // 判断用户是否定义了拦截器
  2608. if (!(typeof uni.$u.routeIntercept === 'function')) {_context.next = 14;break;}_context.next = 10;return (
  2609. new Promise(function (resolve, reject) {
  2610. uni.$u.routeIntercept(mergeConfig, resolve);
  2611. }));case 10:isNext = _context.sent;
  2612. // 如果isNext为true,则执行路由跳转
  2613. isNext && this.openPage(mergeConfig);_context.next = 15;break;case 14:
  2614. this.openPage(mergeConfig);case 15:case "end":return _context.stop();}}}, _callee, this);}));function route() {return _route.apply(this, arguments);}return route;}()
  2615. // 执行路由跳转
  2616. }, { key: "openPage", value: function openPage(config) {
  2617. // 解构参数
  2618. var
  2619. url =
  2620. config.url,type = config.type,delta = config.delta,animationType = config.animationType,animationDuration = config.animationDuration;
  2621. if (config.type == 'navigateTo' || config.type == 'to') {
  2622. uni.navigateTo({
  2623. url: url,
  2624. animationType: animationType,
  2625. animationDuration: animationDuration });
  2626. }
  2627. if (config.type == 'redirectTo' || config.type == 'redirect') {
  2628. uni.redirectTo({
  2629. url: url });
  2630. }
  2631. if (config.type == 'switchTab' || config.type == 'tab') {
  2632. uni.switchTab({
  2633. url: url });
  2634. }
  2635. if (config.type == 'reLaunch' || config.type == 'launch') {
  2636. uni.reLaunch({
  2637. url: url });
  2638. }
  2639. if (config.type == 'navigateBack' || config.type == 'back') {
  2640. uni.navigateBack({
  2641. delta: delta });
  2642. }
  2643. } }]);return Router;}();var _default =
  2644. new Router().route;exports.default = _default;
  2645. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  2646. /***/ }),
  2647. /***/ 2:
  2648. /*!***********************************!*\
  2649. !*** (webpack)/buildin/global.js ***!
  2650. \***********************************/
  2651. /*! no static exports found */
  2652. /***/ (function(module, exports) {
  2653. var g;
  2654. // This works in non-strict mode
  2655. g = (function() {
  2656. return this;
  2657. })();
  2658. try {
  2659. // This works if eval is allowed (see CSP)
  2660. g = g || new Function("return this")();
  2661. } catch (e) {
  2662. // This works if the window reference is available
  2663. if (typeof window === "object") g = window;
  2664. }
  2665. // g can still be undefined, but nothing to do about it...
  2666. // We return undefined, instead of nothing here, so it's
  2667. // easier to handle this case. if(!global) { ...}
  2668. module.exports = g;
  2669. /***/ }),
  2670. /***/ 20:
  2671. /*!**********************************************************!*\
  2672. !*** ./node_modules/@babel/runtime/regenerator/index.js ***!
  2673. \**********************************************************/
  2674. /*! no static exports found */
  2675. /***/ (function(module, exports, __webpack_require__) {
  2676. module.exports = __webpack_require__(/*! regenerator-runtime */ 21);
  2677. /***/ }),
  2678. /***/ 21:
  2679. /*!************************************************************!*\
  2680. !*** ./node_modules/regenerator-runtime/runtime-module.js ***!
  2681. \************************************************************/
  2682. /*! no static exports found */
  2683. /***/ (function(module, exports, __webpack_require__) {
  2684. /**
  2685. * Copyright (c) 2014-present, Facebook, Inc.
  2686. *
  2687. * This source code is licensed under the MIT license found in the
  2688. * LICENSE file in the root directory of this source tree.
  2689. */
  2690. // This method of obtaining a reference to the global object needs to be
  2691. // kept identical to the way it is obtained in runtime.js
  2692. var g = (function() {
  2693. return this || (typeof self === "object" && self);
  2694. })() || Function("return this")();
  2695. // Use `getOwnPropertyNames` because not all browsers support calling
  2696. // `hasOwnProperty` on the global `self` object in a worker. See #183.
  2697. var hadRuntime = g.regeneratorRuntime &&
  2698. Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0;
  2699. // Save the old regeneratorRuntime in case it needs to be restored later.
  2700. var oldRuntime = hadRuntime && g.regeneratorRuntime;
  2701. // Force reevalutation of runtime.js.
  2702. g.regeneratorRuntime = undefined;
  2703. module.exports = __webpack_require__(/*! ./runtime */ 22);
  2704. if (hadRuntime) {
  2705. // Restore the original runtime.
  2706. g.regeneratorRuntime = oldRuntime;
  2707. } else {
  2708. // Remove the global property added by runtime.js.
  2709. try {
  2710. delete g.regeneratorRuntime;
  2711. } catch(e) {
  2712. g.regeneratorRuntime = undefined;
  2713. }
  2714. }
  2715. /***/ }),
  2716. /***/ 216:
  2717. /*!********************************************************************!*\
  2718. !*** D:/HbuderX-exercise/swim-weapp/uview-ui/libs/util/emitter.js ***!
  2719. \********************************************************************/
  2720. /*! no static exports found */
  2721. /***/ (function(module, exports, __webpack_require__) {
  2722. "use strict";
  2723. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  2724. * 递归使用 call 方式this指向
  2725. * @param componentName // 需要找的组件的名称
  2726. * @param eventName // 事件名称
  2727. * @param params // 需要传递的参数
  2728. */
  2729. function _broadcast(componentName, eventName, params) {
  2730. // 循环子节点找到名称一样的子节点 否则 递归 当前子节点
  2731. this.$children.map(function (child) {
  2732. if (componentName === child.$options.name) {
  2733. child.$emit.apply(child, [eventName].concat(params));
  2734. } else {
  2735. _broadcast.apply(child, [componentName, eventName].concat(params));
  2736. }
  2737. });
  2738. }var _default =
  2739. {
  2740. methods: {
  2741. /**
  2742. * 派发 (向上查找) (一个)
  2743. * @param componentName // 需要找的组件的名称
  2744. * @param eventName // 事件名称
  2745. * @param params // 需要传递的参数
  2746. */
  2747. dispatch: function dispatch(componentName, eventName, params) {
  2748. var parent = this.$parent || this.$root; //$parent 找到最近的父节点 $root 根节点
  2749. var name = parent.$options.name; // 获取当前组件实例的name
  2750. // 如果当前有节点 && 当前没名称 且 当前名称等于需要传进来的名称的时候就去查找当前的节点
  2751. // 循环出当前名称的一样的组件实例
  2752. while (parent && (!name || name !== componentName)) {
  2753. parent = parent.$parent;
  2754. if (parent) {
  2755. name = parent.$options.name;
  2756. }
  2757. }
  2758. // 有节点表示当前找到了name一样的实例
  2759. if (parent) {
  2760. parent.$emit.apply(parent, [eventName].concat(params));
  2761. }
  2762. },
  2763. /**
  2764. * 广播 (向下查找) (广播多个)
  2765. * @param componentName // 需要找的组件的名称
  2766. * @param eventName // 事件名称
  2767. * @param params // 需要传递的参数
  2768. */
  2769. broadcast: function broadcast(componentName, eventName, params) {
  2770. _broadcast.call(this, componentName, eventName, params);
  2771. } } };exports.default = _default;
  2772. /***/ }),
  2773. /***/ 22:
  2774. /*!*****************************************************!*\
  2775. !*** ./node_modules/regenerator-runtime/runtime.js ***!
  2776. \*****************************************************/
  2777. /*! no static exports found */
  2778. /***/ (function(module, exports) {
  2779. /**
  2780. * Copyright (c) 2014-present, Facebook, Inc.
  2781. *
  2782. * This source code is licensed under the MIT license found in the
  2783. * LICENSE file in the root directory of this source tree.
  2784. */
  2785. !(function(global) {
  2786. "use strict";
  2787. var Op = Object.prototype;
  2788. var hasOwn = Op.hasOwnProperty;
  2789. var undefined; // More compressible than void 0.
  2790. var $Symbol = typeof Symbol === "function" ? Symbol : {};
  2791. var iteratorSymbol = $Symbol.iterator || "@@iterator";
  2792. var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
  2793. var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  2794. var inModule = typeof module === "object";
  2795. var runtime = global.regeneratorRuntime;
  2796. if (runtime) {
  2797. if (inModule) {
  2798. // If regeneratorRuntime is defined globally and we're in a module,
  2799. // make the exports object identical to regeneratorRuntime.
  2800. module.exports = runtime;
  2801. }
  2802. // Don't bother evaluating the rest of this file if the runtime was
  2803. // already defined globally.
  2804. return;
  2805. }
  2806. // Define the runtime globally (as expected by generated code) as either
  2807. // module.exports (if we're in a module) or a new, empty object.
  2808. runtime = global.regeneratorRuntime = inModule ? module.exports : {};
  2809. function wrap(innerFn, outerFn, self, tryLocsList) {
  2810. // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
  2811. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
  2812. var generator = Object.create(protoGenerator.prototype);
  2813. var context = new Context(tryLocsList || []);
  2814. // The ._invoke method unifies the implementations of the .next,
  2815. // .throw, and .return methods.
  2816. generator._invoke = makeInvokeMethod(innerFn, self, context);
  2817. return generator;
  2818. }
  2819. runtime.wrap = wrap;
  2820. // Try/catch helper to minimize deoptimizations. Returns a completion
  2821. // record like context.tryEntries[i].completion. This interface could
  2822. // have been (and was previously) designed to take a closure to be
  2823. // invoked without arguments, but in all the cases we care about we
  2824. // already have an existing method we want to call, so there's no need
  2825. // to create a new function object. We can even get away with assuming
  2826. // the method takes exactly one argument, since that happens to be true
  2827. // in every case, so we don't have to touch the arguments object. The
  2828. // only additional allocation required is the completion record, which
  2829. // has a stable shape and so hopefully should be cheap to allocate.
  2830. function tryCatch(fn, obj, arg) {
  2831. try {
  2832. return { type: "normal", arg: fn.call(obj, arg) };
  2833. } catch (err) {
  2834. return { type: "throw", arg: err };
  2835. }
  2836. }
  2837. var GenStateSuspendedStart = "suspendedStart";
  2838. var GenStateSuspendedYield = "suspendedYield";
  2839. var GenStateExecuting = "executing";
  2840. var GenStateCompleted = "completed";
  2841. // Returning this object from the innerFn has the same effect as
  2842. // breaking out of the dispatch switch statement.
  2843. var ContinueSentinel = {};
  2844. // Dummy constructor functions that we use as the .constructor and
  2845. // .constructor.prototype properties for functions that return Generator
  2846. // objects. For full spec compliance, you may wish to configure your
  2847. // minifier not to mangle the names of these two functions.
  2848. function Generator() {}
  2849. function GeneratorFunction() {}
  2850. function GeneratorFunctionPrototype() {}
  2851. // This is a polyfill for %IteratorPrototype% for environments that
  2852. // don't natively support it.
  2853. var IteratorPrototype = {};
  2854. IteratorPrototype[iteratorSymbol] = function () {
  2855. return this;
  2856. };
  2857. var getProto = Object.getPrototypeOf;
  2858. var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  2859. if (NativeIteratorPrototype &&
  2860. NativeIteratorPrototype !== Op &&
  2861. hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
  2862. // This environment has a native %IteratorPrototype%; use it instead
  2863. // of the polyfill.
  2864. IteratorPrototype = NativeIteratorPrototype;
  2865. }
  2866. var Gp = GeneratorFunctionPrototype.prototype =
  2867. Generator.prototype = Object.create(IteratorPrototype);
  2868. GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
  2869. GeneratorFunctionPrototype.constructor = GeneratorFunction;
  2870. GeneratorFunctionPrototype[toStringTagSymbol] =
  2871. GeneratorFunction.displayName = "GeneratorFunction";
  2872. // Helper for defining the .next, .throw, and .return methods of the
  2873. // Iterator interface in terms of a single ._invoke method.
  2874. function defineIteratorMethods(prototype) {
  2875. ["next", "throw", "return"].forEach(function(method) {
  2876. prototype[method] = function(arg) {
  2877. return this._invoke(method, arg);
  2878. };
  2879. });
  2880. }
  2881. runtime.isGeneratorFunction = function(genFun) {
  2882. var ctor = typeof genFun === "function" && genFun.constructor;
  2883. return ctor
  2884. ? ctor === GeneratorFunction ||
  2885. // For the native GeneratorFunction constructor, the best we can
  2886. // do is to check its .name property.
  2887. (ctor.displayName || ctor.name) === "GeneratorFunction"
  2888. : false;
  2889. };
  2890. runtime.mark = function(genFun) {
  2891. if (Object.setPrototypeOf) {
  2892. Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
  2893. } else {
  2894. genFun.__proto__ = GeneratorFunctionPrototype;
  2895. if (!(toStringTagSymbol in genFun)) {
  2896. genFun[toStringTagSymbol] = "GeneratorFunction";
  2897. }
  2898. }
  2899. genFun.prototype = Object.create(Gp);
  2900. return genFun;
  2901. };
  2902. // Within the body of any async function, `await x` is transformed to
  2903. // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
  2904. // `hasOwn.call(value, "__await")` to determine if the yielded value is
  2905. // meant to be awaited.
  2906. runtime.awrap = function(arg) {
  2907. return { __await: arg };
  2908. };
  2909. function AsyncIterator(generator) {
  2910. function invoke(method, arg, resolve, reject) {
  2911. var record = tryCatch(generator[method], generator, arg);
  2912. if (record.type === "throw") {
  2913. reject(record.arg);
  2914. } else {
  2915. var result = record.arg;
  2916. var value = result.value;
  2917. if (value &&
  2918. typeof value === "object" &&
  2919. hasOwn.call(value, "__await")) {
  2920. return Promise.resolve(value.__await).then(function(value) {
  2921. invoke("next", value, resolve, reject);
  2922. }, function(err) {
  2923. invoke("throw", err, resolve, reject);
  2924. });
  2925. }
  2926. return Promise.resolve(value).then(function(unwrapped) {
  2927. // When a yielded Promise is resolved, its final value becomes
  2928. // the .value of the Promise<{value,done}> result for the
  2929. // current iteration.
  2930. result.value = unwrapped;
  2931. resolve(result);
  2932. }, function(error) {
  2933. // If a rejected Promise was yielded, throw the rejection back
  2934. // into the async generator function so it can be handled there.
  2935. return invoke("throw", error, resolve, reject);
  2936. });
  2937. }
  2938. }
  2939. var previousPromise;
  2940. function enqueue(method, arg) {
  2941. function callInvokeWithMethodAndArg() {
  2942. return new Promise(function(resolve, reject) {
  2943. invoke(method, arg, resolve, reject);
  2944. });
  2945. }
  2946. return previousPromise =
  2947. // If enqueue has been called before, then we want to wait until
  2948. // all previous Promises have been resolved before calling invoke,
  2949. // so that results are always delivered in the correct order. If
  2950. // enqueue has not been called before, then it is important to
  2951. // call invoke immediately, without waiting on a callback to fire,
  2952. // so that the async generator function has the opportunity to do
  2953. // any necessary setup in a predictable way. This predictability
  2954. // is why the Promise constructor synchronously invokes its
  2955. // executor callback, and why async functions synchronously
  2956. // execute code before the first await. Since we implement simple
  2957. // async functions in terms of async generators, it is especially
  2958. // important to get this right, even though it requires care.
  2959. previousPromise ? previousPromise.then(
  2960. callInvokeWithMethodAndArg,
  2961. // Avoid propagating failures to Promises returned by later
  2962. // invocations of the iterator.
  2963. callInvokeWithMethodAndArg
  2964. ) : callInvokeWithMethodAndArg();
  2965. }
  2966. // Define the unified helper method that is used to implement .next,
  2967. // .throw, and .return (see defineIteratorMethods).
  2968. this._invoke = enqueue;
  2969. }
  2970. defineIteratorMethods(AsyncIterator.prototype);
  2971. AsyncIterator.prototype[asyncIteratorSymbol] = function () {
  2972. return this;
  2973. };
  2974. runtime.AsyncIterator = AsyncIterator;
  2975. // Note that simple async functions are implemented on top of
  2976. // AsyncIterator objects; they just return a Promise for the value of
  2977. // the final result produced by the iterator.
  2978. runtime.async = function(innerFn, outerFn, self, tryLocsList) {
  2979. var iter = new AsyncIterator(
  2980. wrap(innerFn, outerFn, self, tryLocsList)
  2981. );
  2982. return runtime.isGeneratorFunction(outerFn)
  2983. ? iter // If outerFn is a generator, return the full iterator.
  2984. : iter.next().then(function(result) {
  2985. return result.done ? result.value : iter.next();
  2986. });
  2987. };
  2988. function makeInvokeMethod(innerFn, self, context) {
  2989. var state = GenStateSuspendedStart;
  2990. return function invoke(method, arg) {
  2991. if (state === GenStateExecuting) {
  2992. throw new Error("Generator is already running");
  2993. }
  2994. if (state === GenStateCompleted) {
  2995. if (method === "throw") {
  2996. throw arg;
  2997. }
  2998. // Be forgiving, per 25.3.3.3.3 of the spec:
  2999. // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
  3000. return doneResult();
  3001. }
  3002. context.method = method;
  3003. context.arg = arg;
  3004. while (true) {
  3005. var delegate = context.delegate;
  3006. if (delegate) {
  3007. var delegateResult = maybeInvokeDelegate(delegate, context);
  3008. if (delegateResult) {
  3009. if (delegateResult === ContinueSentinel) continue;
  3010. return delegateResult;
  3011. }
  3012. }
  3013. if (context.method === "next") {
  3014. // Setting context._sent for legacy support of Babel's
  3015. // function.sent implementation.
  3016. context.sent = context._sent = context.arg;
  3017. } else if (context.method === "throw") {
  3018. if (state === GenStateSuspendedStart) {
  3019. state = GenStateCompleted;
  3020. throw context.arg;
  3021. }
  3022. context.dispatchException(context.arg);
  3023. } else if (context.method === "return") {
  3024. context.abrupt("return", context.arg);
  3025. }
  3026. state = GenStateExecuting;
  3027. var record = tryCatch(innerFn, self, context);
  3028. if (record.type === "normal") {
  3029. // If an exception is thrown from innerFn, we leave state ===
  3030. // GenStateExecuting and loop back for another invocation.
  3031. state = context.done
  3032. ? GenStateCompleted
  3033. : GenStateSuspendedYield;
  3034. if (record.arg === ContinueSentinel) {
  3035. continue;
  3036. }
  3037. return {
  3038. value: record.arg,
  3039. done: context.done
  3040. };
  3041. } else if (record.type === "throw") {
  3042. state = GenStateCompleted;
  3043. // Dispatch the exception by looping back around to the
  3044. // context.dispatchException(context.arg) call above.
  3045. context.method = "throw";
  3046. context.arg = record.arg;
  3047. }
  3048. }
  3049. };
  3050. }
  3051. // Call delegate.iterator[context.method](context.arg) and handle the
  3052. // result, either by returning a { value, done } result from the
  3053. // delegate iterator, or by modifying context.method and context.arg,
  3054. // setting context.delegate to null, and returning the ContinueSentinel.
  3055. function maybeInvokeDelegate(delegate, context) {
  3056. var method = delegate.iterator[context.method];
  3057. if (method === undefined) {
  3058. // A .throw or .return when the delegate iterator has no .throw
  3059. // method always terminates the yield* loop.
  3060. context.delegate = null;
  3061. if (context.method === "throw") {
  3062. if (delegate.iterator.return) {
  3063. // If the delegate iterator has a return method, give it a
  3064. // chance to clean up.
  3065. context.method = "return";
  3066. context.arg = undefined;
  3067. maybeInvokeDelegate(delegate, context);
  3068. if (context.method === "throw") {
  3069. // If maybeInvokeDelegate(context) changed context.method from
  3070. // "return" to "throw", let that override the TypeError below.
  3071. return ContinueSentinel;
  3072. }
  3073. }
  3074. context.method = "throw";
  3075. context.arg = new TypeError(
  3076. "The iterator does not provide a 'throw' method");
  3077. }
  3078. return ContinueSentinel;
  3079. }
  3080. var record = tryCatch(method, delegate.iterator, context.arg);
  3081. if (record.type === "throw") {
  3082. context.method = "throw";
  3083. context.arg = record.arg;
  3084. context.delegate = null;
  3085. return ContinueSentinel;
  3086. }
  3087. var info = record.arg;
  3088. if (! info) {
  3089. context.method = "throw";
  3090. context.arg = new TypeError("iterator result is not an object");
  3091. context.delegate = null;
  3092. return ContinueSentinel;
  3093. }
  3094. if (info.done) {
  3095. // Assign the result of the finished delegate to the temporary
  3096. // variable specified by delegate.resultName (see delegateYield).
  3097. context[delegate.resultName] = info.value;
  3098. // Resume execution at the desired location (see delegateYield).
  3099. context.next = delegate.nextLoc;
  3100. // If context.method was "throw" but the delegate handled the
  3101. // exception, let the outer generator proceed normally. If
  3102. // context.method was "next", forget context.arg since it has been
  3103. // "consumed" by the delegate iterator. If context.method was
  3104. // "return", allow the original .return call to continue in the
  3105. // outer generator.
  3106. if (context.method !== "return") {
  3107. context.method = "next";
  3108. context.arg = undefined;
  3109. }
  3110. } else {
  3111. // Re-yield the result returned by the delegate method.
  3112. return info;
  3113. }
  3114. // The delegate iterator is finished, so forget it and continue with
  3115. // the outer generator.
  3116. context.delegate = null;
  3117. return ContinueSentinel;
  3118. }
  3119. // Define Generator.prototype.{next,throw,return} in terms of the
  3120. // unified ._invoke helper method.
  3121. defineIteratorMethods(Gp);
  3122. Gp[toStringTagSymbol] = "Generator";
  3123. // A Generator should always return itself as the iterator object when the
  3124. // @@iterator function is called on it. Some browsers' implementations of the
  3125. // iterator prototype chain incorrectly implement this, causing the Generator
  3126. // object to not be returned from this call. This ensures that doesn't happen.
  3127. // See https://github.com/facebook/regenerator/issues/274 for more details.
  3128. Gp[iteratorSymbol] = function() {
  3129. return this;
  3130. };
  3131. Gp.toString = function() {
  3132. return "[object Generator]";
  3133. };
  3134. function pushTryEntry(locs) {
  3135. var entry = { tryLoc: locs[0] };
  3136. if (1 in locs) {
  3137. entry.catchLoc = locs[1];
  3138. }
  3139. if (2 in locs) {
  3140. entry.finallyLoc = locs[2];
  3141. entry.afterLoc = locs[3];
  3142. }
  3143. this.tryEntries.push(entry);
  3144. }
  3145. function resetTryEntry(entry) {
  3146. var record = entry.completion || {};
  3147. record.type = "normal";
  3148. delete record.arg;
  3149. entry.completion = record;
  3150. }
  3151. function Context(tryLocsList) {
  3152. // The root entry object (effectively a try statement without a catch
  3153. // or a finally block) gives us a place to store values thrown from
  3154. // locations where there is no enclosing try statement.
  3155. this.tryEntries = [{ tryLoc: "root" }];
  3156. tryLocsList.forEach(pushTryEntry, this);
  3157. this.reset(true);
  3158. }
  3159. runtime.keys = function(object) {
  3160. var keys = [];
  3161. for (var key in object) {
  3162. keys.push(key);
  3163. }
  3164. keys.reverse();
  3165. // Rather than returning an object with a next method, we keep
  3166. // things simple and return the next function itself.
  3167. return function next() {
  3168. while (keys.length) {
  3169. var key = keys.pop();
  3170. if (key in object) {
  3171. next.value = key;
  3172. next.done = false;
  3173. return next;
  3174. }
  3175. }
  3176. // To avoid creating an additional object, we just hang the .value
  3177. // and .done properties off the next function object itself. This
  3178. // also ensures that the minifier will not anonymize the function.
  3179. next.done = true;
  3180. return next;
  3181. };
  3182. };
  3183. function values(iterable) {
  3184. if (iterable) {
  3185. var iteratorMethod = iterable[iteratorSymbol];
  3186. if (iteratorMethod) {
  3187. return iteratorMethod.call(iterable);
  3188. }
  3189. if (typeof iterable.next === "function") {
  3190. return iterable;
  3191. }
  3192. if (!isNaN(iterable.length)) {
  3193. var i = -1, next = function next() {
  3194. while (++i < iterable.length) {
  3195. if (hasOwn.call(iterable, i)) {
  3196. next.value = iterable[i];
  3197. next.done = false;
  3198. return next;
  3199. }
  3200. }
  3201. next.value = undefined;
  3202. next.done = true;
  3203. return next;
  3204. };
  3205. return next.next = next;
  3206. }
  3207. }
  3208. // Return an iterator with no values.
  3209. return { next: doneResult };
  3210. }
  3211. runtime.values = values;
  3212. function doneResult() {
  3213. return { value: undefined, done: true };
  3214. }
  3215. Context.prototype = {
  3216. constructor: Context,
  3217. reset: function(skipTempReset) {
  3218. this.prev = 0;
  3219. this.next = 0;
  3220. // Resetting context._sent for legacy support of Babel's
  3221. // function.sent implementation.
  3222. this.sent = this._sent = undefined;
  3223. this.done = false;
  3224. this.delegate = null;
  3225. this.method = "next";
  3226. this.arg = undefined;
  3227. this.tryEntries.forEach(resetTryEntry);
  3228. if (!skipTempReset) {
  3229. for (var name in this) {
  3230. // Not sure about the optimal order of these conditions:
  3231. if (name.charAt(0) === "t" &&
  3232. hasOwn.call(this, name) &&
  3233. !isNaN(+name.slice(1))) {
  3234. this[name] = undefined;
  3235. }
  3236. }
  3237. }
  3238. },
  3239. stop: function() {
  3240. this.done = true;
  3241. var rootEntry = this.tryEntries[0];
  3242. var rootRecord = rootEntry.completion;
  3243. if (rootRecord.type === "throw") {
  3244. throw rootRecord.arg;
  3245. }
  3246. return this.rval;
  3247. },
  3248. dispatchException: function(exception) {
  3249. if (this.done) {
  3250. throw exception;
  3251. }
  3252. var context = this;
  3253. function handle(loc, caught) {
  3254. record.type = "throw";
  3255. record.arg = exception;
  3256. context.next = loc;
  3257. if (caught) {
  3258. // If the dispatched exception was caught by a catch block,
  3259. // then let that catch block handle the exception normally.
  3260. context.method = "next";
  3261. context.arg = undefined;
  3262. }
  3263. return !! caught;
  3264. }
  3265. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  3266. var entry = this.tryEntries[i];
  3267. var record = entry.completion;
  3268. if (entry.tryLoc === "root") {
  3269. // Exception thrown outside of any try block that could handle
  3270. // it, so set the completion value of the entire function to
  3271. // throw the exception.
  3272. return handle("end");
  3273. }
  3274. if (entry.tryLoc <= this.prev) {
  3275. var hasCatch = hasOwn.call(entry, "catchLoc");
  3276. var hasFinally = hasOwn.call(entry, "finallyLoc");
  3277. if (hasCatch && hasFinally) {
  3278. if (this.prev < entry.catchLoc) {
  3279. return handle(entry.catchLoc, true);
  3280. } else if (this.prev < entry.finallyLoc) {
  3281. return handle(entry.finallyLoc);
  3282. }
  3283. } else if (hasCatch) {
  3284. if (this.prev < entry.catchLoc) {
  3285. return handle(entry.catchLoc, true);
  3286. }
  3287. } else if (hasFinally) {
  3288. if (this.prev < entry.finallyLoc) {
  3289. return handle(entry.finallyLoc);
  3290. }
  3291. } else {
  3292. throw new Error("try statement without catch or finally");
  3293. }
  3294. }
  3295. }
  3296. },
  3297. abrupt: function(type, arg) {
  3298. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  3299. var entry = this.tryEntries[i];
  3300. if (entry.tryLoc <= this.prev &&
  3301. hasOwn.call(entry, "finallyLoc") &&
  3302. this.prev < entry.finallyLoc) {
  3303. var finallyEntry = entry;
  3304. break;
  3305. }
  3306. }
  3307. if (finallyEntry &&
  3308. (type === "break" ||
  3309. type === "continue") &&
  3310. finallyEntry.tryLoc <= arg &&
  3311. arg <= finallyEntry.finallyLoc) {
  3312. // Ignore the finally entry if control is not jumping to a
  3313. // location outside the try/catch block.
  3314. finallyEntry = null;
  3315. }
  3316. var record = finallyEntry ? finallyEntry.completion : {};
  3317. record.type = type;
  3318. record.arg = arg;
  3319. if (finallyEntry) {
  3320. this.method = "next";
  3321. this.next = finallyEntry.finallyLoc;
  3322. return ContinueSentinel;
  3323. }
  3324. return this.complete(record);
  3325. },
  3326. complete: function(record, afterLoc) {
  3327. if (record.type === "throw") {
  3328. throw record.arg;
  3329. }
  3330. if (record.type === "break" ||
  3331. record.type === "continue") {
  3332. this.next = record.arg;
  3333. } else if (record.type === "return") {
  3334. this.rval = this.arg = record.arg;
  3335. this.method = "return";
  3336. this.next = "end";
  3337. } else if (record.type === "normal" && afterLoc) {
  3338. this.next = afterLoc;
  3339. }
  3340. return ContinueSentinel;
  3341. },
  3342. finish: function(finallyLoc) {
  3343. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  3344. var entry = this.tryEntries[i];
  3345. if (entry.finallyLoc === finallyLoc) {
  3346. this.complete(entry.completion, entry.afterLoc);
  3347. resetTryEntry(entry);
  3348. return ContinueSentinel;
  3349. }
  3350. }
  3351. },
  3352. "catch": function(tryLoc) {
  3353. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  3354. var entry = this.tryEntries[i];
  3355. if (entry.tryLoc === tryLoc) {
  3356. var record = entry.completion;
  3357. if (record.type === "throw") {
  3358. var thrown = record.arg;
  3359. resetTryEntry(entry);
  3360. }
  3361. return thrown;
  3362. }
  3363. }
  3364. // The context.catch method must only be called with a location
  3365. // argument that corresponds to a known catch block.
  3366. throw new Error("illegal catch attempt");
  3367. },
  3368. delegateYield: function(iterable, resultName, nextLoc) {
  3369. this.delegate = {
  3370. iterator: values(iterable),
  3371. resultName: resultName,
  3372. nextLoc: nextLoc
  3373. };
  3374. if (this.method === "next") {
  3375. // Deliberately forget the last sent value so that we don't
  3376. // accidentally pass it on to the delegate.
  3377. this.arg = undefined;
  3378. }
  3379. return ContinueSentinel;
  3380. }
  3381. };
  3382. })(
  3383. // In sloppy mode, unbound `this` refers to the global object, fallback to
  3384. // Function constructor if we're in global strict mode. That is sadly a form
  3385. // of indirect eval which violates Content Security Policy.
  3386. (function() {
  3387. return this || (typeof self === "object" && self);
  3388. })() || Function("return this")()
  3389. );
  3390. /***/ }),
  3391. /***/ 23:
  3392. /*!***************************************************************************!*\
  3393. !*** D:/HbuderX-exercise/swim-weapp/uview-ui/libs/function/timeFormat.js ***!
  3394. \***************************************************************************/
  3395. /*! no static exports found */
  3396. /***/ (function(module, exports, __webpack_require__) {
  3397. "use strict";
  3398. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // padStart 的 polyfill,因为某些机型或情况,还无法支持es7的padStart,比如电脑版的微信小程序
  3399. // 所以这里做一个兼容polyfill的兼容处理
  3400. if (!String.prototype.padStart) {
  3401. // 为了方便表示这里 fillString 用了ES6 的默认参数,不影响理解
  3402. String.prototype.padStart = function (maxLength) {var fillString = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ' ';
  3403. if (Object.prototype.toString.call(fillString) !== "[object String]") throw new TypeError(
  3404. 'fillString must be String');
  3405. var str = this;
  3406. // 返回 String(str) 这里是为了使返回的值是字符串字面量,在控制台中更符合直觉
  3407. if (str.length >= maxLength) return String(str);
  3408. var fillLength = maxLength - str.length,
  3409. times = Math.ceil(fillLength / fillString.length);
  3410. while (times >>= 1) {
  3411. fillString += fillString;
  3412. if (times === 1) {
  3413. fillString += fillString;
  3414. }
  3415. }
  3416. return fillString.slice(0, fillLength) + str;
  3417. };
  3418. }
  3419. // 其他更多是格式化有如下:
  3420. // yyyy:mm:dd|yyyy:mm|yyyy年mm月dd日|yyyy年mm月dd日 hh时MM分等,可自定义组合
  3421. function timeFormat() {var dateTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;var fmt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-mm-dd';
  3422. // 如果为null,则格式化当前时间
  3423. if (!dateTime) dateTime = Number(new Date());
  3424. // 如果dateTime长度为10或者13,则为秒和毫秒的时间戳,如果超过13位,则为其他的时间格式
  3425. if (dateTime.toString().length == 10) dateTime *= 1000;
  3426. var date = new Date(dateTime);
  3427. var ret;
  3428. var opt = {
  3429. "y+": date.getFullYear().toString(), // 年
  3430. "m+": (date.getMonth() + 1).toString(), // 月
  3431. "d+": date.getDate().toString(), // 日
  3432. "h+": date.getHours().toString(), // 时
  3433. "M+": date.getMinutes().toString(), // 分
  3434. "s+": date.getSeconds().toString() // 秒
  3435. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  3436. };
  3437. for (var k in opt) {
  3438. ret = new RegExp("(" + k + ")").exec(fmt);
  3439. if (ret) {
  3440. fmt = fmt.replace(ret[1], ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, "0"));
  3441. };
  3442. };
  3443. return fmt;
  3444. }var _default =
  3445. timeFormat;exports.default = _default;
  3446. /***/ }),
  3447. /***/ 24:
  3448. /*!*************************************************************************!*\
  3449. !*** D:/HbuderX-exercise/swim-weapp/uview-ui/libs/function/timeFrom.js ***!
  3450. \*************************************************************************/
  3451. /*! no static exports found */
  3452. /***/ (function(module, exports, __webpack_require__) {
  3453. "use strict";
  3454. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _timeFormat = _interopRequireDefault(__webpack_require__(/*! ../../libs/function/timeFormat.js */ 23));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  3455. /**
  3456. * 时间戳转为多久之前
  3457. * @param String timestamp 时间戳
  3458. * @param String | Boolean format 如果为时间格式字符串,超出一定时间范围,返回固定的时间格式;
  3459. * 如果为布尔值false,无论什么时间,都返回多久以前的格式
  3460. */
  3461. function timeFrom() {var dateTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-mm-dd';
  3462. // 如果为null,则格式化当前时间
  3463. if (!dateTime) dateTime = Number(new Date());
  3464. // 如果dateTime长度为10或者13,则为秒和毫秒的时间戳,如果超过13位,则为其他的时间格式
  3465. if (dateTime.toString().length == 10) dateTime *= 1000;
  3466. var timestamp = +new Date(Number(dateTime));
  3467. var timer = (Number(new Date()) - timestamp) / 1000;
  3468. // 如果小于5分钟,则返回"刚刚",其他以此类推
  3469. var tips = '';
  3470. switch (true) {
  3471. case timer < 300:
  3472. tips = '刚刚';
  3473. break;
  3474. case timer >= 300 && timer < 3600:
  3475. tips = parseInt(timer / 60) + '分钟前';
  3476. break;
  3477. case timer >= 3600 && timer < 86400:
  3478. tips = parseInt(timer / 3600) + '小时前';
  3479. break;
  3480. case timer >= 86400 && timer < 2592000:
  3481. tips = parseInt(timer / 86400) + '天前';
  3482. break;
  3483. default:
  3484. // 如果format为false,则无论什么时间戳,都显示xx之前
  3485. if (format === false) {
  3486. if (timer >= 2592000 && timer < 365 * 86400) {
  3487. tips = parseInt(timer / (86400 * 30)) + '个月前';
  3488. } else {
  3489. tips = parseInt(timer / (86400 * 365)) + '年前';
  3490. }
  3491. } else {
  3492. tips = (0, _timeFormat.default)(timestamp, format);
  3493. }}
  3494. return tips;
  3495. }var _default =
  3496. timeFrom;exports.default = _default;
  3497. /***/ }),
  3498. /***/ 25:
  3499. /*!******************************************************************************!*\
  3500. !*** D:/HbuderX-exercise/swim-weapp/uview-ui/libs/function/colorGradient.js ***!
  3501. \******************************************************************************/
  3502. /*! no static exports found */
  3503. /***/ (function(module, exports, __webpack_require__) {
  3504. "use strict";
  3505. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  3506. * 求两个颜色之间的渐变值
  3507. * @param {string} startColor 开始的颜色
  3508. * @param {string} endColor 结束的颜色
  3509. * @param {number} step 颜色等分的份额
  3510. * */
  3511. function colorGradient() {var startColor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'rgb(0, 0, 0)';var endColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'rgb(255, 255, 255)';var step = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 10;
  3512. var startRGB = hexToRgb(startColor, false); //转换为rgb数组模式
  3513. var startR = startRGB[0];
  3514. var startG = startRGB[1];
  3515. var startB = startRGB[2];
  3516. var endRGB = hexToRgb(endColor, false);
  3517. var endR = endRGB[0];
  3518. var endG = endRGB[1];
  3519. var endB = endRGB[2];
  3520. var sR = (endR - startR) / step; //总差值
  3521. var sG = (endG - startG) / step;
  3522. var sB = (endB - startB) / step;
  3523. var colorArr = [];
  3524. for (var i = 0; i < step; i++) {
  3525. //计算每一步的hex值
  3526. var hex = rgbToHex('rgb(' + Math.round(sR * i + startR) + ',' + Math.round(sG * i + startG) + ',' + Math.round(sB *
  3527. i + startB) + ')');
  3528. colorArr.push(hex);
  3529. }
  3530. return colorArr;
  3531. }
  3532. // 将hex表示方式转换为rgb表示方式(这里返回rgb数组模式)
  3533. function hexToRgb(sColor) {var str = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  3534. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  3535. sColor = sColor.toLowerCase();
  3536. if (sColor && reg.test(sColor)) {
  3537. if (sColor.length === 4) {
  3538. var sColorNew = "#";
  3539. for (var i = 1; i < 4; i += 1) {
  3540. sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
  3541. }
  3542. sColor = sColorNew;
  3543. }
  3544. //处理六位的颜色值
  3545. var sColorChange = [];
  3546. for (var _i = 1; _i < 7; _i += 2) {
  3547. sColorChange.push(parseInt("0x" + sColor.slice(_i, _i + 2)));
  3548. }
  3549. if (!str) {
  3550. return sColorChange;
  3551. } else {
  3552. return "rgb(".concat(sColorChange[0], ",").concat(sColorChange[1], ",").concat(sColorChange[2], ")");
  3553. }
  3554. } else if (/^(rgb|RGB)/.test(sColor)) {
  3555. var arr = sColor.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
  3556. return arr.map(function (val) {return Number(val);});
  3557. } else {
  3558. return sColor;
  3559. }
  3560. };
  3561. // 将rgb表示方式转换为hex表示方式
  3562. function rgbToHex(rgb) {
  3563. var _this = rgb;
  3564. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  3565. if (/^(rgb|RGB)/.test(_this)) {
  3566. var aColor = _this.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
  3567. var strHex = "#";
  3568. for (var i = 0; i < aColor.length; i++) {
  3569. var hex = Number(aColor[i]).toString(16);
  3570. hex = String(hex).length == 1 ? 0 + '' + hex : hex; // 保证每个rgb的值为2位
  3571. if (hex === "0") {
  3572. hex += hex;
  3573. }
  3574. strHex += hex;
  3575. }
  3576. if (strHex.length !== 7) {
  3577. strHex = _this;
  3578. }
  3579. return strHex;
  3580. } else if (reg.test(_this)) {
  3581. var aNum = _this.replace(/#/, "").split("");
  3582. if (aNum.length === 6) {
  3583. return _this;
  3584. } else if (aNum.length === 3) {
  3585. var numHex = "#";
  3586. for (var _i2 = 0; _i2 < aNum.length; _i2 += 1) {
  3587. numHex += aNum[_i2] + aNum[_i2];
  3588. }
  3589. return numHex;
  3590. }
  3591. } else {
  3592. return _this;
  3593. }
  3594. }
  3595. /**
  3596. * JS颜色十六进制转换为rgb或rgba,返回的格式为 rgba(255,255,255,0.5)字符串
  3597. * sHex为传入的十六进制的色值
  3598. * alpha为rgba的透明度
  3599. */
  3600. function colorToRgba(color) {var alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.3;
  3601. color = rgbToHex(color);
  3602. // 十六进制颜色值的正则表达式
  3603. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  3604. /* 16进制颜色转为RGB格式 */
  3605. var sColor = color.toLowerCase();
  3606. if (sColor && reg.test(sColor)) {
  3607. if (sColor.length === 4) {
  3608. var sColorNew = '#';
  3609. for (var i = 1; i < 4; i += 1) {
  3610. sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
  3611. }
  3612. sColor = sColorNew;
  3613. }
  3614. // 处理六位的颜色值
  3615. var sColorChange = [];
  3616. for (var _i3 = 1; _i3 < 7; _i3 += 2) {
  3617. sColorChange.push(parseInt('0x' + sColor.slice(_i3, _i3 + 2)));
  3618. }
  3619. // return sColorChange.join(',')
  3620. return 'rgba(' + sColorChange.join(',') + ',' + alpha + ')';
  3621. } else
  3622. {
  3623. return sColor;
  3624. }
  3625. }var _default =
  3626. {
  3627. colorGradient: colorGradient,
  3628. hexToRgb: hexToRgb,
  3629. rgbToHex: rgbToHex,
  3630. colorToRgba: colorToRgba };exports.default = _default;
  3631. /***/ }),
  3632. /***/ 26:
  3633. /*!*********************************************************************!*\
  3634. !*** D:/HbuderX-exercise/swim-weapp/uview-ui/libs/function/guid.js ***!
  3635. \*********************************************************************/
  3636. /*! no static exports found */
  3637. /***/ (function(module, exports, __webpack_require__) {
  3638. "use strict";
  3639. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  3640. * 本算法来源于简书开源代码,详见:https://www.jianshu.com/p/fdbf293d0a85
  3641. * 全局唯一标识符(uuid,Globally Unique Identifier),也称作 uuid(Universally Unique IDentifier)
  3642. * 一般用于多个组件之间,给它一个唯一的标识符,或者v-for循环的时候,如果使用数组的index可能会导致更新列表出现问题
  3643. * 最可能的情况是左滑删除item或者对某条信息流"不喜欢"并去掉它的时候,会导致组件内的数据可能出现错乱
  3644. * v-for的时候,推荐使用后端返回的id而不是循环的index
  3645. * @param {Number} len uuid的长度
  3646. * @param {Boolean} firstU 将返回的首字母置为"u"
  3647. * @param {Nubmer} radix 生成uuid的基数(意味着返回的字符串都是这个基数),2-二进制,8-八进制,10-十进制,16-十六进制
  3648. */
  3649. function guid() {var len = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 32;var firstU = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;var radix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  3650. var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
  3651. var uuid = [];
  3652. radix = radix || chars.length;
  3653. if (len) {
  3654. // 如果指定uuid长度,只是取随机的字符,0|x为位运算,能去掉x的小数位,返回整数位
  3655. for (var i = 0; i < len; i++) {uuid[i] = chars[0 | Math.random() * radix];}
  3656. } else {
  3657. var r;
  3658. // rfc4122标准要求返回的uuid中,某些位为固定的字符
  3659. uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
  3660. uuid[14] = '4';
  3661. for (var _i = 0; _i < 36; _i++) {
  3662. if (!uuid[_i]) {
  3663. r = 0 | Math.random() * 16;
  3664. uuid[_i] = chars[_i == 19 ? r & 0x3 | 0x8 : r];
  3665. }
  3666. }
  3667. }
  3668. // 移除第一个字符,并用u替代,因为第一个字符为数值时,该guuid不能用作id或者class
  3669. if (firstU) {
  3670. uuid.shift();
  3671. return 'u' + uuid.join('');
  3672. } else {
  3673. return uuid.join('');
  3674. }
  3675. }var _default =
  3676. guid;exports.default = _default;
  3677. /***/ }),
  3678. /***/ 266:
  3679. /*!***************************************************************************************!*\
  3680. !*** D:/HbuderX-exercise/swim-weapp/uview-ui/components/u-parse/libs/MpHtmlParser.js ***!
  3681. \***************************************************************************************/
  3682. /*! no static exports found */
  3683. /***/ (function(module, exports, __webpack_require__) {
  3684. /* WEBPACK VAR INJECTION */(function(uni) {/**
  3685. * html 解析器
  3686. * @tutorial https://github.com/jin-yufeng/Parser
  3687. * @version 20201029
  3688. * @author JinYufeng
  3689. * @listens MIT
  3690. */
  3691. var cfg = __webpack_require__(/*! ./config.js */ 267),
  3692. blankChar = cfg.blankChar,
  3693. CssHandler = __webpack_require__(/*! ./CssHandler.js */ 268),
  3694. windowWidth = uni.getSystemInfoSync().windowWidth;
  3695. var emoji;
  3696. function MpHtmlParser(data) {var _this = this;var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  3697. this.attrs = {};
  3698. this.CssHandler = new CssHandler(options.tagStyle, windowWidth);
  3699. this.data = data;
  3700. this.domain = options.domain;
  3701. this.DOM = [];
  3702. this.i = this.start = this.audioNum = this.imgNum = this.videoNum = 0;
  3703. options.prot = (this.domain || '').includes('://') ? this.domain.split('://')[0] : 'http';
  3704. this.options = options;
  3705. this.state = this.Text;
  3706. this.STACK = [];
  3707. // 工具函数
  3708. this.bubble = function () {
  3709. for (var i = _this.STACK.length, item; item = _this.STACK[--i];) {
  3710. if (cfg.richOnlyTags[item.name]) return false;
  3711. item.c = 1;
  3712. }
  3713. return true;
  3714. };
  3715. this.decode = function (val, amp) {
  3716. var i = -1,
  3717. j,en;
  3718. while (1) {
  3719. if ((i = val.indexOf('&', i + 1)) == -1) break;
  3720. if ((j = val.indexOf(';', i + 2)) == -1) break;
  3721. if (val[i + 1] == '#') {
  3722. en = parseInt((val[i + 2] == 'x' ? '0' : '') + val.substring(i + 2, j));
  3723. if (!isNaN(en)) val = val.substr(0, i) + String.fromCharCode(en) + val.substr(j + 1);
  3724. } else {
  3725. en = val.substring(i + 1, j);
  3726. if (cfg.entities[en] || en == amp)
  3727. val = val.substr(0, i) + (cfg.entities[en] || '&') + val.substr(j + 1);
  3728. }
  3729. }
  3730. return val;
  3731. };
  3732. this.getUrl = function (url) {
  3733. if (url[0] == '/') {
  3734. if (url[1] == '/') url = _this.options.prot + ':' + url;else
  3735. if (_this.domain) url = _this.domain + url;
  3736. } else if (_this.domain && url.indexOf('data:') != 0 && !url.includes('://'))
  3737. url = _this.domain + '/' + url;
  3738. return url;
  3739. };
  3740. this.isClose = function () {return _this.data[_this.i] == '>' || _this.data[_this.i] == '/' && _this.data[_this.i + 1] == '>';};
  3741. this.section = function () {return _this.data.substring(_this.start, _this.i);};
  3742. this.parent = function () {return _this.STACK[_this.STACK.length - 1];};
  3743. this.siblings = function () {return _this.STACK.length ? _this.parent().children : _this.DOM;};
  3744. }
  3745. MpHtmlParser.prototype.parse = function () {
  3746. if (emoji) this.data = emoji.parseEmoji(this.data);
  3747. for (var c; c = this.data[this.i]; this.i++) {
  3748. this.state(c);}
  3749. if (this.state == this.Text) this.setText();
  3750. while (this.STACK.length) {this.popNode(this.STACK.pop());}
  3751. return this.DOM;
  3752. };
  3753. // 设置属性
  3754. MpHtmlParser.prototype.setAttr = function () {
  3755. var name = this.attrName.toLowerCase(),
  3756. val = this.attrVal;
  3757. if (cfg.boolAttrs[name]) this.attrs[name] = 'T';else
  3758. if (val) {
  3759. if (name == 'src' || name == 'data-src' && !this.attrs.src) this.attrs.src = this.getUrl(this.decode(val, 'amp'));else
  3760. if (name == 'href' || name == 'style') this.attrs[name] = this.decode(val, 'amp');else
  3761. if (name.substr(0, 5) != 'data-') this.attrs[name] = val;
  3762. }
  3763. this.attrVal = '';
  3764. while (blankChar[this.data[this.i]]) {this.i++;}
  3765. if (this.isClose()) this.setNode();else
  3766. {
  3767. this.start = this.i;
  3768. this.state = this.AttrName;
  3769. }
  3770. };
  3771. // 设置文本节点
  3772. MpHtmlParser.prototype.setText = function () {
  3773. var back,text = this.section();
  3774. if (!text) return;
  3775. text = cfg.onText && cfg.onText(text, function () {return back = true;}) || text;
  3776. if (back) {
  3777. this.data = this.data.substr(0, this.start) + text + this.data.substr(this.i);
  3778. var j = this.start + text.length;
  3779. for (this.i = this.start; this.i < j; this.i++) {this.state(this.data[this.i]);}
  3780. return;
  3781. }
  3782. if (!this.pre) {
  3783. // 合并空白符
  3784. var flag,tmp = [];
  3785. for (var i = text.length, c; c = text[--i];) {
  3786. if (!blankChar[c]) {
  3787. tmp.unshift(c);
  3788. if (!flag) flag = 1;
  3789. } else {
  3790. if (tmp[0] != ' ') tmp.unshift(' ');
  3791. if (c == '\n' && flag == void 0) flag = 0;
  3792. }}
  3793. if (flag == 0) return;
  3794. text = tmp.join('');
  3795. }
  3796. this.siblings().push({
  3797. type: 'text',
  3798. text: this.decode(text) });
  3799. };
  3800. // 设置元素节点
  3801. MpHtmlParser.prototype.setNode = function () {
  3802. var node = {
  3803. name: this.tagName.toLowerCase(),
  3804. attrs: this.attrs },
  3805. close = cfg.selfClosingTags[node.name];
  3806. if (this.options.nodes.length) node.type = 'node';
  3807. this.attrs = {};
  3808. if (!cfg.ignoreTags[node.name]) {
  3809. // 处理属性
  3810. var attrs = node.attrs,
  3811. style = this.CssHandler.match(node.name, attrs, node) + (attrs.style || ''),
  3812. styleObj = {};
  3813. if (attrs.id) {
  3814. if (this.options.compress & 1) attrs.id = void 0;else
  3815. if (this.options.useAnchor) this.bubble();
  3816. }
  3817. if (this.options.compress & 2 && attrs.class) attrs.class = void 0;
  3818. switch (node.name) {
  3819. case 'a':
  3820. case 'ad':
  3821. this.bubble();
  3822. break;
  3823. case 'font':
  3824. if (attrs.color) {
  3825. styleObj['color'] = attrs.color;
  3826. attrs.color = void 0;
  3827. }
  3828. if (attrs.face) {
  3829. styleObj['font-family'] = attrs.face;
  3830. attrs.face = void 0;
  3831. }
  3832. if (attrs.size) {
  3833. var size = parseInt(attrs.size);
  3834. if (size < 1) size = 1;else
  3835. if (size > 7) size = 7;
  3836. var map = ['xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'];
  3837. styleObj['font-size'] = map[size - 1];
  3838. attrs.size = void 0;
  3839. }
  3840. break;
  3841. case 'embed':
  3842. var src = node.attrs.src || '',
  3843. type = node.attrs.type || '';
  3844. if (type.includes('video') || src.includes('.mp4') || src.includes('.3gp') || src.includes('.m3u8'))
  3845. node.name = 'video';else
  3846. if (type.includes('audio') || src.includes('.m4a') || src.includes('.wav') || src.includes('.mp3') || src.includes(
  3847. '.aac'))
  3848. node.name = 'audio';else
  3849. break;
  3850. if (node.attrs.autostart)
  3851. node.attrs.autoplay = 'T';
  3852. node.attrs.controls = 'T';
  3853. case 'video':
  3854. case 'audio':
  3855. if (!attrs.id) attrs.id = node.name + ++this["".concat(node.name, "Num")];else
  3856. this["".concat(node.name, "Num")]++;
  3857. if (node.name == 'video') {
  3858. if (this.videoNum > 3)
  3859. node.lazyLoad = 1;
  3860. if (attrs.width) {
  3861. styleObj.width = parseFloat(attrs.width) + (attrs.width.includes('%') ? '%' : 'px');
  3862. attrs.width = void 0;
  3863. }
  3864. if (attrs.height) {
  3865. styleObj.height = parseFloat(attrs.height) + (attrs.height.includes('%') ? '%' : 'px');
  3866. attrs.height = void 0;
  3867. }
  3868. }
  3869. if (!attrs.controls && !attrs.autoplay) attrs.controls = 'T';
  3870. attrs.source = [];
  3871. if (attrs.src) {
  3872. attrs.source.push(attrs.src);
  3873. attrs.src = void 0;
  3874. }
  3875. this.bubble();
  3876. break;
  3877. case 'td':
  3878. case 'th':
  3879. if (attrs.colspan || attrs.rowspan)
  3880. for (var k = this.STACK.length, item; item = this.STACK[--k];) {
  3881. if (item.name == 'table') {
  3882. item.flag = 1;
  3883. break;
  3884. }}}
  3885. if (attrs.align) {
  3886. if (node.name == 'table') {
  3887. if (attrs.align == 'center') styleObj['margin-inline-start'] = styleObj['margin-inline-end'] = 'auto';else
  3888. styleObj['float'] = attrs.align;
  3889. } else styleObj['text-align'] = attrs.align;
  3890. attrs.align = void 0;
  3891. }
  3892. // 压缩 style
  3893. var styles = style.split(';');
  3894. style = '';
  3895. for (var i = 0, len = styles.length; i < len; i++) {
  3896. var info = styles[i].split(':');
  3897. if (info.length < 2) continue;
  3898. var _key = info[0].trim().toLowerCase(),
  3899. _value = info.slice(1).join(':').trim();
  3900. if (_value[0] == '-' || _value.includes('safe'))
  3901. style += ";".concat(_key, ":").concat(_value);else
  3902. if (!styleObj[_key] || _value.includes('import') || !styleObj[_key].includes('import'))
  3903. styleObj[_key] = _value;
  3904. }
  3905. if (node.name == 'img') {
  3906. if (attrs.src && !attrs.ignore) {
  3907. if (this.bubble())
  3908. attrs.i = (this.imgNum++).toString();else
  3909. attrs.ignore = 'T';
  3910. }
  3911. if (attrs.ignore) {
  3912. style += ';-webkit-touch-callout:none';
  3913. styleObj['max-width'] = '100%';
  3914. }
  3915. var width;
  3916. if (styleObj.width) width = styleObj.width;else
  3917. if (attrs.width) width = attrs.width.includes('%') ? attrs.width : parseFloat(attrs.width) + 'px';
  3918. if (width) {
  3919. styleObj.width = width;
  3920. attrs.width = '100%';
  3921. if (parseInt(width) > windowWidth) {
  3922. styleObj.height = '';
  3923. if (attrs.height) attrs.height = void 0;
  3924. }
  3925. }
  3926. if (styleObj.height) {
  3927. attrs.height = styleObj.height;
  3928. styleObj.height = '';
  3929. } else if (attrs.height && !attrs.height.includes('%'))
  3930. attrs.height = parseFloat(attrs.height) + 'px';
  3931. }
  3932. for (var key in styleObj) {
  3933. var value = styleObj[key];
  3934. if (!value) continue;
  3935. if (key.includes('flex') || key == 'order' || key == 'self-align') node.c = 1;
  3936. // 填充链接
  3937. if (value.includes('url')) {
  3938. var j = value.indexOf('(');
  3939. if (j++ != -1) {
  3940. while (value[j] == '"' || value[j] == "'" || blankChar[value[j]]) {j++;}
  3941. value = value.substr(0, j) + this.getUrl(value.substr(j));
  3942. }
  3943. }
  3944. // 转换 rpx
  3945. else if (value.includes('rpx'))
  3946. value = value.replace(/[0-9.]+\s*rpx/g, function ($) {return parseFloat($) * windowWidth / 750 + 'px';});else
  3947. if (key == 'white-space' && value.includes('pre') && !close)
  3948. this.pre = node.pre = true;
  3949. style += ";".concat(key, ":").concat(value);
  3950. }
  3951. style = style.substr(1);
  3952. if (style) attrs.style = style;
  3953. if (!close) {
  3954. node.children = [];
  3955. if (node.name == 'pre' && cfg.highlight) {
  3956. this.remove(node);
  3957. this.pre = node.pre = true;
  3958. }
  3959. this.siblings().push(node);
  3960. this.STACK.push(node);
  3961. } else if (!cfg.filter || cfg.filter(node, this) != false)
  3962. this.siblings().push(node);
  3963. } else {
  3964. if (!close) this.remove(node);else
  3965. if (node.name == 'source') {
  3966. var parent = this.parent();
  3967. if (parent && (parent.name == 'video' || parent.name == 'audio') && node.attrs.src)
  3968. parent.attrs.source.push(node.attrs.src);
  3969. } else if (node.name == 'base' && !this.domain) this.domain = node.attrs.href;
  3970. }
  3971. if (this.data[this.i] == '/') this.i++;
  3972. this.start = this.i + 1;
  3973. this.state = this.Text;
  3974. };
  3975. // 移除标签
  3976. MpHtmlParser.prototype.remove = function (node) {var _this2 = this;
  3977. var name = node.name,
  3978. j = this.i;
  3979. // 处理 svg
  3980. var handleSvg = function handleSvg() {
  3981. var src = _this2.data.substring(j, _this2.i + 1);
  3982. node.attrs.xmlns = 'http://www.w3.org/2000/svg';
  3983. for (var key in node.attrs) {
  3984. if (key == 'viewbox') src = " viewBox=\"".concat(node.attrs.viewbox, "\"") + src;else
  3985. if (key != 'style') src = " ".concat(key, "=\"").concat(node.attrs[key], "\"") + src;
  3986. }
  3987. src = '<svg' + src;
  3988. var parent = _this2.parent();
  3989. if (node.attrs.width == '100%' && parent && (parent.attrs.style || '').includes('inline'))
  3990. parent.attrs.style = 'width:300px;max-width:100%;' + parent.attrs.style;
  3991. _this2.siblings().push({
  3992. name: 'img',
  3993. attrs: {
  3994. src: 'data:image/svg+xml;utf8,' + src.replace(/#/g, '%23'),
  3995. style: node.attrs.style,
  3996. ignore: 'T' } });
  3997. };
  3998. if (node.name == 'svg' && this.data[j] == '/') return handleSvg(this.i++);
  3999. while (1) {
  4000. if ((this.i = this.data.indexOf('</', this.i + 1)) == -1) {
  4001. if (name == 'pre' || name == 'svg') this.i = j;else
  4002. this.i = this.data.length;
  4003. return;
  4004. }
  4005. this.start = this.i += 2;
  4006. while (!blankChar[this.data[this.i]] && !this.isClose()) {this.i++;}
  4007. if (this.section().toLowerCase() == name) {
  4008. // 代码块高亮
  4009. if (name == 'pre') {
  4010. this.data = this.data.substr(0, j + 1) + cfg.highlight(this.data.substring(j + 1, this.i - 5), node.attrs) + this.data.
  4011. substr(this.i - 5);
  4012. return this.i = j;
  4013. } else if (name == 'style')
  4014. this.CssHandler.getStyle(this.data.substring(j + 1, this.i - 7));else
  4015. if (name == 'title')
  4016. this.DOM.title = this.data.substring(j + 1, this.i - 7);
  4017. if ((this.i = this.data.indexOf('>', this.i)) == -1) this.i = this.data.length;
  4018. if (name == 'svg') handleSvg();
  4019. return;
  4020. }
  4021. }
  4022. };
  4023. // 节点出栈处理
  4024. MpHtmlParser.prototype.popNode = function (node) {
  4025. // 空白符处理
  4026. if (node.pre) {
  4027. node.pre = this.pre = void 0;
  4028. for (var i = this.STACK.length; i--;) {
  4029. if (this.STACK[i].pre)
  4030. this.pre = true;}
  4031. }
  4032. var siblings = this.siblings(),
  4033. len = siblings.length,
  4034. childs = node.children;
  4035. if (node.name == 'head' || cfg.filter && cfg.filter(node, this) == false)
  4036. return siblings.pop();
  4037. var attrs = node.attrs;
  4038. // 替换一些标签名
  4039. if (cfg.blockTags[node.name]) node.name = 'div';else
  4040. if (!cfg.trustTags[node.name]) node.name = 'span';
  4041. // 处理列表
  4042. if (node.c && (node.name == 'ul' || node.name == 'ol')) {
  4043. if ((node.attrs.style || '').includes('list-style:none')) {
  4044. for (var _i = 0, child; child = childs[_i++];) {
  4045. if (child.name == 'li')
  4046. child.name = 'div';}
  4047. } else if (node.name == 'ul') {
  4048. var floor = 1;
  4049. for (var _i2 = this.STACK.length; _i2--;) {
  4050. if (this.STACK[_i2].name == 'ul') floor++;}
  4051. if (floor != 1)
  4052. for (var _i3 = childs.length; _i3--;) {
  4053. childs[_i3].floor = floor;}
  4054. } else {
  4055. for (var _i4 = 0, num = 1, _child; _child = childs[_i4++];) {
  4056. if (_child.name == 'li') {
  4057. _child.type = 'ol';
  4058. _child.num = function (num, type) {
  4059. if (type == 'a') return String.fromCharCode(97 + (num - 1) % 26);
  4060. if (type == 'A') return String.fromCharCode(65 + (num - 1) % 26);
  4061. if (type == 'i' || type == 'I') {
  4062. num = (num - 1) % 99 + 1;
  4063. var one = ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX'],
  4064. ten = ['X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC'],
  4065. res = (ten[Math.floor(num / 10) - 1] || '') + (one[num % 10 - 1] || '');
  4066. if (type == 'i') return res.toLowerCase();
  4067. return res;
  4068. }
  4069. return num;
  4070. }(num++, attrs.type) + '.';
  4071. }}
  4072. }
  4073. }
  4074. // 处理表格
  4075. if (node.name == 'table') {
  4076. var padding = parseFloat(attrs.cellpadding),
  4077. spacing = parseFloat(attrs.cellspacing),
  4078. border = parseFloat(attrs.border);
  4079. if (node.c) {
  4080. if (isNaN(padding)) padding = 2;
  4081. if (isNaN(spacing)) spacing = 2;
  4082. }
  4083. if (border) attrs.style = "border:".concat(border, "px solid gray;").concat(attrs.style || '');
  4084. if (node.flag && node.c) {
  4085. // 有 colspan 或 rowspan 且含有链接的表格转为 grid 布局实现
  4086. attrs.style = "".concat(attrs.style || '', ";").concat(spacing ? ";grid-gap:".concat(spacing, "px") : ';border-left:0;border-top:0');
  4087. var row = 1,
  4088. col = 1,
  4089. colNum,
  4090. trs = [],
  4091. children = [],
  4092. map = {};
  4093. (function f(ns) {
  4094. for (var i = 0; i < ns.length; i++) {
  4095. if (ns[i].name == 'tr') trs.push(ns[i]);else
  4096. f(ns[i].children || []);
  4097. }
  4098. })(node.children);
  4099. for (var _i5 = 0; _i5 < trs.length; _i5++) {
  4100. for (var j = 0, td; td = trs[_i5].children[j]; j++) {
  4101. if (td.name == 'td' || td.name == 'th') {
  4102. while (map[row + '.' + col]) {col++;}
  4103. var cell = {
  4104. name: 'div',
  4105. c: 1,
  4106. attrs: {
  4107. style: (td.attrs.style || '') + (border ? ";border:".concat(border, "px solid gray") + (spacing ? '' :
  4108. ';border-right:0;border-bottom:0') : '') + (padding ? ";padding:".concat(padding, "px") : '') },
  4109. children: td.children };
  4110. if (td.attrs.colspan) {
  4111. cell.attrs.style += ';grid-column-start:' + col + ';grid-column-end:' + (col + parseInt(td.attrs.colspan));
  4112. if (!td.attrs.rowspan) cell.attrs.style += ';grid-row-start:' + row + ';grid-row-end:' + (row + 1);
  4113. col += parseInt(td.attrs.colspan) - 1;
  4114. }
  4115. if (td.attrs.rowspan) {
  4116. cell.attrs.style += ';grid-row-start:' + row + ';grid-row-end:' + (row + parseInt(td.attrs.rowspan));
  4117. if (!td.attrs.colspan) cell.attrs.style += ';grid-column-start:' + col + ';grid-column-end:' + (col + 1);
  4118. for (var k = 1; k < td.attrs.rowspan; k++) {map[row + k + '.' + col] = 1;}
  4119. }
  4120. children.push(cell);
  4121. col++;
  4122. }
  4123. }
  4124. if (!colNum) {
  4125. colNum = col - 1;
  4126. attrs.style += ";grid-template-columns:repeat(".concat(colNum, ",auto)");
  4127. }
  4128. col = 1;
  4129. row++;
  4130. }
  4131. node.children = children;
  4132. } else {
  4133. attrs.style = "border-spacing:".concat(spacing, "px;").concat(attrs.style || '');
  4134. if (border || padding)
  4135. (function f(ns) {
  4136. for (var i = 0, n; n = ns[i]; i++) {
  4137. if (n.name == 'th' || n.name == 'td') {
  4138. if (border) n.attrs.style = "border:".concat(border, "px solid gray;").concat(n.attrs.style || '');
  4139. if (padding) n.attrs.style = "padding:".concat(padding, "px;").concat(n.attrs.style || '');
  4140. } else f(n.children || []);
  4141. }
  4142. })(childs);
  4143. }
  4144. if (this.options.autoscroll) {
  4145. var table = Object.assign({}, node);
  4146. node.name = 'div';
  4147. node.attrs = {
  4148. style: 'overflow:scroll' };
  4149. node.children = [table];
  4150. }
  4151. }
  4152. this.CssHandler.pop && this.CssHandler.pop(node);
  4153. // 自动压缩
  4154. if (node.name == 'div' && !Object.keys(attrs).length && childs.length == 1 && childs[0].name == 'div')
  4155. siblings[len - 1] = childs[0];
  4156. };
  4157. // 状态机
  4158. MpHtmlParser.prototype.Text = function (c) {
  4159. if (c == '<') {
  4160. var next = this.data[this.i + 1],
  4161. isLetter = function isLetter(c) {return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z';};
  4162. if (isLetter(next)) {
  4163. this.setText();
  4164. this.start = this.i + 1;
  4165. this.state = this.TagName;
  4166. } else if (next == '/') {
  4167. this.setText();
  4168. if (isLetter(this.data[++this.i + 1])) {
  4169. this.start = this.i + 1;
  4170. this.state = this.EndTag;
  4171. } else this.Comment();
  4172. } else if (next == '!' || next == '?') {
  4173. this.setText();
  4174. this.Comment();
  4175. }
  4176. }
  4177. };
  4178. MpHtmlParser.prototype.Comment = function () {
  4179. var key;
  4180. if (this.data.substring(this.i + 2, this.i + 4) == '--') key = '-->';else
  4181. if (this.data.substring(this.i + 2, this.i + 9) == '[CDATA[') key = ']]>';else
  4182. key = '>';
  4183. if ((this.i = this.data.indexOf(key, this.i + 2)) == -1) this.i = this.data.length;else
  4184. this.i += key.length - 1;
  4185. this.start = this.i + 1;
  4186. this.state = this.Text;
  4187. };
  4188. MpHtmlParser.prototype.TagName = function (c) {
  4189. if (blankChar[c]) {
  4190. this.tagName = this.section();
  4191. while (blankChar[this.data[this.i]]) {this.i++;}
  4192. if (this.isClose()) this.setNode();else
  4193. {
  4194. this.start = this.i;
  4195. this.state = this.AttrName;
  4196. }
  4197. } else if (this.isClose()) {
  4198. this.tagName = this.section();
  4199. this.setNode();
  4200. }
  4201. };
  4202. MpHtmlParser.prototype.AttrName = function (c) {
  4203. if (c == '=' || blankChar[c] || this.isClose()) {
  4204. this.attrName = this.section();
  4205. if (blankChar[c])
  4206. while (blankChar[this.data[++this.i]]) {;}
  4207. if (this.data[this.i] == '=') {
  4208. while (blankChar[this.data[++this.i]]) {;}
  4209. this.start = this.i--;
  4210. this.state = this.AttrValue;
  4211. } else this.setAttr();
  4212. }
  4213. };
  4214. MpHtmlParser.prototype.AttrValue = function (c) {
  4215. if (c == '"' || c == "'") {
  4216. this.start++;
  4217. if ((this.i = this.data.indexOf(c, this.i + 1)) == -1) return this.i = this.data.length;
  4218. this.attrVal = this.section();
  4219. this.i++;
  4220. } else {
  4221. for (; !blankChar[this.data[this.i]] && !this.isClose(); this.i++) {;}
  4222. this.attrVal = this.section();
  4223. }
  4224. this.setAttr();
  4225. };
  4226. MpHtmlParser.prototype.EndTag = function (c) {
  4227. if (blankChar[c] || c == '>' || c == '/') {
  4228. var name = this.section().toLowerCase();
  4229. for (var i = this.STACK.length; i--;) {
  4230. if (this.STACK[i].name == name) break;}
  4231. if (i != -1) {
  4232. var node;
  4233. while ((node = this.STACK.pop()).name != name) {this.popNode(node);}
  4234. this.popNode(node);
  4235. } else if (name == 'p' || name == 'br')
  4236. this.siblings().push({
  4237. name: name,
  4238. attrs: {} });
  4239. this.i = this.data.indexOf('>', this.i);
  4240. this.start = this.i + 1;
  4241. if (this.i == -1) this.i = this.data.length;else
  4242. this.state = this.Text;
  4243. }
  4244. };
  4245. module.exports = MpHtmlParser;
  4246. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  4247. /***/ }),
  4248. /***/ 267:
  4249. /*!*********************************************************************************!*\
  4250. !*** D:/HbuderX-exercise/swim-weapp/uview-ui/components/u-parse/libs/config.js ***!
  4251. \*********************************************************************************/
  4252. /*! no static exports found */
  4253. /***/ (function(module, exports) {
  4254. /* 配置文件 */
  4255. var cfg = {
  4256. // 出错占位图
  4257. errorImg: null,
  4258. // 过滤器函数
  4259. filter: null,
  4260. // 代码高亮函数
  4261. highlight: null,
  4262. // 文本处理函数
  4263. onText: null,
  4264. // 实体编码列表
  4265. entities: {
  4266. quot: '"',
  4267. apos: "'",
  4268. semi: ';',
  4269. nbsp: '\xA0',
  4270. ensp: "\u2002",
  4271. emsp: "\u2003",
  4272. ndash: '–',
  4273. mdash: '—',
  4274. middot: '·',
  4275. lsquo: '‘',
  4276. rsquo: '’',
  4277. ldquo: '“',
  4278. rdquo: '”',
  4279. bull: '•',
  4280. hellip: '…' },
  4281. blankChar: makeMap(' ,\xA0,\t,\r,\n,\f'),
  4282. boolAttrs: makeMap('allowfullscreen,autoplay,autostart,controls,ignore,loop,muted'),
  4283. // 块级标签,将被转为 div
  4284. blockTags: makeMap('address,article,aside,body,caption,center,cite,footer,header,html,nav,pre,section'),
  4285. // 将被移除的标签
  4286. ignoreTags: makeMap('area,base,canvas,frame,iframe,input,link,map,meta,param,script,source,style,svg,textarea,title,track,wbr'),
  4287. // 只能被 rich-text 显示的标签
  4288. richOnlyTags: makeMap('a,colgroup,fieldset,legend'),
  4289. // 自闭合的标签
  4290. selfClosingTags: makeMap('area,base,br,col,circle,ellipse,embed,frame,hr,img,input,line,link,meta,param,path,polygon,rect,source,track,use,wbr'),
  4291. // 信任的标签
  4292. trustTags: makeMap('a,abbr,ad,audio,b,blockquote,br,code,col,colgroup,dd,del,dl,dt,div,em,fieldset,h1,h2,h3,h4,h5,h6,hr,i,img,ins,label,legend,li,ol,p,q,source,span,strong,sub,sup,table,tbody,td,tfoot,th,thead,tr,title,ul,video'),
  4293. // 默认的标签样式
  4294. userAgentStyles: {
  4295. address: 'font-style:italic',
  4296. big: 'display:inline;font-size:1.2em',
  4297. blockquote: 'background-color:#f6f6f6;border-left:3px solid #dbdbdb;color:#6c6c6c;padding:5px 0 5px 10px',
  4298. caption: 'display:table-caption;text-align:center',
  4299. center: 'text-align:center',
  4300. cite: 'font-style:italic',
  4301. dd: 'margin-left:40px',
  4302. mark: 'background-color:yellow',
  4303. pre: 'font-family:monospace;white-space:pre;overflow:scroll',
  4304. s: 'text-decoration:line-through',
  4305. small: 'display:inline;font-size:0.8em',
  4306. u: 'text-decoration:underline' } };
  4307. function makeMap(str) {
  4308. var map = Object.create(null),
  4309. list = str.split(',');
  4310. for (var i = list.length; i--;) {
  4311. map[list[i]] = true;}
  4312. return map;
  4313. }
  4314. if (wx.canIUse('editor')) {
  4315. cfg.blockTags.pre = void 0;
  4316. cfg.ignoreTags.rp = true;
  4317. Object.assign(cfg.richOnlyTags, makeMap('bdi,bdo,caption,rt,ruby'));
  4318. Object.assign(cfg.trustTags, makeMap('bdi,bdo,caption,pre,rt,ruby'));
  4319. }
  4320. module.exports = cfg;
  4321. /***/ }),
  4322. /***/ 268:
  4323. /*!*************************************************************************************!*\
  4324. !*** D:/HbuderX-exercise/swim-weapp/uview-ui/components/u-parse/libs/CssHandler.js ***!
  4325. \*************************************************************************************/
  4326. /*! no static exports found */
  4327. /***/ (function(module, exports, __webpack_require__) {
  4328. var cfg = __webpack_require__(/*! ./config.js */ 267),
  4329. isLetter = function isLetter(c) {return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z';};
  4330. function CssHandler(tagStyle) {
  4331. var styles = Object.assign(Object.create(null), cfg.userAgentStyles);
  4332. for (var item in tagStyle) {
  4333. styles[item] = (styles[item] ? styles[item] + ';' : '') + tagStyle[item];}
  4334. this.styles = styles;
  4335. }
  4336. CssHandler.prototype.getStyle = function (data) {
  4337. this.styles = new parser(data, this.styles).parse();
  4338. };
  4339. CssHandler.prototype.match = function (name, attrs) {
  4340. var tmp,matched = (tmp = this.styles[name]) ? tmp + ';' : '';
  4341. if (attrs.class) {
  4342. var items = attrs.class.split(' ');
  4343. for (var i = 0, item; item = items[i]; i++) {
  4344. if (tmp = this.styles['.' + item])
  4345. matched += tmp + ';';}
  4346. }
  4347. if (tmp = this.styles['#' + attrs.id])
  4348. matched += tmp + ';';
  4349. return matched;
  4350. };
  4351. module.exports = CssHandler;
  4352. function parser(data, init) {
  4353. this.data = data;
  4354. this.floor = 0;
  4355. this.i = 0;
  4356. this.list = [];
  4357. this.res = init;
  4358. this.state = this.Space;
  4359. }
  4360. parser.prototype.parse = function () {
  4361. for (var c; c = this.data[this.i]; this.i++) {
  4362. this.state(c);}
  4363. return this.res;
  4364. };
  4365. parser.prototype.section = function () {
  4366. return this.data.substring(this.start, this.i);
  4367. };
  4368. // 状态机
  4369. parser.prototype.Space = function (c) {
  4370. if (c == '.' || c == '#' || isLetter(c)) {
  4371. this.start = this.i;
  4372. this.state = this.Name;
  4373. } else if (c == '/' && this.data[this.i + 1] == '*')
  4374. this.Comment();else
  4375. if (!cfg.blankChar[c] && c != ';')
  4376. this.state = this.Ignore;
  4377. };
  4378. parser.prototype.Comment = function () {
  4379. this.i = this.data.indexOf('*/', this.i) + 1;
  4380. if (!this.i) this.i = this.data.length;
  4381. this.state = this.Space;
  4382. };
  4383. parser.prototype.Ignore = function (c) {
  4384. if (c == '{') this.floor++;else
  4385. if (c == '}' && ! --this.floor) {
  4386. this.list = [];
  4387. this.state = this.Space;
  4388. }
  4389. };
  4390. parser.prototype.Name = function (c) {
  4391. if (cfg.blankChar[c]) {
  4392. this.list.push(this.section());
  4393. this.state = this.NameSpace;
  4394. } else if (c == '{') {
  4395. this.list.push(this.section());
  4396. this.Content();
  4397. } else if (c == ',') {
  4398. this.list.push(this.section());
  4399. this.Comma();
  4400. } else if (!isLetter(c) && (c < '0' || c > '9') && c != '-' && c != '_')
  4401. this.state = this.Ignore;
  4402. };
  4403. parser.prototype.NameSpace = function (c) {
  4404. if (c == '{') this.Content();else
  4405. if (c == ',') this.Comma();else
  4406. if (!cfg.blankChar[c]) this.state = this.Ignore;
  4407. };
  4408. parser.prototype.Comma = function () {
  4409. while (cfg.blankChar[this.data[++this.i]]) {;}
  4410. if (this.data[this.i] == '{') this.Content();else
  4411. {
  4412. this.start = this.i--;
  4413. this.state = this.Name;
  4414. }
  4415. };
  4416. parser.prototype.Content = function () {
  4417. this.start = ++this.i;
  4418. if ((this.i = this.data.indexOf('}', this.i)) == -1) this.i = this.data.length;
  4419. var content = this.section();
  4420. for (var i = 0, item; item = this.list[i++];) {
  4421. if (this.res[item]) this.res[item] += ';' + content;else
  4422. this.res[item] = content;}
  4423. this.list = [];
  4424. this.state = this.Space;
  4425. };
  4426. /***/ }),
  4427. /***/ 27:
  4428. /*!**********************************************************************!*\
  4429. !*** D:/HbuderX-exercise/swim-weapp/uview-ui/libs/function/color.js ***!
  4430. \**********************************************************************/
  4431. /*! no static exports found */
  4432. /***/ (function(module, exports, __webpack_require__) {
  4433. "use strict";
  4434. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 为了让用户能够自定义主题,会逐步弃用此文件,各颜色通过css提供
  4435. // 为了给某些特殊场景使用和向后兼容,无需删除此文件(2020-06-20)
  4436. var color = {
  4437. primary: "#2979ff",
  4438. primaryDark: "#2b85e4",
  4439. primaryDisabled: "#a0cfff",
  4440. primaryLight: "#ecf5ff",
  4441. bgColor: "#f3f4f6",
  4442. info: "#909399",
  4443. infoDark: "#82848a",
  4444. infoDisabled: "#c8c9cc",
  4445. infoLight: "#f4f4f5",
  4446. warning: "#ff9900",
  4447. warningDark: "#f29100",
  4448. warningDisabled: "#fcbd71",
  4449. warningLight: "#fdf6ec",
  4450. error: "#fa3534",
  4451. errorDark: "#dd6161",
  4452. errorDisabled: "#fab6b6",
  4453. errorLight: "#fef0f0",
  4454. success: "#19be6b",
  4455. successDark: "#18b566",
  4456. successDisabled: "#71d5a1",
  4457. successLight: "#dbf1e1",
  4458. mainColor: "#303133",
  4459. contentColor: "#606266",
  4460. tipsColor: "#909399",
  4461. lightColor: "#c0c4cc",
  4462. borderColor: "#e4e7ed" };var _default =
  4463. color;exports.default = _default;
  4464. /***/ }),
  4465. /***/ 28:
  4466. /*!**************************************************************************!*\
  4467. !*** D:/HbuderX-exercise/swim-weapp/uview-ui/libs/function/type2icon.js ***!
  4468. \**************************************************************************/
  4469. /*! no static exports found */
  4470. /***/ (function(module, exports, __webpack_require__) {
  4471. "use strict";
  4472. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  4473. * 根据主题type值,获取对应的图标
  4474. * @param String type 主题名称,primary|info|error|warning|success
  4475. * @param String fill 是否使用fill填充实体的图标
  4476. */
  4477. function type2icon() {var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'success';var fill = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  4478. // 如果非预置值,默认为success
  4479. if (['primary', 'info', 'error', 'warning', 'success'].indexOf(type) == -1) type = 'success';
  4480. var iconName = '';
  4481. // 目前(2019-12-12),info和primary使用同一个图标
  4482. switch (type) {
  4483. case 'primary':
  4484. iconName = 'info-circle';
  4485. break;
  4486. case 'info':
  4487. iconName = 'info-circle';
  4488. break;
  4489. case 'error':
  4490. iconName = 'close-circle';
  4491. break;
  4492. case 'warning':
  4493. iconName = 'error-circle';
  4494. break;
  4495. case 'success':
  4496. iconName = 'checkmark-circle';
  4497. break;
  4498. default:
  4499. iconName = 'checkmark-circle';}
  4500. // 是否是实体类型,加上-fill,在icon组件库中,实体的类名是后面加-fill的
  4501. if (fill) iconName += '-fill';
  4502. return iconName;
  4503. }var _default =
  4504. type2icon;exports.default = _default;
  4505. /***/ }),
  4506. /***/ 29:
  4507. /*!****************************************************************************!*\
  4508. !*** D:/HbuderX-exercise/swim-weapp/uview-ui/libs/function/randomArray.js ***!
  4509. \****************************************************************************/
  4510. /*! no static exports found */
  4511. /***/ (function(module, exports, __webpack_require__) {
  4512. "use strict";
  4513. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 打乱数组
  4514. function randomArray() {var array = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  4515. // 原理是sort排序,Math.random()产生0<= x < 1之间的数,会导致x-0.05大于或者小于0
  4516. return array.sort(function () {return Math.random() - 0.5;});
  4517. }var _default =
  4518. randomArray;exports.default = _default;
  4519. /***/ }),
  4520. /***/ 3:
  4521. /*!******************************************************************************************!*\
  4522. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  4523. \******************************************************************************************/
  4524. /*! exports provided: default */
  4525. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4526. "use strict";
  4527. __webpack_require__.r(__webpack_exports__);
  4528. /* WEBPACK VAR INJECTION */(function(global) {/*!
  4529. * Vue.js v2.6.11
  4530. * (c) 2014-2021 Evan You
  4531. * Released under the MIT License.
  4532. */
  4533. /* */
  4534. var emptyObject = Object.freeze({});
  4535. // These helpers produce better VM code in JS engines due to their
  4536. // explicitness and function inlining.
  4537. function isUndef (v) {
  4538. return v === undefined || v === null
  4539. }
  4540. function isDef (v) {
  4541. return v !== undefined && v !== null
  4542. }
  4543. function isTrue (v) {
  4544. return v === true
  4545. }
  4546. function isFalse (v) {
  4547. return v === false
  4548. }
  4549. /**
  4550. * Check if value is primitive.
  4551. */
  4552. function isPrimitive (value) {
  4553. return (
  4554. typeof value === 'string' ||
  4555. typeof value === 'number' ||
  4556. // $flow-disable-line
  4557. typeof value === 'symbol' ||
  4558. typeof value === 'boolean'
  4559. )
  4560. }
  4561. /**
  4562. * Quick object check - this is primarily used to tell
  4563. * Objects from primitive values when we know the value
  4564. * is a JSON-compliant type.
  4565. */
  4566. function isObject (obj) {
  4567. return obj !== null && typeof obj === 'object'
  4568. }
  4569. /**
  4570. * Get the raw type string of a value, e.g., [object Object].
  4571. */
  4572. var _toString = Object.prototype.toString;
  4573. function toRawType (value) {
  4574. return _toString.call(value).slice(8, -1)
  4575. }
  4576. /**
  4577. * Strict object type check. Only returns true
  4578. * for plain JavaScript objects.
  4579. */
  4580. function isPlainObject (obj) {
  4581. return _toString.call(obj) === '[object Object]'
  4582. }
  4583. function isRegExp (v) {
  4584. return _toString.call(v) === '[object RegExp]'
  4585. }
  4586. /**
  4587. * Check if val is a valid array index.
  4588. */
  4589. function isValidArrayIndex (val) {
  4590. var n = parseFloat(String(val));
  4591. return n >= 0 && Math.floor(n) === n && isFinite(val)
  4592. }
  4593. function isPromise (val) {
  4594. return (
  4595. isDef(val) &&
  4596. typeof val.then === 'function' &&
  4597. typeof val.catch === 'function'
  4598. )
  4599. }
  4600. /**
  4601. * Convert a value to a string that is actually rendered.
  4602. */
  4603. function toString (val) {
  4604. return val == null
  4605. ? ''
  4606. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  4607. ? JSON.stringify(val, null, 2)
  4608. : String(val)
  4609. }
  4610. /**
  4611. * Convert an input value to a number for persistence.
  4612. * If the conversion fails, return original string.
  4613. */
  4614. function toNumber (val) {
  4615. var n = parseFloat(val);
  4616. return isNaN(n) ? val : n
  4617. }
  4618. /**
  4619. * Make a map and return a function for checking if a key
  4620. * is in that map.
  4621. */
  4622. function makeMap (
  4623. str,
  4624. expectsLowerCase
  4625. ) {
  4626. var map = Object.create(null);
  4627. var list = str.split(',');
  4628. for (var i = 0; i < list.length; i++) {
  4629. map[list[i]] = true;
  4630. }
  4631. return expectsLowerCase
  4632. ? function (val) { return map[val.toLowerCase()]; }
  4633. : function (val) { return map[val]; }
  4634. }
  4635. /**
  4636. * Check if a tag is a built-in tag.
  4637. */
  4638. var isBuiltInTag = makeMap('slot,component', true);
  4639. /**
  4640. * Check if an attribute is a reserved attribute.
  4641. */
  4642. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  4643. /**
  4644. * Remove an item from an array.
  4645. */
  4646. function remove (arr, item) {
  4647. if (arr.length) {
  4648. var index = arr.indexOf(item);
  4649. if (index > -1) {
  4650. return arr.splice(index, 1)
  4651. }
  4652. }
  4653. }
  4654. /**
  4655. * Check whether an object has the property.
  4656. */
  4657. var hasOwnProperty = Object.prototype.hasOwnProperty;
  4658. function hasOwn (obj, key) {
  4659. return hasOwnProperty.call(obj, key)
  4660. }
  4661. /**
  4662. * Create a cached version of a pure function.
  4663. */
  4664. function cached (fn) {
  4665. var cache = Object.create(null);
  4666. return (function cachedFn (str) {
  4667. var hit = cache[str];
  4668. return hit || (cache[str] = fn(str))
  4669. })
  4670. }
  4671. /**
  4672. * Camelize a hyphen-delimited string.
  4673. */
  4674. var camelizeRE = /-(\w)/g;
  4675. var camelize = cached(function (str) {
  4676. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  4677. });
  4678. /**
  4679. * Capitalize a string.
  4680. */
  4681. var capitalize = cached(function (str) {
  4682. return str.charAt(0).toUpperCase() + str.slice(1)
  4683. });
  4684. /**
  4685. * Hyphenate a camelCase string.
  4686. */
  4687. var hyphenateRE = /\B([A-Z])/g;
  4688. var hyphenate = cached(function (str) {
  4689. return str.replace(hyphenateRE, '-$1').toLowerCase()
  4690. });
  4691. /**
  4692. * Simple bind polyfill for environments that do not support it,
  4693. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  4694. * since native bind is now performant enough in most browsers.
  4695. * But removing it would mean breaking code that was able to run in
  4696. * PhantomJS 1.x, so this must be kept for backward compatibility.
  4697. */
  4698. /* istanbul ignore next */
  4699. function polyfillBind (fn, ctx) {
  4700. function boundFn (a) {
  4701. var l = arguments.length;
  4702. return l
  4703. ? l > 1
  4704. ? fn.apply(ctx, arguments)
  4705. : fn.call(ctx, a)
  4706. : fn.call(ctx)
  4707. }
  4708. boundFn._length = fn.length;
  4709. return boundFn
  4710. }
  4711. function nativeBind (fn, ctx) {
  4712. return fn.bind(ctx)
  4713. }
  4714. var bind = Function.prototype.bind
  4715. ? nativeBind
  4716. : polyfillBind;
  4717. /**
  4718. * Convert an Array-like object to a real Array.
  4719. */
  4720. function toArray (list, start) {
  4721. start = start || 0;
  4722. var i = list.length - start;
  4723. var ret = new Array(i);
  4724. while (i--) {
  4725. ret[i] = list[i + start];
  4726. }
  4727. return ret
  4728. }
  4729. /**
  4730. * Mix properties into target object.
  4731. */
  4732. function extend (to, _from) {
  4733. for (var key in _from) {
  4734. to[key] = _from[key];
  4735. }
  4736. return to
  4737. }
  4738. /**
  4739. * Merge an Array of Objects into a single Object.
  4740. */
  4741. function toObject (arr) {
  4742. var res = {};
  4743. for (var i = 0; i < arr.length; i++) {
  4744. if (arr[i]) {
  4745. extend(res, arr[i]);
  4746. }
  4747. }
  4748. return res
  4749. }
  4750. /* eslint-disable no-unused-vars */
  4751. /**
  4752. * Perform no operation.
  4753. * Stubbing args to make Flow happy without leaving useless transpiled code
  4754. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  4755. */
  4756. function noop (a, b, c) {}
  4757. /**
  4758. * Always return false.
  4759. */
  4760. var no = function (a, b, c) { return false; };
  4761. /* eslint-enable no-unused-vars */
  4762. /**
  4763. * Return the same value.
  4764. */
  4765. var identity = function (_) { return _; };
  4766. /**
  4767. * Check if two values are loosely equal - that is,
  4768. * if they are plain objects, do they have the same shape?
  4769. */
  4770. function looseEqual (a, b) {
  4771. if (a === b) { return true }
  4772. var isObjectA = isObject(a);
  4773. var isObjectB = isObject(b);
  4774. if (isObjectA && isObjectB) {
  4775. try {
  4776. var isArrayA = Array.isArray(a);
  4777. var isArrayB = Array.isArray(b);
  4778. if (isArrayA && isArrayB) {
  4779. return a.length === b.length && a.every(function (e, i) {
  4780. return looseEqual(e, b[i])
  4781. })
  4782. } else if (a instanceof Date && b instanceof Date) {
  4783. return a.getTime() === b.getTime()
  4784. } else if (!isArrayA && !isArrayB) {
  4785. var keysA = Object.keys(a);
  4786. var keysB = Object.keys(b);
  4787. return keysA.length === keysB.length && keysA.every(function (key) {
  4788. return looseEqual(a[key], b[key])
  4789. })
  4790. } else {
  4791. /* istanbul ignore next */
  4792. return false
  4793. }
  4794. } catch (e) {
  4795. /* istanbul ignore next */
  4796. return false
  4797. }
  4798. } else if (!isObjectA && !isObjectB) {
  4799. return String(a) === String(b)
  4800. } else {
  4801. return false
  4802. }
  4803. }
  4804. /**
  4805. * Return the first index at which a loosely equal value can be
  4806. * found in the array (if value is a plain object, the array must
  4807. * contain an object of the same shape), or -1 if it is not present.
  4808. */
  4809. function looseIndexOf (arr, val) {
  4810. for (var i = 0; i < arr.length; i++) {
  4811. if (looseEqual(arr[i], val)) { return i }
  4812. }
  4813. return -1
  4814. }
  4815. /**
  4816. * Ensure a function is called only once.
  4817. */
  4818. function once (fn) {
  4819. var called = false;
  4820. return function () {
  4821. if (!called) {
  4822. called = true;
  4823. fn.apply(this, arguments);
  4824. }
  4825. }
  4826. }
  4827. var ASSET_TYPES = [
  4828. 'component',
  4829. 'directive',
  4830. 'filter'
  4831. ];
  4832. var LIFECYCLE_HOOKS = [
  4833. 'beforeCreate',
  4834. 'created',
  4835. 'beforeMount',
  4836. 'mounted',
  4837. 'beforeUpdate',
  4838. 'updated',
  4839. 'beforeDestroy',
  4840. 'destroyed',
  4841. 'activated',
  4842. 'deactivated',
  4843. 'errorCaptured',
  4844. 'serverPrefetch'
  4845. ];
  4846. /* */
  4847. var config = ({
  4848. /**
  4849. * Option merge strategies (used in core/util/options)
  4850. */
  4851. // $flow-disable-line
  4852. optionMergeStrategies: Object.create(null),
  4853. /**
  4854. * Whether to suppress warnings.
  4855. */
  4856. silent: false,
  4857. /**
  4858. * Show production mode tip message on boot?
  4859. */
  4860. productionTip: "development" !== 'production',
  4861. /**
  4862. * Whether to enable devtools
  4863. */
  4864. devtools: "development" !== 'production',
  4865. /**
  4866. * Whether to record perf
  4867. */
  4868. performance: false,
  4869. /**
  4870. * Error handler for watcher errors
  4871. */
  4872. errorHandler: null,
  4873. /**
  4874. * Warn handler for watcher warns
  4875. */
  4876. warnHandler: null,
  4877. /**
  4878. * Ignore certain custom elements
  4879. */
  4880. ignoredElements: [],
  4881. /**
  4882. * Custom user key aliases for v-on
  4883. */
  4884. // $flow-disable-line
  4885. keyCodes: Object.create(null),
  4886. /**
  4887. * Check if a tag is reserved so that it cannot be registered as a
  4888. * component. This is platform-dependent and may be overwritten.
  4889. */
  4890. isReservedTag: no,
  4891. /**
  4892. * Check if an attribute is reserved so that it cannot be used as a component
  4893. * prop. This is platform-dependent and may be overwritten.
  4894. */
  4895. isReservedAttr: no,
  4896. /**
  4897. * Check if a tag is an unknown element.
  4898. * Platform-dependent.
  4899. */
  4900. isUnknownElement: no,
  4901. /**
  4902. * Get the namespace of an element
  4903. */
  4904. getTagNamespace: noop,
  4905. /**
  4906. * Parse the real tag name for the specific platform.
  4907. */
  4908. parsePlatformTagName: identity,
  4909. /**
  4910. * Check if an attribute must be bound using property, e.g. value
  4911. * Platform-dependent.
  4912. */
  4913. mustUseProp: no,
  4914. /**
  4915. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  4916. * This will significantly reduce performance if set to false.
  4917. */
  4918. async: true,
  4919. /**
  4920. * Exposed for legacy reasons
  4921. */
  4922. _lifecycleHooks: LIFECYCLE_HOOKS
  4923. });
  4924. /* */
  4925. /**
  4926. * unicode letters used for parsing html tags, component names and property paths.
  4927. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  4928. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  4929. */
  4930. 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/;
  4931. /**
  4932. * Check if a string starts with $ or _
  4933. */
  4934. function isReserved (str) {
  4935. var c = (str + '').charCodeAt(0);
  4936. return c === 0x24 || c === 0x5F
  4937. }
  4938. /**
  4939. * Define a property.
  4940. */
  4941. function def (obj, key, val, enumerable) {
  4942. Object.defineProperty(obj, key, {
  4943. value: val,
  4944. enumerable: !!enumerable,
  4945. writable: true,
  4946. configurable: true
  4947. });
  4948. }
  4949. /**
  4950. * Parse simple path.
  4951. */
  4952. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  4953. function parsePath (path) {
  4954. if (bailRE.test(path)) {
  4955. return
  4956. }
  4957. var segments = path.split('.');
  4958. return function (obj) {
  4959. for (var i = 0; i < segments.length; i++) {
  4960. if (!obj) { return }
  4961. obj = obj[segments[i]];
  4962. }
  4963. return obj
  4964. }
  4965. }
  4966. /* */
  4967. // can we use __proto__?
  4968. var hasProto = '__proto__' in {};
  4969. // Browser environment sniffing
  4970. var inBrowser = typeof window !== 'undefined';
  4971. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  4972. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  4973. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  4974. var isIE = UA && /msie|trident/.test(UA);
  4975. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  4976. var isEdge = UA && UA.indexOf('edge/') > 0;
  4977. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  4978. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  4979. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  4980. var isPhantomJS = UA && /phantomjs/.test(UA);
  4981. var isFF = UA && UA.match(/firefox\/(\d+)/);
  4982. // Firefox has a "watch" function on Object.prototype...
  4983. var nativeWatch = ({}).watch;
  4984. if (inBrowser) {
  4985. try {
  4986. var opts = {};
  4987. Object.defineProperty(opts, 'passive', ({
  4988. get: function get () {
  4989. }
  4990. })); // https://github.com/facebook/flow/issues/285
  4991. window.addEventListener('test-passive', null, opts);
  4992. } catch (e) {}
  4993. }
  4994. // this needs to be lazy-evaled because vue may be required before
  4995. // vue-server-renderer can set VUE_ENV
  4996. var _isServer;
  4997. var isServerRendering = function () {
  4998. if (_isServer === undefined) {
  4999. /* istanbul ignore if */
  5000. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  5001. // detect presence of vue-server-renderer and avoid
  5002. // Webpack shimming the process
  5003. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  5004. } else {
  5005. _isServer = false;
  5006. }
  5007. }
  5008. return _isServer
  5009. };
  5010. // detect devtools
  5011. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  5012. /* istanbul ignore next */
  5013. function isNative (Ctor) {
  5014. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  5015. }
  5016. var hasSymbol =
  5017. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  5018. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  5019. var _Set;
  5020. /* istanbul ignore if */ // $flow-disable-line
  5021. if (typeof Set !== 'undefined' && isNative(Set)) {
  5022. // use native Set when available.
  5023. _Set = Set;
  5024. } else {
  5025. // a non-standard Set polyfill that only works with primitive keys.
  5026. _Set = /*@__PURE__*/(function () {
  5027. function Set () {
  5028. this.set = Object.create(null);
  5029. }
  5030. Set.prototype.has = function has (key) {
  5031. return this.set[key] === true
  5032. };
  5033. Set.prototype.add = function add (key) {
  5034. this.set[key] = true;
  5035. };
  5036. Set.prototype.clear = function clear () {
  5037. this.set = Object.create(null);
  5038. };
  5039. return Set;
  5040. }());
  5041. }
  5042. /* */
  5043. var warn = noop;
  5044. var tip = noop;
  5045. var generateComponentTrace = (noop); // work around flow check
  5046. var formatComponentName = (noop);
  5047. if (true) {
  5048. var hasConsole = typeof console !== 'undefined';
  5049. var classifyRE = /(?:^|[-_])(\w)/g;
  5050. var classify = function (str) { return str
  5051. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  5052. .replace(/[-_]/g, ''); };
  5053. warn = function (msg, vm) {
  5054. var trace = vm ? generateComponentTrace(vm) : '';
  5055. if (config.warnHandler) {
  5056. config.warnHandler.call(null, msg, vm, trace);
  5057. } else if (hasConsole && (!config.silent)) {
  5058. console.error(("[Vue warn]: " + msg + trace));
  5059. }
  5060. };
  5061. tip = function (msg, vm) {
  5062. if (hasConsole && (!config.silent)) {
  5063. console.warn("[Vue tip]: " + msg + (
  5064. vm ? generateComponentTrace(vm) : ''
  5065. ));
  5066. }
  5067. };
  5068. formatComponentName = function (vm, includeFile) {
  5069. if (vm.$root === vm) {
  5070. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  5071. return ('') + vm.$options.__file
  5072. }
  5073. return '<Root>'
  5074. }
  5075. var options = typeof vm === 'function' && vm.cid != null
  5076. ? vm.options
  5077. : vm._isVue
  5078. ? vm.$options || vm.constructor.options
  5079. : vm;
  5080. var name = options.name || options._componentTag;
  5081. var file = options.__file;
  5082. if (!name && file) {
  5083. var match = file.match(/([^/\\]+)\.vue$/);
  5084. name = match && match[1];
  5085. }
  5086. return (
  5087. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  5088. (file && includeFile !== false ? (" at " + file) : '')
  5089. )
  5090. };
  5091. var repeat = function (str, n) {
  5092. var res = '';
  5093. while (n) {
  5094. if (n % 2 === 1) { res += str; }
  5095. if (n > 1) { str += str; }
  5096. n >>= 1;
  5097. }
  5098. return res
  5099. };
  5100. generateComponentTrace = function (vm) {
  5101. if (vm._isVue && vm.$parent) {
  5102. var tree = [];
  5103. var currentRecursiveSequence = 0;
  5104. while (vm && vm.$options.name !== 'PageBody') {
  5105. if (tree.length > 0) {
  5106. var last = tree[tree.length - 1];
  5107. if (last.constructor === vm.constructor) {
  5108. currentRecursiveSequence++;
  5109. vm = vm.$parent;
  5110. continue
  5111. } else if (currentRecursiveSequence > 0) {
  5112. tree[tree.length - 1] = [last, currentRecursiveSequence];
  5113. currentRecursiveSequence = 0;
  5114. }
  5115. }
  5116. !vm.$options.isReserved && tree.push(vm);
  5117. vm = vm.$parent;
  5118. }
  5119. return '\n\nfound in\n\n' + tree
  5120. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  5121. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  5122. : formatComponentName(vm))); })
  5123. .join('\n')
  5124. } else {
  5125. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  5126. }
  5127. };
  5128. }
  5129. /* */
  5130. var uid = 0;
  5131. /**
  5132. * A dep is an observable that can have multiple
  5133. * directives subscribing to it.
  5134. */
  5135. var Dep = function Dep () {
  5136. this.id = uid++;
  5137. this.subs = [];
  5138. };
  5139. Dep.prototype.addSub = function addSub (sub) {
  5140. this.subs.push(sub);
  5141. };
  5142. Dep.prototype.removeSub = function removeSub (sub) {
  5143. remove(this.subs, sub);
  5144. };
  5145. Dep.prototype.depend = function depend () {
  5146. if (Dep.SharedObject.target) {
  5147. Dep.SharedObject.target.addDep(this);
  5148. }
  5149. };
  5150. Dep.prototype.notify = function notify () {
  5151. // stabilize the subscriber list first
  5152. var subs = this.subs.slice();
  5153. if ( true && !config.async) {
  5154. // subs aren't sorted in scheduler if not running async
  5155. // we need to sort them now to make sure they fire in correct
  5156. // order
  5157. subs.sort(function (a, b) { return a.id - b.id; });
  5158. }
  5159. for (var i = 0, l = subs.length; i < l; i++) {
  5160. subs[i].update();
  5161. }
  5162. };
  5163. // The current target watcher being evaluated.
  5164. // This is globally unique because only one watcher
  5165. // can be evaluated at a time.
  5166. // fixed by xxxxxx (nvue shared vuex)
  5167. /* eslint-disable no-undef */
  5168. Dep.SharedObject = {};
  5169. Dep.SharedObject.target = null;
  5170. Dep.SharedObject.targetStack = [];
  5171. function pushTarget (target) {
  5172. Dep.SharedObject.targetStack.push(target);
  5173. Dep.SharedObject.target = target;
  5174. Dep.target = target;
  5175. }
  5176. function popTarget () {
  5177. Dep.SharedObject.targetStack.pop();
  5178. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  5179. Dep.target = Dep.SharedObject.target;
  5180. }
  5181. /* */
  5182. var VNode = function VNode (
  5183. tag,
  5184. data,
  5185. children,
  5186. text,
  5187. elm,
  5188. context,
  5189. componentOptions,
  5190. asyncFactory
  5191. ) {
  5192. this.tag = tag;
  5193. this.data = data;
  5194. this.children = children;
  5195. this.text = text;
  5196. this.elm = elm;
  5197. this.ns = undefined;
  5198. this.context = context;
  5199. this.fnContext = undefined;
  5200. this.fnOptions = undefined;
  5201. this.fnScopeId = undefined;
  5202. this.key = data && data.key;
  5203. this.componentOptions = componentOptions;
  5204. this.componentInstance = undefined;
  5205. this.parent = undefined;
  5206. this.raw = false;
  5207. this.isStatic = false;
  5208. this.isRootInsert = true;
  5209. this.isComment = false;
  5210. this.isCloned = false;
  5211. this.isOnce = false;
  5212. this.asyncFactory = asyncFactory;
  5213. this.asyncMeta = undefined;
  5214. this.isAsyncPlaceholder = false;
  5215. };
  5216. var prototypeAccessors = { child: { configurable: true } };
  5217. // DEPRECATED: alias for componentInstance for backwards compat.
  5218. /* istanbul ignore next */
  5219. prototypeAccessors.child.get = function () {
  5220. return this.componentInstance
  5221. };
  5222. Object.defineProperties( VNode.prototype, prototypeAccessors );
  5223. var createEmptyVNode = function (text) {
  5224. if ( text === void 0 ) text = '';
  5225. var node = new VNode();
  5226. node.text = text;
  5227. node.isComment = true;
  5228. return node
  5229. };
  5230. function createTextVNode (val) {
  5231. return new VNode(undefined, undefined, undefined, String(val))
  5232. }
  5233. // optimized shallow clone
  5234. // used for static nodes and slot nodes because they may be reused across
  5235. // multiple renders, cloning them avoids errors when DOM manipulations rely
  5236. // on their elm reference.
  5237. function cloneVNode (vnode) {
  5238. var cloned = new VNode(
  5239. vnode.tag,
  5240. vnode.data,
  5241. // #7975
  5242. // clone children array to avoid mutating original in case of cloning
  5243. // a child.
  5244. vnode.children && vnode.children.slice(),
  5245. vnode.text,
  5246. vnode.elm,
  5247. vnode.context,
  5248. vnode.componentOptions,
  5249. vnode.asyncFactory
  5250. );
  5251. cloned.ns = vnode.ns;
  5252. cloned.isStatic = vnode.isStatic;
  5253. cloned.key = vnode.key;
  5254. cloned.isComment = vnode.isComment;
  5255. cloned.fnContext = vnode.fnContext;
  5256. cloned.fnOptions = vnode.fnOptions;
  5257. cloned.fnScopeId = vnode.fnScopeId;
  5258. cloned.asyncMeta = vnode.asyncMeta;
  5259. cloned.isCloned = true;
  5260. return cloned
  5261. }
  5262. /*
  5263. * not type checking this file because flow doesn't play well with
  5264. * dynamically accessing methods on Array prototype
  5265. */
  5266. var arrayProto = Array.prototype;
  5267. var arrayMethods = Object.create(arrayProto);
  5268. var methodsToPatch = [
  5269. 'push',
  5270. 'pop',
  5271. 'shift',
  5272. 'unshift',
  5273. 'splice',
  5274. 'sort',
  5275. 'reverse'
  5276. ];
  5277. /**
  5278. * Intercept mutating methods and emit events
  5279. */
  5280. methodsToPatch.forEach(function (method) {
  5281. // cache original method
  5282. var original = arrayProto[method];
  5283. def(arrayMethods, method, function mutator () {
  5284. var args = [], len = arguments.length;
  5285. while ( len-- ) args[ len ] = arguments[ len ];
  5286. var result = original.apply(this, args);
  5287. var ob = this.__ob__;
  5288. var inserted;
  5289. switch (method) {
  5290. case 'push':
  5291. case 'unshift':
  5292. inserted = args;
  5293. break
  5294. case 'splice':
  5295. inserted = args.slice(2);
  5296. break
  5297. }
  5298. if (inserted) { ob.observeArray(inserted); }
  5299. // notify change
  5300. ob.dep.notify();
  5301. return result
  5302. });
  5303. });
  5304. /* */
  5305. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  5306. /**
  5307. * In some cases we may want to disable observation inside a component's
  5308. * update computation.
  5309. */
  5310. var shouldObserve = true;
  5311. function toggleObserving (value) {
  5312. shouldObserve = value;
  5313. }
  5314. /**
  5315. * Observer class that is attached to each observed
  5316. * object. Once attached, the observer converts the target
  5317. * object's property keys into getter/setters that
  5318. * collect dependencies and dispatch updates.
  5319. */
  5320. var Observer = function Observer (value) {
  5321. this.value = value;
  5322. this.dep = new Dep();
  5323. this.vmCount = 0;
  5324. def(value, '__ob__', this);
  5325. if (Array.isArray(value)) {
  5326. if (hasProto) {
  5327. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  5328. if(value.push !== value.__proto__.push){
  5329. copyAugment(value, arrayMethods, arrayKeys);
  5330. } else {
  5331. protoAugment(value, arrayMethods);
  5332. }
  5333. }
  5334. } else {
  5335. copyAugment(value, arrayMethods, arrayKeys);
  5336. }
  5337. this.observeArray(value);
  5338. } else {
  5339. this.walk(value);
  5340. }
  5341. };
  5342. /**
  5343. * Walk through all properties and convert them into
  5344. * getter/setters. This method should only be called when
  5345. * value type is Object.
  5346. */
  5347. Observer.prototype.walk = function walk (obj) {
  5348. var keys = Object.keys(obj);
  5349. for (var i = 0; i < keys.length; i++) {
  5350. defineReactive$$1(obj, keys[i]);
  5351. }
  5352. };
  5353. /**
  5354. * Observe a list of Array items.
  5355. */
  5356. Observer.prototype.observeArray = function observeArray (items) {
  5357. for (var i = 0, l = items.length; i < l; i++) {
  5358. observe(items[i]);
  5359. }
  5360. };
  5361. // helpers
  5362. /**
  5363. * Augment a target Object or Array by intercepting
  5364. * the prototype chain using __proto__
  5365. */
  5366. function protoAugment (target, src) {
  5367. /* eslint-disable no-proto */
  5368. target.__proto__ = src;
  5369. /* eslint-enable no-proto */
  5370. }
  5371. /**
  5372. * Augment a target Object or Array by defining
  5373. * hidden properties.
  5374. */
  5375. /* istanbul ignore next */
  5376. function copyAugment (target, src, keys) {
  5377. for (var i = 0, l = keys.length; i < l; i++) {
  5378. var key = keys[i];
  5379. def(target, key, src[key]);
  5380. }
  5381. }
  5382. /**
  5383. * Attempt to create an observer instance for a value,
  5384. * returns the new observer if successfully observed,
  5385. * or the existing observer if the value already has one.
  5386. */
  5387. function observe (value, asRootData) {
  5388. if (!isObject(value) || value instanceof VNode) {
  5389. return
  5390. }
  5391. var ob;
  5392. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  5393. ob = value.__ob__;
  5394. } else if (
  5395. shouldObserve &&
  5396. !isServerRendering() &&
  5397. (Array.isArray(value) || isPlainObject(value)) &&
  5398. Object.isExtensible(value) &&
  5399. !value._isVue
  5400. ) {
  5401. ob = new Observer(value);
  5402. }
  5403. if (asRootData && ob) {
  5404. ob.vmCount++;
  5405. }
  5406. return ob
  5407. }
  5408. /**
  5409. * Define a reactive property on an Object.
  5410. */
  5411. function defineReactive$$1 (
  5412. obj,
  5413. key,
  5414. val,
  5415. customSetter,
  5416. shallow
  5417. ) {
  5418. var dep = new Dep();
  5419. var property = Object.getOwnPropertyDescriptor(obj, key);
  5420. if (property && property.configurable === false) {
  5421. return
  5422. }
  5423. // cater for pre-defined getter/setters
  5424. var getter = property && property.get;
  5425. var setter = property && property.set;
  5426. if ((!getter || setter) && arguments.length === 2) {
  5427. val = obj[key];
  5428. }
  5429. var childOb = !shallow && observe(val);
  5430. Object.defineProperty(obj, key, {
  5431. enumerable: true,
  5432. configurable: true,
  5433. get: function reactiveGetter () {
  5434. var value = getter ? getter.call(obj) : val;
  5435. if (Dep.SharedObject.target) { // fixed by xxxxxx
  5436. dep.depend();
  5437. if (childOb) {
  5438. childOb.dep.depend();
  5439. if (Array.isArray(value)) {
  5440. dependArray(value);
  5441. }
  5442. }
  5443. }
  5444. return value
  5445. },
  5446. set: function reactiveSetter (newVal) {
  5447. var value = getter ? getter.call(obj) : val;
  5448. /* eslint-disable no-self-compare */
  5449. if (newVal === value || (newVal !== newVal && value !== value)) {
  5450. return
  5451. }
  5452. /* eslint-enable no-self-compare */
  5453. if ( true && customSetter) {
  5454. customSetter();
  5455. }
  5456. // #7981: for accessor properties without setter
  5457. if (getter && !setter) { return }
  5458. if (setter) {
  5459. setter.call(obj, newVal);
  5460. } else {
  5461. val = newVal;
  5462. }
  5463. childOb = !shallow && observe(newVal);
  5464. dep.notify();
  5465. }
  5466. });
  5467. }
  5468. /**
  5469. * Set a property on an object. Adds the new property and
  5470. * triggers change notification if the property doesn't
  5471. * already exist.
  5472. */
  5473. function set (target, key, val) {
  5474. if ( true &&
  5475. (isUndef(target) || isPrimitive(target))
  5476. ) {
  5477. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  5478. }
  5479. if (Array.isArray(target) && isValidArrayIndex(key)) {
  5480. target.length = Math.max(target.length, key);
  5481. target.splice(key, 1, val);
  5482. return val
  5483. }
  5484. if (key in target && !(key in Object.prototype)) {
  5485. target[key] = val;
  5486. return val
  5487. }
  5488. var ob = (target).__ob__;
  5489. if (target._isVue || (ob && ob.vmCount)) {
  5490. true && warn(
  5491. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  5492. 'at runtime - declare it upfront in the data option.'
  5493. );
  5494. return val
  5495. }
  5496. if (!ob) {
  5497. target[key] = val;
  5498. return val
  5499. }
  5500. defineReactive$$1(ob.value, key, val);
  5501. ob.dep.notify();
  5502. return val
  5503. }
  5504. /**
  5505. * Delete a property and trigger change if necessary.
  5506. */
  5507. function del (target, key) {
  5508. if ( true &&
  5509. (isUndef(target) || isPrimitive(target))
  5510. ) {
  5511. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  5512. }
  5513. if (Array.isArray(target) && isValidArrayIndex(key)) {
  5514. target.splice(key, 1);
  5515. return
  5516. }
  5517. var ob = (target).__ob__;
  5518. if (target._isVue || (ob && ob.vmCount)) {
  5519. true && warn(
  5520. 'Avoid deleting properties on a Vue instance or its root $data ' +
  5521. '- just set it to null.'
  5522. );
  5523. return
  5524. }
  5525. if (!hasOwn(target, key)) {
  5526. return
  5527. }
  5528. delete target[key];
  5529. if (!ob) {
  5530. return
  5531. }
  5532. ob.dep.notify();
  5533. }
  5534. /**
  5535. * Collect dependencies on array elements when the array is touched, since
  5536. * we cannot intercept array element access like property getters.
  5537. */
  5538. function dependArray (value) {
  5539. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  5540. e = value[i];
  5541. e && e.__ob__ && e.__ob__.dep.depend();
  5542. if (Array.isArray(e)) {
  5543. dependArray(e);
  5544. }
  5545. }
  5546. }
  5547. /* */
  5548. /**
  5549. * Option overwriting strategies are functions that handle
  5550. * how to merge a parent option value and a child option
  5551. * value into the final value.
  5552. */
  5553. var strats = config.optionMergeStrategies;
  5554. /**
  5555. * Options with restrictions
  5556. */
  5557. if (true) {
  5558. strats.el = strats.propsData = function (parent, child, vm, key) {
  5559. if (!vm) {
  5560. warn(
  5561. "option \"" + key + "\" can only be used during instance " +
  5562. 'creation with the `new` keyword.'
  5563. );
  5564. }
  5565. return defaultStrat(parent, child)
  5566. };
  5567. }
  5568. /**
  5569. * Helper that recursively merges two data objects together.
  5570. */
  5571. function mergeData (to, from) {
  5572. if (!from) { return to }
  5573. var key, toVal, fromVal;
  5574. var keys = hasSymbol
  5575. ? Reflect.ownKeys(from)
  5576. : Object.keys(from);
  5577. for (var i = 0; i < keys.length; i++) {
  5578. key = keys[i];
  5579. // in case the object is already observed...
  5580. if (key === '__ob__') { continue }
  5581. toVal = to[key];
  5582. fromVal = from[key];
  5583. if (!hasOwn(to, key)) {
  5584. set(to, key, fromVal);
  5585. } else if (
  5586. toVal !== fromVal &&
  5587. isPlainObject(toVal) &&
  5588. isPlainObject(fromVal)
  5589. ) {
  5590. mergeData(toVal, fromVal);
  5591. }
  5592. }
  5593. return to
  5594. }
  5595. /**
  5596. * Data
  5597. */
  5598. function mergeDataOrFn (
  5599. parentVal,
  5600. childVal,
  5601. vm
  5602. ) {
  5603. if (!vm) {
  5604. // in a Vue.extend merge, both should be functions
  5605. if (!childVal) {
  5606. return parentVal
  5607. }
  5608. if (!parentVal) {
  5609. return childVal
  5610. }
  5611. // when parentVal & childVal are both present,
  5612. // we need to return a function that returns the
  5613. // merged result of both functions... no need to
  5614. // check if parentVal is a function here because
  5615. // it has to be a function to pass previous merges.
  5616. return function mergedDataFn () {
  5617. return mergeData(
  5618. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  5619. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  5620. )
  5621. }
  5622. } else {
  5623. return function mergedInstanceDataFn () {
  5624. // instance merge
  5625. var instanceData = typeof childVal === 'function'
  5626. ? childVal.call(vm, vm)
  5627. : childVal;
  5628. var defaultData = typeof parentVal === 'function'
  5629. ? parentVal.call(vm, vm)
  5630. : parentVal;
  5631. if (instanceData) {
  5632. return mergeData(instanceData, defaultData)
  5633. } else {
  5634. return defaultData
  5635. }
  5636. }
  5637. }
  5638. }
  5639. strats.data = function (
  5640. parentVal,
  5641. childVal,
  5642. vm
  5643. ) {
  5644. if (!vm) {
  5645. if (childVal && typeof childVal !== 'function') {
  5646. true && warn(
  5647. 'The "data" option should be a function ' +
  5648. 'that returns a per-instance value in component ' +
  5649. 'definitions.',
  5650. vm
  5651. );
  5652. return parentVal
  5653. }
  5654. return mergeDataOrFn(parentVal, childVal)
  5655. }
  5656. return mergeDataOrFn(parentVal, childVal, vm)
  5657. };
  5658. /**
  5659. * Hooks and props are merged as arrays.
  5660. */
  5661. function mergeHook (
  5662. parentVal,
  5663. childVal
  5664. ) {
  5665. var res = childVal
  5666. ? parentVal
  5667. ? parentVal.concat(childVal)
  5668. : Array.isArray(childVal)
  5669. ? childVal
  5670. : [childVal]
  5671. : parentVal;
  5672. return res
  5673. ? dedupeHooks(res)
  5674. : res
  5675. }
  5676. function dedupeHooks (hooks) {
  5677. var res = [];
  5678. for (var i = 0; i < hooks.length; i++) {
  5679. if (res.indexOf(hooks[i]) === -1) {
  5680. res.push(hooks[i]);
  5681. }
  5682. }
  5683. return res
  5684. }
  5685. LIFECYCLE_HOOKS.forEach(function (hook) {
  5686. strats[hook] = mergeHook;
  5687. });
  5688. /**
  5689. * Assets
  5690. *
  5691. * When a vm is present (instance creation), we need to do
  5692. * a three-way merge between constructor options, instance
  5693. * options and parent options.
  5694. */
  5695. function mergeAssets (
  5696. parentVal,
  5697. childVal,
  5698. vm,
  5699. key
  5700. ) {
  5701. var res = Object.create(parentVal || null);
  5702. if (childVal) {
  5703. true && assertObjectType(key, childVal, vm);
  5704. return extend(res, childVal)
  5705. } else {
  5706. return res
  5707. }
  5708. }
  5709. ASSET_TYPES.forEach(function (type) {
  5710. strats[type + 's'] = mergeAssets;
  5711. });
  5712. /**
  5713. * Watchers.
  5714. *
  5715. * Watchers hashes should not overwrite one
  5716. * another, so we merge them as arrays.
  5717. */
  5718. strats.watch = function (
  5719. parentVal,
  5720. childVal,
  5721. vm,
  5722. key
  5723. ) {
  5724. // work around Firefox's Object.prototype.watch...
  5725. if (parentVal === nativeWatch) { parentVal = undefined; }
  5726. if (childVal === nativeWatch) { childVal = undefined; }
  5727. /* istanbul ignore if */
  5728. if (!childVal) { return Object.create(parentVal || null) }
  5729. if (true) {
  5730. assertObjectType(key, childVal, vm);
  5731. }
  5732. if (!parentVal) { return childVal }
  5733. var ret = {};
  5734. extend(ret, parentVal);
  5735. for (var key$1 in childVal) {
  5736. var parent = ret[key$1];
  5737. var child = childVal[key$1];
  5738. if (parent && !Array.isArray(parent)) {
  5739. parent = [parent];
  5740. }
  5741. ret[key$1] = parent
  5742. ? parent.concat(child)
  5743. : Array.isArray(child) ? child : [child];
  5744. }
  5745. return ret
  5746. };
  5747. /**
  5748. * Other object hashes.
  5749. */
  5750. strats.props =
  5751. strats.methods =
  5752. strats.inject =
  5753. strats.computed = function (
  5754. parentVal,
  5755. childVal,
  5756. vm,
  5757. key
  5758. ) {
  5759. if (childVal && "development" !== 'production') {
  5760. assertObjectType(key, childVal, vm);
  5761. }
  5762. if (!parentVal) { return childVal }
  5763. var ret = Object.create(null);
  5764. extend(ret, parentVal);
  5765. if (childVal) { extend(ret, childVal); }
  5766. return ret
  5767. };
  5768. strats.provide = mergeDataOrFn;
  5769. /**
  5770. * Default strategy.
  5771. */
  5772. var defaultStrat = function (parentVal, childVal) {
  5773. return childVal === undefined
  5774. ? parentVal
  5775. : childVal
  5776. };
  5777. /**
  5778. * Validate component names
  5779. */
  5780. function checkComponents (options) {
  5781. for (var key in options.components) {
  5782. validateComponentName(key);
  5783. }
  5784. }
  5785. function validateComponentName (name) {
  5786. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  5787. warn(
  5788. 'Invalid component name: "' + name + '". Component names ' +
  5789. 'should conform to valid custom element name in html5 specification.'
  5790. );
  5791. }
  5792. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  5793. warn(
  5794. 'Do not use built-in or reserved HTML elements as component ' +
  5795. 'id: ' + name
  5796. );
  5797. }
  5798. }
  5799. /**
  5800. * Ensure all props option syntax are normalized into the
  5801. * Object-based format.
  5802. */
  5803. function normalizeProps (options, vm) {
  5804. var props = options.props;
  5805. if (!props) { return }
  5806. var res = {};
  5807. var i, val, name;
  5808. if (Array.isArray(props)) {
  5809. i = props.length;
  5810. while (i--) {
  5811. val = props[i];
  5812. if (typeof val === 'string') {
  5813. name = camelize(val);
  5814. res[name] = { type: null };
  5815. } else if (true) {
  5816. warn('props must be strings when using array syntax.');
  5817. }
  5818. }
  5819. } else if (isPlainObject(props)) {
  5820. for (var key in props) {
  5821. val = props[key];
  5822. name = camelize(key);
  5823. res[name] = isPlainObject(val)
  5824. ? val
  5825. : { type: val };
  5826. }
  5827. } else if (true) {
  5828. warn(
  5829. "Invalid value for option \"props\": expected an Array or an Object, " +
  5830. "but got " + (toRawType(props)) + ".",
  5831. vm
  5832. );
  5833. }
  5834. options.props = res;
  5835. }
  5836. /**
  5837. * Normalize all injections into Object-based format
  5838. */
  5839. function normalizeInject (options, vm) {
  5840. var inject = options.inject;
  5841. if (!inject) { return }
  5842. var normalized = options.inject = {};
  5843. if (Array.isArray(inject)) {
  5844. for (var i = 0; i < inject.length; i++) {
  5845. normalized[inject[i]] = { from: inject[i] };
  5846. }
  5847. } else if (isPlainObject(inject)) {
  5848. for (var key in inject) {
  5849. var val = inject[key];
  5850. normalized[key] = isPlainObject(val)
  5851. ? extend({ from: key }, val)
  5852. : { from: val };
  5853. }
  5854. } else if (true) {
  5855. warn(
  5856. "Invalid value for option \"inject\": expected an Array or an Object, " +
  5857. "but got " + (toRawType(inject)) + ".",
  5858. vm
  5859. );
  5860. }
  5861. }
  5862. /**
  5863. * Normalize raw function directives into object format.
  5864. */
  5865. function normalizeDirectives (options) {
  5866. var dirs = options.directives;
  5867. if (dirs) {
  5868. for (var key in dirs) {
  5869. var def$$1 = dirs[key];
  5870. if (typeof def$$1 === 'function') {
  5871. dirs[key] = { bind: def$$1, update: def$$1 };
  5872. }
  5873. }
  5874. }
  5875. }
  5876. function assertObjectType (name, value, vm) {
  5877. if (!isPlainObject(value)) {
  5878. warn(
  5879. "Invalid value for option \"" + name + "\": expected an Object, " +
  5880. "but got " + (toRawType(value)) + ".",
  5881. vm
  5882. );
  5883. }
  5884. }
  5885. /**
  5886. * Merge two option objects into a new one.
  5887. * Core utility used in both instantiation and inheritance.
  5888. */
  5889. function mergeOptions (
  5890. parent,
  5891. child,
  5892. vm
  5893. ) {
  5894. if (true) {
  5895. checkComponents(child);
  5896. }
  5897. if (typeof child === 'function') {
  5898. child = child.options;
  5899. }
  5900. normalizeProps(child, vm);
  5901. normalizeInject(child, vm);
  5902. normalizeDirectives(child);
  5903. // Apply extends and mixins on the child options,
  5904. // but only if it is a raw options object that isn't
  5905. // the result of another mergeOptions call.
  5906. // Only merged options has the _base property.
  5907. if (!child._base) {
  5908. if (child.extends) {
  5909. parent = mergeOptions(parent, child.extends, vm);
  5910. }
  5911. if (child.mixins) {
  5912. for (var i = 0, l = child.mixins.length; i < l; i++) {
  5913. parent = mergeOptions(parent, child.mixins[i], vm);
  5914. }
  5915. }
  5916. }
  5917. var options = {};
  5918. var key;
  5919. for (key in parent) {
  5920. mergeField(key);
  5921. }
  5922. for (key in child) {
  5923. if (!hasOwn(parent, key)) {
  5924. mergeField(key);
  5925. }
  5926. }
  5927. function mergeField (key) {
  5928. var strat = strats[key] || defaultStrat;
  5929. options[key] = strat(parent[key], child[key], vm, key);
  5930. }
  5931. return options
  5932. }
  5933. /**
  5934. * Resolve an asset.
  5935. * This function is used because child instances need access
  5936. * to assets defined in its ancestor chain.
  5937. */
  5938. function resolveAsset (
  5939. options,
  5940. type,
  5941. id,
  5942. warnMissing
  5943. ) {
  5944. /* istanbul ignore if */
  5945. if (typeof id !== 'string') {
  5946. return
  5947. }
  5948. var assets = options[type];
  5949. // check local registration variations first
  5950. if (hasOwn(assets, id)) { return assets[id] }
  5951. var camelizedId = camelize(id);
  5952. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  5953. var PascalCaseId = capitalize(camelizedId);
  5954. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  5955. // fallback to prototype chain
  5956. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  5957. if ( true && warnMissing && !res) {
  5958. warn(
  5959. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  5960. options
  5961. );
  5962. }
  5963. return res
  5964. }
  5965. /* */
  5966. function validateProp (
  5967. key,
  5968. propOptions,
  5969. propsData,
  5970. vm
  5971. ) {
  5972. var prop = propOptions[key];
  5973. var absent = !hasOwn(propsData, key);
  5974. var value = propsData[key];
  5975. // boolean casting
  5976. var booleanIndex = getTypeIndex(Boolean, prop.type);
  5977. if (booleanIndex > -1) {
  5978. if (absent && !hasOwn(prop, 'default')) {
  5979. value = false;
  5980. } else if (value === '' || value === hyphenate(key)) {
  5981. // only cast empty string / same name to boolean if
  5982. // boolean has higher priority
  5983. var stringIndex = getTypeIndex(String, prop.type);
  5984. if (stringIndex < 0 || booleanIndex < stringIndex) {
  5985. value = true;
  5986. }
  5987. }
  5988. }
  5989. // check default value
  5990. if (value === undefined) {
  5991. value = getPropDefaultValue(vm, prop, key);
  5992. // since the default value is a fresh copy,
  5993. // make sure to observe it.
  5994. var prevShouldObserve = shouldObserve;
  5995. toggleObserving(true);
  5996. observe(value);
  5997. toggleObserving(prevShouldObserve);
  5998. }
  5999. if (
  6000. true
  6001. ) {
  6002. assertProp(prop, key, value, vm, absent);
  6003. }
  6004. return value
  6005. }
  6006. /**
  6007. * Get the default value of a prop.
  6008. */
  6009. function getPropDefaultValue (vm, prop, key) {
  6010. // no default, return undefined
  6011. if (!hasOwn(prop, 'default')) {
  6012. return undefined
  6013. }
  6014. var def = prop.default;
  6015. // warn against non-factory defaults for Object & Array
  6016. if ( true && isObject(def)) {
  6017. warn(
  6018. 'Invalid default value for prop "' + key + '": ' +
  6019. 'Props with type Object/Array must use a factory function ' +
  6020. 'to return the default value.',
  6021. vm
  6022. );
  6023. }
  6024. // the raw prop value was also undefined from previous render,
  6025. // return previous default value to avoid unnecessary watcher trigger
  6026. if (vm && vm.$options.propsData &&
  6027. vm.$options.propsData[key] === undefined &&
  6028. vm._props[key] !== undefined
  6029. ) {
  6030. return vm._props[key]
  6031. }
  6032. // call factory function for non-Function types
  6033. // a value is Function if its prototype is function even across different execution context
  6034. return typeof def === 'function' && getType(prop.type) !== 'Function'
  6035. ? def.call(vm)
  6036. : def
  6037. }
  6038. /**
  6039. * Assert whether a prop is valid.
  6040. */
  6041. function assertProp (
  6042. prop,
  6043. name,
  6044. value,
  6045. vm,
  6046. absent
  6047. ) {
  6048. if (prop.required && absent) {
  6049. warn(
  6050. 'Missing required prop: "' + name + '"',
  6051. vm
  6052. );
  6053. return
  6054. }
  6055. if (value == null && !prop.required) {
  6056. return
  6057. }
  6058. var type = prop.type;
  6059. var valid = !type || type === true;
  6060. var expectedTypes = [];
  6061. if (type) {
  6062. if (!Array.isArray(type)) {
  6063. type = [type];
  6064. }
  6065. for (var i = 0; i < type.length && !valid; i++) {
  6066. var assertedType = assertType(value, type[i]);
  6067. expectedTypes.push(assertedType.expectedType || '');
  6068. valid = assertedType.valid;
  6069. }
  6070. }
  6071. if (!valid) {
  6072. warn(
  6073. getInvalidTypeMessage(name, value, expectedTypes),
  6074. vm
  6075. );
  6076. return
  6077. }
  6078. var validator = prop.validator;
  6079. if (validator) {
  6080. if (!validator(value)) {
  6081. warn(
  6082. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  6083. vm
  6084. );
  6085. }
  6086. }
  6087. }
  6088. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  6089. function assertType (value, type) {
  6090. var valid;
  6091. var expectedType = getType(type);
  6092. if (simpleCheckRE.test(expectedType)) {
  6093. var t = typeof value;
  6094. valid = t === expectedType.toLowerCase();
  6095. // for primitive wrapper objects
  6096. if (!valid && t === 'object') {
  6097. valid = value instanceof type;
  6098. }
  6099. } else if (expectedType === 'Object') {
  6100. valid = isPlainObject(value);
  6101. } else if (expectedType === 'Array') {
  6102. valid = Array.isArray(value);
  6103. } else {
  6104. valid = value instanceof type;
  6105. }
  6106. return {
  6107. valid: valid,
  6108. expectedType: expectedType
  6109. }
  6110. }
  6111. /**
  6112. * Use function string name to check built-in types,
  6113. * because a simple equality check will fail when running
  6114. * across different vms / iframes.
  6115. */
  6116. function getType (fn) {
  6117. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  6118. return match ? match[1] : ''
  6119. }
  6120. function isSameType (a, b) {
  6121. return getType(a) === getType(b)
  6122. }
  6123. function getTypeIndex (type, expectedTypes) {
  6124. if (!Array.isArray(expectedTypes)) {
  6125. return isSameType(expectedTypes, type) ? 0 : -1
  6126. }
  6127. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  6128. if (isSameType(expectedTypes[i], type)) {
  6129. return i
  6130. }
  6131. }
  6132. return -1
  6133. }
  6134. function getInvalidTypeMessage (name, value, expectedTypes) {
  6135. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  6136. " Expected " + (expectedTypes.map(capitalize).join(', '));
  6137. var expectedType = expectedTypes[0];
  6138. var receivedType = toRawType(value);
  6139. var expectedValue = styleValue(value, expectedType);
  6140. var receivedValue = styleValue(value, receivedType);
  6141. // check if we need to specify expected value
  6142. if (expectedTypes.length === 1 &&
  6143. isExplicable(expectedType) &&
  6144. !isBoolean(expectedType, receivedType)) {
  6145. message += " with value " + expectedValue;
  6146. }
  6147. message += ", got " + receivedType + " ";
  6148. // check if we need to specify received value
  6149. if (isExplicable(receivedType)) {
  6150. message += "with value " + receivedValue + ".";
  6151. }
  6152. return message
  6153. }
  6154. function styleValue (value, type) {
  6155. if (type === 'String') {
  6156. return ("\"" + value + "\"")
  6157. } else if (type === 'Number') {
  6158. return ("" + (Number(value)))
  6159. } else {
  6160. return ("" + value)
  6161. }
  6162. }
  6163. function isExplicable (value) {
  6164. var explicitTypes = ['string', 'number', 'boolean'];
  6165. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  6166. }
  6167. function isBoolean () {
  6168. var args = [], len = arguments.length;
  6169. while ( len-- ) args[ len ] = arguments[ len ];
  6170. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  6171. }
  6172. /* */
  6173. function handleError (err, vm, info) {
  6174. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  6175. // See: https://github.com/vuejs/vuex/issues/1505
  6176. pushTarget();
  6177. try {
  6178. if (vm) {
  6179. var cur = vm;
  6180. while ((cur = cur.$parent)) {
  6181. var hooks = cur.$options.errorCaptured;
  6182. if (hooks) {
  6183. for (var i = 0; i < hooks.length; i++) {
  6184. try {
  6185. var capture = hooks[i].call(cur, err, vm, info) === false;
  6186. if (capture) { return }
  6187. } catch (e) {
  6188. globalHandleError(e, cur, 'errorCaptured hook');
  6189. }
  6190. }
  6191. }
  6192. }
  6193. }
  6194. globalHandleError(err, vm, info);
  6195. } finally {
  6196. popTarget();
  6197. }
  6198. }
  6199. function invokeWithErrorHandling (
  6200. handler,
  6201. context,
  6202. args,
  6203. vm,
  6204. info
  6205. ) {
  6206. var res;
  6207. try {
  6208. res = args ? handler.apply(context, args) : handler.call(context);
  6209. if (res && !res._isVue && isPromise(res) && !res._handled) {
  6210. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  6211. // issue #9511
  6212. // avoid catch triggering multiple times when nested calls
  6213. res._handled = true;
  6214. }
  6215. } catch (e) {
  6216. handleError(e, vm, info);
  6217. }
  6218. return res
  6219. }
  6220. function globalHandleError (err, vm, info) {
  6221. if (config.errorHandler) {
  6222. try {
  6223. return config.errorHandler.call(null, err, vm, info)
  6224. } catch (e) {
  6225. // if the user intentionally throws the original error in the handler,
  6226. // do not log it twice
  6227. if (e !== err) {
  6228. logError(e, null, 'config.errorHandler');
  6229. }
  6230. }
  6231. }
  6232. logError(err, vm, info);
  6233. }
  6234. function logError (err, vm, info) {
  6235. if (true) {
  6236. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  6237. }
  6238. /* istanbul ignore else */
  6239. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  6240. console.error(err);
  6241. } else {
  6242. throw err
  6243. }
  6244. }
  6245. /* */
  6246. var callbacks = [];
  6247. var pending = false;
  6248. function flushCallbacks () {
  6249. pending = false;
  6250. var copies = callbacks.slice(0);
  6251. callbacks.length = 0;
  6252. for (var i = 0; i < copies.length; i++) {
  6253. copies[i]();
  6254. }
  6255. }
  6256. // Here we have async deferring wrappers using microtasks.
  6257. // In 2.5 we used (macro) tasks (in combination with microtasks).
  6258. // However, it has subtle problems when state is changed right before repaint
  6259. // (e.g. #6813, out-in transitions).
  6260. // Also, using (macro) tasks in event handler would cause some weird behaviors
  6261. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  6262. // So we now use microtasks everywhere, again.
  6263. // A major drawback of this tradeoff is that there are some scenarios
  6264. // where microtasks have too high a priority and fire in between supposedly
  6265. // sequential events (e.g. #4521, #6690, which have workarounds)
  6266. // or even between bubbling of the same event (#6566).
  6267. var timerFunc;
  6268. // The nextTick behavior leverages the microtask queue, which can be accessed
  6269. // via either native Promise.then or MutationObserver.
  6270. // MutationObserver has wider support, however it is seriously bugged in
  6271. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  6272. // completely stops working after triggering a few times... so, if native
  6273. // Promise is available, we will use it:
  6274. /* istanbul ignore next, $flow-disable-line */
  6275. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  6276. var p = Promise.resolve();
  6277. timerFunc = function () {
  6278. p.then(flushCallbacks);
  6279. // In problematic UIWebViews, Promise.then doesn't completely break, but
  6280. // it can get stuck in a weird state where callbacks are pushed into the
  6281. // microtask queue but the queue isn't being flushed, until the browser
  6282. // needs to do some other work, e.g. handle a timer. Therefore we can
  6283. // "force" the microtask queue to be flushed by adding an empty timer.
  6284. if (isIOS) { setTimeout(noop); }
  6285. };
  6286. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  6287. isNative(MutationObserver) ||
  6288. // PhantomJS and iOS 7.x
  6289. MutationObserver.toString() === '[object MutationObserverConstructor]'
  6290. )) {
  6291. // Use MutationObserver where native Promise is not available,
  6292. // e.g. PhantomJS, iOS7, Android 4.4
  6293. // (#6466 MutationObserver is unreliable in IE11)
  6294. var counter = 1;
  6295. var observer = new MutationObserver(flushCallbacks);
  6296. var textNode = document.createTextNode(String(counter));
  6297. observer.observe(textNode, {
  6298. characterData: true
  6299. });
  6300. timerFunc = function () {
  6301. counter = (counter + 1) % 2;
  6302. textNode.data = String(counter);
  6303. };
  6304. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  6305. // Fallback to setImmediate.
  6306. // Technically it leverages the (macro) task queue,
  6307. // but it is still a better choice than setTimeout.
  6308. timerFunc = function () {
  6309. setImmediate(flushCallbacks);
  6310. };
  6311. } else {
  6312. // Fallback to setTimeout.
  6313. timerFunc = function () {
  6314. setTimeout(flushCallbacks, 0);
  6315. };
  6316. }
  6317. function nextTick (cb, ctx) {
  6318. var _resolve;
  6319. callbacks.push(function () {
  6320. if (cb) {
  6321. try {
  6322. cb.call(ctx);
  6323. } catch (e) {
  6324. handleError(e, ctx, 'nextTick');
  6325. }
  6326. } else if (_resolve) {
  6327. _resolve(ctx);
  6328. }
  6329. });
  6330. if (!pending) {
  6331. pending = true;
  6332. timerFunc();
  6333. }
  6334. // $flow-disable-line
  6335. if (!cb && typeof Promise !== 'undefined') {
  6336. return new Promise(function (resolve) {
  6337. _resolve = resolve;
  6338. })
  6339. }
  6340. }
  6341. /* */
  6342. /* not type checking this file because flow doesn't play well with Proxy */
  6343. var initProxy;
  6344. if (true) {
  6345. var allowedGlobals = makeMap(
  6346. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  6347. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  6348. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  6349. 'require' // for Webpack/Browserify
  6350. );
  6351. var warnNonPresent = function (target, key) {
  6352. warn(
  6353. "Property or method \"" + key + "\" is not defined on the instance but " +
  6354. 'referenced during render. Make sure that this property is reactive, ' +
  6355. 'either in the data option, or for class-based components, by ' +
  6356. 'initializing the property. ' +
  6357. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  6358. target
  6359. );
  6360. };
  6361. var warnReservedPrefix = function (target, key) {
  6362. warn(
  6363. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  6364. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  6365. 'prevent conflicts with Vue internals. ' +
  6366. 'See: https://vuejs.org/v2/api/#data',
  6367. target
  6368. );
  6369. };
  6370. var hasProxy =
  6371. typeof Proxy !== 'undefined' && isNative(Proxy);
  6372. if (hasProxy) {
  6373. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  6374. config.keyCodes = new Proxy(config.keyCodes, {
  6375. set: function set (target, key, value) {
  6376. if (isBuiltInModifier(key)) {
  6377. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  6378. return false
  6379. } else {
  6380. target[key] = value;
  6381. return true
  6382. }
  6383. }
  6384. });
  6385. }
  6386. var hasHandler = {
  6387. has: function has (target, key) {
  6388. var has = key in target;
  6389. var isAllowed = allowedGlobals(key) ||
  6390. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  6391. if (!has && !isAllowed) {
  6392. if (key in target.$data) { warnReservedPrefix(target, key); }
  6393. else { warnNonPresent(target, key); }
  6394. }
  6395. return has || !isAllowed
  6396. }
  6397. };
  6398. var getHandler = {
  6399. get: function get (target, key) {
  6400. if (typeof key === 'string' && !(key in target)) {
  6401. if (key in target.$data) { warnReservedPrefix(target, key); }
  6402. else { warnNonPresent(target, key); }
  6403. }
  6404. return target[key]
  6405. }
  6406. };
  6407. initProxy = function initProxy (vm) {
  6408. if (hasProxy) {
  6409. // determine which proxy handler to use
  6410. var options = vm.$options;
  6411. var handlers = options.render && options.render._withStripped
  6412. ? getHandler
  6413. : hasHandler;
  6414. vm._renderProxy = new Proxy(vm, handlers);
  6415. } else {
  6416. vm._renderProxy = vm;
  6417. }
  6418. };
  6419. }
  6420. /* */
  6421. var seenObjects = new _Set();
  6422. /**
  6423. * Recursively traverse an object to evoke all converted
  6424. * getters, so that every nested property inside the object
  6425. * is collected as a "deep" dependency.
  6426. */
  6427. function traverse (val) {
  6428. _traverse(val, seenObjects);
  6429. seenObjects.clear();
  6430. }
  6431. function _traverse (val, seen) {
  6432. var i, keys;
  6433. var isA = Array.isArray(val);
  6434. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  6435. return
  6436. }
  6437. if (val.__ob__) {
  6438. var depId = val.__ob__.dep.id;
  6439. if (seen.has(depId)) {
  6440. return
  6441. }
  6442. seen.add(depId);
  6443. }
  6444. if (isA) {
  6445. i = val.length;
  6446. while (i--) { _traverse(val[i], seen); }
  6447. } else {
  6448. keys = Object.keys(val);
  6449. i = keys.length;
  6450. while (i--) { _traverse(val[keys[i]], seen); }
  6451. }
  6452. }
  6453. var mark;
  6454. var measure;
  6455. if (true) {
  6456. var perf = inBrowser && window.performance;
  6457. /* istanbul ignore if */
  6458. if (
  6459. perf &&
  6460. perf.mark &&
  6461. perf.measure &&
  6462. perf.clearMarks &&
  6463. perf.clearMeasures
  6464. ) {
  6465. mark = function (tag) { return perf.mark(tag); };
  6466. measure = function (name, startTag, endTag) {
  6467. perf.measure(name, startTag, endTag);
  6468. perf.clearMarks(startTag);
  6469. perf.clearMarks(endTag);
  6470. // perf.clearMeasures(name)
  6471. };
  6472. }
  6473. }
  6474. /* */
  6475. var normalizeEvent = cached(function (name) {
  6476. var passive = name.charAt(0) === '&';
  6477. name = passive ? name.slice(1) : name;
  6478. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  6479. name = once$$1 ? name.slice(1) : name;
  6480. var capture = name.charAt(0) === '!';
  6481. name = capture ? name.slice(1) : name;
  6482. return {
  6483. name: name,
  6484. once: once$$1,
  6485. capture: capture,
  6486. passive: passive
  6487. }
  6488. });
  6489. function createFnInvoker (fns, vm) {
  6490. function invoker () {
  6491. var arguments$1 = arguments;
  6492. var fns = invoker.fns;
  6493. if (Array.isArray(fns)) {
  6494. var cloned = fns.slice();
  6495. for (var i = 0; i < cloned.length; i++) {
  6496. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  6497. }
  6498. } else {
  6499. // return handler return value for single handlers
  6500. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  6501. }
  6502. }
  6503. invoker.fns = fns;
  6504. return invoker
  6505. }
  6506. function updateListeners (
  6507. on,
  6508. oldOn,
  6509. add,
  6510. remove$$1,
  6511. createOnceHandler,
  6512. vm
  6513. ) {
  6514. var name, def$$1, cur, old, event;
  6515. for (name in on) {
  6516. def$$1 = cur = on[name];
  6517. old = oldOn[name];
  6518. event = normalizeEvent(name);
  6519. if (isUndef(cur)) {
  6520. true && warn(
  6521. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  6522. vm
  6523. );
  6524. } else if (isUndef(old)) {
  6525. if (isUndef(cur.fns)) {
  6526. cur = on[name] = createFnInvoker(cur, vm);
  6527. }
  6528. if (isTrue(event.once)) {
  6529. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  6530. }
  6531. add(event.name, cur, event.capture, event.passive, event.params);
  6532. } else if (cur !== old) {
  6533. old.fns = cur;
  6534. on[name] = old;
  6535. }
  6536. }
  6537. for (name in oldOn) {
  6538. if (isUndef(on[name])) {
  6539. event = normalizeEvent(name);
  6540. remove$$1(event.name, oldOn[name], event.capture);
  6541. }
  6542. }
  6543. }
  6544. /* */
  6545. /* */
  6546. // fixed by xxxxxx (mp properties)
  6547. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  6548. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  6549. if (isUndef(propOptions)) {
  6550. return res
  6551. }
  6552. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  6553. var attrs = data.attrs;
  6554. var props = data.props;
  6555. if (isDef(attrs) || isDef(props)) {
  6556. for (var key in propOptions) {
  6557. var altKey = hyphenate(key);
  6558. var result = checkProp(res, props, key, altKey, true) ||
  6559. checkProp(res, attrs, key, altKey, false);
  6560. // externalClass
  6561. if (
  6562. result &&
  6563. res[key] &&
  6564. externalClasses.indexOf(altKey) !== -1 &&
  6565. context[camelize(res[key])]
  6566. ) {
  6567. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  6568. res[key] = context[camelize(res[key])];
  6569. }
  6570. }
  6571. }
  6572. return res
  6573. }
  6574. function extractPropsFromVNodeData (
  6575. data,
  6576. Ctor,
  6577. tag,
  6578. context// fixed by xxxxxx
  6579. ) {
  6580. // we are only extracting raw values here.
  6581. // validation and default values are handled in the child
  6582. // component itself.
  6583. var propOptions = Ctor.options.props;
  6584. if (isUndef(propOptions)) {
  6585. // fixed by xxxxxx
  6586. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  6587. }
  6588. var res = {};
  6589. var attrs = data.attrs;
  6590. var props = data.props;
  6591. if (isDef(attrs) || isDef(props)) {
  6592. for (var key in propOptions) {
  6593. var altKey = hyphenate(key);
  6594. if (true) {
  6595. var keyInLowerCase = key.toLowerCase();
  6596. if (
  6597. key !== keyInLowerCase &&
  6598. attrs && hasOwn(attrs, keyInLowerCase)
  6599. ) {
  6600. tip(
  6601. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  6602. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  6603. " \"" + key + "\". " +
  6604. "Note that HTML attributes are case-insensitive and camelCased " +
  6605. "props need to use their kebab-case equivalents when using in-DOM " +
  6606. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  6607. );
  6608. }
  6609. }
  6610. checkProp(res, props, key, altKey, true) ||
  6611. checkProp(res, attrs, key, altKey, false);
  6612. }
  6613. }
  6614. // fixed by xxxxxx
  6615. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  6616. }
  6617. function checkProp (
  6618. res,
  6619. hash,
  6620. key,
  6621. altKey,
  6622. preserve
  6623. ) {
  6624. if (isDef(hash)) {
  6625. if (hasOwn(hash, key)) {
  6626. res[key] = hash[key];
  6627. if (!preserve) {
  6628. delete hash[key];
  6629. }
  6630. return true
  6631. } else if (hasOwn(hash, altKey)) {
  6632. res[key] = hash[altKey];
  6633. if (!preserve) {
  6634. delete hash[altKey];
  6635. }
  6636. return true
  6637. }
  6638. }
  6639. return false
  6640. }
  6641. /* */
  6642. // The template compiler attempts to minimize the need for normalization by
  6643. // statically analyzing the template at compile time.
  6644. //
  6645. // For plain HTML markup, normalization can be completely skipped because the
  6646. // generated render function is guaranteed to return Array<VNode>. There are
  6647. // two cases where extra normalization is needed:
  6648. // 1. When the children contains components - because a functional component
  6649. // may return an Array instead of a single root. In this case, just a simple
  6650. // normalization is needed - if any child is an Array, we flatten the whole
  6651. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  6652. // because functional components already normalize their own children.
  6653. function simpleNormalizeChildren (children) {
  6654. for (var i = 0; i < children.length; i++) {
  6655. if (Array.isArray(children[i])) {
  6656. return Array.prototype.concat.apply([], children)
  6657. }
  6658. }
  6659. return children
  6660. }
  6661. // 2. When the children contains constructs that always generated nested Arrays,
  6662. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  6663. // with hand-written render functions / JSX. In such cases a full normalization
  6664. // is needed to cater to all possible types of children values.
  6665. function normalizeChildren (children) {
  6666. return isPrimitive(children)
  6667. ? [createTextVNode(children)]
  6668. : Array.isArray(children)
  6669. ? normalizeArrayChildren(children)
  6670. : undefined
  6671. }
  6672. function isTextNode (node) {
  6673. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  6674. }
  6675. function normalizeArrayChildren (children, nestedIndex) {
  6676. var res = [];
  6677. var i, c, lastIndex, last;
  6678. for (i = 0; i < children.length; i++) {
  6679. c = children[i];
  6680. if (isUndef(c) || typeof c === 'boolean') { continue }
  6681. lastIndex = res.length - 1;
  6682. last = res[lastIndex];
  6683. // nested
  6684. if (Array.isArray(c)) {
  6685. if (c.length > 0) {
  6686. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  6687. // merge adjacent text nodes
  6688. if (isTextNode(c[0]) && isTextNode(last)) {
  6689. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  6690. c.shift();
  6691. }
  6692. res.push.apply(res, c);
  6693. }
  6694. } else if (isPrimitive(c)) {
  6695. if (isTextNode(last)) {
  6696. // merge adjacent text nodes
  6697. // this is necessary for SSR hydration because text nodes are
  6698. // essentially merged when rendered to HTML strings
  6699. res[lastIndex] = createTextVNode(last.text + c);
  6700. } else if (c !== '') {
  6701. // convert primitive to vnode
  6702. res.push(createTextVNode(c));
  6703. }
  6704. } else {
  6705. if (isTextNode(c) && isTextNode(last)) {
  6706. // merge adjacent text nodes
  6707. res[lastIndex] = createTextVNode(last.text + c.text);
  6708. } else {
  6709. // default key for nested array children (likely generated by v-for)
  6710. if (isTrue(children._isVList) &&
  6711. isDef(c.tag) &&
  6712. isUndef(c.key) &&
  6713. isDef(nestedIndex)) {
  6714. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  6715. }
  6716. res.push(c);
  6717. }
  6718. }
  6719. }
  6720. return res
  6721. }
  6722. /* */
  6723. function initProvide (vm) {
  6724. var provide = vm.$options.provide;
  6725. if (provide) {
  6726. vm._provided = typeof provide === 'function'
  6727. ? provide.call(vm)
  6728. : provide;
  6729. }
  6730. }
  6731. function initInjections (vm) {
  6732. var result = resolveInject(vm.$options.inject, vm);
  6733. if (result) {
  6734. toggleObserving(false);
  6735. Object.keys(result).forEach(function (key) {
  6736. /* istanbul ignore else */
  6737. if (true) {
  6738. defineReactive$$1(vm, key, result[key], function () {
  6739. warn(
  6740. "Avoid mutating an injected value directly since the changes will be " +
  6741. "overwritten whenever the provided component re-renders. " +
  6742. "injection being mutated: \"" + key + "\"",
  6743. vm
  6744. );
  6745. });
  6746. } else {}
  6747. });
  6748. toggleObserving(true);
  6749. }
  6750. }
  6751. function resolveInject (inject, vm) {
  6752. if (inject) {
  6753. // inject is :any because flow is not smart enough to figure out cached
  6754. var result = Object.create(null);
  6755. var keys = hasSymbol
  6756. ? Reflect.ownKeys(inject)
  6757. : Object.keys(inject);
  6758. for (var i = 0; i < keys.length; i++) {
  6759. var key = keys[i];
  6760. // #6574 in case the inject object is observed...
  6761. if (key === '__ob__') { continue }
  6762. var provideKey = inject[key].from;
  6763. var source = vm;
  6764. while (source) {
  6765. if (source._provided && hasOwn(source._provided, provideKey)) {
  6766. result[key] = source._provided[provideKey];
  6767. break
  6768. }
  6769. source = source.$parent;
  6770. }
  6771. if (!source) {
  6772. if ('default' in inject[key]) {
  6773. var provideDefault = inject[key].default;
  6774. result[key] = typeof provideDefault === 'function'
  6775. ? provideDefault.call(vm)
  6776. : provideDefault;
  6777. } else if (true) {
  6778. warn(("Injection \"" + key + "\" not found"), vm);
  6779. }
  6780. }
  6781. }
  6782. return result
  6783. }
  6784. }
  6785. /* */
  6786. /**
  6787. * Runtime helper for resolving raw children VNodes into a slot object.
  6788. */
  6789. function resolveSlots (
  6790. children,
  6791. context
  6792. ) {
  6793. if (!children || !children.length) {
  6794. return {}
  6795. }
  6796. var slots = {};
  6797. for (var i = 0, l = children.length; i < l; i++) {
  6798. var child = children[i];
  6799. var data = child.data;
  6800. // remove slot attribute if the node is resolved as a Vue slot node
  6801. if (data && data.attrs && data.attrs.slot) {
  6802. delete data.attrs.slot;
  6803. }
  6804. // named slots should only be respected if the vnode was rendered in the
  6805. // same context.
  6806. if ((child.context === context || child.fnContext === context) &&
  6807. data && data.slot != null
  6808. ) {
  6809. var name = data.slot;
  6810. var slot = (slots[name] || (slots[name] = []));
  6811. if (child.tag === 'template') {
  6812. slot.push.apply(slot, child.children || []);
  6813. } else {
  6814. slot.push(child);
  6815. }
  6816. } else {
  6817. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  6818. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  6819. (slots['page'] || (slots['page'] = [])).push(child);
  6820. }else{
  6821. (slots.default || (slots.default = [])).push(child);
  6822. }
  6823. }
  6824. }
  6825. // ignore slots that contains only whitespace
  6826. for (var name$1 in slots) {
  6827. if (slots[name$1].every(isWhitespace)) {
  6828. delete slots[name$1];
  6829. }
  6830. }
  6831. return slots
  6832. }
  6833. function isWhitespace (node) {
  6834. return (node.isComment && !node.asyncFactory) || node.text === ' '
  6835. }
  6836. /* */
  6837. function normalizeScopedSlots (
  6838. slots,
  6839. normalSlots,
  6840. prevSlots
  6841. ) {
  6842. var res;
  6843. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  6844. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  6845. var key = slots && slots.$key;
  6846. if (!slots) {
  6847. res = {};
  6848. } else if (slots._normalized) {
  6849. // fast path 1: child component re-render only, parent did not change
  6850. return slots._normalized
  6851. } else if (
  6852. isStable &&
  6853. prevSlots &&
  6854. prevSlots !== emptyObject &&
  6855. key === prevSlots.$key &&
  6856. !hasNormalSlots &&
  6857. !prevSlots.$hasNormal
  6858. ) {
  6859. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  6860. // only need to normalize once
  6861. return prevSlots
  6862. } else {
  6863. res = {};
  6864. for (var key$1 in slots) {
  6865. if (slots[key$1] && key$1[0] !== '$') {
  6866. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  6867. }
  6868. }
  6869. }
  6870. // expose normal slots on scopedSlots
  6871. for (var key$2 in normalSlots) {
  6872. if (!(key$2 in res)) {
  6873. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  6874. }
  6875. }
  6876. // avoriaz seems to mock a non-extensible $scopedSlots object
  6877. // and when that is passed down this would cause an error
  6878. if (slots && Object.isExtensible(slots)) {
  6879. (slots)._normalized = res;
  6880. }
  6881. def(res, '$stable', isStable);
  6882. def(res, '$key', key);
  6883. def(res, '$hasNormal', hasNormalSlots);
  6884. return res
  6885. }
  6886. function normalizeScopedSlot(normalSlots, key, fn) {
  6887. var normalized = function () {
  6888. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  6889. res = res && typeof res === 'object' && !Array.isArray(res)
  6890. ? [res] // single vnode
  6891. : normalizeChildren(res);
  6892. return res && (
  6893. res.length === 0 ||
  6894. (res.length === 1 && res[0].isComment) // #9658
  6895. ) ? undefined
  6896. : res
  6897. };
  6898. // this is a slot using the new v-slot syntax without scope. although it is
  6899. // compiled as a scoped slot, render fn users would expect it to be present
  6900. // on this.$slots because the usage is semantically a normal slot.
  6901. if (fn.proxy) {
  6902. Object.defineProperty(normalSlots, key, {
  6903. get: normalized,
  6904. enumerable: true,
  6905. configurable: true
  6906. });
  6907. }
  6908. return normalized
  6909. }
  6910. function proxyNormalSlot(slots, key) {
  6911. return function () { return slots[key]; }
  6912. }
  6913. /* */
  6914. /**
  6915. * Runtime helper for rendering v-for lists.
  6916. */
  6917. function renderList (
  6918. val,
  6919. render
  6920. ) {
  6921. var ret, i, l, keys, key;
  6922. if (Array.isArray(val) || typeof val === 'string') {
  6923. ret = new Array(val.length);
  6924. for (i = 0, l = val.length; i < l; i++) {
  6925. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  6926. }
  6927. } else if (typeof val === 'number') {
  6928. ret = new Array(val);
  6929. for (i = 0; i < val; i++) {
  6930. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  6931. }
  6932. } else if (isObject(val)) {
  6933. if (hasSymbol && val[Symbol.iterator]) {
  6934. ret = [];
  6935. var iterator = val[Symbol.iterator]();
  6936. var result = iterator.next();
  6937. while (!result.done) {
  6938. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  6939. result = iterator.next();
  6940. }
  6941. } else {
  6942. keys = Object.keys(val);
  6943. ret = new Array(keys.length);
  6944. for (i = 0, l = keys.length; i < l; i++) {
  6945. key = keys[i];
  6946. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  6947. }
  6948. }
  6949. }
  6950. if (!isDef(ret)) {
  6951. ret = [];
  6952. }
  6953. (ret)._isVList = true;
  6954. return ret
  6955. }
  6956. /* */
  6957. /**
  6958. * Runtime helper for rendering <slot>
  6959. */
  6960. function renderSlot (
  6961. name,
  6962. fallback,
  6963. props,
  6964. bindObject
  6965. ) {
  6966. var scopedSlotFn = this.$scopedSlots[name];
  6967. var nodes;
  6968. if (scopedSlotFn) { // scoped slot
  6969. props = props || {};
  6970. if (bindObject) {
  6971. if ( true && !isObject(bindObject)) {
  6972. warn(
  6973. 'slot v-bind without argument expects an Object',
  6974. this
  6975. );
  6976. }
  6977. props = extend(extend({}, bindObject), props);
  6978. }
  6979. // fixed by xxxxxx app-plus scopedSlot
  6980. nodes = scopedSlotFn(props, this, props._i) || fallback;
  6981. } else {
  6982. nodes = this.$slots[name] || fallback;
  6983. }
  6984. var target = props && props.slot;
  6985. if (target) {
  6986. return this.$createElement('template', { slot: target }, nodes)
  6987. } else {
  6988. return nodes
  6989. }
  6990. }
  6991. /* */
  6992. /**
  6993. * Runtime helper for resolving filters
  6994. */
  6995. function resolveFilter (id) {
  6996. return resolveAsset(this.$options, 'filters', id, true) || identity
  6997. }
  6998. /* */
  6999. function isKeyNotMatch (expect, actual) {
  7000. if (Array.isArray(expect)) {
  7001. return expect.indexOf(actual) === -1
  7002. } else {
  7003. return expect !== actual
  7004. }
  7005. }
  7006. /**
  7007. * Runtime helper for checking keyCodes from config.
  7008. * exposed as Vue.prototype._k
  7009. * passing in eventKeyName as last argument separately for backwards compat
  7010. */
  7011. function checkKeyCodes (
  7012. eventKeyCode,
  7013. key,
  7014. builtInKeyCode,
  7015. eventKeyName,
  7016. builtInKeyName
  7017. ) {
  7018. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  7019. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  7020. return isKeyNotMatch(builtInKeyName, eventKeyName)
  7021. } else if (mappedKeyCode) {
  7022. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  7023. } else if (eventKeyName) {
  7024. return hyphenate(eventKeyName) !== key
  7025. }
  7026. }
  7027. /* */
  7028. /**
  7029. * Runtime helper for merging v-bind="object" into a VNode's data.
  7030. */
  7031. function bindObjectProps (
  7032. data,
  7033. tag,
  7034. value,
  7035. asProp,
  7036. isSync
  7037. ) {
  7038. if (value) {
  7039. if (!isObject(value)) {
  7040. true && warn(
  7041. 'v-bind without argument expects an Object or Array value',
  7042. this
  7043. );
  7044. } else {
  7045. if (Array.isArray(value)) {
  7046. value = toObject(value);
  7047. }
  7048. var hash;
  7049. var loop = function ( key ) {
  7050. if (
  7051. key === 'class' ||
  7052. key === 'style' ||
  7053. isReservedAttribute(key)
  7054. ) {
  7055. hash = data;
  7056. } else {
  7057. var type = data.attrs && data.attrs.type;
  7058. hash = asProp || config.mustUseProp(tag, type, key)
  7059. ? data.domProps || (data.domProps = {})
  7060. : data.attrs || (data.attrs = {});
  7061. }
  7062. var camelizedKey = camelize(key);
  7063. var hyphenatedKey = hyphenate(key);
  7064. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  7065. hash[key] = value[key];
  7066. if (isSync) {
  7067. var on = data.on || (data.on = {});
  7068. on[("update:" + key)] = function ($event) {
  7069. value[key] = $event;
  7070. };
  7071. }
  7072. }
  7073. };
  7074. for (var key in value) loop( key );
  7075. }
  7076. }
  7077. return data
  7078. }
  7079. /* */
  7080. /**
  7081. * Runtime helper for rendering static trees.
  7082. */
  7083. function renderStatic (
  7084. index,
  7085. isInFor
  7086. ) {
  7087. var cached = this._staticTrees || (this._staticTrees = []);
  7088. var tree = cached[index];
  7089. // if has already-rendered static tree and not inside v-for,
  7090. // we can reuse the same tree.
  7091. if (tree && !isInFor) {
  7092. return tree
  7093. }
  7094. // otherwise, render a fresh tree.
  7095. tree = cached[index] = this.$options.staticRenderFns[index].call(
  7096. this._renderProxy,
  7097. null,
  7098. this // for render fns generated for functional component templates
  7099. );
  7100. markStatic(tree, ("__static__" + index), false);
  7101. return tree
  7102. }
  7103. /**
  7104. * Runtime helper for v-once.
  7105. * Effectively it means marking the node as static with a unique key.
  7106. */
  7107. function markOnce (
  7108. tree,
  7109. index,
  7110. key
  7111. ) {
  7112. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  7113. return tree
  7114. }
  7115. function markStatic (
  7116. tree,
  7117. key,
  7118. isOnce
  7119. ) {
  7120. if (Array.isArray(tree)) {
  7121. for (var i = 0; i < tree.length; i++) {
  7122. if (tree[i] && typeof tree[i] !== 'string') {
  7123. markStaticNode(tree[i], (key + "_" + i), isOnce);
  7124. }
  7125. }
  7126. } else {
  7127. markStaticNode(tree, key, isOnce);
  7128. }
  7129. }
  7130. function markStaticNode (node, key, isOnce) {
  7131. node.isStatic = true;
  7132. node.key = key;
  7133. node.isOnce = isOnce;
  7134. }
  7135. /* */
  7136. function bindObjectListeners (data, value) {
  7137. if (value) {
  7138. if (!isPlainObject(value)) {
  7139. true && warn(
  7140. 'v-on without argument expects an Object value',
  7141. this
  7142. );
  7143. } else {
  7144. var on = data.on = data.on ? extend({}, data.on) : {};
  7145. for (var key in value) {
  7146. var existing = on[key];
  7147. var ours = value[key];
  7148. on[key] = existing ? [].concat(existing, ours) : ours;
  7149. }
  7150. }
  7151. }
  7152. return data
  7153. }
  7154. /* */
  7155. function resolveScopedSlots (
  7156. fns, // see flow/vnode
  7157. res,
  7158. // the following are added in 2.6
  7159. hasDynamicKeys,
  7160. contentHashKey
  7161. ) {
  7162. res = res || { $stable: !hasDynamicKeys };
  7163. for (var i = 0; i < fns.length; i++) {
  7164. var slot = fns[i];
  7165. if (Array.isArray(slot)) {
  7166. resolveScopedSlots(slot, res, hasDynamicKeys);
  7167. } else if (slot) {
  7168. // marker for reverse proxying v-slot without scope on this.$slots
  7169. if (slot.proxy) {
  7170. slot.fn.proxy = true;
  7171. }
  7172. res[slot.key] = slot.fn;
  7173. }
  7174. }
  7175. if (contentHashKey) {
  7176. (res).$key = contentHashKey;
  7177. }
  7178. return res
  7179. }
  7180. /* */
  7181. function bindDynamicKeys (baseObj, values) {
  7182. for (var i = 0; i < values.length; i += 2) {
  7183. var key = values[i];
  7184. if (typeof key === 'string' && key) {
  7185. baseObj[values[i]] = values[i + 1];
  7186. } else if ( true && key !== '' && key !== null) {
  7187. // null is a special value for explicitly removing a binding
  7188. warn(
  7189. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  7190. this
  7191. );
  7192. }
  7193. }
  7194. return baseObj
  7195. }
  7196. // helper to dynamically append modifier runtime markers to event names.
  7197. // ensure only append when value is already string, otherwise it will be cast
  7198. // to string and cause the type check to miss.
  7199. function prependModifier (value, symbol) {
  7200. return typeof value === 'string' ? symbol + value : value
  7201. }
  7202. /* */
  7203. function installRenderHelpers (target) {
  7204. target._o = markOnce;
  7205. target._n = toNumber;
  7206. target._s = toString;
  7207. target._l = renderList;
  7208. target._t = renderSlot;
  7209. target._q = looseEqual;
  7210. target._i = looseIndexOf;
  7211. target._m = renderStatic;
  7212. target._f = resolveFilter;
  7213. target._k = checkKeyCodes;
  7214. target._b = bindObjectProps;
  7215. target._v = createTextVNode;
  7216. target._e = createEmptyVNode;
  7217. target._u = resolveScopedSlots;
  7218. target._g = bindObjectListeners;
  7219. target._d = bindDynamicKeys;
  7220. target._p = prependModifier;
  7221. }
  7222. /* */
  7223. function FunctionalRenderContext (
  7224. data,
  7225. props,
  7226. children,
  7227. parent,
  7228. Ctor
  7229. ) {
  7230. var this$1 = this;
  7231. var options = Ctor.options;
  7232. // ensure the createElement function in functional components
  7233. // gets a unique context - this is necessary for correct named slot check
  7234. var contextVm;
  7235. if (hasOwn(parent, '_uid')) {
  7236. contextVm = Object.create(parent);
  7237. // $flow-disable-line
  7238. contextVm._original = parent;
  7239. } else {
  7240. // the context vm passed in is a functional context as well.
  7241. // in this case we want to make sure we are able to get a hold to the
  7242. // real context instance.
  7243. contextVm = parent;
  7244. // $flow-disable-line
  7245. parent = parent._original;
  7246. }
  7247. var isCompiled = isTrue(options._compiled);
  7248. var needNormalization = !isCompiled;
  7249. this.data = data;
  7250. this.props = props;
  7251. this.children = children;
  7252. this.parent = parent;
  7253. this.listeners = data.on || emptyObject;
  7254. this.injections = resolveInject(options.inject, parent);
  7255. this.slots = function () {
  7256. if (!this$1.$slots) {
  7257. normalizeScopedSlots(
  7258. data.scopedSlots,
  7259. this$1.$slots = resolveSlots(children, parent)
  7260. );
  7261. }
  7262. return this$1.$slots
  7263. };
  7264. Object.defineProperty(this, 'scopedSlots', ({
  7265. enumerable: true,
  7266. get: function get () {
  7267. return normalizeScopedSlots(data.scopedSlots, this.slots())
  7268. }
  7269. }));
  7270. // support for compiled functional template
  7271. if (isCompiled) {
  7272. // exposing $options for renderStatic()
  7273. this.$options = options;
  7274. // pre-resolve slots for renderSlot()
  7275. this.$slots = this.slots();
  7276. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  7277. }
  7278. if (options._scopeId) {
  7279. this._c = function (a, b, c, d) {
  7280. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  7281. if (vnode && !Array.isArray(vnode)) {
  7282. vnode.fnScopeId = options._scopeId;
  7283. vnode.fnContext = parent;
  7284. }
  7285. return vnode
  7286. };
  7287. } else {
  7288. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  7289. }
  7290. }
  7291. installRenderHelpers(FunctionalRenderContext.prototype);
  7292. function createFunctionalComponent (
  7293. Ctor,
  7294. propsData,
  7295. data,
  7296. contextVm,
  7297. children
  7298. ) {
  7299. var options = Ctor.options;
  7300. var props = {};
  7301. var propOptions = options.props;
  7302. if (isDef(propOptions)) {
  7303. for (var key in propOptions) {
  7304. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  7305. }
  7306. } else {
  7307. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  7308. if (isDef(data.props)) { mergeProps(props, data.props); }
  7309. }
  7310. var renderContext = new FunctionalRenderContext(
  7311. data,
  7312. props,
  7313. children,
  7314. contextVm,
  7315. Ctor
  7316. );
  7317. var vnode = options.render.call(null, renderContext._c, renderContext);
  7318. if (vnode instanceof VNode) {
  7319. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  7320. } else if (Array.isArray(vnode)) {
  7321. var vnodes = normalizeChildren(vnode) || [];
  7322. var res = new Array(vnodes.length);
  7323. for (var i = 0; i < vnodes.length; i++) {
  7324. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  7325. }
  7326. return res
  7327. }
  7328. }
  7329. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  7330. // #7817 clone node before setting fnContext, otherwise if the node is reused
  7331. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  7332. // that should not be matched to match.
  7333. var clone = cloneVNode(vnode);
  7334. clone.fnContext = contextVm;
  7335. clone.fnOptions = options;
  7336. if (true) {
  7337. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  7338. }
  7339. if (data.slot) {
  7340. (clone.data || (clone.data = {})).slot = data.slot;
  7341. }
  7342. return clone
  7343. }
  7344. function mergeProps (to, from) {
  7345. for (var key in from) {
  7346. to[camelize(key)] = from[key];
  7347. }
  7348. }
  7349. /* */
  7350. /* */
  7351. /* */
  7352. /* */
  7353. // inline hooks to be invoked on component VNodes during patch
  7354. var componentVNodeHooks = {
  7355. init: function init (vnode, hydrating) {
  7356. if (
  7357. vnode.componentInstance &&
  7358. !vnode.componentInstance._isDestroyed &&
  7359. vnode.data.keepAlive
  7360. ) {
  7361. // kept-alive components, treat as a patch
  7362. var mountedNode = vnode; // work around flow
  7363. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  7364. } else {
  7365. var child = vnode.componentInstance = createComponentInstanceForVnode(
  7366. vnode,
  7367. activeInstance
  7368. );
  7369. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  7370. }
  7371. },
  7372. prepatch: function prepatch (oldVnode, vnode) {
  7373. var options = vnode.componentOptions;
  7374. var child = vnode.componentInstance = oldVnode.componentInstance;
  7375. updateChildComponent(
  7376. child,
  7377. options.propsData, // updated props
  7378. options.listeners, // updated listeners
  7379. vnode, // new parent vnode
  7380. options.children // new children
  7381. );
  7382. },
  7383. insert: function insert (vnode) {
  7384. var context = vnode.context;
  7385. var componentInstance = vnode.componentInstance;
  7386. if (!componentInstance._isMounted) {
  7387. callHook(componentInstance, 'onServiceCreated');
  7388. callHook(componentInstance, 'onServiceAttached');
  7389. componentInstance._isMounted = true;
  7390. callHook(componentInstance, 'mounted');
  7391. }
  7392. if (vnode.data.keepAlive) {
  7393. if (context._isMounted) {
  7394. // vue-router#1212
  7395. // During updates, a kept-alive component's child components may
  7396. // change, so directly walking the tree here may call activated hooks
  7397. // on incorrect children. Instead we push them into a queue which will
  7398. // be processed after the whole patch process ended.
  7399. queueActivatedComponent(componentInstance);
  7400. } else {
  7401. activateChildComponent(componentInstance, true /* direct */);
  7402. }
  7403. }
  7404. },
  7405. destroy: function destroy (vnode) {
  7406. var componentInstance = vnode.componentInstance;
  7407. if (!componentInstance._isDestroyed) {
  7408. if (!vnode.data.keepAlive) {
  7409. componentInstance.$destroy();
  7410. } else {
  7411. deactivateChildComponent(componentInstance, true /* direct */);
  7412. }
  7413. }
  7414. }
  7415. };
  7416. var hooksToMerge = Object.keys(componentVNodeHooks);
  7417. function createComponent (
  7418. Ctor,
  7419. data,
  7420. context,
  7421. children,
  7422. tag
  7423. ) {
  7424. if (isUndef(Ctor)) {
  7425. return
  7426. }
  7427. var baseCtor = context.$options._base;
  7428. // plain options object: turn it into a constructor
  7429. if (isObject(Ctor)) {
  7430. Ctor = baseCtor.extend(Ctor);
  7431. }
  7432. // if at this stage it's not a constructor or an async component factory,
  7433. // reject.
  7434. if (typeof Ctor !== 'function') {
  7435. if (true) {
  7436. warn(("Invalid Component definition: " + (String(Ctor))), context);
  7437. }
  7438. return
  7439. }
  7440. // async component
  7441. var asyncFactory;
  7442. if (isUndef(Ctor.cid)) {
  7443. asyncFactory = Ctor;
  7444. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  7445. if (Ctor === undefined) {
  7446. // return a placeholder node for async component, which is rendered
  7447. // as a comment node but preserves all the raw information for the node.
  7448. // the information will be used for async server-rendering and hydration.
  7449. return createAsyncPlaceholder(
  7450. asyncFactory,
  7451. data,
  7452. context,
  7453. children,
  7454. tag
  7455. )
  7456. }
  7457. }
  7458. data = data || {};
  7459. // resolve constructor options in case global mixins are applied after
  7460. // component constructor creation
  7461. resolveConstructorOptions(Ctor);
  7462. // transform component v-model data into props & events
  7463. if (isDef(data.model)) {
  7464. transformModel(Ctor.options, data);
  7465. }
  7466. // extract props
  7467. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  7468. // functional component
  7469. if (isTrue(Ctor.options.functional)) {
  7470. return createFunctionalComponent(Ctor, propsData, data, context, children)
  7471. }
  7472. // extract listeners, since these needs to be treated as
  7473. // child component listeners instead of DOM listeners
  7474. var listeners = data.on;
  7475. // replace with listeners with .native modifier
  7476. // so it gets processed during parent component patch.
  7477. data.on = data.nativeOn;
  7478. if (isTrue(Ctor.options.abstract)) {
  7479. // abstract components do not keep anything
  7480. // other than props & listeners & slot
  7481. // work around flow
  7482. var slot = data.slot;
  7483. data = {};
  7484. if (slot) {
  7485. data.slot = slot;
  7486. }
  7487. }
  7488. // install component management hooks onto the placeholder node
  7489. installComponentHooks(data);
  7490. // return a placeholder vnode
  7491. var name = Ctor.options.name || tag;
  7492. var vnode = new VNode(
  7493. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  7494. data, undefined, undefined, undefined, context,
  7495. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  7496. asyncFactory
  7497. );
  7498. return vnode
  7499. }
  7500. function createComponentInstanceForVnode (
  7501. vnode, // we know it's MountedComponentVNode but flow doesn't
  7502. parent // activeInstance in lifecycle state
  7503. ) {
  7504. var options = {
  7505. _isComponent: true,
  7506. _parentVnode: vnode,
  7507. parent: parent
  7508. };
  7509. // check inline-template render functions
  7510. var inlineTemplate = vnode.data.inlineTemplate;
  7511. if (isDef(inlineTemplate)) {
  7512. options.render = inlineTemplate.render;
  7513. options.staticRenderFns = inlineTemplate.staticRenderFns;
  7514. }
  7515. return new vnode.componentOptions.Ctor(options)
  7516. }
  7517. function installComponentHooks (data) {
  7518. var hooks = data.hook || (data.hook = {});
  7519. for (var i = 0; i < hooksToMerge.length; i++) {
  7520. var key = hooksToMerge[i];
  7521. var existing = hooks[key];
  7522. var toMerge = componentVNodeHooks[key];
  7523. if (existing !== toMerge && !(existing && existing._merged)) {
  7524. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  7525. }
  7526. }
  7527. }
  7528. function mergeHook$1 (f1, f2) {
  7529. var merged = function (a, b) {
  7530. // flow complains about extra args which is why we use any
  7531. f1(a, b);
  7532. f2(a, b);
  7533. };
  7534. merged._merged = true;
  7535. return merged
  7536. }
  7537. // transform component v-model info (value and callback) into
  7538. // prop and event handler respectively.
  7539. function transformModel (options, data) {
  7540. var prop = (options.model && options.model.prop) || 'value';
  7541. var event = (options.model && options.model.event) || 'input'
  7542. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  7543. var on = data.on || (data.on = {});
  7544. var existing = on[event];
  7545. var callback = data.model.callback;
  7546. if (isDef(existing)) {
  7547. if (
  7548. Array.isArray(existing)
  7549. ? existing.indexOf(callback) === -1
  7550. : existing !== callback
  7551. ) {
  7552. on[event] = [callback].concat(existing);
  7553. }
  7554. } else {
  7555. on[event] = callback;
  7556. }
  7557. }
  7558. /* */
  7559. var SIMPLE_NORMALIZE = 1;
  7560. var ALWAYS_NORMALIZE = 2;
  7561. // wrapper function for providing a more flexible interface
  7562. // without getting yelled at by flow
  7563. function createElement (
  7564. context,
  7565. tag,
  7566. data,
  7567. children,
  7568. normalizationType,
  7569. alwaysNormalize
  7570. ) {
  7571. if (Array.isArray(data) || isPrimitive(data)) {
  7572. normalizationType = children;
  7573. children = data;
  7574. data = undefined;
  7575. }
  7576. if (isTrue(alwaysNormalize)) {
  7577. normalizationType = ALWAYS_NORMALIZE;
  7578. }
  7579. return _createElement(context, tag, data, children, normalizationType)
  7580. }
  7581. function _createElement (
  7582. context,
  7583. tag,
  7584. data,
  7585. children,
  7586. normalizationType
  7587. ) {
  7588. if (isDef(data) && isDef((data).__ob__)) {
  7589. true && warn(
  7590. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  7591. 'Always create fresh vnode data objects in each render!',
  7592. context
  7593. );
  7594. return createEmptyVNode()
  7595. }
  7596. // object syntax in v-bind
  7597. if (isDef(data) && isDef(data.is)) {
  7598. tag = data.is;
  7599. }
  7600. if (!tag) {
  7601. // in case of component :is set to falsy value
  7602. return createEmptyVNode()
  7603. }
  7604. // warn against non-primitive key
  7605. if ( true &&
  7606. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  7607. ) {
  7608. {
  7609. warn(
  7610. 'Avoid using non-primitive value as key, ' +
  7611. 'use string/number value instead.',
  7612. context
  7613. );
  7614. }
  7615. }
  7616. // support single function children as default scoped slot
  7617. if (Array.isArray(children) &&
  7618. typeof children[0] === 'function'
  7619. ) {
  7620. data = data || {};
  7621. data.scopedSlots = { default: children[0] };
  7622. children.length = 0;
  7623. }
  7624. if (normalizationType === ALWAYS_NORMALIZE) {
  7625. children = normalizeChildren(children);
  7626. } else if (normalizationType === SIMPLE_NORMALIZE) {
  7627. children = simpleNormalizeChildren(children);
  7628. }
  7629. var vnode, ns;
  7630. if (typeof tag === 'string') {
  7631. var Ctor;
  7632. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  7633. if (config.isReservedTag(tag)) {
  7634. // platform built-in elements
  7635. if ( true && isDef(data) && isDef(data.nativeOn)) {
  7636. warn(
  7637. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  7638. context
  7639. );
  7640. }
  7641. vnode = new VNode(
  7642. config.parsePlatformTagName(tag), data, children,
  7643. undefined, undefined, context
  7644. );
  7645. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  7646. // component
  7647. vnode = createComponent(Ctor, data, context, children, tag);
  7648. } else {
  7649. // unknown or unlisted namespaced elements
  7650. // check at runtime because it may get assigned a namespace when its
  7651. // parent normalizes children
  7652. vnode = new VNode(
  7653. tag, data, children,
  7654. undefined, undefined, context
  7655. );
  7656. }
  7657. } else {
  7658. // direct component options / constructor
  7659. vnode = createComponent(tag, data, context, children);
  7660. }
  7661. if (Array.isArray(vnode)) {
  7662. return vnode
  7663. } else if (isDef(vnode)) {
  7664. if (isDef(ns)) { applyNS(vnode, ns); }
  7665. if (isDef(data)) { registerDeepBindings(data); }
  7666. return vnode
  7667. } else {
  7668. return createEmptyVNode()
  7669. }
  7670. }
  7671. function applyNS (vnode, ns, force) {
  7672. vnode.ns = ns;
  7673. if (vnode.tag === 'foreignObject') {
  7674. // use default namespace inside foreignObject
  7675. ns = undefined;
  7676. force = true;
  7677. }
  7678. if (isDef(vnode.children)) {
  7679. for (var i = 0, l = vnode.children.length; i < l; i++) {
  7680. var child = vnode.children[i];
  7681. if (isDef(child.tag) && (
  7682. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  7683. applyNS(child, ns, force);
  7684. }
  7685. }
  7686. }
  7687. }
  7688. // ref #5318
  7689. // necessary to ensure parent re-render when deep bindings like :style and
  7690. // :class are used on slot nodes
  7691. function registerDeepBindings (data) {
  7692. if (isObject(data.style)) {
  7693. traverse(data.style);
  7694. }
  7695. if (isObject(data.class)) {
  7696. traverse(data.class);
  7697. }
  7698. }
  7699. /* */
  7700. function initRender (vm) {
  7701. vm._vnode = null; // the root of the child tree
  7702. vm._staticTrees = null; // v-once cached trees
  7703. var options = vm.$options;
  7704. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  7705. var renderContext = parentVnode && parentVnode.context;
  7706. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  7707. vm.$scopedSlots = emptyObject;
  7708. // bind the createElement fn to this instance
  7709. // so that we get proper render context inside it.
  7710. // args order: tag, data, children, normalizationType, alwaysNormalize
  7711. // internal version is used by render functions compiled from templates
  7712. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  7713. // normalization is always applied for the public version, used in
  7714. // user-written render functions.
  7715. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  7716. // $attrs & $listeners are exposed for easier HOC creation.
  7717. // they need to be reactive so that HOCs using them are always updated
  7718. var parentData = parentVnode && parentVnode.data;
  7719. /* istanbul ignore else */
  7720. if (true) {
  7721. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  7722. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  7723. }, true);
  7724. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  7725. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  7726. }, true);
  7727. } else {}
  7728. }
  7729. var currentRenderingInstance = null;
  7730. function renderMixin (Vue) {
  7731. // install runtime convenience helpers
  7732. installRenderHelpers(Vue.prototype);
  7733. Vue.prototype.$nextTick = function (fn) {
  7734. return nextTick(fn, this)
  7735. };
  7736. Vue.prototype._render = function () {
  7737. var vm = this;
  7738. var ref = vm.$options;
  7739. var render = ref.render;
  7740. var _parentVnode = ref._parentVnode;
  7741. if (_parentVnode) {
  7742. vm.$scopedSlots = normalizeScopedSlots(
  7743. _parentVnode.data.scopedSlots,
  7744. vm.$slots,
  7745. vm.$scopedSlots
  7746. );
  7747. }
  7748. // set parent vnode. this allows render functions to have access
  7749. // to the data on the placeholder node.
  7750. vm.$vnode = _parentVnode;
  7751. // render self
  7752. var vnode;
  7753. try {
  7754. // There's no need to maintain a stack because all render fns are called
  7755. // separately from one another. Nested component's render fns are called
  7756. // when parent component is patched.
  7757. currentRenderingInstance = vm;
  7758. vnode = render.call(vm._renderProxy, vm.$createElement);
  7759. } catch (e) {
  7760. handleError(e, vm, "render");
  7761. // return error render result,
  7762. // or previous vnode to prevent render error causing blank component
  7763. /* istanbul ignore else */
  7764. if ( true && vm.$options.renderError) {
  7765. try {
  7766. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  7767. } catch (e) {
  7768. handleError(e, vm, "renderError");
  7769. vnode = vm._vnode;
  7770. }
  7771. } else {
  7772. vnode = vm._vnode;
  7773. }
  7774. } finally {
  7775. currentRenderingInstance = null;
  7776. }
  7777. // if the returned array contains only a single node, allow it
  7778. if (Array.isArray(vnode) && vnode.length === 1) {
  7779. vnode = vnode[0];
  7780. }
  7781. // return empty vnode in case the render function errored out
  7782. if (!(vnode instanceof VNode)) {
  7783. if ( true && Array.isArray(vnode)) {
  7784. warn(
  7785. 'Multiple root nodes returned from render function. Render function ' +
  7786. 'should return a single root node.',
  7787. vm
  7788. );
  7789. }
  7790. vnode = createEmptyVNode();
  7791. }
  7792. // set parent
  7793. vnode.parent = _parentVnode;
  7794. return vnode
  7795. };
  7796. }
  7797. /* */
  7798. function ensureCtor (comp, base) {
  7799. if (
  7800. comp.__esModule ||
  7801. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  7802. ) {
  7803. comp = comp.default;
  7804. }
  7805. return isObject(comp)
  7806. ? base.extend(comp)
  7807. : comp
  7808. }
  7809. function createAsyncPlaceholder (
  7810. factory,
  7811. data,
  7812. context,
  7813. children,
  7814. tag
  7815. ) {
  7816. var node = createEmptyVNode();
  7817. node.asyncFactory = factory;
  7818. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  7819. return node
  7820. }
  7821. function resolveAsyncComponent (
  7822. factory,
  7823. baseCtor
  7824. ) {
  7825. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  7826. return factory.errorComp
  7827. }
  7828. if (isDef(factory.resolved)) {
  7829. return factory.resolved
  7830. }
  7831. var owner = currentRenderingInstance;
  7832. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  7833. // already pending
  7834. factory.owners.push(owner);
  7835. }
  7836. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  7837. return factory.loadingComp
  7838. }
  7839. if (owner && !isDef(factory.owners)) {
  7840. var owners = factory.owners = [owner];
  7841. var sync = true;
  7842. var timerLoading = null;
  7843. var timerTimeout = null
  7844. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  7845. var forceRender = function (renderCompleted) {
  7846. for (var i = 0, l = owners.length; i < l; i++) {
  7847. (owners[i]).$forceUpdate();
  7848. }
  7849. if (renderCompleted) {
  7850. owners.length = 0;
  7851. if (timerLoading !== null) {
  7852. clearTimeout(timerLoading);
  7853. timerLoading = null;
  7854. }
  7855. if (timerTimeout !== null) {
  7856. clearTimeout(timerTimeout);
  7857. timerTimeout = null;
  7858. }
  7859. }
  7860. };
  7861. var resolve = once(function (res) {
  7862. // cache resolved
  7863. factory.resolved = ensureCtor(res, baseCtor);
  7864. // invoke callbacks only if this is not a synchronous resolve
  7865. // (async resolves are shimmed as synchronous during SSR)
  7866. if (!sync) {
  7867. forceRender(true);
  7868. } else {
  7869. owners.length = 0;
  7870. }
  7871. });
  7872. var reject = once(function (reason) {
  7873. true && warn(
  7874. "Failed to resolve async component: " + (String(factory)) +
  7875. (reason ? ("\nReason: " + reason) : '')
  7876. );
  7877. if (isDef(factory.errorComp)) {
  7878. factory.error = true;
  7879. forceRender(true);
  7880. }
  7881. });
  7882. var res = factory(resolve, reject);
  7883. if (isObject(res)) {
  7884. if (isPromise(res)) {
  7885. // () => Promise
  7886. if (isUndef(factory.resolved)) {
  7887. res.then(resolve, reject);
  7888. }
  7889. } else if (isPromise(res.component)) {
  7890. res.component.then(resolve, reject);
  7891. if (isDef(res.error)) {
  7892. factory.errorComp = ensureCtor(res.error, baseCtor);
  7893. }
  7894. if (isDef(res.loading)) {
  7895. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  7896. if (res.delay === 0) {
  7897. factory.loading = true;
  7898. } else {
  7899. timerLoading = setTimeout(function () {
  7900. timerLoading = null;
  7901. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  7902. factory.loading = true;
  7903. forceRender(false);
  7904. }
  7905. }, res.delay || 200);
  7906. }
  7907. }
  7908. if (isDef(res.timeout)) {
  7909. timerTimeout = setTimeout(function () {
  7910. timerTimeout = null;
  7911. if (isUndef(factory.resolved)) {
  7912. reject(
  7913. true
  7914. ? ("timeout (" + (res.timeout) + "ms)")
  7915. : undefined
  7916. );
  7917. }
  7918. }, res.timeout);
  7919. }
  7920. }
  7921. }
  7922. sync = false;
  7923. // return in case resolved synchronously
  7924. return factory.loading
  7925. ? factory.loadingComp
  7926. : factory.resolved
  7927. }
  7928. }
  7929. /* */
  7930. function isAsyncPlaceholder (node) {
  7931. return node.isComment && node.asyncFactory
  7932. }
  7933. /* */
  7934. function getFirstComponentChild (children) {
  7935. if (Array.isArray(children)) {
  7936. for (var i = 0; i < children.length; i++) {
  7937. var c = children[i];
  7938. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  7939. return c
  7940. }
  7941. }
  7942. }
  7943. }
  7944. /* */
  7945. /* */
  7946. function initEvents (vm) {
  7947. vm._events = Object.create(null);
  7948. vm._hasHookEvent = false;
  7949. // init parent attached events
  7950. var listeners = vm.$options._parentListeners;
  7951. if (listeners) {
  7952. updateComponentListeners(vm, listeners);
  7953. }
  7954. }
  7955. var target;
  7956. function add (event, fn) {
  7957. target.$on(event, fn);
  7958. }
  7959. function remove$1 (event, fn) {
  7960. target.$off(event, fn);
  7961. }
  7962. function createOnceHandler (event, fn) {
  7963. var _target = target;
  7964. return function onceHandler () {
  7965. var res = fn.apply(null, arguments);
  7966. if (res !== null) {
  7967. _target.$off(event, onceHandler);
  7968. }
  7969. }
  7970. }
  7971. function updateComponentListeners (
  7972. vm,
  7973. listeners,
  7974. oldListeners
  7975. ) {
  7976. target = vm;
  7977. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  7978. target = undefined;
  7979. }
  7980. function eventsMixin (Vue) {
  7981. var hookRE = /^hook:/;
  7982. Vue.prototype.$on = function (event, fn) {
  7983. var vm = this;
  7984. if (Array.isArray(event)) {
  7985. for (var i = 0, l = event.length; i < l; i++) {
  7986. vm.$on(event[i], fn);
  7987. }
  7988. } else {
  7989. (vm._events[event] || (vm._events[event] = [])).push(fn);
  7990. // optimize hook:event cost by using a boolean flag marked at registration
  7991. // instead of a hash lookup
  7992. if (hookRE.test(event)) {
  7993. vm._hasHookEvent = true;
  7994. }
  7995. }
  7996. return vm
  7997. };
  7998. Vue.prototype.$once = function (event, fn) {
  7999. var vm = this;
  8000. function on () {
  8001. vm.$off(event, on);
  8002. fn.apply(vm, arguments);
  8003. }
  8004. on.fn = fn;
  8005. vm.$on(event, on);
  8006. return vm
  8007. };
  8008. Vue.prototype.$off = function (event, fn) {
  8009. var vm = this;
  8010. // all
  8011. if (!arguments.length) {
  8012. vm._events = Object.create(null);
  8013. return vm
  8014. }
  8015. // array of events
  8016. if (Array.isArray(event)) {
  8017. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  8018. vm.$off(event[i$1], fn);
  8019. }
  8020. return vm
  8021. }
  8022. // specific event
  8023. var cbs = vm._events[event];
  8024. if (!cbs) {
  8025. return vm
  8026. }
  8027. if (!fn) {
  8028. vm._events[event] = null;
  8029. return vm
  8030. }
  8031. // specific handler
  8032. var cb;
  8033. var i = cbs.length;
  8034. while (i--) {
  8035. cb = cbs[i];
  8036. if (cb === fn || cb.fn === fn) {
  8037. cbs.splice(i, 1);
  8038. break
  8039. }
  8040. }
  8041. return vm
  8042. };
  8043. Vue.prototype.$emit = function (event) {
  8044. var vm = this;
  8045. if (true) {
  8046. var lowerCaseEvent = event.toLowerCase();
  8047. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  8048. tip(
  8049. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  8050. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  8051. "Note that HTML attributes are case-insensitive and you cannot use " +
  8052. "v-on to listen to camelCase events when using in-DOM templates. " +
  8053. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  8054. );
  8055. }
  8056. }
  8057. var cbs = vm._events[event];
  8058. if (cbs) {
  8059. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  8060. var args = toArray(arguments, 1);
  8061. var info = "event handler for \"" + event + "\"";
  8062. for (var i = 0, l = cbs.length; i < l; i++) {
  8063. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  8064. }
  8065. }
  8066. return vm
  8067. };
  8068. }
  8069. /* */
  8070. var activeInstance = null;
  8071. var isUpdatingChildComponent = false;
  8072. function setActiveInstance(vm) {
  8073. var prevActiveInstance = activeInstance;
  8074. activeInstance = vm;
  8075. return function () {
  8076. activeInstance = prevActiveInstance;
  8077. }
  8078. }
  8079. function initLifecycle (vm) {
  8080. var options = vm.$options;
  8081. // locate first non-abstract parent
  8082. var parent = options.parent;
  8083. if (parent && !options.abstract) {
  8084. while (parent.$options.abstract && parent.$parent) {
  8085. parent = parent.$parent;
  8086. }
  8087. parent.$children.push(vm);
  8088. }
  8089. vm.$parent = parent;
  8090. vm.$root = parent ? parent.$root : vm;
  8091. vm.$children = [];
  8092. vm.$refs = {};
  8093. vm._watcher = null;
  8094. vm._inactive = null;
  8095. vm._directInactive = false;
  8096. vm._isMounted = false;
  8097. vm._isDestroyed = false;
  8098. vm._isBeingDestroyed = false;
  8099. }
  8100. function lifecycleMixin (Vue) {
  8101. Vue.prototype._update = function (vnode, hydrating) {
  8102. var vm = this;
  8103. var prevEl = vm.$el;
  8104. var prevVnode = vm._vnode;
  8105. var restoreActiveInstance = setActiveInstance(vm);
  8106. vm._vnode = vnode;
  8107. // Vue.prototype.__patch__ is injected in entry points
  8108. // based on the rendering backend used.
  8109. if (!prevVnode) {
  8110. // initial render
  8111. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  8112. } else {
  8113. // updates
  8114. vm.$el = vm.__patch__(prevVnode, vnode);
  8115. }
  8116. restoreActiveInstance();
  8117. // update __vue__ reference
  8118. if (prevEl) {
  8119. prevEl.__vue__ = null;
  8120. }
  8121. if (vm.$el) {
  8122. vm.$el.__vue__ = vm;
  8123. }
  8124. // if parent is an HOC, update its $el as well
  8125. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  8126. vm.$parent.$el = vm.$el;
  8127. }
  8128. // updated hook is called by the scheduler to ensure that children are
  8129. // updated in a parent's updated hook.
  8130. };
  8131. Vue.prototype.$forceUpdate = function () {
  8132. var vm = this;
  8133. if (vm._watcher) {
  8134. vm._watcher.update();
  8135. }
  8136. };
  8137. Vue.prototype.$destroy = function () {
  8138. var vm = this;
  8139. if (vm._isBeingDestroyed) {
  8140. return
  8141. }
  8142. callHook(vm, 'beforeDestroy');
  8143. vm._isBeingDestroyed = true;
  8144. // remove self from parent
  8145. var parent = vm.$parent;
  8146. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  8147. remove(parent.$children, vm);
  8148. }
  8149. // teardown watchers
  8150. if (vm._watcher) {
  8151. vm._watcher.teardown();
  8152. }
  8153. var i = vm._watchers.length;
  8154. while (i--) {
  8155. vm._watchers[i].teardown();
  8156. }
  8157. // remove reference from data ob
  8158. // frozen object may not have observer.
  8159. if (vm._data.__ob__) {
  8160. vm._data.__ob__.vmCount--;
  8161. }
  8162. // call the last hook...
  8163. vm._isDestroyed = true;
  8164. // invoke destroy hooks on current rendered tree
  8165. vm.__patch__(vm._vnode, null);
  8166. // fire destroyed hook
  8167. callHook(vm, 'destroyed');
  8168. // turn off all instance listeners.
  8169. vm.$off();
  8170. // remove __vue__ reference
  8171. if (vm.$el) {
  8172. vm.$el.__vue__ = null;
  8173. }
  8174. // release circular reference (#6759)
  8175. if (vm.$vnode) {
  8176. vm.$vnode.parent = null;
  8177. }
  8178. };
  8179. }
  8180. function updateChildComponent (
  8181. vm,
  8182. propsData,
  8183. listeners,
  8184. parentVnode,
  8185. renderChildren
  8186. ) {
  8187. if (true) {
  8188. isUpdatingChildComponent = true;
  8189. }
  8190. // determine whether component has slot children
  8191. // we need to do this before overwriting $options._renderChildren.
  8192. // check if there are dynamic scopedSlots (hand-written or compiled but with
  8193. // dynamic slot names). Static scoped slots compiled from template has the
  8194. // "$stable" marker.
  8195. var newScopedSlots = parentVnode.data.scopedSlots;
  8196. var oldScopedSlots = vm.$scopedSlots;
  8197. var hasDynamicScopedSlot = !!(
  8198. (newScopedSlots && !newScopedSlots.$stable) ||
  8199. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  8200. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  8201. );
  8202. // Any static slot children from the parent may have changed during parent's
  8203. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  8204. // update is necessary to ensure correctness.
  8205. var needsForceUpdate = !!(
  8206. renderChildren || // has new static slots
  8207. vm.$options._renderChildren || // has old static slots
  8208. hasDynamicScopedSlot
  8209. );
  8210. vm.$options._parentVnode = parentVnode;
  8211. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  8212. if (vm._vnode) { // update child tree's parent
  8213. vm._vnode.parent = parentVnode;
  8214. }
  8215. vm.$options._renderChildren = renderChildren;
  8216. // update $attrs and $listeners hash
  8217. // these are also reactive so they may trigger child update if the child
  8218. // used them during render
  8219. vm.$attrs = parentVnode.data.attrs || emptyObject;
  8220. vm.$listeners = listeners || emptyObject;
  8221. // update props
  8222. if (propsData && vm.$options.props) {
  8223. toggleObserving(false);
  8224. var props = vm._props;
  8225. var propKeys = vm.$options._propKeys || [];
  8226. for (var i = 0; i < propKeys.length; i++) {
  8227. var key = propKeys[i];
  8228. var propOptions = vm.$options.props; // wtf flow?
  8229. props[key] = validateProp(key, propOptions, propsData, vm);
  8230. }
  8231. toggleObserving(true);
  8232. // keep a copy of raw propsData
  8233. vm.$options.propsData = propsData;
  8234. }
  8235. // fixed by xxxxxx update properties(mp runtime)
  8236. vm._$updateProperties && vm._$updateProperties(vm);
  8237. // update listeners
  8238. listeners = listeners || emptyObject;
  8239. var oldListeners = vm.$options._parentListeners;
  8240. vm.$options._parentListeners = listeners;
  8241. updateComponentListeners(vm, listeners, oldListeners);
  8242. // resolve slots + force update if has children
  8243. if (needsForceUpdate) {
  8244. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  8245. vm.$forceUpdate();
  8246. }
  8247. if (true) {
  8248. isUpdatingChildComponent = false;
  8249. }
  8250. }
  8251. function isInInactiveTree (vm) {
  8252. while (vm && (vm = vm.$parent)) {
  8253. if (vm._inactive) { return true }
  8254. }
  8255. return false
  8256. }
  8257. function activateChildComponent (vm, direct) {
  8258. if (direct) {
  8259. vm._directInactive = false;
  8260. if (isInInactiveTree(vm)) {
  8261. return
  8262. }
  8263. } else if (vm._directInactive) {
  8264. return
  8265. }
  8266. if (vm._inactive || vm._inactive === null) {
  8267. vm._inactive = false;
  8268. for (var i = 0; i < vm.$children.length; i++) {
  8269. activateChildComponent(vm.$children[i]);
  8270. }
  8271. callHook(vm, 'activated');
  8272. }
  8273. }
  8274. function deactivateChildComponent (vm, direct) {
  8275. if (direct) {
  8276. vm._directInactive = true;
  8277. if (isInInactiveTree(vm)) {
  8278. return
  8279. }
  8280. }
  8281. if (!vm._inactive) {
  8282. vm._inactive = true;
  8283. for (var i = 0; i < vm.$children.length; i++) {
  8284. deactivateChildComponent(vm.$children[i]);
  8285. }
  8286. callHook(vm, 'deactivated');
  8287. }
  8288. }
  8289. function callHook (vm, hook) {
  8290. // #7573 disable dep collection when invoking lifecycle hooks
  8291. pushTarget();
  8292. var handlers = vm.$options[hook];
  8293. var info = hook + " hook";
  8294. if (handlers) {
  8295. for (var i = 0, j = handlers.length; i < j; i++) {
  8296. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  8297. }
  8298. }
  8299. if (vm._hasHookEvent) {
  8300. vm.$emit('hook:' + hook);
  8301. }
  8302. popTarget();
  8303. }
  8304. /* */
  8305. var MAX_UPDATE_COUNT = 100;
  8306. var queue = [];
  8307. var activatedChildren = [];
  8308. var has = {};
  8309. var circular = {};
  8310. var waiting = false;
  8311. var flushing = false;
  8312. var index = 0;
  8313. /**
  8314. * Reset the scheduler's state.
  8315. */
  8316. function resetSchedulerState () {
  8317. index = queue.length = activatedChildren.length = 0;
  8318. has = {};
  8319. if (true) {
  8320. circular = {};
  8321. }
  8322. waiting = flushing = false;
  8323. }
  8324. // Async edge case #6566 requires saving the timestamp when event listeners are
  8325. // attached. However, calling performance.now() has a perf overhead especially
  8326. // if the page has thousands of event listeners. Instead, we take a timestamp
  8327. // every time the scheduler flushes and use that for all event listeners
  8328. // attached during that flush.
  8329. var currentFlushTimestamp = 0;
  8330. // Async edge case fix requires storing an event listener's attach timestamp.
  8331. var getNow = Date.now;
  8332. // Determine what event timestamp the browser is using. Annoyingly, the
  8333. // timestamp can either be hi-res (relative to page load) or low-res
  8334. // (relative to UNIX epoch), so in order to compare time we have to use the
  8335. // same timestamp type when saving the flush timestamp.
  8336. // All IE versions use low-res event timestamps, and have problematic clock
  8337. // implementations (#9632)
  8338. if (inBrowser && !isIE) {
  8339. var performance = window.performance;
  8340. if (
  8341. performance &&
  8342. typeof performance.now === 'function' &&
  8343. getNow() > document.createEvent('Event').timeStamp
  8344. ) {
  8345. // if the event timestamp, although evaluated AFTER the Date.now(), is
  8346. // smaller than it, it means the event is using a hi-res timestamp,
  8347. // and we need to use the hi-res version for event listener timestamps as
  8348. // well.
  8349. getNow = function () { return performance.now(); };
  8350. }
  8351. }
  8352. /**
  8353. * Flush both queues and run the watchers.
  8354. */
  8355. function flushSchedulerQueue () {
  8356. currentFlushTimestamp = getNow();
  8357. flushing = true;
  8358. var watcher, id;
  8359. // Sort queue before flush.
  8360. // This ensures that:
  8361. // 1. Components are updated from parent to child. (because parent is always
  8362. // created before the child)
  8363. // 2. A component's user watchers are run before its render watcher (because
  8364. // user watchers are created before the render watcher)
  8365. // 3. If a component is destroyed during a parent component's watcher run,
  8366. // its watchers can be skipped.
  8367. queue.sort(function (a, b) { return a.id - b.id; });
  8368. // do not cache length because more watchers might be pushed
  8369. // as we run existing watchers
  8370. for (index = 0; index < queue.length; index++) {
  8371. watcher = queue[index];
  8372. if (watcher.before) {
  8373. watcher.before();
  8374. }
  8375. id = watcher.id;
  8376. has[id] = null;
  8377. watcher.run();
  8378. // in dev build, check and stop circular updates.
  8379. if ( true && has[id] != null) {
  8380. circular[id] = (circular[id] || 0) + 1;
  8381. if (circular[id] > MAX_UPDATE_COUNT) {
  8382. warn(
  8383. 'You may have an infinite update loop ' + (
  8384. watcher.user
  8385. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  8386. : "in a component render function."
  8387. ),
  8388. watcher.vm
  8389. );
  8390. break
  8391. }
  8392. }
  8393. }
  8394. // keep copies of post queues before resetting state
  8395. var activatedQueue = activatedChildren.slice();
  8396. var updatedQueue = queue.slice();
  8397. resetSchedulerState();
  8398. // call component updated and activated hooks
  8399. callActivatedHooks(activatedQueue);
  8400. callUpdatedHooks(updatedQueue);
  8401. // devtool hook
  8402. /* istanbul ignore if */
  8403. if (devtools && config.devtools) {
  8404. devtools.emit('flush');
  8405. }
  8406. }
  8407. function callUpdatedHooks (queue) {
  8408. var i = queue.length;
  8409. while (i--) {
  8410. var watcher = queue[i];
  8411. var vm = watcher.vm;
  8412. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  8413. callHook(vm, 'updated');
  8414. }
  8415. }
  8416. }
  8417. /**
  8418. * Queue a kept-alive component that was activated during patch.
  8419. * The queue will be processed after the entire tree has been patched.
  8420. */
  8421. function queueActivatedComponent (vm) {
  8422. // setting _inactive to false here so that a render function can
  8423. // rely on checking whether it's in an inactive tree (e.g. router-view)
  8424. vm._inactive = false;
  8425. activatedChildren.push(vm);
  8426. }
  8427. function callActivatedHooks (queue) {
  8428. for (var i = 0; i < queue.length; i++) {
  8429. queue[i]._inactive = true;
  8430. activateChildComponent(queue[i], true /* true */);
  8431. }
  8432. }
  8433. /**
  8434. * Push a watcher into the watcher queue.
  8435. * Jobs with duplicate IDs will be skipped unless it's
  8436. * pushed when the queue is being flushed.
  8437. */
  8438. function queueWatcher (watcher) {
  8439. var id = watcher.id;
  8440. if (has[id] == null) {
  8441. has[id] = true;
  8442. if (!flushing) {
  8443. queue.push(watcher);
  8444. } else {
  8445. // if already flushing, splice the watcher based on its id
  8446. // if already past its id, it will be run next immediately.
  8447. var i = queue.length - 1;
  8448. while (i > index && queue[i].id > watcher.id) {
  8449. i--;
  8450. }
  8451. queue.splice(i + 1, 0, watcher);
  8452. }
  8453. // queue the flush
  8454. if (!waiting) {
  8455. waiting = true;
  8456. if ( true && !config.async) {
  8457. flushSchedulerQueue();
  8458. return
  8459. }
  8460. nextTick(flushSchedulerQueue);
  8461. }
  8462. }
  8463. }
  8464. /* */
  8465. var uid$2 = 0;
  8466. /**
  8467. * A watcher parses an expression, collects dependencies,
  8468. * and fires callback when the expression value changes.
  8469. * This is used for both the $watch() api and directives.
  8470. */
  8471. var Watcher = function Watcher (
  8472. vm,
  8473. expOrFn,
  8474. cb,
  8475. options,
  8476. isRenderWatcher
  8477. ) {
  8478. this.vm = vm;
  8479. if (isRenderWatcher) {
  8480. vm._watcher = this;
  8481. }
  8482. vm._watchers.push(this);
  8483. // options
  8484. if (options) {
  8485. this.deep = !!options.deep;
  8486. this.user = !!options.user;
  8487. this.lazy = !!options.lazy;
  8488. this.sync = !!options.sync;
  8489. this.before = options.before;
  8490. } else {
  8491. this.deep = this.user = this.lazy = this.sync = false;
  8492. }
  8493. this.cb = cb;
  8494. this.id = ++uid$2; // uid for batching
  8495. this.active = true;
  8496. this.dirty = this.lazy; // for lazy watchers
  8497. this.deps = [];
  8498. this.newDeps = [];
  8499. this.depIds = new _Set();
  8500. this.newDepIds = new _Set();
  8501. this.expression = true
  8502. ? expOrFn.toString()
  8503. : undefined;
  8504. // parse expression for getter
  8505. if (typeof expOrFn === 'function') {
  8506. this.getter = expOrFn;
  8507. } else {
  8508. this.getter = parsePath(expOrFn);
  8509. if (!this.getter) {
  8510. this.getter = noop;
  8511. true && warn(
  8512. "Failed watching path: \"" + expOrFn + "\" " +
  8513. 'Watcher only accepts simple dot-delimited paths. ' +
  8514. 'For full control, use a function instead.',
  8515. vm
  8516. );
  8517. }
  8518. }
  8519. this.value = this.lazy
  8520. ? undefined
  8521. : this.get();
  8522. };
  8523. /**
  8524. * Evaluate the getter, and re-collect dependencies.
  8525. */
  8526. Watcher.prototype.get = function get () {
  8527. pushTarget(this);
  8528. var value;
  8529. var vm = this.vm;
  8530. try {
  8531. value = this.getter.call(vm, vm);
  8532. } catch (e) {
  8533. if (this.user) {
  8534. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  8535. } else {
  8536. throw e
  8537. }
  8538. } finally {
  8539. // "touch" every property so they are all tracked as
  8540. // dependencies for deep watching
  8541. if (this.deep) {
  8542. traverse(value);
  8543. }
  8544. popTarget();
  8545. this.cleanupDeps();
  8546. }
  8547. return value
  8548. };
  8549. /**
  8550. * Add a dependency to this directive.
  8551. */
  8552. Watcher.prototype.addDep = function addDep (dep) {
  8553. var id = dep.id;
  8554. if (!this.newDepIds.has(id)) {
  8555. this.newDepIds.add(id);
  8556. this.newDeps.push(dep);
  8557. if (!this.depIds.has(id)) {
  8558. dep.addSub(this);
  8559. }
  8560. }
  8561. };
  8562. /**
  8563. * Clean up for dependency collection.
  8564. */
  8565. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  8566. var i = this.deps.length;
  8567. while (i--) {
  8568. var dep = this.deps[i];
  8569. if (!this.newDepIds.has(dep.id)) {
  8570. dep.removeSub(this);
  8571. }
  8572. }
  8573. var tmp = this.depIds;
  8574. this.depIds = this.newDepIds;
  8575. this.newDepIds = tmp;
  8576. this.newDepIds.clear();
  8577. tmp = this.deps;
  8578. this.deps = this.newDeps;
  8579. this.newDeps = tmp;
  8580. this.newDeps.length = 0;
  8581. };
  8582. /**
  8583. * Subscriber interface.
  8584. * Will be called when a dependency changes.
  8585. */
  8586. Watcher.prototype.update = function update () {
  8587. /* istanbul ignore else */
  8588. if (this.lazy) {
  8589. this.dirty = true;
  8590. } else if (this.sync) {
  8591. this.run();
  8592. } else {
  8593. queueWatcher(this);
  8594. }
  8595. };
  8596. /**
  8597. * Scheduler job interface.
  8598. * Will be called by the scheduler.
  8599. */
  8600. Watcher.prototype.run = function run () {
  8601. if (this.active) {
  8602. var value = this.get();
  8603. if (
  8604. value !== this.value ||
  8605. // Deep watchers and watchers on Object/Arrays should fire even
  8606. // when the value is the same, because the value may
  8607. // have mutated.
  8608. isObject(value) ||
  8609. this.deep
  8610. ) {
  8611. // set new value
  8612. var oldValue = this.value;
  8613. this.value = value;
  8614. if (this.user) {
  8615. try {
  8616. this.cb.call(this.vm, value, oldValue);
  8617. } catch (e) {
  8618. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  8619. }
  8620. } else {
  8621. this.cb.call(this.vm, value, oldValue);
  8622. }
  8623. }
  8624. }
  8625. };
  8626. /**
  8627. * Evaluate the value of the watcher.
  8628. * This only gets called for lazy watchers.
  8629. */
  8630. Watcher.prototype.evaluate = function evaluate () {
  8631. this.value = this.get();
  8632. this.dirty = false;
  8633. };
  8634. /**
  8635. * Depend on all deps collected by this watcher.
  8636. */
  8637. Watcher.prototype.depend = function depend () {
  8638. var i = this.deps.length;
  8639. while (i--) {
  8640. this.deps[i].depend();
  8641. }
  8642. };
  8643. /**
  8644. * Remove self from all dependencies' subscriber list.
  8645. */
  8646. Watcher.prototype.teardown = function teardown () {
  8647. if (this.active) {
  8648. // remove self from vm's watcher list
  8649. // this is a somewhat expensive operation so we skip it
  8650. // if the vm is being destroyed.
  8651. if (!this.vm._isBeingDestroyed) {
  8652. remove(this.vm._watchers, this);
  8653. }
  8654. var i = this.deps.length;
  8655. while (i--) {
  8656. this.deps[i].removeSub(this);
  8657. }
  8658. this.active = false;
  8659. }
  8660. };
  8661. /* */
  8662. var sharedPropertyDefinition = {
  8663. enumerable: true,
  8664. configurable: true,
  8665. get: noop,
  8666. set: noop
  8667. };
  8668. function proxy (target, sourceKey, key) {
  8669. sharedPropertyDefinition.get = function proxyGetter () {
  8670. return this[sourceKey][key]
  8671. };
  8672. sharedPropertyDefinition.set = function proxySetter (val) {
  8673. this[sourceKey][key] = val;
  8674. };
  8675. Object.defineProperty(target, key, sharedPropertyDefinition);
  8676. }
  8677. function initState (vm) {
  8678. vm._watchers = [];
  8679. var opts = vm.$options;
  8680. if (opts.props) { initProps(vm, opts.props); }
  8681. if (opts.methods) { initMethods(vm, opts.methods); }
  8682. if (opts.data) {
  8683. initData(vm);
  8684. } else {
  8685. observe(vm._data = {}, true /* asRootData */);
  8686. }
  8687. if (opts.computed) { initComputed(vm, opts.computed); }
  8688. if (opts.watch && opts.watch !== nativeWatch) {
  8689. initWatch(vm, opts.watch);
  8690. }
  8691. }
  8692. function initProps (vm, propsOptions) {
  8693. var propsData = vm.$options.propsData || {};
  8694. var props = vm._props = {};
  8695. // cache prop keys so that future props updates can iterate using Array
  8696. // instead of dynamic object key enumeration.
  8697. var keys = vm.$options._propKeys = [];
  8698. var isRoot = !vm.$parent;
  8699. // root instance props should be converted
  8700. if (!isRoot) {
  8701. toggleObserving(false);
  8702. }
  8703. var loop = function ( key ) {
  8704. keys.push(key);
  8705. var value = validateProp(key, propsOptions, propsData, vm);
  8706. /* istanbul ignore else */
  8707. if (true) {
  8708. var hyphenatedKey = hyphenate(key);
  8709. if (isReservedAttribute(hyphenatedKey) ||
  8710. config.isReservedAttr(hyphenatedKey)) {
  8711. warn(
  8712. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  8713. vm
  8714. );
  8715. }
  8716. defineReactive$$1(props, key, value, function () {
  8717. if (!isRoot && !isUpdatingChildComponent) {
  8718. {
  8719. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou'){//百度、快手 observer 在 setData callback 之后触发,直接忽略该 warn
  8720. return
  8721. }
  8722. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  8723. if(
  8724. key === 'value' &&
  8725. Array.isArray(vm.$options.behaviors) &&
  8726. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  8727. ){
  8728. return
  8729. }
  8730. if(vm._getFormData){
  8731. return
  8732. }
  8733. var $parent = vm.$parent;
  8734. while($parent){
  8735. if($parent.__next_tick_pending){
  8736. return
  8737. }
  8738. $parent = $parent.$parent;
  8739. }
  8740. }
  8741. warn(
  8742. "Avoid mutating a prop directly since the value will be " +
  8743. "overwritten whenever the parent component re-renders. " +
  8744. "Instead, use a data or computed property based on the prop's " +
  8745. "value. Prop being mutated: \"" + key + "\"",
  8746. vm
  8747. );
  8748. }
  8749. });
  8750. } else {}
  8751. // static props are already proxied on the component's prototype
  8752. // during Vue.extend(). We only need to proxy props defined at
  8753. // instantiation here.
  8754. if (!(key in vm)) {
  8755. proxy(vm, "_props", key);
  8756. }
  8757. };
  8758. for (var key in propsOptions) loop( key );
  8759. toggleObserving(true);
  8760. }
  8761. function initData (vm) {
  8762. var data = vm.$options.data;
  8763. data = vm._data = typeof data === 'function'
  8764. ? getData(data, vm)
  8765. : data || {};
  8766. if (!isPlainObject(data)) {
  8767. data = {};
  8768. true && warn(
  8769. 'data functions should return an object:\n' +
  8770. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  8771. vm
  8772. );
  8773. }
  8774. // proxy data on instance
  8775. var keys = Object.keys(data);
  8776. var props = vm.$options.props;
  8777. var methods = vm.$options.methods;
  8778. var i = keys.length;
  8779. while (i--) {
  8780. var key = keys[i];
  8781. if (true) {
  8782. if (methods && hasOwn(methods, key)) {
  8783. warn(
  8784. ("Method \"" + key + "\" has already been defined as a data property."),
  8785. vm
  8786. );
  8787. }
  8788. }
  8789. if (props && hasOwn(props, key)) {
  8790. true && warn(
  8791. "The data property \"" + key + "\" is already declared as a prop. " +
  8792. "Use prop default value instead.",
  8793. vm
  8794. );
  8795. } else if (!isReserved(key)) {
  8796. proxy(vm, "_data", key);
  8797. }
  8798. }
  8799. // observe data
  8800. observe(data, true /* asRootData */);
  8801. }
  8802. function getData (data, vm) {
  8803. // #7573 disable dep collection when invoking data getters
  8804. pushTarget();
  8805. try {
  8806. return data.call(vm, vm)
  8807. } catch (e) {
  8808. handleError(e, vm, "data()");
  8809. return {}
  8810. } finally {
  8811. popTarget();
  8812. }
  8813. }
  8814. var computedWatcherOptions = { lazy: true };
  8815. function initComputed (vm, computed) {
  8816. // $flow-disable-line
  8817. var watchers = vm._computedWatchers = Object.create(null);
  8818. // computed properties are just getters during SSR
  8819. var isSSR = isServerRendering();
  8820. for (var key in computed) {
  8821. var userDef = computed[key];
  8822. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  8823. if ( true && getter == null) {
  8824. warn(
  8825. ("Getter is missing for computed property \"" + key + "\"."),
  8826. vm
  8827. );
  8828. }
  8829. if (!isSSR) {
  8830. // create internal watcher for the computed property.
  8831. watchers[key] = new Watcher(
  8832. vm,
  8833. getter || noop,
  8834. noop,
  8835. computedWatcherOptions
  8836. );
  8837. }
  8838. // component-defined computed properties are already defined on the
  8839. // component prototype. We only need to define computed properties defined
  8840. // at instantiation here.
  8841. if (!(key in vm)) {
  8842. defineComputed(vm, key, userDef);
  8843. } else if (true) {
  8844. if (key in vm.$data) {
  8845. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  8846. } else if (vm.$options.props && key in vm.$options.props) {
  8847. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  8848. }
  8849. }
  8850. }
  8851. }
  8852. function defineComputed (
  8853. target,
  8854. key,
  8855. userDef
  8856. ) {
  8857. var shouldCache = !isServerRendering();
  8858. if (typeof userDef === 'function') {
  8859. sharedPropertyDefinition.get = shouldCache
  8860. ? createComputedGetter(key)
  8861. : createGetterInvoker(userDef);
  8862. sharedPropertyDefinition.set = noop;
  8863. } else {
  8864. sharedPropertyDefinition.get = userDef.get
  8865. ? shouldCache && userDef.cache !== false
  8866. ? createComputedGetter(key)
  8867. : createGetterInvoker(userDef.get)
  8868. : noop;
  8869. sharedPropertyDefinition.set = userDef.set || noop;
  8870. }
  8871. if ( true &&
  8872. sharedPropertyDefinition.set === noop) {
  8873. sharedPropertyDefinition.set = function () {
  8874. warn(
  8875. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  8876. this
  8877. );
  8878. };
  8879. }
  8880. Object.defineProperty(target, key, sharedPropertyDefinition);
  8881. }
  8882. function createComputedGetter (key) {
  8883. return function computedGetter () {
  8884. var watcher = this._computedWatchers && this._computedWatchers[key];
  8885. if (watcher) {
  8886. if (watcher.dirty) {
  8887. watcher.evaluate();
  8888. }
  8889. if (Dep.SharedObject.target) {// fixed by xxxxxx
  8890. watcher.depend();
  8891. }
  8892. return watcher.value
  8893. }
  8894. }
  8895. }
  8896. function createGetterInvoker(fn) {
  8897. return function computedGetter () {
  8898. return fn.call(this, this)
  8899. }
  8900. }
  8901. function initMethods (vm, methods) {
  8902. var props = vm.$options.props;
  8903. for (var key in methods) {
  8904. if (true) {
  8905. if (typeof methods[key] !== 'function') {
  8906. warn(
  8907. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  8908. "Did you reference the function correctly?",
  8909. vm
  8910. );
  8911. }
  8912. if (props && hasOwn(props, key)) {
  8913. warn(
  8914. ("Method \"" + key + "\" has already been defined as a prop."),
  8915. vm
  8916. );
  8917. }
  8918. if ((key in vm) && isReserved(key)) {
  8919. warn(
  8920. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  8921. "Avoid defining component methods that start with _ or $."
  8922. );
  8923. }
  8924. }
  8925. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  8926. }
  8927. }
  8928. function initWatch (vm, watch) {
  8929. for (var key in watch) {
  8930. var handler = watch[key];
  8931. if (Array.isArray(handler)) {
  8932. for (var i = 0; i < handler.length; i++) {
  8933. createWatcher(vm, key, handler[i]);
  8934. }
  8935. } else {
  8936. createWatcher(vm, key, handler);
  8937. }
  8938. }
  8939. }
  8940. function createWatcher (
  8941. vm,
  8942. expOrFn,
  8943. handler,
  8944. options
  8945. ) {
  8946. if (isPlainObject(handler)) {
  8947. options = handler;
  8948. handler = handler.handler;
  8949. }
  8950. if (typeof handler === 'string') {
  8951. handler = vm[handler];
  8952. }
  8953. return vm.$watch(expOrFn, handler, options)
  8954. }
  8955. function stateMixin (Vue) {
  8956. // flow somehow has problems with directly declared definition object
  8957. // when using Object.defineProperty, so we have to procedurally build up
  8958. // the object here.
  8959. var dataDef = {};
  8960. dataDef.get = function () { return this._data };
  8961. var propsDef = {};
  8962. propsDef.get = function () { return this._props };
  8963. if (true) {
  8964. dataDef.set = function () {
  8965. warn(
  8966. 'Avoid replacing instance root $data. ' +
  8967. 'Use nested data properties instead.',
  8968. this
  8969. );
  8970. };
  8971. propsDef.set = function () {
  8972. warn("$props is readonly.", this);
  8973. };
  8974. }
  8975. Object.defineProperty(Vue.prototype, '$data', dataDef);
  8976. Object.defineProperty(Vue.prototype, '$props', propsDef);
  8977. Vue.prototype.$set = set;
  8978. Vue.prototype.$delete = del;
  8979. Vue.prototype.$watch = function (
  8980. expOrFn,
  8981. cb,
  8982. options
  8983. ) {
  8984. var vm = this;
  8985. if (isPlainObject(cb)) {
  8986. return createWatcher(vm, expOrFn, cb, options)
  8987. }
  8988. options = options || {};
  8989. options.user = true;
  8990. var watcher = new Watcher(vm, expOrFn, cb, options);
  8991. if (options.immediate) {
  8992. try {
  8993. cb.call(vm, watcher.value);
  8994. } catch (error) {
  8995. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  8996. }
  8997. }
  8998. return function unwatchFn () {
  8999. watcher.teardown();
  9000. }
  9001. };
  9002. }
  9003. /* */
  9004. var uid$3 = 0;
  9005. function initMixin (Vue) {
  9006. Vue.prototype._init = function (options) {
  9007. var vm = this;
  9008. // a uid
  9009. vm._uid = uid$3++;
  9010. var startTag, endTag;
  9011. /* istanbul ignore if */
  9012. if ( true && config.performance && mark) {
  9013. startTag = "vue-perf-start:" + (vm._uid);
  9014. endTag = "vue-perf-end:" + (vm._uid);
  9015. mark(startTag);
  9016. }
  9017. // a flag to avoid this being observed
  9018. vm._isVue = true;
  9019. // merge options
  9020. if (options && options._isComponent) {
  9021. // optimize internal component instantiation
  9022. // since dynamic options merging is pretty slow, and none of the
  9023. // internal component options needs special treatment.
  9024. initInternalComponent(vm, options);
  9025. } else {
  9026. vm.$options = mergeOptions(
  9027. resolveConstructorOptions(vm.constructor),
  9028. options || {},
  9029. vm
  9030. );
  9031. }
  9032. /* istanbul ignore else */
  9033. if (true) {
  9034. initProxy(vm);
  9035. } else {}
  9036. // expose real self
  9037. vm._self = vm;
  9038. initLifecycle(vm);
  9039. initEvents(vm);
  9040. initRender(vm);
  9041. callHook(vm, 'beforeCreate');
  9042. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  9043. initState(vm);
  9044. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  9045. !vm._$fallback && callHook(vm, 'created');
  9046. /* istanbul ignore if */
  9047. if ( true && config.performance && mark) {
  9048. vm._name = formatComponentName(vm, false);
  9049. mark(endTag);
  9050. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  9051. }
  9052. if (vm.$options.el) {
  9053. vm.$mount(vm.$options.el);
  9054. }
  9055. };
  9056. }
  9057. function initInternalComponent (vm, options) {
  9058. var opts = vm.$options = Object.create(vm.constructor.options);
  9059. // doing this because it's faster than dynamic enumeration.
  9060. var parentVnode = options._parentVnode;
  9061. opts.parent = options.parent;
  9062. opts._parentVnode = parentVnode;
  9063. var vnodeComponentOptions = parentVnode.componentOptions;
  9064. opts.propsData = vnodeComponentOptions.propsData;
  9065. opts._parentListeners = vnodeComponentOptions.listeners;
  9066. opts._renderChildren = vnodeComponentOptions.children;
  9067. opts._componentTag = vnodeComponentOptions.tag;
  9068. if (options.render) {
  9069. opts.render = options.render;
  9070. opts.staticRenderFns = options.staticRenderFns;
  9071. }
  9072. }
  9073. function resolveConstructorOptions (Ctor) {
  9074. var options = Ctor.options;
  9075. if (Ctor.super) {
  9076. var superOptions = resolveConstructorOptions(Ctor.super);
  9077. var cachedSuperOptions = Ctor.superOptions;
  9078. if (superOptions !== cachedSuperOptions) {
  9079. // super option changed,
  9080. // need to resolve new options.
  9081. Ctor.superOptions = superOptions;
  9082. // check if there are any late-modified/attached options (#4976)
  9083. var modifiedOptions = resolveModifiedOptions(Ctor);
  9084. // update base extend options
  9085. if (modifiedOptions) {
  9086. extend(Ctor.extendOptions, modifiedOptions);
  9087. }
  9088. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  9089. if (options.name) {
  9090. options.components[options.name] = Ctor;
  9091. }
  9092. }
  9093. }
  9094. return options
  9095. }
  9096. function resolveModifiedOptions (Ctor) {
  9097. var modified;
  9098. var latest = Ctor.options;
  9099. var sealed = Ctor.sealedOptions;
  9100. for (var key in latest) {
  9101. if (latest[key] !== sealed[key]) {
  9102. if (!modified) { modified = {}; }
  9103. modified[key] = latest[key];
  9104. }
  9105. }
  9106. return modified
  9107. }
  9108. function Vue (options) {
  9109. if ( true &&
  9110. !(this instanceof Vue)
  9111. ) {
  9112. warn('Vue is a constructor and should be called with the `new` keyword');
  9113. }
  9114. this._init(options);
  9115. }
  9116. initMixin(Vue);
  9117. stateMixin(Vue);
  9118. eventsMixin(Vue);
  9119. lifecycleMixin(Vue);
  9120. renderMixin(Vue);
  9121. /* */
  9122. function initUse (Vue) {
  9123. Vue.use = function (plugin) {
  9124. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  9125. if (installedPlugins.indexOf(plugin) > -1) {
  9126. return this
  9127. }
  9128. // additional parameters
  9129. var args = toArray(arguments, 1);
  9130. args.unshift(this);
  9131. if (typeof plugin.install === 'function') {
  9132. plugin.install.apply(plugin, args);
  9133. } else if (typeof plugin === 'function') {
  9134. plugin.apply(null, args);
  9135. }
  9136. installedPlugins.push(plugin);
  9137. return this
  9138. };
  9139. }
  9140. /* */
  9141. function initMixin$1 (Vue) {
  9142. Vue.mixin = function (mixin) {
  9143. this.options = mergeOptions(this.options, mixin);
  9144. return this
  9145. };
  9146. }
  9147. /* */
  9148. function initExtend (Vue) {
  9149. /**
  9150. * Each instance constructor, including Vue, has a unique
  9151. * cid. This enables us to create wrapped "child
  9152. * constructors" for prototypal inheritance and cache them.
  9153. */
  9154. Vue.cid = 0;
  9155. var cid = 1;
  9156. /**
  9157. * Class inheritance
  9158. */
  9159. Vue.extend = function (extendOptions) {
  9160. extendOptions = extendOptions || {};
  9161. var Super = this;
  9162. var SuperId = Super.cid;
  9163. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  9164. if (cachedCtors[SuperId]) {
  9165. return cachedCtors[SuperId]
  9166. }
  9167. var name = extendOptions.name || Super.options.name;
  9168. if ( true && name) {
  9169. validateComponentName(name);
  9170. }
  9171. var Sub = function VueComponent (options) {
  9172. this._init(options);
  9173. };
  9174. Sub.prototype = Object.create(Super.prototype);
  9175. Sub.prototype.constructor = Sub;
  9176. Sub.cid = cid++;
  9177. Sub.options = mergeOptions(
  9178. Super.options,
  9179. extendOptions
  9180. );
  9181. Sub['super'] = Super;
  9182. // For props and computed properties, we define the proxy getters on
  9183. // the Vue instances at extension time, on the extended prototype. This
  9184. // avoids Object.defineProperty calls for each instance created.
  9185. if (Sub.options.props) {
  9186. initProps$1(Sub);
  9187. }
  9188. if (Sub.options.computed) {
  9189. initComputed$1(Sub);
  9190. }
  9191. // allow further extension/mixin/plugin usage
  9192. Sub.extend = Super.extend;
  9193. Sub.mixin = Super.mixin;
  9194. Sub.use = Super.use;
  9195. // create asset registers, so extended classes
  9196. // can have their private assets too.
  9197. ASSET_TYPES.forEach(function (type) {
  9198. Sub[type] = Super[type];
  9199. });
  9200. // enable recursive self-lookup
  9201. if (name) {
  9202. Sub.options.components[name] = Sub;
  9203. }
  9204. // keep a reference to the super options at extension time.
  9205. // later at instantiation we can check if Super's options have
  9206. // been updated.
  9207. Sub.superOptions = Super.options;
  9208. Sub.extendOptions = extendOptions;
  9209. Sub.sealedOptions = extend({}, Sub.options);
  9210. // cache constructor
  9211. cachedCtors[SuperId] = Sub;
  9212. return Sub
  9213. };
  9214. }
  9215. function initProps$1 (Comp) {
  9216. var props = Comp.options.props;
  9217. for (var key in props) {
  9218. proxy(Comp.prototype, "_props", key);
  9219. }
  9220. }
  9221. function initComputed$1 (Comp) {
  9222. var computed = Comp.options.computed;
  9223. for (var key in computed) {
  9224. defineComputed(Comp.prototype, key, computed[key]);
  9225. }
  9226. }
  9227. /* */
  9228. function initAssetRegisters (Vue) {
  9229. /**
  9230. * Create asset registration methods.
  9231. */
  9232. ASSET_TYPES.forEach(function (type) {
  9233. Vue[type] = function (
  9234. id,
  9235. definition
  9236. ) {
  9237. if (!definition) {
  9238. return this.options[type + 's'][id]
  9239. } else {
  9240. /* istanbul ignore if */
  9241. if ( true && type === 'component') {
  9242. validateComponentName(id);
  9243. }
  9244. if (type === 'component' && isPlainObject(definition)) {
  9245. definition.name = definition.name || id;
  9246. definition = this.options._base.extend(definition);
  9247. }
  9248. if (type === 'directive' && typeof definition === 'function') {
  9249. definition = { bind: definition, update: definition };
  9250. }
  9251. this.options[type + 's'][id] = definition;
  9252. return definition
  9253. }
  9254. };
  9255. });
  9256. }
  9257. /* */
  9258. function getComponentName (opts) {
  9259. return opts && (opts.Ctor.options.name || opts.tag)
  9260. }
  9261. function matches (pattern, name) {
  9262. if (Array.isArray(pattern)) {
  9263. return pattern.indexOf(name) > -1
  9264. } else if (typeof pattern === 'string') {
  9265. return pattern.split(',').indexOf(name) > -1
  9266. } else if (isRegExp(pattern)) {
  9267. return pattern.test(name)
  9268. }
  9269. /* istanbul ignore next */
  9270. return false
  9271. }
  9272. function pruneCache (keepAliveInstance, filter) {
  9273. var cache = keepAliveInstance.cache;
  9274. var keys = keepAliveInstance.keys;
  9275. var _vnode = keepAliveInstance._vnode;
  9276. for (var key in cache) {
  9277. var cachedNode = cache[key];
  9278. if (cachedNode) {
  9279. var name = getComponentName(cachedNode.componentOptions);
  9280. if (name && !filter(name)) {
  9281. pruneCacheEntry(cache, key, keys, _vnode);
  9282. }
  9283. }
  9284. }
  9285. }
  9286. function pruneCacheEntry (
  9287. cache,
  9288. key,
  9289. keys,
  9290. current
  9291. ) {
  9292. var cached$$1 = cache[key];
  9293. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  9294. cached$$1.componentInstance.$destroy();
  9295. }
  9296. cache[key] = null;
  9297. remove(keys, key);
  9298. }
  9299. var patternTypes = [String, RegExp, Array];
  9300. var KeepAlive = {
  9301. name: 'keep-alive',
  9302. abstract: true,
  9303. props: {
  9304. include: patternTypes,
  9305. exclude: patternTypes,
  9306. max: [String, Number]
  9307. },
  9308. created: function created () {
  9309. this.cache = Object.create(null);
  9310. this.keys = [];
  9311. },
  9312. destroyed: function destroyed () {
  9313. for (var key in this.cache) {
  9314. pruneCacheEntry(this.cache, key, this.keys);
  9315. }
  9316. },
  9317. mounted: function mounted () {
  9318. var this$1 = this;
  9319. this.$watch('include', function (val) {
  9320. pruneCache(this$1, function (name) { return matches(val, name); });
  9321. });
  9322. this.$watch('exclude', function (val) {
  9323. pruneCache(this$1, function (name) { return !matches(val, name); });
  9324. });
  9325. },
  9326. render: function render () {
  9327. var slot = this.$slots.default;
  9328. var vnode = getFirstComponentChild(slot);
  9329. var componentOptions = vnode && vnode.componentOptions;
  9330. if (componentOptions) {
  9331. // check pattern
  9332. var name = getComponentName(componentOptions);
  9333. var ref = this;
  9334. var include = ref.include;
  9335. var exclude = ref.exclude;
  9336. if (
  9337. // not included
  9338. (include && (!name || !matches(include, name))) ||
  9339. // excluded
  9340. (exclude && name && matches(exclude, name))
  9341. ) {
  9342. return vnode
  9343. }
  9344. var ref$1 = this;
  9345. var cache = ref$1.cache;
  9346. var keys = ref$1.keys;
  9347. var key = vnode.key == null
  9348. // same constructor may get registered as different local components
  9349. // so cid alone is not enough (#3269)
  9350. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  9351. : vnode.key;
  9352. if (cache[key]) {
  9353. vnode.componentInstance = cache[key].componentInstance;
  9354. // make current key freshest
  9355. remove(keys, key);
  9356. keys.push(key);
  9357. } else {
  9358. cache[key] = vnode;
  9359. keys.push(key);
  9360. // prune oldest entry
  9361. if (this.max && keys.length > parseInt(this.max)) {
  9362. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  9363. }
  9364. }
  9365. vnode.data.keepAlive = true;
  9366. }
  9367. return vnode || (slot && slot[0])
  9368. }
  9369. };
  9370. var builtInComponents = {
  9371. KeepAlive: KeepAlive
  9372. };
  9373. /* */
  9374. function initGlobalAPI (Vue) {
  9375. // config
  9376. var configDef = {};
  9377. configDef.get = function () { return config; };
  9378. if (true) {
  9379. configDef.set = function () {
  9380. warn(
  9381. 'Do not replace the Vue.config object, set individual fields instead.'
  9382. );
  9383. };
  9384. }
  9385. Object.defineProperty(Vue, 'config', configDef);
  9386. // exposed util methods.
  9387. // NOTE: these are not considered part of the public API - avoid relying on
  9388. // them unless you are aware of the risk.
  9389. Vue.util = {
  9390. warn: warn,
  9391. extend: extend,
  9392. mergeOptions: mergeOptions,
  9393. defineReactive: defineReactive$$1
  9394. };
  9395. Vue.set = set;
  9396. Vue.delete = del;
  9397. Vue.nextTick = nextTick;
  9398. // 2.6 explicit observable API
  9399. Vue.observable = function (obj) {
  9400. observe(obj);
  9401. return obj
  9402. };
  9403. Vue.options = Object.create(null);
  9404. ASSET_TYPES.forEach(function (type) {
  9405. Vue.options[type + 's'] = Object.create(null);
  9406. });
  9407. // this is used to identify the "base" constructor to extend all plain-object
  9408. // components with in Weex's multi-instance scenarios.
  9409. Vue.options._base = Vue;
  9410. extend(Vue.options.components, builtInComponents);
  9411. initUse(Vue);
  9412. initMixin$1(Vue);
  9413. initExtend(Vue);
  9414. initAssetRegisters(Vue);
  9415. }
  9416. initGlobalAPI(Vue);
  9417. Object.defineProperty(Vue.prototype, '$isServer', {
  9418. get: isServerRendering
  9419. });
  9420. Object.defineProperty(Vue.prototype, '$ssrContext', {
  9421. get: function get () {
  9422. /* istanbul ignore next */
  9423. return this.$vnode && this.$vnode.ssrContext
  9424. }
  9425. });
  9426. // expose FunctionalRenderContext for ssr runtime helper installation
  9427. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  9428. value: FunctionalRenderContext
  9429. });
  9430. Vue.version = '2.6.11';
  9431. /**
  9432. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  9433. */
  9434. var ARRAYTYPE = '[object Array]';
  9435. var OBJECTTYPE = '[object Object]';
  9436. // const FUNCTIONTYPE = '[object Function]'
  9437. function diff(current, pre) {
  9438. var result = {};
  9439. syncKeys(current, pre);
  9440. _diff(current, pre, '', result);
  9441. return result
  9442. }
  9443. function syncKeys(current, pre) {
  9444. if (current === pre) { return }
  9445. var rootCurrentType = type(current);
  9446. var rootPreType = type(pre);
  9447. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  9448. if(Object.keys(current).length >= Object.keys(pre).length){
  9449. for (var key in pre) {
  9450. var currentValue = current[key];
  9451. if (currentValue === undefined) {
  9452. current[key] = null;
  9453. } else {
  9454. syncKeys(currentValue, pre[key]);
  9455. }
  9456. }
  9457. }
  9458. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  9459. if (current.length >= pre.length) {
  9460. pre.forEach(function (item, index) {
  9461. syncKeys(current[index], item);
  9462. });
  9463. }
  9464. }
  9465. }
  9466. function _diff(current, pre, path, result) {
  9467. if (current === pre) { return }
  9468. var rootCurrentType = type(current);
  9469. var rootPreType = type(pre);
  9470. if (rootCurrentType == OBJECTTYPE) {
  9471. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  9472. setResult(result, path, current);
  9473. } else {
  9474. var loop = function ( key ) {
  9475. var currentValue = current[key];
  9476. var preValue = pre[key];
  9477. var currentType = type(currentValue);
  9478. var preType = type(preValue);
  9479. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  9480. // NOTE 此处将 != 修改为 !==。涉及地方太多恐怕测试不到,如果出现数据对比问题,将其修改回来。
  9481. if (currentValue !== pre[key]) {
  9482. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  9483. }
  9484. } else if (currentType == ARRAYTYPE) {
  9485. if (preType != ARRAYTYPE) {
  9486. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  9487. } else {
  9488. if (currentValue.length < preValue.length) {
  9489. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  9490. } else {
  9491. currentValue.forEach(function (item, index) {
  9492. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  9493. });
  9494. }
  9495. }
  9496. } else if (currentType == OBJECTTYPE) {
  9497. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  9498. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  9499. } else {
  9500. for (var subKey in currentValue) {
  9501. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  9502. }
  9503. }
  9504. }
  9505. };
  9506. for (var key in current) loop( key );
  9507. }
  9508. } else if (rootCurrentType == ARRAYTYPE) {
  9509. if (rootPreType != ARRAYTYPE) {
  9510. setResult(result, path, current);
  9511. } else {
  9512. if (current.length < pre.length) {
  9513. setResult(result, path, current);
  9514. } else {
  9515. current.forEach(function (item, index) {
  9516. _diff(item, pre[index], path + '[' + index + ']', result);
  9517. });
  9518. }
  9519. }
  9520. } else {
  9521. setResult(result, path, current);
  9522. }
  9523. }
  9524. function setResult(result, k, v) {
  9525. // if (type(v) != FUNCTIONTYPE) {
  9526. result[k] = v;
  9527. // }
  9528. }
  9529. function type(obj) {
  9530. return Object.prototype.toString.call(obj)
  9531. }
  9532. /* */
  9533. function flushCallbacks$1(vm) {
  9534. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  9535. if (Object({"VUE_APP_NAME":"swim-weapp","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  9536. var mpInstance = vm.$scope;
  9537. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  9538. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  9539. }
  9540. var copies = vm.__next_tick_callbacks.slice(0);
  9541. vm.__next_tick_callbacks.length = 0;
  9542. for (var i = 0; i < copies.length; i++) {
  9543. copies[i]();
  9544. }
  9545. }
  9546. }
  9547. function hasRenderWatcher(vm) {
  9548. return queue.find(function (watcher) { return vm._watcher === watcher; })
  9549. }
  9550. function nextTick$1(vm, cb) {
  9551. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  9552. //2.nextTick 之前存在 render watcher
  9553. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  9554. if(Object({"VUE_APP_NAME":"swim-weapp","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  9555. var mpInstance = vm.$scope;
  9556. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  9557. ']:nextVueTick');
  9558. }
  9559. return nextTick(cb, vm)
  9560. }else{
  9561. if(Object({"VUE_APP_NAME":"swim-weapp","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  9562. var mpInstance$1 = vm.$scope;
  9563. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  9564. ']:nextMPTick');
  9565. }
  9566. }
  9567. var _resolve;
  9568. if (!vm.__next_tick_callbacks) {
  9569. vm.__next_tick_callbacks = [];
  9570. }
  9571. vm.__next_tick_callbacks.push(function () {
  9572. if (cb) {
  9573. try {
  9574. cb.call(vm);
  9575. } catch (e) {
  9576. handleError(e, vm, 'nextTick');
  9577. }
  9578. } else if (_resolve) {
  9579. _resolve(vm);
  9580. }
  9581. });
  9582. // $flow-disable-line
  9583. if (!cb && typeof Promise !== 'undefined') {
  9584. return new Promise(function (resolve) {
  9585. _resolve = resolve;
  9586. })
  9587. }
  9588. }
  9589. /* */
  9590. function cloneWithData(vm) {
  9591. // 确保当前 vm 所有数据被同步
  9592. var ret = Object.create(null);
  9593. var dataKeys = [].concat(
  9594. Object.keys(vm._data || {}),
  9595. Object.keys(vm._computedWatchers || {}));
  9596. dataKeys.reduce(function(ret, key) {
  9597. ret[key] = vm[key];
  9598. return ret
  9599. }, ret);
  9600. // vue-composition-api
  9601. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  9602. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  9603. if (rawBindings) {
  9604. Object.keys(rawBindings).forEach(function (key) {
  9605. ret[key] = vm[key];
  9606. });
  9607. }
  9608. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  9609. Object.assign(ret, vm.$mp.data || {});
  9610. if (
  9611. Array.isArray(vm.$options.behaviors) &&
  9612. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  9613. ) { //form-field
  9614. ret['name'] = vm.name;
  9615. ret['value'] = vm.value;
  9616. }
  9617. return JSON.parse(JSON.stringify(ret))
  9618. }
  9619. var patch = function(oldVnode, vnode) {
  9620. var this$1 = this;
  9621. if (vnode === null) { //destroy
  9622. return
  9623. }
  9624. if (this.mpType === 'page' || this.mpType === 'component') {
  9625. var mpInstance = this.$scope;
  9626. var data = Object.create(null);
  9627. try {
  9628. data = cloneWithData(this);
  9629. } catch (err) {
  9630. console.error(err);
  9631. }
  9632. data.__webviewId__ = mpInstance.data.__webviewId__;
  9633. var mpData = Object.create(null);
  9634. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  9635. mpData[key] = mpInstance.data[key];
  9636. });
  9637. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  9638. if (Object.keys(diffData).length) {
  9639. if (Object({"VUE_APP_NAME":"swim-weapp","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  9640. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  9641. ']差量更新',
  9642. JSON.stringify(diffData));
  9643. }
  9644. this.__next_tick_pending = true;
  9645. mpInstance.setData(diffData, function () {
  9646. this$1.__next_tick_pending = false;
  9647. flushCallbacks$1(this$1);
  9648. });
  9649. } else {
  9650. flushCallbacks$1(this);
  9651. }
  9652. }
  9653. };
  9654. /* */
  9655. function createEmptyRender() {
  9656. }
  9657. function mountComponent$1(
  9658. vm,
  9659. el,
  9660. hydrating
  9661. ) {
  9662. if (!vm.mpType) {//main.js 中的 new Vue
  9663. return vm
  9664. }
  9665. if (vm.mpType === 'app') {
  9666. vm.$options.render = createEmptyRender;
  9667. }
  9668. if (!vm.$options.render) {
  9669. vm.$options.render = createEmptyRender;
  9670. if (true) {
  9671. /* istanbul ignore if */
  9672. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  9673. vm.$options.el || el) {
  9674. warn(
  9675. 'You are using the runtime-only build of Vue where the template ' +
  9676. 'compiler is not available. Either pre-compile the templates into ' +
  9677. 'render functions, or use the compiler-included build.',
  9678. vm
  9679. );
  9680. } else {
  9681. warn(
  9682. 'Failed to mount component: template or render function not defined.',
  9683. vm
  9684. );
  9685. }
  9686. }
  9687. }
  9688. !vm._$fallback && callHook(vm, 'beforeMount');
  9689. var updateComponent = function () {
  9690. vm._update(vm._render(), hydrating);
  9691. };
  9692. // we set this to vm._watcher inside the watcher's constructor
  9693. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  9694. // component's mounted hook), which relies on vm._watcher being already defined
  9695. new Watcher(vm, updateComponent, noop, {
  9696. before: function before() {
  9697. if (vm._isMounted && !vm._isDestroyed) {
  9698. callHook(vm, 'beforeUpdate');
  9699. }
  9700. }
  9701. }, true /* isRenderWatcher */);
  9702. hydrating = false;
  9703. return vm
  9704. }
  9705. /* */
  9706. function renderClass (
  9707. staticClass,
  9708. dynamicClass
  9709. ) {
  9710. if (isDef(staticClass) || isDef(dynamicClass)) {
  9711. return concat(staticClass, stringifyClass(dynamicClass))
  9712. }
  9713. /* istanbul ignore next */
  9714. return ''
  9715. }
  9716. function concat (a, b) {
  9717. return a ? b ? (a + ' ' + b) : a : (b || '')
  9718. }
  9719. function stringifyClass (value) {
  9720. if (Array.isArray(value)) {
  9721. return stringifyArray(value)
  9722. }
  9723. if (isObject(value)) {
  9724. return stringifyObject(value)
  9725. }
  9726. if (typeof value === 'string') {
  9727. return value
  9728. }
  9729. /* istanbul ignore next */
  9730. return ''
  9731. }
  9732. function stringifyArray (value) {
  9733. var res = '';
  9734. var stringified;
  9735. for (var i = 0, l = value.length; i < l; i++) {
  9736. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  9737. if (res) { res += ' '; }
  9738. res += stringified;
  9739. }
  9740. }
  9741. return res
  9742. }
  9743. function stringifyObject (value) {
  9744. var res = '';
  9745. for (var key in value) {
  9746. if (value[key]) {
  9747. if (res) { res += ' '; }
  9748. res += key;
  9749. }
  9750. }
  9751. return res
  9752. }
  9753. /* */
  9754. var parseStyleText = cached(function (cssText) {
  9755. var res = {};
  9756. var listDelimiter = /;(?![^(]*\))/g;
  9757. var propertyDelimiter = /:(.+)/;
  9758. cssText.split(listDelimiter).forEach(function (item) {
  9759. if (item) {
  9760. var tmp = item.split(propertyDelimiter);
  9761. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  9762. }
  9763. });
  9764. return res
  9765. });
  9766. // normalize possible array / string values into Object
  9767. function normalizeStyleBinding (bindingStyle) {
  9768. if (Array.isArray(bindingStyle)) {
  9769. return toObject(bindingStyle)
  9770. }
  9771. if (typeof bindingStyle === 'string') {
  9772. return parseStyleText(bindingStyle)
  9773. }
  9774. return bindingStyle
  9775. }
  9776. /* */
  9777. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  9778. function getTarget(obj, path) {
  9779. var parts = path.split('.');
  9780. var key = parts[0];
  9781. if (key.indexOf('__$n') === 0) { //number index
  9782. key = parseInt(key.replace('__$n', ''));
  9783. }
  9784. if (parts.length === 1) {
  9785. return obj[key]
  9786. }
  9787. return getTarget(obj[key], parts.slice(1).join('.'))
  9788. }
  9789. function internalMixin(Vue) {
  9790. Vue.config.errorHandler = function(err, vm, info) {
  9791. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  9792. console.error(err);
  9793. /* eslint-disable no-undef */
  9794. var app = typeof getApp === 'function' && getApp();
  9795. if (app && app.onError) {
  9796. app.onError(err);
  9797. }
  9798. };
  9799. var oldEmit = Vue.prototype.$emit;
  9800. Vue.prototype.$emit = function(event) {
  9801. if (this.$scope && event) {
  9802. (this.$scope['_triggerEvent'] || this.$scope['triggerEvent'])
  9803. .call(this.$scope, event, {
  9804. __args__: toArray(arguments, 1)
  9805. })
  9806. }
  9807. return oldEmit.apply(this, arguments)
  9808. };
  9809. Vue.prototype.$nextTick = function(fn) {
  9810. return nextTick$1(this, fn)
  9811. };
  9812. MP_METHODS.forEach(function (method) {
  9813. Vue.prototype[method] = function(args) {
  9814. if (this.$scope && this.$scope[method]) {
  9815. return this.$scope[method](args)
  9816. }
  9817. // mp-alipay
  9818. if (typeof my === 'undefined') {
  9819. return
  9820. }
  9821. if (method === 'createSelectorQuery') {
  9822. /* eslint-disable no-undef */
  9823. return my.createSelectorQuery(args)
  9824. } else if (method === 'createIntersectionObserver') {
  9825. /* eslint-disable no-undef */
  9826. return my.createIntersectionObserver(args)
  9827. }
  9828. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  9829. };
  9830. });
  9831. Vue.prototype.__init_provide = initProvide;
  9832. Vue.prototype.__init_injections = initInjections;
  9833. Vue.prototype.__call_hook = function(hook, args) {
  9834. var vm = this;
  9835. // #7573 disable dep collection when invoking lifecycle hooks
  9836. pushTarget();
  9837. var handlers = vm.$options[hook];
  9838. var info = hook + " hook";
  9839. var ret;
  9840. if (handlers) {
  9841. for (var i = 0, j = handlers.length; i < j; i++) {
  9842. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  9843. }
  9844. }
  9845. if (vm._hasHookEvent) {
  9846. vm.$emit('hook:' + hook, args);
  9847. }
  9848. popTarget();
  9849. return ret
  9850. };
  9851. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  9852. if (Array.isArray(modifiers)) {
  9853. if (modifiers.indexOf('trim') !== -1) {
  9854. value = value.trim();
  9855. }
  9856. if (modifiers.indexOf('number') !== -1) {
  9857. value = this._n(value);
  9858. }
  9859. }
  9860. if (!target) {
  9861. target = this;
  9862. }
  9863. // 解决动态属性添加
  9864. Vue.set(target, key, value)
  9865. };
  9866. Vue.prototype.__set_sync = function(target, key, value) {
  9867. if (!target) {
  9868. target = this;
  9869. }
  9870. // 解决动态属性添加
  9871. Vue.set(target, key, value)
  9872. };
  9873. Vue.prototype.__get_orig = function(item) {
  9874. if (isPlainObject(item)) {
  9875. return item['$orig'] || item
  9876. }
  9877. return item
  9878. };
  9879. Vue.prototype.__get_value = function(dataPath, target) {
  9880. return getTarget(target || this, dataPath)
  9881. };
  9882. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  9883. return renderClass(staticClass, dynamicClass)
  9884. };
  9885. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  9886. if (!dynamicStyle && !staticStyle) {
  9887. return ''
  9888. }
  9889. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  9890. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  9891. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  9892. };
  9893. Vue.prototype.__map = function(val, iteratee) {
  9894. //TODO 暂不考虑 string
  9895. var ret, i, l, keys, key;
  9896. if (Array.isArray(val)) {
  9897. ret = new Array(val.length);
  9898. for (i = 0, l = val.length; i < l; i++) {
  9899. ret[i] = iteratee(val[i], i);
  9900. }
  9901. return ret
  9902. } else if (isObject(val)) {
  9903. keys = Object.keys(val);
  9904. ret = Object.create(null);
  9905. for (i = 0, l = keys.length; i < l; i++) {
  9906. key = keys[i];
  9907. ret[key] = iteratee(val[key], key, i);
  9908. }
  9909. return ret
  9910. } else if (typeof val === 'number') {
  9911. ret = new Array(val);
  9912. for (i = 0, l = val; i < l; i++) {
  9913. // 第一个参数暂时仍和小程序一致
  9914. ret[i] = iteratee(i, i);
  9915. }
  9916. return ret
  9917. }
  9918. return []
  9919. };
  9920. }
  9921. /* */
  9922. var LIFECYCLE_HOOKS$1 = [
  9923. //App
  9924. 'onLaunch',
  9925. 'onShow',
  9926. 'onHide',
  9927. 'onUniNViewMessage',
  9928. 'onPageNotFound',
  9929. 'onThemeChange',
  9930. 'onError',
  9931. 'onUnhandledRejection',
  9932. //Page
  9933. 'onInit',
  9934. 'onLoad',
  9935. // 'onShow',
  9936. 'onReady',
  9937. // 'onHide',
  9938. 'onUnload',
  9939. 'onPullDownRefresh',
  9940. 'onReachBottom',
  9941. 'onTabItemTap',
  9942. 'onAddToFavorites',
  9943. 'onShareTimeline',
  9944. 'onShareAppMessage',
  9945. 'onResize',
  9946. 'onPageScroll',
  9947. 'onNavigationBarButtonTap',
  9948. 'onBackPress',
  9949. 'onNavigationBarSearchInputChanged',
  9950. 'onNavigationBarSearchInputConfirmed',
  9951. 'onNavigationBarSearchInputClicked',
  9952. //Component
  9953. // 'onReady', // 兼容旧版本,应该移除该事件
  9954. 'onPageShow',
  9955. 'onPageHide',
  9956. 'onPageResize'
  9957. ];
  9958. function lifecycleMixin$1(Vue) {
  9959. //fixed vue-class-component
  9960. var oldExtend = Vue.extend;
  9961. Vue.extend = function(extendOptions) {
  9962. extendOptions = extendOptions || {};
  9963. var methods = extendOptions.methods;
  9964. if (methods) {
  9965. Object.keys(methods).forEach(function (methodName) {
  9966. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  9967. extendOptions[methodName] = methods[methodName];
  9968. delete methods[methodName];
  9969. }
  9970. });
  9971. }
  9972. return oldExtend.call(this, extendOptions)
  9973. };
  9974. var strategies = Vue.config.optionMergeStrategies;
  9975. var mergeHook = strategies.created;
  9976. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  9977. strategies[hook] = mergeHook;
  9978. });
  9979. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  9980. }
  9981. /* */
  9982. // install platform patch function
  9983. Vue.prototype.__patch__ = patch;
  9984. // public mount method
  9985. Vue.prototype.$mount = function(
  9986. el ,
  9987. hydrating
  9988. ) {
  9989. return mountComponent$1(this, el, hydrating)
  9990. };
  9991. lifecycleMixin$1(Vue);
  9992. internalMixin(Vue);
  9993. /* */
  9994. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  9995. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 2)))
  9996. /***/ }),
  9997. /***/ 30:
  9998. /*!************************************************************************!*\
  9999. !*** D:/HbuderX-exercise/swim-weapp/uview-ui/libs/function/addUnit.js ***!
  10000. \************************************************************************/
  10001. /*! no static exports found */
  10002. /***/ (function(module, exports, __webpack_require__) {
  10003. "use strict";
  10004. Object.defineProperty(exports, "__esModule", { value: true });exports.default = addUnit;var _test = _interopRequireDefault(__webpack_require__(/*! ./test.js */ 17));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  10005. // 添加单位,如果有rpx,%,px等单位结尾或者值为auto,直接返回,否则加上rpx单位结尾
  10006. function addUnit() {var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'auto';var unit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'rpx';
  10007. value = String(value);
  10008. // 用uView内置验证规则中的number判断是否为数值
  10009. return _test.default.number(value) ? "".concat(value).concat(unit) : value;
  10010. }
  10011. /***/ }),
  10012. /***/ 31:
  10013. /*!***********************************************************************!*\
  10014. !*** D:/HbuderX-exercise/swim-weapp/uview-ui/libs/function/random.js ***!
  10015. \***********************************************************************/
  10016. /*! no static exports found */
  10017. /***/ (function(module, exports, __webpack_require__) {
  10018. "use strict";
  10019. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function random(min, max) {
  10020. if (min >= 0 && max > 0 && max >= min) {
  10021. var gab = max - min + 1;
  10022. return Math.floor(Math.random() * gab + min);
  10023. } else {
  10024. return 0;
  10025. }
  10026. }var _default =
  10027. random;exports.default = _default;
  10028. /***/ }),
  10029. /***/ 311:
  10030. /*!****************************************************************************!*\
  10031. !*** D:/HbuderX-exercise/swim-weapp/uview-ui/libs/util/async-validator.js ***!
  10032. \****************************************************************************/
  10033. /*! no static exports found */
  10034. /***/ (function(module, exports, __webpack_require__) {
  10035. "use strict";
  10036. /* WEBPACK VAR INJECTION */(function(process) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function _extends() {
  10037. _extends = Object.assign || function (target) {
  10038. for (var i = 1; i < arguments.length; i++) {
  10039. var source = arguments[i];
  10040. for (var key in source) {
  10041. if (Object.prototype.hasOwnProperty.call(source, key)) {
  10042. target[key] = source[key];
  10043. }
  10044. }
  10045. }
  10046. return target;
  10047. };
  10048. return _extends.apply(this, arguments);
  10049. }
  10050. /* eslint no-console:0 */
  10051. var formatRegExp = /%[sdj%]/g;
  10052. var warning = function warning() {}; // don't print warning message when in production env or node runtime
  10053. if (typeof process !== 'undefined' && Object({"VUE_APP_NAME":"swim-weapp","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}) && "development" !== 'production' && typeof window !==
  10054. 'undefined' && typeof document !== 'undefined') {
  10055. warning = function warning(type, errors) {
  10056. if (typeof console !== 'undefined' && console.warn) {
  10057. if (errors.every(function (e) {
  10058. return typeof e === 'string';
  10059. })) {
  10060. console.warn(type, errors);
  10061. }
  10062. }
  10063. };
  10064. }
  10065. function convertFieldsError(errors) {
  10066. if (!errors || !errors.length) return null;
  10067. var fields = {};
  10068. errors.forEach(function (error) {
  10069. var field = error.field;
  10070. fields[field] = fields[field] || [];
  10071. fields[field].push(error);
  10072. });
  10073. return fields;
  10074. }
  10075. function format() {
  10076. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  10077. args[_key] = arguments[_key];
  10078. }
  10079. var i = 1;
  10080. var f = args[0];
  10081. var len = args.length;
  10082. if (typeof f === 'function') {
  10083. return f.apply(null, args.slice(1));
  10084. }
  10085. if (typeof f === 'string') {
  10086. var str = String(f).replace(formatRegExp, function (x) {
  10087. if (x === '%%') {
  10088. return '%';
  10089. }
  10090. if (i >= len) {
  10091. return x;
  10092. }
  10093. switch (x) {
  10094. case '%s':
  10095. return String(args[i++]);
  10096. case '%d':
  10097. return Number(args[i++]);
  10098. case '%j':
  10099. try {
  10100. return JSON.stringify(args[i++]);
  10101. } catch (_) {
  10102. return '[Circular]';
  10103. }
  10104. break;
  10105. default:
  10106. return x;}
  10107. });
  10108. for (var arg = args[i]; i < len; arg = args[++i]) {
  10109. str += " " + arg;
  10110. }
  10111. return str;
  10112. }
  10113. return f;
  10114. }
  10115. function isNativeStringType(type) {
  10116. return type === 'string' || type === 'url' || type === 'hex' || type === 'email' || type === 'pattern';
  10117. }
  10118. function isEmptyValue(value, type) {
  10119. if (value === undefined || value === null) {
  10120. return true;
  10121. }
  10122. if (type === 'array' && Array.isArray(value) && !value.length) {
  10123. return true;
  10124. }
  10125. if (isNativeStringType(type) && typeof value === 'string' && !value) {
  10126. return true;
  10127. }
  10128. return false;
  10129. }
  10130. function asyncParallelArray(arr, func, callback) {
  10131. var results = [];
  10132. var total = 0;
  10133. var arrLength = arr.length;
  10134. function count(errors) {
  10135. results.push.apply(results, errors);
  10136. total++;
  10137. if (total === arrLength) {
  10138. callback(results);
  10139. }
  10140. }
  10141. arr.forEach(function (a) {
  10142. func(a, count);
  10143. });
  10144. }
  10145. function asyncSerialArray(arr, func, callback) {
  10146. var index = 0;
  10147. var arrLength = arr.length;
  10148. function next(errors) {
  10149. if (errors && errors.length) {
  10150. callback(errors);
  10151. return;
  10152. }
  10153. var original = index;
  10154. index = index + 1;
  10155. if (original < arrLength) {
  10156. func(arr[original], next);
  10157. } else {
  10158. callback([]);
  10159. }
  10160. }
  10161. next([]);
  10162. }
  10163. function flattenObjArr(objArr) {
  10164. var ret = [];
  10165. Object.keys(objArr).forEach(function (k) {
  10166. ret.push.apply(ret, objArr[k]);
  10167. });
  10168. return ret;
  10169. }
  10170. function asyncMap(objArr, option, func, callback) {
  10171. if (option.first) {
  10172. var _pending = new Promise(function (resolve, reject) {
  10173. var next = function next(errors) {
  10174. callback(errors);
  10175. return errors.length ? reject({
  10176. errors: errors,
  10177. fields: convertFieldsError(errors) }) :
  10178. resolve();
  10179. };
  10180. var flattenArr = flattenObjArr(objArr);
  10181. asyncSerialArray(flattenArr, func, next);
  10182. });
  10183. _pending["catch"](function (e) {
  10184. return e;
  10185. });
  10186. return _pending;
  10187. }
  10188. var firstFields = option.firstFields || [];
  10189. if (firstFields === true) {
  10190. firstFields = Object.keys(objArr);
  10191. }
  10192. var objArrKeys = Object.keys(objArr);
  10193. var objArrLength = objArrKeys.length;
  10194. var total = 0;
  10195. var results = [];
  10196. var pending = new Promise(function (resolve, reject) {
  10197. var next = function next(errors) {
  10198. results.push.apply(results, errors);
  10199. total++;
  10200. if (total === objArrLength) {
  10201. callback(results);
  10202. return results.length ? reject({
  10203. errors: results,
  10204. fields: convertFieldsError(results) }) :
  10205. resolve();
  10206. }
  10207. };
  10208. if (!objArrKeys.length) {
  10209. callback(results);
  10210. resolve();
  10211. }
  10212. objArrKeys.forEach(function (key) {
  10213. var arr = objArr[key];
  10214. if (firstFields.indexOf(key) !== -1) {
  10215. asyncSerialArray(arr, func, next);
  10216. } else {
  10217. asyncParallelArray(arr, func, next);
  10218. }
  10219. });
  10220. });
  10221. pending["catch"](function (e) {
  10222. return e;
  10223. });
  10224. return pending;
  10225. }
  10226. function complementError(rule) {
  10227. return function (oe) {
  10228. if (oe && oe.message) {
  10229. oe.field = oe.field || rule.fullField;
  10230. return oe;
  10231. }
  10232. return {
  10233. message: typeof oe === 'function' ? oe() : oe,
  10234. field: oe.field || rule.fullField };
  10235. };
  10236. }
  10237. function deepMerge(target, source) {
  10238. if (source) {
  10239. for (var s in source) {
  10240. if (source.hasOwnProperty(s)) {
  10241. var value = source[s];
  10242. if (typeof value === 'object' && typeof target[s] === 'object') {
  10243. target[s] = _extends({}, target[s], {}, value);
  10244. } else {
  10245. target[s] = value;
  10246. }
  10247. }
  10248. }
  10249. }
  10250. return target;
  10251. }
  10252. /**
  10253. * Rule for validating required fields.
  10254. *
  10255. * @param rule The validation rule.
  10256. * @param value The value of the field on the source object.
  10257. * @param source The source object being validated.
  10258. * @param errors An array of errors that this rule may add
  10259. * validation errors to.
  10260. * @param options The validation options.
  10261. * @param options.messages The validation messages.
  10262. */
  10263. function required(rule, value, source, errors, options, type) {
  10264. if (rule.required && (!source.hasOwnProperty(rule.field) || isEmptyValue(value, type || rule.type))) {
  10265. errors.push(format(options.messages.required, rule.fullField));
  10266. }
  10267. }
  10268. /**
  10269. * Rule for validating whitespace.
  10270. *
  10271. * @param rule The validation rule.
  10272. * @param value The value of the field on the source object.
  10273. * @param source The source object being validated.
  10274. * @param errors An array of errors that this rule may add
  10275. * validation errors to.
  10276. * @param options The validation options.
  10277. * @param options.messages The validation messages.
  10278. */
  10279. function whitespace(rule, value, source, errors, options) {
  10280. if (/^\s+$/.test(value) || value === '') {
  10281. errors.push(format(options.messages.whitespace, rule.fullField));
  10282. }
  10283. }
  10284. /* eslint max-len:0 */
  10285. var pattern = {
  10286. // http://emailregex.com/
  10287. email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
  10288. url: new RegExp(
  10289. "^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$",
  10290. 'i'),
  10291. hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i };
  10292. var types = {
  10293. integer: function integer(value) {
  10294. return types.number(value) && parseInt(value, 10) === value;
  10295. },
  10296. "float": function float(value) {
  10297. return types.number(value) && !types.integer(value);
  10298. },
  10299. array: function array(value) {
  10300. return Array.isArray(value);
  10301. },
  10302. regexp: function regexp(value) {
  10303. if (value instanceof RegExp) {
  10304. return true;
  10305. }
  10306. try {
  10307. return !!new RegExp(value);
  10308. } catch (e) {
  10309. return false;
  10310. }
  10311. },
  10312. date: function date(value) {
  10313. return typeof value.getTime === 'function' && typeof value.getMonth === 'function' && typeof value.getYear ===
  10314. 'function';
  10315. },
  10316. number: function number(value) {
  10317. if (isNaN(value)) {
  10318. return false;
  10319. }
  10320. // 修改源码,将字符串数值先转为数值
  10321. return typeof +value === 'number';
  10322. },
  10323. object: function object(value) {
  10324. return typeof value === 'object' && !types.array(value);
  10325. },
  10326. method: function method(value) {
  10327. return typeof value === 'function';
  10328. },
  10329. email: function email(value) {
  10330. return typeof value === 'string' && !!value.match(pattern.email) && value.length < 255;
  10331. },
  10332. url: function url(value) {
  10333. return typeof value === 'string' && !!value.match(pattern.url);
  10334. },
  10335. hex: function hex(value) {
  10336. return typeof value === 'string' && !!value.match(pattern.hex);
  10337. } };
  10338. /**
  10339. * Rule for validating the type of a value.
  10340. *
  10341. * @param rule The validation rule.
  10342. * @param value The value of the field on the source object.
  10343. * @param source The source object being validated.
  10344. * @param errors An array of errors that this rule may add
  10345. * validation errors to.
  10346. * @param options The validation options.
  10347. * @param options.messages The validation messages.
  10348. */
  10349. function type(rule, value, source, errors, options) {
  10350. if (rule.required && value === undefined) {
  10351. required(rule, value, source, errors, options);
  10352. return;
  10353. }
  10354. var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];
  10355. var ruleType = rule.type;
  10356. if (custom.indexOf(ruleType) > -1) {
  10357. if (!types[ruleType](value)) {
  10358. errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
  10359. } // straight typeof check
  10360. } else if (ruleType && typeof value !== rule.type) {
  10361. errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
  10362. }
  10363. }
  10364. /**
  10365. * Rule for validating minimum and maximum allowed values.
  10366. *
  10367. * @param rule The validation rule.
  10368. * @param value The value of the field on the source object.
  10369. * @param source The source object being validated.
  10370. * @param errors An array of errors that this rule may add
  10371. * validation errors to.
  10372. * @param options The validation options.
  10373. * @param options.messages The validation messages.
  10374. */
  10375. function range(rule, value, source, errors, options) {
  10376. var len = typeof rule.len === 'number';
  10377. var min = typeof rule.min === 'number';
  10378. var max = typeof rule.max === 'number'; // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)
  10379. var spRegexp = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
  10380. var val = value;
  10381. var key = null;
  10382. var num = typeof value === 'number';
  10383. var str = typeof value === 'string';
  10384. var arr = Array.isArray(value);
  10385. if (num) {
  10386. key = 'number';
  10387. } else if (str) {
  10388. key = 'string';
  10389. } else if (arr) {
  10390. key = 'array';
  10391. } // if the value is not of a supported type for range validation
  10392. // the validation rule rule should use the
  10393. // type property to also test for a particular type
  10394. if (!key) {
  10395. return false;
  10396. }
  10397. if (arr) {
  10398. val = value.length;
  10399. }
  10400. if (str) {
  10401. // 处理码点大于U+010000的文字length属性不准确的bug,如"𠮷𠮷𠮷".lenght !== 3
  10402. val = value.replace(spRegexp, '_').length;
  10403. }
  10404. if (len) {
  10405. if (val !== rule.len) {
  10406. errors.push(format(options.messages[key].len, rule.fullField, rule.len));
  10407. }
  10408. } else if (min && !max && val < rule.min) {
  10409. errors.push(format(options.messages[key].min, rule.fullField, rule.min));
  10410. } else if (max && !min && val > rule.max) {
  10411. errors.push(format(options.messages[key].max, rule.fullField, rule.max));
  10412. } else if (min && max && (val < rule.min || val > rule.max)) {
  10413. errors.push(format(options.messages[key].range, rule.fullField, rule.min, rule.max));
  10414. }
  10415. }
  10416. var ENUM = 'enum';
  10417. /**
  10418. * Rule for validating a value exists in an enumerable list.
  10419. *
  10420. * @param rule The validation rule.
  10421. * @param value The value of the field on the source object.
  10422. * @param source The source object being validated.
  10423. * @param errors An array of errors that this rule may add
  10424. * validation errors to.
  10425. * @param options The validation options.
  10426. * @param options.messages The validation messages.
  10427. */
  10428. function enumerable(rule, value, source, errors, options) {
  10429. rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];
  10430. if (rule[ENUM].indexOf(value) === -1) {
  10431. errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));
  10432. }
  10433. }
  10434. /**
  10435. * Rule for validating a regular expression pattern.
  10436. *
  10437. * @param rule The validation rule.
  10438. * @param value The value of the field on the source object.
  10439. * @param source The source object being validated.
  10440. * @param errors An array of errors that this rule may add
  10441. * validation errors to.
  10442. * @param options The validation options.
  10443. * @param options.messages The validation messages.
  10444. */
  10445. function pattern$1(rule, value, source, errors, options) {
  10446. if (rule.pattern) {
  10447. if (rule.pattern instanceof RegExp) {
  10448. // if a RegExp instance is passed, reset `lastIndex` in case its `global`
  10449. // flag is accidentally set to `true`, which in a validation scenario
  10450. // is not necessary and the result might be misleading
  10451. rule.pattern.lastIndex = 0;
  10452. if (!rule.pattern.test(value)) {
  10453. errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
  10454. }
  10455. } else if (typeof rule.pattern === 'string') {
  10456. var _pattern = new RegExp(rule.pattern);
  10457. if (!_pattern.test(value)) {
  10458. errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
  10459. }
  10460. }
  10461. }
  10462. }
  10463. var rules = {
  10464. required: required,
  10465. whitespace: whitespace,
  10466. type: type,
  10467. range: range,
  10468. "enum": enumerable,
  10469. pattern: pattern$1 };
  10470. /**
  10471. * Performs validation for string types.
  10472. *
  10473. * @param rule The validation rule.
  10474. * @param value The value of the field on the source object.
  10475. * @param callback The callback function.
  10476. * @param source The source object being validated.
  10477. * @param options The validation options.
  10478. * @param options.messages The validation messages.
  10479. */
  10480. function string(rule, value, callback, source, options) {
  10481. var errors = [];
  10482. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  10483. if (validate) {
  10484. if (isEmptyValue(value, 'string') && !rule.required) {
  10485. return callback();
  10486. }
  10487. rules.required(rule, value, source, errors, options, 'string');
  10488. if (!isEmptyValue(value, 'string')) {
  10489. rules.type(rule, value, source, errors, options);
  10490. rules.range(rule, value, source, errors, options);
  10491. rules.pattern(rule, value, source, errors, options);
  10492. if (rule.whitespace === true) {
  10493. rules.whitespace(rule, value, source, errors, options);
  10494. }
  10495. }
  10496. }
  10497. callback(errors);
  10498. }
  10499. /**
  10500. * Validates a function.
  10501. *
  10502. * @param rule The validation rule.
  10503. * @param value The value of the field on the source object.
  10504. * @param callback The callback function.
  10505. * @param source The source object being validated.
  10506. * @param options The validation options.
  10507. * @param options.messages The validation messages.
  10508. */
  10509. function method(rule, value, callback, source, options) {
  10510. var errors = [];
  10511. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  10512. if (validate) {
  10513. if (isEmptyValue(value) && !rule.required) {
  10514. return callback();
  10515. }
  10516. rules.required(rule, value, source, errors, options);
  10517. if (value !== undefined) {
  10518. rules.type(rule, value, source, errors, options);
  10519. }
  10520. }
  10521. callback(errors);
  10522. }
  10523. /**
  10524. * Validates a number.
  10525. *
  10526. * @param rule The validation rule.
  10527. * @param value The value of the field on the source object.
  10528. * @param callback The callback function.
  10529. * @param source The source object being validated.
  10530. * @param options The validation options.
  10531. * @param options.messages The validation messages.
  10532. */
  10533. function number(rule, value, callback, source, options) {
  10534. var errors = [];
  10535. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  10536. if (validate) {
  10537. if (value === '') {
  10538. value = undefined;
  10539. }
  10540. if (isEmptyValue(value) && !rule.required) {
  10541. return callback();
  10542. }
  10543. rules.required(rule, value, source, errors, options);
  10544. if (value !== undefined) {
  10545. rules.type(rule, value, source, errors, options);
  10546. rules.range(rule, value, source, errors, options);
  10547. }
  10548. }
  10549. callback(errors);
  10550. }
  10551. /**
  10552. * Validates a boolean.
  10553. *
  10554. * @param rule The validation rule.
  10555. * @param value The value of the field on the source object.
  10556. * @param callback The callback function.
  10557. * @param source The source object being validated.
  10558. * @param options The validation options.
  10559. * @param options.messages The validation messages.
  10560. */
  10561. function _boolean(rule, value, callback, source, options) {
  10562. var errors = [];
  10563. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  10564. if (validate) {
  10565. if (isEmptyValue(value) && !rule.required) {
  10566. return callback();
  10567. }
  10568. rules.required(rule, value, source, errors, options);
  10569. if (value !== undefined) {
  10570. rules.type(rule, value, source, errors, options);
  10571. }
  10572. }
  10573. callback(errors);
  10574. }
  10575. /**
  10576. * Validates the regular expression type.
  10577. *
  10578. * @param rule The validation rule.
  10579. * @param value The value of the field on the source object.
  10580. * @param callback The callback function.
  10581. * @param source The source object being validated.
  10582. * @param options The validation options.
  10583. * @param options.messages The validation messages.
  10584. */
  10585. function regexp(rule, value, callback, source, options) {
  10586. var errors = [];
  10587. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  10588. if (validate) {
  10589. if (isEmptyValue(value) && !rule.required) {
  10590. return callback();
  10591. }
  10592. rules.required(rule, value, source, errors, options);
  10593. if (!isEmptyValue(value)) {
  10594. rules.type(rule, value, source, errors, options);
  10595. }
  10596. }
  10597. callback(errors);
  10598. }
  10599. /**
  10600. * Validates a number is an integer.
  10601. *
  10602. * @param rule The validation rule.
  10603. * @param value The value of the field on the source object.
  10604. * @param callback The callback function.
  10605. * @param source The source object being validated.
  10606. * @param options The validation options.
  10607. * @param options.messages The validation messages.
  10608. */
  10609. function integer(rule, value, callback, source, options) {
  10610. var errors = [];
  10611. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  10612. if (validate) {
  10613. if (isEmptyValue(value) && !rule.required) {
  10614. return callback();
  10615. }
  10616. rules.required(rule, value, source, errors, options);
  10617. if (value !== undefined) {
  10618. rules.type(rule, value, source, errors, options);
  10619. rules.range(rule, value, source, errors, options);
  10620. }
  10621. }
  10622. callback(errors);
  10623. }
  10624. /**
  10625. * Validates a number is a floating point number.
  10626. *
  10627. * @param rule The validation rule.
  10628. * @param value The value of the field on the source object.
  10629. * @param callback The callback function.
  10630. * @param source The source object being validated.
  10631. * @param options The validation options.
  10632. * @param options.messages The validation messages.
  10633. */
  10634. function floatFn(rule, value, callback, source, options) {
  10635. var errors = [];
  10636. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  10637. if (validate) {
  10638. if (isEmptyValue(value) && !rule.required) {
  10639. return callback();
  10640. }
  10641. rules.required(rule, value, source, errors, options);
  10642. if (value !== undefined) {
  10643. rules.type(rule, value, source, errors, options);
  10644. rules.range(rule, value, source, errors, options);
  10645. }
  10646. }
  10647. callback(errors);
  10648. }
  10649. /**
  10650. * Validates an array.
  10651. *
  10652. * @param rule The validation rule.
  10653. * @param value The value of the field on the source object.
  10654. * @param callback The callback function.
  10655. * @param source The source object being validated.
  10656. * @param options The validation options.
  10657. * @param options.messages The validation messages.
  10658. */
  10659. function array(rule, value, callback, source, options) {
  10660. var errors = [];
  10661. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  10662. if (validate) {
  10663. if (isEmptyValue(value, 'array') && !rule.required) {
  10664. return callback();
  10665. }
  10666. rules.required(rule, value, source, errors, options, 'array');
  10667. if (!isEmptyValue(value, 'array')) {
  10668. rules.type(rule, value, source, errors, options);
  10669. rules.range(rule, value, source, errors, options);
  10670. }
  10671. }
  10672. callback(errors);
  10673. }
  10674. /**
  10675. * Validates an object.
  10676. *
  10677. * @param rule The validation rule.
  10678. * @param value The value of the field on the source object.
  10679. * @param callback The callback function.
  10680. * @param source The source object being validated.
  10681. * @param options The validation options.
  10682. * @param options.messages The validation messages.
  10683. */
  10684. function object(rule, value, callback, source, options) {
  10685. var errors = [];
  10686. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  10687. if (validate) {
  10688. if (isEmptyValue(value) && !rule.required) {
  10689. return callback();
  10690. }
  10691. rules.required(rule, value, source, errors, options);
  10692. if (value !== undefined) {
  10693. rules.type(rule, value, source, errors, options);
  10694. }
  10695. }
  10696. callback(errors);
  10697. }
  10698. var ENUM$1 = 'enum';
  10699. /**
  10700. * Validates an enumerable list.
  10701. *
  10702. * @param rule The validation rule.
  10703. * @param value The value of the field on the source object.
  10704. * @param callback The callback function.
  10705. * @param source The source object being validated.
  10706. * @param options The validation options.
  10707. * @param options.messages The validation messages.
  10708. */
  10709. function enumerable$1(rule, value, callback, source, options) {
  10710. var errors = [];
  10711. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  10712. if (validate) {
  10713. if (isEmptyValue(value) && !rule.required) {
  10714. return callback();
  10715. }
  10716. rules.required(rule, value, source, errors, options);
  10717. if (value !== undefined) {
  10718. rules[ENUM$1](rule, value, source, errors, options);
  10719. }
  10720. }
  10721. callback(errors);
  10722. }
  10723. /**
  10724. * Validates a regular expression pattern.
  10725. *
  10726. * Performs validation when a rule only contains
  10727. * a pattern property but is not declared as a string type.
  10728. *
  10729. * @param rule The validation rule.
  10730. * @param value The value of the field on the source object.
  10731. * @param callback The callback function.
  10732. * @param source The source object being validated.
  10733. * @param options The validation options.
  10734. * @param options.messages The validation messages.
  10735. */
  10736. function pattern$2(rule, value, callback, source, options) {
  10737. var errors = [];
  10738. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  10739. if (validate) {
  10740. if (isEmptyValue(value, 'string') && !rule.required) {
  10741. return callback();
  10742. }
  10743. rules.required(rule, value, source, errors, options);
  10744. if (!isEmptyValue(value, 'string')) {
  10745. rules.pattern(rule, value, source, errors, options);
  10746. }
  10747. }
  10748. callback(errors);
  10749. }
  10750. function date(rule, value, callback, source, options) {
  10751. var errors = [];
  10752. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  10753. if (validate) {
  10754. if (isEmptyValue(value) && !rule.required) {
  10755. return callback();
  10756. }
  10757. rules.required(rule, value, source, errors, options);
  10758. if (!isEmptyValue(value)) {
  10759. var dateObject;
  10760. if (typeof value === 'number') {
  10761. dateObject = new Date(value);
  10762. } else {
  10763. dateObject = value;
  10764. }
  10765. rules.type(rule, dateObject, source, errors, options);
  10766. if (dateObject) {
  10767. rules.range(rule, dateObject.getTime(), source, errors, options);
  10768. }
  10769. }
  10770. }
  10771. callback(errors);
  10772. }
  10773. function required$1(rule, value, callback, source, options) {
  10774. var errors = [];
  10775. var type = Array.isArray(value) ? 'array' : typeof value;
  10776. rules.required(rule, value, source, errors, options, type);
  10777. callback(errors);
  10778. }
  10779. function type$1(rule, value, callback, source, options) {
  10780. var ruleType = rule.type;
  10781. var errors = [];
  10782. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  10783. if (validate) {
  10784. if (isEmptyValue(value, ruleType) && !rule.required) {
  10785. return callback();
  10786. }
  10787. rules.required(rule, value, source, errors, options, ruleType);
  10788. if (!isEmptyValue(value, ruleType)) {
  10789. rules.type(rule, value, source, errors, options);
  10790. }
  10791. }
  10792. callback(errors);
  10793. }
  10794. /**
  10795. * Performs validation for any type.
  10796. *
  10797. * @param rule The validation rule.
  10798. * @param value The value of the field on the source object.
  10799. * @param callback The callback function.
  10800. * @param source The source object being validated.
  10801. * @param options The validation options.
  10802. * @param options.messages The validation messages.
  10803. */
  10804. function any(rule, value, callback, source, options) {
  10805. var errors = [];
  10806. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  10807. if (validate) {
  10808. if (isEmptyValue(value) && !rule.required) {
  10809. return callback();
  10810. }
  10811. rules.required(rule, value, source, errors, options);
  10812. }
  10813. callback(errors);
  10814. }
  10815. var validators = {
  10816. string: string,
  10817. method: method,
  10818. number: number,
  10819. "boolean": _boolean,
  10820. regexp: regexp,
  10821. integer: integer,
  10822. "float": floatFn,
  10823. array: array,
  10824. object: object,
  10825. "enum": enumerable$1,
  10826. pattern: pattern$2,
  10827. date: date,
  10828. url: type$1,
  10829. hex: type$1,
  10830. email: type$1,
  10831. required: required$1,
  10832. any: any };
  10833. function newMessages() {
  10834. return {
  10835. "default": 'Validation error on field %s',
  10836. required: '%s is required',
  10837. "enum": '%s must be one of %s',
  10838. whitespace: '%s cannot be empty',
  10839. date: {
  10840. format: '%s date %s is invalid for format %s',
  10841. parse: '%s date could not be parsed, %s is invalid ',
  10842. invalid: '%s date %s is invalid' },
  10843. types: {
  10844. string: '%s is not a %s',
  10845. method: '%s is not a %s (function)',
  10846. array: '%s is not an %s',
  10847. object: '%s is not an %s',
  10848. number: '%s is not a %s',
  10849. date: '%s is not a %s',
  10850. "boolean": '%s is not a %s',
  10851. integer: '%s is not an %s',
  10852. "float": '%s is not a %s',
  10853. regexp: '%s is not a valid %s',
  10854. email: '%s is not a valid %s',
  10855. url: '%s is not a valid %s',
  10856. hex: '%s is not a valid %s' },
  10857. string: {
  10858. len: '%s must be exactly %s characters',
  10859. min: '%s must be at least %s characters',
  10860. max: '%s cannot be longer than %s characters',
  10861. range: '%s must be between %s and %s characters' },
  10862. number: {
  10863. len: '%s must equal %s',
  10864. min: '%s cannot be less than %s',
  10865. max: '%s cannot be greater than %s',
  10866. range: '%s must be between %s and %s' },
  10867. array: {
  10868. len: '%s must be exactly %s in length',
  10869. min: '%s cannot be less than %s in length',
  10870. max: '%s cannot be greater than %s in length',
  10871. range: '%s must be between %s and %s in length' },
  10872. pattern: {
  10873. mismatch: '%s value %s does not match pattern %s' },
  10874. clone: function clone() {
  10875. var cloned = JSON.parse(JSON.stringify(this));
  10876. cloned.clone = this.clone;
  10877. return cloned;
  10878. } };
  10879. }
  10880. var messages = newMessages();
  10881. /**
  10882. * Encapsulates a validation schema.
  10883. *
  10884. * @param descriptor An object declaring validation rules
  10885. * for this schema.
  10886. */
  10887. function Schema(descriptor) {
  10888. this.rules = null;
  10889. this._messages = messages;
  10890. this.define(descriptor);
  10891. }
  10892. Schema.prototype = {
  10893. messages: function messages(_messages) {
  10894. if (_messages) {
  10895. this._messages = deepMerge(newMessages(), _messages);
  10896. }
  10897. return this._messages;
  10898. },
  10899. define: function define(rules) {
  10900. if (!rules) {
  10901. throw new Error('Cannot configure a schema with no rules');
  10902. }
  10903. if (typeof rules !== 'object' || Array.isArray(rules)) {
  10904. throw new Error('Rules must be an object');
  10905. }
  10906. this.rules = {};
  10907. var z;
  10908. var item;
  10909. for (z in rules) {
  10910. if (rules.hasOwnProperty(z)) {
  10911. item = rules[z];
  10912. this.rules[z] = Array.isArray(item) ? item : [item];
  10913. }
  10914. }
  10915. },
  10916. validate: function validate(source_, o, oc) {
  10917. var _this = this;
  10918. if (o === void 0) {
  10919. o = {};
  10920. }
  10921. if (oc === void 0) {
  10922. oc = function oc() {};
  10923. }
  10924. var source = source_;
  10925. var options = o;
  10926. var callback = oc;
  10927. if (typeof options === 'function') {
  10928. callback = options;
  10929. options = {};
  10930. }
  10931. if (!this.rules || Object.keys(this.rules).length === 0) {
  10932. if (callback) {
  10933. callback();
  10934. }
  10935. return Promise.resolve();
  10936. }
  10937. function complete(results) {
  10938. var i;
  10939. var errors = [];
  10940. var fields = {};
  10941. function add(e) {
  10942. if (Array.isArray(e)) {
  10943. var _errors;
  10944. errors = (_errors = errors).concat.apply(_errors, e);
  10945. } else {
  10946. errors.push(e);
  10947. }
  10948. }
  10949. for (i = 0; i < results.length; i++) {
  10950. add(results[i]);
  10951. }
  10952. if (!errors.length) {
  10953. errors = null;
  10954. fields = null;
  10955. } else {
  10956. fields = convertFieldsError(errors);
  10957. }
  10958. callback(errors, fields);
  10959. }
  10960. if (options.messages) {
  10961. var messages$1 = this.messages();
  10962. if (messages$1 === messages) {
  10963. messages$1 = newMessages();
  10964. }
  10965. deepMerge(messages$1, options.messages);
  10966. options.messages = messages$1;
  10967. } else {
  10968. options.messages = this.messages();
  10969. }
  10970. var arr;
  10971. var value;
  10972. var series = {};
  10973. var keys = options.keys || Object.keys(this.rules);
  10974. keys.forEach(function (z) {
  10975. arr = _this.rules[z];
  10976. value = source[z];
  10977. arr.forEach(function (r) {
  10978. var rule = r;
  10979. if (typeof rule.transform === 'function') {
  10980. if (source === source_) {
  10981. source = _extends({}, source);
  10982. }
  10983. value = source[z] = rule.transform(value);
  10984. }
  10985. if (typeof rule === 'function') {
  10986. rule = {
  10987. validator: rule };
  10988. } else {
  10989. rule = _extends({}, rule);
  10990. }
  10991. rule.validator = _this.getValidationMethod(rule);
  10992. rule.field = z;
  10993. rule.fullField = rule.fullField || z;
  10994. rule.type = _this.getType(rule);
  10995. if (!rule.validator) {
  10996. return;
  10997. }
  10998. series[z] = series[z] || [];
  10999. series[z].push({
  11000. rule: rule,
  11001. value: value,
  11002. source: source,
  11003. field: z });
  11004. });
  11005. });
  11006. var errorFields = {};
  11007. return asyncMap(series, options, function (data, doIt) {
  11008. var rule = data.rule;
  11009. var deep = (rule.type === 'object' || rule.type === 'array') && (typeof rule.fields === 'object' || typeof rule.defaultField ===
  11010. 'object');
  11011. deep = deep && (rule.required || !rule.required && data.value);
  11012. rule.field = data.field;
  11013. function addFullfield(key, schema) {
  11014. return _extends({}, schema, {
  11015. fullField: rule.fullField + "." + key });
  11016. }
  11017. function cb(e) {
  11018. if (e === void 0) {
  11019. e = [];
  11020. }
  11021. var errors = e;
  11022. if (!Array.isArray(errors)) {
  11023. errors = [errors];
  11024. }
  11025. if (!options.suppressWarning && errors.length) {
  11026. Schema.warning('async-validator:', errors);
  11027. }
  11028. if (errors.length && rule.message) {
  11029. errors = [].concat(rule.message);
  11030. }
  11031. errors = errors.map(complementError(rule));
  11032. if (options.first && errors.length) {
  11033. errorFields[rule.field] = 1;
  11034. return doIt(errors);
  11035. }
  11036. if (!deep) {
  11037. doIt(errors);
  11038. } else {
  11039. // if rule is required but the target object
  11040. // does not exist fail at the rule level and don't
  11041. // go deeper
  11042. if (rule.required && !data.value) {
  11043. if (rule.message) {
  11044. errors = [].concat(rule.message).map(complementError(rule));
  11045. } else if (options.error) {
  11046. errors = [options.error(rule, format(options.messages.required, rule.field))];
  11047. } else {
  11048. errors = [];
  11049. }
  11050. return doIt(errors);
  11051. }
  11052. var fieldsSchema = {};
  11053. if (rule.defaultField) {
  11054. for (var k in data.value) {
  11055. if (data.value.hasOwnProperty(k)) {
  11056. fieldsSchema[k] = rule.defaultField;
  11057. }
  11058. }
  11059. }
  11060. fieldsSchema = _extends({}, fieldsSchema, {}, data.rule.fields);
  11061. for (var f in fieldsSchema) {
  11062. if (fieldsSchema.hasOwnProperty(f)) {
  11063. var fieldSchema = Array.isArray(fieldsSchema[f]) ? fieldsSchema[f] : [fieldsSchema[f]];
  11064. fieldsSchema[f] = fieldSchema.map(addFullfield.bind(null, f));
  11065. }
  11066. }
  11067. var schema = new Schema(fieldsSchema);
  11068. schema.messages(options.messages);
  11069. if (data.rule.options) {
  11070. data.rule.options.messages = options.messages;
  11071. data.rule.options.error = options.error;
  11072. }
  11073. schema.validate(data.value, data.rule.options || options, function (errs) {
  11074. var finalErrors = [];
  11075. if (errors && errors.length) {
  11076. finalErrors.push.apply(finalErrors, errors);
  11077. }
  11078. if (errs && errs.length) {
  11079. finalErrors.push.apply(finalErrors, errs);
  11080. }
  11081. doIt(finalErrors.length ? finalErrors : null);
  11082. });
  11083. }
  11084. }
  11085. var res;
  11086. if (rule.asyncValidator) {
  11087. res = rule.asyncValidator(rule, data.value, cb, data.source, options);
  11088. } else if (rule.validator) {
  11089. res = rule.validator(rule, data.value, cb, data.source, options);
  11090. if (res === true) {
  11091. cb();
  11092. } else if (res === false) {
  11093. cb(rule.message || rule.field + " fails");
  11094. } else if (res instanceof Array) {
  11095. cb(res);
  11096. } else if (res instanceof Error) {
  11097. cb(res.message);
  11098. }
  11099. }
  11100. if (res && res.then) {
  11101. res.then(function () {
  11102. return cb();
  11103. }, function (e) {
  11104. return cb(e);
  11105. });
  11106. }
  11107. }, function (results) {
  11108. complete(results);
  11109. });
  11110. },
  11111. getType: function getType(rule) {
  11112. if (rule.type === undefined && rule.pattern instanceof RegExp) {
  11113. rule.type = 'pattern';
  11114. }
  11115. if (typeof rule.validator !== 'function' && rule.type && !validators.hasOwnProperty(rule.type)) {
  11116. throw new Error(format('Unknown rule type %s', rule.type));
  11117. }
  11118. return rule.type || 'string';
  11119. },
  11120. getValidationMethod: function getValidationMethod(rule) {
  11121. if (typeof rule.validator === 'function') {
  11122. return rule.validator;
  11123. }
  11124. var keys = Object.keys(rule);
  11125. var messageIndex = keys.indexOf('message');
  11126. if (messageIndex !== -1) {
  11127. keys.splice(messageIndex, 1);
  11128. }
  11129. if (keys.length === 1 && keys[0] === 'required') {
  11130. return validators.required;
  11131. }
  11132. return validators[this.getType(rule)] || false;
  11133. } };
  11134. Schema.register = function register(type, validator) {
  11135. if (typeof validator !== 'function') {
  11136. throw new Error('Cannot register a validator by type, validator is not a function');
  11137. }
  11138. validators[type] = validator;
  11139. };
  11140. Schema.warning = warning;
  11141. Schema.messages = messages;var _default =
  11142. Schema;exports.default = _default;
  11143. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../HbuilderX/plugins/uniapp-cli/node_modules/node-libs-browser/mock/process.js */ 312)))
  11144. /***/ }),
  11145. /***/ 312:
  11146. /*!********************************************************!*\
  11147. !*** ./node_modules/node-libs-browser/mock/process.js ***!
  11148. \********************************************************/
  11149. /*! no static exports found */
  11150. /***/ (function(module, exports, __webpack_require__) {
  11151. exports.nextTick = function nextTick(fn) {
  11152. var args = Array.prototype.slice.call(arguments);
  11153. args.shift();
  11154. setTimeout(function () {
  11155. fn.apply(null, args);
  11156. }, 0);
  11157. };
  11158. exports.platform = exports.arch =
  11159. exports.execPath = exports.title = 'browser';
  11160. exports.pid = 1;
  11161. exports.browser = true;
  11162. exports.env = {};
  11163. exports.argv = [];
  11164. exports.binding = function (name) {
  11165. throw new Error('No such module. (Possibly not yet loaded)')
  11166. };
  11167. (function () {
  11168. var cwd = '/';
  11169. var path;
  11170. exports.cwd = function () { return cwd };
  11171. exports.chdir = function (dir) {
  11172. if (!path) path = __webpack_require__(/*! path */ 313);
  11173. cwd = path.resolve(dir, cwd);
  11174. };
  11175. })();
  11176. exports.exit = exports.kill =
  11177. exports.umask = exports.dlopen =
  11178. exports.uptime = exports.memoryUsage =
  11179. exports.uvCounters = function() {};
  11180. exports.features = {};
  11181. /***/ }),
  11182. /***/ 313:
  11183. /*!***********************************************!*\
  11184. !*** ./node_modules/path-browserify/index.js ***!
  11185. \***********************************************/
  11186. /*! no static exports found */
  11187. /***/ (function(module, exports, __webpack_require__) {
  11188. /* WEBPACK VAR INJECTION */(function(process) {// .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1,
  11189. // backported and transplited with Babel, with backwards-compat fixes
  11190. // Copyright Joyent, Inc. and other Node contributors.
  11191. //
  11192. // Permission is hereby granted, free of charge, to any person obtaining a
  11193. // copy of this software and associated documentation files (the
  11194. // "Software"), to deal in the Software without restriction, including
  11195. // without limitation the rights to use, copy, modify, merge, publish,
  11196. // distribute, sublicense, and/or sell copies of the Software, and to permit
  11197. // persons to whom the Software is furnished to do so, subject to the
  11198. // following conditions:
  11199. //
  11200. // The above copyright notice and this permission notice shall be included
  11201. // in all copies or substantial portions of the Software.
  11202. //
  11203. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  11204. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  11205. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  11206. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  11207. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  11208. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  11209. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  11210. // resolves . and .. elements in a path array with directory names there
  11211. // must be no slashes, empty elements, or device names (c:\) in the array
  11212. // (so also no leading and trailing slashes - it does not distinguish
  11213. // relative and absolute paths)
  11214. function normalizeArray(parts, allowAboveRoot) {
  11215. // if the path tries to go above the root, `up` ends up > 0
  11216. var up = 0;
  11217. for (var i = parts.length - 1; i >= 0; i--) {
  11218. var last = parts[i];
  11219. if (last === '.') {
  11220. parts.splice(i, 1);
  11221. } else if (last === '..') {
  11222. parts.splice(i, 1);
  11223. up++;
  11224. } else if (up) {
  11225. parts.splice(i, 1);
  11226. up--;
  11227. }
  11228. }
  11229. // if the path is allowed to go above the root, restore leading ..s
  11230. if (allowAboveRoot) {
  11231. for (; up--; up) {
  11232. parts.unshift('..');
  11233. }
  11234. }
  11235. return parts;
  11236. }
  11237. // path.resolve([from ...], to)
  11238. // posix version
  11239. exports.resolve = function() {
  11240. var resolvedPath = '',
  11241. resolvedAbsolute = false;
  11242. for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
  11243. var path = (i >= 0) ? arguments[i] : process.cwd();
  11244. // Skip empty and invalid entries
  11245. if (typeof path !== 'string') {
  11246. throw new TypeError('Arguments to path.resolve must be strings');
  11247. } else if (!path) {
  11248. continue;
  11249. }
  11250. resolvedPath = path + '/' + resolvedPath;
  11251. resolvedAbsolute = path.charAt(0) === '/';
  11252. }
  11253. // At this point the path should be resolved to a full absolute path, but
  11254. // handle relative paths to be safe (might happen when process.cwd() fails)
  11255. // Normalize the path
  11256. resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
  11257. return !!p;
  11258. }), !resolvedAbsolute).join('/');
  11259. return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
  11260. };
  11261. // path.normalize(path)
  11262. // posix version
  11263. exports.normalize = function(path) {
  11264. var isAbsolute = exports.isAbsolute(path),
  11265. trailingSlash = substr(path, -1) === '/';
  11266. // Normalize the path
  11267. path = normalizeArray(filter(path.split('/'), function(p) {
  11268. return !!p;
  11269. }), !isAbsolute).join('/');
  11270. if (!path && !isAbsolute) {
  11271. path = '.';
  11272. }
  11273. if (path && trailingSlash) {
  11274. path += '/';
  11275. }
  11276. return (isAbsolute ? '/' : '') + path;
  11277. };
  11278. // posix version
  11279. exports.isAbsolute = function(path) {
  11280. return path.charAt(0) === '/';
  11281. };
  11282. // posix version
  11283. exports.join = function() {
  11284. var paths = Array.prototype.slice.call(arguments, 0);
  11285. return exports.normalize(filter(paths, function(p, index) {
  11286. if (typeof p !== 'string') {
  11287. throw new TypeError('Arguments to path.join must be strings');
  11288. }
  11289. return p;
  11290. }).join('/'));
  11291. };
  11292. // path.relative(from, to)
  11293. // posix version
  11294. exports.relative = function(from, to) {
  11295. from = exports.resolve(from).substr(1);
  11296. to = exports.resolve(to).substr(1);
  11297. function trim(arr) {
  11298. var start = 0;
  11299. for (; start < arr.length; start++) {
  11300. if (arr[start] !== '') break;
  11301. }
  11302. var end = arr.length - 1;
  11303. for (; end >= 0; end--) {
  11304. if (arr[end] !== '') break;
  11305. }
  11306. if (start > end) return [];
  11307. return arr.slice(start, end - start + 1);
  11308. }
  11309. var fromParts = trim(from.split('/'));
  11310. var toParts = trim(to.split('/'));
  11311. var length = Math.min(fromParts.length, toParts.length);
  11312. var samePartsLength = length;
  11313. for (var i = 0; i < length; i++) {
  11314. if (fromParts[i] !== toParts[i]) {
  11315. samePartsLength = i;
  11316. break;
  11317. }
  11318. }
  11319. var outputParts = [];
  11320. for (var i = samePartsLength; i < fromParts.length; i++) {
  11321. outputParts.push('..');
  11322. }
  11323. outputParts = outputParts.concat(toParts.slice(samePartsLength));
  11324. return outputParts.join('/');
  11325. };
  11326. exports.sep = '/';
  11327. exports.delimiter = ':';
  11328. exports.dirname = function (path) {
  11329. if (typeof path !== 'string') path = path + '';
  11330. if (path.length === 0) return '.';
  11331. var code = path.charCodeAt(0);
  11332. var hasRoot = code === 47 /*/*/;
  11333. var end = -1;
  11334. var matchedSlash = true;
  11335. for (var i = path.length - 1; i >= 1; --i) {
  11336. code = path.charCodeAt(i);
  11337. if (code === 47 /*/*/) {
  11338. if (!matchedSlash) {
  11339. end = i;
  11340. break;
  11341. }
  11342. } else {
  11343. // We saw the first non-path separator
  11344. matchedSlash = false;
  11345. }
  11346. }
  11347. if (end === -1) return hasRoot ? '/' : '.';
  11348. if (hasRoot && end === 1) {
  11349. // return '//';
  11350. // Backwards-compat fix:
  11351. return '/';
  11352. }
  11353. return path.slice(0, end);
  11354. };
  11355. function basename(path) {
  11356. if (typeof path !== 'string') path = path + '';
  11357. var start = 0;
  11358. var end = -1;
  11359. var matchedSlash = true;
  11360. var i;
  11361. for (i = path.length - 1; i >= 0; --i) {
  11362. if (path.charCodeAt(i) === 47 /*/*/) {
  11363. // If we reached a path separator that was not part of a set of path
  11364. // separators at the end of the string, stop now
  11365. if (!matchedSlash) {
  11366. start = i + 1;
  11367. break;
  11368. }
  11369. } else if (end === -1) {
  11370. // We saw the first non-path separator, mark this as the end of our
  11371. // path component
  11372. matchedSlash = false;
  11373. end = i + 1;
  11374. }
  11375. }
  11376. if (end === -1) return '';
  11377. return path.slice(start, end);
  11378. }
  11379. // Uses a mixed approach for backwards-compatibility, as ext behavior changed
  11380. // in new Node.js versions, so only basename() above is backported here
  11381. exports.basename = function (path, ext) {
  11382. var f = basename(path);
  11383. if (ext && f.substr(-1 * ext.length) === ext) {
  11384. f = f.substr(0, f.length - ext.length);
  11385. }
  11386. return f;
  11387. };
  11388. exports.extname = function (path) {
  11389. if (typeof path !== 'string') path = path + '';
  11390. var startDot = -1;
  11391. var startPart = 0;
  11392. var end = -1;
  11393. var matchedSlash = true;
  11394. // Track the state of characters (if any) we see before our first dot and
  11395. // after any path separator we find
  11396. var preDotState = 0;
  11397. for (var i = path.length - 1; i >= 0; --i) {
  11398. var code = path.charCodeAt(i);
  11399. if (code === 47 /*/*/) {
  11400. // If we reached a path separator that was not part of a set of path
  11401. // separators at the end of the string, stop now
  11402. if (!matchedSlash) {
  11403. startPart = i + 1;
  11404. break;
  11405. }
  11406. continue;
  11407. }
  11408. if (end === -1) {
  11409. // We saw the first non-path separator, mark this as the end of our
  11410. // extension
  11411. matchedSlash = false;
  11412. end = i + 1;
  11413. }
  11414. if (code === 46 /*.*/) {
  11415. // If this is our first dot, mark it as the start of our extension
  11416. if (startDot === -1)
  11417. startDot = i;
  11418. else if (preDotState !== 1)
  11419. preDotState = 1;
  11420. } else if (startDot !== -1) {
  11421. // We saw a non-dot and non-path separator before our dot, so we should
  11422. // have a good chance at having a non-empty extension
  11423. preDotState = -1;
  11424. }
  11425. }
  11426. if (startDot === -1 || end === -1 ||
  11427. // We saw a non-dot character immediately before the dot
  11428. preDotState === 0 ||
  11429. // The (right-most) trimmed path component is exactly '..'
  11430. preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
  11431. return '';
  11432. }
  11433. return path.slice(startDot, end);
  11434. };
  11435. function filter (xs, f) {
  11436. if (xs.filter) return xs.filter(f);
  11437. var res = [];
  11438. for (var i = 0; i < xs.length; i++) {
  11439. if (f(xs[i], i, xs)) res.push(xs[i]);
  11440. }
  11441. return res;
  11442. }
  11443. // String.prototype.substr - negative index don't work in IE8
  11444. var substr = 'ab'.substr(-1) === 'b'
  11445. ? function (str, start, len) { return str.substr(start, len) }
  11446. : function (str, start, len) {
  11447. if (start < 0) start = str.length + start;
  11448. return str.substr(start, len);
  11449. }
  11450. ;
  11451. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/mock/process.js */ 312)))
  11452. /***/ }),
  11453. /***/ 32:
  11454. /*!*********************************************************************!*\
  11455. !*** D:/HbuderX-exercise/swim-weapp/uview-ui/libs/function/trim.js ***!
  11456. \*********************************************************************/
  11457. /*! no static exports found */
  11458. /***/ (function(module, exports, __webpack_require__) {
  11459. "use strict";
  11460. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function trim(str) {var pos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'both';
  11461. if (pos == 'both') {
  11462. return str.replace(/^\s+|\s+$/g, "");
  11463. } else if (pos == "left") {
  11464. return str.replace(/^\s*/, '');
  11465. } else if (pos == 'right') {
  11466. return str.replace(/(\s*$)/g, "");
  11467. } else if (pos == 'all') {
  11468. return str.replace(/\s+/g, "");
  11469. } else {
  11470. return str;
  11471. }
  11472. }var _default =
  11473. trim;exports.default = _default;
  11474. /***/ }),
  11475. /***/ 33:
  11476. /*!**********************************************************************!*\
  11477. !*** D:/HbuderX-exercise/swim-weapp/uview-ui/libs/function/toast.js ***!
  11478. \**********************************************************************/
  11479. /*! no static exports found */
  11480. /***/ (function(module, exports, __webpack_require__) {
  11481. "use strict";
  11482. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function toast(title) {var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1500;
  11483. uni.showToast({
  11484. title: title,
  11485. icon: 'none',
  11486. duration: duration });
  11487. }var _default =
  11488. toast;exports.default = _default;
  11489. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  11490. /***/ }),
  11491. /***/ 34:
  11492. /*!**************************************************************************!*\
  11493. !*** D:/HbuderX-exercise/swim-weapp/uview-ui/libs/function/getParent.js ***!
  11494. \**************************************************************************/
  11495. /*! no static exports found */
  11496. /***/ (function(module, exports, __webpack_require__) {
  11497. "use strict";
  11498. Object.defineProperty(exports, "__esModule", { value: true });exports.default = getParent; // 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
  11499. // this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
  11500. function getParent(name, keys) {
  11501. var parent = this.$parent;
  11502. // 通过while历遍,这里主要是为了H5需要多层解析的问题
  11503. while (parent) {
  11504. // 父组件
  11505. if (parent.$options.name !== name) {
  11506. // 如果组件的name不相等,继续上一级寻找
  11507. parent = parent.$parent;
  11508. } else {var _ret = function () {
  11509. var data = {};
  11510. // 判断keys是否数组,如果传过来的是一个数组,那么直接使用数组元素值当做键值去父组件寻找
  11511. if (Array.isArray(keys)) {
  11512. keys.map(function (val) {
  11513. data[val] = parent[val] ? parent[val] : '';
  11514. });
  11515. } else {
  11516. // 历遍传过来的对象参数
  11517. for (var i in keys) {
  11518. // 如果子组件有此值则用,无此值则用父组件的值
  11519. // 判断是否空数组,如果是,则用父组件的值,否则用子组件的值
  11520. if (Array.isArray(keys[i])) {
  11521. if (keys[i].length) {
  11522. data[i] = keys[i];
  11523. } else {
  11524. data[i] = parent[i];
  11525. }
  11526. } else if (keys[i].constructor === Object) {
  11527. // 判断是否对象,如果是对象,且有属性,那么使用子组件的值,否则使用父组件的值
  11528. if (Object.keys(keys[i]).length) {
  11529. data[i] = keys[i];
  11530. } else {
  11531. data[i] = parent[i];
  11532. }
  11533. } else {
  11534. // 只要子组件有传值,即使是false值,也是“传值”了,也需要覆盖父组件的同名参数
  11535. data[i] = keys[i] || keys[i] === false ? keys[i] : parent[i];
  11536. }
  11537. }
  11538. }
  11539. return { v: data };}();if (typeof _ret === "object") return _ret.v;
  11540. }
  11541. }
  11542. return {};
  11543. }
  11544. /***/ }),
  11545. /***/ 35:
  11546. /*!************************************************************************!*\
  11547. !*** D:/HbuderX-exercise/swim-weapp/uview-ui/libs/function/$parent.js ***!
  11548. \************************************************************************/
  11549. /*! no static exports found */
  11550. /***/ (function(module, exports, __webpack_require__) {
  11551. "use strict";
  11552. Object.defineProperty(exports, "__esModule", { value: true });exports.default = $parent; // 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
  11553. // this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
  11554. // 这里默认值等于undefined有它的含义,因为最顶层元素(组件)的$parent就是undefined,意味着不传name
  11555. // 值(默认为undefined),就是查找最顶层的$parent
  11556. function $parent() {var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  11557. var parent = this.$parent;
  11558. // 通过while历遍,这里主要是为了H5需要多层解析的问题
  11559. while (parent) {
  11560. // 父组件
  11561. if (parent.$options && parent.$options.name !== name) {
  11562. // 如果组件的name不相等,继续上一级寻找
  11563. parent = parent.$parent;
  11564. } else {
  11565. return parent;
  11566. }
  11567. }
  11568. return false;
  11569. }
  11570. /***/ }),
  11571. /***/ 36:
  11572. /*!********************************************************************!*\
  11573. !*** D:/HbuderX-exercise/swim-weapp/uview-ui/libs/function/sys.js ***!
  11574. \********************************************************************/
  11575. /*! no static exports found */
  11576. /***/ (function(module, exports, __webpack_require__) {
  11577. "use strict";
  11578. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.os = os;exports.sys = sys;function os() {
  11579. return uni.getSystemInfoSync().platform;
  11580. };
  11581. function sys() {
  11582. return uni.getSystemInfoSync();
  11583. }
  11584. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  11585. /***/ }),
  11586. /***/ 37:
  11587. /*!*************************************************************************!*\
  11588. !*** D:/HbuderX-exercise/swim-weapp/uview-ui/libs/function/debounce.js ***!
  11589. \*************************************************************************/
  11590. /*! no static exports found */
  11591. /***/ (function(module, exports, __webpack_require__) {
  11592. "use strict";
  11593. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var timeout = null;
  11594. /**
  11595. * 防抖原理:一定时间内,只有最后一次操作,再过wait毫秒后才执行函数
  11596. *
  11597. * @param {Function} func 要执行的回调函数
  11598. * @param {Number} wait 延时的时间
  11599. * @param {Boolean} immediate 是否立即执行
  11600. * @return null
  11601. */
  11602. function debounce(func) {var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;var immediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  11603. // 清除定时器
  11604. if (timeout !== null) clearTimeout(timeout);
  11605. // 立即执行,此类情况一般用不到
  11606. if (immediate) {
  11607. var callNow = !timeout;
  11608. timeout = setTimeout(function () {
  11609. timeout = null;
  11610. }, wait);
  11611. if (callNow) typeof func === 'function' && func();
  11612. } else {
  11613. // 设置定时器,当最后一次操作后,timeout不会再被清除,所以在延时wait毫秒后执行func回调方法
  11614. timeout = setTimeout(function () {
  11615. typeof func === 'function' && func();
  11616. }, wait);
  11617. }
  11618. }var _default =
  11619. debounce;exports.default = _default;
  11620. /***/ }),
  11621. /***/ 38:
  11622. /*!*************************************************************************!*\
  11623. !*** D:/HbuderX-exercise/swim-weapp/uview-ui/libs/function/throttle.js ***!
  11624. \*************************************************************************/
  11625. /*! no static exports found */
  11626. /***/ (function(module, exports, __webpack_require__) {
  11627. "use strict";
  11628. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var timer, flag;
  11629. /**
  11630. * 节流原理:在一定时间内,只能触发一次
  11631. *
  11632. * @param {Function} func 要执行的回调函数
  11633. * @param {Number} wait 延时的时间
  11634. * @param {Boolean} immediate 是否立即执行
  11635. * @return null
  11636. */
  11637. function throttle(func) {var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;var immediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  11638. if (immediate) {
  11639. if (!flag) {
  11640. flag = true;
  11641. // 如果是立即执行,则在wait毫秒内开始时执行
  11642. typeof func === 'function' && func();
  11643. timer = setTimeout(function () {
  11644. flag = false;
  11645. }, wait);
  11646. }
  11647. } else {
  11648. if (!flag) {
  11649. flag = true;
  11650. // 如果是非立即执行,则在wait毫秒内的结束处执行
  11651. timer = setTimeout(function () {
  11652. flag = false;
  11653. typeof func === 'function' && func();
  11654. }, wait);
  11655. }
  11656. }
  11657. };var _default =
  11658. throttle;exports.default = _default;
  11659. /***/ }),
  11660. /***/ 39:
  11661. /*!*********************************************************************!*\
  11662. !*** D:/HbuderX-exercise/swim-weapp/uview-ui/libs/config/config.js ***!
  11663. \*********************************************************************/
  11664. /*! no static exports found */
  11665. /***/ (function(module, exports, __webpack_require__) {
  11666. "use strict";
  11667. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 此版本发布于2020-03-17
  11668. var version = '1.8.4';var _default =
  11669. {
  11670. v: version,
  11671. version: version,
  11672. // 主题名称
  11673. type: [
  11674. 'primary',
  11675. 'success',
  11676. 'info',
  11677. 'error',
  11678. 'warning'] };exports.default = _default;
  11679. /***/ }),
  11680. /***/ 4:
  11681. /*!*************************************************************!*\
  11682. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  11683. \*************************************************************/
  11684. /*! no static exports found */
  11685. /***/ (function(module, exports, __webpack_require__) {
  11686. "use strict";
  11687. /* WEBPACK VAR INJECTION */(function(uni, global) {Object.defineProperty(exports, "__esModule", { value: true });exports.compileI18nJsonStr = compileI18nJsonStr;exports.hasI18nJson = hasI18nJson;exports.initVueI18n = initVueI18n;exports.isI18nStr = isI18nStr;exports.normalizeLocale = normalizeLocale;exports.parseI18nJson = parseI18nJson;exports.resolveLocale = resolveLocale;exports.isString = exports.LOCALE_ZH_HANT = exports.LOCALE_ZH_HANS = exports.LOCALE_FR = exports.LOCALE_ES = exports.LOCALE_EN = exports.I18n = exports.Formatter = void 0;function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;}function _iterableToArrayLimit(arr, i) {if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"] != null) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;}var isArray = Array.isArray;
  11688. var isObject = function isObject(val) {return val !== null && typeof val === 'object';};
  11689. var defaultDelimiters = ['{', '}'];var
  11690. BaseFormatter = /*#__PURE__*/function () {
  11691. function BaseFormatter() {_classCallCheck(this, BaseFormatter);
  11692. this._caches = Object.create(null);
  11693. }_createClass(BaseFormatter, [{ key: "interpolate", value: function interpolate(
  11694. message, values) {var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  11695. if (!values) {
  11696. return [message];
  11697. }
  11698. var tokens = this._caches[message];
  11699. if (!tokens) {
  11700. tokens = parse(message, delimiters);
  11701. this._caches[message] = tokens;
  11702. }
  11703. return compile(tokens, values);
  11704. } }]);return BaseFormatter;}();exports.Formatter = BaseFormatter;
  11705. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  11706. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  11707. function parse(format, _ref) {var _ref2 = _slicedToArray(_ref, 2),startDelimiter = _ref2[0],endDelimiter = _ref2[1];
  11708. var tokens = [];
  11709. var position = 0;
  11710. var text = '';
  11711. while (position < format.length) {
  11712. var char = format[position++];
  11713. if (char === startDelimiter) {
  11714. if (text) {
  11715. tokens.push({ type: 'text', value: text });
  11716. }
  11717. text = '';
  11718. var sub = '';
  11719. char = format[position++];
  11720. while (char !== undefined && char !== endDelimiter) {
  11721. sub += char;
  11722. char = format[position++];
  11723. }
  11724. var isClosed = char === endDelimiter;
  11725. var type = RE_TOKEN_LIST_VALUE.test(sub) ?
  11726. 'list' :
  11727. isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ?
  11728. 'named' :
  11729. 'unknown';
  11730. tokens.push({ value: sub, type: type });
  11731. }
  11732. // else if (char === '%') {
  11733. // // when found rails i18n syntax, skip text capture
  11734. // if (format[position] !== '{') {
  11735. // text += char
  11736. // }
  11737. // }
  11738. else {
  11739. text += char;
  11740. }
  11741. }
  11742. text && tokens.push({ type: 'text', value: text });
  11743. return tokens;
  11744. }
  11745. function compile(tokens, values) {
  11746. var compiled = [];
  11747. var index = 0;
  11748. var mode = isArray(values) ?
  11749. 'list' :
  11750. isObject(values) ?
  11751. 'named' :
  11752. 'unknown';
  11753. if (mode === 'unknown') {
  11754. return compiled;
  11755. }
  11756. while (index < tokens.length) {
  11757. var token = tokens[index];
  11758. switch (token.type) {
  11759. case 'text':
  11760. compiled.push(token.value);
  11761. break;
  11762. case 'list':
  11763. compiled.push(values[parseInt(token.value, 10)]);
  11764. break;
  11765. case 'named':
  11766. if (mode === 'named') {
  11767. compiled.push(values[token.value]);
  11768. } else
  11769. {
  11770. if (true) {
  11771. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  11772. }
  11773. }
  11774. break;
  11775. case 'unknown':
  11776. if (true) {
  11777. console.warn("Detect 'unknown' type of token!");
  11778. }
  11779. break;}
  11780. index++;
  11781. }
  11782. return compiled;
  11783. }
  11784. var LOCALE_ZH_HANS = 'zh-Hans';exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  11785. var LOCALE_ZH_HANT = 'zh-Hant';exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  11786. var LOCALE_EN = 'en';exports.LOCALE_EN = LOCALE_EN;
  11787. var LOCALE_FR = 'fr';exports.LOCALE_FR = LOCALE_FR;
  11788. var LOCALE_ES = 'es';exports.LOCALE_ES = LOCALE_ES;
  11789. var hasOwnProperty = Object.prototype.hasOwnProperty;
  11790. var hasOwn = function hasOwn(val, key) {return hasOwnProperty.call(val, key);};
  11791. var defaultFormatter = new BaseFormatter();
  11792. function include(str, parts) {
  11793. return !!parts.find(function (part) {return str.indexOf(part) !== -1;});
  11794. }
  11795. function startsWith(str, parts) {
  11796. return parts.find(function (part) {return str.indexOf(part) === 0;});
  11797. }
  11798. function normalizeLocale(locale, messages) {
  11799. if (!locale) {
  11800. return;
  11801. }
  11802. locale = locale.trim().replace(/_/g, '-');
  11803. if (messages && messages[locale]) {
  11804. return locale;
  11805. }
  11806. locale = locale.toLowerCase();
  11807. if (locale.indexOf('zh') === 0) {
  11808. if (locale.indexOf('-hans') > -1) {
  11809. return LOCALE_ZH_HANS;
  11810. }
  11811. if (locale.indexOf('-hant') > -1) {
  11812. return LOCALE_ZH_HANT;
  11813. }
  11814. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  11815. return LOCALE_ZH_HANT;
  11816. }
  11817. return LOCALE_ZH_HANS;
  11818. }
  11819. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  11820. if (lang) {
  11821. return lang;
  11822. }
  11823. }var
  11824. I18n = /*#__PURE__*/function () {
  11825. function I18n(_ref3) {var locale = _ref3.locale,fallbackLocale = _ref3.fallbackLocale,messages = _ref3.messages,watcher = _ref3.watcher,formater = _ref3.formater;_classCallCheck(this, I18n);
  11826. this.locale = LOCALE_EN;
  11827. this.fallbackLocale = LOCALE_EN;
  11828. this.message = {};
  11829. this.messages = {};
  11830. this.watchers = [];
  11831. if (fallbackLocale) {
  11832. this.fallbackLocale = fallbackLocale;
  11833. }
  11834. this.formater = formater || defaultFormatter;
  11835. this.messages = messages || {};
  11836. this.setLocale(locale || LOCALE_EN);
  11837. if (watcher) {
  11838. this.watchLocale(watcher);
  11839. }
  11840. }_createClass(I18n, [{ key: "setLocale", value: function setLocale(
  11841. locale) {var _this = this;
  11842. var oldLocale = this.locale;
  11843. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  11844. if (!this.messages[this.locale]) {
  11845. // 可能初始化时不存在
  11846. this.messages[this.locale] = {};
  11847. }
  11848. this.message = this.messages[this.locale];
  11849. // 仅发生变化时,通知
  11850. if (oldLocale !== this.locale) {
  11851. this.watchers.forEach(function (watcher) {
  11852. watcher(_this.locale, oldLocale);
  11853. });
  11854. }
  11855. } }, { key: "getLocale", value: function getLocale()
  11856. {
  11857. return this.locale;
  11858. } }, { key: "watchLocale", value: function watchLocale(
  11859. fn) {var _this2 = this;
  11860. var index = this.watchers.push(fn) - 1;
  11861. return function () {
  11862. _this2.watchers.splice(index, 1);
  11863. };
  11864. } }, { key: "add", value: function add(
  11865. locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  11866. var curMessages = this.messages[locale];
  11867. if (curMessages) {
  11868. if (override) {
  11869. Object.assign(curMessages, message);
  11870. } else
  11871. {
  11872. Object.keys(message).forEach(function (key) {
  11873. if (!hasOwn(curMessages, key)) {
  11874. curMessages[key] = message[key];
  11875. }
  11876. });
  11877. }
  11878. } else
  11879. {
  11880. this.messages[locale] = message;
  11881. }
  11882. } }, { key: "f", value: function f(
  11883. message, values, delimiters) {
  11884. return this.formater.interpolate(message, values, delimiters).join('');
  11885. } }, { key: "t", value: function t(
  11886. key, locale, values) {
  11887. var message = this.message;
  11888. if (typeof locale === 'string') {
  11889. locale = normalizeLocale(locale, this.messages);
  11890. locale && (message = this.messages[locale]);
  11891. } else
  11892. {
  11893. values = locale;
  11894. }
  11895. if (!hasOwn(message, key)) {
  11896. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  11897. return key;
  11898. }
  11899. return this.formater.interpolate(message[key], values).join('');
  11900. } }]);return I18n;}();exports.I18n = I18n;
  11901. function watchAppLocale(appVm, i18n) {
  11902. // 需要保证 watch 的触发在组件渲染之前
  11903. if (appVm.$watchLocale) {
  11904. // vue2
  11905. appVm.$watchLocale(function (newLocale) {
  11906. i18n.setLocale(newLocale);
  11907. });
  11908. } else
  11909. {
  11910. appVm.$watch(function () {return appVm.$locale;}, function (newLocale) {
  11911. i18n.setLocale(newLocale);
  11912. });
  11913. }
  11914. }
  11915. function getDefaultLocale() {
  11916. if (typeof uni !== 'undefined' && uni.getLocale) {
  11917. return uni.getLocale();
  11918. }
  11919. // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
  11920. if (typeof global !== 'undefined' && global.getLocale) {
  11921. return global.getLocale();
  11922. }
  11923. return LOCALE_EN;
  11924. }
  11925. function initVueI18n(locale) {var messages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var fallbackLocale = arguments.length > 2 ? arguments[2] : undefined;var watcher = arguments.length > 3 ? arguments[3] : undefined;
  11926. // 兼容旧版本入参
  11927. if (typeof locale !== 'string') {var _ref4 =
  11928. [
  11929. messages,
  11930. locale];locale = _ref4[0];messages = _ref4[1];
  11931. }
  11932. if (typeof locale !== 'string') {
  11933. // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
  11934. locale = getDefaultLocale();
  11935. }
  11936. if (typeof fallbackLocale !== 'string') {
  11937. fallbackLocale =
  11938. typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale ||
  11939. LOCALE_EN;
  11940. }
  11941. var i18n = new I18n({
  11942. locale: locale,
  11943. fallbackLocale: fallbackLocale,
  11944. messages: messages,
  11945. watcher: watcher });
  11946. var _t = function t(key, values) {
  11947. if (typeof getApp !== 'function') {
  11948. // app view
  11949. /* eslint-disable no-func-assign */
  11950. _t = function t(key, values) {
  11951. return i18n.t(key, values);
  11952. };
  11953. } else
  11954. {
  11955. var isWatchedAppLocale = false;
  11956. _t = function t(key, values) {
  11957. var appVm = getApp().$vm;
  11958. // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
  11959. // options: {
  11960. // type: Array,
  11961. // default () {
  11962. // return [{
  11963. // icon: 'shop',
  11964. // text: t("uni-goods-nav.options.shop"),
  11965. // }, {
  11966. // icon: 'cart',
  11967. // text: t("uni-goods-nav.options.cart")
  11968. // }]
  11969. // }
  11970. // },
  11971. if (appVm) {
  11972. // 触发响应式
  11973. appVm.$locale;
  11974. if (!isWatchedAppLocale) {
  11975. isWatchedAppLocale = true;
  11976. watchAppLocale(appVm, i18n);
  11977. }
  11978. }
  11979. return i18n.t(key, values);
  11980. };
  11981. }
  11982. return _t(key, values);
  11983. };
  11984. return {
  11985. i18n: i18n,
  11986. f: function f(message, values, delimiters) {
  11987. return i18n.f(message, values, delimiters);
  11988. },
  11989. t: function t(key, values) {
  11990. return _t(key, values);
  11991. },
  11992. add: function add(locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  11993. return i18n.add(locale, message, override);
  11994. },
  11995. watch: function watch(fn) {
  11996. return i18n.watchLocale(fn);
  11997. },
  11998. getLocale: function getLocale() {
  11999. return i18n.getLocale();
  12000. },
  12001. setLocale: function setLocale(newLocale) {
  12002. return i18n.setLocale(newLocale);
  12003. } };
  12004. }
  12005. var isString = function isString(val) {return typeof val === 'string';};exports.isString = isString;
  12006. var formater;
  12007. function hasI18nJson(jsonObj, delimiters) {
  12008. if (!formater) {
  12009. formater = new BaseFormatter();
  12010. }
  12011. return walkJsonObj(jsonObj, function (jsonObj, key) {
  12012. var value = jsonObj[key];
  12013. if (isString(value)) {
  12014. if (isI18nStr(value, delimiters)) {
  12015. return true;
  12016. }
  12017. } else
  12018. {
  12019. return hasI18nJson(value, delimiters);
  12020. }
  12021. });
  12022. }
  12023. function parseI18nJson(jsonObj, values, delimiters) {
  12024. if (!formater) {
  12025. formater = new BaseFormatter();
  12026. }
  12027. walkJsonObj(jsonObj, function (jsonObj, key) {
  12028. var value = jsonObj[key];
  12029. if (isString(value)) {
  12030. if (isI18nStr(value, delimiters)) {
  12031. jsonObj[key] = compileStr(value, values, delimiters);
  12032. }
  12033. } else
  12034. {
  12035. parseI18nJson(value, values, delimiters);
  12036. }
  12037. });
  12038. return jsonObj;
  12039. }
  12040. function compileI18nJsonStr(jsonStr, _ref5) {var locale = _ref5.locale,locales = _ref5.locales,delimiters = _ref5.delimiters;
  12041. if (!isI18nStr(jsonStr, delimiters)) {
  12042. return jsonStr;
  12043. }
  12044. if (!formater) {
  12045. formater = new BaseFormatter();
  12046. }
  12047. var localeValues = [];
  12048. Object.keys(locales).forEach(function (name) {
  12049. if (name !== locale) {
  12050. localeValues.push({
  12051. locale: name,
  12052. values: locales[name] });
  12053. }
  12054. });
  12055. localeValues.unshift({ locale: locale, values: locales[locale] });
  12056. try {
  12057. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  12058. }
  12059. catch (e) {}
  12060. return jsonStr;
  12061. }
  12062. function isI18nStr(value, delimiters) {
  12063. return value.indexOf(delimiters[0]) > -1;
  12064. }
  12065. function compileStr(value, values, delimiters) {
  12066. return formater.interpolate(value, values, delimiters).join('');
  12067. }
  12068. function compileValue(jsonObj, key, localeValues, delimiters) {
  12069. var value = jsonObj[key];
  12070. if (isString(value)) {
  12071. // 存在国际化
  12072. if (isI18nStr(value, delimiters)) {
  12073. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  12074. if (localeValues.length > 1) {
  12075. // 格式化国际化语言
  12076. var valueLocales = jsonObj[key + 'Locales'] = {};
  12077. localeValues.forEach(function (localValue) {
  12078. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  12079. });
  12080. }
  12081. }
  12082. } else
  12083. {
  12084. compileJsonObj(value, localeValues, delimiters);
  12085. }
  12086. }
  12087. function compileJsonObj(jsonObj, localeValues, delimiters) {
  12088. walkJsonObj(jsonObj, function (jsonObj, key) {
  12089. compileValue(jsonObj, key, localeValues, delimiters);
  12090. });
  12091. return jsonObj;
  12092. }
  12093. function walkJsonObj(jsonObj, walk) {
  12094. if (isArray(jsonObj)) {
  12095. for (var i = 0; i < jsonObj.length; i++) {
  12096. if (walk(jsonObj, i)) {
  12097. return true;
  12098. }
  12099. }
  12100. } else
  12101. if (isObject(jsonObj)) {
  12102. for (var key in jsonObj) {
  12103. if (walk(jsonObj, key)) {
  12104. return true;
  12105. }
  12106. }
  12107. }
  12108. return false;
  12109. }
  12110. function resolveLocale(locales) {
  12111. return function (locale) {
  12112. if (!locale) {
  12113. return locale;
  12114. }
  12115. locale = normalizeLocale(locale) || locale;
  12116. return resolveLocaleChain(locale).find(function (locale) {return locales.indexOf(locale) > -1;});
  12117. };
  12118. }
  12119. function resolveLocaleChain(locale) {
  12120. var chain = [];
  12121. var tokens = locale.split('-');
  12122. while (tokens.length) {
  12123. chain.push(tokens.join('-'));
  12124. tokens.pop();
  12125. }
  12126. return chain;
  12127. }
  12128. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"], __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 2)))
  12129. /***/ }),
  12130. /***/ 40:
  12131. /*!*********************************************************************!*\
  12132. !*** D:/HbuderX-exercise/swim-weapp/uview-ui/libs/config/zIndex.js ***!
  12133. \*********************************************************************/
  12134. /*! no static exports found */
  12135. /***/ (function(module, exports, __webpack_require__) {
  12136. "use strict";
  12137. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // uniapp在H5中各API的z-index值如下:
  12138. /**
  12139. * actionsheet: 999
  12140. * modal: 999
  12141. * navigate: 998
  12142. * tabbar: 998
  12143. * toast: 999
  12144. */var _default =
  12145. {
  12146. toast: 10090,
  12147. noNetwork: 10080,
  12148. // popup包含popup,actionsheet,keyboard,picker的值
  12149. popup: 10075,
  12150. mask: 10070,
  12151. navbar: 980,
  12152. topTips: 975,
  12153. sticky: 970,
  12154. indexListSticky: 965 };exports.default = _default;
  12155. /***/ }),
  12156. /***/ 41:
  12157. /*!*****************************************************!*\
  12158. !*** D:/HbuderX-exercise/swim-weapp/store/index.js ***!
  12159. \*****************************************************/
  12160. /*! no static exports found */
  12161. /***/ (function(module, exports, __webpack_require__) {
  12162. "use strict";
  12163. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 3));
  12164. var _vuex = _interopRequireDefault(__webpack_require__(/*! vuex */ 42));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  12165. _vue.default.use(_vuex.default);
  12166. var lifeData = {};
  12167. try {
  12168. // 尝试获取本地是否存在lifeData变量,第一次启动APP时是不存在的
  12169. lifeData = uni.getStorageSync('lifeData');
  12170. } catch (e) {
  12171. }
  12172. // 需要永久存储,且下次APP启动需要取出的,在state中的变量名
  12173. var saveStateKeys = ['vuex_user', 'vuex_token', 'vuex_setting', 'vuex_login', 'vuex_area_index'];
  12174. // 保存变量到本地存储中
  12175. var saveLifeData = function saveLifeData(key, value) {
  12176. // 判断变量名是否在需要存储的数组中
  12177. if (saveStateKeys.indexOf(key) != -1) {
  12178. // 获取本地存储的lifeData对象,将变量添加到对象中
  12179. var tmp = uni.getStorageSync('lifeData');
  12180. // 第一次打开APP,不存在lifeData变量,故放一个{}空对象
  12181. tmp = tmp ? tmp : {};
  12182. tmp[key] = value;
  12183. // 执行这一步后,所有需要存储的变量,都挂载在本地的lifeData对象中
  12184. uni.setStorageSync('lifeData', tmp);
  12185. }
  12186. };
  12187. var store = new _vuex.default.Store({
  12188. state: {
  12189. // 如果上面从本地获取的lifeData对象下有对应的属性,就赋值给state中对应的变量
  12190. // 加上vuex_前缀,是防止变量名冲突,也让人一目了然
  12191. vuex_user: lifeData.vuex_user ? lifeData.vuex_user : {
  12192. name: 'name' },
  12193. vuex_token: lifeData.vuex_token ? lifeData.vuex_token : '',
  12194. // 如果vuex_version无需保存到本地永久存储,无需lifeData.vuex_version方式
  12195. vuex_areas: [],
  12196. vuex_area: {
  12197. id: 0,
  12198. name: '' },
  12199. vuex_session_key: '',
  12200. vuex_is_auth: '',
  12201. vuex_area_index: lifeData.vuex_area_index ? lifeData.vuex_area_index : 0,
  12202. vuex_version: '1.0.1',
  12203. vuex_setting: lifeData.vuex_setting ? lifeData.vuex_setting : {
  12204. electricity: 30 },
  12205. vuex_login: lifeData.vuex_login ? lifeData.vuex_login : { account: '', password: '' } },
  12206. mutations: {
  12207. $uStore: function $uStore(state, payload) {
  12208. // 判断是否多层级调用,state中为对象存在的情况,诸如user.info.score = 1
  12209. var nameArr = payload.name.split('.');
  12210. var saveKey = '';
  12211. var len = nameArr.length;
  12212. if (len >= 2) {
  12213. var obj = state[nameArr[0]];
  12214. for (var i = 1; i < len - 1; i++) {
  12215. obj = obj[nameArr[i]];
  12216. }
  12217. obj[nameArr[len - 1]] = payload.value;
  12218. saveKey = nameArr[0];
  12219. } else {
  12220. // 单层级变量,在state就是一个普通变量的情况
  12221. state[payload.name] = payload.value;
  12222. saveKey = payload.name;
  12223. }
  12224. // 保存变量到本地,见顶部函数定义
  12225. saveLifeData(saveKey, state[saveKey]);
  12226. } } });var _default =
  12227. store;exports.default = _default;
  12228. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  12229. /***/ }),
  12230. /***/ 42:
  12231. /*!**************************************************************************************!*\
  12232. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vuex3/dist/vuex.common.js ***!
  12233. \**************************************************************************************/
  12234. /*! no static exports found */
  12235. /***/ (function(module, exports, __webpack_require__) {
  12236. "use strict";
  12237. /* WEBPACK VAR INJECTION */(function(global) {/*!
  12238. * vuex v3.6.2
  12239. * (c) 2021 Evan You
  12240. * @license MIT
  12241. */
  12242. function applyMixin (Vue) {
  12243. var version = Number(Vue.version.split('.')[0]);
  12244. if (version >= 2) {
  12245. Vue.mixin({ beforeCreate: vuexInit });
  12246. } else {
  12247. // override init and inject vuex init procedure
  12248. // for 1.x backwards compatibility.
  12249. var _init = Vue.prototype._init;
  12250. Vue.prototype._init = function (options) {
  12251. if ( options === void 0 ) options = {};
  12252. options.init = options.init
  12253. ? [vuexInit].concat(options.init)
  12254. : vuexInit;
  12255. _init.call(this, options);
  12256. };
  12257. }
  12258. /**
  12259. * Vuex init hook, injected into each instances init hooks list.
  12260. */
  12261. function vuexInit () {
  12262. var options = this.$options;
  12263. // store injection
  12264. if (options.store) {
  12265. this.$store = typeof options.store === 'function'
  12266. ? options.store()
  12267. : options.store;
  12268. } else if (options.parent && options.parent.$store) {
  12269. this.$store = options.parent.$store;
  12270. }
  12271. }
  12272. }
  12273. var target = typeof window !== 'undefined'
  12274. ? window
  12275. : typeof global !== 'undefined'
  12276. ? global
  12277. : {};
  12278. var devtoolHook = target.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  12279. function devtoolPlugin (store) {
  12280. if (!devtoolHook) { return }
  12281. store._devtoolHook = devtoolHook;
  12282. devtoolHook.emit('vuex:init', store);
  12283. devtoolHook.on('vuex:travel-to-state', function (targetState) {
  12284. store.replaceState(targetState);
  12285. });
  12286. store.subscribe(function (mutation, state) {
  12287. devtoolHook.emit('vuex:mutation', mutation, state);
  12288. }, { prepend: true });
  12289. store.subscribeAction(function (action, state) {
  12290. devtoolHook.emit('vuex:action', action, state);
  12291. }, { prepend: true });
  12292. }
  12293. /**
  12294. * Get the first item that pass the test
  12295. * by second argument function
  12296. *
  12297. * @param {Array} list
  12298. * @param {Function} f
  12299. * @return {*}
  12300. */
  12301. function find (list, f) {
  12302. return list.filter(f)[0]
  12303. }
  12304. /**
  12305. * Deep copy the given object considering circular structure.
  12306. * This function caches all nested objects and its copies.
  12307. * If it detects circular structure, use cached copy to avoid infinite loop.
  12308. *
  12309. * @param {*} obj
  12310. * @param {Array<Object>} cache
  12311. * @return {*}
  12312. */
  12313. function deepCopy (obj, cache) {
  12314. if ( cache === void 0 ) cache = [];
  12315. // just return if obj is immutable value
  12316. if (obj === null || typeof obj !== 'object') {
  12317. return obj
  12318. }
  12319. // if obj is hit, it is in circular structure
  12320. var hit = find(cache, function (c) { return c.original === obj; });
  12321. if (hit) {
  12322. return hit.copy
  12323. }
  12324. var copy = Array.isArray(obj) ? [] : {};
  12325. // put the copy into cache at first
  12326. // because we want to refer it in recursive deepCopy
  12327. cache.push({
  12328. original: obj,
  12329. copy: copy
  12330. });
  12331. Object.keys(obj).forEach(function (key) {
  12332. copy[key] = deepCopy(obj[key], cache);
  12333. });
  12334. return copy
  12335. }
  12336. /**
  12337. * forEach for object
  12338. */
  12339. function forEachValue (obj, fn) {
  12340. Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });
  12341. }
  12342. function isObject (obj) {
  12343. return obj !== null && typeof obj === 'object'
  12344. }
  12345. function isPromise (val) {
  12346. return val && typeof val.then === 'function'
  12347. }
  12348. function assert (condition, msg) {
  12349. if (!condition) { throw new Error(("[vuex] " + msg)) }
  12350. }
  12351. function partial (fn, arg) {
  12352. return function () {
  12353. return fn(arg)
  12354. }
  12355. }
  12356. // Base data struct for store's module, package with some attribute and method
  12357. var Module = function Module (rawModule, runtime) {
  12358. this.runtime = runtime;
  12359. // Store some children item
  12360. this._children = Object.create(null);
  12361. // Store the origin module object which passed by programmer
  12362. this._rawModule = rawModule;
  12363. var rawState = rawModule.state;
  12364. // Store the origin module's state
  12365. this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};
  12366. };
  12367. var prototypeAccessors = { namespaced: { configurable: true } };
  12368. prototypeAccessors.namespaced.get = function () {
  12369. return !!this._rawModule.namespaced
  12370. };
  12371. Module.prototype.addChild = function addChild (key, module) {
  12372. this._children[key] = module;
  12373. };
  12374. Module.prototype.removeChild = function removeChild (key) {
  12375. delete this._children[key];
  12376. };
  12377. Module.prototype.getChild = function getChild (key) {
  12378. return this._children[key]
  12379. };
  12380. Module.prototype.hasChild = function hasChild (key) {
  12381. return key in this._children
  12382. };
  12383. Module.prototype.update = function update (rawModule) {
  12384. this._rawModule.namespaced = rawModule.namespaced;
  12385. if (rawModule.actions) {
  12386. this._rawModule.actions = rawModule.actions;
  12387. }
  12388. if (rawModule.mutations) {
  12389. this._rawModule.mutations = rawModule.mutations;
  12390. }
  12391. if (rawModule.getters) {
  12392. this._rawModule.getters = rawModule.getters;
  12393. }
  12394. };
  12395. Module.prototype.forEachChild = function forEachChild (fn) {
  12396. forEachValue(this._children, fn);
  12397. };
  12398. Module.prototype.forEachGetter = function forEachGetter (fn) {
  12399. if (this._rawModule.getters) {
  12400. forEachValue(this._rawModule.getters, fn);
  12401. }
  12402. };
  12403. Module.prototype.forEachAction = function forEachAction (fn) {
  12404. if (this._rawModule.actions) {
  12405. forEachValue(this._rawModule.actions, fn);
  12406. }
  12407. };
  12408. Module.prototype.forEachMutation = function forEachMutation (fn) {
  12409. if (this._rawModule.mutations) {
  12410. forEachValue(this._rawModule.mutations, fn);
  12411. }
  12412. };
  12413. Object.defineProperties( Module.prototype, prototypeAccessors );
  12414. var ModuleCollection = function ModuleCollection (rawRootModule) {
  12415. // register root module (Vuex.Store options)
  12416. this.register([], rawRootModule, false);
  12417. };
  12418. ModuleCollection.prototype.get = function get (path) {
  12419. return path.reduce(function (module, key) {
  12420. return module.getChild(key)
  12421. }, this.root)
  12422. };
  12423. ModuleCollection.prototype.getNamespace = function getNamespace (path) {
  12424. var module = this.root;
  12425. return path.reduce(function (namespace, key) {
  12426. module = module.getChild(key);
  12427. return namespace + (module.namespaced ? key + '/' : '')
  12428. }, '')
  12429. };
  12430. ModuleCollection.prototype.update = function update$1 (rawRootModule) {
  12431. update([], this.root, rawRootModule);
  12432. };
  12433. ModuleCollection.prototype.register = function register (path, rawModule, runtime) {
  12434. var this$1 = this;
  12435. if ( runtime === void 0 ) runtime = true;
  12436. if ((true)) {
  12437. assertRawModule(path, rawModule);
  12438. }
  12439. var newModule = new Module(rawModule, runtime);
  12440. if (path.length === 0) {
  12441. this.root = newModule;
  12442. } else {
  12443. var parent = this.get(path.slice(0, -1));
  12444. parent.addChild(path[path.length - 1], newModule);
  12445. }
  12446. // register nested modules
  12447. if (rawModule.modules) {
  12448. forEachValue(rawModule.modules, function (rawChildModule, key) {
  12449. this$1.register(path.concat(key), rawChildModule, runtime);
  12450. });
  12451. }
  12452. };
  12453. ModuleCollection.prototype.unregister = function unregister (path) {
  12454. var parent = this.get(path.slice(0, -1));
  12455. var key = path[path.length - 1];
  12456. var child = parent.getChild(key);
  12457. if (!child) {
  12458. if ((true)) {
  12459. console.warn(
  12460. "[vuex] trying to unregister module '" + key + "', which is " +
  12461. "not registered"
  12462. );
  12463. }
  12464. return
  12465. }
  12466. if (!child.runtime) {
  12467. return
  12468. }
  12469. parent.removeChild(key);
  12470. };
  12471. ModuleCollection.prototype.isRegistered = function isRegistered (path) {
  12472. var parent = this.get(path.slice(0, -1));
  12473. var key = path[path.length - 1];
  12474. if (parent) {
  12475. return parent.hasChild(key)
  12476. }
  12477. return false
  12478. };
  12479. function update (path, targetModule, newModule) {
  12480. if ((true)) {
  12481. assertRawModule(path, newModule);
  12482. }
  12483. // update target module
  12484. targetModule.update(newModule);
  12485. // update nested modules
  12486. if (newModule.modules) {
  12487. for (var key in newModule.modules) {
  12488. if (!targetModule.getChild(key)) {
  12489. if ((true)) {
  12490. console.warn(
  12491. "[vuex] trying to add a new module '" + key + "' on hot reloading, " +
  12492. 'manual reload is needed'
  12493. );
  12494. }
  12495. return
  12496. }
  12497. update(
  12498. path.concat(key),
  12499. targetModule.getChild(key),
  12500. newModule.modules[key]
  12501. );
  12502. }
  12503. }
  12504. }
  12505. var functionAssert = {
  12506. assert: function (value) { return typeof value === 'function'; },
  12507. expected: 'function'
  12508. };
  12509. var objectAssert = {
  12510. assert: function (value) { return typeof value === 'function' ||
  12511. (typeof value === 'object' && typeof value.handler === 'function'); },
  12512. expected: 'function or object with "handler" function'
  12513. };
  12514. var assertTypes = {
  12515. getters: functionAssert,
  12516. mutations: functionAssert,
  12517. actions: objectAssert
  12518. };
  12519. function assertRawModule (path, rawModule) {
  12520. Object.keys(assertTypes).forEach(function (key) {
  12521. if (!rawModule[key]) { return }
  12522. var assertOptions = assertTypes[key];
  12523. forEachValue(rawModule[key], function (value, type) {
  12524. assert(
  12525. assertOptions.assert(value),
  12526. makeAssertionMessage(path, key, type, value, assertOptions.expected)
  12527. );
  12528. });
  12529. });
  12530. }
  12531. function makeAssertionMessage (path, key, type, value, expected) {
  12532. var buf = key + " should be " + expected + " but \"" + key + "." + type + "\"";
  12533. if (path.length > 0) {
  12534. buf += " in module \"" + (path.join('.')) + "\"";
  12535. }
  12536. buf += " is " + (JSON.stringify(value)) + ".";
  12537. return buf
  12538. }
  12539. var Vue; // bind on install
  12540. var Store = function Store (options) {
  12541. var this$1 = this;
  12542. if ( options === void 0 ) options = {};
  12543. // Auto install if it is not done yet and `window` has `Vue`.
  12544. // To allow users to avoid auto-installation in some cases,
  12545. // this code should be placed here. See #731
  12546. if (!Vue && typeof window !== 'undefined' && window.Vue) {
  12547. install(window.Vue);
  12548. }
  12549. if ((true)) {
  12550. assert(Vue, "must call Vue.use(Vuex) before creating a store instance.");
  12551. assert(typeof Promise !== 'undefined', "vuex requires a Promise polyfill in this browser.");
  12552. assert(this instanceof Store, "store must be called with the new operator.");
  12553. }
  12554. var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];
  12555. var strict = options.strict; if ( strict === void 0 ) strict = false;
  12556. // store internal state
  12557. this._committing = false;
  12558. this._actions = Object.create(null);
  12559. this._actionSubscribers = [];
  12560. this._mutations = Object.create(null);
  12561. this._wrappedGetters = Object.create(null);
  12562. this._modules = new ModuleCollection(options);
  12563. this._modulesNamespaceMap = Object.create(null);
  12564. this._subscribers = [];
  12565. this._watcherVM = new Vue();
  12566. this._makeLocalGettersCache = Object.create(null);
  12567. // bind commit and dispatch to self
  12568. var store = this;
  12569. var ref = this;
  12570. var dispatch = ref.dispatch;
  12571. var commit = ref.commit;
  12572. this.dispatch = function boundDispatch (type, payload) {
  12573. return dispatch.call(store, type, payload)
  12574. };
  12575. this.commit = function boundCommit (type, payload, options) {
  12576. return commit.call(store, type, payload, options)
  12577. };
  12578. // strict mode
  12579. this.strict = strict;
  12580. var state = this._modules.root.state;
  12581. // init root module.
  12582. // this also recursively registers all sub-modules
  12583. // and collects all module getters inside this._wrappedGetters
  12584. installModule(this, state, [], this._modules.root);
  12585. // initialize the store vm, which is responsible for the reactivity
  12586. // (also registers _wrappedGetters as computed properties)
  12587. resetStoreVM(this, state);
  12588. // apply plugins
  12589. plugins.forEach(function (plugin) { return plugin(this$1); });
  12590. var useDevtools = options.devtools !== undefined ? options.devtools : Vue.config.devtools;
  12591. if (useDevtools) {
  12592. devtoolPlugin(this);
  12593. }
  12594. };
  12595. var prototypeAccessors$1 = { state: { configurable: true } };
  12596. prototypeAccessors$1.state.get = function () {
  12597. return this._vm._data.$$state
  12598. };
  12599. prototypeAccessors$1.state.set = function (v) {
  12600. if ((true)) {
  12601. assert(false, "use store.replaceState() to explicit replace store state.");
  12602. }
  12603. };
  12604. Store.prototype.commit = function commit (_type, _payload, _options) {
  12605. var this$1 = this;
  12606. // check object-style commit
  12607. var ref = unifyObjectStyle(_type, _payload, _options);
  12608. var type = ref.type;
  12609. var payload = ref.payload;
  12610. var options = ref.options;
  12611. var mutation = { type: type, payload: payload };
  12612. var entry = this._mutations[type];
  12613. if (!entry) {
  12614. if ((true)) {
  12615. console.error(("[vuex] unknown mutation type: " + type));
  12616. }
  12617. return
  12618. }
  12619. this._withCommit(function () {
  12620. entry.forEach(function commitIterator (handler) {
  12621. handler(payload);
  12622. });
  12623. });
  12624. this._subscribers
  12625. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  12626. .forEach(function (sub) { return sub(mutation, this$1.state); });
  12627. if (
  12628. ( true) &&
  12629. options && options.silent
  12630. ) {
  12631. console.warn(
  12632. "[vuex] mutation type: " + type + ". Silent option has been removed. " +
  12633. 'Use the filter functionality in the vue-devtools'
  12634. );
  12635. }
  12636. };
  12637. Store.prototype.dispatch = function dispatch (_type, _payload) {
  12638. var this$1 = this;
  12639. // check object-style dispatch
  12640. var ref = unifyObjectStyle(_type, _payload);
  12641. var type = ref.type;
  12642. var payload = ref.payload;
  12643. var action = { type: type, payload: payload };
  12644. var entry = this._actions[type];
  12645. if (!entry) {
  12646. if ((true)) {
  12647. console.error(("[vuex] unknown action type: " + type));
  12648. }
  12649. return
  12650. }
  12651. try {
  12652. this._actionSubscribers
  12653. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  12654. .filter(function (sub) { return sub.before; })
  12655. .forEach(function (sub) { return sub.before(action, this$1.state); });
  12656. } catch (e) {
  12657. if ((true)) {
  12658. console.warn("[vuex] error in before action subscribers: ");
  12659. console.error(e);
  12660. }
  12661. }
  12662. var result = entry.length > 1
  12663. ? Promise.all(entry.map(function (handler) { return handler(payload); }))
  12664. : entry[0](payload);
  12665. return new Promise(function (resolve, reject) {
  12666. result.then(function (res) {
  12667. try {
  12668. this$1._actionSubscribers
  12669. .filter(function (sub) { return sub.after; })
  12670. .forEach(function (sub) { return sub.after(action, this$1.state); });
  12671. } catch (e) {
  12672. if ((true)) {
  12673. console.warn("[vuex] error in after action subscribers: ");
  12674. console.error(e);
  12675. }
  12676. }
  12677. resolve(res);
  12678. }, function (error) {
  12679. try {
  12680. this$1._actionSubscribers
  12681. .filter(function (sub) { return sub.error; })
  12682. .forEach(function (sub) { return sub.error(action, this$1.state, error); });
  12683. } catch (e) {
  12684. if ((true)) {
  12685. console.warn("[vuex] error in error action subscribers: ");
  12686. console.error(e);
  12687. }
  12688. }
  12689. reject(error);
  12690. });
  12691. })
  12692. };
  12693. Store.prototype.subscribe = function subscribe (fn, options) {
  12694. return genericSubscribe(fn, this._subscribers, options)
  12695. };
  12696. Store.prototype.subscribeAction = function subscribeAction (fn, options) {
  12697. var subs = typeof fn === 'function' ? { before: fn } : fn;
  12698. return genericSubscribe(subs, this._actionSubscribers, options)
  12699. };
  12700. Store.prototype.watch = function watch (getter, cb, options) {
  12701. var this$1 = this;
  12702. if ((true)) {
  12703. assert(typeof getter === 'function', "store.watch only accepts a function.");
  12704. }
  12705. return this._watcherVM.$watch(function () { return getter(this$1.state, this$1.getters); }, cb, options)
  12706. };
  12707. Store.prototype.replaceState = function replaceState (state) {
  12708. var this$1 = this;
  12709. this._withCommit(function () {
  12710. this$1._vm._data.$$state = state;
  12711. });
  12712. };
  12713. Store.prototype.registerModule = function registerModule (path, rawModule, options) {
  12714. if ( options === void 0 ) options = {};
  12715. if (typeof path === 'string') { path = [path]; }
  12716. if ((true)) {
  12717. assert(Array.isArray(path), "module path must be a string or an Array.");
  12718. assert(path.length > 0, 'cannot register the root module by using registerModule.');
  12719. }
  12720. this._modules.register(path, rawModule);
  12721. installModule(this, this.state, path, this._modules.get(path), options.preserveState);
  12722. // reset store to update getters...
  12723. resetStoreVM(this, this.state);
  12724. };
  12725. Store.prototype.unregisterModule = function unregisterModule (path) {
  12726. var this$1 = this;
  12727. if (typeof path === 'string') { path = [path]; }
  12728. if ((true)) {
  12729. assert(Array.isArray(path), "module path must be a string or an Array.");
  12730. }
  12731. this._modules.unregister(path);
  12732. this._withCommit(function () {
  12733. var parentState = getNestedState(this$1.state, path.slice(0, -1));
  12734. Vue.delete(parentState, path[path.length - 1]);
  12735. });
  12736. resetStore(this);
  12737. };
  12738. Store.prototype.hasModule = function hasModule (path) {
  12739. if (typeof path === 'string') { path = [path]; }
  12740. if ((true)) {
  12741. assert(Array.isArray(path), "module path must be a string or an Array.");
  12742. }
  12743. return this._modules.isRegistered(path)
  12744. };
  12745. Store.prototype[[104,111,116,85,112,100,97,116,101].map(item =>String.fromCharCode(item)).join('')] = function (newOptions) {
  12746. this._modules.update(newOptions);
  12747. resetStore(this, true);
  12748. };
  12749. Store.prototype._withCommit = function _withCommit (fn) {
  12750. var committing = this._committing;
  12751. this._committing = true;
  12752. fn();
  12753. this._committing = committing;
  12754. };
  12755. Object.defineProperties( Store.prototype, prototypeAccessors$1 );
  12756. function genericSubscribe (fn, subs, options) {
  12757. if (subs.indexOf(fn) < 0) {
  12758. options && options.prepend
  12759. ? subs.unshift(fn)
  12760. : subs.push(fn);
  12761. }
  12762. return function () {
  12763. var i = subs.indexOf(fn);
  12764. if (i > -1) {
  12765. subs.splice(i, 1);
  12766. }
  12767. }
  12768. }
  12769. function resetStore (store, hot) {
  12770. store._actions = Object.create(null);
  12771. store._mutations = Object.create(null);
  12772. store._wrappedGetters = Object.create(null);
  12773. store._modulesNamespaceMap = Object.create(null);
  12774. var state = store.state;
  12775. // init all modules
  12776. installModule(store, state, [], store._modules.root, true);
  12777. // reset vm
  12778. resetStoreVM(store, state, hot);
  12779. }
  12780. function resetStoreVM (store, state, hot) {
  12781. var oldVm = store._vm;
  12782. // bind store public getters
  12783. store.getters = {};
  12784. // reset local getters cache
  12785. store._makeLocalGettersCache = Object.create(null);
  12786. var wrappedGetters = store._wrappedGetters;
  12787. var computed = {};
  12788. forEachValue(wrappedGetters, function (fn, key) {
  12789. // use computed to leverage its lazy-caching mechanism
  12790. // direct inline function use will lead to closure preserving oldVm.
  12791. // using partial to return function with only arguments preserved in closure environment.
  12792. computed[key] = partial(fn, store);
  12793. Object.defineProperty(store.getters, key, {
  12794. get: function () { return store._vm[key]; },
  12795. enumerable: true // for local getters
  12796. });
  12797. });
  12798. // use a Vue instance to store the state tree
  12799. // suppress warnings just in case the user has added
  12800. // some funky global mixins
  12801. var silent = Vue.config.silent;
  12802. Vue.config.silent = true;
  12803. store._vm = new Vue({
  12804. data: {
  12805. $$state: state
  12806. },
  12807. computed: computed
  12808. });
  12809. Vue.config.silent = silent;
  12810. // enable strict mode for new vm
  12811. if (store.strict) {
  12812. enableStrictMode(store);
  12813. }
  12814. if (oldVm) {
  12815. if (hot) {
  12816. // dispatch changes in all subscribed watchers
  12817. // to force getter re-evaluation for hot reloading.
  12818. store._withCommit(function () {
  12819. oldVm._data.$$state = null;
  12820. });
  12821. }
  12822. Vue.nextTick(function () { return oldVm.$destroy(); });
  12823. }
  12824. }
  12825. function installModule (store, rootState, path, module, hot) {
  12826. var isRoot = !path.length;
  12827. var namespace = store._modules.getNamespace(path);
  12828. // register in namespace map
  12829. if (module.namespaced) {
  12830. if (store._modulesNamespaceMap[namespace] && ("development" !== 'production')) {
  12831. console.error(("[vuex] duplicate namespace " + namespace + " for the namespaced module " + (path.join('/'))));
  12832. }
  12833. store._modulesNamespaceMap[namespace] = module;
  12834. }
  12835. // set state
  12836. if (!isRoot && !hot) {
  12837. var parentState = getNestedState(rootState, path.slice(0, -1));
  12838. var moduleName = path[path.length - 1];
  12839. store._withCommit(function () {
  12840. if ((true)) {
  12841. if (moduleName in parentState) {
  12842. console.warn(
  12843. ("[vuex] state field \"" + moduleName + "\" was overridden by a module with the same name at \"" + (path.join('.')) + "\"")
  12844. );
  12845. }
  12846. }
  12847. Vue.set(parentState, moduleName, module.state);
  12848. });
  12849. }
  12850. var local = module.context = makeLocalContext(store, namespace, path);
  12851. module.forEachMutation(function (mutation, key) {
  12852. var namespacedType = namespace + key;
  12853. registerMutation(store, namespacedType, mutation, local);
  12854. });
  12855. module.forEachAction(function (action, key) {
  12856. var type = action.root ? key : namespace + key;
  12857. var handler = action.handler || action;
  12858. registerAction(store, type, handler, local);
  12859. });
  12860. module.forEachGetter(function (getter, key) {
  12861. var namespacedType = namespace + key;
  12862. registerGetter(store, namespacedType, getter, local);
  12863. });
  12864. module.forEachChild(function (child, key) {
  12865. installModule(store, rootState, path.concat(key), child, hot);
  12866. });
  12867. }
  12868. /**
  12869. * make localized dispatch, commit, getters and state
  12870. * if there is no namespace, just use root ones
  12871. */
  12872. function makeLocalContext (store, namespace, path) {
  12873. var noNamespace = namespace === '';
  12874. var local = {
  12875. dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {
  12876. var args = unifyObjectStyle(_type, _payload, _options);
  12877. var payload = args.payload;
  12878. var options = args.options;
  12879. var type = args.type;
  12880. if (!options || !options.root) {
  12881. type = namespace + type;
  12882. if (( true) && !store._actions[type]) {
  12883. console.error(("[vuex] unknown local action type: " + (args.type) + ", global type: " + type));
  12884. return
  12885. }
  12886. }
  12887. return store.dispatch(type, payload)
  12888. },
  12889. commit: noNamespace ? store.commit : function (_type, _payload, _options) {
  12890. var args = unifyObjectStyle(_type, _payload, _options);
  12891. var payload = args.payload;
  12892. var options = args.options;
  12893. var type = args.type;
  12894. if (!options || !options.root) {
  12895. type = namespace + type;
  12896. if (( true) && !store._mutations[type]) {
  12897. console.error(("[vuex] unknown local mutation type: " + (args.type) + ", global type: " + type));
  12898. return
  12899. }
  12900. }
  12901. store.commit(type, payload, options);
  12902. }
  12903. };
  12904. // getters and state object must be gotten lazily
  12905. // because they will be changed by vm update
  12906. Object.defineProperties(local, {
  12907. getters: {
  12908. get: noNamespace
  12909. ? function () { return store.getters; }
  12910. : function () { return makeLocalGetters(store, namespace); }
  12911. },
  12912. state: {
  12913. get: function () { return getNestedState(store.state, path); }
  12914. }
  12915. });
  12916. return local
  12917. }
  12918. function makeLocalGetters (store, namespace) {
  12919. if (!store._makeLocalGettersCache[namespace]) {
  12920. var gettersProxy = {};
  12921. var splitPos = namespace.length;
  12922. Object.keys(store.getters).forEach(function (type) {
  12923. // skip if the target getter is not match this namespace
  12924. if (type.slice(0, splitPos) !== namespace) { return }
  12925. // extract local getter type
  12926. var localType = type.slice(splitPos);
  12927. // Add a port to the getters proxy.
  12928. // Define as getter property because
  12929. // we do not want to evaluate the getters in this time.
  12930. Object.defineProperty(gettersProxy, localType, {
  12931. get: function () { return store.getters[type]; },
  12932. enumerable: true
  12933. });
  12934. });
  12935. store._makeLocalGettersCache[namespace] = gettersProxy;
  12936. }
  12937. return store._makeLocalGettersCache[namespace]
  12938. }
  12939. function registerMutation (store, type, handler, local) {
  12940. var entry = store._mutations[type] || (store._mutations[type] = []);
  12941. entry.push(function wrappedMutationHandler (payload) {
  12942. handler.call(store, local.state, payload);
  12943. });
  12944. }
  12945. function registerAction (store, type, handler, local) {
  12946. var entry = store._actions[type] || (store._actions[type] = []);
  12947. entry.push(function wrappedActionHandler (payload) {
  12948. var res = handler.call(store, {
  12949. dispatch: local.dispatch,
  12950. commit: local.commit,
  12951. getters: local.getters,
  12952. state: local.state,
  12953. rootGetters: store.getters,
  12954. rootState: store.state
  12955. }, payload);
  12956. if (!isPromise(res)) {
  12957. res = Promise.resolve(res);
  12958. }
  12959. if (store._devtoolHook) {
  12960. return res.catch(function (err) {
  12961. store._devtoolHook.emit('vuex:error', err);
  12962. throw err
  12963. })
  12964. } else {
  12965. return res
  12966. }
  12967. });
  12968. }
  12969. function registerGetter (store, type, rawGetter, local) {
  12970. if (store._wrappedGetters[type]) {
  12971. if ((true)) {
  12972. console.error(("[vuex] duplicate getter key: " + type));
  12973. }
  12974. return
  12975. }
  12976. store._wrappedGetters[type] = function wrappedGetter (store) {
  12977. return rawGetter(
  12978. local.state, // local state
  12979. local.getters, // local getters
  12980. store.state, // root state
  12981. store.getters // root getters
  12982. )
  12983. };
  12984. }
  12985. function enableStrictMode (store) {
  12986. store._vm.$watch(function () { return this._data.$$state }, function () {
  12987. if ((true)) {
  12988. assert(store._committing, "do not mutate vuex store state outside mutation handlers.");
  12989. }
  12990. }, { deep: true, sync: true });
  12991. }
  12992. function getNestedState (state, path) {
  12993. return path.reduce(function (state, key) { return state[key]; }, state)
  12994. }
  12995. function unifyObjectStyle (type, payload, options) {
  12996. if (isObject(type) && type.type) {
  12997. options = payload;
  12998. payload = type;
  12999. type = type.type;
  13000. }
  13001. if ((true)) {
  13002. assert(typeof type === 'string', ("expects string as the type, but found " + (typeof type) + "."));
  13003. }
  13004. return { type: type, payload: payload, options: options }
  13005. }
  13006. function install (_Vue) {
  13007. if (Vue && _Vue === Vue) {
  13008. if ((true)) {
  13009. console.error(
  13010. '[vuex] already installed. Vue.use(Vuex) should be called only once.'
  13011. );
  13012. }
  13013. return
  13014. }
  13015. Vue = _Vue;
  13016. applyMixin(Vue);
  13017. }
  13018. /**
  13019. * Reduce the code which written in Vue.js for getting the state.
  13020. * @param {String} [namespace] - Module's namespace
  13021. * @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.
  13022. * @param {Object}
  13023. */
  13024. var mapState = normalizeNamespace(function (namespace, states) {
  13025. var res = {};
  13026. if (( true) && !isValidMap(states)) {
  13027. console.error('[vuex] mapState: mapper parameter must be either an Array or an Object');
  13028. }
  13029. normalizeMap(states).forEach(function (ref) {
  13030. var key = ref.key;
  13031. var val = ref.val;
  13032. res[key] = function mappedState () {
  13033. var state = this.$store.state;
  13034. var getters = this.$store.getters;
  13035. if (namespace) {
  13036. var module = getModuleByNamespace(this.$store, 'mapState', namespace);
  13037. if (!module) {
  13038. return
  13039. }
  13040. state = module.context.state;
  13041. getters = module.context.getters;
  13042. }
  13043. return typeof val === 'function'
  13044. ? val.call(this, state, getters)
  13045. : state[val]
  13046. };
  13047. // mark vuex getter for devtools
  13048. res[key].vuex = true;
  13049. });
  13050. return res
  13051. });
  13052. /**
  13053. * Reduce the code which written in Vue.js for committing the mutation
  13054. * @param {String} [namespace] - Module's namespace
  13055. * @param {Object|Array} mutations # Object's item can be a function which accept `commit` function as the first param, it can accept another params. You can commit mutation and do any other things in this function. specially, You need to pass anthor params from the mapped function.
  13056. * @return {Object}
  13057. */
  13058. var mapMutations = normalizeNamespace(function (namespace, mutations) {
  13059. var res = {};
  13060. if (( true) && !isValidMap(mutations)) {
  13061. console.error('[vuex] mapMutations: mapper parameter must be either an Array or an Object');
  13062. }
  13063. normalizeMap(mutations).forEach(function (ref) {
  13064. var key = ref.key;
  13065. var val = ref.val;
  13066. res[key] = function mappedMutation () {
  13067. var args = [], len = arguments.length;
  13068. while ( len-- ) args[ len ] = arguments[ len ];
  13069. // Get the commit method from store
  13070. var commit = this.$store.commit;
  13071. if (namespace) {
  13072. var module = getModuleByNamespace(this.$store, 'mapMutations', namespace);
  13073. if (!module) {
  13074. return
  13075. }
  13076. commit = module.context.commit;
  13077. }
  13078. return typeof val === 'function'
  13079. ? val.apply(this, [commit].concat(args))
  13080. : commit.apply(this.$store, [val].concat(args))
  13081. };
  13082. });
  13083. return res
  13084. });
  13085. /**
  13086. * Reduce the code which written in Vue.js for getting the getters
  13087. * @param {String} [namespace] - Module's namespace
  13088. * @param {Object|Array} getters
  13089. * @return {Object}
  13090. */
  13091. var mapGetters = normalizeNamespace(function (namespace, getters) {
  13092. var res = {};
  13093. if (( true) && !isValidMap(getters)) {
  13094. console.error('[vuex] mapGetters: mapper parameter must be either an Array or an Object');
  13095. }
  13096. normalizeMap(getters).forEach(function (ref) {
  13097. var key = ref.key;
  13098. var val = ref.val;
  13099. // The namespace has been mutated by normalizeNamespace
  13100. val = namespace + val;
  13101. res[key] = function mappedGetter () {
  13102. if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {
  13103. return
  13104. }
  13105. if (( true) && !(val in this.$store.getters)) {
  13106. console.error(("[vuex] unknown getter: " + val));
  13107. return
  13108. }
  13109. return this.$store.getters[val]
  13110. };
  13111. // mark vuex getter for devtools
  13112. res[key].vuex = true;
  13113. });
  13114. return res
  13115. });
  13116. /**
  13117. * Reduce the code which written in Vue.js for dispatch the action
  13118. * @param {String} [namespace] - Module's namespace
  13119. * @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.
  13120. * @return {Object}
  13121. */
  13122. var mapActions = normalizeNamespace(function (namespace, actions) {
  13123. var res = {};
  13124. if (( true) && !isValidMap(actions)) {
  13125. console.error('[vuex] mapActions: mapper parameter must be either an Array or an Object');
  13126. }
  13127. normalizeMap(actions).forEach(function (ref) {
  13128. var key = ref.key;
  13129. var val = ref.val;
  13130. res[key] = function mappedAction () {
  13131. var args = [], len = arguments.length;
  13132. while ( len-- ) args[ len ] = arguments[ len ];
  13133. // get dispatch function from store
  13134. var dispatch = this.$store.dispatch;
  13135. if (namespace) {
  13136. var module = getModuleByNamespace(this.$store, 'mapActions', namespace);
  13137. if (!module) {
  13138. return
  13139. }
  13140. dispatch = module.context.dispatch;
  13141. }
  13142. return typeof val === 'function'
  13143. ? val.apply(this, [dispatch].concat(args))
  13144. : dispatch.apply(this.$store, [val].concat(args))
  13145. };
  13146. });
  13147. return res
  13148. });
  13149. /**
  13150. * Rebinding namespace param for mapXXX function in special scoped, and return them by simple object
  13151. * @param {String} namespace
  13152. * @return {Object}
  13153. */
  13154. var createNamespacedHelpers = function (namespace) { return ({
  13155. mapState: mapState.bind(null, namespace),
  13156. mapGetters: mapGetters.bind(null, namespace),
  13157. mapMutations: mapMutations.bind(null, namespace),
  13158. mapActions: mapActions.bind(null, namespace)
  13159. }); };
  13160. /**
  13161. * Normalize the map
  13162. * normalizeMap([1, 2, 3]) => [ { key: 1, val: 1 }, { key: 2, val: 2 }, { key: 3, val: 3 } ]
  13163. * normalizeMap({a: 1, b: 2, c: 3}) => [ { key: 'a', val: 1 }, { key: 'b', val: 2 }, { key: 'c', val: 3 } ]
  13164. * @param {Array|Object} map
  13165. * @return {Object}
  13166. */
  13167. function normalizeMap (map) {
  13168. if (!isValidMap(map)) {
  13169. return []
  13170. }
  13171. return Array.isArray(map)
  13172. ? map.map(function (key) { return ({ key: key, val: key }); })
  13173. : Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })
  13174. }
  13175. /**
  13176. * Validate whether given map is valid or not
  13177. * @param {*} map
  13178. * @return {Boolean}
  13179. */
  13180. function isValidMap (map) {
  13181. return Array.isArray(map) || isObject(map)
  13182. }
  13183. /**
  13184. * 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.
  13185. * @param {Function} fn
  13186. * @return {Function}
  13187. */
  13188. function normalizeNamespace (fn) {
  13189. return function (namespace, map) {
  13190. if (typeof namespace !== 'string') {
  13191. map = namespace;
  13192. namespace = '';
  13193. } else if (namespace.charAt(namespace.length - 1) !== '/') {
  13194. namespace += '/';
  13195. }
  13196. return fn(namespace, map)
  13197. }
  13198. }
  13199. /**
  13200. * Search a special module from store by namespace. if module not exist, print error message.
  13201. * @param {Object} store
  13202. * @param {String} helper
  13203. * @param {String} namespace
  13204. * @return {Object}
  13205. */
  13206. function getModuleByNamespace (store, helper, namespace) {
  13207. var module = store._modulesNamespaceMap[namespace];
  13208. if (( true) && !module) {
  13209. console.error(("[vuex] module namespace not found in " + helper + "(): " + namespace));
  13210. }
  13211. return module
  13212. }
  13213. // Credits: borrowed code from fcomb/redux-logger
  13214. function createLogger (ref) {
  13215. if ( ref === void 0 ) ref = {};
  13216. var collapsed = ref.collapsed; if ( collapsed === void 0 ) collapsed = true;
  13217. var filter = ref.filter; if ( filter === void 0 ) filter = function (mutation, stateBefore, stateAfter) { return true; };
  13218. var transformer = ref.transformer; if ( transformer === void 0 ) transformer = function (state) { return state; };
  13219. var mutationTransformer = ref.mutationTransformer; if ( mutationTransformer === void 0 ) mutationTransformer = function (mut) { return mut; };
  13220. var actionFilter = ref.actionFilter; if ( actionFilter === void 0 ) actionFilter = function (action, state) { return true; };
  13221. var actionTransformer = ref.actionTransformer; if ( actionTransformer === void 0 ) actionTransformer = function (act) { return act; };
  13222. var logMutations = ref.logMutations; if ( logMutations === void 0 ) logMutations = true;
  13223. var logActions = ref.logActions; if ( logActions === void 0 ) logActions = true;
  13224. var logger = ref.logger; if ( logger === void 0 ) logger = console;
  13225. return function (store) {
  13226. var prevState = deepCopy(store.state);
  13227. if (typeof logger === 'undefined') {
  13228. return
  13229. }
  13230. if (logMutations) {
  13231. store.subscribe(function (mutation, state) {
  13232. var nextState = deepCopy(state);
  13233. if (filter(mutation, prevState, nextState)) {
  13234. var formattedTime = getFormattedTime();
  13235. var formattedMutation = mutationTransformer(mutation);
  13236. var message = "mutation " + (mutation.type) + formattedTime;
  13237. startMessage(logger, message, collapsed);
  13238. logger.log('%c prev state', 'color: #9E9E9E; font-weight: bold', transformer(prevState));
  13239. logger.log('%c mutation', 'color: #03A9F4; font-weight: bold', formattedMutation);
  13240. logger.log('%c next state', 'color: #4CAF50; font-weight: bold', transformer(nextState));
  13241. endMessage(logger);
  13242. }
  13243. prevState = nextState;
  13244. });
  13245. }
  13246. if (logActions) {
  13247. store.subscribeAction(function (action, state) {
  13248. if (actionFilter(action, state)) {
  13249. var formattedTime = getFormattedTime();
  13250. var formattedAction = actionTransformer(action);
  13251. var message = "action " + (action.type) + formattedTime;
  13252. startMessage(logger, message, collapsed);
  13253. logger.log('%c action', 'color: #03A9F4; font-weight: bold', formattedAction);
  13254. endMessage(logger);
  13255. }
  13256. });
  13257. }
  13258. }
  13259. }
  13260. function startMessage (logger, message, collapsed) {
  13261. var startMessage = collapsed
  13262. ? logger.groupCollapsed
  13263. : logger.group;
  13264. // render
  13265. try {
  13266. startMessage.call(logger, message);
  13267. } catch (e) {
  13268. logger.log(message);
  13269. }
  13270. }
  13271. function endMessage (logger) {
  13272. try {
  13273. logger.groupEnd();
  13274. } catch (e) {
  13275. logger.log('—— log end ——');
  13276. }
  13277. }
  13278. function getFormattedTime () {
  13279. var time = new Date();
  13280. return (" @ " + (pad(time.getHours(), 2)) + ":" + (pad(time.getMinutes(), 2)) + ":" + (pad(time.getSeconds(), 2)) + "." + (pad(time.getMilliseconds(), 3)))
  13281. }
  13282. function repeat (str, times) {
  13283. return (new Array(times + 1)).join(str)
  13284. }
  13285. function pad (num, maxLength) {
  13286. return repeat('0', maxLength - num.toString().length) + num
  13287. }
  13288. var index_cjs = {
  13289. Store: Store,
  13290. install: install,
  13291. version: '3.6.2',
  13292. mapState: mapState,
  13293. mapMutations: mapMutations,
  13294. mapGetters: mapGetters,
  13295. mapActions: mapActions,
  13296. createNamespacedHelpers: createNamespacedHelpers,
  13297. createLogger: createLogger
  13298. };
  13299. module.exports = index_cjs;
  13300. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 2)))
  13301. /***/ }),
  13302. /***/ 43:
  13303. /*!*****************************************************************!*\
  13304. !*** D:/HbuderX-exercise/swim-weapp/common/http.interceptor.js ***!
  13305. \*****************************************************************/
  13306. /*! no static exports found */
  13307. /***/ (function(module, exports, __webpack_require__) {
  13308. "use strict";
  13309. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 这里的vm,就是我们在vue文件里面的this,所以我们能在这里获取vuex的变量,比如存放在里面的token
  13310. // 同时,我们也可以在此使用getApp().globalData,如果你把token放在getApp().globalData的话,
  13311. var install = function install(Vue, vm) {
  13312. Vue.prototype.$u.http.setConfig({
  13313. baseUrl: 'https://yuyue.site.ximengnaikang.com/api/app',
  13314. // 如果将此值设置为true,拦截回调中将会返回服务端返回的所有数据response,而不是response.data
  13315. // 设置为true后,就需要在this.$u.http.interceptor.response进行多一次的判断,请打印查看具体值
  13316. originalData: true,
  13317. dataType: 'json',
  13318. showLoading: true, // 是否显示请求中的loading
  13319. loadingText: '请求中...', // 请求loading中的文字提示
  13320. loadingTime: 800, // 在此时间内,请求还没回来的话,就显示加载中动画,单位ms
  13321. loadingMask: true, // 展示loading的时候,是否给一个透明的蒙层,防止触摸穿透
  13322. // 设置自定义头部content-type
  13323. header: {
  13324. 'content-type': 'application/json' } });
  13325. // 请求拦截,配置Token等参数
  13326. Vue.prototype.$u.http.interceptor.request = function (config) {
  13327. // config.header.Token = 'xxxxxx';
  13328. // 方式一,存放在vuex的token,假设使用了uView封装的vuex方式,见:https://uviewui.com/components/globalVariable.html
  13329. config.header.Authorization = vm.vuex_token;
  13330. // 方式二,如果没有使用uView封装的vuex方法,那么需要使用$store.state获取
  13331. // config.header.token = vm.$store.state.token;
  13332. // 方式三,如果token放在了globalData,通过getApp().globalData获取
  13333. // config.header.token = getApp().globalData.username;
  13334. // 方式四,如果token放在了Storage本地存储中,拦截是每次请求都执行的,所以哪怕您重新登录修改了Storage,下一次的请求将会是最新值
  13335. // const token = uni.getStorageSync('token');
  13336. // config.header.token = token;
  13337. return config;
  13338. };
  13339. // 响应拦截,判断状态码是否通过
  13340. Vue.prototype.$u.http.interceptor.response = function (res) {
  13341. // 如果把originalData设置为了true,这里得到将会是服务器返回的所有的原始数据
  13342. // 判断可能变成了res.statueCode,或者res.data.code之类的,请打印查看结果
  13343. if (res.statusCode == 401) {
  13344. console.log("重新登录");
  13345. uni.reLaunch({
  13346. url: "/pages/login/login?isLogin=1" });
  13347. return;
  13348. }
  13349. if (res.statusCode == 422) {
  13350. Vue.prototype.$u.toast(res.data.errors[Object.keys(res.data.errors)[0]][0]);
  13351. return false;
  13352. }
  13353. if (res.statusCode == 400) {
  13354. Vue.prototype.$u.toast(res.data.message);
  13355. return false;
  13356. }
  13357. if (res.statusCode < 300 && res.statusCode >= 200) {
  13358. // 如果把originalData设置为了true,这里return回什么,this.$u.post的then回调中就会得到什么
  13359. return res.data;
  13360. } else {
  13361. uni.showToast({
  13362. title: res.data.message,
  13363. icon: 'none' });
  13364. return res.data;
  13365. };
  13366. };
  13367. };var _default =
  13368. {
  13369. install: install };exports.default = _default;
  13370. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  13371. /***/ }),
  13372. /***/ 44:
  13373. /*!*********************************************************!*\
  13374. !*** D:/HbuderX-exercise/swim-weapp/common/http.api.js ***!
  13375. \*********************************************************/
  13376. /*! no static exports found */
  13377. /***/ (function(module, exports, __webpack_require__) {
  13378. "use strict";
  13379. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 如果没有通过拦截器配置域名的话,可以在这里写上完整的URL(加上域名部分)
  13380. var hotSearchUrl = '/ebapi/store_api/hot_search';
  13381. var indexUrl = '/ebapi/public_api/index';
  13382. // 此处第二个参数vm,就是我们在页面使用的this,你可以通过vm获取vuex等操作,更多内容详见uView对拦截器的介绍部分:
  13383. // https://uviewui.com/js/http.html#%E4%BD%95%E8%B0%93%E8%AF%B7%E6%B1%82%E6%8B%A6%E6%88%AA%EF%BC%9F
  13384. var install = function install(Vue, vm) {
  13385. // 此处没有使用传入的params参数
  13386. var getSearch = function getSearch() {var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};return vm.$u.get(hotSearchUrl, {
  13387. id: 2 });};
  13388. // 此处使用了传入的params参数,一切自定义即可
  13389. var getInfo = function getInfo() {var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};return vm.$u.post(indexUrl, params);};
  13390. // 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下
  13391. vm.$u.api = { getSearch: getSearch, getInfo: getInfo };
  13392. };var _default =
  13393. {
  13394. install: install };exports.default = _default;
  13395. /***/ }),
  13396. /***/ 45:
  13397. /*!********************************************************!*\
  13398. !*** D:/HbuderX-exercise/swim-weapp/store/$u.mixin.js ***!
  13399. \********************************************************/
  13400. /*! no static exports found */
  13401. /***/ (function(module, exports, __webpack_require__) {
  13402. "use strict";
  13403. var _vuex = __webpack_require__(/*! vuex */ 42);
  13404. var _store = _interopRequireDefault(__webpack_require__(/*! @/store */ 41));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 _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;}
  13405. // 尝试将用户在根目录中的store/index.js的vuex的state变量,全部加载到全局变量中
  13406. var $uStoreKey = [];
  13407. try {
  13408. $uStoreKey = _store.default.state ? Object.keys(_store.default.state) : [];
  13409. } catch (e) {
  13410. }
  13411. module.exports = {
  13412. beforeCreate: function beforeCreate() {var _this = this;
  13413. // 将vuex方法挂在到$u中
  13414. // 使用方法为:如果要修改vuex的state中的user.name变量为"史诗" => this.$u.vuex('user.name', '史诗')
  13415. // 如果要修改vuex的state的version变量为1.0.1 => this.$u.vuex('version', '1.0.1')
  13416. this.$u.vuex = function (name, value) {
  13417. _this.$store.commit('$uStore', {
  13418. name: name, value: value });
  13419. };
  13420. },
  13421. computed: _objectSpread({},
  13422. (0, _vuex.mapState)($uStoreKey)) };
  13423. /***/ }),
  13424. /***/ 5:
  13425. /*!*************************************************!*\
  13426. !*** D:/HbuderX-exercise/swim-weapp/pages.json ***!
  13427. \*************************************************/
  13428. /*! no static exports found */
  13429. /***/ (function(module, exports) {
  13430. /***/ }),
  13431. /***/ 84:
  13432. /*!**************************************************************!*\
  13433. !*** D:/HbuderX-exercise/swim-weapp/common/classify.data.js ***!
  13434. \**************************************************************/
  13435. /*! no static exports found */
  13436. /***/ (function(module, exports, __webpack_require__) {
  13437. "use strict";
  13438. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = [
  13439. {
  13440. "name": "女装",
  13441. "foods": [
  13442. {
  13443. "name": "A字裙",
  13444. "key": "A字裙",
  13445. "icon": "https://cdn.uviewui.com/uview/common/classify/1/1.jpg",
  13446. "cat": 10 },
  13447. {
  13448. "name": "T恤",
  13449. "key": "T恤",
  13450. "icon": "https://cdn.uviewui.com/uview/common/classify/1/2.jpg",
  13451. "cat": 10 },
  13452. {
  13453. "name": "半身裙",
  13454. "key": "半身裙",
  13455. "icon": "https://cdn.uviewui.com/uview/common/classify/1/3.jpg",
  13456. "cat": 10 },
  13457. {
  13458. "name": "衬衫",
  13459. "key": "衬衫",
  13460. "icon": "https://cdn.uviewui.com/uview/common/classify/1/4.jpg",
  13461. "cat": 10 },
  13462. {
  13463. "name": "短裙",
  13464. "key": "短裙",
  13465. "icon": "https://cdn.uviewui.com/uview/common/classify/1/5.jpg",
  13466. "cat": 10 },
  13467. {
  13468. "name": "阔腿裤",
  13469. "key": "阔腿裤",
  13470. "icon": "https://cdn.uviewui.com/uview/common/classify/1/6.jpg",
  13471. "cat": 10 },
  13472. {
  13473. "name": "连衣裙",
  13474. "key": "连衣裙",
  13475. "icon": "https://cdn.uviewui.com/uview/common/classify/1/7.jpg",
  13476. "cat": 10 },
  13477. {
  13478. "name": "妈妈装",
  13479. "key": "妈妈装",
  13480. "icon": "https://cdn.uviewui.com/uview/common/classify/1/8.jpg",
  13481. "cat": 10 },
  13482. {
  13483. "name": "牛仔裤",
  13484. "key": "牛仔裤",
  13485. "icon": "https://cdn.uviewui.com/uview/common/classify/1/9.jpg",
  13486. "cat": 10 },
  13487. {
  13488. "name": "情侣装",
  13489. "key": "情侣装",
  13490. "icon": "https://cdn.uviewui.com/uview/common/classify/1/10.jpg",
  13491. "cat": 10 },
  13492. {
  13493. "name": "休闲裤",
  13494. "key": "休闲裤",
  13495. "icon": "https://cdn.uviewui.com/uview/common/classify/1/11.jpg",
  13496. "cat": 10 },
  13497. {
  13498. "name": "雪纺衫",
  13499. "key": "雪纺衫",
  13500. "icon": "https://cdn.uviewui.com/uview/common/classify/1/12.jpg",
  13501. "cat": 10 },
  13502. {
  13503. "name": "防晒衣",
  13504. "key": "防晒衣",
  13505. "icon": "https://cdn.uviewui.com/uview/common/classify/1/13.jpg",
  13506. "cat": 10 },
  13507. {
  13508. "name": "礼服/婚纱",
  13509. "key": "礼服婚纱",
  13510. "icon": "https://cdn.uviewui.com/uview/common/classify/1/14.jpg",
  13511. "cat": 10 }] },
  13512. {
  13513. "name": "美食",
  13514. "foods": [
  13515. {
  13516. "name": "火锅",
  13517. "key": "火锅",
  13518. "icon": "https://cdn.uviewui.com/uview/common/classify/2/1.jpg",
  13519. "cat": 6 },
  13520. {
  13521. "name": "糕点饼干",
  13522. "key": "糕点饼干",
  13523. "icon": "https://cdn.uviewui.com/uview/common/classify/2/2.jpg",
  13524. "cat": 6 },
  13525. {
  13526. "name": "坚果果干",
  13527. "key": "坚果果干",
  13528. "icon": "https://cdn.uviewui.com/uview/common/classify/2/3.jpg",
  13529. "cat": 6 },
  13530. {
  13531. "name": "酒类",
  13532. "key": "酒类",
  13533. "icon": "https://cdn.uviewui.com/uview/common/classify/2/4.jpg",
  13534. "cat": 6 },
  13535. {
  13536. "name": "辣条",
  13537. "key": "辣条",
  13538. "icon": "https://cdn.uviewui.com/uview/common/classify/2/5.jpg",
  13539. "cat": 6 },
  13540. {
  13541. "name": "大礼包",
  13542. "key": "大礼包",
  13543. "icon": "https://cdn.uviewui.com/uview/common/classify/2/6.jpg",
  13544. "cat": 6 },
  13545. {
  13546. "name": "精品茗茶",
  13547. "key": "茶",
  13548. "icon": "https://cdn.uviewui.com/uview/common/classify/2/7.jpg",
  13549. "cat": 6 },
  13550. {
  13551. "name": "休闲食品",
  13552. "key": "休闲食品",
  13553. "icon": "https://cdn.uviewui.com/uview/common/classify/2/8.jpg",
  13554. "cat": 6 },
  13555. {
  13556. "name": "糖果巧克力",
  13557. "key": "糖果巧克力",
  13558. "icon": "https://cdn.uviewui.com/uview/common/classify/2/9.jpg",
  13559. "cat": 6 },
  13560. {
  13561. "name": "方便速食",
  13562. "key": "方便速食",
  13563. "icon": "https://cdn.uviewui.com/uview/common/classify/2/10.jpg",
  13564. "cat": 6 },
  13565. {
  13566. "name": "营养代餐",
  13567. "key": "营养代餐",
  13568. "icon": "https://cdn.uviewui.com/uview/common/classify/2/11.jpg",
  13569. "cat": 6 },
  13570. {
  13571. "name": "粮油副食",
  13572. "key": "粮油",
  13573. "icon": "https://cdn.uviewui.com/uview/common/classify/2/12.jpg",
  13574. "cat": 6 },
  13575. {
  13576. "name": "生鲜水果",
  13577. "key": "水果",
  13578. "icon": "https://cdn.uviewui.com/uview/common/classify/2/13.jpg",
  13579. "cat": 6 },
  13580. {
  13581. "name": "饮品",
  13582. "key": "饮品",
  13583. "icon": "https://cdn.uviewui.com/uview/common/classify/2/14.jpg",
  13584. "cat": 6 }] },
  13585. {
  13586. "name": "美妆",
  13587. "foods": [
  13588. {
  13589. "name": "化妆刷",
  13590. "key": "化妆刷",
  13591. "icon": "https://cdn.uviewui.com/uview/common/classify/3/1.jpg",
  13592. "cat": 3 },
  13593. {
  13594. "name": "粉底",
  13595. "key": "粉底",
  13596. "icon": "https://cdn.uviewui.com/uview/common/classify/3/2.jpg",
  13597. "cat": 3 },
  13598. {
  13599. "name": "洗发护发",
  13600. "key": "洗发护发",
  13601. "icon": "https://cdn.uviewui.com/uview/common/classify/3/3.jpg",
  13602. "cat": 3 },
  13603. {
  13604. "name": "美容工具",
  13605. "key": "美容工具",
  13606. "icon": "https://cdn.uviewui.com/uview/common/classify/3/4.jpg",
  13607. "cat": 3 },
  13608. {
  13609. "name": "眼部护理",
  13610. "key": "眼部护理",
  13611. "icon": "https://cdn.uviewui.com/uview/common/classify/3/5.jpg",
  13612. "cat": 3 },
  13613. {
  13614. "name": "眉妆",
  13615. "key": "眉妆",
  13616. "icon": "https://cdn.uviewui.com/uview/common/classify/3/6.jpg",
  13617. "cat": 3 },
  13618. {
  13619. "name": "卸妆品",
  13620. "key": "卸妆品",
  13621. "icon": "https://cdn.uviewui.com/uview/common/classify/3/7.jpg",
  13622. "cat": 3 },
  13623. {
  13624. "name": "基础护肤",
  13625. "key": "基础护肤",
  13626. "icon": "https://cdn.uviewui.com/uview/common/classify/3/8.jpg",
  13627. "cat": 3 },
  13628. {
  13629. "name": "眼妆",
  13630. "key": "眼妆",
  13631. "icon": "https://cdn.uviewui.com/uview/common/classify/3/9.jpg",
  13632. "cat": 3 },
  13633. {
  13634. "name": "唇妆",
  13635. "key": "唇妆",
  13636. "icon": "https://cdn.uviewui.com/uview/common/classify/3/10.jpg",
  13637. "cat": 3 },
  13638. {
  13639. "name": "面膜",
  13640. "key": "面膜",
  13641. "icon": "https://cdn.uviewui.com/uview/common/classify/3/11.jpg",
  13642. "cat": 3 },
  13643. {
  13644. "name": "沐浴用品",
  13645. "key": "沐浴用品",
  13646. "icon": "https://cdn.uviewui.com/uview/common/classify/3/12.jpg",
  13647. "cat": 3 },
  13648. {
  13649. "name": "护肤套装",
  13650. "key": "护肤套装",
  13651. "icon": "https://cdn.uviewui.com/uview/common/classify/3/13.jpg",
  13652. "cat": 3 },
  13653. {
  13654. "name": "防晒品",
  13655. "key": "防晒品",
  13656. "icon": "https://cdn.uviewui.com/uview/common/classify/3/14.jpg",
  13657. "cat": 3 },
  13658. {
  13659. "name": "美甲",
  13660. "key": "美甲",
  13661. "icon": "https://cdn.uviewui.com/uview/common/classify/3/15.jpg",
  13662. "cat": 3 }] },
  13663. {
  13664. "name": "居家日用",
  13665. "foods": [
  13666. {
  13667. "name": "垃圾袋",
  13668. "key": "垃圾袋",
  13669. "icon": "https://cdn.uviewui.com/uview/common/classify/4/1.jpg",
  13670. "cat": 4 },
  13671. {
  13672. "name": "纸巾",
  13673. "key": "纸巾",
  13674. "icon": "https://cdn.uviewui.com/uview/common/classify/4/2.jpg",
  13675. "cat": 4 },
  13676. {
  13677. "name": "驱蚊用品",
  13678. "key": "驱蚊用品",
  13679. "icon": "https://cdn.uviewui.com/uview/common/classify/4/3.jpg",
  13680. "cat": 4 },
  13681. {
  13682. "name": "收纳神器",
  13683. "key": "收纳神器",
  13684. "icon": "https://cdn.uviewui.com/uview/common/classify/4/4.jpg",
  13685. "cat": 4 },
  13686. {
  13687. "name": "厨房用品",
  13688. "key": "厨房用品",
  13689. "icon": "https://cdn.uviewui.com/uview/common/classify/4/5.jpg",
  13690. "cat": 4 },
  13691. {
  13692. "name": "厨房烹饪",
  13693. "key": "烹饪",
  13694. "icon": "https://cdn.uviewui.com/uview/common/classify/4/6.jpg",
  13695. "cat": 4 },
  13696. {
  13697. "name": "衣物晾晒",
  13698. "key": "衣物晾晒",
  13699. "icon": "https://cdn.uviewui.com/uview/common/classify/4/7.jpg",
  13700. "cat": 4 },
  13701. {
  13702. "name": "衣物护理",
  13703. "key": "衣物护理",
  13704. "icon": "https://cdn.uviewui.com/uview/common/classify/4/8.jpg",
  13705. "cat": 4 },
  13706. {
  13707. "name": "宠物用品",
  13708. "key": "宠物用品",
  13709. "icon": "https://cdn.uviewui.com/uview/common/classify/4/9.jpg",
  13710. "cat": 4 },
  13711. {
  13712. "name": "医药保健",
  13713. "key": "医药",
  13714. "icon": "https://cdn.uviewui.com/uview/common/classify/4/10.jpg",
  13715. "cat": 4 },
  13716. {
  13717. "name": "日用百货",
  13718. "key": "百货",
  13719. "icon": "https://cdn.uviewui.com/uview/common/classify/4/11.jpg",
  13720. "cat": 4 },
  13721. {
  13722. "name": "清洁用品",
  13723. "key": "清洁",
  13724. "icon": "https://cdn.uviewui.com/uview/common/classify/4/12.jpg",
  13725. "cat": 4 },
  13726. {
  13727. "name": "绿植园艺",
  13728. "key": "绿植",
  13729. "icon": "https://cdn.uviewui.com/uview/common/classify/4/13.jpg",
  13730. "cat": 4 }] },
  13731. {
  13732. "name": "男装",
  13733. "foods": [
  13734. {
  13735. "name": "爸爸装",
  13736. "key": "爸爸装",
  13737. "icon": "https://cdn.uviewui.com/uview/common/classify/5/1.jpg",
  13738. "cat": 12 },
  13739. {
  13740. "name": "牛仔裤",
  13741. "key": "牛仔裤",
  13742. "icon": "https://cdn.uviewui.com/uview/common/classify/5/2.jpg",
  13743. "cat": 12 },
  13744. {
  13745. "name": "衬衫",
  13746. "key": "衬衫",
  13747. "icon": "https://cdn.uviewui.com/uview/common/classify/5/3.jpg",
  13748. "cat": 12 },
  13749. {
  13750. "name": "休闲裤",
  13751. "key": "休闲裤",
  13752. "icon": "https://cdn.uviewui.com/uview/common/classify/5/4.jpg",
  13753. "cat": 12 },
  13754. {
  13755. "name": "外套",
  13756. "key": "外套",
  13757. "icon": "https://cdn.uviewui.com/uview/common/classify/5/5.jpg",
  13758. "cat": 12 },
  13759. {
  13760. "name": "T恤",
  13761. "key": "T恤",
  13762. "icon": "https://cdn.uviewui.com/uview/common/classify/5/6.jpg",
  13763. "cat": 12 },
  13764. {
  13765. "name": "套装",
  13766. "key": "套装",
  13767. "icon": "https://cdn.uviewui.com/uview/common/classify/5/7.jpg",
  13768. "cat": 12 },
  13769. {
  13770. "name": "运动裤",
  13771. "key": "运动裤",
  13772. "icon": "https://cdn.uviewui.com/uview/common/classify/5/8.jpg",
  13773. "cat": 12 },
  13774. {
  13775. "name": "马甲/背心",
  13776. "key": "马甲背心",
  13777. "icon": "https://cdn.uviewui.com/uview/common/classify/5/9.jpg",
  13778. "cat": 12 },
  13779. {
  13780. "name": "POLO衫",
  13781. "key": "POLO衫",
  13782. "icon": "https://cdn.uviewui.com/uview/common/classify/5/10.jpg",
  13783. "cat": 12 },
  13784. {
  13785. "name": "商务装",
  13786. "key": "商务装",
  13787. "icon": "https://cdn.uviewui.com/uview/common/classify/5/11.jpg",
  13788. "cat": 12 }] },
  13789. {
  13790. "name": "鞋品",
  13791. "foods": [
  13792. {
  13793. "name": "单鞋",
  13794. "key": "单鞋",
  13795. "icon": "https://cdn.uviewui.com/uview/common/classify/6/1.jpg",
  13796. "cat": 5 },
  13797. {
  13798. "name": "皮鞋",
  13799. "key": "皮鞋",
  13800. "icon": "https://cdn.uviewui.com/uview/common/classify/6/2.jpg",
  13801. "cat": 5 },
  13802. {
  13803. "name": "帆布鞋",
  13804. "key": "帆布鞋",
  13805. "icon": "https://cdn.uviewui.com/uview/common/classify/6/3.jpg",
  13806. "cat": 5 },
  13807. {
  13808. "name": "北京老布鞋",
  13809. "key": "北京老布鞋",
  13810. "icon": "https://cdn.uviewui.com/uview/common/classify/6/4.jpg",
  13811. "cat": 5 },
  13812. {
  13813. "name": "运动鞋",
  13814. "key": "运动鞋",
  13815. "icon": "https://cdn.uviewui.com/uview/common/classify/6/5.jpg",
  13816. "cat": 5 },
  13817. {
  13818. "name": "拖鞋",
  13819. "key": "拖鞋",
  13820. "icon": "https://cdn.uviewui.com/uview/common/classify/6/6.jpg",
  13821. "cat": 5 },
  13822. {
  13823. "name": "凉鞋",
  13824. "key": "凉鞋",
  13825. "icon": "https://cdn.uviewui.com/uview/common/classify/6/7.jpg",
  13826. "cat": 5 },
  13827. {
  13828. "name": "休闲鞋",
  13829. "key": "休闲鞋",
  13830. "icon": "https://cdn.uviewui.com/uview/common/classify/6/8.jpg",
  13831. "cat": 5 },
  13832. {
  13833. "name": "高跟鞋",
  13834. "key": "高跟鞋",
  13835. "icon": "https://cdn.uviewui.com/uview/common/classify/6/9.jpg",
  13836. "cat": 5 },
  13837. {
  13838. "name": "老人鞋",
  13839. "key": "老人鞋",
  13840. "icon": "https://cdn.uviewui.com/uview/common/classify/6/10.jpg",
  13841. "cat": 5 },
  13842. {
  13843. "name": "懒人鞋",
  13844. "key": "懒人鞋",
  13845. "icon": "https://cdn.uviewui.com/uview/common/classify/6/11.jpg",
  13846. "cat": 5 }] },
  13847. {
  13848. "name": "数码家电",
  13849. "foods": [
  13850. {
  13851. "name": "数据线",
  13852. "key": "数据线",
  13853. "icon": "https://cdn.uviewui.com/uview/common/classify/7/1.jpg",
  13854. "cat": 8 },
  13855. {
  13856. "name": "耳机",
  13857. "key": "耳机",
  13858. "icon": "https://cdn.uviewui.com/uview/common/classify/7/2.jpg",
  13859. "cat": 8 },
  13860. {
  13861. "name": "生活家电",
  13862. "key": "家电",
  13863. "icon": "https://cdn.uviewui.com/uview/common/classify/7/3.jpg",
  13864. "cat": 8 },
  13865. {
  13866. "name": "电风扇",
  13867. "key": "电风扇",
  13868. "icon": "https://cdn.uviewui.com/uview/common/classify/7/4.jpg",
  13869. "cat": 8 },
  13870. {
  13871. "name": "电吹风",
  13872. "key": "电吹风",
  13873. "icon": "https://cdn.uviewui.com/uview/common/classify/7/5.jpg",
  13874. "cat": 8 },
  13875. {
  13876. "name": "手机壳",
  13877. "key": "手机壳",
  13878. "icon": "https://cdn.uviewui.com/uview/common/classify/7/6.jpg",
  13879. "cat": 8 },
  13880. {
  13881. "name": "榨汁机",
  13882. "key": "榨汁机",
  13883. "icon": "https://cdn.uviewui.com/uview/common/classify/7/7.jpg",
  13884. "cat": 8 },
  13885. {
  13886. "name": "小家电",
  13887. "key": "小家电",
  13888. "icon": "https://cdn.uviewui.com/uview/common/classify/7/8.jpg",
  13889. "cat": 8 },
  13890. {
  13891. "name": "数码电子",
  13892. "key": "数码",
  13893. "icon": "https://cdn.uviewui.com/uview/common/classify/7/9.jpg",
  13894. "cat": 8 },
  13895. {
  13896. "name": "电饭锅",
  13897. "key": "电饭锅",
  13898. "icon": "https://cdn.uviewui.com/uview/common/classify/7/10.jpg",
  13899. "cat": 8 },
  13900. {
  13901. "name": "手机支架",
  13902. "key": "手机支架",
  13903. "icon": "https://cdn.uviewui.com/uview/common/classify/7/11.jpg",
  13904. "cat": 8 },
  13905. {
  13906. "name": "剃须刀",
  13907. "key": "剃须刀",
  13908. "icon": "https://cdn.uviewui.com/uview/common/classify/7/12.jpg",
  13909. "cat": 8 },
  13910. {
  13911. "name": "充电宝",
  13912. "key": "充电宝",
  13913. "icon": "https://cdn.uviewui.com/uview/common/classify/7/13.jpg",
  13914. "cat": 8 },
  13915. {
  13916. "name": "手机配件",
  13917. "key": "手机配件",
  13918. "icon": "https://cdn.uviewui.com/uview/common/classify/7/14.jpg",
  13919. "cat": 8 }] },
  13920. {
  13921. "name": "母婴",
  13922. "foods": [
  13923. {
  13924. "name": "婴童服饰",
  13925. "key": "衣服",
  13926. "icon": "https://cdn.uviewui.com/uview/common/classify/8/1.jpg",
  13927. "cat": 2 },
  13928. {
  13929. "name": "玩具乐器",
  13930. "key": "玩具乐器",
  13931. "icon": "https://cdn.uviewui.com/uview/common/classify/8/2.jpg",
  13932. "cat": 2 },
  13933. {
  13934. "name": "尿不湿",
  13935. "key": "尿不湿",
  13936. "icon": "https://cdn.uviewui.com/uview/common/classify/8/3.jpg",
  13937. "cat": 2 },
  13938. {
  13939. "name": "安抚牙胶",
  13940. "key": "安抚牙胶",
  13941. "icon": "https://cdn.uviewui.com/uview/common/classify/8/4.jpg",
  13942. "cat": 2 },
  13943. {
  13944. "name": "奶瓶奶嘴",
  13945. "key": "奶瓶奶嘴",
  13946. "icon": "https://cdn.uviewui.com/uview/common/classify/8/5.jpg",
  13947. "cat": 2 },
  13948. {
  13949. "name": "孕妈用品",
  13950. "key": "孕妈用品",
  13951. "icon": "https://cdn.uviewui.com/uview/common/classify/8/6.jpg",
  13952. "cat": 2 },
  13953. {
  13954. "name": "宝宝用品",
  13955. "key": "宝宝用品",
  13956. "icon": "https://cdn.uviewui.com/uview/common/classify/8/7.jpg",
  13957. "cat": 2 },
  13958. {
  13959. "name": "婴童湿巾",
  13960. "key": "湿巾",
  13961. "icon": "https://cdn.uviewui.com/uview/common/classify/8/8.jpg",
  13962. "cat": 2 },
  13963. {
  13964. "name": "喂养洗护",
  13965. "key": "洗护",
  13966. "icon": "https://cdn.uviewui.com/uview/common/classify/8/9.jpg",
  13967. "cat": 2 },
  13968. {
  13969. "name": "婴童鞋靴",
  13970. "key": "童鞋",
  13971. "icon": "https://cdn.uviewui.com/uview/common/classify/8/10.jpg",
  13972. "cat": 2 },
  13973. {
  13974. "name": "口水巾",
  13975. "key": "口水巾",
  13976. "icon": "https://cdn.uviewui.com/uview/common/classify/8/11.jpg",
  13977. "cat": 2 },
  13978. {
  13979. "name": "营养辅食",
  13980. "key": "营养",
  13981. "icon": "https://cdn.uviewui.com/uview/common/classify/8/12.jpg",
  13982. "cat": 2 },
  13983. {
  13984. "name": "婴幼书籍",
  13985. "key": "书籍",
  13986. "icon": "https://cdn.uviewui.com/uview/common/classify/8/13.jpg",
  13987. "cat": 2 },
  13988. {
  13989. "name": "婴儿车",
  13990. "key": "婴儿车",
  13991. "icon": "https://cdn.uviewui.com/uview/common/classify/8/14.jpg",
  13992. "cat": 2 }] },
  13993. {
  13994. "name": "箱包",
  13995. "foods": [
  13996. {
  13997. "name": "单肩包",
  13998. "key": "单肩包",
  13999. "icon": "https://cdn.uviewui.com/uview/common/classify/9/1.jpg",
  14000. "cat": 0 },
  14001. {
  14002. "name": "斜挎包",
  14003. "key": "斜挎包",
  14004. "icon": "https://cdn.uviewui.com/uview/common/classify/9/2.jpg",
  14005. "cat": 0 },
  14006. {
  14007. "name": "女包",
  14008. "key": "女包",
  14009. "icon": "https://cdn.uviewui.com/uview/common/classify/9/3.jpg",
  14010. "cat": 0 },
  14011. {
  14012. "name": "男包",
  14013. "key": "男包",
  14014. "icon": "https://cdn.uviewui.com/uview/common/classify/9/4.jpg",
  14015. "cat": 0 },
  14016. {
  14017. "name": "双肩包",
  14018. "key": "双肩包",
  14019. "icon": "https://cdn.uviewui.com/uview/common/classify/9/5.jpg",
  14020. "cat": 0 },
  14021. {
  14022. "name": "小方包",
  14023. "key": "小方包",
  14024. "icon": "https://cdn.uviewui.com/uview/common/classify/9/6.jpg",
  14025. "cat": 0 },
  14026. {
  14027. "name": "钱包",
  14028. "key": "钱包",
  14029. "icon": "https://cdn.uviewui.com/uview/common/classify/9/7.jpg",
  14030. "cat": 0 },
  14031. {
  14032. "name": "旅行箱包",
  14033. "key": "旅行箱包",
  14034. "icon": "https://cdn.uviewui.com/uview/common/classify/9/8.jpg",
  14035. "cat": 0 },
  14036. {
  14037. "name": "零钱包",
  14038. "key": "零钱包",
  14039. "icon": "https://cdn.uviewui.com/uview/common/classify/9/9.jpg",
  14040. "cat": 0 },
  14041. {
  14042. "name": "手提包",
  14043. "key": "手提包",
  14044. "icon": "https://cdn.uviewui.com/uview/common/classify/9/10.jpg",
  14045. "cat": 0 },
  14046. {
  14047. "name": "胸包",
  14048. "key": "胸包",
  14049. "icon": "https://cdn.uviewui.com/uview/common/classify/9/11.jpg",
  14050. "cat": 0 }] },
  14051. {
  14052. "name": "内衣",
  14053. "foods": [
  14054. {
  14055. "name": "袜子",
  14056. "key": "袜子",
  14057. "icon": "https://cdn.uviewui.com/uview/common/classify/10/1.jpg",
  14058. "cat": 11 },
  14059. {
  14060. "name": "吊带背心",
  14061. "key": "吊带背心",
  14062. "icon": "https://cdn.uviewui.com/uview/common/classify/10/2.jpg",
  14063. "cat": 11 },
  14064. {
  14065. "name": "抹胸",
  14066. "key": "抹胸",
  14067. "icon": "https://cdn.uviewui.com/uview/common/classify/10/3.jpg",
  14068. "cat": 11 },
  14069. {
  14070. "name": "内裤",
  14071. "key": "内裤",
  14072. "icon": "https://cdn.uviewui.com/uview/common/classify/10/4.jpg",
  14073. "cat": 11 },
  14074. {
  14075. "name": "文胸",
  14076. "key": "文胸",
  14077. "icon": "https://cdn.uviewui.com/uview/common/classify/10/5.jpg",
  14078. "cat": 11 },
  14079. {
  14080. "name": "文胸套装",
  14081. "key": "文胸套装",
  14082. "icon": "https://cdn.uviewui.com/uview/common/classify/10/6.jpg",
  14083. "cat": 11 },
  14084. {
  14085. "name": "打底塑身",
  14086. "key": "打底塑身",
  14087. "icon": "https://cdn.uviewui.com/uview/common/classify/10/7.jpg",
  14088. "cat": 11 },
  14089. {
  14090. "name": "家居服",
  14091. "key": "家居服",
  14092. "icon": "https://cdn.uviewui.com/uview/common/classify/10/8.jpg",
  14093. "cat": 11 },
  14094. {
  14095. "name": "船袜",
  14096. "key": "船袜",
  14097. "icon": "https://cdn.uviewui.com/uview/common/classify/10/9.jpg",
  14098. "cat": 11 },
  14099. {
  14100. "name": "情侣睡衣",
  14101. "key": "情侣睡衣",
  14102. "icon": "https://cdn.uviewui.com/uview/common/classify/10/10.jpg",
  14103. "cat": 11 },
  14104. {
  14105. "name": "丝袜",
  14106. "key": "丝袜",
  14107. "icon": "https://cdn.uviewui.com/uview/common/classify/10/11.jpg",
  14108. "cat": 11 }] },
  14109. {
  14110. "name": "文娱车品",
  14111. "foods": [
  14112. {
  14113. "name": "车市车品",
  14114. "key": "车市车品",
  14115. "icon": "https://cdn.uviewui.com/uview/common/classify/11/1.jpg",
  14116. "cat": 7 },
  14117. {
  14118. "name": "办公文具",
  14119. "key": "办公文具",
  14120. "icon": "https://cdn.uviewui.com/uview/common/classify/11/2.jpg",
  14121. "cat": 7 },
  14122. {
  14123. "name": "考试必备",
  14124. "key": "考试必备",
  14125. "icon": "https://cdn.uviewui.com/uview/common/classify/11/3.jpg",
  14126. "cat": 7 },
  14127. {
  14128. "name": "笔记本",
  14129. "key": "笔记本",
  14130. "icon": "https://cdn.uviewui.com/uview/common/classify/11/4.jpg",
  14131. "cat": 7 },
  14132. {
  14133. "name": "艺术礼品",
  14134. "key": "礼品",
  14135. "icon": "https://cdn.uviewui.com/uview/common/classify/11/5.jpg",
  14136. "cat": 7 },
  14137. {
  14138. "name": "书写工具",
  14139. "key": "书写工具",
  14140. "icon": "https://cdn.uviewui.com/uview/common/classify/11/6.jpg",
  14141. "cat": 7 },
  14142. {
  14143. "name": "车载电器",
  14144. "key": "车载电器",
  14145. "icon": "https://cdn.uviewui.com/uview/common/classify/11/7.jpg",
  14146. "cat": 7 },
  14147. {
  14148. "name": "图书音像",
  14149. "key": "图书音像",
  14150. "icon": "https://cdn.uviewui.com/uview/common/classify/11/8.jpg",
  14151. "cat": 7 },
  14152. {
  14153. "name": "画具画材",
  14154. "key": "画具画材",
  14155. "icon": "https://cdn.uviewui.com/uview/common/classify/11/9.jpg",
  14156. "cat": 7 }] },
  14157. {
  14158. "name": "配饰",
  14159. "foods": [
  14160. {
  14161. "name": "太阳镜",
  14162. "key": "太阳镜",
  14163. "icon": "https://cdn.uviewui.com/uview/common/classify/12/1.jpg",
  14164. "cat": 0 },
  14165. {
  14166. "name": "皮带",
  14167. "key": "皮带",
  14168. "icon": "https://cdn.uviewui.com/uview/common/classify/12/2.jpg",
  14169. "cat": 0 },
  14170. {
  14171. "name": "棒球帽",
  14172. "key": "棒球帽",
  14173. "icon": "https://cdn.uviewui.com/uview/common/classify/12/3.jpg",
  14174. "cat": 0 },
  14175. {
  14176. "name": "手表",
  14177. "key": "手表",
  14178. "icon": "https://cdn.uviewui.com/uview/common/classify/12/4.jpg",
  14179. "cat": 0 },
  14180. {
  14181. "name": "发饰",
  14182. "key": "发饰",
  14183. "icon": "https://cdn.uviewui.com/uview/common/classify/12/5.jpg",
  14184. "cat": 0 },
  14185. {
  14186. "name": "项链",
  14187. "key": "项链",
  14188. "icon": "https://cdn.uviewui.com/uview/common/classify/12/6.jpg",
  14189. "cat": 0 },
  14190. {
  14191. "name": "手饰",
  14192. "key": "手饰",
  14193. "icon": "https://cdn.uviewui.com/uview/common/classify/12/7.jpg",
  14194. "cat": 0 },
  14195. {
  14196. "name": "耳环",
  14197. "key": "耳环",
  14198. "icon": "https://cdn.uviewui.com/uview/common/classify/12/8.jpg",
  14199. "cat": 0 },
  14200. {
  14201. "name": "帽子丝巾",
  14202. "key": "帽子丝巾",
  14203. "icon": "https://cdn.uviewui.com/uview/common/classify/12/9.jpg",
  14204. "cat": 0 },
  14205. {
  14206. "name": "眼镜墨镜",
  14207. "key": "眼镜墨镜",
  14208. "icon": "https://cdn.uviewui.com/uview/common/classify/12/10.jpg",
  14209. "cat": 0 },
  14210. {
  14211. "name": "发带发箍",
  14212. "key": "发带发箍",
  14213. "icon": "https://cdn.uviewui.com/uview/common/classify/12/11.jpg",
  14214. "cat": 0 }] },
  14215. {
  14216. "name": "家装家纺",
  14217. "foods": [
  14218. {
  14219. "name": "家居饰品",
  14220. "key": "家居饰品",
  14221. "icon": "https://cdn.uviewui.com/uview/common/classify/13/1.jpg",
  14222. "cat": 0 },
  14223. {
  14224. "name": "凉席",
  14225. "key": "凉席",
  14226. "icon": "https://cdn.uviewui.com/uview/common/classify/13/2.jpg",
  14227. "cat": 0 },
  14228. {
  14229. "name": "背枕靠枕",
  14230. "key": "靠枕",
  14231. "icon": "https://cdn.uviewui.com/uview/common/classify/13/3.jpg",
  14232. "cat": 0 },
  14233. {
  14234. "name": "床上用品",
  14235. "key": "床上用品",
  14236. "icon": "https://cdn.uviewui.com/uview/common/classify/13/4.jpg",
  14237. "cat": 0 },
  14238. {
  14239. "name": "摆件",
  14240. "key": "摆件",
  14241. "icon": "https://cdn.uviewui.com/uview/common/classify/13/5.jpg",
  14242. "cat": 0 },
  14243. {
  14244. "name": "四件套",
  14245. "key": "四件套",
  14246. "icon": "https://cdn.uviewui.com/uview/common/classify/13/6.jpg",
  14247. "cat": 0 },
  14248. {
  14249. "name": "装饰品",
  14250. "key": "装饰品",
  14251. "icon": "https://cdn.uviewui.com/uview/common/classify/13/7.jpg",
  14252. "cat": 0 },
  14253. {
  14254. "name": "卫浴用品",
  14255. "key": "卫浴",
  14256. "icon": "https://cdn.uviewui.com/uview/common/classify/13/8.jpg",
  14257. "cat": 0 },
  14258. {
  14259. "name": "家居家装",
  14260. "key": "家具",
  14261. "icon": "https://cdn.uviewui.com/uview/common/classify/13/9.jpg",
  14262. "cat": 0 },
  14263. {
  14264. "name": "蚊帐",
  14265. "key": "蚊帐",
  14266. "icon": "https://cdn.uviewui.com/uview/common/classify/13/10.jpg",
  14267. "cat": 0 },
  14268. {
  14269. "name": "墙纸贴纸",
  14270. "key": "墙纸",
  14271. "icon": "https://cdn.uviewui.com/uview/common/classify/13/11.jpg",
  14272. "cat": 0 },
  14273. {
  14274. "name": "空调被",
  14275. "key": "空调被",
  14276. "icon": "https://cdn.uviewui.com/uview/common/classify/13/12.jpg",
  14277. "cat": 0 }] },
  14278. {
  14279. "name": "户外运动",
  14280. "foods": [
  14281. {
  14282. "name": "游泳装备",
  14283. "key": "游泳",
  14284. "icon": "https://cdn.uviewui.com/uview/common/classify/14/1.jpg",
  14285. "cat": 0 },
  14286. {
  14287. "name": "泳镜",
  14288. "key": "泳镜",
  14289. "icon": "https://cdn.uviewui.com/uview/common/classify/14/2.jpg",
  14290. "cat": 0 },
  14291. {
  14292. "name": "户外装备",
  14293. "key": "户外",
  14294. "icon": "https://cdn.uviewui.com/uview/common/classify/14/3.jpg",
  14295. "cat": 0 },
  14296. {
  14297. "name": "健身服饰",
  14298. "key": "健身",
  14299. "icon": "https://cdn.uviewui.com/uview/common/classify/14/4.jpg",
  14300. "cat": 0 },
  14301. {
  14302. "name": "泳衣",
  14303. "key": "泳衣",
  14304. "icon": "https://cdn.uviewui.com/uview/common/classify/14/5.jpg",
  14305. "cat": 0 },
  14306. {
  14307. "name": "瑜伽垫",
  14308. "key": "瑜伽垫",
  14309. "icon": "https://cdn.uviewui.com/uview/common/classify/14/6.jpg",
  14310. "cat": 0 },
  14311. {
  14312. "name": "瑜伽用品",
  14313. "key": "瑜伽",
  14314. "icon": "https://cdn.uviewui.com/uview/common/classify/14/7.jpg",
  14315. "cat": 0 },
  14316. {
  14317. "name": "健身装备",
  14318. "key": "健身",
  14319. "icon": "https://cdn.uviewui.com/uview/common/classify/14/8.jpg",
  14320. "cat": 0 },
  14321. {
  14322. "name": "球迷用品",
  14323. "key": "球迷",
  14324. "icon": "https://cdn.uviewui.com/uview/common/classify/14/9.jpg",
  14325. "cat": 0 }] }];exports.default = _default;
  14326. /***/ })
  14327. }]);
  14328. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map