vendor.js 497 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],{
  2. /***/ 1:
  3. /*!*********************************************************!*\
  4. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js ***!
  5. \*********************************************************/
  6. /*! no static exports found */
  7. /***/ (function(module, exports, __webpack_require__) {
  8. "use strict";
  9. Object.defineProperty(exports, "__esModule", {
  10. value: true
  11. });
  12. exports.default = void 0;
  13. var objectKeys = ['qy', 'env', 'error', 'version', 'lanDebug', 'cloud', 'serviceMarket', 'router', 'worklet', '__webpack_require_UNI_MP_PLUGIN__'];
  14. var singlePageDisableKey = ['lanDebug', 'router', 'worklet'];
  15. var target = typeof globalThis !== 'undefined' ? globalThis : function () {
  16. return this;
  17. }();
  18. var key = ['w', 'x'].join('');
  19. var oldWx = target[key];
  20. var launchOption = oldWx.getLaunchOptionsSync ? oldWx.getLaunchOptionsSync() : null;
  21. function isWxKey(key) {
  22. if (launchOption && launchOption.scene === 1154 && singlePageDisableKey.includes(key)) {
  23. return false;
  24. }
  25. return objectKeys.indexOf(key) > -1 || typeof oldWx[key] === 'function';
  26. }
  27. function initWx() {
  28. var newWx = {};
  29. for (var _key in oldWx) {
  30. if (isWxKey(_key)) {
  31. // TODO wrapper function
  32. newWx[_key] = oldWx[_key];
  33. }
  34. }
  35. return newWx;
  36. }
  37. target[key] = initWx();
  38. var _default = target[key];
  39. exports.default = _default;
  40. /***/ }),
  41. /***/ 10:
  42. /*!****************************************************************!*\
  43. !*** ./node_modules/@babel/runtime/helpers/nonIterableRest.js ***!
  44. \****************************************************************/
  45. /*! no static exports found */
  46. /***/ (function(module, exports) {
  47. function _nonIterableRest() {
  48. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  49. }
  50. module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
  51. /***/ }),
  52. /***/ 11:
  53. /*!***************************************************************!*\
  54. !*** ./node_modules/@babel/runtime/helpers/defineProperty.js ***!
  55. \***************************************************************/
  56. /*! no static exports found */
  57. /***/ (function(module, exports, __webpack_require__) {
  58. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
  59. function _defineProperty(obj, key, value) {
  60. key = toPropertyKey(key);
  61. if (key in obj) {
  62. Object.defineProperty(obj, key, {
  63. value: value,
  64. enumerable: true,
  65. configurable: true,
  66. writable: true
  67. });
  68. } else {
  69. obj[key] = value;
  70. }
  71. return obj;
  72. }
  73. module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
  74. /***/ }),
  75. /***/ 116:
  76. /*!************************************************!*\
  77. !*** E:/work/mdapp/js_sdk/xb-copy/uni-copy.js ***!
  78. \************************************************/
  79. /*! no static exports found */
  80. /***/ (function(module, exports, __webpack_require__) {
  81. "use strict";
  82. /* WEBPACK VAR INJECTION */(function(uni) {
  83. Object.defineProperty(exports, "__esModule", {
  84. value: true
  85. });
  86. exports.default = uniCopy;
  87. function uniCopy(_ref) {
  88. var content = _ref.content,
  89. _success = _ref.success,
  90. error = _ref.error;
  91. if (!content) return error('复制的内容不能为空 !');
  92. content = typeof content === 'string' ? content : content.toString(); // 复制内容,必须字符串,数字需要转换为字符串
  93. /**
  94. * 小程序端 和 app端的复制逻辑
  95. */
  96. uni.setClipboardData({
  97. data: content,
  98. success: function success() {
  99. _success("复制成功~");
  100. console.log('success');
  101. },
  102. fail: function fail() {
  103. _success("复制失败~");
  104. }
  105. });
  106. /**
  107. * H5端的复制逻辑
  108. */
  109. }
  110. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  111. /***/ }),
  112. /***/ 12:
  113. /*!**************************************************************!*\
  114. !*** ./node_modules/@babel/runtime/helpers/toPropertyKey.js ***!
  115. \**************************************************************/
  116. /*! no static exports found */
  117. /***/ (function(module, exports, __webpack_require__) {
  118. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  119. var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ 14);
  120. function _toPropertyKey(arg) {
  121. var key = toPrimitive(arg, "string");
  122. return _typeof(key) === "symbol" ? key : String(key);
  123. }
  124. module.exports = _toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
  125. /***/ }),
  126. /***/ 13:
  127. /*!*******************************************************!*\
  128. !*** ./node_modules/@babel/runtime/helpers/typeof.js ***!
  129. \*******************************************************/
  130. /*! no static exports found */
  131. /***/ (function(module, exports) {
  132. function _typeof(obj) {
  133. "@babel/helpers - typeof";
  134. return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
  135. return typeof obj;
  136. } : function (obj) {
  137. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  138. }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
  139. }
  140. module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
  141. /***/ }),
  142. /***/ 14:
  143. /*!************************************************************!*\
  144. !*** ./node_modules/@babel/runtime/helpers/toPrimitive.js ***!
  145. \************************************************************/
  146. /*! no static exports found */
  147. /***/ (function(module, exports, __webpack_require__) {
  148. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  149. function _toPrimitive(input, hint) {
  150. if (_typeof(input) !== "object" || input === null) return input;
  151. var prim = input[Symbol.toPrimitive];
  152. if (prim !== undefined) {
  153. var res = prim.call(input, hint || "default");
  154. if (_typeof(res) !== "object") return res;
  155. throw new TypeError("@@toPrimitive must return a primitive value.");
  156. }
  157. return (hint === "string" ? String : Number)(input);
  158. }
  159. module.exports = _toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
  160. /***/ }),
  161. /***/ 15:
  162. /*!**********************************************************!*\
  163. !*** ./node_modules/@babel/runtime/helpers/construct.js ***!
  164. \**********************************************************/
  165. /*! no static exports found */
  166. /***/ (function(module, exports, __webpack_require__) {
  167. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  168. var isNativeReflectConstruct = __webpack_require__(/*! ./isNativeReflectConstruct.js */ 17);
  169. function _construct(Parent, args, Class) {
  170. if (isNativeReflectConstruct()) {
  171. module.exports = _construct = Reflect.construct.bind(), module.exports.__esModule = true, module.exports["default"] = module.exports;
  172. } else {
  173. module.exports = _construct = function _construct(Parent, args, Class) {
  174. var a = [null];
  175. a.push.apply(a, args);
  176. var Constructor = Function.bind.apply(Parent, a);
  177. var instance = new Constructor();
  178. if (Class) setPrototypeOf(instance, Class.prototype);
  179. return instance;
  180. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  181. }
  182. return _construct.apply(null, arguments);
  183. }
  184. module.exports = _construct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  185. /***/ }),
  186. /***/ 16:
  187. /*!***************************************************************!*\
  188. !*** ./node_modules/@babel/runtime/helpers/setPrototypeOf.js ***!
  189. \***************************************************************/
  190. /*! no static exports found */
  191. /***/ (function(module, exports) {
  192. function _setPrototypeOf(o, p) {
  193. module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
  194. o.__proto__ = p;
  195. return o;
  196. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  197. return _setPrototypeOf(o, p);
  198. }
  199. module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
  200. /***/ }),
  201. /***/ 17:
  202. /*!*************************************************************************!*\
  203. !*** ./node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js ***!
  204. \*************************************************************************/
  205. /*! no static exports found */
  206. /***/ (function(module, exports) {
  207. function _isNativeReflectConstruct() {
  208. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  209. if (Reflect.construct.sham) return false;
  210. if (typeof Proxy === "function") return true;
  211. try {
  212. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  213. return true;
  214. } catch (e) {
  215. return false;
  216. }
  217. }
  218. module.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  219. /***/ }),
  220. /***/ 173:
  221. /*!*************************************!*\
  222. !*** E:/work/mdapp/utils/qrcode.js ***!
  223. \*************************************/
  224. /*! no static exports found */
  225. /***/ (function(module, exports, __webpack_require__) {
  226. "use strict";
  227. /* WEBPACK VAR INJECTION */(function(uni) {
  228. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  229. Object.defineProperty(exports, "__esModule", {
  230. value: true
  231. });
  232. exports.default = void 0;
  233. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  234. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  235. /**
  236. * qrcode-wx-miniprogram
  237. */
  238. var QRMode = {
  239. MODE_NUMBER: 1 << 0,
  240. MODE_ALPHA_NUM: 1 << 1,
  241. MODE_8BIT_BYTE: 1 << 2,
  242. MODE_KANJI: 1 << 3
  243. },
  244. QRErrorCorrectLevel = {
  245. L: 1,
  246. M: 0,
  247. Q: 3,
  248. H: 2
  249. },
  250. QRMaskPattern = {
  251. PATTERN000: 0,
  252. PATTERN001: 1,
  253. PATTERN010: 2,
  254. PATTERN011: 3,
  255. PATTERN100: 4,
  256. PATTERN101: 5,
  257. PATTERN110: 6,
  258. PATTERN111: 7
  259. },
  260. QRUtil = {
  261. PATTERN_POSITION_TABLE: [[], [6, 18], [6, 22], [6, 26], [6, 30], [6, 34], [6, 22, 38], [6, 24, 42], [6, 26, 46], [6, 28, 50], [6, 30, 54], [6, 32, 58], [6, 34, 62], [6, 26, 46, 66], [6, 26, 48, 70], [6, 26, 50, 74], [6, 30, 54, 78], [6, 30, 56, 82], [6, 30, 58, 86], [6, 34, 62, 90], [6, 28, 50, 72, 94], [6, 26, 50, 74, 98], [6, 30, 54, 78, 102], [6, 28, 54, 80, 106], [6, 32, 58, 84, 110], [6, 30, 58, 86, 114], [6, 34, 62, 90, 118], [6, 26, 50, 74, 98, 122], [6, 30, 54, 78, 102, 126], [6, 26, 52, 78, 104, 130], [6, 30, 56, 82, 108, 134], [6, 34, 60, 86, 112, 138], [6, 30, 58, 86, 114, 142], [6, 34, 62, 90, 118, 146], [6, 30, 54, 78, 102, 126, 150], [6, 24, 50, 76, 102, 128, 154], [6, 28, 54, 80, 106, 132, 158], [6, 32, 58, 84, 110, 136, 162], [6, 26, 54, 82, 110, 138, 166], [6, 30, 58, 86, 114, 142, 170]],
  262. G15: 1 << 10 | 1 << 8 | 1 << 5 | 1 << 4 | 1 << 2 | 1 << 1 | 1 << 0,
  263. G18: 1 << 12 | 1 << 11 | 1 << 10 | 1 << 9 | 1 << 8 | 1 << 5 | 1 << 2 | 1 << 0,
  264. G15_MASK: 1 << 14 | 1 << 12 | 1 << 10 | 1 << 4 | 1 << 1,
  265. getBCHTypeInfo: function getBCHTypeInfo(data) {
  266. var d = data << 10;
  267. while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15) >= 0) {
  268. d ^= QRUtil.G15 << QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15);
  269. }
  270. return (data << 10 | d) ^ QRUtil.G15_MASK;
  271. },
  272. getBCHTypeNumber: function getBCHTypeNumber(data) {
  273. var d = data << 12;
  274. while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18) >= 0) {
  275. d ^= QRUtil.G18 << QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18);
  276. }
  277. return data << 12 | d;
  278. },
  279. getBCHDigit: function getBCHDigit(data) {
  280. var digit = 0;
  281. while (data != 0) {
  282. digit++;
  283. data >>>= 1;
  284. }
  285. return digit;
  286. },
  287. getPatternPosition: function getPatternPosition(typeNumber) {
  288. return QRUtil.PATTERN_POSITION_TABLE[typeNumber - 1];
  289. },
  290. getMask: function getMask(maskPattern, i, j) {
  291. switch (maskPattern) {
  292. case QRMaskPattern.PATTERN000:
  293. return (i + j) % 2 == 0;
  294. case QRMaskPattern.PATTERN001:
  295. return i % 2 == 0;
  296. case QRMaskPattern.PATTERN010:
  297. return j % 3 == 0;
  298. case QRMaskPattern.PATTERN011:
  299. return (i + j) % 3 == 0;
  300. case QRMaskPattern.PATTERN100:
  301. return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 == 0;
  302. case QRMaskPattern.PATTERN101:
  303. return i * j % 2 + i * j % 3 == 0;
  304. case QRMaskPattern.PATTERN110:
  305. return (i * j % 2 + i * j % 3) % 2 == 0;
  306. case QRMaskPattern.PATTERN111:
  307. return (i * j % 3 + (i + j) % 2) % 2 == 0;
  308. default:
  309. //throw new Error("bad maskPattern:" + maskPattern);
  310. throwError("bad maskPattern:" + maskPattern);
  311. }
  312. },
  313. getErrorCorrectPolynomial: function getErrorCorrectPolynomial(errorCorrectLength) {
  314. var a = new QRPolynomial([1], 0);
  315. for (var i = 0; i < errorCorrectLength; i++) {
  316. a = a.multiply(new QRPolynomial([1, QRMath.gexp(i)], 0));
  317. }
  318. return a;
  319. },
  320. getLengthInBits: function getLengthInBits(mode, type) {
  321. if (1 <= type && type < 10) {
  322. switch (mode) {
  323. case QRMode.MODE_NUMBER:
  324. return 10;
  325. case QRMode.MODE_ALPHA_NUM:
  326. return 9;
  327. case QRMode.MODE_8BIT_BYTE:
  328. return 8;
  329. case QRMode.MODE_KANJI:
  330. return 8;
  331. default:
  332. //throw new Error("mode:" + mode);
  333. throwError("mode:" + mode);
  334. }
  335. } else if (type < 27) {
  336. switch (mode) {
  337. case QRMode.MODE_NUMBER:
  338. return 12;
  339. case QRMode.MODE_ALPHA_NUM:
  340. return 11;
  341. case QRMode.MODE_8BIT_BYTE:
  342. return 16;
  343. case QRMode.MODE_KANJI:
  344. return 10;
  345. default:
  346. //throw new Error("mode:" + mode);
  347. throwError("mode:" + mode);
  348. }
  349. } else if (type < 41) {
  350. switch (mode) {
  351. case QRMode.MODE_NUMBER:
  352. return 14;
  353. case QRMode.MODE_ALPHA_NUM:
  354. return 13;
  355. case QRMode.MODE_8BIT_BYTE:
  356. return 16;
  357. case QRMode.MODE_KANJI:
  358. return 12;
  359. default:
  360. //throw new Error("mode:" + mode);
  361. throwError("mode:" + mode);
  362. }
  363. } else {
  364. //throw new Error("type:" + type);
  365. throwError("type:" + type);
  366. }
  367. },
  368. getLostPoint: function getLostPoint(qrCode) {
  369. var moduleCount = qrCode.getModuleCount();
  370. var lostPoint = 0;
  371. for (var row = 0; row < moduleCount; row++) {
  372. for (var col = 0; col < moduleCount; col++) {
  373. var sameCount = 0;
  374. var dark = qrCode.isDark(row, col);
  375. for (var r = -1; r <= 1; r++) {
  376. if (row + r < 0 || moduleCount <= row + r) {
  377. continue;
  378. }
  379. for (var c = -1; c <= 1; c++) {
  380. if (col + c < 0 || moduleCount <= col + c) {
  381. continue;
  382. }
  383. if (r == 0 && c == 0) {
  384. continue;
  385. }
  386. if (dark == qrCode.isDark(row + r, col + c)) {
  387. sameCount++;
  388. }
  389. }
  390. }
  391. if (sameCount > 5) {
  392. lostPoint += 3 + sameCount - 5;
  393. }
  394. }
  395. }
  396. for (var row = 0; row < moduleCount - 1; row++) {
  397. for (var col = 0; col < moduleCount - 1; col++) {
  398. var count = 0;
  399. if (qrCode.isDark(row, col)) count++;
  400. if (qrCode.isDark(row + 1, col)) count++;
  401. if (qrCode.isDark(row, col + 1)) count++;
  402. if (qrCode.isDark(row + 1, col + 1)) count++;
  403. if (count == 0 || count == 4) {
  404. lostPoint += 3;
  405. }
  406. }
  407. }
  408. for (var row = 0; row < moduleCount; row++) {
  409. for (var col = 0; col < moduleCount - 6; col++) {
  410. if (qrCode.isDark(row, col) && !qrCode.isDark(row, col + 1) && qrCode.isDark(row, col + 2) && qrCode.isDark(row, col + 3) && qrCode.isDark(row, col + 4) && !qrCode.isDark(row, col + 5) && qrCode.isDark(row, col + 6)) {
  411. lostPoint += 40;
  412. }
  413. }
  414. }
  415. for (var col = 0; col < moduleCount; col++) {
  416. for (var row = 0; row < moduleCount - 6; row++) {
  417. if (qrCode.isDark(row, col) && !qrCode.isDark(row + 1, col) && qrCode.isDark(row + 2, col) && qrCode.isDark(row + 3, col) && qrCode.isDark(row + 4, col) && !qrCode.isDark(row + 5, col) && qrCode.isDark(row + 6, col)) {
  418. lostPoint += 40;
  419. }
  420. }
  421. }
  422. var darkCount = 0;
  423. for (var col = 0; col < moduleCount; col++) {
  424. for (var row = 0; row < moduleCount; row++) {
  425. if (qrCode.isDark(row, col)) {
  426. darkCount++;
  427. }
  428. }
  429. }
  430. var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5;
  431. lostPoint += ratio * 10;
  432. return lostPoint;
  433. }
  434. },
  435. QRMath = {
  436. glog: function glog(n) {
  437. if (n < 1) {
  438. //throw new Error("glog(" + n + ")");
  439. throwError("glog(" + n + ")");
  440. }
  441. return QRMath.LOG_TABLE[n];
  442. },
  443. gexp: function gexp(n) {
  444. while (n < 0) {
  445. n += 255;
  446. }
  447. while (n >= 256) {
  448. n -= 255;
  449. }
  450. return QRMath.EXP_TABLE[n];
  451. },
  452. EXP_TABLE: new Array(256),
  453. LOG_TABLE: new Array(256)
  454. };
  455. for (var i = 0; i < 8; i++) {
  456. QRMath.EXP_TABLE[i] = 1 << i;
  457. }
  458. for (var _i = 8; _i < 256; _i++) {
  459. QRMath.EXP_TABLE[_i] = QRMath.EXP_TABLE[_i - 4] ^ QRMath.EXP_TABLE[_i - 5] ^ QRMath.EXP_TABLE[_i - 6] ^ QRMath.EXP_TABLE[_i - 8];
  460. }
  461. for (var _i2 = 0; _i2 < 255; _i2++) {
  462. QRMath.LOG_TABLE[QRMath.EXP_TABLE[_i2]] = _i2;
  463. }
  464. /*
  465. * class QR8bitByte
  466. * */
  467. var QR8bitByte = /*#__PURE__*/function () {
  468. function QR8bitByte(data) {
  469. (0, _classCallCheck2.default)(this, QR8bitByte);
  470. this.mode = QRMode.MODE_8BIT_BYTE;
  471. this.data = data;
  472. this.parsedData = [];
  473. // Added to support UTF-8 Characters
  474. for (var _i3 = 0, l = this.data.length; _i3 < l; _i3++) {
  475. var byteArray = [],
  476. code = this.data.charCodeAt(_i3);
  477. if (code > 0x10000) {
  478. byteArray[0] = 0xF0 | (code & 0x1C0000) >>> 18;
  479. byteArray[1] = 0x80 | (code & 0x3F000) >>> 12;
  480. byteArray[2] = 0x80 | (code & 0xFC0) >>> 6;
  481. byteArray[3] = 0x80 | code & 0x3F;
  482. } else if (code > 0x800) {
  483. byteArray[0] = 0xE0 | (code & 0xF000) >>> 12;
  484. byteArray[1] = 0x80 | (code & 0xFC0) >>> 6;
  485. byteArray[2] = 0x80 | code & 0x3F;
  486. } else if (code > 0x80) {
  487. byteArray[0] = 0xC0 | (code & 0x7C0) >>> 6;
  488. byteArray[1] = 0x80 | code & 0x3F;
  489. } else {
  490. byteArray[0] = code;
  491. }
  492. this.parsedData.push(byteArray);
  493. }
  494. this.parsedData = Array.prototype.concat.apply([], this.parsedData);
  495. if (this.parsedData.length !== this.data.length) {
  496. this.parsedData.unshift(191);
  497. this.parsedData.unshift(187);
  498. this.parsedData.unshift(239);
  499. }
  500. }
  501. (0, _createClass2.default)(QR8bitByte, [{
  502. key: "getLength",
  503. value: function getLength(buffer) {
  504. return this.parsedData.length;
  505. }
  506. }, {
  507. key: "write",
  508. value: function write(buffer) {
  509. for (var _i4 = 0, l = this.parsedData.length; _i4 < l; _i4++) {
  510. buffer.put(this.parsedData[_i4], 8);
  511. }
  512. }
  513. }]);
  514. return QR8bitByte;
  515. }();
  516. /*
  517. * class QRCodeModel
  518. * */
  519. var QRCodeModel = /*#__PURE__*/function () {
  520. function QRCodeModel(typeNumber, errorCorrectLevel) {
  521. (0, _classCallCheck2.default)(this, QRCodeModel);
  522. this.typeNumber = typeNumber;
  523. this.errorCorrectLevel = errorCorrectLevel;
  524. this.modules = null;
  525. this.moduleCount = 0;
  526. this.dataCache = null;
  527. this.dataList = [];
  528. }
  529. (0, _createClass2.default)(QRCodeModel, [{
  530. key: "addData",
  531. value: function addData(data) {
  532. var newData = new QR8bitByte(data);
  533. this.dataList.push(newData);
  534. this.dataCache = null;
  535. }
  536. }, {
  537. key: "isDark",
  538. value: function isDark(row, col) {
  539. if (row < 0 || this.moduleCount <= row || col < 0 || this.moduleCount <= col) {
  540. //throw new Error(row + ',' + col);
  541. throwError(row + ',' + col);
  542. }
  543. return this.modules[row][col];
  544. }
  545. }, {
  546. key: "getModuleCount",
  547. value: function getModuleCount() {
  548. return this.moduleCount;
  549. }
  550. }, {
  551. key: "make",
  552. value: function make() {
  553. this.makeImpl(false, this.getBestMaskPattern());
  554. }
  555. }, {
  556. key: "makeImpl",
  557. value: function makeImpl(test, maskPattern) {
  558. this.moduleCount = this.typeNumber * 4 + 17;
  559. this.modules = new Array(this.moduleCount);
  560. for (var row = 0; row < this.moduleCount; row++) {
  561. this.modules[row] = new Array(this.moduleCount);
  562. for (var col = 0; col < this.moduleCount; col++) {
  563. this.modules[row][col] = null;
  564. }
  565. }
  566. this.setupPositionProbePattern(0, 0);
  567. this.setupPositionProbePattern(this.moduleCount - 7, 0);
  568. this.setupPositionProbePattern(0, this.moduleCount - 7);
  569. this.setupPositionAdjustPattern();
  570. this.setupTimingPattern();
  571. this.setupTypeInfo(test, maskPattern);
  572. if (this.typeNumber >= 7) {
  573. this.setupTypeNumber(test);
  574. }
  575. if (this.dataCache == null) {
  576. this.dataCache = QRCodeModel.createData(this.typeNumber, this.errorCorrectLevel, this.dataList);
  577. }
  578. this.mapData(this.dataCache, maskPattern);
  579. }
  580. }, {
  581. key: "setupPositionProbePattern",
  582. value: function setupPositionProbePattern(row, col) {
  583. for (var r = -1; r <= 7; r++) {
  584. if (row + r <= -1 || this.moduleCount <= row + r) {
  585. continue;
  586. }
  587. for (var c = -1; c <= 7; c++) {
  588. if (col + c <= -1 || this.moduleCount <= col + c) {
  589. continue;
  590. }
  591. this.modules[row + r][col + c] = 0 <= r && r <= 6 && (c == 0 || c == 6) || 0 <= c && c <= 6 && (r == 0 || r == 6) || 2 <= r && r <= 4 && 2 <= c && c <= 4;
  592. }
  593. }
  594. }
  595. }, {
  596. key: "getBestMaskPattern",
  597. value: function getBestMaskPattern() {
  598. var minLostPoint = 0,
  599. pattern = 0;
  600. for (var _i5 = 0; _i5 < 8; _i5++) {
  601. this.makeImpl(true, _i5);
  602. var lostPoint = QRUtil.getLostPoint(this);
  603. if (_i5 == 0 || minLostPoint > lostPoint) {
  604. minLostPoint = lostPoint;
  605. pattern = _i5;
  606. }
  607. }
  608. return pattern;
  609. }
  610. }, {
  611. key: "setupTimingPattern",
  612. value: function setupTimingPattern() {
  613. for (var r = 8; r < this.moduleCount - 8; r++) {
  614. if (this.modules[r][6] != null) {
  615. continue;
  616. }
  617. this.modules[r][6] = r % 2 == 0;
  618. }
  619. for (var c = 8; c < this.moduleCount - 8; c++) {
  620. if (this.modules[6][c] != null) {
  621. continue;
  622. }
  623. this.modules[6][c] = c % 2 == 0;
  624. }
  625. }
  626. }, {
  627. key: "setupPositionAdjustPattern",
  628. value: function setupPositionAdjustPattern() {
  629. var pos = QRUtil.getPatternPosition(this.typeNumber);
  630. for (var _i6 = 0; _i6 < pos.length; _i6++) {
  631. for (var j = 0; j < pos.length; j++) {
  632. var row = pos[_i6],
  633. col = pos[j];
  634. if (this.modules[row][col] != null) {
  635. continue;
  636. }
  637. for (var r = -2; r <= 2; r++) {
  638. for (var c = -2; c <= 2; c++) {
  639. this.modules[row + r][col + c] = r == -2 || r == 2 || c == -2 || c == 2 || r == 0 && c == 0;
  640. }
  641. }
  642. }
  643. }
  644. }
  645. }, {
  646. key: "setupTypeNumber",
  647. value: function setupTypeNumber(test) {
  648. var bits = QRUtil.getBCHTypeNumber(this.typeNumber);
  649. for (var _i7 = 0; _i7 < 18; _i7++) {
  650. this.modules[Math.floor(_i7 / 3)][_i7 % 3 + this.moduleCount - 8 - 3] = !test && (bits >> _i7 & 1) == 1;
  651. }
  652. for (var _i8 = 0; _i8 < 18; _i8++) {
  653. this.modules[_i8 % 3 + this.moduleCount - 8 - 3][Math.floor(_i8 / 3)] = !test && (bits >> _i8 & 1) == 1;
  654. }
  655. }
  656. }, {
  657. key: "setupTypeInfo",
  658. value: function setupTypeInfo(test, maskPattern) {
  659. var data = this.errorCorrectLevel << 3 | maskPattern,
  660. bits = QRUtil.getBCHTypeInfo(data);
  661. for (var _i9 = 0; _i9 < 15; _i9++) {
  662. var mod = !test && (bits >> _i9 & 1) == 1;
  663. if (_i9 < 6) {
  664. this.modules[_i9][8] = mod;
  665. } else if (_i9 < 8) {
  666. this.modules[_i9 + 1][8] = mod;
  667. } else {
  668. this.modules[this.moduleCount - 15 + _i9][8] = mod;
  669. }
  670. }
  671. for (var _i10 = 0; _i10 < 15; _i10++) {
  672. var _mod = !test && (bits >> _i10 & 1) == 1;
  673. if (_i10 < 8) {
  674. this.modules[8][this.moduleCount - _i10 - 1] = _mod;
  675. } else if (_i10 < 9) {
  676. this.modules[8][15 - _i10 - 1 + 1] = _mod;
  677. } else {
  678. this.modules[8][15 - _i10 - 1] = _mod;
  679. }
  680. }
  681. this.modules[this.moduleCount - 8][8] = !test;
  682. }
  683. }, {
  684. key: "mapData",
  685. value: function mapData(data, maskPattern) {
  686. var inc = -1,
  687. row = this.moduleCount - 1,
  688. bitIndex = 7,
  689. byteIndex = 0;
  690. for (var col = this.moduleCount - 1; col > 0; col -= 2) {
  691. if (col == 6) col--;
  692. while (true) {
  693. for (var c = 0; c < 2; c++) {
  694. if (this.modules[row][col - c] == null) {
  695. var dark = false;
  696. if (byteIndex < data.length) {
  697. dark = (data[byteIndex] >>> bitIndex & 1) == 1;
  698. }
  699. var mask = QRUtil.getMask(maskPattern, row, col - c);
  700. if (mask) {
  701. dark = !dark;
  702. }
  703. this.modules[row][col - c] = dark;
  704. bitIndex--;
  705. if (bitIndex == -1) {
  706. byteIndex++;
  707. bitIndex = 7;
  708. }
  709. }
  710. }
  711. row += inc;
  712. if (row < 0 || this.moduleCount <= row) {
  713. row -= inc;
  714. inc = -inc;
  715. break;
  716. }
  717. }
  718. }
  719. }
  720. }]);
  721. return QRCodeModel;
  722. }();
  723. QRCodeModel.PAD0 = 0xEC;
  724. QRCodeModel.PAD1 = 0x11;
  725. QRCodeModel.createData = function (typeNumber, errorCorrectLevel, dataList) {
  726. var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, errorCorrectLevel),
  727. buffer = new QRBitBuffer();
  728. for (var _i11 = 0; _i11 < dataList.length; _i11++) {
  729. var data = dataList[_i11];
  730. buffer.put(data.mode, 4);
  731. buffer.put(data.getLength(), QRUtil.getLengthInBits(data.mode, typeNumber));
  732. data.write(buffer);
  733. }
  734. var totalDataCount = 0;
  735. for (var _i12 = 0; _i12 < rsBlocks.length; _i12++) {
  736. totalDataCount += rsBlocks[_i12].dataCount;
  737. }
  738. if (buffer.getLengthInBits() > totalDataCount * 8) {
  739. /*
  740. throw new Error("code length overflow. (" +
  741. buffer.getLengthInBits() +
  742. ">" +
  743. totalDataCount * 8 +
  744. ")");
  745. */
  746. throwError("code length overflow. (" + buffer.getLengthInBits() + ">" + totalDataCount * 8 + ")");
  747. }
  748. if (buffer.getLengthInBits() + 4 <= totalDataCount * 8) {
  749. buffer.put(0, 4);
  750. }
  751. while (buffer.getLengthInBits() % 8 != 0) {
  752. buffer.putBit(false);
  753. }
  754. while (true) {
  755. if (buffer.getLengthInBits() >= totalDataCount * 8) {
  756. break;
  757. }
  758. buffer.put(QRCodeModel.PAD0, 8);
  759. if (buffer.getLengthInBits() >= totalDataCount * 8) {
  760. break;
  761. }
  762. buffer.put(QRCodeModel.PAD1, 8);
  763. }
  764. return QRCodeModel.createBytes(buffer, rsBlocks);
  765. };
  766. QRCodeModel.createBytes = function (buffer, rsBlocks) {
  767. var offset = 0,
  768. maxDcCount = 0,
  769. maxEcCount = 0,
  770. dcData = new Array(rsBlocks.length),
  771. ecData = new Array(rsBlocks.length);
  772. for (var r = 0; r < rsBlocks.length; r++) {
  773. var dcCount = rsBlocks[r].dataCount,
  774. ecCount = rsBlocks[r].totalCount - dcCount;
  775. maxDcCount = Math.max(maxDcCount, dcCount);
  776. maxEcCount = Math.max(maxEcCount, ecCount);
  777. dcData[r] = new Array(dcCount);
  778. for (var _i13 = 0; _i13 < dcData[r].length; _i13++) {
  779. dcData[r][_i13] = 0xff & buffer.buffer[_i13 + offset];
  780. }
  781. offset += dcCount;
  782. var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount),
  783. rawPoly = new QRPolynomial(dcData[r], rsPoly.getLength() - 1),
  784. modPoly = rawPoly.mod(rsPoly);
  785. ecData[r] = new Array(rsPoly.getLength() - 1);
  786. for (var _i14 = 0; _i14 < ecData[r].length; _i14++) {
  787. var modIndex = _i14 + modPoly.getLength() - ecData[r].length;
  788. ecData[r][_i14] = modIndex >= 0 ? modPoly.get(modIndex) : 0;
  789. }
  790. }
  791. var totalCodeCount = 0;
  792. for (var _i15 = 0; _i15 < rsBlocks.length; _i15++) {
  793. totalCodeCount += rsBlocks[_i15].totalCount;
  794. }
  795. var data = new Array(totalCodeCount),
  796. index = 0;
  797. for (var _i16 = 0; _i16 < maxDcCount; _i16++) {
  798. for (var _r = 0; _r < rsBlocks.length; _r++) {
  799. if (_i16 < dcData[_r].length) {
  800. data[index++] = dcData[_r][_i16];
  801. }
  802. }
  803. }
  804. for (var _i17 = 0; _i17 < maxEcCount; _i17++) {
  805. for (var _r2 = 0; _r2 < rsBlocks.length; _r2++) {
  806. if (_i17 < ecData[_r2].length) {
  807. data[index++] = ecData[_r2][_i17];
  808. }
  809. }
  810. }
  811. return data;
  812. };
  813. /*
  814. * class QRPolynomial
  815. * */
  816. var QRPolynomial = /*#__PURE__*/function () {
  817. function QRPolynomial(num, shift) {
  818. (0, _classCallCheck2.default)(this, QRPolynomial);
  819. if (num.length == undefined) {
  820. //throw new Error(num.length + '/' + shift);
  821. throwError(num.length + '/' + shift);
  822. }
  823. var offset = 0;
  824. while (offset < num.length && num[offset] == 0) {
  825. offset++;
  826. }
  827. this.num = new Array(num.length - offset + shift);
  828. for (var _i18 = 0; _i18 < num.length - offset; _i18++) {
  829. this.num[_i18] = num[_i18 + offset];
  830. }
  831. }
  832. (0, _createClass2.default)(QRPolynomial, [{
  833. key: "get",
  834. value: function get(index) {
  835. return this.num[index];
  836. }
  837. }, {
  838. key: "getLength",
  839. value: function getLength() {
  840. return this.num.length;
  841. }
  842. }, {
  843. key: "multiply",
  844. value: function multiply(e) {
  845. var num = new Array(this.getLength() + e.getLength() - 1);
  846. for (var _i19 = 0; _i19 < this.getLength(); _i19++) {
  847. for (var j = 0; j < e.getLength(); j++) {
  848. num[_i19 + j] ^= QRMath.gexp(QRMath.glog(this.get(_i19)) + QRMath.glog(e.get(j)));
  849. }
  850. }
  851. return new QRPolynomial(num, 0);
  852. }
  853. }, {
  854. key: "mod",
  855. value: function mod(e) {
  856. if (this.getLength() - e.getLength() < 0) {
  857. return this;
  858. }
  859. var ratio = QRMath.glog(this.get(0)) - QRMath.glog(e.get(0)),
  860. num = new Array(this.getLength());
  861. for (var _i20 = 0; _i20 < this.getLength(); _i20++) {
  862. num[_i20] = this.get(_i20);
  863. }
  864. for (var _i21 = 0; _i21 < e.getLength(); _i21++) {
  865. num[_i21] ^= QRMath.gexp(QRMath.glog(e.get(_i21)) + ratio);
  866. }
  867. return new QRPolynomial(num, 0).mod(e);
  868. }
  869. }]);
  870. return QRPolynomial;
  871. }();
  872. /*
  873. * class QRRSBlock
  874. * */
  875. var QRRSBlock = /*#__PURE__*/(0, _createClass2.default)(function QRRSBlock(totalCount, dataCount) {
  876. (0, _classCallCheck2.default)(this, QRRSBlock);
  877. this.totalCount = totalCount;
  878. this.dataCount = dataCount;
  879. });
  880. QRRSBlock.RS_BLOCK_TABLE = [[1, 26, 19], [1, 26, 16], [1, 26, 13], [1, 26, 9], [1, 44, 34], [1, 44, 28], [1, 44, 22], [1, 44, 16], [1, 70, 55], [1, 70, 44], [2, 35, 17], [2, 35, 13], [1, 100, 80], [2, 50, 32], [2, 50, 24], [4, 25, 9], [1, 134, 108], [2, 67, 43], [2, 33, 15, 2, 34, 16], [2, 33, 11, 2, 34, 12], [2, 86, 68], [4, 43, 27], [4, 43, 19], [4, 43, 15], [2, 98, 78], [4, 49, 31], [2, 32, 14, 4, 33, 15], [4, 39, 13, 1, 40, 14], [2, 121, 97], [2, 60, 38, 2, 61, 39], [4, 40, 18, 2, 41, 19], [4, 40, 14, 2, 41, 15], [2, 146, 116], [3, 58, 36, 2, 59, 37], [4, 36, 16, 4, 37, 17], [4, 36, 12, 4, 37, 13], [2, 86, 68, 2, 87, 69], [4, 69, 43, 1, 70, 44], [6, 43, 19, 2, 44, 20], [6, 43, 15, 2, 44, 16], [4, 101, 81], [1, 80, 50, 4, 81, 51], [4, 50, 22, 4, 51, 23], [3, 36, 12, 8, 37, 13], [2, 116, 92, 2, 117, 93], [6, 58, 36, 2, 59, 37], [4, 46, 20, 6, 47, 21], [7, 42, 14, 4, 43, 15], [4, 133, 107], [8, 59, 37, 1, 60, 38], [8, 44, 20, 4, 45, 21], [12, 33, 11, 4, 34, 12], [3, 145, 115, 1, 146, 116], [4, 64, 40, 5, 65, 41], [11, 36, 16, 5, 37, 17], [11, 36, 12, 5, 37, 13], [5, 109, 87, 1, 110, 88], [5, 65, 41, 5, 66, 42], [5, 54, 24, 7, 55, 25], [11, 36, 12], [5, 122, 98, 1, 123, 99], [7, 73, 45, 3, 74, 46], [15, 43, 19, 2, 44, 20], [3, 45, 15, 13, 46, 16], [1, 135, 107, 5, 136, 108], [10, 74, 46, 1, 75, 47], [1, 50, 22, 15, 51, 23], [2, 42, 14, 17, 43, 15], [5, 150, 120, 1, 151, 121], [9, 69, 43, 4, 70, 44], [17, 50, 22, 1, 51, 23], [2, 42, 14, 19, 43, 15], [3, 141, 113, 4, 142, 114], [3, 70, 44, 11, 71, 45], [17, 47, 21, 4, 48, 22], [9, 39, 13, 16, 40, 14], [3, 135, 107, 5, 136, 108], [3, 67, 41, 13, 68, 42], [15, 54, 24, 5, 55, 25], [15, 43, 15, 10, 44, 16], [4, 144, 116, 4, 145, 117], [17, 68, 42], [17, 50, 22, 6, 51, 23], [19, 46, 16, 6, 47, 17], [2, 139, 111, 7, 140, 112], [17, 74, 46], [7, 54, 24, 16, 55, 25], [34, 37, 13], [4, 151, 121, 5, 152, 122], [4, 75, 47, 14, 76, 48], [11, 54, 24, 14, 55, 25], [16, 45, 15, 14, 46, 16], [6, 147, 117, 4, 148, 118], [6, 73, 45, 14, 74, 46], [11, 54, 24, 16, 55, 25], [30, 46, 16, 2, 47, 17], [8, 132, 106, 4, 133, 107], [8, 75, 47, 13, 76, 48], [7, 54, 24, 22, 55, 25], [22, 45, 15, 13, 46, 16], [10, 142, 114, 2, 143, 115], [19, 74, 46, 4, 75, 47], [28, 50, 22, 6, 51, 23], [33, 46, 16, 4, 47, 17], [8, 152, 122, 4, 153, 123], [22, 73, 45, 3, 74, 46], [8, 53, 23, 26, 54, 24], [12, 45, 15, 28, 46, 16], [3, 147, 117, 10, 148, 118], [3, 73, 45, 23, 74, 46], [4, 54, 24, 31, 55, 25], [11, 45, 15, 31, 46, 16], [7, 146, 116, 7, 147, 117], [21, 73, 45, 7, 74, 46], [1, 53, 23, 37, 54, 24], [19, 45, 15, 26, 46, 16], [5, 145, 115, 10, 146, 116], [19, 75, 47, 10, 76, 48], [15, 54, 24, 25, 55, 25], [23, 45, 15, 25, 46, 16], [13, 145, 115, 3, 146, 116], [2, 74, 46, 29, 75, 47], [42, 54, 24, 1, 55, 25], [23, 45, 15, 28, 46, 16], [17, 145, 115], [10, 74, 46, 23, 75, 47], [10, 54, 24, 35, 55, 25], [19, 45, 15, 35, 46, 16], [17, 145, 115, 1, 146, 116], [14, 74, 46, 21, 75, 47], [29, 54, 24, 19, 55, 25], [11, 45, 15, 46, 46, 16], [13, 145, 115, 6, 146, 116], [14, 74, 46, 23, 75, 47], [44, 54, 24, 7, 55, 25], [59, 46, 16, 1, 47, 17], [12, 151, 121, 7, 152, 122], [12, 75, 47, 26, 76, 48], [39, 54, 24, 14, 55, 25], [22, 45, 15, 41, 46, 16], [6, 151, 121, 14, 152, 122], [6, 75, 47, 34, 76, 48], [46, 54, 24, 10, 55, 25], [2, 45, 15, 64, 46, 16], [17, 152, 122, 4, 153, 123], [29, 74, 46, 14, 75, 47], [49, 54, 24, 10, 55, 25], [24, 45, 15, 46, 46, 16], [4, 152, 122, 18, 153, 123], [13, 74, 46, 32, 75, 47], [48, 54, 24, 14, 55, 25], [42, 45, 15, 32, 46, 16], [20, 147, 117, 4, 148, 118], [40, 75, 47, 7, 76, 48], [43, 54, 24, 22, 55, 25], [10, 45, 15, 67, 46, 16], [19, 148, 118, 6, 149, 119], [18, 75, 47, 31, 76, 48], [34, 54, 24, 34, 55, 25], [20, 45, 15, 61, 46, 16]];
  881. QRRSBlock.getRSBlocks = function (typeNumber, errorCorrectLevel) {
  882. var rsBlock = QRRSBlock.getRsBlockTable(typeNumber, errorCorrectLevel);
  883. if (!rsBlock) {
  884. //throw new Error("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + errorCorrectLevel);
  885. throwError("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + errorCorrectLevel);
  886. }
  887. var length = rsBlock.length / 3,
  888. list = [];
  889. for (var _i22 = 0; _i22 < length; _i22++) {
  890. var count = rsBlock[_i22 * 3],
  891. totalCount = rsBlock[_i22 * 3 + 1],
  892. dataCount = rsBlock[_i22 * 3 + 2];
  893. for (var j = 0; j < count; j++) {
  894. list.push(new QRRSBlock(totalCount, dataCount));
  895. }
  896. }
  897. return list;
  898. };
  899. QRRSBlock.getRsBlockTable = function (typeNumber, errorCorrectLevel) {
  900. switch (errorCorrectLevel) {
  901. case QRErrorCorrectLevel.L:
  902. return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4];
  903. case QRErrorCorrectLevel.M:
  904. return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 1];
  905. case QRErrorCorrectLevel.Q:
  906. return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 2];
  907. case QRErrorCorrectLevel.H:
  908. return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 3];
  909. default:
  910. return undefined;
  911. }
  912. };
  913. /*
  914. * class QRBitBuffer
  915. * */
  916. var QRBitBuffer = /*#__PURE__*/function () {
  917. function QRBitBuffer() {
  918. (0, _classCallCheck2.default)(this, QRBitBuffer);
  919. this.buffer = [];
  920. this.length = 0;
  921. }
  922. (0, _createClass2.default)(QRBitBuffer, [{
  923. key: "get",
  924. value: function get(index) {
  925. var bufIndex = Math.floor(index / 8);
  926. return (this.buffer[bufIndex] >>> 7 - index % 8 & 1) == 1;
  927. }
  928. }, {
  929. key: "put",
  930. value: function put(num, length) {
  931. for (var _i23 = 0; _i23 < length; _i23++) {
  932. this.putBit((num >>> length - _i23 - 1 & 1) == 1);
  933. }
  934. }
  935. }, {
  936. key: "getLengthInBits",
  937. value: function getLengthInBits() {
  938. return this.length;
  939. }
  940. }, {
  941. key: "putBit",
  942. value: function putBit(bit) {
  943. var bufIndex = Math.floor(this.length / 8);
  944. if (this.buffer.length <= bufIndex) {
  945. this.buffer.push(0);
  946. }
  947. if (bit) {
  948. this.buffer[bufIndex] |= 0x80 >>> this.length % 8;
  949. }
  950. this.length++;
  951. }
  952. }]);
  953. return QRBitBuffer;
  954. }();
  955. /*
  956. * Class Drawing
  957. * */
  958. var Drawing = /*#__PURE__*/function () {
  959. function Drawing(el, opts) {
  960. (0, _classCallCheck2.default)(this, Drawing);
  961. this._opts = opts;
  962. this._el = el;
  963. this._ctx = uni.createCanvasContext(el);
  964. }
  965. (0, _createClass2.default)(Drawing, [{
  966. key: "draw",
  967. value: function draw(QRCode) {
  968. var ctx = this._ctx,
  969. opts = this._opts;
  970. var ctxPosFix = opts.width / 20;
  971. //console.log(opts.width)
  972. var count = QRCode.getModuleCount(),
  973. width = (opts.width - 2 * ctxPosFix) / count,
  974. height = (opts.height - 2 * ctxPosFix) / count,
  975. roundedWidth = Math.round(width),
  976. roundedHeight = Math.round(height);
  977. this.clear();
  978. ctx.setFillStyle('#fff');
  979. ctx.fillRect(0, 0, this._opts.width + 4 * ctxPosFix, this._opts.width + 4 * ctxPosFix);
  980. for (var row = 0; row < count; row++) {
  981. for (var col = 0; col < count; col++) {
  982. var isDark = QRCode.isDark(row, col),
  983. left = col * width + ctxPosFix,
  984. top = row * height + ctxPosFix;
  985. ctx.setStrokeStyle(isDark ? opts.colorDark : opts.colorLight);
  986. ctx.setLineWidth(1);
  987. ctx.setFillStyle(isDark ? opts.colorDark : opts.colorLight);
  988. ctx.fillRect(left, top, width, height);
  989. ctx.strokeRect(Math.floor(left) + 0.5, Math.floor(top) + 0.5, roundedWidth, roundedHeight);
  990. ctx.strokeRect(Math.ceil(left) - 0.5, Math.ceil(top) - 0.5, roundedWidth, roundedHeight);
  991. }
  992. }
  993. this._opts.logo && this.drawImg(this._opts.logo, this._opts.width, ctx);
  994. ctx.draw();
  995. this._bIsPainted = true;
  996. if (this._opts.successTips && drawingOptsSuccessTips) {
  997. uni.hideLoading();
  998. uni.showToast({
  999. title: '生成成功',
  1000. icon: 'success',
  1001. duration: 1000
  1002. });
  1003. }
  1004. drawingOptsSuccessTips = true;
  1005. }
  1006. }, {
  1007. key: "clear",
  1008. value: function clear() {
  1009. this._ctx.clearRect(0, 0, this._opts.width, this._opts.height);
  1010. }
  1011. /** anlib **/
  1012. /**
  1013. * 二维码上添加图片
  1014. */
  1015. }, {
  1016. key: "drawImg",
  1017. value: function drawImg(src, width, ctx) {
  1018. // logo相对二维码的比例
  1019. var scale = 5;
  1020. // logo相对二维码的大小
  1021. var imgSize = width / scale;
  1022. // 偏移位置起始点
  1023. var imgPos = width / scale * 2;
  1024. // 二维码边框尺寸,这里设置为原宽度的80分之一
  1025. var imgPosFix = width / 80;
  1026. //console.log('width', width);
  1027. //console.log('imgSize', imgSize);
  1028. //console.log('imgPos', imgPos);
  1029. //console.log('imgPosFix', imgPosFix);
  1030. //console.log('src', src);
  1031. ctx.setFillStyle('#fff');
  1032. ctx.fillRect(imgPos - imgPosFix, imgPos - imgPosFix, imgSize + imgPosFix * 2, imgSize + imgPosFix * 2);
  1033. ctx.beginPath();
  1034. ctx.moveTo(imgPos - imgPosFix, imgPos - imgPosFix);
  1035. ctx.stroke();
  1036. ctx.closePath();
  1037. ctx.drawImage(src, imgPos, imgPos, imgSize, imgSize);
  1038. ctx.beginPath();
  1039. }
  1040. }]);
  1041. return Drawing;
  1042. }();
  1043. /*
  1044. * Class QRCode
  1045. * */
  1046. var QRCode = function () {
  1047. /**
  1048. * Get the type by string length
  1049. * @author anlib
  1050. * @private
  1051. * @param {String} text
  1052. * @param {Number} correctLevel
  1053. * @return {Number} type
  1054. */
  1055. function getTypeNumber(text, correctLevel) {
  1056. var type = 1,
  1057. length = getUTF8Length(text),
  1058. QRCodeLimitLength = [[17, 14, 11, 7], [32, 26, 20, 14], [53, 42, 32, 24], [78, 62, 46, 34], [106, 84, 60, 44], [134, 106, 74, 58], [154, 122, 86, 64], [192, 152, 108, 84], [230, 180, 130, 98], [271, 213, 151, 119], [321, 251, 177, 137], [367, 287, 203, 155], [425, 331, 241, 177], [458, 362, 258, 194], [520, 412, 292, 220], [586, 450, 322, 250], [644, 504, 364, 280], [718, 560, 394, 310], [792, 624, 442, 338], [858, 666, 482, 382], [929, 711, 509, 403], [1003, 779, 565, 439], [1091, 857, 611, 461], [1171, 911, 661, 511], [1273, 997, 715, 535], [1367, 1059, 751, 593], [1465, 1125, 805, 625], [1528, 1190, 868, 658], [1628, 1264, 908, 698], [1732, 1370, 982, 742], [1840, 1452, 1030, 790], [1952, 1538, 1112, 842], [2068, 1628, 1168, 898], [2188, 1722, 1228, 958], [2303, 1809, 1283, 983], [2431, 1911, 1351, 1051], [2563, 1989, 1423, 1093], [2699, 2099, 1499, 1139], [2809, 2213, 1579, 1219], [2953, 2331, 1663, 1273]];
  1059. for (var _i24 = 0, len = QRCodeLimitLength.length; _i24 <= len; _i24++) {
  1060. var limit = 0;
  1061. switch (correctLevel) {
  1062. case QRErrorCorrectLevel.L:
  1063. limit = QRCodeLimitLength[_i24][0];
  1064. break;
  1065. case QRErrorCorrectLevel.M:
  1066. limit = QRCodeLimitLength[_i24][1];
  1067. break;
  1068. case QRErrorCorrectLevel.Q:
  1069. limit = QRCodeLimitLength[_i24][2];
  1070. break;
  1071. case QRErrorCorrectLevel.H:
  1072. limit = QRCodeLimitLength[_i24][3];
  1073. break;
  1074. }
  1075. if (length <= limit) {
  1076. break;
  1077. } else {
  1078. type++;
  1079. }
  1080. }
  1081. if (type > QRCodeLimitLength.length) {
  1082. // throw new Error('Too long data'); //supfire
  1083. throwError('Too long data');
  1084. }
  1085. return type;
  1086. }
  1087. function getUTF8Length(text) {
  1088. var replacedText = encodeURI(text).toString().replace(/\%[0-9a-fA-F]{2}/g, 'a');
  1089. return replacedText.length + (replacedText.length != text ? 3 : 0);
  1090. }
  1091. var Fn = /*#__PURE__*/function () {
  1092. function Fn(el, opts) {
  1093. (0, _classCallCheck2.default)(this, Fn);
  1094. this._opts = {
  1095. width: 300,
  1096. height: 300,
  1097. typeNumber: 4,
  1098. colorDark: '#000000',
  1099. colorLight: '#ffffff',
  1100. correctLevel: Fn.correctLevel.H,
  1101. logo: false,
  1102. successTips: false
  1103. };
  1104. if (typeof opts === 'string') {
  1105. opts = {
  1106. text: opts
  1107. };
  1108. }
  1109. // Overwrites options 简单拷贝
  1110. if (opts) {
  1111. for (var _i25 in opts) {
  1112. if (opts.hasOwnProperty(_i25)) {
  1113. this._opts[_i25] = opts[_i25];
  1114. }
  1115. }
  1116. }
  1117. this._el = el;
  1118. this._QRCode = null;
  1119. this._drawing = new Drawing(this._el, this._opts);
  1120. if (this._opts.text) {
  1121. this.makeCode(this._opts.text);
  1122. }
  1123. }
  1124. (0, _createClass2.default)(Fn, [{
  1125. key: "makeCode",
  1126. value: function makeCode(text) {
  1127. this._QRCode = new QRCodeModel(getTypeNumber(text, this._opts.correctLevel), this._opts.correctLevel);
  1128. this._QRCode.addData(text);
  1129. this._QRCode.make();
  1130. this._drawing.draw(this._QRCode);
  1131. }
  1132. }, {
  1133. key: "clear",
  1134. value: function clear() {
  1135. this._drawing.clear();
  1136. }
  1137. }]);
  1138. return Fn;
  1139. }();
  1140. Fn.correctLevel = QRErrorCorrectLevel;
  1141. return Fn;
  1142. }();
  1143. /** anlib **/
  1144. var drawingOptsSuccessTips = true;
  1145. /**
  1146. * 抛出错误
  1147. */
  1148. function throwError(str) {
  1149. uni.hideLoading();
  1150. uni.showToast({
  1151. title: '有字符暂不支持',
  1152. icon: 'none',
  1153. duration: 2000
  1154. });
  1155. drawingOptsSuccessTips = false;
  1156. //throw new Error(str);
  1157. }
  1158. var _default = QRCode;
  1159. exports.default = _default;
  1160. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  1161. /***/ }),
  1162. /***/ 18:
  1163. /*!******************************************************************!*\
  1164. !*** ./node_modules/@babel/runtime/helpers/toConsumableArray.js ***!
  1165. \******************************************************************/
  1166. /*! no static exports found */
  1167. /***/ (function(module, exports, __webpack_require__) {
  1168. var arrayWithoutHoles = __webpack_require__(/*! ./arrayWithoutHoles.js */ 19);
  1169. var iterableToArray = __webpack_require__(/*! ./iterableToArray.js */ 20);
  1170. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  1171. var nonIterableSpread = __webpack_require__(/*! ./nonIterableSpread.js */ 21);
  1172. function _toConsumableArray(arr) {
  1173. return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
  1174. }
  1175. module.exports = _toConsumableArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1176. /***/ }),
  1177. /***/ 19:
  1178. /*!******************************************************************!*\
  1179. !*** ./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js ***!
  1180. \******************************************************************/
  1181. /*! no static exports found */
  1182. /***/ (function(module, exports, __webpack_require__) {
  1183. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  1184. function _arrayWithoutHoles(arr) {
  1185. if (Array.isArray(arr)) return arrayLikeToArray(arr);
  1186. }
  1187. module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1188. /***/ }),
  1189. /***/ 2:
  1190. /*!************************************************************!*\
  1191. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  1192. \************************************************************/
  1193. /*! no static exports found */
  1194. /***/ (function(module, exports, __webpack_require__) {
  1195. "use strict";
  1196. /* WEBPACK VAR INJECTION */(function(wx, global) {
  1197. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  1198. Object.defineProperty(exports, "__esModule", {
  1199. value: true
  1200. });
  1201. exports.createApp = createApp;
  1202. exports.createComponent = createComponent;
  1203. exports.createPage = createPage;
  1204. exports.createPlugin = createPlugin;
  1205. exports.createSubpackageApp = createSubpackageApp;
  1206. exports.default = void 0;
  1207. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  1208. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  1209. var _construct2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/construct */ 15));
  1210. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
  1211. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  1212. var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 22);
  1213. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 25));
  1214. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
  1215. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
  1216. var realAtob;
  1217. var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  1218. var b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  1219. if (typeof atob !== 'function') {
  1220. realAtob = function realAtob(str) {
  1221. str = String(str).replace(/[\t\n\f\r ]+/g, '');
  1222. if (!b64re.test(str)) {
  1223. throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  1224. }
  1225. // Adding the padding if missing, for semplicity
  1226. str += '=='.slice(2 - (str.length & 3));
  1227. var bitmap;
  1228. var result = '';
  1229. var r1;
  1230. var r2;
  1231. var i = 0;
  1232. for (; i < str.length;) {
  1233. bitmap = b64.indexOf(str.charAt(i++)) << 18 | b64.indexOf(str.charAt(i++)) << 12 | (r1 = b64.indexOf(str.charAt(i++))) << 6 | (r2 = b64.indexOf(str.charAt(i++)));
  1234. result += r1 === 64 ? String.fromCharCode(bitmap >> 16 & 255) : r2 === 64 ? String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255) : String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255);
  1235. }
  1236. return result;
  1237. };
  1238. } else {
  1239. // 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法
  1240. realAtob = atob;
  1241. }
  1242. function b64DecodeUnicode(str) {
  1243. return decodeURIComponent(realAtob(str).split('').map(function (c) {
  1244. return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
  1245. }).join(''));
  1246. }
  1247. function getCurrentUserInfo() {
  1248. var token = wx.getStorageSync('uni_id_token') || '';
  1249. var tokenArr = token.split('.');
  1250. if (!token || tokenArr.length !== 3) {
  1251. return {
  1252. uid: null,
  1253. role: [],
  1254. permission: [],
  1255. tokenExpired: 0
  1256. };
  1257. }
  1258. var userInfo;
  1259. try {
  1260. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  1261. } catch (error) {
  1262. throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message);
  1263. }
  1264. userInfo.tokenExpired = userInfo.exp * 1000;
  1265. delete userInfo.exp;
  1266. delete userInfo.iat;
  1267. return userInfo;
  1268. }
  1269. function uniIdMixin(Vue) {
  1270. Vue.prototype.uniIDHasRole = function (roleId) {
  1271. var _getCurrentUserInfo = getCurrentUserInfo(),
  1272. role = _getCurrentUserInfo.role;
  1273. return role.indexOf(roleId) > -1;
  1274. };
  1275. Vue.prototype.uniIDHasPermission = function (permissionId) {
  1276. var _getCurrentUserInfo2 = getCurrentUserInfo(),
  1277. permission = _getCurrentUserInfo2.permission;
  1278. return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1;
  1279. };
  1280. Vue.prototype.uniIDTokenValid = function () {
  1281. var _getCurrentUserInfo3 = getCurrentUserInfo(),
  1282. tokenExpired = _getCurrentUserInfo3.tokenExpired;
  1283. return tokenExpired > Date.now();
  1284. };
  1285. }
  1286. var _toString = Object.prototype.toString;
  1287. var hasOwnProperty = Object.prototype.hasOwnProperty;
  1288. function isFn(fn) {
  1289. return typeof fn === 'function';
  1290. }
  1291. function isStr(str) {
  1292. return typeof str === 'string';
  1293. }
  1294. function isObject(obj) {
  1295. return obj !== null && (0, _typeof2.default)(obj) === 'object';
  1296. }
  1297. function isPlainObject(obj) {
  1298. return _toString.call(obj) === '[object Object]';
  1299. }
  1300. function hasOwn(obj, key) {
  1301. return hasOwnProperty.call(obj, key);
  1302. }
  1303. function noop() {}
  1304. /**
  1305. * Create a cached version of a pure function.
  1306. */
  1307. function cached(fn) {
  1308. var cache = Object.create(null);
  1309. return function cachedFn(str) {
  1310. var hit = cache[str];
  1311. return hit || (cache[str] = fn(str));
  1312. };
  1313. }
  1314. /**
  1315. * Camelize a hyphen-delimited string.
  1316. */
  1317. var camelizeRE = /-(\w)/g;
  1318. var camelize = cached(function (str) {
  1319. return str.replace(camelizeRE, function (_, c) {
  1320. return c ? c.toUpperCase() : '';
  1321. });
  1322. });
  1323. function sortObject(obj) {
  1324. var sortObj = {};
  1325. if (isPlainObject(obj)) {
  1326. Object.keys(obj).sort().forEach(function (key) {
  1327. sortObj[key] = obj[key];
  1328. });
  1329. }
  1330. return !Object.keys(sortObj) ? obj : sortObj;
  1331. }
  1332. var HOOKS = ['invoke', 'success', 'fail', 'complete', 'returnValue'];
  1333. var globalInterceptors = {};
  1334. var scopedInterceptors = {};
  1335. function mergeHook(parentVal, childVal) {
  1336. var res = childVal ? parentVal ? parentVal.concat(childVal) : Array.isArray(childVal) ? childVal : [childVal] : parentVal;
  1337. return res ? dedupeHooks(res) : res;
  1338. }
  1339. function dedupeHooks(hooks) {
  1340. var res = [];
  1341. for (var i = 0; i < hooks.length; i++) {
  1342. if (res.indexOf(hooks[i]) === -1) {
  1343. res.push(hooks[i]);
  1344. }
  1345. }
  1346. return res;
  1347. }
  1348. function removeHook(hooks, hook) {
  1349. var index = hooks.indexOf(hook);
  1350. if (index !== -1) {
  1351. hooks.splice(index, 1);
  1352. }
  1353. }
  1354. function mergeInterceptorHook(interceptor, option) {
  1355. Object.keys(option).forEach(function (hook) {
  1356. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  1357. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  1358. }
  1359. });
  1360. }
  1361. function removeInterceptorHook(interceptor, option) {
  1362. if (!interceptor || !option) {
  1363. return;
  1364. }
  1365. Object.keys(option).forEach(function (hook) {
  1366. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  1367. removeHook(interceptor[hook], option[hook]);
  1368. }
  1369. });
  1370. }
  1371. function addInterceptor(method, option) {
  1372. if (typeof method === 'string' && isPlainObject(option)) {
  1373. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  1374. } else if (isPlainObject(method)) {
  1375. mergeInterceptorHook(globalInterceptors, method);
  1376. }
  1377. }
  1378. function removeInterceptor(method, option) {
  1379. if (typeof method === 'string') {
  1380. if (isPlainObject(option)) {
  1381. removeInterceptorHook(scopedInterceptors[method], option);
  1382. } else {
  1383. delete scopedInterceptors[method];
  1384. }
  1385. } else if (isPlainObject(method)) {
  1386. removeInterceptorHook(globalInterceptors, method);
  1387. }
  1388. }
  1389. function wrapperHook(hook, params) {
  1390. return function (data) {
  1391. return hook(data, params) || data;
  1392. };
  1393. }
  1394. function isPromise(obj) {
  1395. return !!obj && ((0, _typeof2.default)(obj) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  1396. }
  1397. function queue(hooks, data, params) {
  1398. var promise = false;
  1399. for (var i = 0; i < hooks.length; i++) {
  1400. var hook = hooks[i];
  1401. if (promise) {
  1402. promise = Promise.resolve(wrapperHook(hook, params));
  1403. } else {
  1404. var res = hook(data, params);
  1405. if (isPromise(res)) {
  1406. promise = Promise.resolve(res);
  1407. }
  1408. if (res === false) {
  1409. return {
  1410. then: function then() {}
  1411. };
  1412. }
  1413. }
  1414. }
  1415. return promise || {
  1416. then: function then(callback) {
  1417. return callback(data);
  1418. }
  1419. };
  1420. }
  1421. function wrapperOptions(interceptor) {
  1422. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  1423. ['success', 'fail', 'complete'].forEach(function (name) {
  1424. if (Array.isArray(interceptor[name])) {
  1425. var oldCallback = options[name];
  1426. options[name] = function callbackInterceptor(res) {
  1427. queue(interceptor[name], res, options).then(function (res) {
  1428. /* eslint-disable no-mixed-operators */
  1429. return isFn(oldCallback) && oldCallback(res) || res;
  1430. });
  1431. };
  1432. }
  1433. });
  1434. return options;
  1435. }
  1436. function wrapperReturnValue(method, returnValue) {
  1437. var returnValueHooks = [];
  1438. if (Array.isArray(globalInterceptors.returnValue)) {
  1439. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(globalInterceptors.returnValue));
  1440. }
  1441. var interceptor = scopedInterceptors[method];
  1442. if (interceptor && Array.isArray(interceptor.returnValue)) {
  1443. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(interceptor.returnValue));
  1444. }
  1445. returnValueHooks.forEach(function (hook) {
  1446. returnValue = hook(returnValue) || returnValue;
  1447. });
  1448. return returnValue;
  1449. }
  1450. function getApiInterceptorHooks(method) {
  1451. var interceptor = Object.create(null);
  1452. Object.keys(globalInterceptors).forEach(function (hook) {
  1453. if (hook !== 'returnValue') {
  1454. interceptor[hook] = globalInterceptors[hook].slice();
  1455. }
  1456. });
  1457. var scopedInterceptor = scopedInterceptors[method];
  1458. if (scopedInterceptor) {
  1459. Object.keys(scopedInterceptor).forEach(function (hook) {
  1460. if (hook !== 'returnValue') {
  1461. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  1462. }
  1463. });
  1464. }
  1465. return interceptor;
  1466. }
  1467. function invokeApi(method, api, options) {
  1468. for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
  1469. params[_key - 3] = arguments[_key];
  1470. }
  1471. var interceptor = getApiInterceptorHooks(method);
  1472. if (interceptor && Object.keys(interceptor).length) {
  1473. if (Array.isArray(interceptor.invoke)) {
  1474. var res = queue(interceptor.invoke, options);
  1475. return res.then(function (options) {
  1476. // 重新访问 getApiInterceptorHooks, 允许 invoke 中再次调用 addInterceptor,removeInterceptor
  1477. return api.apply(void 0, [wrapperOptions(getApiInterceptorHooks(method), options)].concat(params));
  1478. });
  1479. } else {
  1480. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  1481. }
  1482. }
  1483. return api.apply(void 0, [options].concat(params));
  1484. }
  1485. var promiseInterceptor = {
  1486. returnValue: function returnValue(res) {
  1487. if (!isPromise(res)) {
  1488. return res;
  1489. }
  1490. return new Promise(function (resolve, reject) {
  1491. res.then(function (res) {
  1492. if (res[0]) {
  1493. reject(res[0]);
  1494. } else {
  1495. resolve(res[1]);
  1496. }
  1497. });
  1498. });
  1499. }
  1500. };
  1501. var SYNC_API_RE = /^\$|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback|getWindowInfo|getDeviceInfo|getAppBaseInfo|getSystemSetting|getAppAuthorizeSetting|initUTS|requireUTS|registerUTS/;
  1502. var CONTEXT_API_RE = /^create|Manager$/;
  1503. // Context例外情况
  1504. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  1505. // 同步例外情况
  1506. var ASYNC_API = ['createBLEConnection', 'createPushMessage'];
  1507. var CALLBACK_API_RE = /^on|^off/;
  1508. function isContextApi(name) {
  1509. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  1510. }
  1511. function isSyncApi(name) {
  1512. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  1513. }
  1514. function isCallbackApi(name) {
  1515. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  1516. }
  1517. function handlePromise(promise) {
  1518. return promise.then(function (data) {
  1519. return [null, data];
  1520. }).catch(function (err) {
  1521. return [err];
  1522. });
  1523. }
  1524. function shouldPromise(name) {
  1525. if (isContextApi(name) || isSyncApi(name) || isCallbackApi(name)) {
  1526. return false;
  1527. }
  1528. return true;
  1529. }
  1530. /* eslint-disable no-extend-native */
  1531. if (!Promise.prototype.finally) {
  1532. Promise.prototype.finally = function (callback) {
  1533. var promise = this.constructor;
  1534. return this.then(function (value) {
  1535. return promise.resolve(callback()).then(function () {
  1536. return value;
  1537. });
  1538. }, function (reason) {
  1539. return promise.resolve(callback()).then(function () {
  1540. throw reason;
  1541. });
  1542. });
  1543. };
  1544. }
  1545. function promisify(name, api) {
  1546. if (!shouldPromise(name) || !isFn(api)) {
  1547. return api;
  1548. }
  1549. return function promiseApi() {
  1550. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1551. for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  1552. params[_key2 - 1] = arguments[_key2];
  1553. }
  1554. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  1555. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  1556. }
  1557. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  1558. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  1559. success: resolve,
  1560. fail: reject
  1561. })].concat(params));
  1562. })));
  1563. };
  1564. }
  1565. var EPS = 1e-4;
  1566. var BASE_DEVICE_WIDTH = 750;
  1567. var isIOS = false;
  1568. var deviceWidth = 0;
  1569. var deviceDPR = 0;
  1570. function checkDeviceWidth() {
  1571. var _wx$getSystemInfoSync = wx.getSystemInfoSync(),
  1572. platform = _wx$getSystemInfoSync.platform,
  1573. pixelRatio = _wx$getSystemInfoSync.pixelRatio,
  1574. windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  1575. deviceWidth = windowWidth;
  1576. deviceDPR = pixelRatio;
  1577. isIOS = platform === 'ios';
  1578. }
  1579. function upx2px(number, newDeviceWidth) {
  1580. if (deviceWidth === 0) {
  1581. checkDeviceWidth();
  1582. }
  1583. number = Number(number);
  1584. if (number === 0) {
  1585. return 0;
  1586. }
  1587. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  1588. if (result < 0) {
  1589. result = -result;
  1590. }
  1591. result = Math.floor(result + EPS);
  1592. if (result === 0) {
  1593. if (deviceDPR === 1 || !isIOS) {
  1594. result = 1;
  1595. } else {
  1596. result = 0.5;
  1597. }
  1598. }
  1599. return number < 0 ? -result : result;
  1600. }
  1601. var LOCALE_ZH_HANS = 'zh-Hans';
  1602. var LOCALE_ZH_HANT = 'zh-Hant';
  1603. var LOCALE_EN = 'en';
  1604. var LOCALE_FR = 'fr';
  1605. var LOCALE_ES = 'es';
  1606. var messages = {};
  1607. var locale;
  1608. {
  1609. locale = normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  1610. }
  1611. function initI18nMessages() {
  1612. if (!isEnableLocale()) {
  1613. return;
  1614. }
  1615. var localeKeys = Object.keys(__uniConfig.locales);
  1616. if (localeKeys.length) {
  1617. localeKeys.forEach(function (locale) {
  1618. var curMessages = messages[locale];
  1619. var userMessages = __uniConfig.locales[locale];
  1620. if (curMessages) {
  1621. Object.assign(curMessages, userMessages);
  1622. } else {
  1623. messages[locale] = userMessages;
  1624. }
  1625. });
  1626. }
  1627. }
  1628. initI18nMessages();
  1629. var i18n = (0, _uniI18n.initVueI18n)(locale, {});
  1630. var t = i18n.t;
  1631. var i18nMixin = i18n.mixin = {
  1632. beforeCreate: function beforeCreate() {
  1633. var _this = this;
  1634. var unwatch = i18n.i18n.watchLocale(function () {
  1635. _this.$forceUpdate();
  1636. });
  1637. this.$once('hook:beforeDestroy', function () {
  1638. unwatch();
  1639. });
  1640. },
  1641. methods: {
  1642. $$t: function $$t(key, values) {
  1643. return t(key, values);
  1644. }
  1645. }
  1646. };
  1647. var setLocale = i18n.setLocale;
  1648. var getLocale = i18n.getLocale;
  1649. function initAppLocale(Vue, appVm, locale) {
  1650. var state = Vue.observable({
  1651. locale: locale || i18n.getLocale()
  1652. });
  1653. var localeWatchers = [];
  1654. appVm.$watchLocale = function (fn) {
  1655. localeWatchers.push(fn);
  1656. };
  1657. Object.defineProperty(appVm, '$locale', {
  1658. get: function get() {
  1659. return state.locale;
  1660. },
  1661. set: function set(v) {
  1662. state.locale = v;
  1663. localeWatchers.forEach(function (watch) {
  1664. return watch(v);
  1665. });
  1666. }
  1667. });
  1668. }
  1669. function isEnableLocale() {
  1670. return typeof __uniConfig !== 'undefined' && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length;
  1671. }
  1672. function include(str, parts) {
  1673. return !!parts.find(function (part) {
  1674. return str.indexOf(part) !== -1;
  1675. });
  1676. }
  1677. function startsWith(str, parts) {
  1678. return parts.find(function (part) {
  1679. return str.indexOf(part) === 0;
  1680. });
  1681. }
  1682. function normalizeLocale(locale, messages) {
  1683. if (!locale) {
  1684. return;
  1685. }
  1686. locale = locale.trim().replace(/_/g, '-');
  1687. if (messages && messages[locale]) {
  1688. return locale;
  1689. }
  1690. locale = locale.toLowerCase();
  1691. if (locale === 'chinese') {
  1692. // 支付宝
  1693. return LOCALE_ZH_HANS;
  1694. }
  1695. if (locale.indexOf('zh') === 0) {
  1696. if (locale.indexOf('-hans') > -1) {
  1697. return LOCALE_ZH_HANS;
  1698. }
  1699. if (locale.indexOf('-hant') > -1) {
  1700. return LOCALE_ZH_HANT;
  1701. }
  1702. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  1703. return LOCALE_ZH_HANT;
  1704. }
  1705. return LOCALE_ZH_HANS;
  1706. }
  1707. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  1708. if (lang) {
  1709. return lang;
  1710. }
  1711. }
  1712. // export function initI18n() {
  1713. // const localeKeys = Object.keys(__uniConfig.locales || {})
  1714. // if (localeKeys.length) {
  1715. // localeKeys.forEach((locale) =>
  1716. // i18n.add(locale, __uniConfig.locales[locale])
  1717. // )
  1718. // }
  1719. // }
  1720. function getLocale$1() {
  1721. // 优先使用 $locale
  1722. if (isFn(getApp)) {
  1723. var app = getApp({
  1724. allowDefault: true
  1725. });
  1726. if (app && app.$vm) {
  1727. return app.$vm.$locale;
  1728. }
  1729. }
  1730. return normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  1731. }
  1732. function setLocale$1(locale) {
  1733. var app = isFn(getApp) ? getApp() : false;
  1734. if (!app) {
  1735. return false;
  1736. }
  1737. var oldLocale = app.$vm.$locale;
  1738. if (oldLocale !== locale) {
  1739. app.$vm.$locale = locale;
  1740. onLocaleChangeCallbacks.forEach(function (fn) {
  1741. return fn({
  1742. locale: locale
  1743. });
  1744. });
  1745. return true;
  1746. }
  1747. return false;
  1748. }
  1749. var onLocaleChangeCallbacks = [];
  1750. function onLocaleChange(fn) {
  1751. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  1752. onLocaleChangeCallbacks.push(fn);
  1753. }
  1754. }
  1755. if (typeof global !== 'undefined') {
  1756. global.getLocale = getLocale$1;
  1757. }
  1758. var interceptors = {
  1759. promiseInterceptor: promiseInterceptor
  1760. };
  1761. var baseApi = /*#__PURE__*/Object.freeze({
  1762. __proto__: null,
  1763. upx2px: upx2px,
  1764. getLocale: getLocale$1,
  1765. setLocale: setLocale$1,
  1766. onLocaleChange: onLocaleChange,
  1767. addInterceptor: addInterceptor,
  1768. removeInterceptor: removeInterceptor,
  1769. interceptors: interceptors
  1770. });
  1771. function findExistsPageIndex(url) {
  1772. var pages = getCurrentPages();
  1773. var len = pages.length;
  1774. while (len--) {
  1775. var page = pages[len];
  1776. if (page.$page && page.$page.fullPath === url) {
  1777. return len;
  1778. }
  1779. }
  1780. return -1;
  1781. }
  1782. var redirectTo = {
  1783. name: function name(fromArgs) {
  1784. if (fromArgs.exists === 'back' && fromArgs.delta) {
  1785. return 'navigateBack';
  1786. }
  1787. return 'redirectTo';
  1788. },
  1789. args: function args(fromArgs) {
  1790. if (fromArgs.exists === 'back' && fromArgs.url) {
  1791. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  1792. if (existsPageIndex !== -1) {
  1793. var delta = getCurrentPages().length - 1 - existsPageIndex;
  1794. if (delta > 0) {
  1795. fromArgs.delta = delta;
  1796. }
  1797. }
  1798. }
  1799. }
  1800. };
  1801. var previewImage = {
  1802. args: function args(fromArgs) {
  1803. var currentIndex = parseInt(fromArgs.current);
  1804. if (isNaN(currentIndex)) {
  1805. return;
  1806. }
  1807. var urls = fromArgs.urls;
  1808. if (!Array.isArray(urls)) {
  1809. return;
  1810. }
  1811. var len = urls.length;
  1812. if (!len) {
  1813. return;
  1814. }
  1815. if (currentIndex < 0) {
  1816. currentIndex = 0;
  1817. } else if (currentIndex >= len) {
  1818. currentIndex = len - 1;
  1819. }
  1820. if (currentIndex > 0) {
  1821. fromArgs.current = urls[currentIndex];
  1822. fromArgs.urls = urls.filter(function (item, index) {
  1823. return index < currentIndex ? item !== urls[currentIndex] : true;
  1824. });
  1825. } else {
  1826. fromArgs.current = urls[0];
  1827. }
  1828. return {
  1829. indicator: false,
  1830. loop: false
  1831. };
  1832. }
  1833. };
  1834. var UUID_KEY = '__DC_STAT_UUID';
  1835. var deviceId;
  1836. function useDeviceId(result) {
  1837. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  1838. if (!deviceId) {
  1839. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  1840. wx.setStorage({
  1841. key: UUID_KEY,
  1842. data: deviceId
  1843. });
  1844. }
  1845. result.deviceId = deviceId;
  1846. }
  1847. function addSafeAreaInsets(result) {
  1848. if (result.safeArea) {
  1849. var safeArea = result.safeArea;
  1850. result.safeAreaInsets = {
  1851. top: safeArea.top,
  1852. left: safeArea.left,
  1853. right: result.windowWidth - safeArea.right,
  1854. bottom: result.screenHeight - safeArea.bottom
  1855. };
  1856. }
  1857. }
  1858. function populateParameters(result) {
  1859. var _result$brand = result.brand,
  1860. brand = _result$brand === void 0 ? '' : _result$brand,
  1861. _result$model = result.model,
  1862. model = _result$model === void 0 ? '' : _result$model,
  1863. _result$system = result.system,
  1864. system = _result$system === void 0 ? '' : _result$system,
  1865. _result$language = result.language,
  1866. language = _result$language === void 0 ? '' : _result$language,
  1867. theme = result.theme,
  1868. version = result.version,
  1869. platform = result.platform,
  1870. fontSizeSetting = result.fontSizeSetting,
  1871. SDKVersion = result.SDKVersion,
  1872. pixelRatio = result.pixelRatio,
  1873. deviceOrientation = result.deviceOrientation;
  1874. // const isQuickApp = "mp-weixin".indexOf('quickapp-webview') !== -1
  1875. var extraParam = {};
  1876. // osName osVersion
  1877. var osName = '';
  1878. var osVersion = '';
  1879. {
  1880. osName = system.split(' ')[0] || '';
  1881. osVersion = system.split(' ')[1] || '';
  1882. }
  1883. var hostVersion = version;
  1884. // deviceType
  1885. var deviceType = getGetDeviceType(result, model);
  1886. // deviceModel
  1887. var deviceBrand = getDeviceBrand(brand);
  1888. // hostName
  1889. var _hostName = getHostName(result);
  1890. // deviceOrientation
  1891. var _deviceOrientation = deviceOrientation; // 仅 微信 百度 支持
  1892. // devicePixelRatio
  1893. var _devicePixelRatio = pixelRatio;
  1894. // SDKVersion
  1895. var _SDKVersion = SDKVersion;
  1896. // hostLanguage
  1897. var hostLanguage = language.replace(/_/g, '-');
  1898. // wx.getAccountInfoSync
  1899. var parameters = {
  1900. appId: "__UNI__1C40FB4",
  1901. appName: "房票科技",
  1902. appVersion: "1.0.0",
  1903. appVersionCode: "100",
  1904. appLanguage: getAppLanguage(hostLanguage),
  1905. uniCompileVersion: "3.8.12",
  1906. uniRuntimeVersion: "3.8.12",
  1907. uniPlatform: undefined || "mp-weixin",
  1908. deviceBrand: deviceBrand,
  1909. deviceModel: model,
  1910. deviceType: deviceType,
  1911. devicePixelRatio: _devicePixelRatio,
  1912. deviceOrientation: _deviceOrientation,
  1913. osName: osName.toLocaleLowerCase(),
  1914. osVersion: osVersion,
  1915. hostTheme: theme,
  1916. hostVersion: hostVersion,
  1917. hostLanguage: hostLanguage,
  1918. hostName: _hostName,
  1919. hostSDKVersion: _SDKVersion,
  1920. hostFontSizeSetting: fontSizeSetting,
  1921. windowTop: 0,
  1922. windowBottom: 0,
  1923. // TODO
  1924. osLanguage: undefined,
  1925. osTheme: undefined,
  1926. ua: undefined,
  1927. hostPackageName: undefined,
  1928. browserName: undefined,
  1929. browserVersion: undefined
  1930. };
  1931. Object.assign(result, parameters, extraParam);
  1932. }
  1933. function getGetDeviceType(result, model) {
  1934. var deviceType = result.deviceType || 'phone';
  1935. {
  1936. var deviceTypeMaps = {
  1937. ipad: 'pad',
  1938. windows: 'pc',
  1939. mac: 'pc'
  1940. };
  1941. var deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
  1942. var _model = model.toLocaleLowerCase();
  1943. for (var index = 0; index < deviceTypeMapsKeys.length; index++) {
  1944. var _m = deviceTypeMapsKeys[index];
  1945. if (_model.indexOf(_m) !== -1) {
  1946. deviceType = deviceTypeMaps[_m];
  1947. break;
  1948. }
  1949. }
  1950. }
  1951. return deviceType;
  1952. }
  1953. function getDeviceBrand(brand) {
  1954. var deviceBrand = brand;
  1955. if (deviceBrand) {
  1956. deviceBrand = brand.toLocaleLowerCase();
  1957. }
  1958. return deviceBrand;
  1959. }
  1960. function getAppLanguage(defaultLanguage) {
  1961. return getLocale$1 ? getLocale$1() : defaultLanguage;
  1962. }
  1963. function getHostName(result) {
  1964. var _platform = 'WeChat';
  1965. var _hostName = result.hostName || _platform; // mp-jd
  1966. {
  1967. if (result.environment) {
  1968. _hostName = result.environment;
  1969. } else if (result.host && result.host.env) {
  1970. _hostName = result.host.env;
  1971. }
  1972. }
  1973. return _hostName;
  1974. }
  1975. var getSystemInfo = {
  1976. returnValue: function returnValue(result) {
  1977. useDeviceId(result);
  1978. addSafeAreaInsets(result);
  1979. populateParameters(result);
  1980. }
  1981. };
  1982. var showActionSheet = {
  1983. args: function args(fromArgs) {
  1984. if ((0, _typeof2.default)(fromArgs) === 'object') {
  1985. fromArgs.alertText = fromArgs.title;
  1986. }
  1987. }
  1988. };
  1989. var getAppBaseInfo = {
  1990. returnValue: function returnValue(result) {
  1991. var _result = result,
  1992. version = _result.version,
  1993. language = _result.language,
  1994. SDKVersion = _result.SDKVersion,
  1995. theme = _result.theme;
  1996. var _hostName = getHostName(result);
  1997. var hostLanguage = language.replace('_', '-');
  1998. result = sortObject(Object.assign(result, {
  1999. appId: "__UNI__1C40FB4",
  2000. appName: "房票科技",
  2001. appVersion: "1.0.0",
  2002. appVersionCode: "100",
  2003. appLanguage: getAppLanguage(hostLanguage),
  2004. hostVersion: version,
  2005. hostLanguage: hostLanguage,
  2006. hostName: _hostName,
  2007. hostSDKVersion: SDKVersion,
  2008. hostTheme: theme
  2009. }));
  2010. }
  2011. };
  2012. var getDeviceInfo = {
  2013. returnValue: function returnValue(result) {
  2014. var _result2 = result,
  2015. brand = _result2.brand,
  2016. model = _result2.model;
  2017. var deviceType = getGetDeviceType(result, model);
  2018. var deviceBrand = getDeviceBrand(brand);
  2019. useDeviceId(result);
  2020. result = sortObject(Object.assign(result, {
  2021. deviceType: deviceType,
  2022. deviceBrand: deviceBrand,
  2023. deviceModel: model
  2024. }));
  2025. }
  2026. };
  2027. var getWindowInfo = {
  2028. returnValue: function returnValue(result) {
  2029. addSafeAreaInsets(result);
  2030. result = sortObject(Object.assign(result, {
  2031. windowTop: 0,
  2032. windowBottom: 0
  2033. }));
  2034. }
  2035. };
  2036. var getAppAuthorizeSetting = {
  2037. returnValue: function returnValue(result) {
  2038. var locationReducedAccuracy = result.locationReducedAccuracy;
  2039. result.locationAccuracy = 'unsupported';
  2040. if (locationReducedAccuracy === true) {
  2041. result.locationAccuracy = 'reduced';
  2042. } else if (locationReducedAccuracy === false) {
  2043. result.locationAccuracy = 'full';
  2044. }
  2045. }
  2046. };
  2047. // import navigateTo from 'uni-helpers/navigate-to'
  2048. var compressImage = {
  2049. args: function args(fromArgs) {
  2050. // https://developers.weixin.qq.com/community/develop/doc/000c08940c865011298e0a43256800?highLine=compressHeight
  2051. if (fromArgs.compressedHeight && !fromArgs.compressHeight) {
  2052. fromArgs.compressHeight = fromArgs.compressedHeight;
  2053. }
  2054. if (fromArgs.compressedWidth && !fromArgs.compressWidth) {
  2055. fromArgs.compressWidth = fromArgs.compressedWidth;
  2056. }
  2057. }
  2058. };
  2059. var protocols = {
  2060. redirectTo: redirectTo,
  2061. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  2062. previewImage: previewImage,
  2063. getSystemInfo: getSystemInfo,
  2064. getSystemInfoSync: getSystemInfo,
  2065. showActionSheet: showActionSheet,
  2066. getAppBaseInfo: getAppBaseInfo,
  2067. getDeviceInfo: getDeviceInfo,
  2068. getWindowInfo: getWindowInfo,
  2069. getAppAuthorizeSetting: getAppAuthorizeSetting,
  2070. compressImage: compressImage
  2071. };
  2072. var todos = ['vibrate', 'preloadPage', 'unPreloadPage', 'loadSubPackage'];
  2073. var canIUses = [];
  2074. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  2075. function processCallback(methodName, method, returnValue) {
  2076. return function (res) {
  2077. return method(processReturnValue(methodName, res, returnValue));
  2078. };
  2079. }
  2080. function processArgs(methodName, fromArgs) {
  2081. var argsOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  2082. var returnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  2083. var keepFromArgs = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  2084. if (isPlainObject(fromArgs)) {
  2085. // 一般 api 的参数解析
  2086. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  2087. if (isFn(argsOption)) {
  2088. argsOption = argsOption(fromArgs, toArgs) || {};
  2089. }
  2090. for (var key in fromArgs) {
  2091. if (hasOwn(argsOption, key)) {
  2092. var keyOption = argsOption[key];
  2093. if (isFn(keyOption)) {
  2094. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  2095. }
  2096. if (!keyOption) {
  2097. // 不支持的参数
  2098. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  2099. } else if (isStr(keyOption)) {
  2100. // 重写参数 key
  2101. toArgs[keyOption] = fromArgs[key];
  2102. } else if (isPlainObject(keyOption)) {
  2103. // {name:newName,value:value}可重新指定参数 key:value
  2104. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  2105. }
  2106. } else if (CALLBACKS.indexOf(key) !== -1) {
  2107. if (isFn(fromArgs[key])) {
  2108. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  2109. }
  2110. } else {
  2111. if (!keepFromArgs) {
  2112. toArgs[key] = fromArgs[key];
  2113. }
  2114. }
  2115. }
  2116. return toArgs;
  2117. } else if (isFn(fromArgs)) {
  2118. fromArgs = processCallback(methodName, fromArgs, returnValue);
  2119. }
  2120. return fromArgs;
  2121. }
  2122. function processReturnValue(methodName, res, returnValue) {
  2123. var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  2124. if (isFn(protocols.returnValue)) {
  2125. // 处理通用 returnValue
  2126. res = protocols.returnValue(methodName, res);
  2127. }
  2128. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  2129. }
  2130. function wrapper(methodName, method) {
  2131. if (hasOwn(protocols, methodName)) {
  2132. var protocol = protocols[methodName];
  2133. if (!protocol) {
  2134. // 暂不支持的 api
  2135. return function () {
  2136. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  2137. };
  2138. }
  2139. return function (arg1, arg2) {
  2140. // 目前 api 最多两个参数
  2141. var options = protocol;
  2142. if (isFn(protocol)) {
  2143. options = protocol(arg1);
  2144. }
  2145. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  2146. var args = [arg1];
  2147. if (typeof arg2 !== 'undefined') {
  2148. args.push(arg2);
  2149. }
  2150. if (isFn(options.name)) {
  2151. methodName = options.name(arg1);
  2152. } else if (isStr(options.name)) {
  2153. methodName = options.name;
  2154. }
  2155. var returnValue = wx[methodName].apply(wx, args);
  2156. if (isSyncApi(methodName)) {
  2157. // 同步 api
  2158. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  2159. }
  2160. return returnValue;
  2161. };
  2162. }
  2163. return method;
  2164. }
  2165. var todoApis = Object.create(null);
  2166. var TODOS = ['onTabBarMidButtonTap', 'subscribePush', 'unsubscribePush', 'onPush', 'offPush', 'share'];
  2167. function createTodoApi(name) {
  2168. return function todoApi(_ref) {
  2169. var fail = _ref.fail,
  2170. complete = _ref.complete;
  2171. var res = {
  2172. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported")
  2173. };
  2174. isFn(fail) && fail(res);
  2175. isFn(complete) && complete(res);
  2176. };
  2177. }
  2178. TODOS.forEach(function (name) {
  2179. todoApis[name] = createTodoApi(name);
  2180. });
  2181. var providers = {
  2182. oauth: ['weixin'],
  2183. share: ['weixin'],
  2184. payment: ['wxpay'],
  2185. push: ['weixin']
  2186. };
  2187. function getProvider(_ref2) {
  2188. var service = _ref2.service,
  2189. success = _ref2.success,
  2190. fail = _ref2.fail,
  2191. complete = _ref2.complete;
  2192. var res = false;
  2193. if (providers[service]) {
  2194. res = {
  2195. errMsg: 'getProvider:ok',
  2196. service: service,
  2197. provider: providers[service]
  2198. };
  2199. isFn(success) && success(res);
  2200. } else {
  2201. res = {
  2202. errMsg: 'getProvider:fail service not found'
  2203. };
  2204. isFn(fail) && fail(res);
  2205. }
  2206. isFn(complete) && complete(res);
  2207. }
  2208. var extraApi = /*#__PURE__*/Object.freeze({
  2209. __proto__: null,
  2210. getProvider: getProvider
  2211. });
  2212. var getEmitter = function () {
  2213. var Emitter;
  2214. return function getUniEmitter() {
  2215. if (!Emitter) {
  2216. Emitter = new _vue.default();
  2217. }
  2218. return Emitter;
  2219. };
  2220. }();
  2221. function apply(ctx, method, args) {
  2222. return ctx[method].apply(ctx, args);
  2223. }
  2224. function $on() {
  2225. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  2226. }
  2227. function $off() {
  2228. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  2229. }
  2230. function $once() {
  2231. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  2232. }
  2233. function $emit() {
  2234. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  2235. }
  2236. var eventApi = /*#__PURE__*/Object.freeze({
  2237. __proto__: null,
  2238. $on: $on,
  2239. $off: $off,
  2240. $once: $once,
  2241. $emit: $emit
  2242. });
  2243. /**
  2244. * 框架内 try-catch
  2245. */
  2246. /**
  2247. * 开发者 try-catch
  2248. */
  2249. function tryCatch(fn) {
  2250. return function () {
  2251. try {
  2252. return fn.apply(fn, arguments);
  2253. } catch (e) {
  2254. // TODO
  2255. console.error(e);
  2256. }
  2257. };
  2258. }
  2259. function getApiCallbacks(params) {
  2260. var apiCallbacks = {};
  2261. for (var name in params) {
  2262. var param = params[name];
  2263. if (isFn(param)) {
  2264. apiCallbacks[name] = tryCatch(param);
  2265. delete params[name];
  2266. }
  2267. }
  2268. return apiCallbacks;
  2269. }
  2270. var cid;
  2271. var cidErrMsg;
  2272. var enabled;
  2273. function normalizePushMessage(message) {
  2274. try {
  2275. return JSON.parse(message);
  2276. } catch (e) {}
  2277. return message;
  2278. }
  2279. function invokePushCallback(args) {
  2280. if (args.type === 'enabled') {
  2281. enabled = true;
  2282. } else if (args.type === 'clientId') {
  2283. cid = args.cid;
  2284. cidErrMsg = args.errMsg;
  2285. invokeGetPushCidCallbacks(cid, args.errMsg);
  2286. } else if (args.type === 'pushMsg') {
  2287. var message = {
  2288. type: 'receive',
  2289. data: normalizePushMessage(args.message)
  2290. };
  2291. for (var i = 0; i < onPushMessageCallbacks.length; i++) {
  2292. var callback = onPushMessageCallbacks[i];
  2293. callback(message);
  2294. // 该消息已被阻止
  2295. if (message.stopped) {
  2296. break;
  2297. }
  2298. }
  2299. } else if (args.type === 'click') {
  2300. onPushMessageCallbacks.forEach(function (callback) {
  2301. callback({
  2302. type: 'click',
  2303. data: normalizePushMessage(args.message)
  2304. });
  2305. });
  2306. }
  2307. }
  2308. var getPushCidCallbacks = [];
  2309. function invokeGetPushCidCallbacks(cid, errMsg) {
  2310. getPushCidCallbacks.forEach(function (callback) {
  2311. callback(cid, errMsg);
  2312. });
  2313. getPushCidCallbacks.length = 0;
  2314. }
  2315. function getPushClientId(args) {
  2316. if (!isPlainObject(args)) {
  2317. args = {};
  2318. }
  2319. var _getApiCallbacks = getApiCallbacks(args),
  2320. success = _getApiCallbacks.success,
  2321. fail = _getApiCallbacks.fail,
  2322. complete = _getApiCallbacks.complete;
  2323. var hasSuccess = isFn(success);
  2324. var hasFail = isFn(fail);
  2325. var hasComplete = isFn(complete);
  2326. Promise.resolve().then(function () {
  2327. if (typeof enabled === 'undefined') {
  2328. enabled = false;
  2329. cid = '';
  2330. cidErrMsg = 'uniPush is not enabled';
  2331. }
  2332. getPushCidCallbacks.push(function (cid, errMsg) {
  2333. var res;
  2334. if (cid) {
  2335. res = {
  2336. errMsg: 'getPushClientId:ok',
  2337. cid: cid
  2338. };
  2339. hasSuccess && success(res);
  2340. } else {
  2341. res = {
  2342. errMsg: 'getPushClientId:fail' + (errMsg ? ' ' + errMsg : '')
  2343. };
  2344. hasFail && fail(res);
  2345. }
  2346. hasComplete && complete(res);
  2347. });
  2348. if (typeof cid !== 'undefined') {
  2349. invokeGetPushCidCallbacks(cid, cidErrMsg);
  2350. }
  2351. });
  2352. }
  2353. var onPushMessageCallbacks = [];
  2354. // 不使用 defineOnApi 实现,是因为 defineOnApi 依赖 UniServiceJSBridge ,该对象目前在小程序上未提供,故简单实现
  2355. var onPushMessage = function onPushMessage(fn) {
  2356. if (onPushMessageCallbacks.indexOf(fn) === -1) {
  2357. onPushMessageCallbacks.push(fn);
  2358. }
  2359. };
  2360. var offPushMessage = function offPushMessage(fn) {
  2361. if (!fn) {
  2362. onPushMessageCallbacks.length = 0;
  2363. } else {
  2364. var index = onPushMessageCallbacks.indexOf(fn);
  2365. if (index > -1) {
  2366. onPushMessageCallbacks.splice(index, 1);
  2367. }
  2368. }
  2369. };
  2370. var baseInfo = wx.getAppBaseInfo && wx.getAppBaseInfo();
  2371. if (!baseInfo) {
  2372. baseInfo = wx.getSystemInfoSync();
  2373. }
  2374. var host = baseInfo ? baseInfo.host : null;
  2375. var shareVideoMessage = host && host.env === 'SAAASDK' ? wx.miniapp.shareVideoMessage : wx.shareVideoMessage;
  2376. var api = /*#__PURE__*/Object.freeze({
  2377. __proto__: null,
  2378. shareVideoMessage: shareVideoMessage,
  2379. getPushClientId: getPushClientId,
  2380. onPushMessage: onPushMessage,
  2381. offPushMessage: offPushMessage,
  2382. invokePushCallback: invokePushCallback
  2383. });
  2384. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  2385. function findVmByVueId(vm, vuePid) {
  2386. var $children = vm.$children;
  2387. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  2388. for (var i = $children.length - 1; i >= 0; i--) {
  2389. var childVm = $children[i];
  2390. if (childVm.$scope._$vueId === vuePid) {
  2391. return childVm;
  2392. }
  2393. }
  2394. // 反向递归查找
  2395. var parentVm;
  2396. for (var _i = $children.length - 1; _i >= 0; _i--) {
  2397. parentVm = findVmByVueId($children[_i], vuePid);
  2398. if (parentVm) {
  2399. return parentVm;
  2400. }
  2401. }
  2402. }
  2403. function initBehavior(options) {
  2404. return Behavior(options);
  2405. }
  2406. function isPage() {
  2407. return !!this.route;
  2408. }
  2409. function initRelation(detail) {
  2410. this.triggerEvent('__l', detail);
  2411. }
  2412. function selectAllComponents(mpInstance, selector, $refs) {
  2413. var components = mpInstance.selectAllComponents(selector) || [];
  2414. components.forEach(function (component) {
  2415. var ref = component.dataset.ref;
  2416. $refs[ref] = component.$vm || toSkip(component);
  2417. {
  2418. if (component.dataset.vueGeneric === 'scoped') {
  2419. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  2420. selectAllComponents(scopedComponent, selector, $refs);
  2421. });
  2422. }
  2423. }
  2424. });
  2425. }
  2426. function syncRefs(refs, newRefs) {
  2427. var oldKeys = (0, _construct2.default)(Set, (0, _toConsumableArray2.default)(Object.keys(refs)));
  2428. var newKeys = Object.keys(newRefs);
  2429. newKeys.forEach(function (key) {
  2430. var oldValue = refs[key];
  2431. var newValue = newRefs[key];
  2432. if (Array.isArray(oldValue) && Array.isArray(newValue) && oldValue.length === newValue.length && newValue.every(function (value) {
  2433. return oldValue.includes(value);
  2434. })) {
  2435. return;
  2436. }
  2437. refs[key] = newValue;
  2438. oldKeys.delete(key);
  2439. });
  2440. oldKeys.forEach(function (key) {
  2441. delete refs[key];
  2442. });
  2443. return refs;
  2444. }
  2445. function initRefs(vm) {
  2446. var mpInstance = vm.$scope;
  2447. var refs = {};
  2448. Object.defineProperty(vm, '$refs', {
  2449. get: function get() {
  2450. var $refs = {};
  2451. selectAllComponents(mpInstance, '.vue-ref', $refs);
  2452. // TODO 暂不考虑 for 中的 scoped
  2453. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for') || [];
  2454. forComponents.forEach(function (component) {
  2455. var ref = component.dataset.ref;
  2456. if (!$refs[ref]) {
  2457. $refs[ref] = [];
  2458. }
  2459. $refs[ref].push(component.$vm || toSkip(component));
  2460. });
  2461. return syncRefs(refs, $refs);
  2462. }
  2463. });
  2464. }
  2465. function handleLink(event) {
  2466. var _ref3 = event.detail || event.value,
  2467. vuePid = _ref3.vuePid,
  2468. vueOptions = _ref3.vueOptions; // detail 是微信,value 是百度(dipatch)
  2469. var parentVm;
  2470. if (vuePid) {
  2471. parentVm = findVmByVueId(this.$vm, vuePid);
  2472. }
  2473. if (!parentVm) {
  2474. parentVm = this.$vm;
  2475. }
  2476. vueOptions.parent = parentVm;
  2477. }
  2478. function markMPComponent(component) {
  2479. // 在 Vue 中标记为小程序组件
  2480. var IS_MP = '__v_isMPComponent';
  2481. Object.defineProperty(component, IS_MP, {
  2482. configurable: true,
  2483. enumerable: false,
  2484. value: true
  2485. });
  2486. return component;
  2487. }
  2488. function toSkip(obj) {
  2489. var OB = '__ob__';
  2490. var SKIP = '__v_skip';
  2491. if (isObject(obj) && Object.isExtensible(obj)) {
  2492. // 避免被 @vue/composition-api 观测
  2493. Object.defineProperty(obj, OB, {
  2494. configurable: true,
  2495. enumerable: false,
  2496. value: (0, _defineProperty2.default)({}, SKIP, true)
  2497. });
  2498. }
  2499. return obj;
  2500. }
  2501. var WORKLET_RE = /_(.*)_worklet_factory_/;
  2502. function initWorkletMethods(mpMethods, vueMethods) {
  2503. if (vueMethods) {
  2504. Object.keys(vueMethods).forEach(function (name) {
  2505. var matches = name.match(WORKLET_RE);
  2506. if (matches) {
  2507. var workletName = matches[1];
  2508. mpMethods[name] = vueMethods[name];
  2509. mpMethods[workletName] = vueMethods[workletName];
  2510. }
  2511. });
  2512. }
  2513. }
  2514. var MPPage = Page;
  2515. var MPComponent = Component;
  2516. var customizeRE = /:/g;
  2517. var customize = cached(function (str) {
  2518. return camelize(str.replace(customizeRE, '-'));
  2519. });
  2520. function initTriggerEvent(mpInstance) {
  2521. var oldTriggerEvent = mpInstance.triggerEvent;
  2522. var newTriggerEvent = function newTriggerEvent(event) {
  2523. for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
  2524. args[_key3 - 1] = arguments[_key3];
  2525. }
  2526. // 事件名统一转驼峰格式,仅处理:当前组件为 vue 组件、当前组件为 vue 组件子组件
  2527. if (this.$vm || this.dataset && this.dataset.comType) {
  2528. event = customize(event);
  2529. } else {
  2530. // 针对微信/QQ小程序单独补充驼峰格式事件,以兼容历史项目
  2531. var newEvent = customize(event);
  2532. if (newEvent !== event) {
  2533. oldTriggerEvent.apply(this, [newEvent].concat(args));
  2534. }
  2535. }
  2536. return oldTriggerEvent.apply(this, [event].concat(args));
  2537. };
  2538. try {
  2539. // 京东小程序 triggerEvent 为只读
  2540. mpInstance.triggerEvent = newTriggerEvent;
  2541. } catch (error) {
  2542. mpInstance._triggerEvent = newTriggerEvent;
  2543. }
  2544. }
  2545. function initHook(name, options, isComponent) {
  2546. var oldHook = options[name];
  2547. options[name] = function () {
  2548. markMPComponent(this);
  2549. initTriggerEvent(this);
  2550. if (oldHook) {
  2551. for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  2552. args[_key4] = arguments[_key4];
  2553. }
  2554. return oldHook.apply(this, args);
  2555. }
  2556. };
  2557. }
  2558. if (!MPPage.__$wrappered) {
  2559. MPPage.__$wrappered = true;
  2560. Page = function Page() {
  2561. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  2562. initHook('onLoad', options);
  2563. return MPPage(options);
  2564. };
  2565. Page.after = MPPage.after;
  2566. Component = function Component() {
  2567. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  2568. initHook('created', options);
  2569. return MPComponent(options);
  2570. };
  2571. }
  2572. var PAGE_EVENT_HOOKS = ['onPullDownRefresh', 'onReachBottom', 'onAddToFavorites', 'onShareTimeline', 'onShareAppMessage', 'onPageScroll', 'onResize', 'onTabItemTap'];
  2573. function initMocks(vm, mocks) {
  2574. var mpInstance = vm.$mp[vm.mpType];
  2575. mocks.forEach(function (mock) {
  2576. if (hasOwn(mpInstance, mock)) {
  2577. vm[mock] = mpInstance[mock];
  2578. }
  2579. });
  2580. }
  2581. function hasHook(hook, vueOptions) {
  2582. if (!vueOptions) {
  2583. return true;
  2584. }
  2585. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  2586. return true;
  2587. }
  2588. vueOptions = vueOptions.default || vueOptions;
  2589. if (isFn(vueOptions)) {
  2590. if (isFn(vueOptions.extendOptions[hook])) {
  2591. return true;
  2592. }
  2593. if (vueOptions.super && vueOptions.super.options && Array.isArray(vueOptions.super.options[hook])) {
  2594. return true;
  2595. }
  2596. return false;
  2597. }
  2598. if (isFn(vueOptions[hook]) || Array.isArray(vueOptions[hook])) {
  2599. return true;
  2600. }
  2601. var mixins = vueOptions.mixins;
  2602. if (Array.isArray(mixins)) {
  2603. return !!mixins.find(function (mixin) {
  2604. return hasHook(hook, mixin);
  2605. });
  2606. }
  2607. }
  2608. function initHooks(mpOptions, hooks, vueOptions) {
  2609. hooks.forEach(function (hook) {
  2610. if (hasHook(hook, vueOptions)) {
  2611. mpOptions[hook] = function (args) {
  2612. return this.$vm && this.$vm.__call_hook(hook, args);
  2613. };
  2614. }
  2615. });
  2616. }
  2617. function initUnknownHooks(mpOptions, vueOptions) {
  2618. var excludes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  2619. findHooks(vueOptions).forEach(function (hook) {
  2620. return initHook$1(mpOptions, hook, excludes);
  2621. });
  2622. }
  2623. function findHooks(vueOptions) {
  2624. var hooks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  2625. if (vueOptions) {
  2626. Object.keys(vueOptions).forEach(function (name) {
  2627. if (name.indexOf('on') === 0 && isFn(vueOptions[name])) {
  2628. hooks.push(name);
  2629. }
  2630. });
  2631. }
  2632. return hooks;
  2633. }
  2634. function initHook$1(mpOptions, hook, excludes) {
  2635. if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
  2636. mpOptions[hook] = function (args) {
  2637. return this.$vm && this.$vm.__call_hook(hook, args);
  2638. };
  2639. }
  2640. }
  2641. function initVueComponent(Vue, vueOptions) {
  2642. vueOptions = vueOptions.default || vueOptions;
  2643. var VueComponent;
  2644. if (isFn(vueOptions)) {
  2645. VueComponent = vueOptions;
  2646. } else {
  2647. VueComponent = Vue.extend(vueOptions);
  2648. }
  2649. vueOptions = VueComponent.options;
  2650. return [VueComponent, vueOptions];
  2651. }
  2652. function initSlots(vm, vueSlots) {
  2653. if (Array.isArray(vueSlots) && vueSlots.length) {
  2654. var $slots = Object.create(null);
  2655. vueSlots.forEach(function (slotName) {
  2656. $slots[slotName] = true;
  2657. });
  2658. vm.$scopedSlots = vm.$slots = $slots;
  2659. }
  2660. }
  2661. function initVueIds(vueIds, mpInstance) {
  2662. vueIds = (vueIds || '').split(',');
  2663. var len = vueIds.length;
  2664. if (len === 1) {
  2665. mpInstance._$vueId = vueIds[0];
  2666. } else if (len === 2) {
  2667. mpInstance._$vueId = vueIds[0];
  2668. mpInstance._$vuePid = vueIds[1];
  2669. }
  2670. }
  2671. function initData(vueOptions, context) {
  2672. var data = vueOptions.data || {};
  2673. var methods = vueOptions.methods || {};
  2674. if (typeof data === 'function') {
  2675. try {
  2676. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  2677. } catch (e) {
  2678. if (Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"房票科技","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  2679. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  2680. }
  2681. }
  2682. } else {
  2683. try {
  2684. // 对 data 格式化
  2685. data = JSON.parse(JSON.stringify(data));
  2686. } catch (e) {}
  2687. }
  2688. if (!isPlainObject(data)) {
  2689. data = {};
  2690. }
  2691. Object.keys(methods).forEach(function (methodName) {
  2692. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  2693. data[methodName] = methods[methodName];
  2694. }
  2695. });
  2696. return data;
  2697. }
  2698. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  2699. function createObserver(name) {
  2700. return function observer(newVal, oldVal) {
  2701. if (this.$vm) {
  2702. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  2703. }
  2704. };
  2705. }
  2706. function initBehaviors(vueOptions, initBehavior) {
  2707. var vueBehaviors = vueOptions.behaviors;
  2708. var vueExtends = vueOptions.extends;
  2709. var vueMixins = vueOptions.mixins;
  2710. var vueProps = vueOptions.props;
  2711. if (!vueProps) {
  2712. vueOptions.props = vueProps = [];
  2713. }
  2714. var behaviors = [];
  2715. if (Array.isArray(vueBehaviors)) {
  2716. vueBehaviors.forEach(function (behavior) {
  2717. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  2718. if (behavior === 'uni://form-field') {
  2719. if (Array.isArray(vueProps)) {
  2720. vueProps.push('name');
  2721. vueProps.push('value');
  2722. } else {
  2723. vueProps.name = {
  2724. type: String,
  2725. default: ''
  2726. };
  2727. vueProps.value = {
  2728. type: [String, Number, Boolean, Array, Object, Date],
  2729. default: ''
  2730. };
  2731. }
  2732. }
  2733. });
  2734. }
  2735. if (isPlainObject(vueExtends) && vueExtends.props) {
  2736. behaviors.push(initBehavior({
  2737. properties: initProperties(vueExtends.props, true)
  2738. }));
  2739. }
  2740. if (Array.isArray(vueMixins)) {
  2741. vueMixins.forEach(function (vueMixin) {
  2742. if (isPlainObject(vueMixin) && vueMixin.props) {
  2743. behaviors.push(initBehavior({
  2744. properties: initProperties(vueMixin.props, true)
  2745. }));
  2746. }
  2747. });
  2748. }
  2749. return behaviors;
  2750. }
  2751. function parsePropType(key, type, defaultValue, file) {
  2752. // [String]=>String
  2753. if (Array.isArray(type) && type.length === 1) {
  2754. return type[0];
  2755. }
  2756. return type;
  2757. }
  2758. function initProperties(props) {
  2759. var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  2760. var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  2761. var options = arguments.length > 3 ? arguments[3] : undefined;
  2762. var properties = {};
  2763. if (!isBehavior) {
  2764. properties.vueId = {
  2765. type: String,
  2766. value: ''
  2767. };
  2768. {
  2769. if (options.virtualHost) {
  2770. properties.virtualHostStyle = {
  2771. type: null,
  2772. value: ''
  2773. };
  2774. properties.virtualHostClass = {
  2775. type: null,
  2776. value: ''
  2777. };
  2778. }
  2779. }
  2780. // scopedSlotsCompiler auto
  2781. properties.scopedSlotsCompiler = {
  2782. type: String,
  2783. value: ''
  2784. };
  2785. properties.vueSlots = {
  2786. // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  2787. type: null,
  2788. value: [],
  2789. observer: function observer(newVal, oldVal) {
  2790. var $slots = Object.create(null);
  2791. newVal.forEach(function (slotName) {
  2792. $slots[slotName] = true;
  2793. });
  2794. this.setData({
  2795. $slots: $slots
  2796. });
  2797. }
  2798. };
  2799. }
  2800. if (Array.isArray(props)) {
  2801. // ['title']
  2802. props.forEach(function (key) {
  2803. properties[key] = {
  2804. type: null,
  2805. observer: createObserver(key)
  2806. };
  2807. });
  2808. } else if (isPlainObject(props)) {
  2809. // {title:{type:String,default:''},content:String}
  2810. Object.keys(props).forEach(function (key) {
  2811. var opts = props[key];
  2812. if (isPlainObject(opts)) {
  2813. // title:{type:String,default:''}
  2814. var value = opts.default;
  2815. if (isFn(value)) {
  2816. value = value();
  2817. }
  2818. opts.type = parsePropType(key, opts.type);
  2819. properties[key] = {
  2820. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  2821. value: value,
  2822. observer: createObserver(key)
  2823. };
  2824. } else {
  2825. // content:String
  2826. var type = parsePropType(key, opts);
  2827. properties[key] = {
  2828. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  2829. observer: createObserver(key)
  2830. };
  2831. }
  2832. });
  2833. }
  2834. return properties;
  2835. }
  2836. function wrapper$1(event) {
  2837. // TODO 又得兼容 mpvue 的 mp 对象
  2838. try {
  2839. event.mp = JSON.parse(JSON.stringify(event));
  2840. } catch (e) {}
  2841. event.stopPropagation = noop;
  2842. event.preventDefault = noop;
  2843. event.target = event.target || {};
  2844. if (!hasOwn(event, 'detail')) {
  2845. event.detail = {};
  2846. }
  2847. if (hasOwn(event, 'markerId')) {
  2848. event.detail = (0, _typeof2.default)(event.detail) === 'object' ? event.detail : {};
  2849. event.detail.markerId = event.markerId;
  2850. }
  2851. if (isPlainObject(event.detail)) {
  2852. event.target = Object.assign({}, event.target, event.detail);
  2853. }
  2854. return event;
  2855. }
  2856. function getExtraValue(vm, dataPathsArray) {
  2857. var context = vm;
  2858. dataPathsArray.forEach(function (dataPathArray) {
  2859. var dataPath = dataPathArray[0];
  2860. var value = dataPathArray[2];
  2861. if (dataPath || typeof value !== 'undefined') {
  2862. // ['','',index,'disable']
  2863. var propPath = dataPathArray[1];
  2864. var valuePath = dataPathArray[3];
  2865. var vFor;
  2866. if (Number.isInteger(dataPath)) {
  2867. vFor = dataPath;
  2868. } else if (!dataPath) {
  2869. vFor = context;
  2870. } else if (typeof dataPath === 'string' && dataPath) {
  2871. if (dataPath.indexOf('#s#') === 0) {
  2872. vFor = dataPath.substr(3);
  2873. } else {
  2874. vFor = vm.__get_value(dataPath, context);
  2875. }
  2876. }
  2877. if (Number.isInteger(vFor)) {
  2878. context = value;
  2879. } else if (!propPath) {
  2880. context = vFor[value];
  2881. } else {
  2882. if (Array.isArray(vFor)) {
  2883. context = vFor.find(function (vForItem) {
  2884. return vm.__get_value(propPath, vForItem) === value;
  2885. });
  2886. } else if (isPlainObject(vFor)) {
  2887. context = Object.keys(vFor).find(function (vForKey) {
  2888. return vm.__get_value(propPath, vFor[vForKey]) === value;
  2889. });
  2890. } else {
  2891. console.error('v-for 暂不支持循环数据:', vFor);
  2892. }
  2893. }
  2894. if (valuePath) {
  2895. context = vm.__get_value(valuePath, context);
  2896. }
  2897. }
  2898. });
  2899. return context;
  2900. }
  2901. function processEventExtra(vm, extra, event, __args__) {
  2902. var extraObj = {};
  2903. if (Array.isArray(extra) && extra.length) {
  2904. /**
  2905. *[
  2906. * ['data.items', 'data.id', item.data.id],
  2907. * ['metas', 'id', meta.id]
  2908. *],
  2909. *[
  2910. * ['data.items', 'data.id', item.data.id],
  2911. * ['metas', 'id', meta.id]
  2912. *],
  2913. *'test'
  2914. */
  2915. extra.forEach(function (dataPath, index) {
  2916. if (typeof dataPath === 'string') {
  2917. if (!dataPath) {
  2918. // model,prop.sync
  2919. extraObj['$' + index] = vm;
  2920. } else {
  2921. if (dataPath === '$event') {
  2922. // $event
  2923. extraObj['$' + index] = event;
  2924. } else if (dataPath === 'arguments') {
  2925. extraObj['$' + index] = event.detail ? event.detail.__args__ || __args__ : __args__;
  2926. } else if (dataPath.indexOf('$event.') === 0) {
  2927. // $event.target.value
  2928. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  2929. } else {
  2930. extraObj['$' + index] = vm.__get_value(dataPath);
  2931. }
  2932. }
  2933. } else {
  2934. extraObj['$' + index] = getExtraValue(vm, dataPath);
  2935. }
  2936. });
  2937. }
  2938. return extraObj;
  2939. }
  2940. function getObjByArray(arr) {
  2941. var obj = {};
  2942. for (var i = 1; i < arr.length; i++) {
  2943. var element = arr[i];
  2944. obj[element[0]] = element[1];
  2945. }
  2946. return obj;
  2947. }
  2948. function processEventArgs(vm, event) {
  2949. var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  2950. var extra = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
  2951. var isCustom = arguments.length > 4 ? arguments[4] : undefined;
  2952. var methodName = arguments.length > 5 ? arguments[5] : undefined;
  2953. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  2954. // fixed 用户直接触发 mpInstance.triggerEvent
  2955. var __args__ = isPlainObject(event.detail) ? event.detail.__args__ || [event.detail] : [event.detail];
  2956. if (isCustom) {
  2957. // 自定义事件
  2958. isCustomMPEvent = event.currentTarget && event.currentTarget.dataset && event.currentTarget.dataset.comType === 'wx';
  2959. if (!args.length) {
  2960. // 无参数,直接传入 event 或 detail 数组
  2961. if (isCustomMPEvent) {
  2962. return [event];
  2963. }
  2964. return __args__;
  2965. }
  2966. }
  2967. var extraObj = processEventExtra(vm, extra, event, __args__);
  2968. var ret = [];
  2969. args.forEach(function (arg) {
  2970. if (arg === '$event') {
  2971. if (methodName === '__set_model' && !isCustom) {
  2972. // input v-model value
  2973. ret.push(event.target.value);
  2974. } else {
  2975. if (isCustom && !isCustomMPEvent) {
  2976. ret.push(__args__[0]);
  2977. } else {
  2978. // wxcomponent 组件或内置组件
  2979. ret.push(event);
  2980. }
  2981. }
  2982. } else {
  2983. if (Array.isArray(arg) && arg[0] === 'o') {
  2984. ret.push(getObjByArray(arg));
  2985. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  2986. ret.push(extraObj[arg]);
  2987. } else {
  2988. ret.push(arg);
  2989. }
  2990. }
  2991. });
  2992. return ret;
  2993. }
  2994. var ONCE = '~';
  2995. var CUSTOM = '^';
  2996. function isMatchEventType(eventType, optType) {
  2997. return eventType === optType || optType === 'regionchange' && (eventType === 'begin' || eventType === 'end');
  2998. }
  2999. function getContextVm(vm) {
  3000. var $parent = vm.$parent;
  3001. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  3002. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  3003. $parent = $parent.$parent;
  3004. }
  3005. return $parent && $parent.$parent;
  3006. }
  3007. function handleEvent(event) {
  3008. var _this2 = this;
  3009. event = wrapper$1(event);
  3010. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  3011. var dataset = (event.currentTarget || event.target).dataset;
  3012. if (!dataset) {
  3013. return console.warn('事件信息不存在');
  3014. }
  3015. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  3016. if (!eventOpts) {
  3017. return console.warn('事件信息不存在');
  3018. }
  3019. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  3020. var eventType = event.type;
  3021. var ret = [];
  3022. eventOpts.forEach(function (eventOpt) {
  3023. var type = eventOpt[0];
  3024. var eventsArray = eventOpt[1];
  3025. var isCustom = type.charAt(0) === CUSTOM;
  3026. type = isCustom ? type.slice(1) : type;
  3027. var isOnce = type.charAt(0) === ONCE;
  3028. type = isOnce ? type.slice(1) : type;
  3029. if (eventsArray && isMatchEventType(eventType, type)) {
  3030. eventsArray.forEach(function (eventArray) {
  3031. var methodName = eventArray[0];
  3032. if (methodName) {
  3033. var handlerCtx = _this2.$vm;
  3034. if (handlerCtx.$options.generic) {
  3035. // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  3036. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  3037. }
  3038. if (methodName === '$emit') {
  3039. handlerCtx.$emit.apply(handlerCtx, processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName));
  3040. return;
  3041. }
  3042. var handler = handlerCtx[methodName];
  3043. if (!isFn(handler)) {
  3044. var _type = _this2.$vm.mpType === 'page' ? 'Page' : 'Component';
  3045. var path = _this2.route || _this2.is;
  3046. throw new Error("".concat(_type, " \"").concat(path, "\" does not have a method \"").concat(methodName, "\""));
  3047. }
  3048. if (isOnce) {
  3049. if (handler.once) {
  3050. return;
  3051. }
  3052. handler.once = true;
  3053. }
  3054. var params = processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName);
  3055. params = Array.isArray(params) ? params : [];
  3056. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  3057. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  3058. // eslint-disable-next-line no-sparse-arrays
  3059. params = params.concat([,,,,,,,,,, event]);
  3060. }
  3061. ret.push(handler.apply(handlerCtx, params));
  3062. }
  3063. });
  3064. }
  3065. });
  3066. if (eventType === 'input' && ret.length === 1 && typeof ret[0] !== 'undefined') {
  3067. return ret[0];
  3068. }
  3069. }
  3070. var eventChannels = {};
  3071. function getEventChannel(id) {
  3072. var eventChannel = eventChannels[id];
  3073. delete eventChannels[id];
  3074. return eventChannel;
  3075. }
  3076. var hooks = ['onShow', 'onHide', 'onError', 'onPageNotFound', 'onThemeChange', 'onUnhandledRejection'];
  3077. function initEventChannel() {
  3078. _vue.default.prototype.getOpenerEventChannel = function () {
  3079. // 微信小程序使用自身getOpenerEventChannel
  3080. {
  3081. return this.$scope.getOpenerEventChannel();
  3082. }
  3083. };
  3084. var callHook = _vue.default.prototype.__call_hook;
  3085. _vue.default.prototype.__call_hook = function (hook, args) {
  3086. if (hook === 'onLoad' && args && args.__id__) {
  3087. this.__eventChannel__ = getEventChannel(args.__id__);
  3088. delete args.__id__;
  3089. }
  3090. return callHook.call(this, hook, args);
  3091. };
  3092. }
  3093. function initScopedSlotsParams() {
  3094. var center = {};
  3095. var parents = {};
  3096. function currentId(fn) {
  3097. var vueIds = this.$options.propsData.vueId;
  3098. if (vueIds) {
  3099. var vueId = vueIds.split(',')[0];
  3100. fn(vueId);
  3101. }
  3102. }
  3103. _vue.default.prototype.$hasSSP = function (vueId) {
  3104. var slot = center[vueId];
  3105. if (!slot) {
  3106. parents[vueId] = this;
  3107. this.$on('hook:destroyed', function () {
  3108. delete parents[vueId];
  3109. });
  3110. }
  3111. return slot;
  3112. };
  3113. _vue.default.prototype.$getSSP = function (vueId, name, needAll) {
  3114. var slot = center[vueId];
  3115. if (slot) {
  3116. var params = slot[name] || [];
  3117. if (needAll) {
  3118. return params;
  3119. }
  3120. return params[0];
  3121. }
  3122. };
  3123. _vue.default.prototype.$setSSP = function (name, value) {
  3124. var index = 0;
  3125. currentId.call(this, function (vueId) {
  3126. var slot = center[vueId];
  3127. var params = slot[name] = slot[name] || [];
  3128. params.push(value);
  3129. index = params.length - 1;
  3130. });
  3131. return index;
  3132. };
  3133. _vue.default.prototype.$initSSP = function () {
  3134. currentId.call(this, function (vueId) {
  3135. center[vueId] = {};
  3136. });
  3137. };
  3138. _vue.default.prototype.$callSSP = function () {
  3139. currentId.call(this, function (vueId) {
  3140. if (parents[vueId]) {
  3141. parents[vueId].$forceUpdate();
  3142. }
  3143. });
  3144. };
  3145. _vue.default.mixin({
  3146. destroyed: function destroyed() {
  3147. var propsData = this.$options.propsData;
  3148. var vueId = propsData && propsData.vueId;
  3149. if (vueId) {
  3150. delete center[vueId];
  3151. delete parents[vueId];
  3152. }
  3153. }
  3154. });
  3155. }
  3156. function parseBaseApp(vm, _ref4) {
  3157. var mocks = _ref4.mocks,
  3158. initRefs = _ref4.initRefs;
  3159. initEventChannel();
  3160. {
  3161. initScopedSlotsParams();
  3162. }
  3163. if (vm.$options.store) {
  3164. _vue.default.prototype.$store = vm.$options.store;
  3165. }
  3166. uniIdMixin(_vue.default);
  3167. _vue.default.prototype.mpHost = "mp-weixin";
  3168. _vue.default.mixin({
  3169. beforeCreate: function beforeCreate() {
  3170. if (!this.$options.mpType) {
  3171. return;
  3172. }
  3173. this.mpType = this.$options.mpType;
  3174. this.$mp = (0, _defineProperty2.default)({
  3175. data: {}
  3176. }, this.mpType, this.$options.mpInstance);
  3177. this.$scope = this.$options.mpInstance;
  3178. delete this.$options.mpType;
  3179. delete this.$options.mpInstance;
  3180. if (this.mpType === 'page' && typeof getApp === 'function') {
  3181. // hack vue-i18n
  3182. var app = getApp();
  3183. if (app.$vm && app.$vm.$i18n) {
  3184. this._i18n = app.$vm.$i18n;
  3185. }
  3186. }
  3187. if (this.mpType !== 'app') {
  3188. initRefs(this);
  3189. initMocks(this, mocks);
  3190. }
  3191. }
  3192. });
  3193. var appOptions = {
  3194. onLaunch: function onLaunch(args) {
  3195. if (this.$vm) {
  3196. // 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  3197. return;
  3198. }
  3199. {
  3200. if (wx.canIUse && !wx.canIUse('nextTick')) {
  3201. // 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  3202. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  3203. }
  3204. }
  3205. this.$vm = vm;
  3206. this.$vm.$mp = {
  3207. app: this
  3208. };
  3209. this.$vm.$scope = this;
  3210. // vm 上也挂载 globalData
  3211. this.$vm.globalData = this.globalData;
  3212. this.$vm._isMounted = true;
  3213. this.$vm.__call_hook('mounted', args);
  3214. this.$vm.__call_hook('onLaunch', args);
  3215. }
  3216. };
  3217. // 兼容旧版本 globalData
  3218. appOptions.globalData = vm.$options.globalData || {};
  3219. // 将 methods 中的方法挂在 getApp() 中
  3220. var methods = vm.$options.methods;
  3221. if (methods) {
  3222. Object.keys(methods).forEach(function (name) {
  3223. appOptions[name] = methods[name];
  3224. });
  3225. }
  3226. initAppLocale(_vue.default, vm, normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN);
  3227. initHooks(appOptions, hooks);
  3228. initUnknownHooks(appOptions, vm.$options);
  3229. return appOptions;
  3230. }
  3231. function parseApp(vm) {
  3232. return parseBaseApp(vm, {
  3233. mocks: mocks,
  3234. initRefs: initRefs
  3235. });
  3236. }
  3237. function createApp(vm) {
  3238. App(parseApp(vm));
  3239. return vm;
  3240. }
  3241. var encodeReserveRE = /[!'()*]/g;
  3242. var encodeReserveReplacer = function encodeReserveReplacer(c) {
  3243. return '%' + c.charCodeAt(0).toString(16);
  3244. };
  3245. var commaRE = /%2C/g;
  3246. // fixed encodeURIComponent which is more conformant to RFC3986:
  3247. // - escapes [!'()*]
  3248. // - preserve commas
  3249. var encode = function encode(str) {
  3250. return encodeURIComponent(str).replace(encodeReserveRE, encodeReserveReplacer).replace(commaRE, ',');
  3251. };
  3252. function stringifyQuery(obj) {
  3253. var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  3254. var res = obj ? Object.keys(obj).map(function (key) {
  3255. var val = obj[key];
  3256. if (val === undefined) {
  3257. return '';
  3258. }
  3259. if (val === null) {
  3260. return encodeStr(key);
  3261. }
  3262. if (Array.isArray(val)) {
  3263. var result = [];
  3264. val.forEach(function (val2) {
  3265. if (val2 === undefined) {
  3266. return;
  3267. }
  3268. if (val2 === null) {
  3269. result.push(encodeStr(key));
  3270. } else {
  3271. result.push(encodeStr(key) + '=' + encodeStr(val2));
  3272. }
  3273. });
  3274. return result.join('&');
  3275. }
  3276. return encodeStr(key) + '=' + encodeStr(val);
  3277. }).filter(function (x) {
  3278. return x.length > 0;
  3279. }).join('&') : null;
  3280. return res ? "?".concat(res) : '';
  3281. }
  3282. function parseBaseComponent(vueComponentOptions) {
  3283. var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  3284. isPage = _ref5.isPage,
  3285. initRelation = _ref5.initRelation;
  3286. var needVueOptions = arguments.length > 2 ? arguments[2] : undefined;
  3287. var _initVueComponent = initVueComponent(_vue.default, vueComponentOptions),
  3288. _initVueComponent2 = (0, _slicedToArray2.default)(_initVueComponent, 2),
  3289. VueComponent = _initVueComponent2[0],
  3290. vueOptions = _initVueComponent2[1];
  3291. var options = _objectSpread({
  3292. multipleSlots: true,
  3293. // styleIsolation: 'apply-shared',
  3294. addGlobalClass: true
  3295. }, vueOptions.options || {});
  3296. {
  3297. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  3298. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  3299. Object.assign(options, vueOptions['mp-weixin'].options);
  3300. }
  3301. }
  3302. var componentOptions = {
  3303. options: options,
  3304. data: initData(vueOptions, _vue.default.prototype),
  3305. behaviors: initBehaviors(vueOptions, initBehavior),
  3306. properties: initProperties(vueOptions.props, false, vueOptions.__file, options),
  3307. lifetimes: {
  3308. attached: function attached() {
  3309. var properties = this.properties;
  3310. var options = {
  3311. mpType: isPage.call(this) ? 'page' : 'component',
  3312. mpInstance: this,
  3313. propsData: properties
  3314. };
  3315. initVueIds(properties.vueId, this);
  3316. // 处理父子关系
  3317. initRelation.call(this, {
  3318. vuePid: this._$vuePid,
  3319. vueOptions: options
  3320. });
  3321. // 初始化 vue 实例
  3322. this.$vm = new VueComponent(options);
  3323. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  3324. initSlots(this.$vm, properties.vueSlots);
  3325. // 触发首次 setData
  3326. this.$vm.$mount();
  3327. },
  3328. ready: function ready() {
  3329. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  3330. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  3331. if (this.$vm) {
  3332. this.$vm._isMounted = true;
  3333. this.$vm.__call_hook('mounted');
  3334. this.$vm.__call_hook('onReady');
  3335. }
  3336. },
  3337. detached: function detached() {
  3338. this.$vm && this.$vm.$destroy();
  3339. }
  3340. },
  3341. pageLifetimes: {
  3342. show: function show(args) {
  3343. this.$vm && this.$vm.__call_hook('onPageShow', args);
  3344. },
  3345. hide: function hide() {
  3346. this.$vm && this.$vm.__call_hook('onPageHide');
  3347. },
  3348. resize: function resize(size) {
  3349. this.$vm && this.$vm.__call_hook('onPageResize', size);
  3350. }
  3351. },
  3352. methods: {
  3353. __l: handleLink,
  3354. __e: handleEvent
  3355. }
  3356. };
  3357. // externalClasses
  3358. if (vueOptions.externalClasses) {
  3359. componentOptions.externalClasses = vueOptions.externalClasses;
  3360. }
  3361. if (Array.isArray(vueOptions.wxsCallMethods)) {
  3362. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  3363. componentOptions.methods[callMethod] = function (args) {
  3364. return this.$vm[callMethod](args);
  3365. };
  3366. });
  3367. }
  3368. if (needVueOptions) {
  3369. return [componentOptions, vueOptions, VueComponent];
  3370. }
  3371. if (isPage) {
  3372. return componentOptions;
  3373. }
  3374. return [componentOptions, VueComponent];
  3375. }
  3376. function parseComponent(vueComponentOptions, needVueOptions) {
  3377. return parseBaseComponent(vueComponentOptions, {
  3378. isPage: isPage,
  3379. initRelation: initRelation
  3380. }, needVueOptions);
  3381. }
  3382. var hooks$1 = ['onShow', 'onHide', 'onUnload'];
  3383. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  3384. function parseBasePage(vuePageOptions) {
  3385. var _parseComponent = parseComponent(vuePageOptions, true),
  3386. _parseComponent2 = (0, _slicedToArray2.default)(_parseComponent, 2),
  3387. pageOptions = _parseComponent2[0],
  3388. vueOptions = _parseComponent2[1];
  3389. initHooks(pageOptions.methods, hooks$1, vueOptions);
  3390. pageOptions.methods.onLoad = function (query) {
  3391. this.options = query;
  3392. var copyQuery = Object.assign({}, query);
  3393. delete copyQuery.__id__;
  3394. this.$page = {
  3395. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery)
  3396. };
  3397. this.$vm.$mp.query = query; // 兼容 mpvue
  3398. this.$vm.__call_hook('onLoad', query);
  3399. };
  3400. {
  3401. initUnknownHooks(pageOptions.methods, vuePageOptions, ['onReady']);
  3402. }
  3403. {
  3404. initWorkletMethods(pageOptions.methods, vueOptions.methods);
  3405. }
  3406. return pageOptions;
  3407. }
  3408. function parsePage(vuePageOptions) {
  3409. return parseBasePage(vuePageOptions);
  3410. }
  3411. function createPage(vuePageOptions) {
  3412. {
  3413. return Component(parsePage(vuePageOptions));
  3414. }
  3415. }
  3416. function createComponent(vueOptions) {
  3417. {
  3418. return Component(parseComponent(vueOptions));
  3419. }
  3420. }
  3421. function createSubpackageApp(vm) {
  3422. var appOptions = parseApp(vm);
  3423. var app = getApp({
  3424. allowDefault: true
  3425. });
  3426. vm.$scope = app;
  3427. var globalData = app.globalData;
  3428. if (globalData) {
  3429. Object.keys(appOptions.globalData).forEach(function (name) {
  3430. if (!hasOwn(globalData, name)) {
  3431. globalData[name] = appOptions.globalData[name];
  3432. }
  3433. });
  3434. }
  3435. Object.keys(appOptions).forEach(function (name) {
  3436. if (!hasOwn(app, name)) {
  3437. app[name] = appOptions[name];
  3438. }
  3439. });
  3440. if (isFn(appOptions.onShow) && wx.onAppShow) {
  3441. wx.onAppShow(function () {
  3442. for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
  3443. args[_key5] = arguments[_key5];
  3444. }
  3445. vm.__call_hook('onShow', args);
  3446. });
  3447. }
  3448. if (isFn(appOptions.onHide) && wx.onAppHide) {
  3449. wx.onAppHide(function () {
  3450. for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
  3451. args[_key6] = arguments[_key6];
  3452. }
  3453. vm.__call_hook('onHide', args);
  3454. });
  3455. }
  3456. if (isFn(appOptions.onLaunch)) {
  3457. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  3458. vm.__call_hook('onLaunch', args);
  3459. }
  3460. return vm;
  3461. }
  3462. function createPlugin(vm) {
  3463. var appOptions = parseApp(vm);
  3464. if (isFn(appOptions.onShow) && wx.onAppShow) {
  3465. wx.onAppShow(function () {
  3466. for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
  3467. args[_key7] = arguments[_key7];
  3468. }
  3469. vm.__call_hook('onShow', args);
  3470. });
  3471. }
  3472. if (isFn(appOptions.onHide) && wx.onAppHide) {
  3473. wx.onAppHide(function () {
  3474. for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
  3475. args[_key8] = arguments[_key8];
  3476. }
  3477. vm.__call_hook('onHide', args);
  3478. });
  3479. }
  3480. if (isFn(appOptions.onLaunch)) {
  3481. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  3482. vm.__call_hook('onLaunch', args);
  3483. }
  3484. return vm;
  3485. }
  3486. todos.forEach(function (todoApi) {
  3487. protocols[todoApi] = false;
  3488. });
  3489. canIUses.forEach(function (canIUseApi) {
  3490. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name : canIUseApi;
  3491. if (!wx.canIUse(apiName)) {
  3492. protocols[canIUseApi] = false;
  3493. }
  3494. });
  3495. var uni = {};
  3496. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  3497. uni = new Proxy({}, {
  3498. get: function get(target, name) {
  3499. if (hasOwn(target, name)) {
  3500. return target[name];
  3501. }
  3502. if (baseApi[name]) {
  3503. return baseApi[name];
  3504. }
  3505. if (api[name]) {
  3506. return promisify(name, api[name]);
  3507. }
  3508. {
  3509. if (extraApi[name]) {
  3510. return promisify(name, extraApi[name]);
  3511. }
  3512. if (todoApis[name]) {
  3513. return promisify(name, todoApis[name]);
  3514. }
  3515. }
  3516. if (eventApi[name]) {
  3517. return eventApi[name];
  3518. }
  3519. return promisify(name, wrapper(name, wx[name]));
  3520. },
  3521. set: function set(target, name, value) {
  3522. target[name] = value;
  3523. return true;
  3524. }
  3525. });
  3526. } else {
  3527. Object.keys(baseApi).forEach(function (name) {
  3528. uni[name] = baseApi[name];
  3529. });
  3530. {
  3531. Object.keys(todoApis).forEach(function (name) {
  3532. uni[name] = promisify(name, todoApis[name]);
  3533. });
  3534. Object.keys(extraApi).forEach(function (name) {
  3535. uni[name] = promisify(name, extraApi[name]);
  3536. });
  3537. }
  3538. Object.keys(eventApi).forEach(function (name) {
  3539. uni[name] = eventApi[name];
  3540. });
  3541. Object.keys(api).forEach(function (name) {
  3542. uni[name] = promisify(name, api[name]);
  3543. });
  3544. Object.keys(wx).forEach(function (name) {
  3545. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  3546. uni[name] = promisify(name, wrapper(name, wx[name]));
  3547. }
  3548. });
  3549. }
  3550. wx.createApp = createApp;
  3551. wx.createPage = createPage;
  3552. wx.createComponent = createComponent;
  3553. wx.createSubpackageApp = createSubpackageApp;
  3554. wx.createPlugin = createPlugin;
  3555. var uni$1 = uni;
  3556. var _default = uni$1;
  3557. exports.default = _default;
  3558. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"], __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 3)))
  3559. /***/ }),
  3560. /***/ 20:
  3561. /*!****************************************************************!*\
  3562. !*** ./node_modules/@babel/runtime/helpers/iterableToArray.js ***!
  3563. \****************************************************************/
  3564. /*! no static exports found */
  3565. /***/ (function(module, exports) {
  3566. function _iterableToArray(iter) {
  3567. if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  3568. }
  3569. module.exports = _iterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3570. /***/ }),
  3571. /***/ 21:
  3572. /*!******************************************************************!*\
  3573. !*** ./node_modules/@babel/runtime/helpers/nonIterableSpread.js ***!
  3574. \******************************************************************/
  3575. /*! no static exports found */
  3576. /***/ (function(module, exports) {
  3577. function _nonIterableSpread() {
  3578. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  3579. }
  3580. module.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3581. /***/ }),
  3582. /***/ 22:
  3583. /*!*************************************************************!*\
  3584. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  3585. \*************************************************************/
  3586. /*! no static exports found */
  3587. /***/ (function(module, exports, __webpack_require__) {
  3588. "use strict";
  3589. /* WEBPACK VAR INJECTION */(function(uni, global) {
  3590. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  3591. Object.defineProperty(exports, "__esModule", {
  3592. value: true
  3593. });
  3594. exports.LOCALE_ZH_HANT = exports.LOCALE_ZH_HANS = exports.LOCALE_FR = exports.LOCALE_ES = exports.LOCALE_EN = exports.I18n = exports.Formatter = void 0;
  3595. exports.compileI18nJsonStr = compileI18nJsonStr;
  3596. exports.hasI18nJson = hasI18nJson;
  3597. exports.initVueI18n = initVueI18n;
  3598. exports.isI18nStr = isI18nStr;
  3599. exports.isString = void 0;
  3600. exports.normalizeLocale = normalizeLocale;
  3601. exports.parseI18nJson = parseI18nJson;
  3602. exports.resolveLocale = resolveLocale;
  3603. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  3604. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  3605. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  3606. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  3607. var isObject = function isObject(val) {
  3608. return val !== null && (0, _typeof2.default)(val) === 'object';
  3609. };
  3610. var defaultDelimiters = ['{', '}'];
  3611. var BaseFormatter = /*#__PURE__*/function () {
  3612. function BaseFormatter() {
  3613. (0, _classCallCheck2.default)(this, BaseFormatter);
  3614. this._caches = Object.create(null);
  3615. }
  3616. (0, _createClass2.default)(BaseFormatter, [{
  3617. key: "interpolate",
  3618. value: function interpolate(message, values) {
  3619. var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  3620. if (!values) {
  3621. return [message];
  3622. }
  3623. var tokens = this._caches[message];
  3624. if (!tokens) {
  3625. tokens = parse(message, delimiters);
  3626. this._caches[message] = tokens;
  3627. }
  3628. return compile(tokens, values);
  3629. }
  3630. }]);
  3631. return BaseFormatter;
  3632. }();
  3633. exports.Formatter = BaseFormatter;
  3634. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  3635. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  3636. function parse(format, _ref) {
  3637. var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
  3638. startDelimiter = _ref2[0],
  3639. endDelimiter = _ref2[1];
  3640. var tokens = [];
  3641. var position = 0;
  3642. var text = '';
  3643. while (position < format.length) {
  3644. var char = format[position++];
  3645. if (char === startDelimiter) {
  3646. if (text) {
  3647. tokens.push({
  3648. type: 'text',
  3649. value: text
  3650. });
  3651. }
  3652. text = '';
  3653. var sub = '';
  3654. char = format[position++];
  3655. while (char !== undefined && char !== endDelimiter) {
  3656. sub += char;
  3657. char = format[position++];
  3658. }
  3659. var isClosed = char === endDelimiter;
  3660. var type = RE_TOKEN_LIST_VALUE.test(sub) ? 'list' : isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ? 'named' : 'unknown';
  3661. tokens.push({
  3662. value: sub,
  3663. type: type
  3664. });
  3665. }
  3666. // else if (char === '%') {
  3667. // // when found rails i18n syntax, skip text capture
  3668. // if (format[position] !== '{') {
  3669. // text += char
  3670. // }
  3671. // }
  3672. else {
  3673. text += char;
  3674. }
  3675. }
  3676. text && tokens.push({
  3677. type: 'text',
  3678. value: text
  3679. });
  3680. return tokens;
  3681. }
  3682. function compile(tokens, values) {
  3683. var compiled = [];
  3684. var index = 0;
  3685. var mode = Array.isArray(values) ? 'list' : isObject(values) ? 'named' : 'unknown';
  3686. if (mode === 'unknown') {
  3687. return compiled;
  3688. }
  3689. while (index < tokens.length) {
  3690. var token = tokens[index];
  3691. switch (token.type) {
  3692. case 'text':
  3693. compiled.push(token.value);
  3694. break;
  3695. case 'list':
  3696. compiled.push(values[parseInt(token.value, 10)]);
  3697. break;
  3698. case 'named':
  3699. if (mode === 'named') {
  3700. compiled.push(values[token.value]);
  3701. } else {
  3702. if (true) {
  3703. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  3704. }
  3705. }
  3706. break;
  3707. case 'unknown':
  3708. if (true) {
  3709. console.warn("Detect 'unknown' type of token!");
  3710. }
  3711. break;
  3712. }
  3713. index++;
  3714. }
  3715. return compiled;
  3716. }
  3717. var LOCALE_ZH_HANS = 'zh-Hans';
  3718. exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  3719. var LOCALE_ZH_HANT = 'zh-Hant';
  3720. exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  3721. var LOCALE_EN = 'en';
  3722. exports.LOCALE_EN = LOCALE_EN;
  3723. var LOCALE_FR = 'fr';
  3724. exports.LOCALE_FR = LOCALE_FR;
  3725. var LOCALE_ES = 'es';
  3726. exports.LOCALE_ES = LOCALE_ES;
  3727. var hasOwnProperty = Object.prototype.hasOwnProperty;
  3728. var hasOwn = function hasOwn(val, key) {
  3729. return hasOwnProperty.call(val, key);
  3730. };
  3731. var defaultFormatter = new BaseFormatter();
  3732. function include(str, parts) {
  3733. return !!parts.find(function (part) {
  3734. return str.indexOf(part) !== -1;
  3735. });
  3736. }
  3737. function startsWith(str, parts) {
  3738. return parts.find(function (part) {
  3739. return str.indexOf(part) === 0;
  3740. });
  3741. }
  3742. function normalizeLocale(locale, messages) {
  3743. if (!locale) {
  3744. return;
  3745. }
  3746. locale = locale.trim().replace(/_/g, '-');
  3747. if (messages && messages[locale]) {
  3748. return locale;
  3749. }
  3750. locale = locale.toLowerCase();
  3751. if (locale === 'chinese') {
  3752. // 支付宝
  3753. return LOCALE_ZH_HANS;
  3754. }
  3755. if (locale.indexOf('zh') === 0) {
  3756. if (locale.indexOf('-hans') > -1) {
  3757. return LOCALE_ZH_HANS;
  3758. }
  3759. if (locale.indexOf('-hant') > -1) {
  3760. return LOCALE_ZH_HANT;
  3761. }
  3762. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  3763. return LOCALE_ZH_HANT;
  3764. }
  3765. return LOCALE_ZH_HANS;
  3766. }
  3767. var locales = [LOCALE_EN, LOCALE_FR, LOCALE_ES];
  3768. if (messages && Object.keys(messages).length > 0) {
  3769. locales = Object.keys(messages);
  3770. }
  3771. var lang = startsWith(locale, locales);
  3772. if (lang) {
  3773. return lang;
  3774. }
  3775. }
  3776. var I18n = /*#__PURE__*/function () {
  3777. function I18n(_ref3) {
  3778. var locale = _ref3.locale,
  3779. fallbackLocale = _ref3.fallbackLocale,
  3780. messages = _ref3.messages,
  3781. watcher = _ref3.watcher,
  3782. formater = _ref3.formater;
  3783. (0, _classCallCheck2.default)(this, I18n);
  3784. this.locale = LOCALE_EN;
  3785. this.fallbackLocale = LOCALE_EN;
  3786. this.message = {};
  3787. this.messages = {};
  3788. this.watchers = [];
  3789. if (fallbackLocale) {
  3790. this.fallbackLocale = fallbackLocale;
  3791. }
  3792. this.formater = formater || defaultFormatter;
  3793. this.messages = messages || {};
  3794. this.setLocale(locale || LOCALE_EN);
  3795. if (watcher) {
  3796. this.watchLocale(watcher);
  3797. }
  3798. }
  3799. (0, _createClass2.default)(I18n, [{
  3800. key: "setLocale",
  3801. value: function setLocale(locale) {
  3802. var _this = this;
  3803. var oldLocale = this.locale;
  3804. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  3805. if (!this.messages[this.locale]) {
  3806. // 可能初始化时不存在
  3807. this.messages[this.locale] = {};
  3808. }
  3809. this.message = this.messages[this.locale];
  3810. // 仅发生变化时,通知
  3811. if (oldLocale !== this.locale) {
  3812. this.watchers.forEach(function (watcher) {
  3813. watcher(_this.locale, oldLocale);
  3814. });
  3815. }
  3816. }
  3817. }, {
  3818. key: "getLocale",
  3819. value: function getLocale() {
  3820. return this.locale;
  3821. }
  3822. }, {
  3823. key: "watchLocale",
  3824. value: function watchLocale(fn) {
  3825. var _this2 = this;
  3826. var index = this.watchers.push(fn) - 1;
  3827. return function () {
  3828. _this2.watchers.splice(index, 1);
  3829. };
  3830. }
  3831. }, {
  3832. key: "add",
  3833. value: function add(locale, message) {
  3834. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  3835. var curMessages = this.messages[locale];
  3836. if (curMessages) {
  3837. if (override) {
  3838. Object.assign(curMessages, message);
  3839. } else {
  3840. Object.keys(message).forEach(function (key) {
  3841. if (!hasOwn(curMessages, key)) {
  3842. curMessages[key] = message[key];
  3843. }
  3844. });
  3845. }
  3846. } else {
  3847. this.messages[locale] = message;
  3848. }
  3849. }
  3850. }, {
  3851. key: "f",
  3852. value: function f(message, values, delimiters) {
  3853. return this.formater.interpolate(message, values, delimiters).join('');
  3854. }
  3855. }, {
  3856. key: "t",
  3857. value: function t(key, locale, values) {
  3858. var message = this.message;
  3859. if (typeof locale === 'string') {
  3860. locale = normalizeLocale(locale, this.messages);
  3861. locale && (message = this.messages[locale]);
  3862. } else {
  3863. values = locale;
  3864. }
  3865. if (!hasOwn(message, key)) {
  3866. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  3867. return key;
  3868. }
  3869. return this.formater.interpolate(message[key], values).join('');
  3870. }
  3871. }]);
  3872. return I18n;
  3873. }();
  3874. exports.I18n = I18n;
  3875. function watchAppLocale(appVm, i18n) {
  3876. // 需要保证 watch 的触发在组件渲染之前
  3877. if (appVm.$watchLocale) {
  3878. // vue2
  3879. appVm.$watchLocale(function (newLocale) {
  3880. i18n.setLocale(newLocale);
  3881. });
  3882. } else {
  3883. appVm.$watch(function () {
  3884. return appVm.$locale;
  3885. }, function (newLocale) {
  3886. i18n.setLocale(newLocale);
  3887. });
  3888. }
  3889. }
  3890. function getDefaultLocale() {
  3891. if (typeof uni !== 'undefined' && uni.getLocale) {
  3892. return uni.getLocale();
  3893. }
  3894. // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
  3895. if (typeof global !== 'undefined' && global.getLocale) {
  3896. return global.getLocale();
  3897. }
  3898. return LOCALE_EN;
  3899. }
  3900. function initVueI18n(locale) {
  3901. var messages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  3902. var fallbackLocale = arguments.length > 2 ? arguments[2] : undefined;
  3903. var watcher = arguments.length > 3 ? arguments[3] : undefined;
  3904. // 兼容旧版本入参
  3905. if (typeof locale !== 'string') {
  3906. var _ref4 = [messages, locale];
  3907. locale = _ref4[0];
  3908. messages = _ref4[1];
  3909. }
  3910. if (typeof locale !== 'string') {
  3911. // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
  3912. locale = getDefaultLocale();
  3913. }
  3914. if (typeof fallbackLocale !== 'string') {
  3915. fallbackLocale = typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale || LOCALE_EN;
  3916. }
  3917. var i18n = new I18n({
  3918. locale: locale,
  3919. fallbackLocale: fallbackLocale,
  3920. messages: messages,
  3921. watcher: watcher
  3922. });
  3923. var _t = function t(key, values) {
  3924. if (typeof getApp !== 'function') {
  3925. // app view
  3926. /* eslint-disable no-func-assign */
  3927. _t = function t(key, values) {
  3928. return i18n.t(key, values);
  3929. };
  3930. } else {
  3931. var isWatchedAppLocale = false;
  3932. _t = function t(key, values) {
  3933. var appVm = getApp().$vm;
  3934. // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
  3935. // options: {
  3936. // type: Array,
  3937. // default () {
  3938. // return [{
  3939. // icon: 'shop',
  3940. // text: t("uni-goods-nav.options.shop"),
  3941. // }, {
  3942. // icon: 'cart',
  3943. // text: t("uni-goods-nav.options.cart")
  3944. // }]
  3945. // }
  3946. // },
  3947. if (appVm) {
  3948. // 触发响应式
  3949. appVm.$locale;
  3950. if (!isWatchedAppLocale) {
  3951. isWatchedAppLocale = true;
  3952. watchAppLocale(appVm, i18n);
  3953. }
  3954. }
  3955. return i18n.t(key, values);
  3956. };
  3957. }
  3958. return _t(key, values);
  3959. };
  3960. return {
  3961. i18n: i18n,
  3962. f: function f(message, values, delimiters) {
  3963. return i18n.f(message, values, delimiters);
  3964. },
  3965. t: function t(key, values) {
  3966. return _t(key, values);
  3967. },
  3968. add: function add(locale, message) {
  3969. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  3970. return i18n.add(locale, message, override);
  3971. },
  3972. watch: function watch(fn) {
  3973. return i18n.watchLocale(fn);
  3974. },
  3975. getLocale: function getLocale() {
  3976. return i18n.getLocale();
  3977. },
  3978. setLocale: function setLocale(newLocale) {
  3979. return i18n.setLocale(newLocale);
  3980. }
  3981. };
  3982. }
  3983. var isString = function isString(val) {
  3984. return typeof val === 'string';
  3985. };
  3986. exports.isString = isString;
  3987. var formater;
  3988. function hasI18nJson(jsonObj, delimiters) {
  3989. if (!formater) {
  3990. formater = new BaseFormatter();
  3991. }
  3992. return walkJsonObj(jsonObj, function (jsonObj, key) {
  3993. var value = jsonObj[key];
  3994. if (isString(value)) {
  3995. if (isI18nStr(value, delimiters)) {
  3996. return true;
  3997. }
  3998. } else {
  3999. return hasI18nJson(value, delimiters);
  4000. }
  4001. });
  4002. }
  4003. function parseI18nJson(jsonObj, values, delimiters) {
  4004. if (!formater) {
  4005. formater = new BaseFormatter();
  4006. }
  4007. walkJsonObj(jsonObj, function (jsonObj, key) {
  4008. var value = jsonObj[key];
  4009. if (isString(value)) {
  4010. if (isI18nStr(value, delimiters)) {
  4011. jsonObj[key] = compileStr(value, values, delimiters);
  4012. }
  4013. } else {
  4014. parseI18nJson(value, values, delimiters);
  4015. }
  4016. });
  4017. return jsonObj;
  4018. }
  4019. function compileI18nJsonStr(jsonStr, _ref5) {
  4020. var locale = _ref5.locale,
  4021. locales = _ref5.locales,
  4022. delimiters = _ref5.delimiters;
  4023. if (!isI18nStr(jsonStr, delimiters)) {
  4024. return jsonStr;
  4025. }
  4026. if (!formater) {
  4027. formater = new BaseFormatter();
  4028. }
  4029. var localeValues = [];
  4030. Object.keys(locales).forEach(function (name) {
  4031. if (name !== locale) {
  4032. localeValues.push({
  4033. locale: name,
  4034. values: locales[name]
  4035. });
  4036. }
  4037. });
  4038. localeValues.unshift({
  4039. locale: locale,
  4040. values: locales[locale]
  4041. });
  4042. try {
  4043. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  4044. } catch (e) {}
  4045. return jsonStr;
  4046. }
  4047. function isI18nStr(value, delimiters) {
  4048. return value.indexOf(delimiters[0]) > -1;
  4049. }
  4050. function compileStr(value, values, delimiters) {
  4051. return formater.interpolate(value, values, delimiters).join('');
  4052. }
  4053. function compileValue(jsonObj, key, localeValues, delimiters) {
  4054. var value = jsonObj[key];
  4055. if (isString(value)) {
  4056. // 存在国际化
  4057. if (isI18nStr(value, delimiters)) {
  4058. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  4059. if (localeValues.length > 1) {
  4060. // 格式化国际化语言
  4061. var valueLocales = jsonObj[key + 'Locales'] = {};
  4062. localeValues.forEach(function (localValue) {
  4063. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  4064. });
  4065. }
  4066. }
  4067. } else {
  4068. compileJsonObj(value, localeValues, delimiters);
  4069. }
  4070. }
  4071. function compileJsonObj(jsonObj, localeValues, delimiters) {
  4072. walkJsonObj(jsonObj, function (jsonObj, key) {
  4073. compileValue(jsonObj, key, localeValues, delimiters);
  4074. });
  4075. return jsonObj;
  4076. }
  4077. function walkJsonObj(jsonObj, walk) {
  4078. if (Array.isArray(jsonObj)) {
  4079. for (var i = 0; i < jsonObj.length; i++) {
  4080. if (walk(jsonObj, i)) {
  4081. return true;
  4082. }
  4083. }
  4084. } else if (isObject(jsonObj)) {
  4085. for (var key in jsonObj) {
  4086. if (walk(jsonObj, key)) {
  4087. return true;
  4088. }
  4089. }
  4090. }
  4091. return false;
  4092. }
  4093. function resolveLocale(locales) {
  4094. return function (locale) {
  4095. if (!locale) {
  4096. return locale;
  4097. }
  4098. locale = normalizeLocale(locale) || locale;
  4099. return resolveLocaleChain(locale).find(function (locale) {
  4100. return locales.indexOf(locale) > -1;
  4101. });
  4102. };
  4103. }
  4104. function resolveLocaleChain(locale) {
  4105. var chain = [];
  4106. var tokens = locale.split('-');
  4107. while (tokens.length) {
  4108. chain.push(tokens.join('-'));
  4109. tokens.pop();
  4110. }
  4111. return chain;
  4112. }
  4113. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"], __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 3)))
  4114. /***/ }),
  4115. /***/ 23:
  4116. /*!***************************************************************!*\
  4117. !*** ./node_modules/@babel/runtime/helpers/classCallCheck.js ***!
  4118. \***************************************************************/
  4119. /*! no static exports found */
  4120. /***/ (function(module, exports) {
  4121. function _classCallCheck(instance, Constructor) {
  4122. if (!(instance instanceof Constructor)) {
  4123. throw new TypeError("Cannot call a class as a function");
  4124. }
  4125. }
  4126. module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
  4127. /***/ }),
  4128. /***/ 24:
  4129. /*!************************************************************!*\
  4130. !*** ./node_modules/@babel/runtime/helpers/createClass.js ***!
  4131. \************************************************************/
  4132. /*! no static exports found */
  4133. /***/ (function(module, exports, __webpack_require__) {
  4134. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
  4135. function _defineProperties(target, props) {
  4136. for (var i = 0; i < props.length; i++) {
  4137. var descriptor = props[i];
  4138. descriptor.enumerable = descriptor.enumerable || false;
  4139. descriptor.configurable = true;
  4140. if ("value" in descriptor) descriptor.writable = true;
  4141. Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
  4142. }
  4143. }
  4144. function _createClass(Constructor, protoProps, staticProps) {
  4145. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  4146. if (staticProps) _defineProperties(Constructor, staticProps);
  4147. Object.defineProperty(Constructor, "prototype", {
  4148. writable: false
  4149. });
  4150. return Constructor;
  4151. }
  4152. module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
  4153. /***/ }),
  4154. /***/ 25:
  4155. /*!******************************************************************************************!*\
  4156. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  4157. \******************************************************************************************/
  4158. /*! exports provided: default */
  4159. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4160. "use strict";
  4161. __webpack_require__.r(__webpack_exports__);
  4162. /* WEBPACK VAR INJECTION */(function(global) {/*!
  4163. * Vue.js v2.6.11
  4164. * (c) 2014-2023 Evan You
  4165. * Released under the MIT License.
  4166. */
  4167. /* */
  4168. var emptyObject = Object.freeze({});
  4169. // These helpers produce better VM code in JS engines due to their
  4170. // explicitness and function inlining.
  4171. function isUndef (v) {
  4172. return v === undefined || v === null
  4173. }
  4174. function isDef (v) {
  4175. return v !== undefined && v !== null
  4176. }
  4177. function isTrue (v) {
  4178. return v === true
  4179. }
  4180. function isFalse (v) {
  4181. return v === false
  4182. }
  4183. /**
  4184. * Check if value is primitive.
  4185. */
  4186. function isPrimitive (value) {
  4187. return (
  4188. typeof value === 'string' ||
  4189. typeof value === 'number' ||
  4190. // $flow-disable-line
  4191. typeof value === 'symbol' ||
  4192. typeof value === 'boolean'
  4193. )
  4194. }
  4195. /**
  4196. * Quick object check - this is primarily used to tell
  4197. * Objects from primitive values when we know the value
  4198. * is a JSON-compliant type.
  4199. */
  4200. function isObject (obj) {
  4201. return obj !== null && typeof obj === 'object'
  4202. }
  4203. /**
  4204. * Get the raw type string of a value, e.g., [object Object].
  4205. */
  4206. var _toString = Object.prototype.toString;
  4207. function toRawType (value) {
  4208. return _toString.call(value).slice(8, -1)
  4209. }
  4210. /**
  4211. * Strict object type check. Only returns true
  4212. * for plain JavaScript objects.
  4213. */
  4214. function isPlainObject (obj) {
  4215. return _toString.call(obj) === '[object Object]'
  4216. }
  4217. function isRegExp (v) {
  4218. return _toString.call(v) === '[object RegExp]'
  4219. }
  4220. /**
  4221. * Check if val is a valid array index.
  4222. */
  4223. function isValidArrayIndex (val) {
  4224. var n = parseFloat(String(val));
  4225. return n >= 0 && Math.floor(n) === n && isFinite(val)
  4226. }
  4227. function isPromise (val) {
  4228. return (
  4229. isDef(val) &&
  4230. typeof val.then === 'function' &&
  4231. typeof val.catch === 'function'
  4232. )
  4233. }
  4234. /**
  4235. * Convert a value to a string that is actually rendered.
  4236. */
  4237. function toString (val) {
  4238. return val == null
  4239. ? ''
  4240. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  4241. ? JSON.stringify(val, null, 2)
  4242. : String(val)
  4243. }
  4244. /**
  4245. * Convert an input value to a number for persistence.
  4246. * If the conversion fails, return original string.
  4247. */
  4248. function toNumber (val) {
  4249. var n = parseFloat(val);
  4250. return isNaN(n) ? val : n
  4251. }
  4252. /**
  4253. * Make a map and return a function for checking if a key
  4254. * is in that map.
  4255. */
  4256. function makeMap (
  4257. str,
  4258. expectsLowerCase
  4259. ) {
  4260. var map = Object.create(null);
  4261. var list = str.split(',');
  4262. for (var i = 0; i < list.length; i++) {
  4263. map[list[i]] = true;
  4264. }
  4265. return expectsLowerCase
  4266. ? function (val) { return map[val.toLowerCase()]; }
  4267. : function (val) { return map[val]; }
  4268. }
  4269. /**
  4270. * Check if a tag is a built-in tag.
  4271. */
  4272. var isBuiltInTag = makeMap('slot,component', true);
  4273. /**
  4274. * Check if an attribute is a reserved attribute.
  4275. */
  4276. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  4277. /**
  4278. * Remove an item from an array.
  4279. */
  4280. function remove (arr, item) {
  4281. if (arr.length) {
  4282. var index = arr.indexOf(item);
  4283. if (index > -1) {
  4284. return arr.splice(index, 1)
  4285. }
  4286. }
  4287. }
  4288. /**
  4289. * Check whether an object has the property.
  4290. */
  4291. var hasOwnProperty = Object.prototype.hasOwnProperty;
  4292. function hasOwn (obj, key) {
  4293. return hasOwnProperty.call(obj, key)
  4294. }
  4295. /**
  4296. * Create a cached version of a pure function.
  4297. */
  4298. function cached (fn) {
  4299. var cache = Object.create(null);
  4300. return (function cachedFn (str) {
  4301. var hit = cache[str];
  4302. return hit || (cache[str] = fn(str))
  4303. })
  4304. }
  4305. /**
  4306. * Camelize a hyphen-delimited string.
  4307. */
  4308. var camelizeRE = /-(\w)/g;
  4309. var camelize = cached(function (str) {
  4310. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  4311. });
  4312. /**
  4313. * Capitalize a string.
  4314. */
  4315. var capitalize = cached(function (str) {
  4316. return str.charAt(0).toUpperCase() + str.slice(1)
  4317. });
  4318. /**
  4319. * Hyphenate a camelCase string.
  4320. */
  4321. var hyphenateRE = /\B([A-Z])/g;
  4322. var hyphenate = cached(function (str) {
  4323. return str.replace(hyphenateRE, '-$1').toLowerCase()
  4324. });
  4325. /**
  4326. * Simple bind polyfill for environments that do not support it,
  4327. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  4328. * since native bind is now performant enough in most browsers.
  4329. * But removing it would mean breaking code that was able to run in
  4330. * PhantomJS 1.x, so this must be kept for backward compatibility.
  4331. */
  4332. /* istanbul ignore next */
  4333. function polyfillBind (fn, ctx) {
  4334. function boundFn (a) {
  4335. var l = arguments.length;
  4336. return l
  4337. ? l > 1
  4338. ? fn.apply(ctx, arguments)
  4339. : fn.call(ctx, a)
  4340. : fn.call(ctx)
  4341. }
  4342. boundFn._length = fn.length;
  4343. return boundFn
  4344. }
  4345. function nativeBind (fn, ctx) {
  4346. return fn.bind(ctx)
  4347. }
  4348. var bind = Function.prototype.bind
  4349. ? nativeBind
  4350. : polyfillBind;
  4351. /**
  4352. * Convert an Array-like object to a real Array.
  4353. */
  4354. function toArray (list, start) {
  4355. start = start || 0;
  4356. var i = list.length - start;
  4357. var ret = new Array(i);
  4358. while (i--) {
  4359. ret[i] = list[i + start];
  4360. }
  4361. return ret
  4362. }
  4363. /**
  4364. * Mix properties into target object.
  4365. */
  4366. function extend (to, _from) {
  4367. for (var key in _from) {
  4368. to[key] = _from[key];
  4369. }
  4370. return to
  4371. }
  4372. /**
  4373. * Merge an Array of Objects into a single Object.
  4374. */
  4375. function toObject (arr) {
  4376. var res = {};
  4377. for (var i = 0; i < arr.length; i++) {
  4378. if (arr[i]) {
  4379. extend(res, arr[i]);
  4380. }
  4381. }
  4382. return res
  4383. }
  4384. /* eslint-disable no-unused-vars */
  4385. /**
  4386. * Perform no operation.
  4387. * Stubbing args to make Flow happy without leaving useless transpiled code
  4388. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  4389. */
  4390. function noop (a, b, c) {}
  4391. /**
  4392. * Always return false.
  4393. */
  4394. var no = function (a, b, c) { return false; };
  4395. /* eslint-enable no-unused-vars */
  4396. /**
  4397. * Return the same value.
  4398. */
  4399. var identity = function (_) { return _; };
  4400. /**
  4401. * Check if two values are loosely equal - that is,
  4402. * if they are plain objects, do they have the same shape?
  4403. */
  4404. function looseEqual (a, b) {
  4405. if (a === b) { return true }
  4406. var isObjectA = isObject(a);
  4407. var isObjectB = isObject(b);
  4408. if (isObjectA && isObjectB) {
  4409. try {
  4410. var isArrayA = Array.isArray(a);
  4411. var isArrayB = Array.isArray(b);
  4412. if (isArrayA && isArrayB) {
  4413. return a.length === b.length && a.every(function (e, i) {
  4414. return looseEqual(e, b[i])
  4415. })
  4416. } else if (a instanceof Date && b instanceof Date) {
  4417. return a.getTime() === b.getTime()
  4418. } else if (!isArrayA && !isArrayB) {
  4419. var keysA = Object.keys(a);
  4420. var keysB = Object.keys(b);
  4421. return keysA.length === keysB.length && keysA.every(function (key) {
  4422. return looseEqual(a[key], b[key])
  4423. })
  4424. } else {
  4425. /* istanbul ignore next */
  4426. return false
  4427. }
  4428. } catch (e) {
  4429. /* istanbul ignore next */
  4430. return false
  4431. }
  4432. } else if (!isObjectA && !isObjectB) {
  4433. return String(a) === String(b)
  4434. } else {
  4435. return false
  4436. }
  4437. }
  4438. /**
  4439. * Return the first index at which a loosely equal value can be
  4440. * found in the array (if value is a plain object, the array must
  4441. * contain an object of the same shape), or -1 if it is not present.
  4442. */
  4443. function looseIndexOf (arr, val) {
  4444. for (var i = 0; i < arr.length; i++) {
  4445. if (looseEqual(arr[i], val)) { return i }
  4446. }
  4447. return -1
  4448. }
  4449. /**
  4450. * Ensure a function is called only once.
  4451. */
  4452. function once (fn) {
  4453. var called = false;
  4454. return function () {
  4455. if (!called) {
  4456. called = true;
  4457. fn.apply(this, arguments);
  4458. }
  4459. }
  4460. }
  4461. var ASSET_TYPES = [
  4462. 'component',
  4463. 'directive',
  4464. 'filter'
  4465. ];
  4466. var LIFECYCLE_HOOKS = [
  4467. 'beforeCreate',
  4468. 'created',
  4469. 'beforeMount',
  4470. 'mounted',
  4471. 'beforeUpdate',
  4472. 'updated',
  4473. 'beforeDestroy',
  4474. 'destroyed',
  4475. 'activated',
  4476. 'deactivated',
  4477. 'errorCaptured',
  4478. 'serverPrefetch'
  4479. ];
  4480. /* */
  4481. var config = ({
  4482. /**
  4483. * Option merge strategies (used in core/util/options)
  4484. */
  4485. // $flow-disable-line
  4486. optionMergeStrategies: Object.create(null),
  4487. /**
  4488. * Whether to suppress warnings.
  4489. */
  4490. silent: false,
  4491. /**
  4492. * Show production mode tip message on boot?
  4493. */
  4494. productionTip: "development" !== 'production',
  4495. /**
  4496. * Whether to enable devtools
  4497. */
  4498. devtools: "development" !== 'production',
  4499. /**
  4500. * Whether to record perf
  4501. */
  4502. performance: false,
  4503. /**
  4504. * Error handler for watcher errors
  4505. */
  4506. errorHandler: null,
  4507. /**
  4508. * Warn handler for watcher warns
  4509. */
  4510. warnHandler: null,
  4511. /**
  4512. * Ignore certain custom elements
  4513. */
  4514. ignoredElements: [],
  4515. /**
  4516. * Custom user key aliases for v-on
  4517. */
  4518. // $flow-disable-line
  4519. keyCodes: Object.create(null),
  4520. /**
  4521. * Check if a tag is reserved so that it cannot be registered as a
  4522. * component. This is platform-dependent and may be overwritten.
  4523. */
  4524. isReservedTag: no,
  4525. /**
  4526. * Check if an attribute is reserved so that it cannot be used as a component
  4527. * prop. This is platform-dependent and may be overwritten.
  4528. */
  4529. isReservedAttr: no,
  4530. /**
  4531. * Check if a tag is an unknown element.
  4532. * Platform-dependent.
  4533. */
  4534. isUnknownElement: no,
  4535. /**
  4536. * Get the namespace of an element
  4537. */
  4538. getTagNamespace: noop,
  4539. /**
  4540. * Parse the real tag name for the specific platform.
  4541. */
  4542. parsePlatformTagName: identity,
  4543. /**
  4544. * Check if an attribute must be bound using property, e.g. value
  4545. * Platform-dependent.
  4546. */
  4547. mustUseProp: no,
  4548. /**
  4549. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  4550. * This will significantly reduce performance if set to false.
  4551. */
  4552. async: true,
  4553. /**
  4554. * Exposed for legacy reasons
  4555. */
  4556. _lifecycleHooks: LIFECYCLE_HOOKS
  4557. });
  4558. /* */
  4559. /**
  4560. * unicode letters used for parsing html tags, component names and property paths.
  4561. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  4562. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  4563. */
  4564. 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/;
  4565. /**
  4566. * Check if a string starts with $ or _
  4567. */
  4568. function isReserved (str) {
  4569. var c = (str + '').charCodeAt(0);
  4570. return c === 0x24 || c === 0x5F
  4571. }
  4572. /**
  4573. * Define a property.
  4574. */
  4575. function def (obj, key, val, enumerable) {
  4576. Object.defineProperty(obj, key, {
  4577. value: val,
  4578. enumerable: !!enumerable,
  4579. writable: true,
  4580. configurable: true
  4581. });
  4582. }
  4583. /**
  4584. * Parse simple path.
  4585. */
  4586. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  4587. function parsePath (path) {
  4588. if (bailRE.test(path)) {
  4589. return
  4590. }
  4591. var segments = path.split('.');
  4592. return function (obj) {
  4593. for (var i = 0; i < segments.length; i++) {
  4594. if (!obj) { return }
  4595. obj = obj[segments[i]];
  4596. }
  4597. return obj
  4598. }
  4599. }
  4600. /* */
  4601. // can we use __proto__?
  4602. var hasProto = '__proto__' in {};
  4603. // Browser environment sniffing
  4604. var inBrowser = typeof window !== 'undefined';
  4605. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  4606. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  4607. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  4608. var isIE = UA && /msie|trident/.test(UA);
  4609. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  4610. var isEdge = UA && UA.indexOf('edge/') > 0;
  4611. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  4612. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  4613. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  4614. var isPhantomJS = UA && /phantomjs/.test(UA);
  4615. var isFF = UA && UA.match(/firefox\/(\d+)/);
  4616. // Firefox has a "watch" function on Object.prototype...
  4617. var nativeWatch = ({}).watch;
  4618. if (inBrowser) {
  4619. try {
  4620. var opts = {};
  4621. Object.defineProperty(opts, 'passive', ({
  4622. get: function get () {
  4623. }
  4624. })); // https://github.com/facebook/flow/issues/285
  4625. window.addEventListener('test-passive', null, opts);
  4626. } catch (e) {}
  4627. }
  4628. // this needs to be lazy-evaled because vue may be required before
  4629. // vue-server-renderer can set VUE_ENV
  4630. var _isServer;
  4631. var isServerRendering = function () {
  4632. if (_isServer === undefined) {
  4633. /* istanbul ignore if */
  4634. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  4635. // detect presence of vue-server-renderer and avoid
  4636. // Webpack shimming the process
  4637. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  4638. } else {
  4639. _isServer = false;
  4640. }
  4641. }
  4642. return _isServer
  4643. };
  4644. // detect devtools
  4645. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  4646. /* istanbul ignore next */
  4647. function isNative (Ctor) {
  4648. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  4649. }
  4650. var hasSymbol =
  4651. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  4652. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  4653. var _Set;
  4654. /* istanbul ignore if */ // $flow-disable-line
  4655. if (typeof Set !== 'undefined' && isNative(Set)) {
  4656. // use native Set when available.
  4657. _Set = Set;
  4658. } else {
  4659. // a non-standard Set polyfill that only works with primitive keys.
  4660. _Set = /*@__PURE__*/(function () {
  4661. function Set () {
  4662. this.set = Object.create(null);
  4663. }
  4664. Set.prototype.has = function has (key) {
  4665. return this.set[key] === true
  4666. };
  4667. Set.prototype.add = function add (key) {
  4668. this.set[key] = true;
  4669. };
  4670. Set.prototype.clear = function clear () {
  4671. this.set = Object.create(null);
  4672. };
  4673. return Set;
  4674. }());
  4675. }
  4676. /* */
  4677. var warn = noop;
  4678. var tip = noop;
  4679. var generateComponentTrace = (noop); // work around flow check
  4680. var formatComponentName = (noop);
  4681. if (true) {
  4682. var hasConsole = typeof console !== 'undefined';
  4683. var classifyRE = /(?:^|[-_])(\w)/g;
  4684. var classify = function (str) { return str
  4685. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  4686. .replace(/[-_]/g, ''); };
  4687. warn = function (msg, vm) {
  4688. var trace = vm ? generateComponentTrace(vm) : '';
  4689. if (config.warnHandler) {
  4690. config.warnHandler.call(null, msg, vm, trace);
  4691. } else if (hasConsole && (!config.silent)) {
  4692. console.error(("[Vue warn]: " + msg + trace));
  4693. }
  4694. };
  4695. tip = function (msg, vm) {
  4696. if (hasConsole && (!config.silent)) {
  4697. console.warn("[Vue tip]: " + msg + (
  4698. vm ? generateComponentTrace(vm) : ''
  4699. ));
  4700. }
  4701. };
  4702. formatComponentName = function (vm, includeFile) {
  4703. if (vm.$root === vm) {
  4704. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  4705. return ('') + vm.$options.__file
  4706. }
  4707. return '<Root>'
  4708. }
  4709. var options = typeof vm === 'function' && vm.cid != null
  4710. ? vm.options
  4711. : vm._isVue
  4712. ? vm.$options || vm.constructor.options
  4713. : vm;
  4714. var name = options.name || options._componentTag;
  4715. var file = options.__file;
  4716. if (!name && file) {
  4717. var match = file.match(/([^/\\]+)\.vue$/);
  4718. name = match && match[1];
  4719. }
  4720. return (
  4721. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  4722. (file && includeFile !== false ? (" at " + file) : '')
  4723. )
  4724. };
  4725. var repeat = function (str, n) {
  4726. var res = '';
  4727. while (n) {
  4728. if (n % 2 === 1) { res += str; }
  4729. if (n > 1) { str += str; }
  4730. n >>= 1;
  4731. }
  4732. return res
  4733. };
  4734. generateComponentTrace = function (vm) {
  4735. if (vm._isVue && vm.$parent) {
  4736. var tree = [];
  4737. var currentRecursiveSequence = 0;
  4738. while (vm && vm.$options.name !== 'PageBody') {
  4739. if (tree.length > 0) {
  4740. var last = tree[tree.length - 1];
  4741. if (last.constructor === vm.constructor) {
  4742. currentRecursiveSequence++;
  4743. vm = vm.$parent;
  4744. continue
  4745. } else if (currentRecursiveSequence > 0) {
  4746. tree[tree.length - 1] = [last, currentRecursiveSequence];
  4747. currentRecursiveSequence = 0;
  4748. }
  4749. }
  4750. !vm.$options.isReserved && tree.push(vm);
  4751. vm = vm.$parent;
  4752. }
  4753. return '\n\nfound in\n\n' + tree
  4754. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  4755. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  4756. : formatComponentName(vm))); })
  4757. .join('\n')
  4758. } else {
  4759. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  4760. }
  4761. };
  4762. }
  4763. /* */
  4764. var uid = 0;
  4765. /**
  4766. * A dep is an observable that can have multiple
  4767. * directives subscribing to it.
  4768. */
  4769. var Dep = function Dep () {
  4770. this.id = uid++;
  4771. this.subs = [];
  4772. };
  4773. Dep.prototype.addSub = function addSub (sub) {
  4774. this.subs.push(sub);
  4775. };
  4776. Dep.prototype.removeSub = function removeSub (sub) {
  4777. remove(this.subs, sub);
  4778. };
  4779. Dep.prototype.depend = function depend () {
  4780. if (Dep.SharedObject.target) {
  4781. Dep.SharedObject.target.addDep(this);
  4782. }
  4783. };
  4784. Dep.prototype.notify = function notify () {
  4785. // stabilize the subscriber list first
  4786. var subs = this.subs.slice();
  4787. if ( true && !config.async) {
  4788. // subs aren't sorted in scheduler if not running async
  4789. // we need to sort them now to make sure they fire in correct
  4790. // order
  4791. subs.sort(function (a, b) { return a.id - b.id; });
  4792. }
  4793. for (var i = 0, l = subs.length; i < l; i++) {
  4794. subs[i].update();
  4795. }
  4796. };
  4797. // The current target watcher being evaluated.
  4798. // This is globally unique because only one watcher
  4799. // can be evaluated at a time.
  4800. // fixed by xxxxxx (nvue shared vuex)
  4801. /* eslint-disable no-undef */
  4802. Dep.SharedObject = {};
  4803. Dep.SharedObject.target = null;
  4804. Dep.SharedObject.targetStack = [];
  4805. function pushTarget (target) {
  4806. Dep.SharedObject.targetStack.push(target);
  4807. Dep.SharedObject.target = target;
  4808. Dep.target = target;
  4809. }
  4810. function popTarget () {
  4811. Dep.SharedObject.targetStack.pop();
  4812. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  4813. Dep.target = Dep.SharedObject.target;
  4814. }
  4815. /* */
  4816. var VNode = function VNode (
  4817. tag,
  4818. data,
  4819. children,
  4820. text,
  4821. elm,
  4822. context,
  4823. componentOptions,
  4824. asyncFactory
  4825. ) {
  4826. this.tag = tag;
  4827. this.data = data;
  4828. this.children = children;
  4829. this.text = text;
  4830. this.elm = elm;
  4831. this.ns = undefined;
  4832. this.context = context;
  4833. this.fnContext = undefined;
  4834. this.fnOptions = undefined;
  4835. this.fnScopeId = undefined;
  4836. this.key = data && data.key;
  4837. this.componentOptions = componentOptions;
  4838. this.componentInstance = undefined;
  4839. this.parent = undefined;
  4840. this.raw = false;
  4841. this.isStatic = false;
  4842. this.isRootInsert = true;
  4843. this.isComment = false;
  4844. this.isCloned = false;
  4845. this.isOnce = false;
  4846. this.asyncFactory = asyncFactory;
  4847. this.asyncMeta = undefined;
  4848. this.isAsyncPlaceholder = false;
  4849. };
  4850. var prototypeAccessors = { child: { configurable: true } };
  4851. // DEPRECATED: alias for componentInstance for backwards compat.
  4852. /* istanbul ignore next */
  4853. prototypeAccessors.child.get = function () {
  4854. return this.componentInstance
  4855. };
  4856. Object.defineProperties( VNode.prototype, prototypeAccessors );
  4857. var createEmptyVNode = function (text) {
  4858. if ( text === void 0 ) text = '';
  4859. var node = new VNode();
  4860. node.text = text;
  4861. node.isComment = true;
  4862. return node
  4863. };
  4864. function createTextVNode (val) {
  4865. return new VNode(undefined, undefined, undefined, String(val))
  4866. }
  4867. // optimized shallow clone
  4868. // used for static nodes and slot nodes because they may be reused across
  4869. // multiple renders, cloning them avoids errors when DOM manipulations rely
  4870. // on their elm reference.
  4871. function cloneVNode (vnode) {
  4872. var cloned = new VNode(
  4873. vnode.tag,
  4874. vnode.data,
  4875. // #7975
  4876. // clone children array to avoid mutating original in case of cloning
  4877. // a child.
  4878. vnode.children && vnode.children.slice(),
  4879. vnode.text,
  4880. vnode.elm,
  4881. vnode.context,
  4882. vnode.componentOptions,
  4883. vnode.asyncFactory
  4884. );
  4885. cloned.ns = vnode.ns;
  4886. cloned.isStatic = vnode.isStatic;
  4887. cloned.key = vnode.key;
  4888. cloned.isComment = vnode.isComment;
  4889. cloned.fnContext = vnode.fnContext;
  4890. cloned.fnOptions = vnode.fnOptions;
  4891. cloned.fnScopeId = vnode.fnScopeId;
  4892. cloned.asyncMeta = vnode.asyncMeta;
  4893. cloned.isCloned = true;
  4894. return cloned
  4895. }
  4896. /*
  4897. * not type checking this file because flow doesn't play well with
  4898. * dynamically accessing methods on Array prototype
  4899. */
  4900. var arrayProto = Array.prototype;
  4901. var arrayMethods = Object.create(arrayProto);
  4902. var methodsToPatch = [
  4903. 'push',
  4904. 'pop',
  4905. 'shift',
  4906. 'unshift',
  4907. 'splice',
  4908. 'sort',
  4909. 'reverse'
  4910. ];
  4911. /**
  4912. * Intercept mutating methods and emit events
  4913. */
  4914. methodsToPatch.forEach(function (method) {
  4915. // cache original method
  4916. var original = arrayProto[method];
  4917. def(arrayMethods, method, function mutator () {
  4918. var args = [], len = arguments.length;
  4919. while ( len-- ) args[ len ] = arguments[ len ];
  4920. var result = original.apply(this, args);
  4921. var ob = this.__ob__;
  4922. var inserted;
  4923. switch (method) {
  4924. case 'push':
  4925. case 'unshift':
  4926. inserted = args;
  4927. break
  4928. case 'splice':
  4929. inserted = args.slice(2);
  4930. break
  4931. }
  4932. if (inserted) { ob.observeArray(inserted); }
  4933. // notify change
  4934. ob.dep.notify();
  4935. return result
  4936. });
  4937. });
  4938. /* */
  4939. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  4940. /**
  4941. * In some cases we may want to disable observation inside a component's
  4942. * update computation.
  4943. */
  4944. var shouldObserve = true;
  4945. function toggleObserving (value) {
  4946. shouldObserve = value;
  4947. }
  4948. /**
  4949. * Observer class that is attached to each observed
  4950. * object. Once attached, the observer converts the target
  4951. * object's property keys into getter/setters that
  4952. * collect dependencies and dispatch updates.
  4953. */
  4954. var Observer = function Observer (value) {
  4955. this.value = value;
  4956. this.dep = new Dep();
  4957. this.vmCount = 0;
  4958. def(value, '__ob__', this);
  4959. if (Array.isArray(value)) {
  4960. if (hasProto) {
  4961. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  4962. if(value.push !== value.__proto__.push){
  4963. copyAugment(value, arrayMethods, arrayKeys);
  4964. } else {
  4965. protoAugment(value, arrayMethods);
  4966. }
  4967. }
  4968. } else {
  4969. copyAugment(value, arrayMethods, arrayKeys);
  4970. }
  4971. this.observeArray(value);
  4972. } else {
  4973. this.walk(value);
  4974. }
  4975. };
  4976. /**
  4977. * Walk through all properties and convert them into
  4978. * getter/setters. This method should only be called when
  4979. * value type is Object.
  4980. */
  4981. Observer.prototype.walk = function walk (obj) {
  4982. var keys = Object.keys(obj);
  4983. for (var i = 0; i < keys.length; i++) {
  4984. defineReactive$$1(obj, keys[i]);
  4985. }
  4986. };
  4987. /**
  4988. * Observe a list of Array items.
  4989. */
  4990. Observer.prototype.observeArray = function observeArray (items) {
  4991. for (var i = 0, l = items.length; i < l; i++) {
  4992. observe(items[i]);
  4993. }
  4994. };
  4995. // helpers
  4996. /**
  4997. * Augment a target Object or Array by intercepting
  4998. * the prototype chain using __proto__
  4999. */
  5000. function protoAugment (target, src) {
  5001. /* eslint-disable no-proto */
  5002. target.__proto__ = src;
  5003. /* eslint-enable no-proto */
  5004. }
  5005. /**
  5006. * Augment a target Object or Array by defining
  5007. * hidden properties.
  5008. */
  5009. /* istanbul ignore next */
  5010. function copyAugment (target, src, keys) {
  5011. for (var i = 0, l = keys.length; i < l; i++) {
  5012. var key = keys[i];
  5013. def(target, key, src[key]);
  5014. }
  5015. }
  5016. /**
  5017. * Attempt to create an observer instance for a value,
  5018. * returns the new observer if successfully observed,
  5019. * or the existing observer if the value already has one.
  5020. */
  5021. function observe (value, asRootData) {
  5022. if (!isObject(value) || value instanceof VNode) {
  5023. return
  5024. }
  5025. var ob;
  5026. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  5027. ob = value.__ob__;
  5028. } else if (
  5029. shouldObserve &&
  5030. !isServerRendering() &&
  5031. (Array.isArray(value) || isPlainObject(value)) &&
  5032. Object.isExtensible(value) &&
  5033. !value._isVue &&
  5034. !value.__v_isMPComponent
  5035. ) {
  5036. ob = new Observer(value);
  5037. }
  5038. if (asRootData && ob) {
  5039. ob.vmCount++;
  5040. }
  5041. return ob
  5042. }
  5043. /**
  5044. * Define a reactive property on an Object.
  5045. */
  5046. function defineReactive$$1 (
  5047. obj,
  5048. key,
  5049. val,
  5050. customSetter,
  5051. shallow
  5052. ) {
  5053. var dep = new Dep();
  5054. var property = Object.getOwnPropertyDescriptor(obj, key);
  5055. if (property && property.configurable === false) {
  5056. return
  5057. }
  5058. // cater for pre-defined getter/setters
  5059. var getter = property && property.get;
  5060. var setter = property && property.set;
  5061. if ((!getter || setter) && arguments.length === 2) {
  5062. val = obj[key];
  5063. }
  5064. var childOb = !shallow && observe(val);
  5065. Object.defineProperty(obj, key, {
  5066. enumerable: true,
  5067. configurable: true,
  5068. get: function reactiveGetter () {
  5069. var value = getter ? getter.call(obj) : val;
  5070. if (Dep.SharedObject.target) { // fixed by xxxxxx
  5071. dep.depend();
  5072. if (childOb) {
  5073. childOb.dep.depend();
  5074. if (Array.isArray(value)) {
  5075. dependArray(value);
  5076. }
  5077. }
  5078. }
  5079. return value
  5080. },
  5081. set: function reactiveSetter (newVal) {
  5082. var value = getter ? getter.call(obj) : val;
  5083. /* eslint-disable no-self-compare */
  5084. if (newVal === value || (newVal !== newVal && value !== value)) {
  5085. return
  5086. }
  5087. /* eslint-enable no-self-compare */
  5088. if ( true && customSetter) {
  5089. customSetter();
  5090. }
  5091. // #7981: for accessor properties without setter
  5092. if (getter && !setter) { return }
  5093. if (setter) {
  5094. setter.call(obj, newVal);
  5095. } else {
  5096. val = newVal;
  5097. }
  5098. childOb = !shallow && observe(newVal);
  5099. dep.notify();
  5100. }
  5101. });
  5102. }
  5103. /**
  5104. * Set a property on an object. Adds the new property and
  5105. * triggers change notification if the property doesn't
  5106. * already exist.
  5107. */
  5108. function set (target, key, val) {
  5109. if ( true &&
  5110. (isUndef(target) || isPrimitive(target))
  5111. ) {
  5112. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  5113. }
  5114. if (Array.isArray(target) && isValidArrayIndex(key)) {
  5115. target.length = Math.max(target.length, key);
  5116. target.splice(key, 1, val);
  5117. return val
  5118. }
  5119. if (key in target && !(key in Object.prototype)) {
  5120. target[key] = val;
  5121. return val
  5122. }
  5123. var ob = (target).__ob__;
  5124. if (target._isVue || (ob && ob.vmCount)) {
  5125. true && warn(
  5126. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  5127. 'at runtime - declare it upfront in the data option.'
  5128. );
  5129. return val
  5130. }
  5131. if (!ob) {
  5132. target[key] = val;
  5133. return val
  5134. }
  5135. defineReactive$$1(ob.value, key, val);
  5136. ob.dep.notify();
  5137. return val
  5138. }
  5139. /**
  5140. * Delete a property and trigger change if necessary.
  5141. */
  5142. function del (target, key) {
  5143. if ( true &&
  5144. (isUndef(target) || isPrimitive(target))
  5145. ) {
  5146. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  5147. }
  5148. if (Array.isArray(target) && isValidArrayIndex(key)) {
  5149. target.splice(key, 1);
  5150. return
  5151. }
  5152. var ob = (target).__ob__;
  5153. if (target._isVue || (ob && ob.vmCount)) {
  5154. true && warn(
  5155. 'Avoid deleting properties on a Vue instance or its root $data ' +
  5156. '- just set it to null.'
  5157. );
  5158. return
  5159. }
  5160. if (!hasOwn(target, key)) {
  5161. return
  5162. }
  5163. delete target[key];
  5164. if (!ob) {
  5165. return
  5166. }
  5167. ob.dep.notify();
  5168. }
  5169. /**
  5170. * Collect dependencies on array elements when the array is touched, since
  5171. * we cannot intercept array element access like property getters.
  5172. */
  5173. function dependArray (value) {
  5174. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  5175. e = value[i];
  5176. e && e.__ob__ && e.__ob__.dep.depend();
  5177. if (Array.isArray(e)) {
  5178. dependArray(e);
  5179. }
  5180. }
  5181. }
  5182. /* */
  5183. /**
  5184. * Option overwriting strategies are functions that handle
  5185. * how to merge a parent option value and a child option
  5186. * value into the final value.
  5187. */
  5188. var strats = config.optionMergeStrategies;
  5189. /**
  5190. * Options with restrictions
  5191. */
  5192. if (true) {
  5193. strats.el = strats.propsData = function (parent, child, vm, key) {
  5194. if (!vm) {
  5195. warn(
  5196. "option \"" + key + "\" can only be used during instance " +
  5197. 'creation with the `new` keyword.'
  5198. );
  5199. }
  5200. return defaultStrat(parent, child)
  5201. };
  5202. }
  5203. /**
  5204. * Helper that recursively merges two data objects together.
  5205. */
  5206. function mergeData (to, from) {
  5207. if (!from) { return to }
  5208. var key, toVal, fromVal;
  5209. var keys = hasSymbol
  5210. ? Reflect.ownKeys(from)
  5211. : Object.keys(from);
  5212. for (var i = 0; i < keys.length; i++) {
  5213. key = keys[i];
  5214. // in case the object is already observed...
  5215. if (key === '__ob__') { continue }
  5216. toVal = to[key];
  5217. fromVal = from[key];
  5218. if (!hasOwn(to, key)) {
  5219. set(to, key, fromVal);
  5220. } else if (
  5221. toVal !== fromVal &&
  5222. isPlainObject(toVal) &&
  5223. isPlainObject(fromVal)
  5224. ) {
  5225. mergeData(toVal, fromVal);
  5226. }
  5227. }
  5228. return to
  5229. }
  5230. /**
  5231. * Data
  5232. */
  5233. function mergeDataOrFn (
  5234. parentVal,
  5235. childVal,
  5236. vm
  5237. ) {
  5238. if (!vm) {
  5239. // in a Vue.extend merge, both should be functions
  5240. if (!childVal) {
  5241. return parentVal
  5242. }
  5243. if (!parentVal) {
  5244. return childVal
  5245. }
  5246. // when parentVal & childVal are both present,
  5247. // we need to return a function that returns the
  5248. // merged result of both functions... no need to
  5249. // check if parentVal is a function here because
  5250. // it has to be a function to pass previous merges.
  5251. return function mergedDataFn () {
  5252. return mergeData(
  5253. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  5254. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  5255. )
  5256. }
  5257. } else {
  5258. return function mergedInstanceDataFn () {
  5259. // instance merge
  5260. var instanceData = typeof childVal === 'function'
  5261. ? childVal.call(vm, vm)
  5262. : childVal;
  5263. var defaultData = typeof parentVal === 'function'
  5264. ? parentVal.call(vm, vm)
  5265. : parentVal;
  5266. if (instanceData) {
  5267. return mergeData(instanceData, defaultData)
  5268. } else {
  5269. return defaultData
  5270. }
  5271. }
  5272. }
  5273. }
  5274. strats.data = function (
  5275. parentVal,
  5276. childVal,
  5277. vm
  5278. ) {
  5279. if (!vm) {
  5280. if (childVal && typeof childVal !== 'function') {
  5281. true && warn(
  5282. 'The "data" option should be a function ' +
  5283. 'that returns a per-instance value in component ' +
  5284. 'definitions.',
  5285. vm
  5286. );
  5287. return parentVal
  5288. }
  5289. return mergeDataOrFn(parentVal, childVal)
  5290. }
  5291. return mergeDataOrFn(parentVal, childVal, vm)
  5292. };
  5293. /**
  5294. * Hooks and props are merged as arrays.
  5295. */
  5296. function mergeHook (
  5297. parentVal,
  5298. childVal
  5299. ) {
  5300. var res = childVal
  5301. ? parentVal
  5302. ? parentVal.concat(childVal)
  5303. : Array.isArray(childVal)
  5304. ? childVal
  5305. : [childVal]
  5306. : parentVal;
  5307. return res
  5308. ? dedupeHooks(res)
  5309. : res
  5310. }
  5311. function dedupeHooks (hooks) {
  5312. var res = [];
  5313. for (var i = 0; i < hooks.length; i++) {
  5314. if (res.indexOf(hooks[i]) === -1) {
  5315. res.push(hooks[i]);
  5316. }
  5317. }
  5318. return res
  5319. }
  5320. LIFECYCLE_HOOKS.forEach(function (hook) {
  5321. strats[hook] = mergeHook;
  5322. });
  5323. /**
  5324. * Assets
  5325. *
  5326. * When a vm is present (instance creation), we need to do
  5327. * a three-way merge between constructor options, instance
  5328. * options and parent options.
  5329. */
  5330. function mergeAssets (
  5331. parentVal,
  5332. childVal,
  5333. vm,
  5334. key
  5335. ) {
  5336. var res = Object.create(parentVal || null);
  5337. if (childVal) {
  5338. true && assertObjectType(key, childVal, vm);
  5339. return extend(res, childVal)
  5340. } else {
  5341. return res
  5342. }
  5343. }
  5344. ASSET_TYPES.forEach(function (type) {
  5345. strats[type + 's'] = mergeAssets;
  5346. });
  5347. /**
  5348. * Watchers.
  5349. *
  5350. * Watchers hashes should not overwrite one
  5351. * another, so we merge them as arrays.
  5352. */
  5353. strats.watch = function (
  5354. parentVal,
  5355. childVal,
  5356. vm,
  5357. key
  5358. ) {
  5359. // work around Firefox's Object.prototype.watch...
  5360. if (parentVal === nativeWatch) { parentVal = undefined; }
  5361. if (childVal === nativeWatch) { childVal = undefined; }
  5362. /* istanbul ignore if */
  5363. if (!childVal) { return Object.create(parentVal || null) }
  5364. if (true) {
  5365. assertObjectType(key, childVal, vm);
  5366. }
  5367. if (!parentVal) { return childVal }
  5368. var ret = {};
  5369. extend(ret, parentVal);
  5370. for (var key$1 in childVal) {
  5371. var parent = ret[key$1];
  5372. var child = childVal[key$1];
  5373. if (parent && !Array.isArray(parent)) {
  5374. parent = [parent];
  5375. }
  5376. ret[key$1] = parent
  5377. ? parent.concat(child)
  5378. : Array.isArray(child) ? child : [child];
  5379. }
  5380. return ret
  5381. };
  5382. /**
  5383. * Other object hashes.
  5384. */
  5385. strats.props =
  5386. strats.methods =
  5387. strats.inject =
  5388. strats.computed = function (
  5389. parentVal,
  5390. childVal,
  5391. vm,
  5392. key
  5393. ) {
  5394. if (childVal && "development" !== 'production') {
  5395. assertObjectType(key, childVal, vm);
  5396. }
  5397. if (!parentVal) { return childVal }
  5398. var ret = Object.create(null);
  5399. extend(ret, parentVal);
  5400. if (childVal) { extend(ret, childVal); }
  5401. return ret
  5402. };
  5403. strats.provide = mergeDataOrFn;
  5404. /**
  5405. * Default strategy.
  5406. */
  5407. var defaultStrat = function (parentVal, childVal) {
  5408. return childVal === undefined
  5409. ? parentVal
  5410. : childVal
  5411. };
  5412. /**
  5413. * Validate component names
  5414. */
  5415. function checkComponents (options) {
  5416. for (var key in options.components) {
  5417. validateComponentName(key);
  5418. }
  5419. }
  5420. function validateComponentName (name) {
  5421. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  5422. warn(
  5423. 'Invalid component name: "' + name + '". Component names ' +
  5424. 'should conform to valid custom element name in html5 specification.'
  5425. );
  5426. }
  5427. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  5428. warn(
  5429. 'Do not use built-in or reserved HTML elements as component ' +
  5430. 'id: ' + name
  5431. );
  5432. }
  5433. }
  5434. /**
  5435. * Ensure all props option syntax are normalized into the
  5436. * Object-based format.
  5437. */
  5438. function normalizeProps (options, vm) {
  5439. var props = options.props;
  5440. if (!props) { return }
  5441. var res = {};
  5442. var i, val, name;
  5443. if (Array.isArray(props)) {
  5444. i = props.length;
  5445. while (i--) {
  5446. val = props[i];
  5447. if (typeof val === 'string') {
  5448. name = camelize(val);
  5449. res[name] = { type: null };
  5450. } else if (true) {
  5451. warn('props must be strings when using array syntax.');
  5452. }
  5453. }
  5454. } else if (isPlainObject(props)) {
  5455. for (var key in props) {
  5456. val = props[key];
  5457. name = camelize(key);
  5458. res[name] = isPlainObject(val)
  5459. ? val
  5460. : { type: val };
  5461. }
  5462. } else if (true) {
  5463. warn(
  5464. "Invalid value for option \"props\": expected an Array or an Object, " +
  5465. "but got " + (toRawType(props)) + ".",
  5466. vm
  5467. );
  5468. }
  5469. options.props = res;
  5470. }
  5471. /**
  5472. * Normalize all injections into Object-based format
  5473. */
  5474. function normalizeInject (options, vm) {
  5475. var inject = options.inject;
  5476. if (!inject) { return }
  5477. var normalized = options.inject = {};
  5478. if (Array.isArray(inject)) {
  5479. for (var i = 0; i < inject.length; i++) {
  5480. normalized[inject[i]] = { from: inject[i] };
  5481. }
  5482. } else if (isPlainObject(inject)) {
  5483. for (var key in inject) {
  5484. var val = inject[key];
  5485. normalized[key] = isPlainObject(val)
  5486. ? extend({ from: key }, val)
  5487. : { from: val };
  5488. }
  5489. } else if (true) {
  5490. warn(
  5491. "Invalid value for option \"inject\": expected an Array or an Object, " +
  5492. "but got " + (toRawType(inject)) + ".",
  5493. vm
  5494. );
  5495. }
  5496. }
  5497. /**
  5498. * Normalize raw function directives into object format.
  5499. */
  5500. function normalizeDirectives (options) {
  5501. var dirs = options.directives;
  5502. if (dirs) {
  5503. for (var key in dirs) {
  5504. var def$$1 = dirs[key];
  5505. if (typeof def$$1 === 'function') {
  5506. dirs[key] = { bind: def$$1, update: def$$1 };
  5507. }
  5508. }
  5509. }
  5510. }
  5511. function assertObjectType (name, value, vm) {
  5512. if (!isPlainObject(value)) {
  5513. warn(
  5514. "Invalid value for option \"" + name + "\": expected an Object, " +
  5515. "but got " + (toRawType(value)) + ".",
  5516. vm
  5517. );
  5518. }
  5519. }
  5520. /**
  5521. * Merge two option objects into a new one.
  5522. * Core utility used in both instantiation and inheritance.
  5523. */
  5524. function mergeOptions (
  5525. parent,
  5526. child,
  5527. vm
  5528. ) {
  5529. if (true) {
  5530. checkComponents(child);
  5531. }
  5532. if (typeof child === 'function') {
  5533. child = child.options;
  5534. }
  5535. normalizeProps(child, vm);
  5536. normalizeInject(child, vm);
  5537. normalizeDirectives(child);
  5538. // Apply extends and mixins on the child options,
  5539. // but only if it is a raw options object that isn't
  5540. // the result of another mergeOptions call.
  5541. // Only merged options has the _base property.
  5542. if (!child._base) {
  5543. if (child.extends) {
  5544. parent = mergeOptions(parent, child.extends, vm);
  5545. }
  5546. if (child.mixins) {
  5547. for (var i = 0, l = child.mixins.length; i < l; i++) {
  5548. parent = mergeOptions(parent, child.mixins[i], vm);
  5549. }
  5550. }
  5551. }
  5552. var options = {};
  5553. var key;
  5554. for (key in parent) {
  5555. mergeField(key);
  5556. }
  5557. for (key in child) {
  5558. if (!hasOwn(parent, key)) {
  5559. mergeField(key);
  5560. }
  5561. }
  5562. function mergeField (key) {
  5563. var strat = strats[key] || defaultStrat;
  5564. options[key] = strat(parent[key], child[key], vm, key);
  5565. }
  5566. return options
  5567. }
  5568. /**
  5569. * Resolve an asset.
  5570. * This function is used because child instances need access
  5571. * to assets defined in its ancestor chain.
  5572. */
  5573. function resolveAsset (
  5574. options,
  5575. type,
  5576. id,
  5577. warnMissing
  5578. ) {
  5579. /* istanbul ignore if */
  5580. if (typeof id !== 'string') {
  5581. return
  5582. }
  5583. var assets = options[type];
  5584. // check local registration variations first
  5585. if (hasOwn(assets, id)) { return assets[id] }
  5586. var camelizedId = camelize(id);
  5587. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  5588. var PascalCaseId = capitalize(camelizedId);
  5589. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  5590. // fallback to prototype chain
  5591. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  5592. if ( true && warnMissing && !res) {
  5593. warn(
  5594. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  5595. options
  5596. );
  5597. }
  5598. return res
  5599. }
  5600. /* */
  5601. function validateProp (
  5602. key,
  5603. propOptions,
  5604. propsData,
  5605. vm
  5606. ) {
  5607. var prop = propOptions[key];
  5608. var absent = !hasOwn(propsData, key);
  5609. var value = propsData[key];
  5610. // boolean casting
  5611. var booleanIndex = getTypeIndex(Boolean, prop.type);
  5612. if (booleanIndex > -1) {
  5613. if (absent && !hasOwn(prop, 'default')) {
  5614. value = false;
  5615. } else if (value === '' || value === hyphenate(key)) {
  5616. // only cast empty string / same name to boolean if
  5617. // boolean has higher priority
  5618. var stringIndex = getTypeIndex(String, prop.type);
  5619. if (stringIndex < 0 || booleanIndex < stringIndex) {
  5620. value = true;
  5621. }
  5622. }
  5623. }
  5624. // check default value
  5625. if (value === undefined) {
  5626. value = getPropDefaultValue(vm, prop, key);
  5627. // since the default value is a fresh copy,
  5628. // make sure to observe it.
  5629. var prevShouldObserve = shouldObserve;
  5630. toggleObserving(true);
  5631. observe(value);
  5632. toggleObserving(prevShouldObserve);
  5633. }
  5634. if (
  5635. true
  5636. ) {
  5637. assertProp(prop, key, value, vm, absent);
  5638. }
  5639. return value
  5640. }
  5641. /**
  5642. * Get the default value of a prop.
  5643. */
  5644. function getPropDefaultValue (vm, prop, key) {
  5645. // no default, return undefined
  5646. if (!hasOwn(prop, 'default')) {
  5647. return undefined
  5648. }
  5649. var def = prop.default;
  5650. // warn against non-factory defaults for Object & Array
  5651. if ( true && isObject(def)) {
  5652. warn(
  5653. 'Invalid default value for prop "' + key + '": ' +
  5654. 'Props with type Object/Array must use a factory function ' +
  5655. 'to return the default value.',
  5656. vm
  5657. );
  5658. }
  5659. // the raw prop value was also undefined from previous render,
  5660. // return previous default value to avoid unnecessary watcher trigger
  5661. if (vm && vm.$options.propsData &&
  5662. vm.$options.propsData[key] === undefined &&
  5663. vm._props[key] !== undefined
  5664. ) {
  5665. return vm._props[key]
  5666. }
  5667. // call factory function for non-Function types
  5668. // a value is Function if its prototype is function even across different execution context
  5669. return typeof def === 'function' && getType(prop.type) !== 'Function'
  5670. ? def.call(vm)
  5671. : def
  5672. }
  5673. /**
  5674. * Assert whether a prop is valid.
  5675. */
  5676. function assertProp (
  5677. prop,
  5678. name,
  5679. value,
  5680. vm,
  5681. absent
  5682. ) {
  5683. if (prop.required && absent) {
  5684. warn(
  5685. 'Missing required prop: "' + name + '"',
  5686. vm
  5687. );
  5688. return
  5689. }
  5690. if (value == null && !prop.required) {
  5691. return
  5692. }
  5693. var type = prop.type;
  5694. var valid = !type || type === true;
  5695. var expectedTypes = [];
  5696. if (type) {
  5697. if (!Array.isArray(type)) {
  5698. type = [type];
  5699. }
  5700. for (var i = 0; i < type.length && !valid; i++) {
  5701. var assertedType = assertType(value, type[i]);
  5702. expectedTypes.push(assertedType.expectedType || '');
  5703. valid = assertedType.valid;
  5704. }
  5705. }
  5706. if (!valid) {
  5707. warn(
  5708. getInvalidTypeMessage(name, value, expectedTypes),
  5709. vm
  5710. );
  5711. return
  5712. }
  5713. var validator = prop.validator;
  5714. if (validator) {
  5715. if (!validator(value)) {
  5716. warn(
  5717. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  5718. vm
  5719. );
  5720. }
  5721. }
  5722. }
  5723. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  5724. function assertType (value, type) {
  5725. var valid;
  5726. var expectedType = getType(type);
  5727. if (simpleCheckRE.test(expectedType)) {
  5728. var t = typeof value;
  5729. valid = t === expectedType.toLowerCase();
  5730. // for primitive wrapper objects
  5731. if (!valid && t === 'object') {
  5732. valid = value instanceof type;
  5733. }
  5734. } else if (expectedType === 'Object') {
  5735. valid = isPlainObject(value);
  5736. } else if (expectedType === 'Array') {
  5737. valid = Array.isArray(value);
  5738. } else {
  5739. valid = value instanceof type;
  5740. }
  5741. return {
  5742. valid: valid,
  5743. expectedType: expectedType
  5744. }
  5745. }
  5746. /**
  5747. * Use function string name to check built-in types,
  5748. * because a simple equality check will fail when running
  5749. * across different vms / iframes.
  5750. */
  5751. function getType (fn) {
  5752. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  5753. return match ? match[1] : ''
  5754. }
  5755. function isSameType (a, b) {
  5756. return getType(a) === getType(b)
  5757. }
  5758. function getTypeIndex (type, expectedTypes) {
  5759. if (!Array.isArray(expectedTypes)) {
  5760. return isSameType(expectedTypes, type) ? 0 : -1
  5761. }
  5762. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  5763. if (isSameType(expectedTypes[i], type)) {
  5764. return i
  5765. }
  5766. }
  5767. return -1
  5768. }
  5769. function getInvalidTypeMessage (name, value, expectedTypes) {
  5770. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  5771. " Expected " + (expectedTypes.map(capitalize).join(', '));
  5772. var expectedType = expectedTypes[0];
  5773. var receivedType = toRawType(value);
  5774. var expectedValue = styleValue(value, expectedType);
  5775. var receivedValue = styleValue(value, receivedType);
  5776. // check if we need to specify expected value
  5777. if (expectedTypes.length === 1 &&
  5778. isExplicable(expectedType) &&
  5779. !isBoolean(expectedType, receivedType)) {
  5780. message += " with value " + expectedValue;
  5781. }
  5782. message += ", got " + receivedType + " ";
  5783. // check if we need to specify received value
  5784. if (isExplicable(receivedType)) {
  5785. message += "with value " + receivedValue + ".";
  5786. }
  5787. return message
  5788. }
  5789. function styleValue (value, type) {
  5790. if (type === 'String') {
  5791. return ("\"" + value + "\"")
  5792. } else if (type === 'Number') {
  5793. return ("" + (Number(value)))
  5794. } else {
  5795. return ("" + value)
  5796. }
  5797. }
  5798. function isExplicable (value) {
  5799. var explicitTypes = ['string', 'number', 'boolean'];
  5800. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  5801. }
  5802. function isBoolean () {
  5803. var args = [], len = arguments.length;
  5804. while ( len-- ) args[ len ] = arguments[ len ];
  5805. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  5806. }
  5807. /* */
  5808. function handleError (err, vm, info) {
  5809. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  5810. // See: https://github.com/vuejs/vuex/issues/1505
  5811. pushTarget();
  5812. try {
  5813. if (vm) {
  5814. var cur = vm;
  5815. while ((cur = cur.$parent)) {
  5816. var hooks = cur.$options.errorCaptured;
  5817. if (hooks) {
  5818. for (var i = 0; i < hooks.length; i++) {
  5819. try {
  5820. var capture = hooks[i].call(cur, err, vm, info) === false;
  5821. if (capture) { return }
  5822. } catch (e) {
  5823. globalHandleError(e, cur, 'errorCaptured hook');
  5824. }
  5825. }
  5826. }
  5827. }
  5828. }
  5829. globalHandleError(err, vm, info);
  5830. } finally {
  5831. popTarget();
  5832. }
  5833. }
  5834. function invokeWithErrorHandling (
  5835. handler,
  5836. context,
  5837. args,
  5838. vm,
  5839. info
  5840. ) {
  5841. var res;
  5842. try {
  5843. res = args ? handler.apply(context, args) : handler.call(context);
  5844. if (res && !res._isVue && isPromise(res) && !res._handled) {
  5845. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  5846. // issue #9511
  5847. // avoid catch triggering multiple times when nested calls
  5848. res._handled = true;
  5849. }
  5850. } catch (e) {
  5851. handleError(e, vm, info);
  5852. }
  5853. return res
  5854. }
  5855. function globalHandleError (err, vm, info) {
  5856. if (config.errorHandler) {
  5857. try {
  5858. return config.errorHandler.call(null, err, vm, info)
  5859. } catch (e) {
  5860. // if the user intentionally throws the original error in the handler,
  5861. // do not log it twice
  5862. if (e !== err) {
  5863. logError(e, null, 'config.errorHandler');
  5864. }
  5865. }
  5866. }
  5867. logError(err, vm, info);
  5868. }
  5869. function logError (err, vm, info) {
  5870. if (true) {
  5871. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  5872. }
  5873. /* istanbul ignore else */
  5874. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  5875. console.error(err);
  5876. } else {
  5877. throw err
  5878. }
  5879. }
  5880. /* */
  5881. var callbacks = [];
  5882. var pending = false;
  5883. function flushCallbacks () {
  5884. pending = false;
  5885. var copies = callbacks.slice(0);
  5886. callbacks.length = 0;
  5887. for (var i = 0; i < copies.length; i++) {
  5888. copies[i]();
  5889. }
  5890. }
  5891. // Here we have async deferring wrappers using microtasks.
  5892. // In 2.5 we used (macro) tasks (in combination with microtasks).
  5893. // However, it has subtle problems when state is changed right before repaint
  5894. // (e.g. #6813, out-in transitions).
  5895. // Also, using (macro) tasks in event handler would cause some weird behaviors
  5896. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  5897. // So we now use microtasks everywhere, again.
  5898. // A major drawback of this tradeoff is that there are some scenarios
  5899. // where microtasks have too high a priority and fire in between supposedly
  5900. // sequential events (e.g. #4521, #6690, which have workarounds)
  5901. // or even between bubbling of the same event (#6566).
  5902. var timerFunc;
  5903. // The nextTick behavior leverages the microtask queue, which can be accessed
  5904. // via either native Promise.then or MutationObserver.
  5905. // MutationObserver has wider support, however it is seriously bugged in
  5906. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  5907. // completely stops working after triggering a few times... so, if native
  5908. // Promise is available, we will use it:
  5909. /* istanbul ignore next, $flow-disable-line */
  5910. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  5911. var p = Promise.resolve();
  5912. timerFunc = function () {
  5913. p.then(flushCallbacks);
  5914. // In problematic UIWebViews, Promise.then doesn't completely break, but
  5915. // it can get stuck in a weird state where callbacks are pushed into the
  5916. // microtask queue but the queue isn't being flushed, until the browser
  5917. // needs to do some other work, e.g. handle a timer. Therefore we can
  5918. // "force" the microtask queue to be flushed by adding an empty timer.
  5919. if (isIOS) { setTimeout(noop); }
  5920. };
  5921. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  5922. isNative(MutationObserver) ||
  5923. // PhantomJS and iOS 7.x
  5924. MutationObserver.toString() === '[object MutationObserverConstructor]'
  5925. )) {
  5926. // Use MutationObserver where native Promise is not available,
  5927. // e.g. PhantomJS, iOS7, Android 4.4
  5928. // (#6466 MutationObserver is unreliable in IE11)
  5929. var counter = 1;
  5930. var observer = new MutationObserver(flushCallbacks);
  5931. var textNode = document.createTextNode(String(counter));
  5932. observer.observe(textNode, {
  5933. characterData: true
  5934. });
  5935. timerFunc = function () {
  5936. counter = (counter + 1) % 2;
  5937. textNode.data = String(counter);
  5938. };
  5939. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  5940. // Fallback to setImmediate.
  5941. // Technically it leverages the (macro) task queue,
  5942. // but it is still a better choice than setTimeout.
  5943. timerFunc = function () {
  5944. setImmediate(flushCallbacks);
  5945. };
  5946. } else {
  5947. // Fallback to setTimeout.
  5948. timerFunc = function () {
  5949. setTimeout(flushCallbacks, 0);
  5950. };
  5951. }
  5952. function nextTick (cb, ctx) {
  5953. var _resolve;
  5954. callbacks.push(function () {
  5955. if (cb) {
  5956. try {
  5957. cb.call(ctx);
  5958. } catch (e) {
  5959. handleError(e, ctx, 'nextTick');
  5960. }
  5961. } else if (_resolve) {
  5962. _resolve(ctx);
  5963. }
  5964. });
  5965. if (!pending) {
  5966. pending = true;
  5967. timerFunc();
  5968. }
  5969. // $flow-disable-line
  5970. if (!cb && typeof Promise !== 'undefined') {
  5971. return new Promise(function (resolve) {
  5972. _resolve = resolve;
  5973. })
  5974. }
  5975. }
  5976. /* */
  5977. /* not type checking this file because flow doesn't play well with Proxy */
  5978. var initProxy;
  5979. if (true) {
  5980. var allowedGlobals = makeMap(
  5981. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  5982. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  5983. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  5984. 'require' // for Webpack/Browserify
  5985. );
  5986. var warnNonPresent = function (target, key) {
  5987. warn(
  5988. "Property or method \"" + key + "\" is not defined on the instance but " +
  5989. 'referenced during render. Make sure that this property is reactive, ' +
  5990. 'either in the data option, or for class-based components, by ' +
  5991. 'initializing the property. ' +
  5992. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  5993. target
  5994. );
  5995. };
  5996. var warnReservedPrefix = function (target, key) {
  5997. warn(
  5998. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  5999. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  6000. 'prevent conflicts with Vue internals. ' +
  6001. 'See: https://vuejs.org/v2/api/#data',
  6002. target
  6003. );
  6004. };
  6005. var hasProxy =
  6006. typeof Proxy !== 'undefined' && isNative(Proxy);
  6007. if (hasProxy) {
  6008. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  6009. config.keyCodes = new Proxy(config.keyCodes, {
  6010. set: function set (target, key, value) {
  6011. if (isBuiltInModifier(key)) {
  6012. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  6013. return false
  6014. } else {
  6015. target[key] = value;
  6016. return true
  6017. }
  6018. }
  6019. });
  6020. }
  6021. var hasHandler = {
  6022. has: function has (target, key) {
  6023. var has = key in target;
  6024. var isAllowed = allowedGlobals(key) ||
  6025. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  6026. if (!has && !isAllowed) {
  6027. if (key in target.$data) { warnReservedPrefix(target, key); }
  6028. else { warnNonPresent(target, key); }
  6029. }
  6030. return has || !isAllowed
  6031. }
  6032. };
  6033. var getHandler = {
  6034. get: function get (target, key) {
  6035. if (typeof key === 'string' && !(key in target)) {
  6036. if (key in target.$data) { warnReservedPrefix(target, key); }
  6037. else { warnNonPresent(target, key); }
  6038. }
  6039. return target[key]
  6040. }
  6041. };
  6042. initProxy = function initProxy (vm) {
  6043. if (hasProxy) {
  6044. // determine which proxy handler to use
  6045. var options = vm.$options;
  6046. var handlers = options.render && options.render._withStripped
  6047. ? getHandler
  6048. : hasHandler;
  6049. vm._renderProxy = new Proxy(vm, handlers);
  6050. } else {
  6051. vm._renderProxy = vm;
  6052. }
  6053. };
  6054. }
  6055. /* */
  6056. var seenObjects = new _Set();
  6057. /**
  6058. * Recursively traverse an object to evoke all converted
  6059. * getters, so that every nested property inside the object
  6060. * is collected as a "deep" dependency.
  6061. */
  6062. function traverse (val) {
  6063. _traverse(val, seenObjects);
  6064. seenObjects.clear();
  6065. }
  6066. function _traverse (val, seen) {
  6067. var i, keys;
  6068. var isA = Array.isArray(val);
  6069. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  6070. return
  6071. }
  6072. if (val.__ob__) {
  6073. var depId = val.__ob__.dep.id;
  6074. if (seen.has(depId)) {
  6075. return
  6076. }
  6077. seen.add(depId);
  6078. }
  6079. if (isA) {
  6080. i = val.length;
  6081. while (i--) { _traverse(val[i], seen); }
  6082. } else {
  6083. keys = Object.keys(val);
  6084. i = keys.length;
  6085. while (i--) { _traverse(val[keys[i]], seen); }
  6086. }
  6087. }
  6088. var mark;
  6089. var measure;
  6090. if (true) {
  6091. var perf = inBrowser && window.performance;
  6092. /* istanbul ignore if */
  6093. if (
  6094. perf &&
  6095. perf.mark &&
  6096. perf.measure &&
  6097. perf.clearMarks &&
  6098. perf.clearMeasures
  6099. ) {
  6100. mark = function (tag) { return perf.mark(tag); };
  6101. measure = function (name, startTag, endTag) {
  6102. perf.measure(name, startTag, endTag);
  6103. perf.clearMarks(startTag);
  6104. perf.clearMarks(endTag);
  6105. // perf.clearMeasures(name)
  6106. };
  6107. }
  6108. }
  6109. /* */
  6110. var normalizeEvent = cached(function (name) {
  6111. var passive = name.charAt(0) === '&';
  6112. name = passive ? name.slice(1) : name;
  6113. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  6114. name = once$$1 ? name.slice(1) : name;
  6115. var capture = name.charAt(0) === '!';
  6116. name = capture ? name.slice(1) : name;
  6117. return {
  6118. name: name,
  6119. once: once$$1,
  6120. capture: capture,
  6121. passive: passive
  6122. }
  6123. });
  6124. function createFnInvoker (fns, vm) {
  6125. function invoker () {
  6126. var arguments$1 = arguments;
  6127. var fns = invoker.fns;
  6128. if (Array.isArray(fns)) {
  6129. var cloned = fns.slice();
  6130. for (var i = 0; i < cloned.length; i++) {
  6131. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  6132. }
  6133. } else {
  6134. // return handler return value for single handlers
  6135. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  6136. }
  6137. }
  6138. invoker.fns = fns;
  6139. return invoker
  6140. }
  6141. function updateListeners (
  6142. on,
  6143. oldOn,
  6144. add,
  6145. remove$$1,
  6146. createOnceHandler,
  6147. vm
  6148. ) {
  6149. var name, def$$1, cur, old, event;
  6150. for (name in on) {
  6151. def$$1 = cur = on[name];
  6152. old = oldOn[name];
  6153. event = normalizeEvent(name);
  6154. if (isUndef(cur)) {
  6155. true && warn(
  6156. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  6157. vm
  6158. );
  6159. } else if (isUndef(old)) {
  6160. if (isUndef(cur.fns)) {
  6161. cur = on[name] = createFnInvoker(cur, vm);
  6162. }
  6163. if (isTrue(event.once)) {
  6164. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  6165. }
  6166. add(event.name, cur, event.capture, event.passive, event.params);
  6167. } else if (cur !== old) {
  6168. old.fns = cur;
  6169. on[name] = old;
  6170. }
  6171. }
  6172. for (name in oldOn) {
  6173. if (isUndef(on[name])) {
  6174. event = normalizeEvent(name);
  6175. remove$$1(event.name, oldOn[name], event.capture);
  6176. }
  6177. }
  6178. }
  6179. /* */
  6180. /* */
  6181. // fixed by xxxxxx (mp properties)
  6182. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  6183. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  6184. if (isUndef(propOptions)) {
  6185. return res
  6186. }
  6187. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  6188. var attrs = data.attrs;
  6189. var props = data.props;
  6190. if (isDef(attrs) || isDef(props)) {
  6191. for (var key in propOptions) {
  6192. var altKey = hyphenate(key);
  6193. var result = checkProp(res, props, key, altKey, true) ||
  6194. checkProp(res, attrs, key, altKey, false);
  6195. // externalClass
  6196. if (
  6197. result &&
  6198. res[key] &&
  6199. externalClasses.indexOf(altKey) !== -1 &&
  6200. context[camelize(res[key])]
  6201. ) {
  6202. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  6203. res[key] = context[camelize(res[key])];
  6204. }
  6205. }
  6206. }
  6207. return res
  6208. }
  6209. function extractPropsFromVNodeData (
  6210. data,
  6211. Ctor,
  6212. tag,
  6213. context// fixed by xxxxxx
  6214. ) {
  6215. // we are only extracting raw values here.
  6216. // validation and default values are handled in the child
  6217. // component itself.
  6218. var propOptions = Ctor.options.props;
  6219. if (isUndef(propOptions)) {
  6220. // fixed by xxxxxx
  6221. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  6222. }
  6223. var res = {};
  6224. var attrs = data.attrs;
  6225. var props = data.props;
  6226. if (isDef(attrs) || isDef(props)) {
  6227. for (var key in propOptions) {
  6228. var altKey = hyphenate(key);
  6229. if (true) {
  6230. var keyInLowerCase = key.toLowerCase();
  6231. if (
  6232. key !== keyInLowerCase &&
  6233. attrs && hasOwn(attrs, keyInLowerCase)
  6234. ) {
  6235. tip(
  6236. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  6237. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  6238. " \"" + key + "\". " +
  6239. "Note that HTML attributes are case-insensitive and camelCased " +
  6240. "props need to use their kebab-case equivalents when using in-DOM " +
  6241. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  6242. );
  6243. }
  6244. }
  6245. checkProp(res, props, key, altKey, true) ||
  6246. checkProp(res, attrs, key, altKey, false);
  6247. }
  6248. }
  6249. // fixed by xxxxxx
  6250. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  6251. }
  6252. function checkProp (
  6253. res,
  6254. hash,
  6255. key,
  6256. altKey,
  6257. preserve
  6258. ) {
  6259. if (isDef(hash)) {
  6260. if (hasOwn(hash, key)) {
  6261. res[key] = hash[key];
  6262. if (!preserve) {
  6263. delete hash[key];
  6264. }
  6265. return true
  6266. } else if (hasOwn(hash, altKey)) {
  6267. res[key] = hash[altKey];
  6268. if (!preserve) {
  6269. delete hash[altKey];
  6270. }
  6271. return true
  6272. }
  6273. }
  6274. return false
  6275. }
  6276. /* */
  6277. // The template compiler attempts to minimize the need for normalization by
  6278. // statically analyzing the template at compile time.
  6279. //
  6280. // For plain HTML markup, normalization can be completely skipped because the
  6281. // generated render function is guaranteed to return Array<VNode>. There are
  6282. // two cases where extra normalization is needed:
  6283. // 1. When the children contains components - because a functional component
  6284. // may return an Array instead of a single root. In this case, just a simple
  6285. // normalization is needed - if any child is an Array, we flatten the whole
  6286. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  6287. // because functional components already normalize their own children.
  6288. function simpleNormalizeChildren (children) {
  6289. for (var i = 0; i < children.length; i++) {
  6290. if (Array.isArray(children[i])) {
  6291. return Array.prototype.concat.apply([], children)
  6292. }
  6293. }
  6294. return children
  6295. }
  6296. // 2. When the children contains constructs that always generated nested Arrays,
  6297. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  6298. // with hand-written render functions / JSX. In such cases a full normalization
  6299. // is needed to cater to all possible types of children values.
  6300. function normalizeChildren (children) {
  6301. return isPrimitive(children)
  6302. ? [createTextVNode(children)]
  6303. : Array.isArray(children)
  6304. ? normalizeArrayChildren(children)
  6305. : undefined
  6306. }
  6307. function isTextNode (node) {
  6308. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  6309. }
  6310. function normalizeArrayChildren (children, nestedIndex) {
  6311. var res = [];
  6312. var i, c, lastIndex, last;
  6313. for (i = 0; i < children.length; i++) {
  6314. c = children[i];
  6315. if (isUndef(c) || typeof c === 'boolean') { continue }
  6316. lastIndex = res.length - 1;
  6317. last = res[lastIndex];
  6318. // nested
  6319. if (Array.isArray(c)) {
  6320. if (c.length > 0) {
  6321. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  6322. // merge adjacent text nodes
  6323. if (isTextNode(c[0]) && isTextNode(last)) {
  6324. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  6325. c.shift();
  6326. }
  6327. res.push.apply(res, c);
  6328. }
  6329. } else if (isPrimitive(c)) {
  6330. if (isTextNode(last)) {
  6331. // merge adjacent text nodes
  6332. // this is necessary for SSR hydration because text nodes are
  6333. // essentially merged when rendered to HTML strings
  6334. res[lastIndex] = createTextVNode(last.text + c);
  6335. } else if (c !== '') {
  6336. // convert primitive to vnode
  6337. res.push(createTextVNode(c));
  6338. }
  6339. } else {
  6340. if (isTextNode(c) && isTextNode(last)) {
  6341. // merge adjacent text nodes
  6342. res[lastIndex] = createTextVNode(last.text + c.text);
  6343. } else {
  6344. // default key for nested array children (likely generated by v-for)
  6345. if (isTrue(children._isVList) &&
  6346. isDef(c.tag) &&
  6347. isUndef(c.key) &&
  6348. isDef(nestedIndex)) {
  6349. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  6350. }
  6351. res.push(c);
  6352. }
  6353. }
  6354. }
  6355. return res
  6356. }
  6357. /* */
  6358. function initProvide (vm) {
  6359. var provide = vm.$options.provide;
  6360. if (provide) {
  6361. vm._provided = typeof provide === 'function'
  6362. ? provide.call(vm)
  6363. : provide;
  6364. }
  6365. }
  6366. function initInjections (vm) {
  6367. var result = resolveInject(vm.$options.inject, vm);
  6368. if (result) {
  6369. toggleObserving(false);
  6370. Object.keys(result).forEach(function (key) {
  6371. /* istanbul ignore else */
  6372. if (true) {
  6373. defineReactive$$1(vm, key, result[key], function () {
  6374. warn(
  6375. "Avoid mutating an injected value directly since the changes will be " +
  6376. "overwritten whenever the provided component re-renders. " +
  6377. "injection being mutated: \"" + key + "\"",
  6378. vm
  6379. );
  6380. });
  6381. } else {}
  6382. });
  6383. toggleObserving(true);
  6384. }
  6385. }
  6386. function resolveInject (inject, vm) {
  6387. if (inject) {
  6388. // inject is :any because flow is not smart enough to figure out cached
  6389. var result = Object.create(null);
  6390. var keys = hasSymbol
  6391. ? Reflect.ownKeys(inject)
  6392. : Object.keys(inject);
  6393. for (var i = 0; i < keys.length; i++) {
  6394. var key = keys[i];
  6395. // #6574 in case the inject object is observed...
  6396. if (key === '__ob__') { continue }
  6397. var provideKey = inject[key].from;
  6398. var source = vm;
  6399. while (source) {
  6400. if (source._provided && hasOwn(source._provided, provideKey)) {
  6401. result[key] = source._provided[provideKey];
  6402. break
  6403. }
  6404. source = source.$parent;
  6405. }
  6406. if (!source) {
  6407. if ('default' in inject[key]) {
  6408. var provideDefault = inject[key].default;
  6409. result[key] = typeof provideDefault === 'function'
  6410. ? provideDefault.call(vm)
  6411. : provideDefault;
  6412. } else if (true) {
  6413. warn(("Injection \"" + key + "\" not found"), vm);
  6414. }
  6415. }
  6416. }
  6417. return result
  6418. }
  6419. }
  6420. /* */
  6421. /**
  6422. * Runtime helper for resolving raw children VNodes into a slot object.
  6423. */
  6424. function resolveSlots (
  6425. children,
  6426. context
  6427. ) {
  6428. if (!children || !children.length) {
  6429. return {}
  6430. }
  6431. var slots = {};
  6432. for (var i = 0, l = children.length; i < l; i++) {
  6433. var child = children[i];
  6434. var data = child.data;
  6435. // remove slot attribute if the node is resolved as a Vue slot node
  6436. if (data && data.attrs && data.attrs.slot) {
  6437. delete data.attrs.slot;
  6438. }
  6439. // named slots should only be respected if the vnode was rendered in the
  6440. // same context.
  6441. if ((child.context === context || child.fnContext === context) &&
  6442. data && data.slot != null
  6443. ) {
  6444. var name = data.slot;
  6445. var slot = (slots[name] || (slots[name] = []));
  6446. if (child.tag === 'template') {
  6447. slot.push.apply(slot, child.children || []);
  6448. } else {
  6449. slot.push(child);
  6450. }
  6451. } else {
  6452. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  6453. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  6454. (slots['page'] || (slots['page'] = [])).push(child);
  6455. }else{
  6456. (slots.default || (slots.default = [])).push(child);
  6457. }
  6458. }
  6459. }
  6460. // ignore slots that contains only whitespace
  6461. for (var name$1 in slots) {
  6462. if (slots[name$1].every(isWhitespace)) {
  6463. delete slots[name$1];
  6464. }
  6465. }
  6466. return slots
  6467. }
  6468. function isWhitespace (node) {
  6469. return (node.isComment && !node.asyncFactory) || node.text === ' '
  6470. }
  6471. /* */
  6472. function normalizeScopedSlots (
  6473. slots,
  6474. normalSlots,
  6475. prevSlots
  6476. ) {
  6477. var res;
  6478. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  6479. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  6480. var key = slots && slots.$key;
  6481. if (!slots) {
  6482. res = {};
  6483. } else if (slots._normalized) {
  6484. // fast path 1: child component re-render only, parent did not change
  6485. return slots._normalized
  6486. } else if (
  6487. isStable &&
  6488. prevSlots &&
  6489. prevSlots !== emptyObject &&
  6490. key === prevSlots.$key &&
  6491. !hasNormalSlots &&
  6492. !prevSlots.$hasNormal
  6493. ) {
  6494. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  6495. // only need to normalize once
  6496. return prevSlots
  6497. } else {
  6498. res = {};
  6499. for (var key$1 in slots) {
  6500. if (slots[key$1] && key$1[0] !== '$') {
  6501. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  6502. }
  6503. }
  6504. }
  6505. // expose normal slots on scopedSlots
  6506. for (var key$2 in normalSlots) {
  6507. if (!(key$2 in res)) {
  6508. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  6509. }
  6510. }
  6511. // avoriaz seems to mock a non-extensible $scopedSlots object
  6512. // and when that is passed down this would cause an error
  6513. if (slots && Object.isExtensible(slots)) {
  6514. (slots)._normalized = res;
  6515. }
  6516. def(res, '$stable', isStable);
  6517. def(res, '$key', key);
  6518. def(res, '$hasNormal', hasNormalSlots);
  6519. return res
  6520. }
  6521. function normalizeScopedSlot(normalSlots, key, fn) {
  6522. var normalized = function () {
  6523. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  6524. res = res && typeof res === 'object' && !Array.isArray(res)
  6525. ? [res] // single vnode
  6526. : normalizeChildren(res);
  6527. return res && (
  6528. res.length === 0 ||
  6529. (res.length === 1 && res[0].isComment) // #9658
  6530. ) ? undefined
  6531. : res
  6532. };
  6533. // this is a slot using the new v-slot syntax without scope. although it is
  6534. // compiled as a scoped slot, render fn users would expect it to be present
  6535. // on this.$slots because the usage is semantically a normal slot.
  6536. if (fn.proxy) {
  6537. Object.defineProperty(normalSlots, key, {
  6538. get: normalized,
  6539. enumerable: true,
  6540. configurable: true
  6541. });
  6542. }
  6543. return normalized
  6544. }
  6545. function proxyNormalSlot(slots, key) {
  6546. return function () { return slots[key]; }
  6547. }
  6548. /* */
  6549. /**
  6550. * Runtime helper for rendering v-for lists.
  6551. */
  6552. function renderList (
  6553. val,
  6554. render
  6555. ) {
  6556. var ret, i, l, keys, key;
  6557. if (Array.isArray(val) || typeof val === 'string') {
  6558. ret = new Array(val.length);
  6559. for (i = 0, l = val.length; i < l; i++) {
  6560. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  6561. }
  6562. } else if (typeof val === 'number') {
  6563. ret = new Array(val);
  6564. for (i = 0; i < val; i++) {
  6565. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  6566. }
  6567. } else if (isObject(val)) {
  6568. if (hasSymbol && val[Symbol.iterator]) {
  6569. ret = [];
  6570. var iterator = val[Symbol.iterator]();
  6571. var result = iterator.next();
  6572. while (!result.done) {
  6573. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  6574. result = iterator.next();
  6575. }
  6576. } else {
  6577. keys = Object.keys(val);
  6578. ret = new Array(keys.length);
  6579. for (i = 0, l = keys.length; i < l; i++) {
  6580. key = keys[i];
  6581. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  6582. }
  6583. }
  6584. }
  6585. if (!isDef(ret)) {
  6586. ret = [];
  6587. }
  6588. (ret)._isVList = true;
  6589. return ret
  6590. }
  6591. /* */
  6592. /**
  6593. * Runtime helper for rendering <slot>
  6594. */
  6595. function renderSlot (
  6596. name,
  6597. fallback,
  6598. props,
  6599. bindObject
  6600. ) {
  6601. var scopedSlotFn = this.$scopedSlots[name];
  6602. var nodes;
  6603. if (scopedSlotFn) { // scoped slot
  6604. props = props || {};
  6605. if (bindObject) {
  6606. if ( true && !isObject(bindObject)) {
  6607. warn(
  6608. 'slot v-bind without argument expects an Object',
  6609. this
  6610. );
  6611. }
  6612. props = extend(extend({}, bindObject), props);
  6613. }
  6614. // fixed by xxxxxx app-plus scopedSlot
  6615. nodes = scopedSlotFn(props, this, props._i) || fallback;
  6616. } else {
  6617. nodes = this.$slots[name] || fallback;
  6618. }
  6619. var target = props && props.slot;
  6620. if (target) {
  6621. return this.$createElement('template', { slot: target }, nodes)
  6622. } else {
  6623. return nodes
  6624. }
  6625. }
  6626. /* */
  6627. /**
  6628. * Runtime helper for resolving filters
  6629. */
  6630. function resolveFilter (id) {
  6631. return resolveAsset(this.$options, 'filters', id, true) || identity
  6632. }
  6633. /* */
  6634. function isKeyNotMatch (expect, actual) {
  6635. if (Array.isArray(expect)) {
  6636. return expect.indexOf(actual) === -1
  6637. } else {
  6638. return expect !== actual
  6639. }
  6640. }
  6641. /**
  6642. * Runtime helper for checking keyCodes from config.
  6643. * exposed as Vue.prototype._k
  6644. * passing in eventKeyName as last argument separately for backwards compat
  6645. */
  6646. function checkKeyCodes (
  6647. eventKeyCode,
  6648. key,
  6649. builtInKeyCode,
  6650. eventKeyName,
  6651. builtInKeyName
  6652. ) {
  6653. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  6654. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  6655. return isKeyNotMatch(builtInKeyName, eventKeyName)
  6656. } else if (mappedKeyCode) {
  6657. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  6658. } else if (eventKeyName) {
  6659. return hyphenate(eventKeyName) !== key
  6660. }
  6661. }
  6662. /* */
  6663. /**
  6664. * Runtime helper for merging v-bind="object" into a VNode's data.
  6665. */
  6666. function bindObjectProps (
  6667. data,
  6668. tag,
  6669. value,
  6670. asProp,
  6671. isSync
  6672. ) {
  6673. if (value) {
  6674. if (!isObject(value)) {
  6675. true && warn(
  6676. 'v-bind without argument expects an Object or Array value',
  6677. this
  6678. );
  6679. } else {
  6680. if (Array.isArray(value)) {
  6681. value = toObject(value);
  6682. }
  6683. var hash;
  6684. var loop = function ( key ) {
  6685. if (
  6686. key === 'class' ||
  6687. key === 'style' ||
  6688. isReservedAttribute(key)
  6689. ) {
  6690. hash = data;
  6691. } else {
  6692. var type = data.attrs && data.attrs.type;
  6693. hash = asProp || config.mustUseProp(tag, type, key)
  6694. ? data.domProps || (data.domProps = {})
  6695. : data.attrs || (data.attrs = {});
  6696. }
  6697. var camelizedKey = camelize(key);
  6698. var hyphenatedKey = hyphenate(key);
  6699. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  6700. hash[key] = value[key];
  6701. if (isSync) {
  6702. var on = data.on || (data.on = {});
  6703. on[("update:" + key)] = function ($event) {
  6704. value[key] = $event;
  6705. };
  6706. }
  6707. }
  6708. };
  6709. for (var key in value) loop( key );
  6710. }
  6711. }
  6712. return data
  6713. }
  6714. /* */
  6715. /**
  6716. * Runtime helper for rendering static trees.
  6717. */
  6718. function renderStatic (
  6719. index,
  6720. isInFor
  6721. ) {
  6722. var cached = this._staticTrees || (this._staticTrees = []);
  6723. var tree = cached[index];
  6724. // if has already-rendered static tree and not inside v-for,
  6725. // we can reuse the same tree.
  6726. if (tree && !isInFor) {
  6727. return tree
  6728. }
  6729. // otherwise, render a fresh tree.
  6730. tree = cached[index] = this.$options.staticRenderFns[index].call(
  6731. this._renderProxy,
  6732. null,
  6733. this // for render fns generated for functional component templates
  6734. );
  6735. markStatic(tree, ("__static__" + index), false);
  6736. return tree
  6737. }
  6738. /**
  6739. * Runtime helper for v-once.
  6740. * Effectively it means marking the node as static with a unique key.
  6741. */
  6742. function markOnce (
  6743. tree,
  6744. index,
  6745. key
  6746. ) {
  6747. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  6748. return tree
  6749. }
  6750. function markStatic (
  6751. tree,
  6752. key,
  6753. isOnce
  6754. ) {
  6755. if (Array.isArray(tree)) {
  6756. for (var i = 0; i < tree.length; i++) {
  6757. if (tree[i] && typeof tree[i] !== 'string') {
  6758. markStaticNode(tree[i], (key + "_" + i), isOnce);
  6759. }
  6760. }
  6761. } else {
  6762. markStaticNode(tree, key, isOnce);
  6763. }
  6764. }
  6765. function markStaticNode (node, key, isOnce) {
  6766. node.isStatic = true;
  6767. node.key = key;
  6768. node.isOnce = isOnce;
  6769. }
  6770. /* */
  6771. function bindObjectListeners (data, value) {
  6772. if (value) {
  6773. if (!isPlainObject(value)) {
  6774. true && warn(
  6775. 'v-on without argument expects an Object value',
  6776. this
  6777. );
  6778. } else {
  6779. var on = data.on = data.on ? extend({}, data.on) : {};
  6780. for (var key in value) {
  6781. var existing = on[key];
  6782. var ours = value[key];
  6783. on[key] = existing ? [].concat(existing, ours) : ours;
  6784. }
  6785. }
  6786. }
  6787. return data
  6788. }
  6789. /* */
  6790. function resolveScopedSlots (
  6791. fns, // see flow/vnode
  6792. res,
  6793. // the following are added in 2.6
  6794. hasDynamicKeys,
  6795. contentHashKey
  6796. ) {
  6797. res = res || { $stable: !hasDynamicKeys };
  6798. for (var i = 0; i < fns.length; i++) {
  6799. var slot = fns[i];
  6800. if (Array.isArray(slot)) {
  6801. resolveScopedSlots(slot, res, hasDynamicKeys);
  6802. } else if (slot) {
  6803. // marker for reverse proxying v-slot without scope on this.$slots
  6804. if (slot.proxy) {
  6805. slot.fn.proxy = true;
  6806. }
  6807. res[slot.key] = slot.fn;
  6808. }
  6809. }
  6810. if (contentHashKey) {
  6811. (res).$key = contentHashKey;
  6812. }
  6813. return res
  6814. }
  6815. /* */
  6816. function bindDynamicKeys (baseObj, values) {
  6817. for (var i = 0; i < values.length; i += 2) {
  6818. var key = values[i];
  6819. if (typeof key === 'string' && key) {
  6820. baseObj[values[i]] = values[i + 1];
  6821. } else if ( true && key !== '' && key !== null) {
  6822. // null is a special value for explicitly removing a binding
  6823. warn(
  6824. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  6825. this
  6826. );
  6827. }
  6828. }
  6829. return baseObj
  6830. }
  6831. // helper to dynamically append modifier runtime markers to event names.
  6832. // ensure only append when value is already string, otherwise it will be cast
  6833. // to string and cause the type check to miss.
  6834. function prependModifier (value, symbol) {
  6835. return typeof value === 'string' ? symbol + value : value
  6836. }
  6837. /* */
  6838. function installRenderHelpers (target) {
  6839. target._o = markOnce;
  6840. target._n = toNumber;
  6841. target._s = toString;
  6842. target._l = renderList;
  6843. target._t = renderSlot;
  6844. target._q = looseEqual;
  6845. target._i = looseIndexOf;
  6846. target._m = renderStatic;
  6847. target._f = resolveFilter;
  6848. target._k = checkKeyCodes;
  6849. target._b = bindObjectProps;
  6850. target._v = createTextVNode;
  6851. target._e = createEmptyVNode;
  6852. target._u = resolveScopedSlots;
  6853. target._g = bindObjectListeners;
  6854. target._d = bindDynamicKeys;
  6855. target._p = prependModifier;
  6856. }
  6857. /* */
  6858. function FunctionalRenderContext (
  6859. data,
  6860. props,
  6861. children,
  6862. parent,
  6863. Ctor
  6864. ) {
  6865. var this$1 = this;
  6866. var options = Ctor.options;
  6867. // ensure the createElement function in functional components
  6868. // gets a unique context - this is necessary for correct named slot check
  6869. var contextVm;
  6870. if (hasOwn(parent, '_uid')) {
  6871. contextVm = Object.create(parent);
  6872. // $flow-disable-line
  6873. contextVm._original = parent;
  6874. } else {
  6875. // the context vm passed in is a functional context as well.
  6876. // in this case we want to make sure we are able to get a hold to the
  6877. // real context instance.
  6878. contextVm = parent;
  6879. // $flow-disable-line
  6880. parent = parent._original;
  6881. }
  6882. var isCompiled = isTrue(options._compiled);
  6883. var needNormalization = !isCompiled;
  6884. this.data = data;
  6885. this.props = props;
  6886. this.children = children;
  6887. this.parent = parent;
  6888. this.listeners = data.on || emptyObject;
  6889. this.injections = resolveInject(options.inject, parent);
  6890. this.slots = function () {
  6891. if (!this$1.$slots) {
  6892. normalizeScopedSlots(
  6893. data.scopedSlots,
  6894. this$1.$slots = resolveSlots(children, parent)
  6895. );
  6896. }
  6897. return this$1.$slots
  6898. };
  6899. Object.defineProperty(this, 'scopedSlots', ({
  6900. enumerable: true,
  6901. get: function get () {
  6902. return normalizeScopedSlots(data.scopedSlots, this.slots())
  6903. }
  6904. }));
  6905. // support for compiled functional template
  6906. if (isCompiled) {
  6907. // exposing $options for renderStatic()
  6908. this.$options = options;
  6909. // pre-resolve slots for renderSlot()
  6910. this.$slots = this.slots();
  6911. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  6912. }
  6913. if (options._scopeId) {
  6914. this._c = function (a, b, c, d) {
  6915. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  6916. if (vnode && !Array.isArray(vnode)) {
  6917. vnode.fnScopeId = options._scopeId;
  6918. vnode.fnContext = parent;
  6919. }
  6920. return vnode
  6921. };
  6922. } else {
  6923. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  6924. }
  6925. }
  6926. installRenderHelpers(FunctionalRenderContext.prototype);
  6927. function createFunctionalComponent (
  6928. Ctor,
  6929. propsData,
  6930. data,
  6931. contextVm,
  6932. children
  6933. ) {
  6934. var options = Ctor.options;
  6935. var props = {};
  6936. var propOptions = options.props;
  6937. if (isDef(propOptions)) {
  6938. for (var key in propOptions) {
  6939. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  6940. }
  6941. } else {
  6942. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  6943. if (isDef(data.props)) { mergeProps(props, data.props); }
  6944. }
  6945. var renderContext = new FunctionalRenderContext(
  6946. data,
  6947. props,
  6948. children,
  6949. contextVm,
  6950. Ctor
  6951. );
  6952. var vnode = options.render.call(null, renderContext._c, renderContext);
  6953. if (vnode instanceof VNode) {
  6954. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  6955. } else if (Array.isArray(vnode)) {
  6956. var vnodes = normalizeChildren(vnode) || [];
  6957. var res = new Array(vnodes.length);
  6958. for (var i = 0; i < vnodes.length; i++) {
  6959. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  6960. }
  6961. return res
  6962. }
  6963. }
  6964. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  6965. // #7817 clone node before setting fnContext, otherwise if the node is reused
  6966. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  6967. // that should not be matched to match.
  6968. var clone = cloneVNode(vnode);
  6969. clone.fnContext = contextVm;
  6970. clone.fnOptions = options;
  6971. if (true) {
  6972. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  6973. }
  6974. if (data.slot) {
  6975. (clone.data || (clone.data = {})).slot = data.slot;
  6976. }
  6977. return clone
  6978. }
  6979. function mergeProps (to, from) {
  6980. for (var key in from) {
  6981. to[camelize(key)] = from[key];
  6982. }
  6983. }
  6984. /* */
  6985. /* */
  6986. /* */
  6987. /* */
  6988. // inline hooks to be invoked on component VNodes during patch
  6989. var componentVNodeHooks = {
  6990. init: function init (vnode, hydrating) {
  6991. if (
  6992. vnode.componentInstance &&
  6993. !vnode.componentInstance._isDestroyed &&
  6994. vnode.data.keepAlive
  6995. ) {
  6996. // kept-alive components, treat as a patch
  6997. var mountedNode = vnode; // work around flow
  6998. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  6999. } else {
  7000. var child = vnode.componentInstance = createComponentInstanceForVnode(
  7001. vnode,
  7002. activeInstance
  7003. );
  7004. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  7005. }
  7006. },
  7007. prepatch: function prepatch (oldVnode, vnode) {
  7008. var options = vnode.componentOptions;
  7009. var child = vnode.componentInstance = oldVnode.componentInstance;
  7010. updateChildComponent(
  7011. child,
  7012. options.propsData, // updated props
  7013. options.listeners, // updated listeners
  7014. vnode, // new parent vnode
  7015. options.children // new children
  7016. );
  7017. },
  7018. insert: function insert (vnode) {
  7019. var context = vnode.context;
  7020. var componentInstance = vnode.componentInstance;
  7021. if (!componentInstance._isMounted) {
  7022. callHook(componentInstance, 'onServiceCreated');
  7023. callHook(componentInstance, 'onServiceAttached');
  7024. componentInstance._isMounted = true;
  7025. callHook(componentInstance, 'mounted');
  7026. }
  7027. if (vnode.data.keepAlive) {
  7028. if (context._isMounted) {
  7029. // vue-router#1212
  7030. // During updates, a kept-alive component's child components may
  7031. // change, so directly walking the tree here may call activated hooks
  7032. // on incorrect children. Instead we push them into a queue which will
  7033. // be processed after the whole patch process ended.
  7034. queueActivatedComponent(componentInstance);
  7035. } else {
  7036. activateChildComponent(componentInstance, true /* direct */);
  7037. }
  7038. }
  7039. },
  7040. destroy: function destroy (vnode) {
  7041. var componentInstance = vnode.componentInstance;
  7042. if (!componentInstance._isDestroyed) {
  7043. if (!vnode.data.keepAlive) {
  7044. componentInstance.$destroy();
  7045. } else {
  7046. deactivateChildComponent(componentInstance, true /* direct */);
  7047. }
  7048. }
  7049. }
  7050. };
  7051. var hooksToMerge = Object.keys(componentVNodeHooks);
  7052. function createComponent (
  7053. Ctor,
  7054. data,
  7055. context,
  7056. children,
  7057. tag
  7058. ) {
  7059. if (isUndef(Ctor)) {
  7060. return
  7061. }
  7062. var baseCtor = context.$options._base;
  7063. // plain options object: turn it into a constructor
  7064. if (isObject(Ctor)) {
  7065. Ctor = baseCtor.extend(Ctor);
  7066. }
  7067. // if at this stage it's not a constructor or an async component factory,
  7068. // reject.
  7069. if (typeof Ctor !== 'function') {
  7070. if (true) {
  7071. warn(("Invalid Component definition: " + (String(Ctor))), context);
  7072. }
  7073. return
  7074. }
  7075. // async component
  7076. var asyncFactory;
  7077. if (isUndef(Ctor.cid)) {
  7078. asyncFactory = Ctor;
  7079. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  7080. if (Ctor === undefined) {
  7081. // return a placeholder node for async component, which is rendered
  7082. // as a comment node but preserves all the raw information for the node.
  7083. // the information will be used for async server-rendering and hydration.
  7084. return createAsyncPlaceholder(
  7085. asyncFactory,
  7086. data,
  7087. context,
  7088. children,
  7089. tag
  7090. )
  7091. }
  7092. }
  7093. data = data || {};
  7094. // resolve constructor options in case global mixins are applied after
  7095. // component constructor creation
  7096. resolveConstructorOptions(Ctor);
  7097. // transform component v-model data into props & events
  7098. if (isDef(data.model)) {
  7099. transformModel(Ctor.options, data);
  7100. }
  7101. // extract props
  7102. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  7103. // functional component
  7104. if (isTrue(Ctor.options.functional)) {
  7105. return createFunctionalComponent(Ctor, propsData, data, context, children)
  7106. }
  7107. // extract listeners, since these needs to be treated as
  7108. // child component listeners instead of DOM listeners
  7109. var listeners = data.on;
  7110. // replace with listeners with .native modifier
  7111. // so it gets processed during parent component patch.
  7112. data.on = data.nativeOn;
  7113. if (isTrue(Ctor.options.abstract)) {
  7114. // abstract components do not keep anything
  7115. // other than props & listeners & slot
  7116. // work around flow
  7117. var slot = data.slot;
  7118. data = {};
  7119. if (slot) {
  7120. data.slot = slot;
  7121. }
  7122. }
  7123. // install component management hooks onto the placeholder node
  7124. installComponentHooks(data);
  7125. // return a placeholder vnode
  7126. var name = Ctor.options.name || tag;
  7127. var vnode = new VNode(
  7128. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  7129. data, undefined, undefined, undefined, context,
  7130. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  7131. asyncFactory
  7132. );
  7133. return vnode
  7134. }
  7135. function createComponentInstanceForVnode (
  7136. vnode, // we know it's MountedComponentVNode but flow doesn't
  7137. parent // activeInstance in lifecycle state
  7138. ) {
  7139. var options = {
  7140. _isComponent: true,
  7141. _parentVnode: vnode,
  7142. parent: parent
  7143. };
  7144. // check inline-template render functions
  7145. var inlineTemplate = vnode.data.inlineTemplate;
  7146. if (isDef(inlineTemplate)) {
  7147. options.render = inlineTemplate.render;
  7148. options.staticRenderFns = inlineTemplate.staticRenderFns;
  7149. }
  7150. return new vnode.componentOptions.Ctor(options)
  7151. }
  7152. function installComponentHooks (data) {
  7153. var hooks = data.hook || (data.hook = {});
  7154. for (var i = 0; i < hooksToMerge.length; i++) {
  7155. var key = hooksToMerge[i];
  7156. var existing = hooks[key];
  7157. var toMerge = componentVNodeHooks[key];
  7158. if (existing !== toMerge && !(existing && existing._merged)) {
  7159. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  7160. }
  7161. }
  7162. }
  7163. function mergeHook$1 (f1, f2) {
  7164. var merged = function (a, b) {
  7165. // flow complains about extra args which is why we use any
  7166. f1(a, b);
  7167. f2(a, b);
  7168. };
  7169. merged._merged = true;
  7170. return merged
  7171. }
  7172. // transform component v-model info (value and callback) into
  7173. // prop and event handler respectively.
  7174. function transformModel (options, data) {
  7175. var prop = (options.model && options.model.prop) || 'value';
  7176. var event = (options.model && options.model.event) || 'input'
  7177. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  7178. var on = data.on || (data.on = {});
  7179. var existing = on[event];
  7180. var callback = data.model.callback;
  7181. if (isDef(existing)) {
  7182. if (
  7183. Array.isArray(existing)
  7184. ? existing.indexOf(callback) === -1
  7185. : existing !== callback
  7186. ) {
  7187. on[event] = [callback].concat(existing);
  7188. }
  7189. } else {
  7190. on[event] = callback;
  7191. }
  7192. }
  7193. /* */
  7194. var SIMPLE_NORMALIZE = 1;
  7195. var ALWAYS_NORMALIZE = 2;
  7196. // wrapper function for providing a more flexible interface
  7197. // without getting yelled at by flow
  7198. function createElement (
  7199. context,
  7200. tag,
  7201. data,
  7202. children,
  7203. normalizationType,
  7204. alwaysNormalize
  7205. ) {
  7206. if (Array.isArray(data) || isPrimitive(data)) {
  7207. normalizationType = children;
  7208. children = data;
  7209. data = undefined;
  7210. }
  7211. if (isTrue(alwaysNormalize)) {
  7212. normalizationType = ALWAYS_NORMALIZE;
  7213. }
  7214. return _createElement(context, tag, data, children, normalizationType)
  7215. }
  7216. function _createElement (
  7217. context,
  7218. tag,
  7219. data,
  7220. children,
  7221. normalizationType
  7222. ) {
  7223. if (isDef(data) && isDef((data).__ob__)) {
  7224. true && warn(
  7225. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  7226. 'Always create fresh vnode data objects in each render!',
  7227. context
  7228. );
  7229. return createEmptyVNode()
  7230. }
  7231. // object syntax in v-bind
  7232. if (isDef(data) && isDef(data.is)) {
  7233. tag = data.is;
  7234. }
  7235. if (!tag) {
  7236. // in case of component :is set to falsy value
  7237. return createEmptyVNode()
  7238. }
  7239. // warn against non-primitive key
  7240. if ( true &&
  7241. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  7242. ) {
  7243. {
  7244. warn(
  7245. 'Avoid using non-primitive value as key, ' +
  7246. 'use string/number value instead.',
  7247. context
  7248. );
  7249. }
  7250. }
  7251. // support single function children as default scoped slot
  7252. if (Array.isArray(children) &&
  7253. typeof children[0] === 'function'
  7254. ) {
  7255. data = data || {};
  7256. data.scopedSlots = { default: children[0] };
  7257. children.length = 0;
  7258. }
  7259. if (normalizationType === ALWAYS_NORMALIZE) {
  7260. children = normalizeChildren(children);
  7261. } else if (normalizationType === SIMPLE_NORMALIZE) {
  7262. children = simpleNormalizeChildren(children);
  7263. }
  7264. var vnode, ns;
  7265. if (typeof tag === 'string') {
  7266. var Ctor;
  7267. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  7268. if (config.isReservedTag(tag)) {
  7269. // platform built-in elements
  7270. if ( true && isDef(data) && isDef(data.nativeOn)) {
  7271. warn(
  7272. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  7273. context
  7274. );
  7275. }
  7276. vnode = new VNode(
  7277. config.parsePlatformTagName(tag), data, children,
  7278. undefined, undefined, context
  7279. );
  7280. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  7281. // component
  7282. vnode = createComponent(Ctor, data, context, children, tag);
  7283. } else {
  7284. // unknown or unlisted namespaced elements
  7285. // check at runtime because it may get assigned a namespace when its
  7286. // parent normalizes children
  7287. vnode = new VNode(
  7288. tag, data, children,
  7289. undefined, undefined, context
  7290. );
  7291. }
  7292. } else {
  7293. // direct component options / constructor
  7294. vnode = createComponent(tag, data, context, children);
  7295. }
  7296. if (Array.isArray(vnode)) {
  7297. return vnode
  7298. } else if (isDef(vnode)) {
  7299. if (isDef(ns)) { applyNS(vnode, ns); }
  7300. if (isDef(data)) { registerDeepBindings(data); }
  7301. return vnode
  7302. } else {
  7303. return createEmptyVNode()
  7304. }
  7305. }
  7306. function applyNS (vnode, ns, force) {
  7307. vnode.ns = ns;
  7308. if (vnode.tag === 'foreignObject') {
  7309. // use default namespace inside foreignObject
  7310. ns = undefined;
  7311. force = true;
  7312. }
  7313. if (isDef(vnode.children)) {
  7314. for (var i = 0, l = vnode.children.length; i < l; i++) {
  7315. var child = vnode.children[i];
  7316. if (isDef(child.tag) && (
  7317. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  7318. applyNS(child, ns, force);
  7319. }
  7320. }
  7321. }
  7322. }
  7323. // ref #5318
  7324. // necessary to ensure parent re-render when deep bindings like :style and
  7325. // :class are used on slot nodes
  7326. function registerDeepBindings (data) {
  7327. if (isObject(data.style)) {
  7328. traverse(data.style);
  7329. }
  7330. if (isObject(data.class)) {
  7331. traverse(data.class);
  7332. }
  7333. }
  7334. /* */
  7335. function initRender (vm) {
  7336. vm._vnode = null; // the root of the child tree
  7337. vm._staticTrees = null; // v-once cached trees
  7338. var options = vm.$options;
  7339. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  7340. var renderContext = parentVnode && parentVnode.context;
  7341. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  7342. vm.$scopedSlots = emptyObject;
  7343. // bind the createElement fn to this instance
  7344. // so that we get proper render context inside it.
  7345. // args order: tag, data, children, normalizationType, alwaysNormalize
  7346. // internal version is used by render functions compiled from templates
  7347. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  7348. // normalization is always applied for the public version, used in
  7349. // user-written render functions.
  7350. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  7351. // $attrs & $listeners are exposed for easier HOC creation.
  7352. // they need to be reactive so that HOCs using them are always updated
  7353. var parentData = parentVnode && parentVnode.data;
  7354. /* istanbul ignore else */
  7355. if (true) {
  7356. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  7357. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  7358. }, true);
  7359. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  7360. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  7361. }, true);
  7362. } else {}
  7363. }
  7364. var currentRenderingInstance = null;
  7365. function renderMixin (Vue) {
  7366. // install runtime convenience helpers
  7367. installRenderHelpers(Vue.prototype);
  7368. Vue.prototype.$nextTick = function (fn) {
  7369. return nextTick(fn, this)
  7370. };
  7371. Vue.prototype._render = function () {
  7372. var vm = this;
  7373. var ref = vm.$options;
  7374. var render = ref.render;
  7375. var _parentVnode = ref._parentVnode;
  7376. if (_parentVnode) {
  7377. vm.$scopedSlots = normalizeScopedSlots(
  7378. _parentVnode.data.scopedSlots,
  7379. vm.$slots,
  7380. vm.$scopedSlots
  7381. );
  7382. }
  7383. // set parent vnode. this allows render functions to have access
  7384. // to the data on the placeholder node.
  7385. vm.$vnode = _parentVnode;
  7386. // render self
  7387. var vnode;
  7388. try {
  7389. // There's no need to maintain a stack because all render fns are called
  7390. // separately from one another. Nested component's render fns are called
  7391. // when parent component is patched.
  7392. currentRenderingInstance = vm;
  7393. vnode = render.call(vm._renderProxy, vm.$createElement);
  7394. } catch (e) {
  7395. handleError(e, vm, "render");
  7396. // return error render result,
  7397. // or previous vnode to prevent render error causing blank component
  7398. /* istanbul ignore else */
  7399. if ( true && vm.$options.renderError) {
  7400. try {
  7401. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  7402. } catch (e) {
  7403. handleError(e, vm, "renderError");
  7404. vnode = vm._vnode;
  7405. }
  7406. } else {
  7407. vnode = vm._vnode;
  7408. }
  7409. } finally {
  7410. currentRenderingInstance = null;
  7411. }
  7412. // if the returned array contains only a single node, allow it
  7413. if (Array.isArray(vnode) && vnode.length === 1) {
  7414. vnode = vnode[0];
  7415. }
  7416. // return empty vnode in case the render function errored out
  7417. if (!(vnode instanceof VNode)) {
  7418. if ( true && Array.isArray(vnode)) {
  7419. warn(
  7420. 'Multiple root nodes returned from render function. Render function ' +
  7421. 'should return a single root node.',
  7422. vm
  7423. );
  7424. }
  7425. vnode = createEmptyVNode();
  7426. }
  7427. // set parent
  7428. vnode.parent = _parentVnode;
  7429. return vnode
  7430. };
  7431. }
  7432. /* */
  7433. function ensureCtor (comp, base) {
  7434. if (
  7435. comp.__esModule ||
  7436. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  7437. ) {
  7438. comp = comp.default;
  7439. }
  7440. return isObject(comp)
  7441. ? base.extend(comp)
  7442. : comp
  7443. }
  7444. function createAsyncPlaceholder (
  7445. factory,
  7446. data,
  7447. context,
  7448. children,
  7449. tag
  7450. ) {
  7451. var node = createEmptyVNode();
  7452. node.asyncFactory = factory;
  7453. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  7454. return node
  7455. }
  7456. function resolveAsyncComponent (
  7457. factory,
  7458. baseCtor
  7459. ) {
  7460. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  7461. return factory.errorComp
  7462. }
  7463. if (isDef(factory.resolved)) {
  7464. return factory.resolved
  7465. }
  7466. var owner = currentRenderingInstance;
  7467. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  7468. // already pending
  7469. factory.owners.push(owner);
  7470. }
  7471. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  7472. return factory.loadingComp
  7473. }
  7474. if (owner && !isDef(factory.owners)) {
  7475. var owners = factory.owners = [owner];
  7476. var sync = true;
  7477. var timerLoading = null;
  7478. var timerTimeout = null
  7479. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  7480. var forceRender = function (renderCompleted) {
  7481. for (var i = 0, l = owners.length; i < l; i++) {
  7482. (owners[i]).$forceUpdate();
  7483. }
  7484. if (renderCompleted) {
  7485. owners.length = 0;
  7486. if (timerLoading !== null) {
  7487. clearTimeout(timerLoading);
  7488. timerLoading = null;
  7489. }
  7490. if (timerTimeout !== null) {
  7491. clearTimeout(timerTimeout);
  7492. timerTimeout = null;
  7493. }
  7494. }
  7495. };
  7496. var resolve = once(function (res) {
  7497. // cache resolved
  7498. factory.resolved = ensureCtor(res, baseCtor);
  7499. // invoke callbacks only if this is not a synchronous resolve
  7500. // (async resolves are shimmed as synchronous during SSR)
  7501. if (!sync) {
  7502. forceRender(true);
  7503. } else {
  7504. owners.length = 0;
  7505. }
  7506. });
  7507. var reject = once(function (reason) {
  7508. true && warn(
  7509. "Failed to resolve async component: " + (String(factory)) +
  7510. (reason ? ("\nReason: " + reason) : '')
  7511. );
  7512. if (isDef(factory.errorComp)) {
  7513. factory.error = true;
  7514. forceRender(true);
  7515. }
  7516. });
  7517. var res = factory(resolve, reject);
  7518. if (isObject(res)) {
  7519. if (isPromise(res)) {
  7520. // () => Promise
  7521. if (isUndef(factory.resolved)) {
  7522. res.then(resolve, reject);
  7523. }
  7524. } else if (isPromise(res.component)) {
  7525. res.component.then(resolve, reject);
  7526. if (isDef(res.error)) {
  7527. factory.errorComp = ensureCtor(res.error, baseCtor);
  7528. }
  7529. if (isDef(res.loading)) {
  7530. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  7531. if (res.delay === 0) {
  7532. factory.loading = true;
  7533. } else {
  7534. timerLoading = setTimeout(function () {
  7535. timerLoading = null;
  7536. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  7537. factory.loading = true;
  7538. forceRender(false);
  7539. }
  7540. }, res.delay || 200);
  7541. }
  7542. }
  7543. if (isDef(res.timeout)) {
  7544. timerTimeout = setTimeout(function () {
  7545. timerTimeout = null;
  7546. if (isUndef(factory.resolved)) {
  7547. reject(
  7548. true
  7549. ? ("timeout (" + (res.timeout) + "ms)")
  7550. : undefined
  7551. );
  7552. }
  7553. }, res.timeout);
  7554. }
  7555. }
  7556. }
  7557. sync = false;
  7558. // return in case resolved synchronously
  7559. return factory.loading
  7560. ? factory.loadingComp
  7561. : factory.resolved
  7562. }
  7563. }
  7564. /* */
  7565. function isAsyncPlaceholder (node) {
  7566. return node.isComment && node.asyncFactory
  7567. }
  7568. /* */
  7569. function getFirstComponentChild (children) {
  7570. if (Array.isArray(children)) {
  7571. for (var i = 0; i < children.length; i++) {
  7572. var c = children[i];
  7573. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  7574. return c
  7575. }
  7576. }
  7577. }
  7578. }
  7579. /* */
  7580. /* */
  7581. function initEvents (vm) {
  7582. vm._events = Object.create(null);
  7583. vm._hasHookEvent = false;
  7584. // init parent attached events
  7585. var listeners = vm.$options._parentListeners;
  7586. if (listeners) {
  7587. updateComponentListeners(vm, listeners);
  7588. }
  7589. }
  7590. var target;
  7591. function add (event, fn) {
  7592. target.$on(event, fn);
  7593. }
  7594. function remove$1 (event, fn) {
  7595. target.$off(event, fn);
  7596. }
  7597. function createOnceHandler (event, fn) {
  7598. var _target = target;
  7599. return function onceHandler () {
  7600. var res = fn.apply(null, arguments);
  7601. if (res !== null) {
  7602. _target.$off(event, onceHandler);
  7603. }
  7604. }
  7605. }
  7606. function updateComponentListeners (
  7607. vm,
  7608. listeners,
  7609. oldListeners
  7610. ) {
  7611. target = vm;
  7612. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  7613. target = undefined;
  7614. }
  7615. function eventsMixin (Vue) {
  7616. var hookRE = /^hook:/;
  7617. Vue.prototype.$on = function (event, fn) {
  7618. var vm = this;
  7619. if (Array.isArray(event)) {
  7620. for (var i = 0, l = event.length; i < l; i++) {
  7621. vm.$on(event[i], fn);
  7622. }
  7623. } else {
  7624. (vm._events[event] || (vm._events[event] = [])).push(fn);
  7625. // optimize hook:event cost by using a boolean flag marked at registration
  7626. // instead of a hash lookup
  7627. if (hookRE.test(event)) {
  7628. vm._hasHookEvent = true;
  7629. }
  7630. }
  7631. return vm
  7632. };
  7633. Vue.prototype.$once = function (event, fn) {
  7634. var vm = this;
  7635. function on () {
  7636. vm.$off(event, on);
  7637. fn.apply(vm, arguments);
  7638. }
  7639. on.fn = fn;
  7640. vm.$on(event, on);
  7641. return vm
  7642. };
  7643. Vue.prototype.$off = function (event, fn) {
  7644. var vm = this;
  7645. // all
  7646. if (!arguments.length) {
  7647. vm._events = Object.create(null);
  7648. return vm
  7649. }
  7650. // array of events
  7651. if (Array.isArray(event)) {
  7652. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  7653. vm.$off(event[i$1], fn);
  7654. }
  7655. return vm
  7656. }
  7657. // specific event
  7658. var cbs = vm._events[event];
  7659. if (!cbs) {
  7660. return vm
  7661. }
  7662. if (!fn) {
  7663. vm._events[event] = null;
  7664. return vm
  7665. }
  7666. // specific handler
  7667. var cb;
  7668. var i = cbs.length;
  7669. while (i--) {
  7670. cb = cbs[i];
  7671. if (cb === fn || cb.fn === fn) {
  7672. cbs.splice(i, 1);
  7673. break
  7674. }
  7675. }
  7676. return vm
  7677. };
  7678. Vue.prototype.$emit = function (event) {
  7679. var vm = this;
  7680. if (true) {
  7681. var lowerCaseEvent = event.toLowerCase();
  7682. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  7683. tip(
  7684. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  7685. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  7686. "Note that HTML attributes are case-insensitive and you cannot use " +
  7687. "v-on to listen to camelCase events when using in-DOM templates. " +
  7688. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  7689. );
  7690. }
  7691. }
  7692. var cbs = vm._events[event];
  7693. if (cbs) {
  7694. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  7695. var args = toArray(arguments, 1);
  7696. var info = "event handler for \"" + event + "\"";
  7697. for (var i = 0, l = cbs.length; i < l; i++) {
  7698. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  7699. }
  7700. }
  7701. return vm
  7702. };
  7703. }
  7704. /* */
  7705. var activeInstance = null;
  7706. var isUpdatingChildComponent = false;
  7707. function setActiveInstance(vm) {
  7708. var prevActiveInstance = activeInstance;
  7709. activeInstance = vm;
  7710. return function () {
  7711. activeInstance = prevActiveInstance;
  7712. }
  7713. }
  7714. function initLifecycle (vm) {
  7715. var options = vm.$options;
  7716. // locate first non-abstract parent
  7717. var parent = options.parent;
  7718. if (parent && !options.abstract) {
  7719. while (parent.$options.abstract && parent.$parent) {
  7720. parent = parent.$parent;
  7721. }
  7722. parent.$children.push(vm);
  7723. }
  7724. vm.$parent = parent;
  7725. vm.$root = parent ? parent.$root : vm;
  7726. vm.$children = [];
  7727. vm.$refs = {};
  7728. vm._watcher = null;
  7729. vm._inactive = null;
  7730. vm._directInactive = false;
  7731. vm._isMounted = false;
  7732. vm._isDestroyed = false;
  7733. vm._isBeingDestroyed = false;
  7734. }
  7735. function lifecycleMixin (Vue) {
  7736. Vue.prototype._update = function (vnode, hydrating) {
  7737. var vm = this;
  7738. var prevEl = vm.$el;
  7739. var prevVnode = vm._vnode;
  7740. var restoreActiveInstance = setActiveInstance(vm);
  7741. vm._vnode = vnode;
  7742. // Vue.prototype.__patch__ is injected in entry points
  7743. // based on the rendering backend used.
  7744. if (!prevVnode) {
  7745. // initial render
  7746. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  7747. } else {
  7748. // updates
  7749. vm.$el = vm.__patch__(prevVnode, vnode);
  7750. }
  7751. restoreActiveInstance();
  7752. // update __vue__ reference
  7753. if (prevEl) {
  7754. prevEl.__vue__ = null;
  7755. }
  7756. if (vm.$el) {
  7757. vm.$el.__vue__ = vm;
  7758. }
  7759. // if parent is an HOC, update its $el as well
  7760. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  7761. vm.$parent.$el = vm.$el;
  7762. }
  7763. // updated hook is called by the scheduler to ensure that children are
  7764. // updated in a parent's updated hook.
  7765. };
  7766. Vue.prototype.$forceUpdate = function () {
  7767. var vm = this;
  7768. if (vm._watcher) {
  7769. vm._watcher.update();
  7770. }
  7771. };
  7772. Vue.prototype.$destroy = function () {
  7773. var vm = this;
  7774. if (vm._isBeingDestroyed) {
  7775. return
  7776. }
  7777. callHook(vm, 'beforeDestroy');
  7778. vm._isBeingDestroyed = true;
  7779. // remove self from parent
  7780. var parent = vm.$parent;
  7781. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  7782. remove(parent.$children, vm);
  7783. }
  7784. // teardown watchers
  7785. if (vm._watcher) {
  7786. vm._watcher.teardown();
  7787. }
  7788. var i = vm._watchers.length;
  7789. while (i--) {
  7790. vm._watchers[i].teardown();
  7791. }
  7792. // remove reference from data ob
  7793. // frozen object may not have observer.
  7794. if (vm._data.__ob__) {
  7795. vm._data.__ob__.vmCount--;
  7796. }
  7797. // call the last hook...
  7798. vm._isDestroyed = true;
  7799. // invoke destroy hooks on current rendered tree
  7800. vm.__patch__(vm._vnode, null);
  7801. // fire destroyed hook
  7802. callHook(vm, 'destroyed');
  7803. // turn off all instance listeners.
  7804. vm.$off();
  7805. // remove __vue__ reference
  7806. if (vm.$el) {
  7807. vm.$el.__vue__ = null;
  7808. }
  7809. // release circular reference (#6759)
  7810. if (vm.$vnode) {
  7811. vm.$vnode.parent = null;
  7812. }
  7813. };
  7814. }
  7815. function updateChildComponent (
  7816. vm,
  7817. propsData,
  7818. listeners,
  7819. parentVnode,
  7820. renderChildren
  7821. ) {
  7822. if (true) {
  7823. isUpdatingChildComponent = true;
  7824. }
  7825. // determine whether component has slot children
  7826. // we need to do this before overwriting $options._renderChildren.
  7827. // check if there are dynamic scopedSlots (hand-written or compiled but with
  7828. // dynamic slot names). Static scoped slots compiled from template has the
  7829. // "$stable" marker.
  7830. var newScopedSlots = parentVnode.data.scopedSlots;
  7831. var oldScopedSlots = vm.$scopedSlots;
  7832. var hasDynamicScopedSlot = !!(
  7833. (newScopedSlots && !newScopedSlots.$stable) ||
  7834. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  7835. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  7836. );
  7837. // Any static slot children from the parent may have changed during parent's
  7838. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  7839. // update is necessary to ensure correctness.
  7840. var needsForceUpdate = !!(
  7841. renderChildren || // has new static slots
  7842. vm.$options._renderChildren || // has old static slots
  7843. hasDynamicScopedSlot
  7844. );
  7845. vm.$options._parentVnode = parentVnode;
  7846. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  7847. if (vm._vnode) { // update child tree's parent
  7848. vm._vnode.parent = parentVnode;
  7849. }
  7850. vm.$options._renderChildren = renderChildren;
  7851. // update $attrs and $listeners hash
  7852. // these are also reactive so they may trigger child update if the child
  7853. // used them during render
  7854. vm.$attrs = parentVnode.data.attrs || emptyObject;
  7855. vm.$listeners = listeners || emptyObject;
  7856. // update props
  7857. if (propsData && vm.$options.props) {
  7858. toggleObserving(false);
  7859. var props = vm._props;
  7860. var propKeys = vm.$options._propKeys || [];
  7861. for (var i = 0; i < propKeys.length; i++) {
  7862. var key = propKeys[i];
  7863. var propOptions = vm.$options.props; // wtf flow?
  7864. props[key] = validateProp(key, propOptions, propsData, vm);
  7865. }
  7866. toggleObserving(true);
  7867. // keep a copy of raw propsData
  7868. vm.$options.propsData = propsData;
  7869. }
  7870. // fixed by xxxxxx update properties(mp runtime)
  7871. vm._$updateProperties && vm._$updateProperties(vm);
  7872. // update listeners
  7873. listeners = listeners || emptyObject;
  7874. var oldListeners = vm.$options._parentListeners;
  7875. vm.$options._parentListeners = listeners;
  7876. updateComponentListeners(vm, listeners, oldListeners);
  7877. // resolve slots + force update if has children
  7878. if (needsForceUpdate) {
  7879. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  7880. vm.$forceUpdate();
  7881. }
  7882. if (true) {
  7883. isUpdatingChildComponent = false;
  7884. }
  7885. }
  7886. function isInInactiveTree (vm) {
  7887. while (vm && (vm = vm.$parent)) {
  7888. if (vm._inactive) { return true }
  7889. }
  7890. return false
  7891. }
  7892. function activateChildComponent (vm, direct) {
  7893. if (direct) {
  7894. vm._directInactive = false;
  7895. if (isInInactiveTree(vm)) {
  7896. return
  7897. }
  7898. } else if (vm._directInactive) {
  7899. return
  7900. }
  7901. if (vm._inactive || vm._inactive === null) {
  7902. vm._inactive = false;
  7903. for (var i = 0; i < vm.$children.length; i++) {
  7904. activateChildComponent(vm.$children[i]);
  7905. }
  7906. callHook(vm, 'activated');
  7907. }
  7908. }
  7909. function deactivateChildComponent (vm, direct) {
  7910. if (direct) {
  7911. vm._directInactive = true;
  7912. if (isInInactiveTree(vm)) {
  7913. return
  7914. }
  7915. }
  7916. if (!vm._inactive) {
  7917. vm._inactive = true;
  7918. for (var i = 0; i < vm.$children.length; i++) {
  7919. deactivateChildComponent(vm.$children[i]);
  7920. }
  7921. callHook(vm, 'deactivated');
  7922. }
  7923. }
  7924. function callHook (vm, hook) {
  7925. // #7573 disable dep collection when invoking lifecycle hooks
  7926. pushTarget();
  7927. var handlers = vm.$options[hook];
  7928. var info = hook + " hook";
  7929. if (handlers) {
  7930. for (var i = 0, j = handlers.length; i < j; i++) {
  7931. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  7932. }
  7933. }
  7934. if (vm._hasHookEvent) {
  7935. vm.$emit('hook:' + hook);
  7936. }
  7937. popTarget();
  7938. }
  7939. /* */
  7940. var MAX_UPDATE_COUNT = 100;
  7941. var queue = [];
  7942. var activatedChildren = [];
  7943. var has = {};
  7944. var circular = {};
  7945. var waiting = false;
  7946. var flushing = false;
  7947. var index = 0;
  7948. /**
  7949. * Reset the scheduler's state.
  7950. */
  7951. function resetSchedulerState () {
  7952. index = queue.length = activatedChildren.length = 0;
  7953. has = {};
  7954. if (true) {
  7955. circular = {};
  7956. }
  7957. waiting = flushing = false;
  7958. }
  7959. // Async edge case #6566 requires saving the timestamp when event listeners are
  7960. // attached. However, calling performance.now() has a perf overhead especially
  7961. // if the page has thousands of event listeners. Instead, we take a timestamp
  7962. // every time the scheduler flushes and use that for all event listeners
  7963. // attached during that flush.
  7964. var currentFlushTimestamp = 0;
  7965. // Async edge case fix requires storing an event listener's attach timestamp.
  7966. var getNow = Date.now;
  7967. // Determine what event timestamp the browser is using. Annoyingly, the
  7968. // timestamp can either be hi-res (relative to page load) or low-res
  7969. // (relative to UNIX epoch), so in order to compare time we have to use the
  7970. // same timestamp type when saving the flush timestamp.
  7971. // All IE versions use low-res event timestamps, and have problematic clock
  7972. // implementations (#9632)
  7973. if (inBrowser && !isIE) {
  7974. var performance = window.performance;
  7975. if (
  7976. performance &&
  7977. typeof performance.now === 'function' &&
  7978. getNow() > document.createEvent('Event').timeStamp
  7979. ) {
  7980. // if the event timestamp, although evaluated AFTER the Date.now(), is
  7981. // smaller than it, it means the event is using a hi-res timestamp,
  7982. // and we need to use the hi-res version for event listener timestamps as
  7983. // well.
  7984. getNow = function () { return performance.now(); };
  7985. }
  7986. }
  7987. /**
  7988. * Flush both queues and run the watchers.
  7989. */
  7990. function flushSchedulerQueue () {
  7991. currentFlushTimestamp = getNow();
  7992. flushing = true;
  7993. var watcher, id;
  7994. // Sort queue before flush.
  7995. // This ensures that:
  7996. // 1. Components are updated from parent to child. (because parent is always
  7997. // created before the child)
  7998. // 2. A component's user watchers are run before its render watcher (because
  7999. // user watchers are created before the render watcher)
  8000. // 3. If a component is destroyed during a parent component's watcher run,
  8001. // its watchers can be skipped.
  8002. queue.sort(function (a, b) { return a.id - b.id; });
  8003. // do not cache length because more watchers might be pushed
  8004. // as we run existing watchers
  8005. for (index = 0; index < queue.length; index++) {
  8006. watcher = queue[index];
  8007. if (watcher.before) {
  8008. watcher.before();
  8009. }
  8010. id = watcher.id;
  8011. has[id] = null;
  8012. watcher.run();
  8013. // in dev build, check and stop circular updates.
  8014. if ( true && has[id] != null) {
  8015. circular[id] = (circular[id] || 0) + 1;
  8016. if (circular[id] > MAX_UPDATE_COUNT) {
  8017. warn(
  8018. 'You may have an infinite update loop ' + (
  8019. watcher.user
  8020. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  8021. : "in a component render function."
  8022. ),
  8023. watcher.vm
  8024. );
  8025. break
  8026. }
  8027. }
  8028. }
  8029. // keep copies of post queues before resetting state
  8030. var activatedQueue = activatedChildren.slice();
  8031. var updatedQueue = queue.slice();
  8032. resetSchedulerState();
  8033. // call component updated and activated hooks
  8034. callActivatedHooks(activatedQueue);
  8035. callUpdatedHooks(updatedQueue);
  8036. // devtool hook
  8037. /* istanbul ignore if */
  8038. if (devtools && config.devtools) {
  8039. devtools.emit('flush');
  8040. }
  8041. }
  8042. function callUpdatedHooks (queue) {
  8043. var i = queue.length;
  8044. while (i--) {
  8045. var watcher = queue[i];
  8046. var vm = watcher.vm;
  8047. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  8048. callHook(vm, 'updated');
  8049. }
  8050. }
  8051. }
  8052. /**
  8053. * Queue a kept-alive component that was activated during patch.
  8054. * The queue will be processed after the entire tree has been patched.
  8055. */
  8056. function queueActivatedComponent (vm) {
  8057. // setting _inactive to false here so that a render function can
  8058. // rely on checking whether it's in an inactive tree (e.g. router-view)
  8059. vm._inactive = false;
  8060. activatedChildren.push(vm);
  8061. }
  8062. function callActivatedHooks (queue) {
  8063. for (var i = 0; i < queue.length; i++) {
  8064. queue[i]._inactive = true;
  8065. activateChildComponent(queue[i], true /* true */);
  8066. }
  8067. }
  8068. /**
  8069. * Push a watcher into the watcher queue.
  8070. * Jobs with duplicate IDs will be skipped unless it's
  8071. * pushed when the queue is being flushed.
  8072. */
  8073. function queueWatcher (watcher) {
  8074. var id = watcher.id;
  8075. if (has[id] == null) {
  8076. has[id] = true;
  8077. if (!flushing) {
  8078. queue.push(watcher);
  8079. } else {
  8080. // if already flushing, splice the watcher based on its id
  8081. // if already past its id, it will be run next immediately.
  8082. var i = queue.length - 1;
  8083. while (i > index && queue[i].id > watcher.id) {
  8084. i--;
  8085. }
  8086. queue.splice(i + 1, 0, watcher);
  8087. }
  8088. // queue the flush
  8089. if (!waiting) {
  8090. waiting = true;
  8091. if ( true && !config.async) {
  8092. flushSchedulerQueue();
  8093. return
  8094. }
  8095. nextTick(flushSchedulerQueue);
  8096. }
  8097. }
  8098. }
  8099. /* */
  8100. var uid$2 = 0;
  8101. /**
  8102. * A watcher parses an expression, collects dependencies,
  8103. * and fires callback when the expression value changes.
  8104. * This is used for both the $watch() api and directives.
  8105. */
  8106. var Watcher = function Watcher (
  8107. vm,
  8108. expOrFn,
  8109. cb,
  8110. options,
  8111. isRenderWatcher
  8112. ) {
  8113. this.vm = vm;
  8114. if (isRenderWatcher) {
  8115. vm._watcher = this;
  8116. }
  8117. vm._watchers.push(this);
  8118. // options
  8119. if (options) {
  8120. this.deep = !!options.deep;
  8121. this.user = !!options.user;
  8122. this.lazy = !!options.lazy;
  8123. this.sync = !!options.sync;
  8124. this.before = options.before;
  8125. } else {
  8126. this.deep = this.user = this.lazy = this.sync = false;
  8127. }
  8128. this.cb = cb;
  8129. this.id = ++uid$2; // uid for batching
  8130. this.active = true;
  8131. this.dirty = this.lazy; // for lazy watchers
  8132. this.deps = [];
  8133. this.newDeps = [];
  8134. this.depIds = new _Set();
  8135. this.newDepIds = new _Set();
  8136. this.expression = true
  8137. ? expOrFn.toString()
  8138. : undefined;
  8139. // parse expression for getter
  8140. if (typeof expOrFn === 'function') {
  8141. this.getter = expOrFn;
  8142. } else {
  8143. this.getter = parsePath(expOrFn);
  8144. if (!this.getter) {
  8145. this.getter = noop;
  8146. true && warn(
  8147. "Failed watching path: \"" + expOrFn + "\" " +
  8148. 'Watcher only accepts simple dot-delimited paths. ' +
  8149. 'For full control, use a function instead.',
  8150. vm
  8151. );
  8152. }
  8153. }
  8154. this.value = this.lazy
  8155. ? undefined
  8156. : this.get();
  8157. };
  8158. /**
  8159. * Evaluate the getter, and re-collect dependencies.
  8160. */
  8161. Watcher.prototype.get = function get () {
  8162. pushTarget(this);
  8163. var value;
  8164. var vm = this.vm;
  8165. try {
  8166. value = this.getter.call(vm, vm);
  8167. } catch (e) {
  8168. if (this.user) {
  8169. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  8170. } else {
  8171. throw e
  8172. }
  8173. } finally {
  8174. // "touch" every property so they are all tracked as
  8175. // dependencies for deep watching
  8176. if (this.deep) {
  8177. traverse(value);
  8178. }
  8179. popTarget();
  8180. this.cleanupDeps();
  8181. }
  8182. return value
  8183. };
  8184. /**
  8185. * Add a dependency to this directive.
  8186. */
  8187. Watcher.prototype.addDep = function addDep (dep) {
  8188. var id = dep.id;
  8189. if (!this.newDepIds.has(id)) {
  8190. this.newDepIds.add(id);
  8191. this.newDeps.push(dep);
  8192. if (!this.depIds.has(id)) {
  8193. dep.addSub(this);
  8194. }
  8195. }
  8196. };
  8197. /**
  8198. * Clean up for dependency collection.
  8199. */
  8200. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  8201. var i = this.deps.length;
  8202. while (i--) {
  8203. var dep = this.deps[i];
  8204. if (!this.newDepIds.has(dep.id)) {
  8205. dep.removeSub(this);
  8206. }
  8207. }
  8208. var tmp = this.depIds;
  8209. this.depIds = this.newDepIds;
  8210. this.newDepIds = tmp;
  8211. this.newDepIds.clear();
  8212. tmp = this.deps;
  8213. this.deps = this.newDeps;
  8214. this.newDeps = tmp;
  8215. this.newDeps.length = 0;
  8216. };
  8217. /**
  8218. * Subscriber interface.
  8219. * Will be called when a dependency changes.
  8220. */
  8221. Watcher.prototype.update = function update () {
  8222. /* istanbul ignore else */
  8223. if (this.lazy) {
  8224. this.dirty = true;
  8225. } else if (this.sync) {
  8226. this.run();
  8227. } else {
  8228. queueWatcher(this);
  8229. }
  8230. };
  8231. /**
  8232. * Scheduler job interface.
  8233. * Will be called by the scheduler.
  8234. */
  8235. Watcher.prototype.run = function run () {
  8236. if (this.active) {
  8237. var value = this.get();
  8238. if (
  8239. value !== this.value ||
  8240. // Deep watchers and watchers on Object/Arrays should fire even
  8241. // when the value is the same, because the value may
  8242. // have mutated.
  8243. isObject(value) ||
  8244. this.deep
  8245. ) {
  8246. // set new value
  8247. var oldValue = this.value;
  8248. this.value = value;
  8249. if (this.user) {
  8250. try {
  8251. this.cb.call(this.vm, value, oldValue);
  8252. } catch (e) {
  8253. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  8254. }
  8255. } else {
  8256. this.cb.call(this.vm, value, oldValue);
  8257. }
  8258. }
  8259. }
  8260. };
  8261. /**
  8262. * Evaluate the value of the watcher.
  8263. * This only gets called for lazy watchers.
  8264. */
  8265. Watcher.prototype.evaluate = function evaluate () {
  8266. this.value = this.get();
  8267. this.dirty = false;
  8268. };
  8269. /**
  8270. * Depend on all deps collected by this watcher.
  8271. */
  8272. Watcher.prototype.depend = function depend () {
  8273. var i = this.deps.length;
  8274. while (i--) {
  8275. this.deps[i].depend();
  8276. }
  8277. };
  8278. /**
  8279. * Remove self from all dependencies' subscriber list.
  8280. */
  8281. Watcher.prototype.teardown = function teardown () {
  8282. if (this.active) {
  8283. // remove self from vm's watcher list
  8284. // this is a somewhat expensive operation so we skip it
  8285. // if the vm is being destroyed.
  8286. if (!this.vm._isBeingDestroyed) {
  8287. remove(this.vm._watchers, this);
  8288. }
  8289. var i = this.deps.length;
  8290. while (i--) {
  8291. this.deps[i].removeSub(this);
  8292. }
  8293. this.active = false;
  8294. }
  8295. };
  8296. /* */
  8297. var sharedPropertyDefinition = {
  8298. enumerable: true,
  8299. configurable: true,
  8300. get: noop,
  8301. set: noop
  8302. };
  8303. function proxy (target, sourceKey, key) {
  8304. sharedPropertyDefinition.get = function proxyGetter () {
  8305. return this[sourceKey][key]
  8306. };
  8307. sharedPropertyDefinition.set = function proxySetter (val) {
  8308. this[sourceKey][key] = val;
  8309. };
  8310. Object.defineProperty(target, key, sharedPropertyDefinition);
  8311. }
  8312. function initState (vm) {
  8313. vm._watchers = [];
  8314. var opts = vm.$options;
  8315. if (opts.props) { initProps(vm, opts.props); }
  8316. if (opts.methods) { initMethods(vm, opts.methods); }
  8317. if (opts.data) {
  8318. initData(vm);
  8319. } else {
  8320. observe(vm._data = {}, true /* asRootData */);
  8321. }
  8322. if (opts.computed) { initComputed(vm, opts.computed); }
  8323. if (opts.watch && opts.watch !== nativeWatch) {
  8324. initWatch(vm, opts.watch);
  8325. }
  8326. }
  8327. function initProps (vm, propsOptions) {
  8328. var propsData = vm.$options.propsData || {};
  8329. var props = vm._props = {};
  8330. // cache prop keys so that future props updates can iterate using Array
  8331. // instead of dynamic object key enumeration.
  8332. var keys = vm.$options._propKeys = [];
  8333. var isRoot = !vm.$parent;
  8334. // root instance props should be converted
  8335. if (!isRoot) {
  8336. toggleObserving(false);
  8337. }
  8338. var loop = function ( key ) {
  8339. keys.push(key);
  8340. var value = validateProp(key, propsOptions, propsData, vm);
  8341. /* istanbul ignore else */
  8342. if (true) {
  8343. var hyphenatedKey = hyphenate(key);
  8344. if (isReservedAttribute(hyphenatedKey) ||
  8345. config.isReservedAttr(hyphenatedKey)) {
  8346. warn(
  8347. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  8348. vm
  8349. );
  8350. }
  8351. defineReactive$$1(props, key, value, function () {
  8352. if (!isRoot && !isUpdatingChildComponent) {
  8353. {
  8354. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou' || vm.mpHost === 'mp-xhs'){//百度、快手、小红书 observer 在 setData callback 之后触发,直接忽略该 warn
  8355. return
  8356. }
  8357. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  8358. if(
  8359. key === 'value' &&
  8360. Array.isArray(vm.$options.behaviors) &&
  8361. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  8362. ){
  8363. return
  8364. }
  8365. if(vm._getFormData){
  8366. return
  8367. }
  8368. var $parent = vm.$parent;
  8369. while($parent){
  8370. if($parent.__next_tick_pending){
  8371. return
  8372. }
  8373. $parent = $parent.$parent;
  8374. }
  8375. }
  8376. warn(
  8377. "Avoid mutating a prop directly since the value will be " +
  8378. "overwritten whenever the parent component re-renders. " +
  8379. "Instead, use a data or computed property based on the prop's " +
  8380. "value. Prop being mutated: \"" + key + "\"",
  8381. vm
  8382. );
  8383. }
  8384. });
  8385. } else {}
  8386. // static props are already proxied on the component's prototype
  8387. // during Vue.extend(). We only need to proxy props defined at
  8388. // instantiation here.
  8389. if (!(key in vm)) {
  8390. proxy(vm, "_props", key);
  8391. }
  8392. };
  8393. for (var key in propsOptions) loop( key );
  8394. toggleObserving(true);
  8395. }
  8396. function initData (vm) {
  8397. var data = vm.$options.data;
  8398. data = vm._data = typeof data === 'function'
  8399. ? getData(data, vm)
  8400. : data || {};
  8401. if (!isPlainObject(data)) {
  8402. data = {};
  8403. true && warn(
  8404. 'data functions should return an object:\n' +
  8405. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  8406. vm
  8407. );
  8408. }
  8409. // proxy data on instance
  8410. var keys = Object.keys(data);
  8411. var props = vm.$options.props;
  8412. var methods = vm.$options.methods;
  8413. var i = keys.length;
  8414. while (i--) {
  8415. var key = keys[i];
  8416. if (true) {
  8417. if (methods && hasOwn(methods, key)) {
  8418. warn(
  8419. ("Method \"" + key + "\" has already been defined as a data property."),
  8420. vm
  8421. );
  8422. }
  8423. }
  8424. if (props && hasOwn(props, key)) {
  8425. true && warn(
  8426. "The data property \"" + key + "\" is already declared as a prop. " +
  8427. "Use prop default value instead.",
  8428. vm
  8429. );
  8430. } else if (!isReserved(key)) {
  8431. proxy(vm, "_data", key);
  8432. }
  8433. }
  8434. // observe data
  8435. observe(data, true /* asRootData */);
  8436. }
  8437. function getData (data, vm) {
  8438. // #7573 disable dep collection when invoking data getters
  8439. pushTarget();
  8440. try {
  8441. return data.call(vm, vm)
  8442. } catch (e) {
  8443. handleError(e, vm, "data()");
  8444. return {}
  8445. } finally {
  8446. popTarget();
  8447. }
  8448. }
  8449. var computedWatcherOptions = { lazy: true };
  8450. function initComputed (vm, computed) {
  8451. // $flow-disable-line
  8452. var watchers = vm._computedWatchers = Object.create(null);
  8453. // computed properties are just getters during SSR
  8454. var isSSR = isServerRendering();
  8455. for (var key in computed) {
  8456. var userDef = computed[key];
  8457. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  8458. if ( true && getter == null) {
  8459. warn(
  8460. ("Getter is missing for computed property \"" + key + "\"."),
  8461. vm
  8462. );
  8463. }
  8464. if (!isSSR) {
  8465. // create internal watcher for the computed property.
  8466. watchers[key] = new Watcher(
  8467. vm,
  8468. getter || noop,
  8469. noop,
  8470. computedWatcherOptions
  8471. );
  8472. }
  8473. // component-defined computed properties are already defined on the
  8474. // component prototype. We only need to define computed properties defined
  8475. // at instantiation here.
  8476. if (!(key in vm)) {
  8477. defineComputed(vm, key, userDef);
  8478. } else if (true) {
  8479. if (key in vm.$data) {
  8480. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  8481. } else if (vm.$options.props && key in vm.$options.props) {
  8482. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  8483. }
  8484. }
  8485. }
  8486. }
  8487. function defineComputed (
  8488. target,
  8489. key,
  8490. userDef
  8491. ) {
  8492. var shouldCache = !isServerRendering();
  8493. if (typeof userDef === 'function') {
  8494. sharedPropertyDefinition.get = shouldCache
  8495. ? createComputedGetter(key)
  8496. : createGetterInvoker(userDef);
  8497. sharedPropertyDefinition.set = noop;
  8498. } else {
  8499. sharedPropertyDefinition.get = userDef.get
  8500. ? shouldCache && userDef.cache !== false
  8501. ? createComputedGetter(key)
  8502. : createGetterInvoker(userDef.get)
  8503. : noop;
  8504. sharedPropertyDefinition.set = userDef.set || noop;
  8505. }
  8506. if ( true &&
  8507. sharedPropertyDefinition.set === noop) {
  8508. sharedPropertyDefinition.set = function () {
  8509. warn(
  8510. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  8511. this
  8512. );
  8513. };
  8514. }
  8515. Object.defineProperty(target, key, sharedPropertyDefinition);
  8516. }
  8517. function createComputedGetter (key) {
  8518. return function computedGetter () {
  8519. var watcher = this._computedWatchers && this._computedWatchers[key];
  8520. if (watcher) {
  8521. if (watcher.dirty) {
  8522. watcher.evaluate();
  8523. }
  8524. if (Dep.SharedObject.target) {// fixed by xxxxxx
  8525. watcher.depend();
  8526. }
  8527. return watcher.value
  8528. }
  8529. }
  8530. }
  8531. function createGetterInvoker(fn) {
  8532. return function computedGetter () {
  8533. return fn.call(this, this)
  8534. }
  8535. }
  8536. function initMethods (vm, methods) {
  8537. var props = vm.$options.props;
  8538. for (var key in methods) {
  8539. if (true) {
  8540. if (typeof methods[key] !== 'function') {
  8541. warn(
  8542. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  8543. "Did you reference the function correctly?",
  8544. vm
  8545. );
  8546. }
  8547. if (props && hasOwn(props, key)) {
  8548. warn(
  8549. ("Method \"" + key + "\" has already been defined as a prop."),
  8550. vm
  8551. );
  8552. }
  8553. if ((key in vm) && isReserved(key)) {
  8554. warn(
  8555. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  8556. "Avoid defining component methods that start with _ or $."
  8557. );
  8558. }
  8559. }
  8560. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  8561. }
  8562. }
  8563. function initWatch (vm, watch) {
  8564. for (var key in watch) {
  8565. var handler = watch[key];
  8566. if (Array.isArray(handler)) {
  8567. for (var i = 0; i < handler.length; i++) {
  8568. createWatcher(vm, key, handler[i]);
  8569. }
  8570. } else {
  8571. createWatcher(vm, key, handler);
  8572. }
  8573. }
  8574. }
  8575. function createWatcher (
  8576. vm,
  8577. expOrFn,
  8578. handler,
  8579. options
  8580. ) {
  8581. if (isPlainObject(handler)) {
  8582. options = handler;
  8583. handler = handler.handler;
  8584. }
  8585. if (typeof handler === 'string') {
  8586. handler = vm[handler];
  8587. }
  8588. return vm.$watch(expOrFn, handler, options)
  8589. }
  8590. function stateMixin (Vue) {
  8591. // flow somehow has problems with directly declared definition object
  8592. // when using Object.defineProperty, so we have to procedurally build up
  8593. // the object here.
  8594. var dataDef = {};
  8595. dataDef.get = function () { return this._data };
  8596. var propsDef = {};
  8597. propsDef.get = function () { return this._props };
  8598. if (true) {
  8599. dataDef.set = function () {
  8600. warn(
  8601. 'Avoid replacing instance root $data. ' +
  8602. 'Use nested data properties instead.',
  8603. this
  8604. );
  8605. };
  8606. propsDef.set = function () {
  8607. warn("$props is readonly.", this);
  8608. };
  8609. }
  8610. Object.defineProperty(Vue.prototype, '$data', dataDef);
  8611. Object.defineProperty(Vue.prototype, '$props', propsDef);
  8612. Vue.prototype.$set = set;
  8613. Vue.prototype.$delete = del;
  8614. Vue.prototype.$watch = function (
  8615. expOrFn,
  8616. cb,
  8617. options
  8618. ) {
  8619. var vm = this;
  8620. if (isPlainObject(cb)) {
  8621. return createWatcher(vm, expOrFn, cb, options)
  8622. }
  8623. options = options || {};
  8624. options.user = true;
  8625. var watcher = new Watcher(vm, expOrFn, cb, options);
  8626. if (options.immediate) {
  8627. try {
  8628. cb.call(vm, watcher.value);
  8629. } catch (error) {
  8630. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  8631. }
  8632. }
  8633. return function unwatchFn () {
  8634. watcher.teardown();
  8635. }
  8636. };
  8637. }
  8638. /* */
  8639. var uid$3 = 0;
  8640. function initMixin (Vue) {
  8641. Vue.prototype._init = function (options) {
  8642. var vm = this;
  8643. // a uid
  8644. vm._uid = uid$3++;
  8645. var startTag, endTag;
  8646. /* istanbul ignore if */
  8647. if ( true && config.performance && mark) {
  8648. startTag = "vue-perf-start:" + (vm._uid);
  8649. endTag = "vue-perf-end:" + (vm._uid);
  8650. mark(startTag);
  8651. }
  8652. // a flag to avoid this being observed
  8653. vm._isVue = true;
  8654. // merge options
  8655. if (options && options._isComponent) {
  8656. // optimize internal component instantiation
  8657. // since dynamic options merging is pretty slow, and none of the
  8658. // internal component options needs special treatment.
  8659. initInternalComponent(vm, options);
  8660. } else {
  8661. vm.$options = mergeOptions(
  8662. resolveConstructorOptions(vm.constructor),
  8663. options || {},
  8664. vm
  8665. );
  8666. }
  8667. /* istanbul ignore else */
  8668. if (true) {
  8669. initProxy(vm);
  8670. } else {}
  8671. // expose real self
  8672. vm._self = vm;
  8673. initLifecycle(vm);
  8674. initEvents(vm);
  8675. initRender(vm);
  8676. callHook(vm, 'beforeCreate');
  8677. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  8678. initState(vm);
  8679. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  8680. !vm._$fallback && callHook(vm, 'created');
  8681. /* istanbul ignore if */
  8682. if ( true && config.performance && mark) {
  8683. vm._name = formatComponentName(vm, false);
  8684. mark(endTag);
  8685. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  8686. }
  8687. if (vm.$options.el) {
  8688. vm.$mount(vm.$options.el);
  8689. }
  8690. };
  8691. }
  8692. function initInternalComponent (vm, options) {
  8693. var opts = vm.$options = Object.create(vm.constructor.options);
  8694. // doing this because it's faster than dynamic enumeration.
  8695. var parentVnode = options._parentVnode;
  8696. opts.parent = options.parent;
  8697. opts._parentVnode = parentVnode;
  8698. var vnodeComponentOptions = parentVnode.componentOptions;
  8699. opts.propsData = vnodeComponentOptions.propsData;
  8700. opts._parentListeners = vnodeComponentOptions.listeners;
  8701. opts._renderChildren = vnodeComponentOptions.children;
  8702. opts._componentTag = vnodeComponentOptions.tag;
  8703. if (options.render) {
  8704. opts.render = options.render;
  8705. opts.staticRenderFns = options.staticRenderFns;
  8706. }
  8707. }
  8708. function resolveConstructorOptions (Ctor) {
  8709. var options = Ctor.options;
  8710. if (Ctor.super) {
  8711. var superOptions = resolveConstructorOptions(Ctor.super);
  8712. var cachedSuperOptions = Ctor.superOptions;
  8713. if (superOptions !== cachedSuperOptions) {
  8714. // super option changed,
  8715. // need to resolve new options.
  8716. Ctor.superOptions = superOptions;
  8717. // check if there are any late-modified/attached options (#4976)
  8718. var modifiedOptions = resolveModifiedOptions(Ctor);
  8719. // update base extend options
  8720. if (modifiedOptions) {
  8721. extend(Ctor.extendOptions, modifiedOptions);
  8722. }
  8723. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  8724. if (options.name) {
  8725. options.components[options.name] = Ctor;
  8726. }
  8727. }
  8728. }
  8729. return options
  8730. }
  8731. function resolveModifiedOptions (Ctor) {
  8732. var modified;
  8733. var latest = Ctor.options;
  8734. var sealed = Ctor.sealedOptions;
  8735. for (var key in latest) {
  8736. if (latest[key] !== sealed[key]) {
  8737. if (!modified) { modified = {}; }
  8738. modified[key] = latest[key];
  8739. }
  8740. }
  8741. return modified
  8742. }
  8743. function Vue (options) {
  8744. if ( true &&
  8745. !(this instanceof Vue)
  8746. ) {
  8747. warn('Vue is a constructor and should be called with the `new` keyword');
  8748. }
  8749. this._init(options);
  8750. }
  8751. initMixin(Vue);
  8752. stateMixin(Vue);
  8753. eventsMixin(Vue);
  8754. lifecycleMixin(Vue);
  8755. renderMixin(Vue);
  8756. /* */
  8757. function initUse (Vue) {
  8758. Vue.use = function (plugin) {
  8759. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  8760. if (installedPlugins.indexOf(plugin) > -1) {
  8761. return this
  8762. }
  8763. // additional parameters
  8764. var args = toArray(arguments, 1);
  8765. args.unshift(this);
  8766. if (typeof plugin.install === 'function') {
  8767. plugin.install.apply(plugin, args);
  8768. } else if (typeof plugin === 'function') {
  8769. plugin.apply(null, args);
  8770. }
  8771. installedPlugins.push(plugin);
  8772. return this
  8773. };
  8774. }
  8775. /* */
  8776. function initMixin$1 (Vue) {
  8777. Vue.mixin = function (mixin) {
  8778. this.options = mergeOptions(this.options, mixin);
  8779. return this
  8780. };
  8781. }
  8782. /* */
  8783. function initExtend (Vue) {
  8784. /**
  8785. * Each instance constructor, including Vue, has a unique
  8786. * cid. This enables us to create wrapped "child
  8787. * constructors" for prototypal inheritance and cache them.
  8788. */
  8789. Vue.cid = 0;
  8790. var cid = 1;
  8791. /**
  8792. * Class inheritance
  8793. */
  8794. Vue.extend = function (extendOptions) {
  8795. extendOptions = extendOptions || {};
  8796. var Super = this;
  8797. var SuperId = Super.cid;
  8798. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  8799. if (cachedCtors[SuperId]) {
  8800. return cachedCtors[SuperId]
  8801. }
  8802. var name = extendOptions.name || Super.options.name;
  8803. if ( true && name) {
  8804. validateComponentName(name);
  8805. }
  8806. var Sub = function VueComponent (options) {
  8807. this._init(options);
  8808. };
  8809. Sub.prototype = Object.create(Super.prototype);
  8810. Sub.prototype.constructor = Sub;
  8811. Sub.cid = cid++;
  8812. Sub.options = mergeOptions(
  8813. Super.options,
  8814. extendOptions
  8815. );
  8816. Sub['super'] = Super;
  8817. // For props and computed properties, we define the proxy getters on
  8818. // the Vue instances at extension time, on the extended prototype. This
  8819. // avoids Object.defineProperty calls for each instance created.
  8820. if (Sub.options.props) {
  8821. initProps$1(Sub);
  8822. }
  8823. if (Sub.options.computed) {
  8824. initComputed$1(Sub);
  8825. }
  8826. // allow further extension/mixin/plugin usage
  8827. Sub.extend = Super.extend;
  8828. Sub.mixin = Super.mixin;
  8829. Sub.use = Super.use;
  8830. // create asset registers, so extended classes
  8831. // can have their private assets too.
  8832. ASSET_TYPES.forEach(function (type) {
  8833. Sub[type] = Super[type];
  8834. });
  8835. // enable recursive self-lookup
  8836. if (name) {
  8837. Sub.options.components[name] = Sub;
  8838. }
  8839. // keep a reference to the super options at extension time.
  8840. // later at instantiation we can check if Super's options have
  8841. // been updated.
  8842. Sub.superOptions = Super.options;
  8843. Sub.extendOptions = extendOptions;
  8844. Sub.sealedOptions = extend({}, Sub.options);
  8845. // cache constructor
  8846. cachedCtors[SuperId] = Sub;
  8847. return Sub
  8848. };
  8849. }
  8850. function initProps$1 (Comp) {
  8851. var props = Comp.options.props;
  8852. for (var key in props) {
  8853. proxy(Comp.prototype, "_props", key);
  8854. }
  8855. }
  8856. function initComputed$1 (Comp) {
  8857. var computed = Comp.options.computed;
  8858. for (var key in computed) {
  8859. defineComputed(Comp.prototype, key, computed[key]);
  8860. }
  8861. }
  8862. /* */
  8863. function initAssetRegisters (Vue) {
  8864. /**
  8865. * Create asset registration methods.
  8866. */
  8867. ASSET_TYPES.forEach(function (type) {
  8868. Vue[type] = function (
  8869. id,
  8870. definition
  8871. ) {
  8872. if (!definition) {
  8873. return this.options[type + 's'][id]
  8874. } else {
  8875. /* istanbul ignore if */
  8876. if ( true && type === 'component') {
  8877. validateComponentName(id);
  8878. }
  8879. if (type === 'component' && isPlainObject(definition)) {
  8880. definition.name = definition.name || id;
  8881. definition = this.options._base.extend(definition);
  8882. }
  8883. if (type === 'directive' && typeof definition === 'function') {
  8884. definition = { bind: definition, update: definition };
  8885. }
  8886. this.options[type + 's'][id] = definition;
  8887. return definition
  8888. }
  8889. };
  8890. });
  8891. }
  8892. /* */
  8893. function getComponentName (opts) {
  8894. return opts && (opts.Ctor.options.name || opts.tag)
  8895. }
  8896. function matches (pattern, name) {
  8897. if (Array.isArray(pattern)) {
  8898. return pattern.indexOf(name) > -1
  8899. } else if (typeof pattern === 'string') {
  8900. return pattern.split(',').indexOf(name) > -1
  8901. } else if (isRegExp(pattern)) {
  8902. return pattern.test(name)
  8903. }
  8904. /* istanbul ignore next */
  8905. return false
  8906. }
  8907. function pruneCache (keepAliveInstance, filter) {
  8908. var cache = keepAliveInstance.cache;
  8909. var keys = keepAliveInstance.keys;
  8910. var _vnode = keepAliveInstance._vnode;
  8911. for (var key in cache) {
  8912. var cachedNode = cache[key];
  8913. if (cachedNode) {
  8914. var name = getComponentName(cachedNode.componentOptions);
  8915. if (name && !filter(name)) {
  8916. pruneCacheEntry(cache, key, keys, _vnode);
  8917. }
  8918. }
  8919. }
  8920. }
  8921. function pruneCacheEntry (
  8922. cache,
  8923. key,
  8924. keys,
  8925. current
  8926. ) {
  8927. var cached$$1 = cache[key];
  8928. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  8929. cached$$1.componentInstance.$destroy();
  8930. }
  8931. cache[key] = null;
  8932. remove(keys, key);
  8933. }
  8934. var patternTypes = [String, RegExp, Array];
  8935. var KeepAlive = {
  8936. name: 'keep-alive',
  8937. abstract: true,
  8938. props: {
  8939. include: patternTypes,
  8940. exclude: patternTypes,
  8941. max: [String, Number]
  8942. },
  8943. created: function created () {
  8944. this.cache = Object.create(null);
  8945. this.keys = [];
  8946. },
  8947. destroyed: function destroyed () {
  8948. for (var key in this.cache) {
  8949. pruneCacheEntry(this.cache, key, this.keys);
  8950. }
  8951. },
  8952. mounted: function mounted () {
  8953. var this$1 = this;
  8954. this.$watch('include', function (val) {
  8955. pruneCache(this$1, function (name) { return matches(val, name); });
  8956. });
  8957. this.$watch('exclude', function (val) {
  8958. pruneCache(this$1, function (name) { return !matches(val, name); });
  8959. });
  8960. },
  8961. render: function render () {
  8962. var slot = this.$slots.default;
  8963. var vnode = getFirstComponentChild(slot);
  8964. var componentOptions = vnode && vnode.componentOptions;
  8965. if (componentOptions) {
  8966. // check pattern
  8967. var name = getComponentName(componentOptions);
  8968. var ref = this;
  8969. var include = ref.include;
  8970. var exclude = ref.exclude;
  8971. if (
  8972. // not included
  8973. (include && (!name || !matches(include, name))) ||
  8974. // excluded
  8975. (exclude && name && matches(exclude, name))
  8976. ) {
  8977. return vnode
  8978. }
  8979. var ref$1 = this;
  8980. var cache = ref$1.cache;
  8981. var keys = ref$1.keys;
  8982. var key = vnode.key == null
  8983. // same constructor may get registered as different local components
  8984. // so cid alone is not enough (#3269)
  8985. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  8986. : vnode.key;
  8987. if (cache[key]) {
  8988. vnode.componentInstance = cache[key].componentInstance;
  8989. // make current key freshest
  8990. remove(keys, key);
  8991. keys.push(key);
  8992. } else {
  8993. cache[key] = vnode;
  8994. keys.push(key);
  8995. // prune oldest entry
  8996. if (this.max && keys.length > parseInt(this.max)) {
  8997. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  8998. }
  8999. }
  9000. vnode.data.keepAlive = true;
  9001. }
  9002. return vnode || (slot && slot[0])
  9003. }
  9004. };
  9005. var builtInComponents = {
  9006. KeepAlive: KeepAlive
  9007. };
  9008. /* */
  9009. function initGlobalAPI (Vue) {
  9010. // config
  9011. var configDef = {};
  9012. configDef.get = function () { return config; };
  9013. if (true) {
  9014. configDef.set = function () {
  9015. warn(
  9016. 'Do not replace the Vue.config object, set individual fields instead.'
  9017. );
  9018. };
  9019. }
  9020. Object.defineProperty(Vue, 'config', configDef);
  9021. // exposed util methods.
  9022. // NOTE: these are not considered part of the public API - avoid relying on
  9023. // them unless you are aware of the risk.
  9024. Vue.util = {
  9025. warn: warn,
  9026. extend: extend,
  9027. mergeOptions: mergeOptions,
  9028. defineReactive: defineReactive$$1
  9029. };
  9030. Vue.set = set;
  9031. Vue.delete = del;
  9032. Vue.nextTick = nextTick;
  9033. // 2.6 explicit observable API
  9034. Vue.observable = function (obj) {
  9035. observe(obj);
  9036. return obj
  9037. };
  9038. Vue.options = Object.create(null);
  9039. ASSET_TYPES.forEach(function (type) {
  9040. Vue.options[type + 's'] = Object.create(null);
  9041. });
  9042. // this is used to identify the "base" constructor to extend all plain-object
  9043. // components with in Weex's multi-instance scenarios.
  9044. Vue.options._base = Vue;
  9045. extend(Vue.options.components, builtInComponents);
  9046. initUse(Vue);
  9047. initMixin$1(Vue);
  9048. initExtend(Vue);
  9049. initAssetRegisters(Vue);
  9050. }
  9051. initGlobalAPI(Vue);
  9052. Object.defineProperty(Vue.prototype, '$isServer', {
  9053. get: isServerRendering
  9054. });
  9055. Object.defineProperty(Vue.prototype, '$ssrContext', {
  9056. get: function get () {
  9057. /* istanbul ignore next */
  9058. return this.$vnode && this.$vnode.ssrContext
  9059. }
  9060. });
  9061. // expose FunctionalRenderContext for ssr runtime helper installation
  9062. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  9063. value: FunctionalRenderContext
  9064. });
  9065. Vue.version = '2.6.11';
  9066. /**
  9067. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  9068. */
  9069. var ARRAYTYPE = '[object Array]';
  9070. var OBJECTTYPE = '[object Object]';
  9071. var NULLTYPE = '[object Null]';
  9072. var UNDEFINEDTYPE = '[object Undefined]';
  9073. // const FUNCTIONTYPE = '[object Function]'
  9074. function diff(current, pre) {
  9075. var result = {};
  9076. syncKeys(current, pre);
  9077. _diff(current, pre, '', result);
  9078. return result
  9079. }
  9080. function syncKeys(current, pre) {
  9081. if (current === pre) { return }
  9082. var rootCurrentType = type(current);
  9083. var rootPreType = type(pre);
  9084. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  9085. if(Object.keys(current).length >= Object.keys(pre).length){
  9086. for (var key in pre) {
  9087. var currentValue = current[key];
  9088. if (currentValue === undefined) {
  9089. current[key] = null;
  9090. } else {
  9091. syncKeys(currentValue, pre[key]);
  9092. }
  9093. }
  9094. }
  9095. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  9096. if (current.length >= pre.length) {
  9097. pre.forEach(function (item, index) {
  9098. syncKeys(current[index], item);
  9099. });
  9100. }
  9101. }
  9102. }
  9103. function nullOrUndefined(currentType, preType) {
  9104. if(
  9105. (currentType === NULLTYPE || currentType === UNDEFINEDTYPE) &&
  9106. (preType === NULLTYPE || preType === UNDEFINEDTYPE)
  9107. ) {
  9108. return false
  9109. }
  9110. return true
  9111. }
  9112. function _diff(current, pre, path, result) {
  9113. if (current === pre) { return }
  9114. var rootCurrentType = type(current);
  9115. var rootPreType = type(pre);
  9116. if (rootCurrentType == OBJECTTYPE) {
  9117. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  9118. setResult(result, path, current);
  9119. } else {
  9120. var loop = function ( key ) {
  9121. var currentValue = current[key];
  9122. var preValue = pre[key];
  9123. var currentType = type(currentValue);
  9124. var preType = type(preValue);
  9125. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  9126. if (currentValue !== pre[key] && nullOrUndefined(currentType, preType)) {
  9127. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  9128. }
  9129. } else if (currentType == ARRAYTYPE) {
  9130. if (preType != ARRAYTYPE) {
  9131. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  9132. } else {
  9133. if (currentValue.length < preValue.length) {
  9134. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  9135. } else {
  9136. currentValue.forEach(function (item, index) {
  9137. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  9138. });
  9139. }
  9140. }
  9141. } else if (currentType == OBJECTTYPE) {
  9142. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  9143. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  9144. } else {
  9145. for (var subKey in currentValue) {
  9146. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  9147. }
  9148. }
  9149. }
  9150. };
  9151. for (var key in current) loop( key );
  9152. }
  9153. } else if (rootCurrentType == ARRAYTYPE) {
  9154. if (rootPreType != ARRAYTYPE) {
  9155. setResult(result, path, current);
  9156. } else {
  9157. if (current.length < pre.length) {
  9158. setResult(result, path, current);
  9159. } else {
  9160. current.forEach(function (item, index) {
  9161. _diff(item, pre[index], path + '[' + index + ']', result);
  9162. });
  9163. }
  9164. }
  9165. } else {
  9166. setResult(result, path, current);
  9167. }
  9168. }
  9169. function setResult(result, k, v) {
  9170. // if (type(v) != FUNCTIONTYPE) {
  9171. result[k] = v;
  9172. // }
  9173. }
  9174. function type(obj) {
  9175. return Object.prototype.toString.call(obj)
  9176. }
  9177. /* */
  9178. function flushCallbacks$1(vm) {
  9179. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  9180. if (Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"房票科技","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  9181. var mpInstance = vm.$scope;
  9182. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  9183. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  9184. }
  9185. var copies = vm.__next_tick_callbacks.slice(0);
  9186. vm.__next_tick_callbacks.length = 0;
  9187. for (var i = 0; i < copies.length; i++) {
  9188. copies[i]();
  9189. }
  9190. }
  9191. }
  9192. function hasRenderWatcher(vm) {
  9193. return queue.find(function (watcher) { return vm._watcher === watcher; })
  9194. }
  9195. function nextTick$1(vm, cb) {
  9196. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  9197. //2.nextTick 之前存在 render watcher
  9198. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  9199. if(Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"房票科技","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  9200. var mpInstance = vm.$scope;
  9201. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  9202. ']:nextVueTick');
  9203. }
  9204. return nextTick(cb, vm)
  9205. }else{
  9206. if(Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"房票科技","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  9207. var mpInstance$1 = vm.$scope;
  9208. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  9209. ']:nextMPTick');
  9210. }
  9211. }
  9212. var _resolve;
  9213. if (!vm.__next_tick_callbacks) {
  9214. vm.__next_tick_callbacks = [];
  9215. }
  9216. vm.__next_tick_callbacks.push(function () {
  9217. if (cb) {
  9218. try {
  9219. cb.call(vm);
  9220. } catch (e) {
  9221. handleError(e, vm, 'nextTick');
  9222. }
  9223. } else if (_resolve) {
  9224. _resolve(vm);
  9225. }
  9226. });
  9227. // $flow-disable-line
  9228. if (!cb && typeof Promise !== 'undefined') {
  9229. return new Promise(function (resolve) {
  9230. _resolve = resolve;
  9231. })
  9232. }
  9233. }
  9234. /* */
  9235. function clearInstance(key, value) {
  9236. // 简易去除 Vue 和小程序组件实例
  9237. if (value) {
  9238. if (value._isVue || value.__v_isMPComponent) {
  9239. return {}
  9240. }
  9241. }
  9242. return value
  9243. }
  9244. function cloneWithData(vm) {
  9245. // 确保当前 vm 所有数据被同步
  9246. var ret = Object.create(null);
  9247. var dataKeys = [].concat(
  9248. Object.keys(vm._data || {}),
  9249. Object.keys(vm._computedWatchers || {}));
  9250. dataKeys.reduce(function(ret, key) {
  9251. ret[key] = vm[key];
  9252. return ret
  9253. }, ret);
  9254. // vue-composition-api
  9255. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  9256. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  9257. if (rawBindings) {
  9258. Object.keys(rawBindings).forEach(function (key) {
  9259. ret[key] = vm[key];
  9260. });
  9261. }
  9262. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  9263. Object.assign(ret, vm.$mp.data || {});
  9264. if (
  9265. Array.isArray(vm.$options.behaviors) &&
  9266. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  9267. ) { //form-field
  9268. ret['name'] = vm.name;
  9269. ret['value'] = vm.value;
  9270. }
  9271. return JSON.parse(JSON.stringify(ret, clearInstance))
  9272. }
  9273. var patch = function(oldVnode, vnode) {
  9274. var this$1 = this;
  9275. if (vnode === null) { //destroy
  9276. return
  9277. }
  9278. if (this.mpType === 'page' || this.mpType === 'component') {
  9279. var mpInstance = this.$scope;
  9280. var data = Object.create(null);
  9281. try {
  9282. data = cloneWithData(this);
  9283. } catch (err) {
  9284. console.error(err);
  9285. }
  9286. data.__webviewId__ = mpInstance.data.__webviewId__;
  9287. var mpData = Object.create(null);
  9288. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  9289. mpData[key] = mpInstance.data[key];
  9290. });
  9291. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  9292. if (Object.keys(diffData).length) {
  9293. if (Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"房票科技","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  9294. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  9295. ']差量更新',
  9296. JSON.stringify(diffData));
  9297. }
  9298. this.__next_tick_pending = true;
  9299. mpInstance.setData(diffData, function () {
  9300. this$1.__next_tick_pending = false;
  9301. flushCallbacks$1(this$1);
  9302. });
  9303. } else {
  9304. flushCallbacks$1(this);
  9305. }
  9306. }
  9307. };
  9308. /* */
  9309. function createEmptyRender() {
  9310. }
  9311. function mountComponent$1(
  9312. vm,
  9313. el,
  9314. hydrating
  9315. ) {
  9316. if (!vm.mpType) {//main.js 中的 new Vue
  9317. return vm
  9318. }
  9319. if (vm.mpType === 'app') {
  9320. vm.$options.render = createEmptyRender;
  9321. }
  9322. if (!vm.$options.render) {
  9323. vm.$options.render = createEmptyRender;
  9324. if (true) {
  9325. /* istanbul ignore if */
  9326. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  9327. vm.$options.el || el) {
  9328. warn(
  9329. 'You are using the runtime-only build of Vue where the template ' +
  9330. 'compiler is not available. Either pre-compile the templates into ' +
  9331. 'render functions, or use the compiler-included build.',
  9332. vm
  9333. );
  9334. } else {
  9335. warn(
  9336. 'Failed to mount component: template or render function not defined.',
  9337. vm
  9338. );
  9339. }
  9340. }
  9341. }
  9342. !vm._$fallback && callHook(vm, 'beforeMount');
  9343. var updateComponent = function () {
  9344. vm._update(vm._render(), hydrating);
  9345. };
  9346. // we set this to vm._watcher inside the watcher's constructor
  9347. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  9348. // component's mounted hook), which relies on vm._watcher being already defined
  9349. new Watcher(vm, updateComponent, noop, {
  9350. before: function before() {
  9351. if (vm._isMounted && !vm._isDestroyed) {
  9352. callHook(vm, 'beforeUpdate');
  9353. }
  9354. }
  9355. }, true /* isRenderWatcher */);
  9356. hydrating = false;
  9357. return vm
  9358. }
  9359. /* */
  9360. function renderClass (
  9361. staticClass,
  9362. dynamicClass
  9363. ) {
  9364. if (isDef(staticClass) || isDef(dynamicClass)) {
  9365. return concat(staticClass, stringifyClass(dynamicClass))
  9366. }
  9367. /* istanbul ignore next */
  9368. return ''
  9369. }
  9370. function concat (a, b) {
  9371. return a ? b ? (a + ' ' + b) : a : (b || '')
  9372. }
  9373. function stringifyClass (value) {
  9374. if (Array.isArray(value)) {
  9375. return stringifyArray(value)
  9376. }
  9377. if (isObject(value)) {
  9378. return stringifyObject(value)
  9379. }
  9380. if (typeof value === 'string') {
  9381. return value
  9382. }
  9383. /* istanbul ignore next */
  9384. return ''
  9385. }
  9386. function stringifyArray (value) {
  9387. var res = '';
  9388. var stringified;
  9389. for (var i = 0, l = value.length; i < l; i++) {
  9390. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  9391. if (res) { res += ' '; }
  9392. res += stringified;
  9393. }
  9394. }
  9395. return res
  9396. }
  9397. function stringifyObject (value) {
  9398. var res = '';
  9399. for (var key in value) {
  9400. if (value[key]) {
  9401. if (res) { res += ' '; }
  9402. res += key;
  9403. }
  9404. }
  9405. return res
  9406. }
  9407. /* */
  9408. var parseStyleText = cached(function (cssText) {
  9409. var res = {};
  9410. var listDelimiter = /;(?![^(]*\))/g;
  9411. var propertyDelimiter = /:(.+)/;
  9412. cssText.split(listDelimiter).forEach(function (item) {
  9413. if (item) {
  9414. var tmp = item.split(propertyDelimiter);
  9415. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  9416. }
  9417. });
  9418. return res
  9419. });
  9420. // normalize possible array / string values into Object
  9421. function normalizeStyleBinding (bindingStyle) {
  9422. if (Array.isArray(bindingStyle)) {
  9423. return toObject(bindingStyle)
  9424. }
  9425. if (typeof bindingStyle === 'string') {
  9426. return parseStyleText(bindingStyle)
  9427. }
  9428. return bindingStyle
  9429. }
  9430. /* */
  9431. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  9432. function getTarget(obj, path) {
  9433. var parts = path.split('.');
  9434. var key = parts[0];
  9435. if (key.indexOf('__$n') === 0) { //number index
  9436. key = parseInt(key.replace('__$n', ''));
  9437. }
  9438. if (parts.length === 1) {
  9439. return obj[key]
  9440. }
  9441. return getTarget(obj[key], parts.slice(1).join('.'))
  9442. }
  9443. function internalMixin(Vue) {
  9444. Vue.config.errorHandler = function(err, vm, info) {
  9445. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  9446. console.error(err);
  9447. /* eslint-disable no-undef */
  9448. var app = typeof getApp === 'function' && getApp();
  9449. if (app && app.onError) {
  9450. app.onError(err);
  9451. }
  9452. };
  9453. var oldEmit = Vue.prototype.$emit;
  9454. Vue.prototype.$emit = function(event) {
  9455. if (this.$scope && event) {
  9456. var triggerEvent = this.$scope['_triggerEvent'] || this.$scope['triggerEvent'];
  9457. if (triggerEvent) {
  9458. try {
  9459. triggerEvent.call(this.$scope, event, {
  9460. __args__: toArray(arguments, 1)
  9461. });
  9462. } catch (error) {
  9463. }
  9464. }
  9465. }
  9466. return oldEmit.apply(this, arguments)
  9467. };
  9468. Vue.prototype.$nextTick = function(fn) {
  9469. return nextTick$1(this, fn)
  9470. };
  9471. MP_METHODS.forEach(function (method) {
  9472. Vue.prototype[method] = function(args) {
  9473. if (this.$scope && this.$scope[method]) {
  9474. return this.$scope[method](args)
  9475. }
  9476. // mp-alipay
  9477. if (typeof my === 'undefined') {
  9478. return
  9479. }
  9480. if (method === 'createSelectorQuery') {
  9481. /* eslint-disable no-undef */
  9482. return my.createSelectorQuery(args)
  9483. } else if (method === 'createIntersectionObserver') {
  9484. /* eslint-disable no-undef */
  9485. return my.createIntersectionObserver(args)
  9486. }
  9487. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  9488. };
  9489. });
  9490. Vue.prototype.__init_provide = initProvide;
  9491. Vue.prototype.__init_injections = initInjections;
  9492. Vue.prototype.__call_hook = function(hook, args) {
  9493. var vm = this;
  9494. // #7573 disable dep collection when invoking lifecycle hooks
  9495. pushTarget();
  9496. var handlers = vm.$options[hook];
  9497. var info = hook + " hook";
  9498. var ret;
  9499. if (handlers) {
  9500. for (var i = 0, j = handlers.length; i < j; i++) {
  9501. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  9502. }
  9503. }
  9504. if (vm._hasHookEvent) {
  9505. vm.$emit('hook:' + hook, args);
  9506. }
  9507. popTarget();
  9508. return ret
  9509. };
  9510. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  9511. if (Array.isArray(modifiers)) {
  9512. if (modifiers.indexOf('trim') !== -1) {
  9513. value = value.trim();
  9514. }
  9515. if (modifiers.indexOf('number') !== -1) {
  9516. value = this._n(value);
  9517. }
  9518. }
  9519. if (!target) {
  9520. target = this;
  9521. }
  9522. // 解决动态属性添加
  9523. Vue.set(target, key, value);
  9524. };
  9525. Vue.prototype.__set_sync = function(target, key, value) {
  9526. if (!target) {
  9527. target = this;
  9528. }
  9529. // 解决动态属性添加
  9530. Vue.set(target, key, value);
  9531. };
  9532. Vue.prototype.__get_orig = function(item) {
  9533. if (isPlainObject(item)) {
  9534. return item['$orig'] || item
  9535. }
  9536. return item
  9537. };
  9538. Vue.prototype.__get_value = function(dataPath, target) {
  9539. return getTarget(target || this, dataPath)
  9540. };
  9541. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  9542. return renderClass(staticClass, dynamicClass)
  9543. };
  9544. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  9545. if (!dynamicStyle && !staticStyle) {
  9546. return ''
  9547. }
  9548. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  9549. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  9550. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  9551. };
  9552. Vue.prototype.__map = function(val, iteratee) {
  9553. //TODO 暂不考虑 string
  9554. var ret, i, l, keys, key;
  9555. if (Array.isArray(val)) {
  9556. ret = new Array(val.length);
  9557. for (i = 0, l = val.length; i < l; i++) {
  9558. ret[i] = iteratee(val[i], i);
  9559. }
  9560. return ret
  9561. } else if (isObject(val)) {
  9562. keys = Object.keys(val);
  9563. ret = Object.create(null);
  9564. for (i = 0, l = keys.length; i < l; i++) {
  9565. key = keys[i];
  9566. ret[key] = iteratee(val[key], key, i);
  9567. }
  9568. return ret
  9569. } else if (typeof val === 'number') {
  9570. ret = new Array(val);
  9571. for (i = 0, l = val; i < l; i++) {
  9572. // 第一个参数暂时仍和小程序一致
  9573. ret[i] = iteratee(i, i);
  9574. }
  9575. return ret
  9576. }
  9577. return []
  9578. };
  9579. }
  9580. /* */
  9581. var LIFECYCLE_HOOKS$1 = [
  9582. //App
  9583. 'onLaunch',
  9584. 'onShow',
  9585. 'onHide',
  9586. 'onUniNViewMessage',
  9587. 'onPageNotFound',
  9588. 'onThemeChange',
  9589. 'onError',
  9590. 'onUnhandledRejection',
  9591. //Page
  9592. 'onInit',
  9593. 'onLoad',
  9594. // 'onShow',
  9595. 'onReady',
  9596. // 'onHide',
  9597. 'onUnload',
  9598. 'onPullDownRefresh',
  9599. 'onReachBottom',
  9600. 'onTabItemTap',
  9601. 'onAddToFavorites',
  9602. 'onShareTimeline',
  9603. 'onShareAppMessage',
  9604. 'onResize',
  9605. 'onPageScroll',
  9606. 'onNavigationBarButtonTap',
  9607. 'onBackPress',
  9608. 'onNavigationBarSearchInputChanged',
  9609. 'onNavigationBarSearchInputConfirmed',
  9610. 'onNavigationBarSearchInputClicked',
  9611. 'onUploadDouyinVideo',
  9612. 'onNFCReadMessage',
  9613. //Component
  9614. // 'onReady', // 兼容旧版本,应该移除该事件
  9615. 'onPageShow',
  9616. 'onPageHide',
  9617. 'onPageResize'
  9618. ];
  9619. function lifecycleMixin$1(Vue) {
  9620. //fixed vue-class-component
  9621. var oldExtend = Vue.extend;
  9622. Vue.extend = function(extendOptions) {
  9623. extendOptions = extendOptions || {};
  9624. var methods = extendOptions.methods;
  9625. if (methods) {
  9626. Object.keys(methods).forEach(function (methodName) {
  9627. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  9628. extendOptions[methodName] = methods[methodName];
  9629. delete methods[methodName];
  9630. }
  9631. });
  9632. }
  9633. return oldExtend.call(this, extendOptions)
  9634. };
  9635. var strategies = Vue.config.optionMergeStrategies;
  9636. var mergeHook = strategies.created;
  9637. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  9638. strategies[hook] = mergeHook;
  9639. });
  9640. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  9641. }
  9642. /* */
  9643. // install platform patch function
  9644. Vue.prototype.__patch__ = patch;
  9645. // public mount method
  9646. Vue.prototype.$mount = function(
  9647. el ,
  9648. hydrating
  9649. ) {
  9650. return mountComponent$1(this, el, hydrating)
  9651. };
  9652. lifecycleMixin$1(Vue);
  9653. internalMixin(Vue);
  9654. /* */
  9655. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  9656. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  9657. /***/ }),
  9658. /***/ 26:
  9659. /*!********************************!*\
  9660. !*** E:/work/mdapp/pages.json ***!
  9661. \********************************/
  9662. /*! no static exports found */
  9663. /***/ (function(module, exports) {
  9664. /***/ }),
  9665. /***/ 270:
  9666. /*!*******************************************************!*\
  9667. !*** E:/work/mdapp/node_modules/image-tools/index.js ***!
  9668. \*******************************************************/
  9669. /*! no static exports found */
  9670. /***/ (function(module, exports, __webpack_require__) {
  9671. "use strict";
  9672. /* WEBPACK VAR INJECTION */(function(wx) {
  9673. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  9674. Object.defineProperty(exports, "__esModule", {
  9675. value: true
  9676. });
  9677. exports.base64ToPath = base64ToPath;
  9678. exports.pathToBase64 = pathToBase64;
  9679. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  9680. function getLocalFilePath(path) {
  9681. if (path.indexOf('_www') === 0 || path.indexOf('_doc') === 0 || path.indexOf('_documents') === 0 || path.indexOf('_downloads') === 0) {
  9682. return path;
  9683. }
  9684. if (path.indexOf('file://') === 0) {
  9685. return path;
  9686. }
  9687. if (path.indexOf('/storage/emulated/0/') === 0) {
  9688. return path;
  9689. }
  9690. if (path.indexOf('/') === 0) {
  9691. var localFilePath = plus.io.convertAbsoluteFileSystem(path);
  9692. if (localFilePath !== path) {
  9693. return localFilePath;
  9694. } else {
  9695. path = path.substr(1);
  9696. }
  9697. }
  9698. return '_www/' + path;
  9699. }
  9700. function dataUrlToBase64(str) {
  9701. var array = str.split(',');
  9702. return array[array.length - 1];
  9703. }
  9704. var index = 0;
  9705. function getNewFileId() {
  9706. return Date.now() + String(index++);
  9707. }
  9708. function biggerThan(v1, v2) {
  9709. var v1Array = v1.split('.');
  9710. var v2Array = v2.split('.');
  9711. var update = false;
  9712. for (var index = 0; index < v2Array.length; index++) {
  9713. var diff = v1Array[index] - v2Array[index];
  9714. if (diff !== 0) {
  9715. update = diff > 0;
  9716. break;
  9717. }
  9718. }
  9719. return update;
  9720. }
  9721. function pathToBase64(path) {
  9722. return new Promise(function (resolve, reject) {
  9723. if ((typeof window === "undefined" ? "undefined" : (0, _typeof2.default)(window)) === 'object' && 'document' in window) {
  9724. if (typeof FileReader === 'function') {
  9725. var xhr = new XMLHttpRequest();
  9726. xhr.open('GET', path, true);
  9727. xhr.responseType = 'blob';
  9728. xhr.onload = function () {
  9729. if (this.status === 200) {
  9730. var fileReader = new FileReader();
  9731. fileReader.onload = function (e) {
  9732. resolve(e.target.result);
  9733. };
  9734. fileReader.onerror = reject;
  9735. fileReader.readAsDataURL(this.response);
  9736. }
  9737. };
  9738. xhr.onerror = reject;
  9739. xhr.send();
  9740. return;
  9741. }
  9742. var canvas = document.createElement('canvas');
  9743. var c2x = canvas.getContext('2d');
  9744. var img = new Image();
  9745. img.onload = function () {
  9746. canvas.width = img.width;
  9747. canvas.height = img.height;
  9748. c2x.drawImage(img, 0, 0);
  9749. resolve(canvas.toDataURL());
  9750. canvas.height = canvas.width = 0;
  9751. };
  9752. img.onerror = reject;
  9753. img.src = path;
  9754. return;
  9755. }
  9756. if ((typeof plus === "undefined" ? "undefined" : (0, _typeof2.default)(plus)) === 'object') {
  9757. plus.io.resolveLocalFileSystemURL(getLocalFilePath(path), function (entry) {
  9758. entry.file(function (file) {
  9759. var fileReader = new plus.io.FileReader();
  9760. fileReader.onload = function (data) {
  9761. resolve(data.target.result);
  9762. };
  9763. fileReader.onerror = function (error) {
  9764. reject(error);
  9765. };
  9766. fileReader.readAsDataURL(file);
  9767. }, function (error) {
  9768. reject(error);
  9769. });
  9770. }, function (error) {
  9771. reject(error);
  9772. });
  9773. return;
  9774. }
  9775. if ((typeof wx === "undefined" ? "undefined" : (0, _typeof2.default)(wx)) === 'object' && wx.canIUse('getFileSystemManager')) {
  9776. wx.getFileSystemManager().readFile({
  9777. filePath: path,
  9778. encoding: 'base64',
  9779. success: function success(res) {
  9780. resolve('data:image/png;base64,' + res.data);
  9781. },
  9782. fail: function fail(error) {
  9783. reject(error);
  9784. }
  9785. });
  9786. return;
  9787. }
  9788. reject(new Error('not support'));
  9789. });
  9790. }
  9791. function base64ToPath(base64) {
  9792. return new Promise(function (resolve, reject) {
  9793. if ((typeof window === "undefined" ? "undefined" : (0, _typeof2.default)(window)) === 'object' && 'document' in window) {
  9794. base64 = base64.split(',');
  9795. var type = base64[0].match(/:(.*?);/)[1];
  9796. var str = atob(base64[1]);
  9797. var n = str.length;
  9798. var array = new Uint8Array(n);
  9799. while (n--) {
  9800. array[n] = str.charCodeAt(n);
  9801. }
  9802. return resolve((window.URL || window.webkitURL).createObjectURL(new Blob([array], {
  9803. type: type
  9804. })));
  9805. }
  9806. var extName = base64.split(',')[0].match(/data\:\S+\/(\S+);/);
  9807. if (extName) {
  9808. extName = extName[1];
  9809. } else {
  9810. reject(new Error('base64 error'));
  9811. }
  9812. var fileName = getNewFileId() + '.' + extName;
  9813. if ((typeof plus === "undefined" ? "undefined" : (0, _typeof2.default)(plus)) === 'object') {
  9814. var basePath = '_doc';
  9815. var dirPath = 'uniapp_temp';
  9816. var filePath = basePath + '/' + dirPath + '/' + fileName;
  9817. if (!biggerThan(plus.os.name === 'Android' ? '1.9.9.80627' : '1.9.9.80472', plus.runtime.innerVersion)) {
  9818. plus.io.resolveLocalFileSystemURL(basePath, function (entry) {
  9819. entry.getDirectory(dirPath, {
  9820. create: true,
  9821. exclusive: false
  9822. }, function (entry) {
  9823. entry.getFile(fileName, {
  9824. create: true,
  9825. exclusive: false
  9826. }, function (entry) {
  9827. entry.createWriter(function (writer) {
  9828. writer.onwrite = function () {
  9829. resolve(filePath);
  9830. };
  9831. writer.onerror = reject;
  9832. writer.seek(0);
  9833. writer.writeAsBinary(dataUrlToBase64(base64));
  9834. }, reject);
  9835. }, reject);
  9836. }, reject);
  9837. }, reject);
  9838. return;
  9839. }
  9840. var bitmap = new plus.nativeObj.Bitmap(fileName);
  9841. bitmap.loadBase64Data(base64, function () {
  9842. bitmap.save(filePath, {}, function () {
  9843. bitmap.clear();
  9844. resolve(filePath);
  9845. }, function (error) {
  9846. bitmap.clear();
  9847. reject(error);
  9848. });
  9849. }, function (error) {
  9850. bitmap.clear();
  9851. reject(error);
  9852. });
  9853. return;
  9854. }
  9855. if ((typeof wx === "undefined" ? "undefined" : (0, _typeof2.default)(wx)) === 'object' && wx.canIUse('getFileSystemManager')) {
  9856. var filePath = wx.env.USER_DATA_PATH + '/' + fileName;
  9857. wx.getFileSystemManager().writeFile({
  9858. filePath: filePath,
  9859. data: dataUrlToBase64(base64),
  9860. encoding: 'base64',
  9861. success: function success() {
  9862. resolve(filePath);
  9863. },
  9864. fail: function fail(error) {
  9865. reject(error);
  9866. }
  9867. });
  9868. return;
  9869. }
  9870. reject(new Error('not support'));
  9871. });
  9872. }
  9873. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"]))
  9874. /***/ }),
  9875. /***/ 3:
  9876. /*!***********************************!*\
  9877. !*** (webpack)/buildin/global.js ***!
  9878. \***********************************/
  9879. /*! no static exports found */
  9880. /***/ (function(module, exports) {
  9881. var g;
  9882. // This works in non-strict mode
  9883. g = (function() {
  9884. return this;
  9885. })();
  9886. try {
  9887. // This works if eval is allowed (see CSP)
  9888. g = g || new Function("return this")();
  9889. } catch (e) {
  9890. // This works if the window reference is available
  9891. if (typeof window === "object") g = window;
  9892. }
  9893. // g can still be undefined, but nothing to do about it...
  9894. // We return undefined, instead of nothing here, so it's
  9895. // easier to handle this case. if(!global) { ...}
  9896. module.exports = g;
  9897. /***/ }),
  9898. /***/ 32:
  9899. /*!**********************************************************************************************************!*\
  9900. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  9901. \**********************************************************************************************************/
  9902. /*! exports provided: default */
  9903. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9904. "use strict";
  9905. __webpack_require__.r(__webpack_exports__);
  9906. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  9907. /* globals __VUE_SSR_CONTEXT__ */
  9908. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  9909. // This module is a runtime utility for cleaner component module output and will
  9910. // be included in the final webpack user bundle.
  9911. function normalizeComponent (
  9912. scriptExports,
  9913. render,
  9914. staticRenderFns,
  9915. functionalTemplate,
  9916. injectStyles,
  9917. scopeId,
  9918. moduleIdentifier, /* server only */
  9919. shadowMode, /* vue-cli only */
  9920. components, // fixed by xxxxxx auto components
  9921. renderjs // fixed by xxxxxx renderjs
  9922. ) {
  9923. // Vue.extend constructor export interop
  9924. var options = typeof scriptExports === 'function'
  9925. ? scriptExports.options
  9926. : scriptExports
  9927. // fixed by xxxxxx auto components
  9928. if (components) {
  9929. if (!options.components) {
  9930. options.components = {}
  9931. }
  9932. var hasOwn = Object.prototype.hasOwnProperty
  9933. for (var name in components) {
  9934. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  9935. options.components[name] = components[name]
  9936. }
  9937. }
  9938. }
  9939. // fixed by xxxxxx renderjs
  9940. if (renderjs) {
  9941. if(typeof renderjs.beforeCreate === 'function'){
  9942. renderjs.beforeCreate = [renderjs.beforeCreate]
  9943. }
  9944. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  9945. this[renderjs.__module] = this
  9946. });
  9947. (options.mixins || (options.mixins = [])).push(renderjs)
  9948. }
  9949. // render functions
  9950. if (render) {
  9951. options.render = render
  9952. options.staticRenderFns = staticRenderFns
  9953. options._compiled = true
  9954. }
  9955. // functional template
  9956. if (functionalTemplate) {
  9957. options.functional = true
  9958. }
  9959. // scopedId
  9960. if (scopeId) {
  9961. options._scopeId = 'data-v-' + scopeId
  9962. }
  9963. var hook
  9964. if (moduleIdentifier) { // server build
  9965. hook = function (context) {
  9966. // 2.3 injection
  9967. context =
  9968. context || // cached call
  9969. (this.$vnode && this.$vnode.ssrContext) || // stateful
  9970. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  9971. // 2.2 with runInNewContext: true
  9972. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  9973. context = __VUE_SSR_CONTEXT__
  9974. }
  9975. // inject component styles
  9976. if (injectStyles) {
  9977. injectStyles.call(this, context)
  9978. }
  9979. // register component module identifier for async chunk inferrence
  9980. if (context && context._registeredComponents) {
  9981. context._registeredComponents.add(moduleIdentifier)
  9982. }
  9983. }
  9984. // used by ssr in case component is cached and beforeCreate
  9985. // never gets called
  9986. options._ssrRegister = hook
  9987. } else if (injectStyles) {
  9988. hook = shadowMode
  9989. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  9990. : injectStyles
  9991. }
  9992. if (hook) {
  9993. if (options.functional) {
  9994. // for template-only hot-reload because in that case the render fn doesn't
  9995. // go through the normalizer
  9996. options._injectStyles = hook
  9997. // register for functioal component in vue file
  9998. var originalRender = options.render
  9999. options.render = function renderWithStyleInjection (h, context) {
  10000. hook.call(context)
  10001. return originalRender(h, context)
  10002. }
  10003. } else {
  10004. // inject component registration as beforeCreate hook
  10005. var existing = options.beforeCreate
  10006. options.beforeCreate = existing
  10007. ? [].concat(existing, hook)
  10008. : [hook]
  10009. }
  10010. }
  10011. return {
  10012. exports: scriptExports,
  10013. options: options
  10014. }
  10015. }
  10016. /***/ }),
  10017. /***/ 321:
  10018. /*!**************************************************!*\
  10019. !*** E:/work/mdapp/pages/estate/img/i_house.png ***!
  10020. \**************************************************/
  10021. /*! no static exports found */
  10022. /***/ (function(module, exports) {
  10023. module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAADqklEQVR4Xu1b71XbMBDXWQOUDQoTNH4+8xWYoGUDmKCwQTsBMEHTCcoGha9EfqYTlE7QZID4+o7KeY5t2VaebJxE/kZ8Pt39dLp/OkDs+QN7rr/wAHgL2HME/BHYcwOwc4JPT0+TIAhOAOCgb+CIaJ5l2ePx8fFzn2t1PgKz2ewGAK76FKaONxHdxnF83de6nQBIkuSKiG76EqKNLwBcR1F020a3yftOACilUiHEZJMFHH3zjIihI15rbLoCQH0sbsMTETvJasOTaTsxVUp5AJqQBYDHLMu+5DRBEEyafAYRfRVCPOT02rl+bFpjzBawkFIehmE4LyqglGKn9blGqe+IeFH+XSn1IoR4bwJhtADw7kdRdFoWfDabnQLAz/LvvPtxHK+sJX+fJMkDEZ14AAwIjNYChBAviHhUltuUO+ycBWjFrxDxLgchTdPD5XLJ5n9Ys6Gc4p4VU9wkSS6I6FtLCJsi4qVtmGuj35ow2KaIjir3xY3o8M325AFdlNE0VpaySxawwoiIzuI4XuUZjTlMF2THkAl2kTOnMTnaOh47aQGm3KRvABYA8ExE3Cz50GHHfgHAnIg4UhgzwA58KiSDAwAAl1EUTUthkM9gnWKcOk/CMOTU9/VRSn0SQvzYRNnaXTVkp31ZwB9ErMR714mQDTiDWsBQtYAHwAKBQS1ACDGXUh45KId/G1JnC9X/kw4NAK/Jpewtt7L5DynlKRFVSt5CnGbaey3sAQBwf4AdoZPnLQBwIrgrJh6AgcOgq41zxsdbgLeA+j5lX5kg810IIaZ5FAiCgKOAscGp2+jFtjhHAWf1wOBHQOcBq9xe5/cc5iq9/jrh0jQ9WC6X/P07F45gUABMi5kKnE2bojbAjAIA1/cCowVACFF7c2vq9O6cBfDOZFkWlic5lFLcFq/cGDFgUsqzYu2gJ0+Y3snkyaBHQJsm1wDFURbuD9TdCeSWzA6v6DR59sCk/ILrjOJlqq4huHbg6FFxnG8BgM0RtaJt6vCami47BUDTnaDJ0XoAdikV9hbQMBvkj4BhCMP7AO8Dhi+HrWK7DfGbO0Fdqv61EdolbV2pnfM3VZzOfIBWnmeEK2NtLpVs4fUgpTwv3zvoMRy+TzSN8J4j4mvrvelZXY/rgoSVrStg2vhsw3u+iZ6WJ89XACilajs426CZpYxrluEByNHjIyCl5CsrYzPTEumxkb82bhFx7Z8+Oo3IjE0Tl/J4AFyiuY28vAVs4665lHnvLeAf8XaCXwWtufUAAAAASUVORK5CYII="
  10024. /***/ }),
  10025. /***/ 322:
  10026. /*!************************************************!*\
  10027. !*** E:/work/mdapp/pages/estate/img/i_pos.png ***!
  10028. \************************************************/
  10029. /*! no static exports found */
  10030. /***/ (function(module, exports) {
  10031. module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAHDklEQVR4Xs1bfYhVRRQ/565uGSomWX8kFQlhmq28ObOsq0mitiFhYiSVUFFa4T+aEIaE2hdKkUYQfWBlJaWpRQlZoSmEtrt37t21WrOMRJCiDJfUlF323ROjd2Vddt+dmTvv7Q68v+45v3POb2bOfJx5CBVoR48evby9vf1GZta/cQAwPv31tn4EAL4MgmB/oVA4UQHXAMtpJI7jWUmS3AMA+jfGxhYz7waA/Yi4hYgO2+jayHonoKWlZVSxWFyUBl1n40w/skUA2MrMW6WUX3jAuwTCKwFKqXkAsBoAJvt2VOMhYlgsFlfV1tZ+5QvfCwG615MkWc3My3w5loGzkojW+rCVmwClVAEA3ilXr5cIcjszr5BS/p6HiFwExHE8PUmSDwHgujxO5NBtC4JgQaFQOOSK4UxAGIZzgiDYzMxXuhr3pJeLBCcCdLJj5u2IWOUpiLwwziRYE5Auc3sHYM5nkdQybNiw6RMnTjyTJdjzuzUBURRtqGC2t4lFy64lopU2SlYEpOv8ZzYGKi2LiNOFEN+Z2rUiIIqikJnJFHwg5BBxlxBijqltYwLCMHwQEd83BS4htw0AtgVB0NbZ2Xlcy1VXV49NkmQiANyb/vKaeZiIjHw1JkAppRPf7Tk8WwcAHxHRj6UwmpqaplRVVT2Zhwhm3imlnGviqxEBURTNZ+YdJoD9yCwgIt3zxi0MwzWIqM8VTi0IgsmFQuFglrIRAUqpnQBwVxaYr+C7ccIwnI2I3zjafZ6IVmXpZhLAzFVxHJ9w3PFZ93xvh5VS+tDzdFYgvb8j4iEhhM4rJVsmAXEcT0mS5EAWUO/vzLxBSrncVq+3fBzHY5Ik+R4A9E2SVWPmOVLKXaWUMglQSi0FgFetLAOcHjp06ISamprzWT5vU0otAYDXHXAyN0aZBERRpA88Cy2N7yOiGZY6/Yq3trZe29XV5ULmB0T0UK4REIbhAUScYhMMMz8rpVxjo5MlG0XRQWa+NUuu53dm3iOlnJWLAKWUXrdvsTS8SEqpL0m8NaXUJw57g8NEdHNeAo7ZXngg4p1CiK+9RQ8AYRiuR0S9QTJuzHxaSjkyFwFRFJ20XQKZeYaUcp+xpwaCjqfQf4io5HV8ZhIMw7DL9uKjHAQopfQpVN8627T9RDQt1whQSv0EAJkbil7Jx3sSVEr9ZrsXQMR3hRCP5iVgIwCUBOnDQBsRWSXOUk4qpXQp7Webrtey6a3xS3kJeAIA3rA1joiPCyHettXrS951OxwEwd2FQqFkNSkzBzQ3N9frYqVDIBER5b48SesOeit+ma0PzDxeSvlLrhGwd+/e4cOHDz+GiKNtHdAXH0S0wEHvoorLRqxbmYgyOzhTQIMppTYDgO12+LwfeXaFOe8EPiaiB7LINyIgiqKFzKxJcGqIuAkRXzat4Ohhz8xPIeJ9TgYvED9PSvl5lr4RAW1tbaPPnj17xHEadPtwSh+Ri8Xip3V1dT/0k+wmAYDuNb3js57zPTD/6+zsHFNfX3/OCwF5p0EfTuxj5uOIqE94IxFxbHrQuSHLYZPviPieEOIRI1kTIS2TdxqY2vEhx8z3Sym3mGAZTQEN5GkamPiUSwYR/+jo6JhUX19/0gTImAANFobhm3qDYwI8UDK2q44VAU1NTTVVVVXNupYxUAGWsqt7X1euiOhPU/+sCEiTob4f1PeEg67Z9r4OwJqA1tbWm7q6ukKdvQcTAy6970RAmgvWIeKKwUSAS+87E6CU0m+C9Ci4ejCQ4Nr7zgSkoyBX7c4nca69n4uANCHqut1sn8HYYjGzKhaLM+vq6k7Z6uYmoLGxsW7IkCF7AOAKF+OedBqIyLWAar8K9HY6juPlSZK84ikYW5jVRPScrVJPeetlsC9jURTtYOb5eRyx1WXmXVJK46cw/eF7ISCO4wlJknwLANfYBuIo387MM6WULY76F9W8EKDRoihazMxeLkENglpCRNYXtX3heiMgXRU2AUDJaqxBcFkimRXfLADvOaAbUCl1FQDot/zCxglTWWZura6ubqipqfnbVCdLzusISKfCbcysSfC9NOoSXYMQQucab807ASkJjzHzW968vAC0lIhe84yZfx/Qn0NhGG5ARF//INlIRIt9B6/xyjICeuQEPRUacjreSERWL1Rs7JWVgCiK9OuMXcx8vY1TPWTPdHR0jJs6daq3pNfbj7ISoI01NzfPD4LA6ZVpkiRza2tr9SPNsrWyE5AmxWW6KGITBSK+KIR4xkbHRbYiBKQkrGdmozc+iLhbCFGRY3bFCEhJ0H9103+jLdUy3/W49HR/OhUlQJfaR4wYoe8PaksEMYqI/vUZZCmsihKgHUmfu+gH0Jc8eGLmv4IguEMI0WfhtFyEVJyA7kB0rREAZjHzKET89dy5cy9MmzbtdLkC7Q/3fxMowF8w/lVXAAAAAElFTkSuQmCC"
  10032. /***/ }),
  10033. /***/ 33:
  10034. /*!******************************************************!*\
  10035. !*** E:/work/mdapp/uni_modules/vk-uview-ui/index.js ***!
  10036. \******************************************************/
  10037. /*! no static exports found */
  10038. /***/ (function(module, exports, __webpack_require__) {
  10039. "use strict";
  10040. /* WEBPACK VAR INJECTION */(function(uni) {
  10041. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  10042. Object.defineProperty(exports, "__esModule", {
  10043. value: true
  10044. });
  10045. exports.default = void 0;
  10046. var _mixin = _interopRequireDefault(__webpack_require__(/*! ./libs/mixin/mixin.js */ 34));
  10047. var _request = _interopRequireDefault(__webpack_require__(/*! ./libs/request */ 35));
  10048. var _queryParams = _interopRequireDefault(__webpack_require__(/*! ./libs/function/queryParams.js */ 39));
  10049. var _route = _interopRequireDefault(__webpack_require__(/*! ./libs/function/route.js */ 40));
  10050. var _timeFormat = _interopRequireDefault(__webpack_require__(/*! ./libs/function/timeFormat.js */ 44));
  10051. var _timeFrom = _interopRequireDefault(__webpack_require__(/*! ./libs/function/timeFrom.js */ 45));
  10052. var _colorGradient = _interopRequireDefault(__webpack_require__(/*! ./libs/function/colorGradient.js */ 46));
  10053. var _guid = _interopRequireDefault(__webpack_require__(/*! ./libs/function/guid.js */ 47));
  10054. var _color = _interopRequireDefault(__webpack_require__(/*! ./libs/function/color.js */ 48));
  10055. var _type2icon = _interopRequireDefault(__webpack_require__(/*! ./libs/function/type2icon.js */ 49));
  10056. var _randomArray = _interopRequireDefault(__webpack_require__(/*! ./libs/function/randomArray.js */ 50));
  10057. var _deepClone = _interopRequireDefault(__webpack_require__(/*! ./libs/function/deepClone.js */ 37));
  10058. var _deepMerge = _interopRequireDefault(__webpack_require__(/*! ./libs/function/deepMerge.js */ 36));
  10059. var _addUnit = _interopRequireDefault(__webpack_require__(/*! ./libs/function/addUnit.js */ 51));
  10060. var _test = _interopRequireDefault(__webpack_require__(/*! ./libs/function/test.js */ 38));
  10061. var _random = _interopRequireDefault(__webpack_require__(/*! ./libs/function/random.js */ 52));
  10062. var _trim = _interopRequireDefault(__webpack_require__(/*! ./libs/function/trim.js */ 53));
  10063. var _toast = _interopRequireDefault(__webpack_require__(/*! ./libs/function/toast.js */ 54));
  10064. var _getParent = _interopRequireDefault(__webpack_require__(/*! ./libs/function/getParent.js */ 55));
  10065. var _$parent = _interopRequireDefault(__webpack_require__(/*! ./libs/function/$parent.js */ 56));
  10066. var _sys = __webpack_require__(/*! ./libs/function/sys.js */ 57);
  10067. var _debounce = _interopRequireDefault(__webpack_require__(/*! ./libs/function/debounce.js */ 58));
  10068. var _throttle = _interopRequireDefault(__webpack_require__(/*! ./libs/function/throttle.js */ 59));
  10069. var _addStyle = _interopRequireDefault(__webpack_require__(/*! ./libs/function/addStyle.js */ 60));
  10070. var _config = _interopRequireDefault(__webpack_require__(/*! ./libs/config/config.js */ 61));
  10071. var _zIndex = _interopRequireDefault(__webpack_require__(/*! ./libs/config/zIndex.js */ 62));
  10072. // 引入全局mixin
  10073. // 引入关于是否mixin集成小程序分享的配置
  10074. // import wxshare from './libs/mixin/mpShare.js'
  10075. // 全局挂载引入http相关请求拦截插件
  10076. function wranning(str) {
  10077. // 开发环境进行信息输出,主要是一些报错信息
  10078. // 这个环境的来由是在程序编写时候,点击hx编辑器运行调试代码的时候,详见:
  10079. // 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
  10080. if (true) {
  10081. console.warn(str);
  10082. }
  10083. }
  10084. // 尝试判断在根目录的/store中是否有$u.mixin.js,此文件uView默认为需要挂在到全局的vuex的state变量
  10085. // HX2.6.11版本,放到try中,控制台依然会警告,暂时不用此方式,
  10086. // let vuexStore = {};
  10087. // try {
  10088. // vuexStore = require("@/store/$u.mixin.js");
  10089. // } catch (e) {
  10090. // //TODO handle the exception
  10091. // }
  10092. // post类型对象参数转为get类型url参数
  10093. var $u = {
  10094. queryParams: _queryParams.default,
  10095. route: _route.default,
  10096. timeFormat: _timeFormat.default,
  10097. date: _timeFormat.default,
  10098. // 另名date
  10099. timeFrom: _timeFrom.default,
  10100. colorGradient: _colorGradient.default.colorGradient,
  10101. colorToRgba: _colorGradient.default.colorToRgba,
  10102. guid: _guid.default,
  10103. color: _color.default,
  10104. sys: _sys.sys,
  10105. os: _sys.os,
  10106. type2icon: _type2icon.default,
  10107. randomArray: _randomArray.default,
  10108. wranning: wranning,
  10109. get: _request.default.get,
  10110. post: _request.default.post,
  10111. put: _request.default.put,
  10112. 'delete': _request.default.delete,
  10113. hexToRgb: _colorGradient.default.hexToRgb,
  10114. rgbToHex: _colorGradient.default.rgbToHex,
  10115. test: _test.default,
  10116. random: _random.default,
  10117. deepClone: _deepClone.default,
  10118. deepMerge: _deepMerge.default,
  10119. getParent: _getParent.default,
  10120. $parent: _$parent.default,
  10121. addUnit: _addUnit.default,
  10122. trim: _trim.default,
  10123. type: ['primary', 'success', 'error', 'warning', 'info'],
  10124. http: _request.default,
  10125. toast: _toast.default,
  10126. config: _config.default,
  10127. // uView配置信息相关,比如版本号
  10128. zIndex: _zIndex.default,
  10129. debounce: _debounce.default,
  10130. throttle: _throttle.default,
  10131. addStyle: _addStyle.default
  10132. };
  10133. // $u挂载到uni对象上
  10134. uni.$u = $u;
  10135. var install = function install(Vue) {
  10136. Vue.mixin(_mixin.default);
  10137. if (Vue.prototype.openShare) {
  10138. Vue.mixin(mpShare);
  10139. }
  10140. // Vue.mixin(vuexStore);
  10141. // 时间格式化,同时两个名称,date和timeFormat
  10142. Vue.filter('timeFormat', function (timestamp, format) {
  10143. return (0, _timeFormat.default)(timestamp, format);
  10144. });
  10145. Vue.filter('date', function (timestamp, format) {
  10146. return (0, _timeFormat.default)(timestamp, format);
  10147. });
  10148. // 将多久以前的方法,注入到全局过滤器
  10149. Vue.filter('timeFrom', function (timestamp, format) {
  10150. return (0, _timeFrom.default)(timestamp, format);
  10151. });
  10152. Vue.prototype.$u = $u;
  10153. };
  10154. var _default = {
  10155. install: install
  10156. };
  10157. exports.default = _default;
  10158. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  10159. /***/ }),
  10160. /***/ 34:
  10161. /*!*****************************************************************!*\
  10162. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/mixin/mixin.js ***!
  10163. \*****************************************************************/
  10164. /*! no static exports found */
  10165. /***/ (function(module, exports, __webpack_require__) {
  10166. "use strict";
  10167. /* WEBPACK VAR INJECTION */(function(uni) {
  10168. Object.defineProperty(exports, "__esModule", {
  10169. value: true
  10170. });
  10171. exports.default = void 0;
  10172. var _default = {
  10173. data: function data() {
  10174. return {};
  10175. },
  10176. onLoad: function onLoad() {
  10177. // getRect挂载到$u上,因为这方法需要使用in(this),所以无法把它独立成一个单独的文件导出
  10178. this.$u.getRect = this.$uGetRect;
  10179. },
  10180. methods: {
  10181. // 查询节点信息
  10182. // 目前此方法在支付宝小程序中无法获取组件跟接点的尺寸,为支付宝的bug(2020-07-21)
  10183. // 解决办法为在组件根部再套一个没有任何作用的view元素
  10184. $uGetRect: function $uGetRect(selector, all) {
  10185. var _this = this;
  10186. return new Promise(function (resolve) {
  10187. uni.createSelectorQuery().in(_this)[all ? 'selectAll' : 'select'](selector).boundingClientRect(function (rect) {
  10188. if (all && Array.isArray(rect) && rect.length) {
  10189. resolve(rect);
  10190. }
  10191. if (!all && rect) {
  10192. resolve(rect);
  10193. }
  10194. }).exec();
  10195. });
  10196. },
  10197. getParentData: function getParentData() {
  10198. var _this2 = this;
  10199. var parentName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  10200. // 避免在created中去定义parent变量
  10201. if (!this.parent) this.parent = false;
  10202. // 这里的本质原理是,通过获取父组件实例(也即u-radio-group的this)
  10203. // 将父组件this中对应的参数,赋值给本组件(u-radio的this)的parentData对象中对应的属性
  10204. // 之所以需要这么做,是因为所有端中,头条小程序不支持通过this.parent.xxx去监听父组件参数的变化
  10205. this.parent = this.$u.$parent.call(this, parentName);
  10206. if (this.parent) {
  10207. // 历遍parentData中的属性,将parent中的同名属性赋值给parentData
  10208. Object.keys(this.parentData).map(function (key) {
  10209. _this2.parentData[key] = _this2.parent[key];
  10210. });
  10211. }
  10212. },
  10213. // 阻止事件冒泡
  10214. preventEvent: function preventEvent(e) {
  10215. e && e.stopPropagation && e.stopPropagation();
  10216. }
  10217. },
  10218. onReachBottom: function onReachBottom() {
  10219. uni.$emit('uOnReachBottom');
  10220. },
  10221. beforeDestroy: function beforeDestroy() {
  10222. var _this3 = this;
  10223. // 判断当前页面是否存在parent和chldren,一般在checkbox和checkbox-group父子联动的场景会有此情况
  10224. // 组件销毁时,移除子组件在父组件children数组中的实例,释放资源,避免数据混乱
  10225. if (this.parent && uni.$u.test.array(this.parent.children)) {
  10226. // 组件销毁时,移除父组件中的children数组中对应的实例
  10227. var childrenList = this.parent.children;
  10228. childrenList.map(function (child, index) {
  10229. // 如果相等,则移除
  10230. if (child === _this3) {
  10231. childrenList.splice(index, 1);
  10232. }
  10233. });
  10234. }
  10235. }
  10236. };
  10237. exports.default = _default;
  10238. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  10239. /***/ }),
  10240. /***/ 35:
  10241. /*!*******************************************************************!*\
  10242. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/request/index.js ***!
  10243. \*******************************************************************/
  10244. /*! no static exports found */
  10245. /***/ (function(module, exports, __webpack_require__) {
  10246. "use strict";
  10247. /* WEBPACK VAR INJECTION */(function(uni) {
  10248. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  10249. Object.defineProperty(exports, "__esModule", {
  10250. value: true
  10251. });
  10252. exports.default = void 0;
  10253. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  10254. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  10255. var _deepMerge = _interopRequireDefault(__webpack_require__(/*! ../function/deepMerge */ 36));
  10256. var _test = _interopRequireDefault(__webpack_require__(/*! ../function/test */ 38));
  10257. var Request = /*#__PURE__*/function () {
  10258. function Request() {
  10259. var _this = this;
  10260. (0, _classCallCheck2.default)(this, Request);
  10261. this.config = {
  10262. baseUrl: '',
  10263. // 请求的根域名
  10264. // 默认的请求头
  10265. header: {},
  10266. method: 'POST',
  10267. // 设置为json,返回后uni.request会对数据进行一次JSON.parse
  10268. dataType: 'json',
  10269. // 此参数无需处理,因为5+和支付宝小程序不支持,默认为text即可
  10270. responseType: 'text',
  10271. showLoading: true,
  10272. // 是否显示请求中的loading
  10273. loadingText: '请求中...',
  10274. loadingTime: 800,
  10275. // 在此时间内,请求还没回来的话,就显示加载中动画,单位ms
  10276. timer: null,
  10277. // 定时器
  10278. originalData: false,
  10279. // 是否在拦截器中返回服务端的原始数据,见文档说明
  10280. loadingMask: true // 展示loading的时候,是否给一个透明的蒙层,防止触摸穿透
  10281. };
  10282. // 拦截器
  10283. this.interceptor = {
  10284. // 请求前的拦截
  10285. request: null,
  10286. // 请求后的拦截
  10287. response: null
  10288. };
  10289. // get请求
  10290. this.get = function (url) {
  10291. var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  10292. var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  10293. return _this.request({
  10294. method: 'GET',
  10295. url: url,
  10296. header: header,
  10297. data: data
  10298. });
  10299. };
  10300. // post请求
  10301. this.post = function (url) {
  10302. var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  10303. var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  10304. return _this.request({
  10305. url: url,
  10306. method: 'POST',
  10307. header: header,
  10308. data: data
  10309. });
  10310. };
  10311. // put请求,不支持支付宝小程序(HX2.6.15)
  10312. this.put = function (url) {
  10313. var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  10314. var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  10315. return _this.request({
  10316. url: url,
  10317. method: 'PUT',
  10318. header: header,
  10319. data: data
  10320. });
  10321. };
  10322. // delete请求,不支持支付宝和头条小程序(HX2.6.15)
  10323. this.delete = function (url) {
  10324. var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  10325. var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  10326. return _this.request({
  10327. url: url,
  10328. method: 'DELETE',
  10329. header: header,
  10330. data: data
  10331. });
  10332. };
  10333. }
  10334. (0, _createClass2.default)(Request, [{
  10335. key: "setConfig",
  10336. value:
  10337. // 设置全局默认配置
  10338. function setConfig(customConfig) {
  10339. // 深度合并对象,否则会造成对象深层属性丢失
  10340. this.config = (0, _deepMerge.default)(this.config, customConfig);
  10341. }
  10342. // 主要请求部分
  10343. }, {
  10344. key: "request",
  10345. value: function request() {
  10346. var _this2 = this;
  10347. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  10348. // 检查请求拦截
  10349. if (this.interceptor.request && typeof this.interceptor.request === 'function') {
  10350. var tmpConfig = {};
  10351. var interceptorRequest = this.interceptor.request(options);
  10352. if (interceptorRequest === false) {
  10353. // 返回一个处于pending状态中的Promise,来取消原promise,避免进入then()回调
  10354. return new Promise(function () {});
  10355. }
  10356. this.options = interceptorRequest;
  10357. }
  10358. options.dataType = options.dataType || this.config.dataType;
  10359. options.responseType = options.responseType || this.config.responseType;
  10360. options.url = options.url || '';
  10361. options.params = options.params || {};
  10362. options.header = Object.assign({}, this.config.header, options.header);
  10363. options.method = options.method || this.config.method;
  10364. return new Promise(function (resolve, reject) {
  10365. options.complete = function (response) {
  10366. // 请求返回后,隐藏loading(如果请求返回快的话,可能会没有loading)
  10367. uni.hideLoading();
  10368. // 清除定时器,如果请求回来了,就无需loading
  10369. clearTimeout(_this2.config.timer);
  10370. _this2.config.timer = null;
  10371. // 判断用户对拦截返回数据的要求,如果originalData为true,返回所有的数据(response)到拦截器,否则只返回response.data
  10372. if (_this2.config.originalData) {
  10373. // 判断是否存在拦截器
  10374. if (_this2.interceptor.response && typeof _this2.interceptor.response === 'function') {
  10375. var resInterceptors = _this2.interceptor.response(response);
  10376. // 如果拦截器不返回false,就将拦截器返回的内容给this.$u.post的then回调
  10377. if (resInterceptors !== false) {
  10378. resolve(resInterceptors);
  10379. } else {
  10380. // 如果拦截器返回false,意味着拦截器定义者认为返回有问题,直接接入catch回调
  10381. reject(response);
  10382. }
  10383. } else {
  10384. // 如果要求返回原始数据,就算没有拦截器,也返回最原始的数据
  10385. resolve(response);
  10386. }
  10387. } else {
  10388. if (response.statusCode == 200) {
  10389. if (_this2.interceptor.response && typeof _this2.interceptor.response === 'function') {
  10390. var _resInterceptors = _this2.interceptor.response(response.data);
  10391. if (_resInterceptors !== false) {
  10392. resolve(_resInterceptors);
  10393. } else {
  10394. reject(response.data);
  10395. }
  10396. } else {
  10397. // 如果不是返回原始数据(originalData=false),且没有拦截器的情况下,返回纯数据给then回调
  10398. resolve(response.data);
  10399. }
  10400. } else {
  10401. // 不返回原始数据的情况下,服务器状态码不为200,modal弹框提示
  10402. // if(response.errMsg) {
  10403. // uni.showModal({
  10404. // title: response.errMsg
  10405. // });
  10406. // }
  10407. reject(response);
  10408. }
  10409. }
  10410. };
  10411. // 判断用户传递的URL是否/开头,如果不是,加上/,这里使用了uView的test.js验证库的url()方法
  10412. options.url = _test.default.url(options.url) ? options.url : _this2.config.baseUrl + (options.url.indexOf('/') == 0 ? options.url : '/' + options.url);
  10413. // 是否显示loading
  10414. // 加一个是否已有timer定时器的判断,否则有两个同时请求的时候,后者会清除前者的定时器id
  10415. // 而没有清除前者的定时器,导致前者超时,一直显示loading
  10416. if (_this2.config.showLoading && !_this2.config.timer) {
  10417. _this2.config.timer = setTimeout(function () {
  10418. uni.showLoading({
  10419. title: _this2.config.loadingText,
  10420. mask: _this2.config.loadingMask
  10421. });
  10422. _this2.config.timer = null;
  10423. }, _this2.config.loadingTime);
  10424. }
  10425. uni.request(options);
  10426. });
  10427. // .catch(res => {
  10428. // // 如果返回reject(),不让其进入this.$u.post().then().catch()后面的catct()
  10429. // // 因为很多人都会忘了写后面的catch(),导致报错捕获不到catch
  10430. // return new Promise(()=>{});
  10431. // })
  10432. }
  10433. }]);
  10434. return Request;
  10435. }();
  10436. var _default = new Request();
  10437. exports.default = _default;
  10438. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  10439. /***/ }),
  10440. /***/ 36:
  10441. /*!************************************************************************!*\
  10442. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/deepMerge.js ***!
  10443. \************************************************************************/
  10444. /*! no static exports found */
  10445. /***/ (function(module, exports, __webpack_require__) {
  10446. "use strict";
  10447. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  10448. Object.defineProperty(exports, "__esModule", {
  10449. value: true
  10450. });
  10451. exports.default = void 0;
  10452. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  10453. var _deepClone = _interopRequireDefault(__webpack_require__(/*! ./deepClone */ 37));
  10454. // JS对象深度合并
  10455. function deepMerge() {
  10456. var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  10457. var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  10458. target = (0, _deepClone.default)(target);
  10459. if ((0, _typeof2.default)(target) !== 'object' || (0, _typeof2.default)(source) !== 'object') return false;
  10460. for (var prop in source) {
  10461. if (!source.hasOwnProperty(prop)) continue;
  10462. if (prop in target) {
  10463. if ((0, _typeof2.default)(target[prop]) !== 'object') {
  10464. target[prop] = source[prop];
  10465. } else {
  10466. if ((0, _typeof2.default)(source[prop]) !== 'object') {
  10467. target[prop] = source[prop];
  10468. } else {
  10469. if (target[prop].concat && source[prop].concat) {
  10470. target[prop] = target[prop].concat(source[prop]);
  10471. } else {
  10472. target[prop] = deepMerge(target[prop], source[prop]);
  10473. }
  10474. }
  10475. }
  10476. } else {
  10477. target[prop] = source[prop];
  10478. }
  10479. }
  10480. return target;
  10481. }
  10482. var _default = deepMerge;
  10483. exports.default = _default;
  10484. /***/ }),
  10485. /***/ 37:
  10486. /*!************************************************************************!*\
  10487. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/deepClone.js ***!
  10488. \************************************************************************/
  10489. /*! no static exports found */
  10490. /***/ (function(module, exports, __webpack_require__) {
  10491. "use strict";
  10492. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  10493. Object.defineProperty(exports, "__esModule", {
  10494. value: true
  10495. });
  10496. exports.default = void 0;
  10497. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  10498. // 判断arr是否为一个数组,返回一个bool值
  10499. function isArray(arr) {
  10500. return Object.prototype.toString.call(arr) === '[object Array]';
  10501. }
  10502. // 深度克隆
  10503. function deepClone(obj) {
  10504. // 对常见的“非”值,直接返回原来值
  10505. if ([null, undefined, NaN, false].includes(obj)) return obj;
  10506. if ((0, _typeof2.default)(obj) !== "object" && typeof obj !== 'function') {
  10507. //原始类型直接返回
  10508. return obj;
  10509. }
  10510. var o = isArray(obj) ? [] : {};
  10511. for (var i in obj) {
  10512. if (obj.hasOwnProperty(i)) {
  10513. o[i] = (0, _typeof2.default)(obj[i]) === "object" ? deepClone(obj[i]) : obj[i];
  10514. }
  10515. }
  10516. return o;
  10517. }
  10518. var _default = deepClone;
  10519. exports.default = _default;
  10520. /***/ }),
  10521. /***/ 38:
  10522. /*!*******************************************************************!*\
  10523. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/test.js ***!
  10524. \*******************************************************************/
  10525. /*! no static exports found */
  10526. /***/ (function(module, exports, __webpack_require__) {
  10527. "use strict";
  10528. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  10529. Object.defineProperty(exports, "__esModule", {
  10530. value: true
  10531. });
  10532. exports.default = void 0;
  10533. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  10534. /**
  10535. * 验证电子邮箱格式
  10536. */
  10537. function email(value) {
  10538. return /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(value);
  10539. }
  10540. /**
  10541. * 验证手机格式
  10542. */
  10543. function mobile(value) {
  10544. return /^1[23456789]\d{9}$/.test(value);
  10545. }
  10546. /**
  10547. * 验证URL格式
  10548. */
  10549. function url(value) {
  10550. return /http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w-.\/?%&=]*)?/.test(value);
  10551. }
  10552. /**
  10553. * 验证日期格式
  10554. */
  10555. function date(value) {
  10556. return !/Invalid|NaN/.test(new Date(value).toString());
  10557. }
  10558. /**
  10559. * 验证ISO类型的日期格式
  10560. */
  10561. function dateISO(value) {
  10562. return /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value);
  10563. }
  10564. /**
  10565. * 验证十进制数字
  10566. */
  10567. function number(value) {
  10568. return /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value);
  10569. }
  10570. /**
  10571. * 验证整数
  10572. */
  10573. function digits(value) {
  10574. return /^\d+$/.test(value);
  10575. }
  10576. /**
  10577. * 验证身份证号码
  10578. */
  10579. function idCard(value) {
  10580. 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(value);
  10581. }
  10582. /**
  10583. * 是否车牌号
  10584. */
  10585. function carNo(value) {
  10586. // 新能源车牌
  10587. var xreg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF]$)|([DF][A-HJ-NP-Z0-9][0-9]{4}$))/;
  10588. // 旧车牌
  10589. var creg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$/;
  10590. if (value.length === 7) {
  10591. return creg.test(value);
  10592. } else if (value.length === 8) {
  10593. return xreg.test(value);
  10594. } else {
  10595. return false;
  10596. }
  10597. }
  10598. /**
  10599. * 金额,只允许2位小数
  10600. */
  10601. function amount(value) {
  10602. //金额,只允许保留两位小数
  10603. return /^[1-9]\d*(,\d{3})*(\.\d{1,2})?$|^0\.\d{1,2}$/.test(value);
  10604. }
  10605. /**
  10606. * 中文
  10607. */
  10608. function chinese(value) {
  10609. var reg = /^[\u4e00-\u9fa5]+$/gi;
  10610. return reg.test(value);
  10611. }
  10612. /**
  10613. * 只能输入字母
  10614. */
  10615. function letter(value) {
  10616. return /^[a-zA-Z]*$/.test(value);
  10617. }
  10618. /**
  10619. * 只能是字母或者数字
  10620. */
  10621. function enOrNum(value) {
  10622. //英文或者数字
  10623. var reg = /^[0-9a-zA-Z]*$/g;
  10624. return reg.test(value);
  10625. }
  10626. /**
  10627. * 验证是否包含某个值
  10628. */
  10629. function contains(value, param) {
  10630. return value.indexOf(param) >= 0;
  10631. }
  10632. /**
  10633. * 验证一个值范围[min, max]
  10634. */
  10635. function range(value, param) {
  10636. return value >= param[0] && value <= param[1];
  10637. }
  10638. /**
  10639. * 验证一个长度范围[min, max]
  10640. */
  10641. function rangeLength(value, param) {
  10642. return value.length >= param[0] && value.length <= param[1];
  10643. }
  10644. /**
  10645. * 是否固定电话
  10646. */
  10647. function landline(value) {
  10648. var reg = /^\d{3,4}-\d{7,8}(-\d{3,4})?$/;
  10649. return reg.test(value);
  10650. }
  10651. /**
  10652. * 判断是否为空
  10653. */
  10654. function empty(value) {
  10655. switch ((0, _typeof2.default)(value)) {
  10656. case 'undefined':
  10657. return true;
  10658. case 'string':
  10659. if (value.replace(/(^[ \t\n\r]*)|([ \t\n\r]*$)/g, '').length == 0) return true;
  10660. break;
  10661. case 'boolean':
  10662. if (!value) return true;
  10663. break;
  10664. case 'number':
  10665. if (0 === value || isNaN(value)) return true;
  10666. break;
  10667. case 'object':
  10668. if (null === value || value.length === 0) return true;
  10669. for (var i in value) {
  10670. return false;
  10671. }
  10672. return true;
  10673. }
  10674. return false;
  10675. }
  10676. /**
  10677. * 是否json字符串
  10678. */
  10679. function jsonString(value) {
  10680. if (typeof value == 'string') {
  10681. try {
  10682. var obj = JSON.parse(value);
  10683. if ((0, _typeof2.default)(obj) == 'object' && obj) {
  10684. return true;
  10685. } else {
  10686. return false;
  10687. }
  10688. } catch (e) {
  10689. return false;
  10690. }
  10691. }
  10692. return false;
  10693. }
  10694. /**
  10695. * 是否数组
  10696. */
  10697. function array(value) {
  10698. if (typeof Array.isArray === "function") {
  10699. return Array.isArray(value);
  10700. } else {
  10701. return Object.prototype.toString.call(value) === "[object Array]";
  10702. }
  10703. }
  10704. /**
  10705. * 是否对象
  10706. */
  10707. function object(value) {
  10708. return Object.prototype.toString.call(value) === '[object Object]';
  10709. }
  10710. /**
  10711. * 是否短信验证码
  10712. */
  10713. function code(value) {
  10714. var len = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 6;
  10715. return new RegExp("^\\d{".concat(len, "}$")).test(value);
  10716. }
  10717. /**
  10718. * 是否函数方法
  10719. * @param {Object} value
  10720. */
  10721. function func(value) {
  10722. return typeof value === 'function';
  10723. }
  10724. /**
  10725. * 是否promise对象
  10726. * @param {Object} value
  10727. */
  10728. function promise(value) {
  10729. return object(value) && func(value.then) && func(value.catch);
  10730. }
  10731. /** 是否图片格式
  10732. * @param {Object} value
  10733. */
  10734. function image(value) {
  10735. var newValue = value.split('?')[0];
  10736. return new RegExp(/\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)$/).test(newValue);
  10737. }
  10738. /**
  10739. * 是否视频格式
  10740. * @param {Object} value
  10741. */
  10742. function video(value) {
  10743. var newValue = value.split('?')[0];
  10744. return new RegExp(/\.(mp4|mpg|mpeg|dat|asf|avi|rm|rmvb|mov|wmv|flv|mkv|m3u8|3gp)$/).test(newValue);
  10745. }
  10746. /**
  10747. * 是否为正则对象
  10748. * @param {Object}
  10749. * @return {Boolean}
  10750. */
  10751. function regExp(o) {
  10752. return o && Object.prototype.toString.call(o) === '[object RegExp]';
  10753. }
  10754. /**
  10755. * 验证字符串
  10756. */
  10757. function string(value) {
  10758. return typeof value === 'string';
  10759. }
  10760. var _default = {
  10761. email: email,
  10762. mobile: mobile,
  10763. url: url,
  10764. date: date,
  10765. dateISO: dateISO,
  10766. number: number,
  10767. digits: digits,
  10768. idCard: idCard,
  10769. carNo: carNo,
  10770. amount: amount,
  10771. chinese: chinese,
  10772. letter: letter,
  10773. enOrNum: enOrNum,
  10774. contains: contains,
  10775. range: range,
  10776. rangeLength: rangeLength,
  10777. empty: empty,
  10778. isEmpty: empty,
  10779. jsonString: jsonString,
  10780. landline: landline,
  10781. object: object,
  10782. array: array,
  10783. code: code,
  10784. func: func,
  10785. promise: promise,
  10786. video: video,
  10787. image: image,
  10788. regExp: regExp,
  10789. string: string
  10790. };
  10791. exports.default = _default;
  10792. /***/ }),
  10793. /***/ 39:
  10794. /*!**************************************************************************!*\
  10795. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/queryParams.js ***!
  10796. \**************************************************************************/
  10797. /*! no static exports found */
  10798. /***/ (function(module, exports, __webpack_require__) {
  10799. "use strict";
  10800. Object.defineProperty(exports, "__esModule", {
  10801. value: true
  10802. });
  10803. exports.default = void 0;
  10804. /**
  10805. * 对象转url参数
  10806. * @param {*} data,对象
  10807. * @param {*} isPrefix,是否自动加上"?"
  10808. */
  10809. function queryParams() {
  10810. var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  10811. var isPrefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  10812. var arrayFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'brackets';
  10813. var prefix = isPrefix ? '?' : '';
  10814. var _result = [];
  10815. if (['indices', 'brackets', 'repeat', 'comma'].indexOf(arrayFormat) == -1) arrayFormat = 'brackets';
  10816. var _loop = function _loop(key) {
  10817. var value = data[key];
  10818. // 去掉为空的参数
  10819. if (['', undefined, null].indexOf(value) >= 0) {
  10820. return "continue";
  10821. }
  10822. // 如果值为数组,另行处理
  10823. if (value.constructor === Array) {
  10824. // e.g. {ids: [1, 2, 3]}
  10825. switch (arrayFormat) {
  10826. case 'indices':
  10827. // 结果: ids[0]=1&ids[1]=2&ids[2]=3
  10828. for (var i = 0; i < value.length; i++) {
  10829. _result.push(key + '[' + i + ']=' + value[i]);
  10830. }
  10831. break;
  10832. case 'brackets':
  10833. // 结果: ids[]=1&ids[]=2&ids[]=3
  10834. value.forEach(function (_value) {
  10835. _result.push(key + '[]=' + _value);
  10836. });
  10837. break;
  10838. case 'repeat':
  10839. // 结果: ids=1&ids=2&ids=3
  10840. value.forEach(function (_value) {
  10841. _result.push(key + '=' + _value);
  10842. });
  10843. break;
  10844. case 'comma':
  10845. // 结果: ids=1,2,3
  10846. var commaStr = "";
  10847. value.forEach(function (_value) {
  10848. commaStr += (commaStr ? "," : "") + _value;
  10849. });
  10850. _result.push(key + '=' + commaStr);
  10851. break;
  10852. default:
  10853. value.forEach(function (_value) {
  10854. _result.push(key + '[]=' + _value);
  10855. });
  10856. }
  10857. } else {
  10858. _result.push(key + '=' + value);
  10859. }
  10860. };
  10861. for (var key in data) {
  10862. var _ret = _loop(key);
  10863. if (_ret === "continue") continue;
  10864. }
  10865. return _result.length ? prefix + _result.join('&') : '';
  10866. }
  10867. var _default = queryParams;
  10868. exports.default = _default;
  10869. /***/ }),
  10870. /***/ 4:
  10871. /*!**********************************************************************!*\
  10872. !*** ./node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
  10873. \**********************************************************************/
  10874. /*! no static exports found */
  10875. /***/ (function(module, exports) {
  10876. function _interopRequireDefault(obj) {
  10877. return obj && obj.__esModule ? obj : {
  10878. "default": obj
  10879. };
  10880. }
  10881. module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
  10882. /***/ }),
  10883. /***/ 40:
  10884. /*!********************************************************************!*\
  10885. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/route.js ***!
  10886. \********************************************************************/
  10887. /*! no static exports found */
  10888. /***/ (function(module, exports, __webpack_require__) {
  10889. "use strict";
  10890. /* WEBPACK VAR INJECTION */(function(uni) {
  10891. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  10892. Object.defineProperty(exports, "__esModule", {
  10893. value: true
  10894. });
  10895. exports.default = void 0;
  10896. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 41));
  10897. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 43));
  10898. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  10899. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  10900. /**
  10901. * 路由跳转方法,该方法相对于直接使用uni.xxx的好处是使用更加简单快捷
  10902. * 并且带有路由拦截功能
  10903. */
  10904. var Router = /*#__PURE__*/function () {
  10905. function Router() {
  10906. (0, _classCallCheck2.default)(this, Router);
  10907. // 原始属性定义
  10908. this.config = {
  10909. type: 'navigateTo',
  10910. url: '',
  10911. delta: 1,
  10912. // navigateBack页面后退时,回退的层数
  10913. params: {},
  10914. // 传递的参数
  10915. animationType: 'pop-in',
  10916. // 窗口动画,只在APP有效
  10917. animationDuration: 300,
  10918. // 窗口动画持续时间,单位毫秒,只在APP有效
  10919. intercept: false // 是否需要拦截
  10920. };
  10921. // 因为route方法是需要对外赋值给另外的对象使用,同时route内部有使用this,会导致route失去上下文
  10922. // 这里在构造函数中进行this绑定
  10923. this.route = this.route.bind(this);
  10924. }
  10925. // 判断url前面是否有"/",如果没有则加上,否则无法跳转
  10926. (0, _createClass2.default)(Router, [{
  10927. key: "addRootPath",
  10928. value: function addRootPath(url) {
  10929. return url[0] === '/' ? url : "/".concat(url);
  10930. }
  10931. // 整合路由参数
  10932. }, {
  10933. key: "mixinParam",
  10934. value: function mixinParam(url, params) {
  10935. url = url && this.addRootPath(url);
  10936. // 使用正则匹配,主要依据是判断是否有"/","?","="等,如“/page/index/index?name=mary"
  10937. // 如果有url中有get参数,转换后无需带上"?"
  10938. var query = '';
  10939. if (/.*\/.*\?.*=.*/.test(url)) {
  10940. // object对象转为get类型的参数
  10941. query = uni.$u.queryParams(params, false);
  10942. // 因为已有get参数,所以后面拼接的参数需要带上"&"隔开
  10943. return url += "&" + query;
  10944. } else {
  10945. // 直接拼接参数,因为此处url中没有后面的query参数,也就没有"?/&"之类的符号
  10946. query = uni.$u.queryParams(params);
  10947. return url += query;
  10948. }
  10949. }
  10950. // 对外的方法名称
  10951. }, {
  10952. key: "route",
  10953. value: function () {
  10954. var _route = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
  10955. var options,
  10956. params,
  10957. mergeConfig,
  10958. isNext,
  10959. _args = arguments;
  10960. return _regenerator.default.wrap(function _callee$(_context) {
  10961. while (1) {
  10962. switch (_context.prev = _context.next) {
  10963. case 0:
  10964. options = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
  10965. params = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
  10966. // 合并用户的配置和内部的默认配置
  10967. mergeConfig = {};
  10968. if (typeof options === 'string') {
  10969. // 如果options为字符串,则为route(url, params)的形式
  10970. mergeConfig.url = this.mixinParam(options, params);
  10971. mergeConfig.type = 'navigateTo';
  10972. } else {
  10973. mergeConfig = uni.$u.deepClone(options, this.config);
  10974. // 否则正常使用mergeConfig中的url和params进行拼接
  10975. mergeConfig.url = this.mixinParam(options.url, options.params);
  10976. }
  10977. if (params.intercept) {
  10978. this.config.intercept = params.intercept;
  10979. }
  10980. // params参数也带给拦截器
  10981. mergeConfig.params = params;
  10982. // 合并内外部参数
  10983. mergeConfig = uni.$u.deepMerge(this.config, mergeConfig);
  10984. // 判断用户是否定义了拦截器
  10985. if (!(typeof uni.$u.routeIntercept === 'function')) {
  10986. _context.next = 14;
  10987. break;
  10988. }
  10989. _context.next = 10;
  10990. return new Promise(function (resolve, reject) {
  10991. uni.$u.routeIntercept(mergeConfig, resolve);
  10992. });
  10993. case 10:
  10994. isNext = _context.sent;
  10995. // 如果isNext为true,则执行路由跳转
  10996. isNext && this.openPage(mergeConfig);
  10997. _context.next = 15;
  10998. break;
  10999. case 14:
  11000. this.openPage(mergeConfig);
  11001. case 15:
  11002. case "end":
  11003. return _context.stop();
  11004. }
  11005. }
  11006. }, _callee, this);
  11007. }));
  11008. function route() {
  11009. return _route.apply(this, arguments);
  11010. }
  11011. return route;
  11012. }() // 执行路由跳转
  11013. }, {
  11014. key: "openPage",
  11015. value: function openPage(config) {
  11016. // 解构参数
  11017. var url = config.url,
  11018. type = config.type,
  11019. delta = config.delta,
  11020. animationType = config.animationType,
  11021. animationDuration = config.animationDuration;
  11022. if (config.type == 'navigateTo' || config.type == 'to') {
  11023. uni.navigateTo({
  11024. url: url,
  11025. animationType: animationType,
  11026. animationDuration: animationDuration
  11027. });
  11028. }
  11029. if (config.type == 'redirectTo' || config.type == 'redirect') {
  11030. uni.redirectTo({
  11031. url: url
  11032. });
  11033. }
  11034. if (config.type == 'switchTab' || config.type == 'tab') {
  11035. uni.switchTab({
  11036. url: url
  11037. });
  11038. }
  11039. if (config.type == 'reLaunch' || config.type == 'launch') {
  11040. uni.reLaunch({
  11041. url: url
  11042. });
  11043. }
  11044. if (config.type == 'navigateBack' || config.type == 'back') {
  11045. uni.navigateBack({
  11046. delta: delta
  11047. });
  11048. }
  11049. }
  11050. }]);
  11051. return Router;
  11052. }();
  11053. var _default = new Router().route;
  11054. exports.default = _default;
  11055. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  11056. /***/ }),
  11057. /***/ 41:
  11058. /*!************************************************************************************************!*\
  11059. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/@babel/runtime/regenerator/index.js ***!
  11060. \************************************************************************************************/
  11061. /*! no static exports found */
  11062. /***/ (function(module, exports, __webpack_require__) {
  11063. // TODO(Babel 8): Remove this file.
  11064. var runtime = __webpack_require__(/*! @babel/runtime/helpers/regeneratorRuntime */ 42)();
  11065. module.exports = runtime;
  11066. /***/ }),
  11067. /***/ 42:
  11068. /*!*******************************************************************!*\
  11069. !*** ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
  11070. \*******************************************************************/
  11071. /*! no static exports found */
  11072. /***/ (function(module, exports, __webpack_require__) {
  11073. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  11074. function _regeneratorRuntime() {
  11075. "use strict";
  11076. /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
  11077. module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
  11078. return exports;
  11079. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  11080. var exports = {},
  11081. Op = Object.prototype,
  11082. hasOwn = Op.hasOwnProperty,
  11083. defineProperty = Object.defineProperty || function (obj, key, desc) {
  11084. obj[key] = desc.value;
  11085. },
  11086. $Symbol = "function" == typeof Symbol ? Symbol : {},
  11087. iteratorSymbol = $Symbol.iterator || "@@iterator",
  11088. asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
  11089. toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  11090. function define(obj, key, value) {
  11091. return Object.defineProperty(obj, key, {
  11092. value: value,
  11093. enumerable: !0,
  11094. configurable: !0,
  11095. writable: !0
  11096. }), obj[key];
  11097. }
  11098. try {
  11099. define({}, "");
  11100. } catch (err) {
  11101. define = function define(obj, key, value) {
  11102. return obj[key] = value;
  11103. };
  11104. }
  11105. function wrap(innerFn, outerFn, self, tryLocsList) {
  11106. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
  11107. generator = Object.create(protoGenerator.prototype),
  11108. context = new Context(tryLocsList || []);
  11109. return defineProperty(generator, "_invoke", {
  11110. value: makeInvokeMethod(innerFn, self, context)
  11111. }), generator;
  11112. }
  11113. function tryCatch(fn, obj, arg) {
  11114. try {
  11115. return {
  11116. type: "normal",
  11117. arg: fn.call(obj, arg)
  11118. };
  11119. } catch (err) {
  11120. return {
  11121. type: "throw",
  11122. arg: err
  11123. };
  11124. }
  11125. }
  11126. exports.wrap = wrap;
  11127. var ContinueSentinel = {};
  11128. function Generator() {}
  11129. function GeneratorFunction() {}
  11130. function GeneratorFunctionPrototype() {}
  11131. var IteratorPrototype = {};
  11132. define(IteratorPrototype, iteratorSymbol, function () {
  11133. return this;
  11134. });
  11135. var getProto = Object.getPrototypeOf,
  11136. NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  11137. NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
  11138. var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
  11139. function defineIteratorMethods(prototype) {
  11140. ["next", "throw", "return"].forEach(function (method) {
  11141. define(prototype, method, function (arg) {
  11142. return this._invoke(method, arg);
  11143. });
  11144. });
  11145. }
  11146. function AsyncIterator(generator, PromiseImpl) {
  11147. function invoke(method, arg, resolve, reject) {
  11148. var record = tryCatch(generator[method], generator, arg);
  11149. if ("throw" !== record.type) {
  11150. var result = record.arg,
  11151. value = result.value;
  11152. return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
  11153. invoke("next", value, resolve, reject);
  11154. }, function (err) {
  11155. invoke("throw", err, resolve, reject);
  11156. }) : PromiseImpl.resolve(value).then(function (unwrapped) {
  11157. result.value = unwrapped, resolve(result);
  11158. }, function (error) {
  11159. return invoke("throw", error, resolve, reject);
  11160. });
  11161. }
  11162. reject(record.arg);
  11163. }
  11164. var previousPromise;
  11165. defineProperty(this, "_invoke", {
  11166. value: function value(method, arg) {
  11167. function callInvokeWithMethodAndArg() {
  11168. return new PromiseImpl(function (resolve, reject) {
  11169. invoke(method, arg, resolve, reject);
  11170. });
  11171. }
  11172. return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
  11173. }
  11174. });
  11175. }
  11176. function makeInvokeMethod(innerFn, self, context) {
  11177. var state = "suspendedStart";
  11178. return function (method, arg) {
  11179. if ("executing" === state) throw new Error("Generator is already running");
  11180. if ("completed" === state) {
  11181. if ("throw" === method) throw arg;
  11182. return doneResult();
  11183. }
  11184. for (context.method = method, context.arg = arg;;) {
  11185. var delegate = context.delegate;
  11186. if (delegate) {
  11187. var delegateResult = maybeInvokeDelegate(delegate, context);
  11188. if (delegateResult) {
  11189. if (delegateResult === ContinueSentinel) continue;
  11190. return delegateResult;
  11191. }
  11192. }
  11193. if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
  11194. if ("suspendedStart" === state) throw state = "completed", context.arg;
  11195. context.dispatchException(context.arg);
  11196. } else "return" === context.method && context.abrupt("return", context.arg);
  11197. state = "executing";
  11198. var record = tryCatch(innerFn, self, context);
  11199. if ("normal" === record.type) {
  11200. if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
  11201. return {
  11202. value: record.arg,
  11203. done: context.done
  11204. };
  11205. }
  11206. "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
  11207. }
  11208. };
  11209. }
  11210. function maybeInvokeDelegate(delegate, context) {
  11211. var methodName = context.method,
  11212. method = delegate.iterator[methodName];
  11213. if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
  11214. var record = tryCatch(method, delegate.iterator, context.arg);
  11215. if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
  11216. var info = record.arg;
  11217. return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
  11218. }
  11219. function pushTryEntry(locs) {
  11220. var entry = {
  11221. tryLoc: locs[0]
  11222. };
  11223. 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
  11224. }
  11225. function resetTryEntry(entry) {
  11226. var record = entry.completion || {};
  11227. record.type = "normal", delete record.arg, entry.completion = record;
  11228. }
  11229. function Context(tryLocsList) {
  11230. this.tryEntries = [{
  11231. tryLoc: "root"
  11232. }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
  11233. }
  11234. function values(iterable) {
  11235. if (iterable) {
  11236. var iteratorMethod = iterable[iteratorSymbol];
  11237. if (iteratorMethod) return iteratorMethod.call(iterable);
  11238. if ("function" == typeof iterable.next) return iterable;
  11239. if (!isNaN(iterable.length)) {
  11240. var i = -1,
  11241. next = function next() {
  11242. for (; ++i < iterable.length;) {
  11243. if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
  11244. }
  11245. return next.value = undefined, next.done = !0, next;
  11246. };
  11247. return next.next = next;
  11248. }
  11249. }
  11250. return {
  11251. next: doneResult
  11252. };
  11253. }
  11254. function doneResult() {
  11255. return {
  11256. value: undefined,
  11257. done: !0
  11258. };
  11259. }
  11260. return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
  11261. value: GeneratorFunctionPrototype,
  11262. configurable: !0
  11263. }), defineProperty(GeneratorFunctionPrototype, "constructor", {
  11264. value: GeneratorFunction,
  11265. configurable: !0
  11266. }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
  11267. var ctor = "function" == typeof genFun && genFun.constructor;
  11268. return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
  11269. }, exports.mark = function (genFun) {
  11270. return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
  11271. }, exports.awrap = function (arg) {
  11272. return {
  11273. __await: arg
  11274. };
  11275. }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
  11276. return this;
  11277. }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
  11278. void 0 === PromiseImpl && (PromiseImpl = Promise);
  11279. var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
  11280. return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
  11281. return result.done ? result.value : iter.next();
  11282. });
  11283. }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
  11284. return this;
  11285. }), define(Gp, "toString", function () {
  11286. return "[object Generator]";
  11287. }), exports.keys = function (val) {
  11288. var object = Object(val),
  11289. keys = [];
  11290. for (var key in object) {
  11291. keys.push(key);
  11292. }
  11293. return keys.reverse(), function next() {
  11294. for (; keys.length;) {
  11295. var key = keys.pop();
  11296. if (key in object) return next.value = key, next.done = !1, next;
  11297. }
  11298. return next.done = !0, next;
  11299. };
  11300. }, exports.values = values, Context.prototype = {
  11301. constructor: Context,
  11302. reset: function reset(skipTempReset) {
  11303. if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) {
  11304. "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
  11305. }
  11306. },
  11307. stop: function stop() {
  11308. this.done = !0;
  11309. var rootRecord = this.tryEntries[0].completion;
  11310. if ("throw" === rootRecord.type) throw rootRecord.arg;
  11311. return this.rval;
  11312. },
  11313. dispatchException: function dispatchException(exception) {
  11314. if (this.done) throw exception;
  11315. var context = this;
  11316. function handle(loc, caught) {
  11317. return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
  11318. }
  11319. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  11320. var entry = this.tryEntries[i],
  11321. record = entry.completion;
  11322. if ("root" === entry.tryLoc) return handle("end");
  11323. if (entry.tryLoc <= this.prev) {
  11324. var hasCatch = hasOwn.call(entry, "catchLoc"),
  11325. hasFinally = hasOwn.call(entry, "finallyLoc");
  11326. if (hasCatch && hasFinally) {
  11327. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  11328. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  11329. } else if (hasCatch) {
  11330. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  11331. } else {
  11332. if (!hasFinally) throw new Error("try statement without catch or finally");
  11333. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  11334. }
  11335. }
  11336. }
  11337. },
  11338. abrupt: function abrupt(type, arg) {
  11339. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  11340. var entry = this.tryEntries[i];
  11341. if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
  11342. var finallyEntry = entry;
  11343. break;
  11344. }
  11345. }
  11346. finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
  11347. var record = finallyEntry ? finallyEntry.completion : {};
  11348. return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
  11349. },
  11350. complete: function complete(record, afterLoc) {
  11351. if ("throw" === record.type) throw record.arg;
  11352. return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
  11353. },
  11354. finish: function finish(finallyLoc) {
  11355. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  11356. var entry = this.tryEntries[i];
  11357. if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
  11358. }
  11359. },
  11360. "catch": function _catch(tryLoc) {
  11361. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  11362. var entry = this.tryEntries[i];
  11363. if (entry.tryLoc === tryLoc) {
  11364. var record = entry.completion;
  11365. if ("throw" === record.type) {
  11366. var thrown = record.arg;
  11367. resetTryEntry(entry);
  11368. }
  11369. return thrown;
  11370. }
  11371. }
  11372. throw new Error("illegal catch attempt");
  11373. },
  11374. delegateYield: function delegateYield(iterable, resultName, nextLoc) {
  11375. return this.delegate = {
  11376. iterator: values(iterable),
  11377. resultName: resultName,
  11378. nextLoc: nextLoc
  11379. }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
  11380. }
  11381. }, exports;
  11382. }
  11383. module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
  11384. /***/ }),
  11385. /***/ 43:
  11386. /*!*****************************************************************!*\
  11387. !*** ./node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
  11388. \*****************************************************************/
  11389. /*! no static exports found */
  11390. /***/ (function(module, exports) {
  11391. function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
  11392. try {
  11393. var info = gen[key](arg);
  11394. var value = info.value;
  11395. } catch (error) {
  11396. reject(error);
  11397. return;
  11398. }
  11399. if (info.done) {
  11400. resolve(value);
  11401. } else {
  11402. Promise.resolve(value).then(_next, _throw);
  11403. }
  11404. }
  11405. function _asyncToGenerator(fn) {
  11406. return function () {
  11407. var self = this,
  11408. args = arguments;
  11409. return new Promise(function (resolve, reject) {
  11410. var gen = fn.apply(self, args);
  11411. function _next(value) {
  11412. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
  11413. }
  11414. function _throw(err) {
  11415. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
  11416. }
  11417. _next(undefined);
  11418. });
  11419. };
  11420. }
  11421. module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
  11422. /***/ }),
  11423. /***/ 44:
  11424. /*!*************************************************************************!*\
  11425. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/timeFormat.js ***!
  11426. \*************************************************************************/
  11427. /*! no static exports found */
  11428. /***/ (function(module, exports, __webpack_require__) {
  11429. "use strict";
  11430. Object.defineProperty(exports, "__esModule", {
  11431. value: true
  11432. });
  11433. exports.default = void 0;
  11434. // padStart 的 polyfill,因为某些机型或情况,还无法支持es7的padStart,比如电脑版的微信小程序
  11435. // 所以这里做一个兼容polyfill的兼容处理
  11436. if (!String.prototype.padStart) {
  11437. // 为了方便表示这里 fillString 用了ES6 的默认参数,不影响理解
  11438. String.prototype.padStart = function (maxLength) {
  11439. var fillString = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ' ';
  11440. if (Object.prototype.toString.call(fillString) !== "[object String]") throw new TypeError('fillString must be String');
  11441. var str = this;
  11442. // 返回 String(str) 这里是为了使返回的值是字符串字面量,在控制台中更符合直觉
  11443. if (str.length >= maxLength) return String(str);
  11444. var fillLength = maxLength - str.length,
  11445. times = Math.ceil(fillLength / fillString.length);
  11446. while (times >>= 1) {
  11447. fillString += fillString;
  11448. if (times === 1) {
  11449. fillString += fillString;
  11450. }
  11451. }
  11452. return fillString.slice(0, fillLength) + str;
  11453. };
  11454. }
  11455. // 其他更多是格式化有如下:
  11456. // yyyy:mm:dd|yyyy:mm|yyyy年mm月dd日|yyyy年mm月dd日 hh时MM分等,可自定义组合
  11457. function timeFormat() {
  11458. var dateTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  11459. var fmt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-mm-dd';
  11460. // 如果为null,则格式化当前时间
  11461. if (!dateTime) dateTime = Number(new Date());
  11462. // 如果dateTime长度为10或者13,则为秒和毫秒的时间戳,如果超过13位,则为其他的时间格式
  11463. if (dateTime.toString().length == 10) dateTime *= 1000;
  11464. var date = new Date(dateTime);
  11465. var ret;
  11466. var opt = {
  11467. "y+": date.getFullYear().toString(),
  11468. // 年
  11469. "m+": (date.getMonth() + 1).toString(),
  11470. // 月
  11471. "d+": date.getDate().toString(),
  11472. // 日
  11473. "h+": date.getHours().toString(),
  11474. // 时
  11475. "M+": date.getMinutes().toString(),
  11476. // 分
  11477. "s+": date.getSeconds().toString() // 秒
  11478. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  11479. };
  11480. for (var k in opt) {
  11481. ret = new RegExp("(" + k + ")").exec(fmt);
  11482. if (ret) {
  11483. fmt = fmt.replace(ret[1], ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, "0"));
  11484. }
  11485. ;
  11486. }
  11487. ;
  11488. return fmt;
  11489. }
  11490. var _default = timeFormat;
  11491. exports.default = _default;
  11492. /***/ }),
  11493. /***/ 45:
  11494. /*!***********************************************************************!*\
  11495. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/timeFrom.js ***!
  11496. \***********************************************************************/
  11497. /*! no static exports found */
  11498. /***/ (function(module, exports, __webpack_require__) {
  11499. "use strict";
  11500. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  11501. Object.defineProperty(exports, "__esModule", {
  11502. value: true
  11503. });
  11504. exports.default = void 0;
  11505. var _timeFormat = _interopRequireDefault(__webpack_require__(/*! ../../libs/function/timeFormat.js */ 44));
  11506. /**
  11507. * 时间戳转为多久之前
  11508. * @param String timestamp 时间戳
  11509. * @param String | Boolean format 如果为时间格式字符串,超出一定时间范围,返回固定的时间格式;
  11510. * 如果为布尔值false,无论什么时间,都返回多久以前的格式
  11511. */
  11512. function timeFrom() {
  11513. var dateTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  11514. var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-mm-dd';
  11515. // 如果为null,则格式化当前时间
  11516. if (!dateTime) dateTime = Number(new Date());
  11517. // 如果dateTime长度为10或者13,则为秒和毫秒的时间戳,如果超过13位,则为其他的时间格式
  11518. if (dateTime.toString().length == 10) dateTime *= 1000;
  11519. var timestamp = +new Date(Number(dateTime));
  11520. var timer = (Number(new Date()) - timestamp) / 1000;
  11521. // 如果小于5分钟,则返回"刚刚",其他以此类推
  11522. var tips = '';
  11523. switch (true) {
  11524. case timer < 300:
  11525. tips = '刚刚';
  11526. break;
  11527. case timer >= 300 && timer < 3600:
  11528. tips = parseInt(timer / 60) + '分钟前';
  11529. break;
  11530. case timer >= 3600 && timer < 86400:
  11531. tips = parseInt(timer / 3600) + '小时前';
  11532. break;
  11533. case timer >= 86400 && timer < 2592000:
  11534. tips = parseInt(timer / 86400) + '天前';
  11535. break;
  11536. default:
  11537. // 如果format为false,则无论什么时间戳,都显示xx之前
  11538. if (format === false) {
  11539. if (timer >= 2592000 && timer < 365 * 86400) {
  11540. tips = parseInt(timer / (86400 * 30)) + '个月前';
  11541. } else {
  11542. tips = parseInt(timer / (86400 * 365)) + '年前';
  11543. }
  11544. } else {
  11545. tips = (0, _timeFormat.default)(timestamp, format);
  11546. }
  11547. }
  11548. return tips;
  11549. }
  11550. var _default = timeFrom;
  11551. exports.default = _default;
  11552. /***/ }),
  11553. /***/ 46:
  11554. /*!****************************************************************************!*\
  11555. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/colorGradient.js ***!
  11556. \****************************************************************************/
  11557. /*! no static exports found */
  11558. /***/ (function(module, exports, __webpack_require__) {
  11559. "use strict";
  11560. Object.defineProperty(exports, "__esModule", {
  11561. value: true
  11562. });
  11563. exports.default = void 0;
  11564. /**
  11565. * 求两个颜色之间的渐变值
  11566. * @param {string} startColor 开始的颜色
  11567. * @param {string} endColor 结束的颜色
  11568. * @param {number} step 颜色等分的份额
  11569. * */
  11570. function colorGradient() {
  11571. var startColor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'rgb(0, 0, 0)';
  11572. var endColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'rgb(255, 255, 255)';
  11573. var step = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 10;
  11574. var startRGB = hexToRgb(startColor, false); //转换为rgb数组模式
  11575. var startR = startRGB[0];
  11576. var startG = startRGB[1];
  11577. var startB = startRGB[2];
  11578. var endRGB = hexToRgb(endColor, false);
  11579. var endR = endRGB[0];
  11580. var endG = endRGB[1];
  11581. var endB = endRGB[2];
  11582. var sR = (endR - startR) / step; //总差值
  11583. var sG = (endG - startG) / step;
  11584. var sB = (endB - startB) / step;
  11585. var colorArr = [];
  11586. for (var i = 0; i < step; i++) {
  11587. //计算每一步的hex值
  11588. var hex = rgbToHex('rgb(' + Math.round(sR * i + startR) + ',' + Math.round(sG * i + startG) + ',' + Math.round(sB * i + startB) + ')');
  11589. colorArr.push(hex);
  11590. }
  11591. return colorArr;
  11592. }
  11593. // 将hex表示方式转换为rgb表示方式(这里返回rgb数组模式)
  11594. function hexToRgb(sColor) {
  11595. var str = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  11596. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  11597. sColor = sColor.toLowerCase();
  11598. if (sColor && reg.test(sColor)) {
  11599. if (sColor.length === 4) {
  11600. var sColorNew = "#";
  11601. for (var i = 1; i < 4; i += 1) {
  11602. sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
  11603. }
  11604. sColor = sColorNew;
  11605. }
  11606. //处理六位的颜色值
  11607. var sColorChange = [];
  11608. for (var _i = 1; _i < 7; _i += 2) {
  11609. sColorChange.push(parseInt("0x" + sColor.slice(_i, _i + 2)));
  11610. }
  11611. if (!str) {
  11612. return sColorChange;
  11613. } else {
  11614. return "rgb(".concat(sColorChange[0], ",").concat(sColorChange[1], ",").concat(sColorChange[2], ")");
  11615. }
  11616. } else if (/^(rgb|RGB)/.test(sColor)) {
  11617. var arr = sColor.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
  11618. return arr.map(function (val) {
  11619. return Number(val);
  11620. });
  11621. } else {
  11622. return sColor;
  11623. }
  11624. }
  11625. ;
  11626. // 将rgb表示方式转换为hex表示方式
  11627. function rgbToHex(rgb) {
  11628. var _this = rgb;
  11629. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  11630. if (/^(rgb|RGB)/.test(_this)) {
  11631. var aColor = _this.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
  11632. var strHex = "#";
  11633. for (var i = 0; i < aColor.length; i++) {
  11634. var hex = Number(aColor[i]).toString(16);
  11635. hex = String(hex).length == 1 ? 0 + '' + hex : hex; // 保证每个rgb的值为2位
  11636. if (hex === "0") {
  11637. hex += hex;
  11638. }
  11639. strHex += hex;
  11640. }
  11641. if (strHex.length !== 7) {
  11642. strHex = _this;
  11643. }
  11644. return strHex;
  11645. } else if (reg.test(_this)) {
  11646. var aNum = _this.replace(/#/, "").split("");
  11647. if (aNum.length === 6) {
  11648. return _this;
  11649. } else if (aNum.length === 3) {
  11650. var numHex = "#";
  11651. for (var _i2 = 0; _i2 < aNum.length; _i2 += 1) {
  11652. numHex += aNum[_i2] + aNum[_i2];
  11653. }
  11654. return numHex;
  11655. }
  11656. } else {
  11657. return _this;
  11658. }
  11659. }
  11660. /**
  11661. * JS颜色十六进制转换为rgb或rgba,返回的格式为 rgba(255,255,255,0.5)字符串
  11662. * sHex为传入的十六进制的色值
  11663. * alpha为rgba的透明度
  11664. */
  11665. function colorToRgba(color) {
  11666. var alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.3;
  11667. color = rgbToHex(color);
  11668. // 十六进制颜色值的正则表达式
  11669. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  11670. /* 16进制颜色转为RGB格式 */
  11671. var sColor = color.toLowerCase();
  11672. if (sColor && reg.test(sColor)) {
  11673. if (sColor.length === 4) {
  11674. var sColorNew = '#';
  11675. for (var i = 1; i < 4; i += 1) {
  11676. sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
  11677. }
  11678. sColor = sColorNew;
  11679. }
  11680. // 处理六位的颜色值
  11681. var sColorChange = [];
  11682. for (var _i3 = 1; _i3 < 7; _i3 += 2) {
  11683. sColorChange.push(parseInt('0x' + sColor.slice(_i3, _i3 + 2)));
  11684. }
  11685. // return sColorChange.join(',')
  11686. return 'rgba(' + sColorChange.join(',') + ',' + alpha + ')';
  11687. } else {
  11688. return sColor;
  11689. }
  11690. }
  11691. var _default = {
  11692. colorGradient: colorGradient,
  11693. hexToRgb: hexToRgb,
  11694. rgbToHex: rgbToHex,
  11695. colorToRgba: colorToRgba
  11696. };
  11697. exports.default = _default;
  11698. /***/ }),
  11699. /***/ 47:
  11700. /*!*******************************************************************!*\
  11701. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/guid.js ***!
  11702. \*******************************************************************/
  11703. /*! no static exports found */
  11704. /***/ (function(module, exports, __webpack_require__) {
  11705. "use strict";
  11706. Object.defineProperty(exports, "__esModule", {
  11707. value: true
  11708. });
  11709. exports.default = void 0;
  11710. /**
  11711. * 本算法来源于简书开源代码,详见:https://www.jianshu.com/p/fdbf293d0a85
  11712. * 全局唯一标识符(uuid,Globally Unique Identifier),也称作 uuid(Universally Unique IDentifier)
  11713. * 一般用于多个组件之间,给它一个唯一的标识符,或者v-for循环的时候,如果使用数组的index可能会导致更新列表出现问题
  11714. * 最可能的情况是左滑删除item或者对某条信息流"不喜欢"并去掉它的时候,会导致组件内的数据可能出现错乱
  11715. * v-for的时候,推荐使用后端返回的id而不是循环的index
  11716. * @param {Number} len uuid的长度
  11717. * @param {Boolean} firstU 将返回的首字母置为"u"
  11718. * @param {Nubmer} radix 生成uuid的基数(意味着返回的字符串都是这个基数),2-二进制,8-八进制,10-十进制,16-十六进制
  11719. */
  11720. function guid() {
  11721. var len = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 32;
  11722. var firstU = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  11723. var radix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  11724. var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
  11725. var uuid = [];
  11726. radix = radix || chars.length;
  11727. if (len) {
  11728. // 如果指定uuid长度,只是取随机的字符,0|x为位运算,能去掉x的小数位,返回整数位
  11729. for (var i = 0; i < len; i++) {
  11730. uuid[i] = chars[0 | Math.random() * radix];
  11731. }
  11732. } else {
  11733. var r;
  11734. // rfc4122标准要求返回的uuid中,某些位为固定的字符
  11735. uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
  11736. uuid[14] = '4';
  11737. for (var _i = 0; _i < 36; _i++) {
  11738. if (!uuid[_i]) {
  11739. r = 0 | Math.random() * 16;
  11740. uuid[_i] = chars[_i == 19 ? r & 0x3 | 0x8 : r];
  11741. }
  11742. }
  11743. }
  11744. // 移除第一个字符,并用u替代,因为第一个字符为数值时,该guuid不能用作id或者class
  11745. if (firstU) {
  11746. uuid.shift();
  11747. return 'u' + uuid.join('');
  11748. } else {
  11749. return uuid.join('');
  11750. }
  11751. }
  11752. var _default = guid;
  11753. exports.default = _default;
  11754. /***/ }),
  11755. /***/ 474:
  11756. /*!*************************************************************************************!*\
  11757. !*** E:/work/mdapp/uni_modules/vk-uview-ui/components/u-parse/libs/MpHtmlParser.js ***!
  11758. \*************************************************************************************/
  11759. /*! no static exports found */
  11760. /***/ (function(module, exports, __webpack_require__) {
  11761. "use strict";
  11762. /* WEBPACK VAR INJECTION */(function(uni) {
  11763. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  11764. Object.defineProperty(exports, "__esModule", {
  11765. value: true
  11766. });
  11767. exports.default = void 0;
  11768. var _config = _interopRequireDefault(__webpack_require__(/*! ./config.js */ 475));
  11769. var _CssHandler = _interopRequireDefault(__webpack_require__(/*! ./CssHandler.js */ 476));
  11770. /**
  11771. * html 解析器
  11772. * @tutorial https://github.com/jin-yufeng/Parser
  11773. * @version 20201029
  11774. * @author JinYufeng
  11775. * @listens MIT
  11776. */
  11777. var blankChar = _config.default.blankChar;
  11778. var windowWidth = uni.getSystemInfoSync().windowWidth;
  11779. var emoji;
  11780. function MpHtmlParser(data) {
  11781. var _this = this;
  11782. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  11783. this.attrs = {};
  11784. this.CssHandler = new _CssHandler.default(options.tagStyle, windowWidth);
  11785. this.data = data;
  11786. this.domain = options.domain;
  11787. this.DOM = [];
  11788. this.i = this.start = this.audioNum = this.imgNum = this.videoNum = 0;
  11789. options.prot = (this.domain || '').includes('://') ? this.domain.split('://')[0] : 'http';
  11790. this.options = options;
  11791. this.state = this.Text;
  11792. this.STACK = [];
  11793. // 工具函数
  11794. this.bubble = function () {
  11795. for (var i = _this.STACK.length, item; item = _this.STACK[--i];) {
  11796. if (_config.default.richOnlyTags[item.name]) return false;
  11797. item.c = 1;
  11798. }
  11799. return true;
  11800. };
  11801. this.decode = function (val, amp) {
  11802. var i = -1,
  11803. j,
  11804. en;
  11805. while (1) {
  11806. if ((i = val.indexOf('&', i + 1)) == -1) break;
  11807. if ((j = val.indexOf(';', i + 2)) == -1) break;
  11808. if (val[i + 1] == '#') {
  11809. en = parseInt((val[i + 2] == 'x' ? '0' : '') + val.substring(i + 2, j));
  11810. if (!isNaN(en)) val = val.substr(0, i) + String.fromCharCode(en) + val.substr(j + 1);
  11811. } else {
  11812. en = val.substring(i + 1, j);
  11813. if (_config.default.entities[en] || en == amp) val = val.substr(0, i) + (_config.default.entities[en] || '&') + val.substr(j + 1);
  11814. }
  11815. }
  11816. return val;
  11817. };
  11818. this.getUrl = function (url) {
  11819. if (url[0] == '/') {
  11820. if (url[1] == '/') url = _this.options.prot + ':' + url;else if (_this.domain) url = _this.domain + url;
  11821. } else if (_this.domain && url.indexOf('data:') != 0 && !url.includes('://')) url = _this.domain + '/' + url;
  11822. return url;
  11823. };
  11824. this.isClose = function () {
  11825. return _this.data[_this.i] == '>' || _this.data[_this.i] == '/' && _this.data[_this.i + 1] == '>';
  11826. };
  11827. this.section = function () {
  11828. return _this.data.substring(_this.start, _this.i);
  11829. };
  11830. this.parent = function () {
  11831. return _this.STACK[_this.STACK.length - 1];
  11832. };
  11833. this.siblings = function () {
  11834. return _this.STACK.length ? _this.parent().children : _this.DOM;
  11835. };
  11836. }
  11837. MpHtmlParser.prototype.parse = function () {
  11838. if (emoji) this.data = emoji.parseEmoji(this.data);
  11839. for (var c; c = this.data[this.i]; this.i++) {
  11840. this.state(c);
  11841. }
  11842. if (this.state == this.Text) this.setText();
  11843. while (this.STACK.length) {
  11844. this.popNode(this.STACK.pop());
  11845. }
  11846. return this.DOM;
  11847. };
  11848. // 设置属性
  11849. MpHtmlParser.prototype.setAttr = function () {
  11850. var name = this.attrName.toLowerCase(),
  11851. val = this.attrVal;
  11852. if (_config.default.boolAttrs[name]) this.attrs[name] = 'T';else if (val) {
  11853. if (name == 'src' || name == 'data-src' && !this.attrs.src) this.attrs.src = this.getUrl(this.decode(val, 'amp'));else if (name == 'href' || name == 'style') this.attrs[name] = this.decode(val, 'amp');else if (name.substr(0, 5) != 'data-') this.attrs[name] = val;
  11854. }
  11855. this.attrVal = '';
  11856. while (blankChar[this.data[this.i]]) {
  11857. this.i++;
  11858. }
  11859. if (this.isClose()) this.setNode();else {
  11860. this.start = this.i;
  11861. this.state = this.AttrName;
  11862. }
  11863. };
  11864. // 设置文本节点
  11865. MpHtmlParser.prototype.setText = function () {
  11866. var back,
  11867. text = this.section();
  11868. if (!text) return;
  11869. text = _config.default.onText && _config.default.onText(text, function () {
  11870. return back = true;
  11871. }) || text;
  11872. if (back) {
  11873. this.data = this.data.substr(0, this.start) + text + this.data.substr(this.i);
  11874. var j = this.start + text.length;
  11875. for (this.i = this.start; this.i < j; this.i++) {
  11876. this.state(this.data[this.i]);
  11877. }
  11878. return;
  11879. }
  11880. if (!this.pre) {
  11881. // 合并空白符
  11882. var flag,
  11883. tmp = [];
  11884. for (var i = text.length, c; c = text[--i];) {
  11885. if (!blankChar[c]) {
  11886. tmp.unshift(c);
  11887. if (!flag) flag = 1;
  11888. } else {
  11889. if (tmp[0] != ' ') tmp.unshift(' ');
  11890. if (c == '\n' && flag == void 0) flag = 0;
  11891. }
  11892. }
  11893. if (flag == 0) return;
  11894. text = tmp.join('');
  11895. }
  11896. this.siblings().push({
  11897. type: 'text',
  11898. text: this.decode(text)
  11899. });
  11900. };
  11901. // 设置元素节点
  11902. MpHtmlParser.prototype.setNode = function () {
  11903. var node = {
  11904. name: this.tagName.toLowerCase(),
  11905. attrs: this.attrs
  11906. },
  11907. close = _config.default.selfClosingTags[node.name];
  11908. if (this.options.nodes.length) node.type = 'node';
  11909. this.attrs = {};
  11910. if (!_config.default.ignoreTags[node.name]) {
  11911. // 处理属性
  11912. var attrs = node.attrs,
  11913. style = this.CssHandler.match(node.name, attrs, node) + (attrs.style || ''),
  11914. styleObj = {};
  11915. if (attrs.id) {
  11916. if (this.options.compress & 1) attrs.id = void 0;else if (this.options.useAnchor) this.bubble();
  11917. }
  11918. if (this.options.compress & 2 && attrs.class) attrs.class = void 0;
  11919. switch (node.name) {
  11920. case 'a':
  11921. case 'ad':
  11922. this.bubble();
  11923. break;
  11924. case 'font':
  11925. if (attrs.color) {
  11926. styleObj['color'] = attrs.color;
  11927. attrs.color = void 0;
  11928. }
  11929. if (attrs.face) {
  11930. styleObj['font-family'] = attrs.face;
  11931. attrs.face = void 0;
  11932. }
  11933. if (attrs.size) {
  11934. var size = parseInt(attrs.size);
  11935. if (size < 1) size = 1;else if (size > 7) size = 7;
  11936. var map = ['xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'];
  11937. styleObj['font-size'] = map[size - 1];
  11938. attrs.size = void 0;
  11939. }
  11940. break;
  11941. case 'embed':
  11942. var src = node.attrs.src || '',
  11943. type = node.attrs.type || '';
  11944. if (type.includes('video') || src.includes('.mp4') || src.includes('.3gp') || src.includes('.m3u8')) node.name = 'video';else if (type.includes('audio') || src.includes('.m4a') || src.includes('.wav') || src.includes('.mp3') || src.includes('.aac')) node.name = 'audio';else break;
  11945. if (node.attrs.autostart) node.attrs.autoplay = 'T';
  11946. node.attrs.controls = 'T';
  11947. case 'video':
  11948. case 'audio':
  11949. if (!attrs.id) attrs.id = node.name + ++this["".concat(node.name, "Num")];else this["".concat(node.name, "Num")]++;
  11950. if (node.name == 'video') {
  11951. if (this.videoNum > 3) node.lazyLoad = 1;
  11952. if (attrs.width) {
  11953. styleObj.width = parseFloat(attrs.width) + (attrs.width.includes('%') ? '%' : 'px');
  11954. attrs.width = void 0;
  11955. }
  11956. if (attrs.height) {
  11957. styleObj.height = parseFloat(attrs.height) + (attrs.height.includes('%') ? '%' : 'px');
  11958. attrs.height = void 0;
  11959. }
  11960. }
  11961. if (!attrs.controls && !attrs.autoplay) attrs.controls = 'T';
  11962. attrs.source = [];
  11963. if (attrs.src) {
  11964. attrs.source.push(attrs.src);
  11965. attrs.src = void 0;
  11966. }
  11967. this.bubble();
  11968. break;
  11969. case 'td':
  11970. case 'th':
  11971. if (attrs.colspan || attrs.rowspan) for (var k = this.STACK.length, item; item = this.STACK[--k];) {
  11972. if (item.name == 'table') {
  11973. item.flag = 1;
  11974. break;
  11975. }
  11976. }
  11977. }
  11978. if (attrs.align) {
  11979. if (node.name == 'table') {
  11980. if (attrs.align == 'center') styleObj['margin-inline-start'] = styleObj['margin-inline-end'] = 'auto';else styleObj['float'] = attrs.align;
  11981. } else styleObj['text-align'] = attrs.align;
  11982. attrs.align = void 0;
  11983. }
  11984. // 压缩 style
  11985. var styles = style.split(';');
  11986. style = '';
  11987. for (var i = 0, len = styles.length; i < len; i++) {
  11988. var info = styles[i].split(':');
  11989. if (info.length < 2) continue;
  11990. var _key = info[0].trim().toLowerCase(),
  11991. _value = info.slice(1).join(':').trim();
  11992. if (_value[0] == '-' || _value.includes('safe')) style += ";".concat(_key, ":").concat(_value);else if (!styleObj[_key] || _value.includes('import') || !styleObj[_key].includes('import')) styleObj[_key] = _value;
  11993. }
  11994. if (node.name == 'img') {
  11995. if (attrs.src && !attrs.ignore) {
  11996. if (this.bubble()) attrs.i = (this.imgNum++).toString();else attrs.ignore = 'T';
  11997. }
  11998. if (attrs.ignore) {
  11999. style += ';-webkit-touch-callout:none';
  12000. styleObj['max-width'] = '100%';
  12001. }
  12002. var width;
  12003. if (styleObj.width) width = styleObj.width;else if (attrs.width) width = attrs.width.includes('%') ? attrs.width : parseFloat(attrs.width) + 'px';
  12004. if (width) {
  12005. styleObj.width = width;
  12006. attrs.width = '100%';
  12007. if (parseInt(width) > windowWidth) {
  12008. styleObj.height = '';
  12009. if (attrs.height) attrs.height = void 0;
  12010. }
  12011. }
  12012. if (styleObj.height) {
  12013. attrs.height = styleObj.height;
  12014. styleObj.height = '';
  12015. } else if (attrs.height && !attrs.height.includes('%')) attrs.height = parseFloat(attrs.height) + 'px';
  12016. }
  12017. for (var key in styleObj) {
  12018. var value = styleObj[key];
  12019. if (!value) continue;
  12020. if (key.includes('flex') || key == 'order' || key == 'self-align') node.c = 1;
  12021. // 填充链接
  12022. if (value.includes('url')) {
  12023. var j = value.indexOf('(');
  12024. if (j++ != -1) {
  12025. while (value[j] == '"' || value[j] == "'" || blankChar[value[j]]) {
  12026. j++;
  12027. }
  12028. value = value.substr(0, j) + this.getUrl(value.substr(j));
  12029. }
  12030. }
  12031. // 转换 rpx
  12032. else if (value.includes('rpx')) value = value.replace(/[0-9.]+\s*rpx/g, function ($) {
  12033. return parseFloat($) * windowWidth / 750 + 'px';
  12034. });else if (key == 'white-space' && value.includes('pre') && !close) this.pre = node.pre = true;
  12035. style += ";".concat(key, ":").concat(value);
  12036. }
  12037. style = style.substr(1);
  12038. if (style) attrs.style = style;
  12039. if (!close) {
  12040. node.children = [];
  12041. if (node.name == 'pre' && _config.default.highlight) {
  12042. this.remove(node);
  12043. this.pre = node.pre = true;
  12044. }
  12045. this.siblings().push(node);
  12046. this.STACK.push(node);
  12047. } else if (!_config.default.filter || _config.default.filter(node, this) != false) this.siblings().push(node);
  12048. } else {
  12049. if (!close) this.remove(node);else if (node.name == 'source') {
  12050. var parent = this.parent();
  12051. if (parent && (parent.name == 'video' || parent.name == 'audio') && node.attrs.src) parent.attrs.source.push(node.attrs.src);
  12052. } else if (node.name == 'base' && !this.domain) this.domain = node.attrs.href;
  12053. }
  12054. if (this.data[this.i] == '/') this.i++;
  12055. this.start = this.i + 1;
  12056. this.state = this.Text;
  12057. };
  12058. // 移除标签
  12059. MpHtmlParser.prototype.remove = function (node) {
  12060. var _this2 = this;
  12061. var name = node.name,
  12062. j = this.i;
  12063. // 处理 svg
  12064. var handleSvg = function handleSvg() {
  12065. var src = _this2.data.substring(j, _this2.i + 1);
  12066. node.attrs.xmlns = 'http://www.w3.org/2000/svg';
  12067. for (var key in node.attrs) {
  12068. if (key == 'viewbox') src = " viewBox=\"".concat(node.attrs.viewbox, "\"") + src;else if (key != 'style') src = " ".concat(key, "=\"").concat(node.attrs[key], "\"") + src;
  12069. }
  12070. src = '<svg' + src;
  12071. var parent = _this2.parent();
  12072. if (node.attrs.width == '100%' && parent && (parent.attrs.style || '').includes('inline')) parent.attrs.style = 'width:300px;max-width:100%;' + parent.attrs.style;
  12073. _this2.siblings().push({
  12074. name: 'img',
  12075. attrs: {
  12076. src: 'data:image/svg+xml;utf8,' + src.replace(/#/g, '%23'),
  12077. style: node.attrs.style,
  12078. ignore: 'T'
  12079. }
  12080. });
  12081. };
  12082. if (node.name == 'svg' && this.data[j] == '/') return handleSvg(this.i++);
  12083. while (1) {
  12084. if ((this.i = this.data.indexOf('</', this.i + 1)) == -1) {
  12085. if (name == 'pre' || name == 'svg') this.i = j;else this.i = this.data.length;
  12086. return;
  12087. }
  12088. this.start = this.i += 2;
  12089. while (!blankChar[this.data[this.i]] && !this.isClose()) {
  12090. this.i++;
  12091. }
  12092. if (this.section().toLowerCase() == name) {
  12093. // 代码块高亮
  12094. if (name == 'pre') {
  12095. this.data = this.data.substr(0, j + 1) + _config.default.highlight(this.data.substring(j + 1, this.i - 5), node.attrs) + this.data.substr(this.i - 5);
  12096. return this.i = j;
  12097. } else if (name == 'style') this.CssHandler.getStyle(this.data.substring(j + 1, this.i - 7));else if (name == 'title') this.DOM.title = this.data.substring(j + 1, this.i - 7);
  12098. if ((this.i = this.data.indexOf('>', this.i)) == -1) this.i = this.data.length;
  12099. if (name == 'svg') handleSvg();
  12100. return;
  12101. }
  12102. }
  12103. };
  12104. // 节点出栈处理
  12105. MpHtmlParser.prototype.popNode = function (node) {
  12106. // 空白符处理
  12107. if (node.pre) {
  12108. node.pre = this.pre = void 0;
  12109. for (var i = this.STACK.length; i--;) {
  12110. if (this.STACK[i].pre) this.pre = true;
  12111. }
  12112. }
  12113. var siblings = this.siblings(),
  12114. len = siblings.length,
  12115. childs = node.children;
  12116. if (node.name == 'head' || _config.default.filter && _config.default.filter(node, this) == false) return siblings.pop();
  12117. var attrs = node.attrs;
  12118. // 替换一些标签名
  12119. if (_config.default.blockTags[node.name]) node.name = 'div';else if (!_config.default.trustTags[node.name]) node.name = 'span';
  12120. // 处理列表
  12121. if (node.c && (node.name == 'ul' || node.name == 'ol')) {
  12122. if ((node.attrs.style || '').includes('list-style:none')) {
  12123. for (var _i = 0, child; child = childs[_i++];) {
  12124. if (child.name == 'li') child.name = 'div';
  12125. }
  12126. } else if (node.name == 'ul') {
  12127. var floor = 1;
  12128. for (var _i2 = this.STACK.length; _i2--;) {
  12129. if (this.STACK[_i2].name == 'ul') floor++;
  12130. }
  12131. if (floor != 1) for (var _i3 = childs.length; _i3--;) {
  12132. childs[_i3].floor = floor;
  12133. }
  12134. } else {
  12135. for (var _i4 = 0, num = 1, _child; _child = childs[_i4++];) {
  12136. if (_child.name == 'li') {
  12137. _child.type = 'ol';
  12138. _child.num = function (num, type) {
  12139. if (type == 'a') return String.fromCharCode(97 + (num - 1) % 26);
  12140. if (type == 'A') return String.fromCharCode(65 + (num - 1) % 26);
  12141. if (type == 'i' || type == 'I') {
  12142. num = (num - 1) % 99 + 1;
  12143. var one = ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX'],
  12144. ten = ['X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC'],
  12145. res = (ten[Math.floor(num / 10) - 1] || '') + (one[num % 10 - 1] || '');
  12146. if (type == 'i') return res.toLowerCase();
  12147. return res;
  12148. }
  12149. return num;
  12150. }(num++, attrs.type) + '.';
  12151. }
  12152. }
  12153. }
  12154. }
  12155. // 处理表格
  12156. if (node.name == 'table') {
  12157. var padding = parseFloat(attrs.cellpadding),
  12158. spacing = parseFloat(attrs.cellspacing),
  12159. border = parseFloat(attrs.border);
  12160. if (node.c) {
  12161. if (isNaN(padding)) padding = 2;
  12162. if (isNaN(spacing)) spacing = 2;
  12163. }
  12164. if (border) attrs.style = "border:".concat(border, "px solid gray;").concat(attrs.style || '');
  12165. if (node.flag && node.c) {
  12166. // 有 colspan 或 rowspan 且含有链接的表格转为 grid 布局实现
  12167. attrs.style = "".concat(attrs.style || '', ";").concat(spacing ? ";grid-gap:".concat(spacing, "px") : ';border-left:0;border-top:0');
  12168. var row = 1,
  12169. col = 1,
  12170. colNum,
  12171. trs = [],
  12172. children = [],
  12173. map = {};
  12174. (function f(ns) {
  12175. for (var i = 0; i < ns.length; i++) {
  12176. if (ns[i].name == 'tr') trs.push(ns[i]);else f(ns[i].children || []);
  12177. }
  12178. })(node.children);
  12179. for (var _i5 = 0; _i5 < trs.length; _i5++) {
  12180. for (var j = 0, td; td = trs[_i5].children[j]; j++) {
  12181. if (td.name == 'td' || td.name == 'th') {
  12182. while (map[row + '.' + col]) {
  12183. col++;
  12184. }
  12185. var cell = {
  12186. name: 'div',
  12187. c: 1,
  12188. attrs: {
  12189. style: (td.attrs.style || '') + (border ? ";border:".concat(border, "px solid gray") + (spacing ? '' : ';border-right:0;border-bottom:0') : '') + (padding ? ";padding:".concat(padding, "px") : '')
  12190. },
  12191. children: td.children
  12192. };
  12193. if (td.attrs.colspan) {
  12194. cell.attrs.style += ';grid-column-start:' + col + ';grid-column-end:' + (col + parseInt(td.attrs.colspan));
  12195. if (!td.attrs.rowspan) cell.attrs.style += ';grid-row-start:' + row + ';grid-row-end:' + (row + 1);
  12196. col += parseInt(td.attrs.colspan) - 1;
  12197. }
  12198. if (td.attrs.rowspan) {
  12199. cell.attrs.style += ';grid-row-start:' + row + ';grid-row-end:' + (row + parseInt(td.attrs.rowspan));
  12200. if (!td.attrs.colspan) cell.attrs.style += ';grid-column-start:' + col + ';grid-column-end:' + (col + 1);
  12201. for (var k = 1; k < td.attrs.rowspan; k++) {
  12202. map[row + k + '.' + col] = 1;
  12203. }
  12204. }
  12205. children.push(cell);
  12206. col++;
  12207. }
  12208. }
  12209. if (!colNum) {
  12210. colNum = col - 1;
  12211. attrs.style += ";grid-template-columns:repeat(".concat(colNum, ",auto)");
  12212. }
  12213. col = 1;
  12214. row++;
  12215. }
  12216. node.children = children;
  12217. } else {
  12218. attrs.style = "border-spacing:".concat(spacing, "px;").concat(attrs.style || '');
  12219. if (border || padding) (function f(ns) {
  12220. for (var i = 0, n; n = ns[i]; i++) {
  12221. if (n.name == 'th' || n.name == 'td') {
  12222. if (border) n.attrs.style = "border:".concat(border, "px solid gray;").concat(n.attrs.style || '');
  12223. if (padding) n.attrs.style = "padding:".concat(padding, "px;").concat(n.attrs.style || '');
  12224. } else f(n.children || []);
  12225. }
  12226. })(childs);
  12227. }
  12228. if (this.options.autoscroll) {
  12229. var table = Object.assign({}, node);
  12230. node.name = 'div';
  12231. node.attrs = {
  12232. style: 'overflow:scroll'
  12233. };
  12234. node.children = [table];
  12235. }
  12236. }
  12237. this.CssHandler.pop && this.CssHandler.pop(node);
  12238. // 自动压缩
  12239. if (node.name == 'div' && !Object.keys(attrs).length && childs.length == 1 && childs[0].name == 'div') siblings[len - 1] = childs[0];
  12240. };
  12241. // 状态机
  12242. MpHtmlParser.prototype.Text = function (c) {
  12243. if (c == '<') {
  12244. var next = this.data[this.i + 1],
  12245. isLetter = function isLetter(c) {
  12246. return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z';
  12247. };
  12248. if (isLetter(next)) {
  12249. this.setText();
  12250. this.start = this.i + 1;
  12251. this.state = this.TagName;
  12252. } else if (next == '/') {
  12253. this.setText();
  12254. if (isLetter(this.data[++this.i + 1])) {
  12255. this.start = this.i + 1;
  12256. this.state = this.EndTag;
  12257. } else this.Comment();
  12258. } else if (next == '!' || next == '?') {
  12259. this.setText();
  12260. this.Comment();
  12261. }
  12262. }
  12263. };
  12264. MpHtmlParser.prototype.Comment = function () {
  12265. var key;
  12266. if (this.data.substring(this.i + 2, this.i + 4) == '--') key = '-->';else if (this.data.substring(this.i + 2, this.i + 9) == '[CDATA[') key = ']]>';else key = '>';
  12267. if ((this.i = this.data.indexOf(key, this.i + 2)) == -1) this.i = this.data.length;else this.i += key.length - 1;
  12268. this.start = this.i + 1;
  12269. this.state = this.Text;
  12270. };
  12271. MpHtmlParser.prototype.TagName = function (c) {
  12272. if (blankChar[c]) {
  12273. this.tagName = this.section();
  12274. while (blankChar[this.data[this.i]]) {
  12275. this.i++;
  12276. }
  12277. if (this.isClose()) this.setNode();else {
  12278. this.start = this.i;
  12279. this.state = this.AttrName;
  12280. }
  12281. } else if (this.isClose()) {
  12282. this.tagName = this.section();
  12283. this.setNode();
  12284. }
  12285. };
  12286. MpHtmlParser.prototype.AttrName = function (c) {
  12287. if (c == '=' || blankChar[c] || this.isClose()) {
  12288. this.attrName = this.section();
  12289. if (blankChar[c]) while (blankChar[this.data[++this.i]]) {
  12290. ;
  12291. }
  12292. if (this.data[this.i] == '=') {
  12293. while (blankChar[this.data[++this.i]]) {
  12294. ;
  12295. }
  12296. this.start = this.i--;
  12297. this.state = this.AttrValue;
  12298. } else this.setAttr();
  12299. }
  12300. };
  12301. MpHtmlParser.prototype.AttrValue = function (c) {
  12302. if (c == '"' || c == "'") {
  12303. this.start++;
  12304. if ((this.i = this.data.indexOf(c, this.i + 1)) == -1) return this.i = this.data.length;
  12305. this.attrVal = this.section();
  12306. this.i++;
  12307. } else {
  12308. for (; !blankChar[this.data[this.i]] && !this.isClose(); this.i++) {
  12309. ;
  12310. }
  12311. this.attrVal = this.section();
  12312. }
  12313. this.setAttr();
  12314. };
  12315. MpHtmlParser.prototype.EndTag = function (c) {
  12316. if (blankChar[c] || c == '>' || c == '/') {
  12317. var name = this.section().toLowerCase();
  12318. for (var i = this.STACK.length; i--;) {
  12319. if (this.STACK[i].name == name) break;
  12320. }
  12321. if (i != -1) {
  12322. var node;
  12323. while ((node = this.STACK.pop()).name != name) {
  12324. this.popNode(node);
  12325. }
  12326. this.popNode(node);
  12327. } else if (name == 'p' || name == 'br') this.siblings().push({
  12328. name: name,
  12329. attrs: {}
  12330. });
  12331. this.i = this.data.indexOf('>', this.i);
  12332. this.start = this.i + 1;
  12333. if (this.i == -1) this.i = this.data.length;else this.state = this.Text;
  12334. }
  12335. };
  12336. var _default = MpHtmlParser;
  12337. exports.default = _default;
  12338. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  12339. /***/ }),
  12340. /***/ 475:
  12341. /*!*******************************************************************************!*\
  12342. !*** E:/work/mdapp/uni_modules/vk-uview-ui/components/u-parse/libs/config.js ***!
  12343. \*******************************************************************************/
  12344. /*! no static exports found */
  12345. /***/ (function(module, exports, __webpack_require__) {
  12346. "use strict";
  12347. /* WEBPACK VAR INJECTION */(function(wx) {
  12348. Object.defineProperty(exports, "__esModule", {
  12349. value: true
  12350. });
  12351. exports.default = void 0;
  12352. /* 配置文件 */
  12353. var cfg = {
  12354. // 出错占位图
  12355. errorImg: null,
  12356. // 过滤器函数
  12357. filter: null,
  12358. // 代码高亮函数
  12359. highlight: null,
  12360. // 文本处理函数
  12361. onText: null,
  12362. // 实体编码列表
  12363. entities: {
  12364. quot: '"',
  12365. apos: "'",
  12366. semi: ';',
  12367. nbsp: '\xA0',
  12368. ensp: "\u2002",
  12369. emsp: "\u2003",
  12370. ndash: '–',
  12371. mdash: '—',
  12372. middot: '·',
  12373. lsquo: '‘',
  12374. rsquo: '’',
  12375. ldquo: '“',
  12376. rdquo: '”',
  12377. bull: '•',
  12378. hellip: '…'
  12379. },
  12380. blankChar: makeMap(' ,\xA0,\t,\r,\n,\f'),
  12381. boolAttrs: makeMap('allowfullscreen,autoplay,autostart,controls,ignore,loop,muted'),
  12382. // 块级标签,将被转为 div
  12383. blockTags: makeMap('address,article,aside,body,caption,center,cite,footer,header,html,nav,pre,section'),
  12384. // 将被移除的标签
  12385. ignoreTags: makeMap('area,base,canvas,frame,iframe,input,link,map,meta,param,script,source,style,svg,textarea,title,track,wbr'),
  12386. // 只能被 rich-text 显示的标签
  12387. richOnlyTags: makeMap('a,colgroup,fieldset,legend'),
  12388. // 自闭合的标签
  12389. selfClosingTags: makeMap('area,base,br,col,circle,ellipse,embed,frame,hr,img,input,line,link,meta,param,path,polygon,rect,source,track,use,wbr'),
  12390. // 信任的标签
  12391. 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'),
  12392. // 默认的标签样式
  12393. userAgentStyles: {
  12394. address: 'font-style:italic',
  12395. big: 'display:inline;font-size:1.2em',
  12396. blockquote: 'background-color:#f6f6f6;border-left:3px solid #dbdbdb;color:#6c6c6c;padding:5px 0 5px 10px',
  12397. caption: 'display:table-caption;text-align:center',
  12398. center: 'text-align:center',
  12399. cite: 'font-style:italic',
  12400. dd: 'margin-left:40px',
  12401. mark: 'background-color:yellow',
  12402. pre: 'font-family:monospace;white-space:pre;overflow:scroll',
  12403. s: 'text-decoration:line-through',
  12404. small: 'display:inline;font-size:0.8em',
  12405. u: 'text-decoration:underline'
  12406. }
  12407. };
  12408. function makeMap(str) {
  12409. var map = Object.create(null),
  12410. list = str.split(',');
  12411. for (var i = list.length; i--;) {
  12412. map[list[i]] = true;
  12413. }
  12414. return map;
  12415. }
  12416. if (wx.canIUse('editor')) {
  12417. cfg.blockTags.pre = void 0;
  12418. cfg.ignoreTags.rp = true;
  12419. Object.assign(cfg.richOnlyTags, makeMap('bdi,bdo,caption,rt,ruby'));
  12420. Object.assign(cfg.trustTags, makeMap('bdi,bdo,caption,pre,rt,ruby'));
  12421. }
  12422. var _default = cfg;
  12423. exports.default = _default;
  12424. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"]))
  12425. /***/ }),
  12426. /***/ 476:
  12427. /*!***********************************************************************************!*\
  12428. !*** E:/work/mdapp/uni_modules/vk-uview-ui/components/u-parse/libs/CssHandler.js ***!
  12429. \***********************************************************************************/
  12430. /*! no static exports found */
  12431. /***/ (function(module, exports, __webpack_require__) {
  12432. "use strict";
  12433. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  12434. Object.defineProperty(exports, "__esModule", {
  12435. value: true
  12436. });
  12437. exports.default = void 0;
  12438. var _config = _interopRequireDefault(__webpack_require__(/*! ./config.js */ 475));
  12439. var isLetter = function isLetter(c) {
  12440. return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z';
  12441. };
  12442. function CssHandler(tagStyle) {
  12443. var styles = Object.assign(Object.create(null), _config.default.userAgentStyles);
  12444. for (var item in tagStyle) {
  12445. styles[item] = (styles[item] ? styles[item] + ';' : '') + tagStyle[item];
  12446. }
  12447. this.styles = styles;
  12448. }
  12449. CssHandler.prototype.getStyle = function (data) {
  12450. this.styles = new parser(data, this.styles).parse();
  12451. };
  12452. CssHandler.prototype.match = function (name, attrs) {
  12453. var tmp,
  12454. matched = (tmp = this.styles[name]) ? tmp + ';' : '';
  12455. if (attrs.class) {
  12456. var items = attrs.class.split(' ');
  12457. for (var i = 0, item; item = items[i]; i++) {
  12458. if (tmp = this.styles['.' + item]) matched += tmp + ';';
  12459. }
  12460. }
  12461. if (tmp = this.styles['#' + attrs.id]) matched += tmp + ';';
  12462. return matched;
  12463. };
  12464. var _default = CssHandler;
  12465. exports.default = _default;
  12466. function parser(data, init) {
  12467. this.data = data;
  12468. this.floor = 0;
  12469. this.i = 0;
  12470. this.list = [];
  12471. this.res = init;
  12472. this.state = this.Space;
  12473. }
  12474. parser.prototype.parse = function () {
  12475. for (var c; c = this.data[this.i]; this.i++) {
  12476. this.state(c);
  12477. }
  12478. return this.res;
  12479. };
  12480. parser.prototype.section = function () {
  12481. return this.data.substring(this.start, this.i);
  12482. };
  12483. // 状态机
  12484. parser.prototype.Space = function (c) {
  12485. if (c == '.' || c == '#' || isLetter(c)) {
  12486. this.start = this.i;
  12487. this.state = this.Name;
  12488. } else if (c == '/' && this.data[this.i + 1] == '*') this.Comment();else if (!_config.default.blankChar[c] && c != ';') this.state = this.Ignore;
  12489. };
  12490. parser.prototype.Comment = function () {
  12491. this.i = this.data.indexOf('*/', this.i) + 1;
  12492. if (!this.i) this.i = this.data.length;
  12493. this.state = this.Space;
  12494. };
  12495. parser.prototype.Ignore = function (c) {
  12496. if (c == '{') this.floor++;else if (c == '}' && ! --this.floor) {
  12497. this.list = [];
  12498. this.state = this.Space;
  12499. }
  12500. };
  12501. parser.prototype.Name = function (c) {
  12502. if (_config.default.blankChar[c]) {
  12503. this.list.push(this.section());
  12504. this.state = this.NameSpace;
  12505. } else if (c == '{') {
  12506. this.list.push(this.section());
  12507. this.Content();
  12508. } else if (c == ',') {
  12509. this.list.push(this.section());
  12510. this.Comma();
  12511. } else if (!isLetter(c) && (c < '0' || c > '9') && c != '-' && c != '_') this.state = this.Ignore;
  12512. };
  12513. parser.prototype.NameSpace = function (c) {
  12514. if (c == '{') this.Content();else if (c == ',') this.Comma();else if (!_config.default.blankChar[c]) this.state = this.Ignore;
  12515. };
  12516. parser.prototype.Comma = function () {
  12517. while (_config.default.blankChar[this.data[++this.i]]) {
  12518. ;
  12519. }
  12520. if (this.data[this.i] == '{') this.Content();else {
  12521. this.start = this.i--;
  12522. this.state = this.Name;
  12523. }
  12524. };
  12525. parser.prototype.Content = function () {
  12526. this.start = ++this.i;
  12527. if ((this.i = this.data.indexOf('}', this.i)) == -1) this.i = this.data.length;
  12528. var content = this.section();
  12529. for (var i = 0, item; item = this.list[i++];) {
  12530. if (this.res[item]) this.res[item] += ';' + content;else this.res[item] = content;
  12531. }
  12532. this.list = [];
  12533. this.state = this.Space;
  12534. };
  12535. /***/ }),
  12536. /***/ 48:
  12537. /*!********************************************************************!*\
  12538. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/color.js ***!
  12539. \********************************************************************/
  12540. /*! no static exports found */
  12541. /***/ (function(module, exports, __webpack_require__) {
  12542. "use strict";
  12543. Object.defineProperty(exports, "__esModule", {
  12544. value: true
  12545. });
  12546. exports.default = void 0;
  12547. // 为了让用户能够自定义主题,会逐步弃用此文件,各颜色通过css提供
  12548. // 为了给某些特殊场景使用和向后兼容,无需删除此文件(2020-06-20)
  12549. var color = {
  12550. primary: "#2979ff",
  12551. primaryDark: "#2b85e4",
  12552. primaryDisabled: "#a0cfff",
  12553. primaryLight: "#ecf5ff",
  12554. bgColor: "#f3f4f6",
  12555. info: "#909399",
  12556. infoDark: "#82848a",
  12557. infoDisabled: "#c8c9cc",
  12558. infoLight: "#f4f4f5",
  12559. warning: "#ff9900",
  12560. warningDark: "#f29100",
  12561. warningDisabled: "#fcbd71",
  12562. warningLight: "#fdf6ec",
  12563. error: "#fa3534",
  12564. errorDark: "#dd6161",
  12565. errorDisabled: "#fab6b6",
  12566. errorLight: "#fef0f0",
  12567. success: "#19be6b",
  12568. successDark: "#18b566",
  12569. successDisabled: "#71d5a1",
  12570. successLight: "#dbf1e1",
  12571. mainColor: "#303133",
  12572. contentColor: "#606266",
  12573. tipsColor: "#909399",
  12574. lightColor: "#c0c4cc",
  12575. borderColor: "#e4e7ed"
  12576. };
  12577. var _default = color;
  12578. exports.default = _default;
  12579. /***/ }),
  12580. /***/ 49:
  12581. /*!************************************************************************!*\
  12582. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/type2icon.js ***!
  12583. \************************************************************************/
  12584. /*! no static exports found */
  12585. /***/ (function(module, exports, __webpack_require__) {
  12586. "use strict";
  12587. Object.defineProperty(exports, "__esModule", {
  12588. value: true
  12589. });
  12590. exports.default = void 0;
  12591. /**
  12592. * 根据主题type值,获取对应的图标
  12593. * @param String type 主题名称,primary|info|error|warning|success
  12594. * @param String fill 是否使用fill填充实体的图标
  12595. */
  12596. function type2icon() {
  12597. var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'success';
  12598. var fill = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  12599. // 如果非预置值,默认为success
  12600. if (['primary', 'info', 'error', 'warning', 'success'].indexOf(type) == -1) type = 'success';
  12601. var iconName = '';
  12602. // 目前(2019-12-12),info和primary使用同一个图标
  12603. switch (type) {
  12604. case 'primary':
  12605. iconName = 'info-circle';
  12606. break;
  12607. case 'info':
  12608. iconName = 'info-circle';
  12609. break;
  12610. case 'error':
  12611. iconName = 'close-circle';
  12612. break;
  12613. case 'warning':
  12614. iconName = 'error-circle';
  12615. break;
  12616. case 'success':
  12617. iconName = 'checkmark-circle';
  12618. break;
  12619. default:
  12620. iconName = 'checkmark-circle';
  12621. }
  12622. // 是否是实体类型,加上-fill,在icon组件库中,实体的类名是后面加-fill的
  12623. if (fill) iconName += '-fill';
  12624. return iconName;
  12625. }
  12626. var _default = type2icon;
  12627. exports.default = _default;
  12628. /***/ }),
  12629. /***/ 5:
  12630. /*!**************************************************************!*\
  12631. !*** ./node_modules/@babel/runtime/helpers/slicedToArray.js ***!
  12632. \**************************************************************/
  12633. /*! no static exports found */
  12634. /***/ (function(module, exports, __webpack_require__) {
  12635. var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ 6);
  12636. var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ 7);
  12637. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  12638. var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ 10);
  12639. function _slicedToArray(arr, i) {
  12640. return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
  12641. }
  12642. module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  12643. /***/ }),
  12644. /***/ 50:
  12645. /*!**************************************************************************!*\
  12646. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/randomArray.js ***!
  12647. \**************************************************************************/
  12648. /*! no static exports found */
  12649. /***/ (function(module, exports, __webpack_require__) {
  12650. "use strict";
  12651. Object.defineProperty(exports, "__esModule", {
  12652. value: true
  12653. });
  12654. exports.default = void 0;
  12655. // 打乱数组
  12656. function randomArray() {
  12657. var array = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  12658. // 原理是sort排序,Math.random()产生0<= x < 1之间的数,会导致x-0.05大于或者小于0
  12659. return array.sort(function () {
  12660. return Math.random() - 0.5;
  12661. });
  12662. }
  12663. var _default = randomArray;
  12664. exports.default = _default;
  12665. /***/ }),
  12666. /***/ 51:
  12667. /*!**********************************************************************!*\
  12668. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/addUnit.js ***!
  12669. \**********************************************************************/
  12670. /*! no static exports found */
  12671. /***/ (function(module, exports, __webpack_require__) {
  12672. "use strict";
  12673. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  12674. Object.defineProperty(exports, "__esModule", {
  12675. value: true
  12676. });
  12677. exports.default = addUnit;
  12678. var _test = _interopRequireDefault(__webpack_require__(/*! ./test.js */ 38));
  12679. // 添加单位,如果有rpx,%,px等单位结尾或者值为auto,直接返回,否则加上rpx单位结尾
  12680. function addUnit() {
  12681. var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'auto';
  12682. var unit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'rpx';
  12683. value = String(value);
  12684. // 用uView内置验证规则中的number判断是否为数值
  12685. return _test.default.number(value) ? "".concat(value).concat(unit) : value;
  12686. }
  12687. /***/ }),
  12688. /***/ 512:
  12689. /*!******************************************************************!*\
  12690. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/util/emitter.js ***!
  12691. \******************************************************************/
  12692. /*! no static exports found */
  12693. /***/ (function(module, exports, __webpack_require__) {
  12694. "use strict";
  12695. Object.defineProperty(exports, "__esModule", {
  12696. value: true
  12697. });
  12698. exports.default = void 0;
  12699. /**
  12700. * 递归使用 call 方式this指向
  12701. * @param componentName // 需要找的组件的名称
  12702. * @param eventName // 事件名称
  12703. * @param params // 需要传递的参数
  12704. */
  12705. function _broadcast(componentName, eventName, params) {
  12706. // 循环子节点找到名称一样的子节点 否则 递归 当前子节点
  12707. var $children;
  12708. $children = this.$children;
  12709. $children.map(function (child) {
  12710. if (componentName === child.$options.name) {
  12711. child.$emit.apply(child, [eventName].concat(params));
  12712. } else {
  12713. _broadcast.apply(child, [componentName, eventName].concat(params));
  12714. }
  12715. });
  12716. }
  12717. var _default = {
  12718. methods: {
  12719. /**
  12720. * 派发 (向上查找) (一个)
  12721. * @param componentName // 需要找的组件的名称
  12722. * @param eventName // 事件名称
  12723. * @param params // 需要传递的参数
  12724. */
  12725. dispatch: function dispatch(componentName, eventName, params) {
  12726. var parent = this.$parent || this.$root; //$parent 找到最近的父节点 $root 根节点
  12727. var name = parent.$options.name; // 获取当前组件实例的name
  12728. // 如果当前有节点 && 当前没名称 且 当前名称等于需要传进来的名称的时候就去查找当前的节点
  12729. // 循环出当前名称的一样的组件实例
  12730. while (parent && (!name || name !== componentName)) {
  12731. parent = parent.$parent;
  12732. if (parent) {
  12733. name = parent.$options.name;
  12734. }
  12735. }
  12736. // 有节点表示当前找到了name一样的实例
  12737. if (parent) {
  12738. parent.$emit.apply(parent, [eventName].concat(params));
  12739. }
  12740. },
  12741. /**
  12742. * 广播 (向下查找) (广播多个)
  12743. * @param componentName // 需要找的组件的名称
  12744. * @param eventName // 事件名称
  12745. * @param params // 需要传递的参数
  12746. */
  12747. broadcast: function broadcast(componentName, eventName, params) {
  12748. _broadcast.call(this, componentName, eventName, params);
  12749. }
  12750. }
  12751. };
  12752. exports.default = _default;
  12753. /***/ }),
  12754. /***/ 513:
  12755. /*!**************************************************************************!*\
  12756. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/util/async-validator.js ***!
  12757. \**************************************************************************/
  12758. /*! no static exports found */
  12759. /***/ (function(module, exports, __webpack_require__) {
  12760. "use strict";
  12761. /* WEBPACK VAR INJECTION */(function(process) {
  12762. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  12763. Object.defineProperty(exports, "__esModule", {
  12764. value: true
  12765. });
  12766. exports.default = void 0;
  12767. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  12768. function _extends() {
  12769. _extends = Object.assign || function (target) {
  12770. for (var i = 1; i < arguments.length; i++) {
  12771. var source = arguments[i];
  12772. for (var key in source) {
  12773. if (Object.prototype.hasOwnProperty.call(source, key)) {
  12774. target[key] = source[key];
  12775. }
  12776. }
  12777. }
  12778. return target;
  12779. };
  12780. return _extends.apply(this, arguments);
  12781. }
  12782. /* eslint no-console:0 */
  12783. var formatRegExp = /%[sdj%]/g;
  12784. var warning = function warning() {}; // don't print warning message when in production env or node runtime
  12785. if (typeof process !== 'undefined' && Object({"NODE_ENV":"development","VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"房票科技","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}) && "development" !== 'production' && typeof window !== 'undefined' && typeof document !== 'undefined') {
  12786. warning = function warning(type, errors) {
  12787. if (typeof console !== 'undefined' && console.warn) {
  12788. if (errors.every(function (e) {
  12789. return typeof e === 'string';
  12790. })) {
  12791. console.warn(type, errors);
  12792. }
  12793. }
  12794. };
  12795. }
  12796. function convertFieldsError(errors) {
  12797. if (!errors || !errors.length) return null;
  12798. var fields = {};
  12799. errors.forEach(function (error) {
  12800. var field = error.field;
  12801. fields[field] = fields[field] || [];
  12802. fields[field].push(error);
  12803. });
  12804. return fields;
  12805. }
  12806. function format() {
  12807. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  12808. args[_key] = arguments[_key];
  12809. }
  12810. var i = 1;
  12811. var f = args[0];
  12812. var len = args.length;
  12813. if (typeof f === 'function') {
  12814. return f.apply(null, args.slice(1));
  12815. }
  12816. if (typeof f === 'string') {
  12817. var str = String(f).replace(formatRegExp, function (x) {
  12818. if (x === '%%') {
  12819. return '%';
  12820. }
  12821. if (i >= len) {
  12822. return x;
  12823. }
  12824. switch (x) {
  12825. case '%s':
  12826. return String(args[i++]);
  12827. case '%d':
  12828. return Number(args[i++]);
  12829. case '%j':
  12830. try {
  12831. return JSON.stringify(args[i++]);
  12832. } catch (_) {
  12833. return '[Circular]';
  12834. }
  12835. break;
  12836. default:
  12837. return x;
  12838. }
  12839. });
  12840. for (var arg = args[i]; i < len; arg = args[++i]) {
  12841. str += " " + arg;
  12842. }
  12843. return str;
  12844. }
  12845. return f;
  12846. }
  12847. function isNativeStringType(type) {
  12848. return type === 'string' || type === 'url' || type === 'hex' || type === 'email' || type === 'pattern';
  12849. }
  12850. function isEmptyValue(value, type) {
  12851. if (value === undefined || value === null) {
  12852. return true;
  12853. }
  12854. if (type === 'array' && Array.isArray(value) && !value.length) {
  12855. return true;
  12856. }
  12857. if (isNativeStringType(type) && typeof value === 'string' && !value) {
  12858. return true;
  12859. }
  12860. return false;
  12861. }
  12862. function asyncParallelArray(arr, func, callback) {
  12863. var results = [];
  12864. var total = 0;
  12865. var arrLength = arr.length;
  12866. function count(errors) {
  12867. results.push.apply(results, errors);
  12868. total++;
  12869. if (total === arrLength) {
  12870. callback(results);
  12871. }
  12872. }
  12873. arr.forEach(function (a) {
  12874. func(a, count);
  12875. });
  12876. }
  12877. function asyncSerialArray(arr, func, callback) {
  12878. var index = 0;
  12879. var arrLength = arr.length;
  12880. function next(errors) {
  12881. if (errors && errors.length) {
  12882. callback(errors);
  12883. return;
  12884. }
  12885. var original = index;
  12886. index = index + 1;
  12887. if (original < arrLength) {
  12888. func(arr[original], next);
  12889. } else {
  12890. callback([]);
  12891. }
  12892. }
  12893. next([]);
  12894. }
  12895. function flattenObjArr(objArr) {
  12896. var ret = [];
  12897. Object.keys(objArr).forEach(function (k) {
  12898. ret.push.apply(ret, objArr[k]);
  12899. });
  12900. return ret;
  12901. }
  12902. function asyncMap(objArr, option, func, callback) {
  12903. if (option.first) {
  12904. var _pending = new Promise(function (resolve, reject) {
  12905. var next = function next(errors) {
  12906. callback(errors);
  12907. return errors.length ? reject({
  12908. errors: errors,
  12909. fields: convertFieldsError(errors)
  12910. }) : resolve();
  12911. };
  12912. var flattenArr = flattenObjArr(objArr);
  12913. asyncSerialArray(flattenArr, func, next);
  12914. });
  12915. _pending["catch"](function (e) {
  12916. return e;
  12917. });
  12918. return _pending;
  12919. }
  12920. var firstFields = option.firstFields || [];
  12921. if (firstFields === true) {
  12922. firstFields = Object.keys(objArr);
  12923. }
  12924. var objArrKeys = Object.keys(objArr);
  12925. var objArrLength = objArrKeys.length;
  12926. var total = 0;
  12927. var results = [];
  12928. var pending = new Promise(function (resolve, reject) {
  12929. var next = function next(errors) {
  12930. results.push.apply(results, errors);
  12931. total++;
  12932. if (total === objArrLength) {
  12933. callback(results);
  12934. return results.length ? reject({
  12935. errors: results,
  12936. fields: convertFieldsError(results)
  12937. }) : resolve();
  12938. }
  12939. };
  12940. if (!objArrKeys.length) {
  12941. callback(results);
  12942. resolve();
  12943. }
  12944. objArrKeys.forEach(function (key) {
  12945. var arr = objArr[key];
  12946. if (firstFields.indexOf(key) !== -1) {
  12947. asyncSerialArray(arr, func, next);
  12948. } else {
  12949. asyncParallelArray(arr, func, next);
  12950. }
  12951. });
  12952. });
  12953. pending["catch"](function (e) {
  12954. return e;
  12955. });
  12956. return pending;
  12957. }
  12958. function complementError(rule) {
  12959. return function (oe) {
  12960. if (oe && oe.message) {
  12961. oe.field = oe.field || rule.fullField;
  12962. return oe;
  12963. }
  12964. return {
  12965. message: typeof oe === 'function' ? oe() : oe,
  12966. field: oe.field || rule.fullField
  12967. };
  12968. };
  12969. }
  12970. function deepMerge(target, source) {
  12971. if (source) {
  12972. for (var s in source) {
  12973. if (source.hasOwnProperty(s)) {
  12974. var value = source[s];
  12975. if ((0, _typeof2.default)(value) === 'object' && (0, _typeof2.default)(target[s]) === 'object') {
  12976. target[s] = _extends({}, target[s], {}, value);
  12977. } else {
  12978. target[s] = value;
  12979. }
  12980. }
  12981. }
  12982. }
  12983. return target;
  12984. }
  12985. /**
  12986. * Rule for validating required fields.
  12987. *
  12988. * @param rule The validation rule.
  12989. * @param value The value of the field on the source object.
  12990. * @param source The source object being validated.
  12991. * @param errors An array of errors that this rule may add
  12992. * validation errors to.
  12993. * @param options The validation options.
  12994. * @param options.messages The validation messages.
  12995. */
  12996. function required(rule, value, source, errors, options, type) {
  12997. if (rule.required && (!source.hasOwnProperty(rule.field) || isEmptyValue(value, type || rule.type))) {
  12998. errors.push(format(options.messages.required, rule.fullField));
  12999. }
  13000. }
  13001. /**
  13002. * Rule for validating whitespace.
  13003. *
  13004. * @param rule The validation rule.
  13005. * @param value The value of the field on the source object.
  13006. * @param source The source object being validated.
  13007. * @param errors An array of errors that this rule may add
  13008. * validation errors to.
  13009. * @param options The validation options.
  13010. * @param options.messages The validation messages.
  13011. */
  13012. function whitespace(rule, value, source, errors, options) {
  13013. if (/^\s+$/.test(value) || value === '') {
  13014. errors.push(format(options.messages.whitespace, rule.fullField));
  13015. }
  13016. }
  13017. /* eslint max-len:0 */
  13018. var pattern = {
  13019. // http://emailregex.com/
  13020. 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,}))$/,
  13021. url: new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$", 'i'),
  13022. hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i
  13023. };
  13024. var types = {
  13025. integer: function integer(value) {
  13026. return types.number(value) && parseInt(value, 10) === value;
  13027. },
  13028. "float": function float(value) {
  13029. return types.number(value) && !types.integer(value);
  13030. },
  13031. array: function array(value) {
  13032. return Array.isArray(value);
  13033. },
  13034. regexp: function regexp(value) {
  13035. if (value instanceof RegExp) {
  13036. return true;
  13037. }
  13038. try {
  13039. return !!new RegExp(value);
  13040. } catch (e) {
  13041. return false;
  13042. }
  13043. },
  13044. date: function date(value) {
  13045. return typeof value.getTime === 'function' && typeof value.getMonth === 'function' && typeof value.getYear === 'function';
  13046. },
  13047. number: function number(value) {
  13048. if (isNaN(value)) {
  13049. return false;
  13050. }
  13051. // 修改源码,将字符串数值先转为数值
  13052. return typeof +value === 'number';
  13053. },
  13054. object: function object(value) {
  13055. return (0, _typeof2.default)(value) === 'object' && !types.array(value);
  13056. },
  13057. method: function method(value) {
  13058. return typeof value === 'function';
  13059. },
  13060. email: function email(value) {
  13061. return typeof value === 'string' && !!value.match(pattern.email) && value.length < 255;
  13062. },
  13063. url: function url(value) {
  13064. return typeof value === 'string' && !!value.match(pattern.url);
  13065. },
  13066. hex: function hex(value) {
  13067. return typeof value === 'string' && !!value.match(pattern.hex);
  13068. }
  13069. };
  13070. /**
  13071. * Rule for validating the type of a value.
  13072. *
  13073. * @param rule The validation rule.
  13074. * @param value The value of the field on the source object.
  13075. * @param source The source object being validated.
  13076. * @param errors An array of errors that this rule may add
  13077. * validation errors to.
  13078. * @param options The validation options.
  13079. * @param options.messages The validation messages.
  13080. */
  13081. function type(rule, value, source, errors, options) {
  13082. if (rule.required && value === undefined) {
  13083. required(rule, value, source, errors, options);
  13084. return;
  13085. }
  13086. var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];
  13087. var ruleType = rule.type;
  13088. if (custom.indexOf(ruleType) > -1) {
  13089. if (!types[ruleType](value)) {
  13090. errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
  13091. } // straight typeof check
  13092. } else if (ruleType && (0, _typeof2.default)(value) !== rule.type) {
  13093. errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
  13094. }
  13095. }
  13096. /**
  13097. * Rule for validating minimum and maximum allowed values.
  13098. *
  13099. * @param rule The validation rule.
  13100. * @param value The value of the field on the source object.
  13101. * @param source The source object being validated.
  13102. * @param errors An array of errors that this rule may add
  13103. * validation errors to.
  13104. * @param options The validation options.
  13105. * @param options.messages The validation messages.
  13106. */
  13107. function range(rule, value, source, errors, options) {
  13108. var len = typeof rule.len === 'number';
  13109. var min = typeof rule.min === 'number';
  13110. var max = typeof rule.max === 'number'; // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)
  13111. var spRegexp = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
  13112. var val = value;
  13113. var key = null;
  13114. var num = typeof value === 'number';
  13115. var str = typeof value === 'string';
  13116. var arr = Array.isArray(value);
  13117. if (num) {
  13118. key = 'number';
  13119. } else if (str) {
  13120. key = 'string';
  13121. } else if (arr) {
  13122. key = 'array';
  13123. } // if the value is not of a supported type for range validation
  13124. // the validation rule rule should use the
  13125. // type property to also test for a particular type
  13126. if (!key) {
  13127. return false;
  13128. }
  13129. if (arr) {
  13130. val = value.length;
  13131. }
  13132. if (str) {
  13133. // 处理码点大于U+010000的文字length属性不准确的bug,如"𠮷𠮷𠮷".lenght !== 3
  13134. val = value.replace(spRegexp, '_').length;
  13135. }
  13136. if (len) {
  13137. if (val !== rule.len) {
  13138. errors.push(format(options.messages[key].len, rule.fullField, rule.len));
  13139. }
  13140. } else if (min && !max && val < rule.min) {
  13141. errors.push(format(options.messages[key].min, rule.fullField, rule.min));
  13142. } else if (max && !min && val > rule.max) {
  13143. errors.push(format(options.messages[key].max, rule.fullField, rule.max));
  13144. } else if (min && max && (val < rule.min || val > rule.max)) {
  13145. errors.push(format(options.messages[key].range, rule.fullField, rule.min, rule.max));
  13146. }
  13147. }
  13148. var ENUM = 'enum';
  13149. /**
  13150. * Rule for validating a value exists in an enumerable list.
  13151. *
  13152. * @param rule The validation rule.
  13153. * @param value The value of the field on the source object.
  13154. * @param source The source object being validated.
  13155. * @param errors An array of errors that this rule may add
  13156. * validation errors to.
  13157. * @param options The validation options.
  13158. * @param options.messages The validation messages.
  13159. */
  13160. function enumerable(rule, value, source, errors, options) {
  13161. rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];
  13162. if (rule[ENUM].indexOf(value) === -1) {
  13163. errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));
  13164. }
  13165. }
  13166. /**
  13167. * Rule for validating a regular expression pattern.
  13168. *
  13169. * @param rule The validation rule.
  13170. * @param value The value of the field on the source object.
  13171. * @param source The source object being validated.
  13172. * @param errors An array of errors that this rule may add
  13173. * validation errors to.
  13174. * @param options The validation options.
  13175. * @param options.messages The validation messages.
  13176. */
  13177. function pattern$1(rule, value, source, errors, options) {
  13178. if (rule.pattern) {
  13179. if (rule.pattern instanceof RegExp) {
  13180. // if a RegExp instance is passed, reset `lastIndex` in case its `global`
  13181. // flag is accidentally set to `true`, which in a validation scenario
  13182. // is not necessary and the result might be misleading
  13183. rule.pattern.lastIndex = 0;
  13184. if (!rule.pattern.test(value)) {
  13185. errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
  13186. }
  13187. } else if (typeof rule.pattern === 'string') {
  13188. var _pattern = new RegExp(rule.pattern);
  13189. if (!_pattern.test(value)) {
  13190. errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
  13191. }
  13192. }
  13193. }
  13194. }
  13195. var rules = {
  13196. required: required,
  13197. whitespace: whitespace,
  13198. type: type,
  13199. range: range,
  13200. "enum": enumerable,
  13201. pattern: pattern$1
  13202. };
  13203. /**
  13204. * Performs validation for string types.
  13205. *
  13206. * @param rule The validation rule.
  13207. * @param value The value of the field on the source object.
  13208. * @param callback The callback function.
  13209. * @param source The source object being validated.
  13210. * @param options The validation options.
  13211. * @param options.messages The validation messages.
  13212. */
  13213. function string(rule, value, callback, source, options) {
  13214. var errors = [];
  13215. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  13216. if (validate) {
  13217. if (isEmptyValue(value, 'string') && !rule.required) {
  13218. return callback();
  13219. }
  13220. rules.required(rule, value, source, errors, options, 'string');
  13221. if (!isEmptyValue(value, 'string')) {
  13222. rules.type(rule, value, source, errors, options);
  13223. rules.range(rule, value, source, errors, options);
  13224. rules.pattern(rule, value, source, errors, options);
  13225. if (rule.whitespace === true) {
  13226. rules.whitespace(rule, value, source, errors, options);
  13227. }
  13228. }
  13229. }
  13230. callback(errors);
  13231. }
  13232. /**
  13233. * Validates a function.
  13234. *
  13235. * @param rule The validation rule.
  13236. * @param value The value of the field on the source object.
  13237. * @param callback The callback function.
  13238. * @param source The source object being validated.
  13239. * @param options The validation options.
  13240. * @param options.messages The validation messages.
  13241. */
  13242. function method(rule, value, callback, source, options) {
  13243. var errors = [];
  13244. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  13245. if (validate) {
  13246. if (isEmptyValue(value) && !rule.required) {
  13247. return callback();
  13248. }
  13249. rules.required(rule, value, source, errors, options);
  13250. if (value !== undefined) {
  13251. rules.type(rule, value, source, errors, options);
  13252. }
  13253. }
  13254. callback(errors);
  13255. }
  13256. /**
  13257. * Validates a number.
  13258. *
  13259. * @param rule The validation rule.
  13260. * @param value The value of the field on the source object.
  13261. * @param callback The callback function.
  13262. * @param source The source object being validated.
  13263. * @param options The validation options.
  13264. * @param options.messages The validation messages.
  13265. */
  13266. function number(rule, value, callback, source, options) {
  13267. var errors = [];
  13268. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  13269. if (validate) {
  13270. if (value === '') {
  13271. value = undefined;
  13272. }
  13273. if (isEmptyValue(value) && !rule.required) {
  13274. return callback();
  13275. }
  13276. rules.required(rule, value, source, errors, options);
  13277. if (value !== undefined) {
  13278. rules.type(rule, value, source, errors, options);
  13279. rules.range(rule, value, source, errors, options);
  13280. }
  13281. }
  13282. callback(errors);
  13283. }
  13284. /**
  13285. * Validates a boolean.
  13286. *
  13287. * @param rule The validation rule.
  13288. * @param value The value of the field on the source object.
  13289. * @param callback The callback function.
  13290. * @param source The source object being validated.
  13291. * @param options The validation options.
  13292. * @param options.messages The validation messages.
  13293. */
  13294. function _boolean(rule, value, callback, source, options) {
  13295. var errors = [];
  13296. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  13297. if (validate) {
  13298. if (isEmptyValue(value) && !rule.required) {
  13299. return callback();
  13300. }
  13301. rules.required(rule, value, source, errors, options);
  13302. if (value !== undefined) {
  13303. rules.type(rule, value, source, errors, options);
  13304. }
  13305. }
  13306. callback(errors);
  13307. }
  13308. /**
  13309. * Validates the regular expression type.
  13310. *
  13311. * @param rule The validation rule.
  13312. * @param value The value of the field on the source object.
  13313. * @param callback The callback function.
  13314. * @param source The source object being validated.
  13315. * @param options The validation options.
  13316. * @param options.messages The validation messages.
  13317. */
  13318. function regexp(rule, value, callback, source, options) {
  13319. var errors = [];
  13320. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  13321. if (validate) {
  13322. if (isEmptyValue(value) && !rule.required) {
  13323. return callback();
  13324. }
  13325. rules.required(rule, value, source, errors, options);
  13326. if (!isEmptyValue(value)) {
  13327. rules.type(rule, value, source, errors, options);
  13328. }
  13329. }
  13330. callback(errors);
  13331. }
  13332. /**
  13333. * Validates a number is an integer.
  13334. *
  13335. * @param rule The validation rule.
  13336. * @param value The value of the field on the source object.
  13337. * @param callback The callback function.
  13338. * @param source The source object being validated.
  13339. * @param options The validation options.
  13340. * @param options.messages The validation messages.
  13341. */
  13342. function integer(rule, value, callback, source, options) {
  13343. var errors = [];
  13344. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  13345. if (validate) {
  13346. if (isEmptyValue(value) && !rule.required) {
  13347. return callback();
  13348. }
  13349. rules.required(rule, value, source, errors, options);
  13350. if (value !== undefined) {
  13351. rules.type(rule, value, source, errors, options);
  13352. rules.range(rule, value, source, errors, options);
  13353. }
  13354. }
  13355. callback(errors);
  13356. }
  13357. /**
  13358. * Validates a number is a floating point number.
  13359. *
  13360. * @param rule The validation rule.
  13361. * @param value The value of the field on the source object.
  13362. * @param callback The callback function.
  13363. * @param source The source object being validated.
  13364. * @param options The validation options.
  13365. * @param options.messages The validation messages.
  13366. */
  13367. function floatFn(rule, value, callback, source, options) {
  13368. var errors = [];
  13369. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  13370. if (validate) {
  13371. if (isEmptyValue(value) && !rule.required) {
  13372. return callback();
  13373. }
  13374. rules.required(rule, value, source, errors, options);
  13375. if (value !== undefined) {
  13376. rules.type(rule, value, source, errors, options);
  13377. rules.range(rule, value, source, errors, options);
  13378. }
  13379. }
  13380. callback(errors);
  13381. }
  13382. /**
  13383. * Validates an array.
  13384. *
  13385. * @param rule The validation rule.
  13386. * @param value The value of the field on the source object.
  13387. * @param callback The callback function.
  13388. * @param source The source object being validated.
  13389. * @param options The validation options.
  13390. * @param options.messages The validation messages.
  13391. */
  13392. function array(rule, value, callback, source, options) {
  13393. var errors = [];
  13394. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  13395. if (validate) {
  13396. if (isEmptyValue(value, 'array') && !rule.required) {
  13397. return callback();
  13398. }
  13399. rules.required(rule, value, source, errors, options, 'array');
  13400. if (!isEmptyValue(value, 'array')) {
  13401. rules.type(rule, value, source, errors, options);
  13402. rules.range(rule, value, source, errors, options);
  13403. }
  13404. }
  13405. callback(errors);
  13406. }
  13407. /**
  13408. * Validates an object.
  13409. *
  13410. * @param rule The validation rule.
  13411. * @param value The value of the field on the source object.
  13412. * @param callback The callback function.
  13413. * @param source The source object being validated.
  13414. * @param options The validation options.
  13415. * @param options.messages The validation messages.
  13416. */
  13417. function object(rule, value, callback, source, options) {
  13418. var errors = [];
  13419. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  13420. if (validate) {
  13421. if (isEmptyValue(value) && !rule.required) {
  13422. return callback();
  13423. }
  13424. rules.required(rule, value, source, errors, options);
  13425. if (value !== undefined) {
  13426. rules.type(rule, value, source, errors, options);
  13427. }
  13428. }
  13429. callback(errors);
  13430. }
  13431. var ENUM$1 = 'enum';
  13432. /**
  13433. * Validates an enumerable list.
  13434. *
  13435. * @param rule The validation rule.
  13436. * @param value The value of the field on the source object.
  13437. * @param callback The callback function.
  13438. * @param source The source object being validated.
  13439. * @param options The validation options.
  13440. * @param options.messages The validation messages.
  13441. */
  13442. function enumerable$1(rule, value, callback, source, options) {
  13443. var errors = [];
  13444. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  13445. if (validate) {
  13446. if (isEmptyValue(value) && !rule.required) {
  13447. return callback();
  13448. }
  13449. rules.required(rule, value, source, errors, options);
  13450. if (value !== undefined) {
  13451. rules[ENUM$1](rule, value, source, errors, options);
  13452. }
  13453. }
  13454. callback(errors);
  13455. }
  13456. /**
  13457. * Validates a regular expression pattern.
  13458. *
  13459. * Performs validation when a rule only contains
  13460. * a pattern property but is not declared as a string type.
  13461. *
  13462. * @param rule The validation rule.
  13463. * @param value The value of the field on the source object.
  13464. * @param callback The callback function.
  13465. * @param source The source object being validated.
  13466. * @param options The validation options.
  13467. * @param options.messages The validation messages.
  13468. */
  13469. function pattern$2(rule, value, callback, source, options) {
  13470. var errors = [];
  13471. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  13472. if (validate) {
  13473. if (isEmptyValue(value, 'string') && !rule.required) {
  13474. return callback();
  13475. }
  13476. rules.required(rule, value, source, errors, options);
  13477. if (!isEmptyValue(value, 'string')) {
  13478. rules.pattern(rule, value, source, errors, options);
  13479. }
  13480. }
  13481. callback(errors);
  13482. }
  13483. function date(rule, value, callback, source, options) {
  13484. var errors = [];
  13485. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  13486. if (validate) {
  13487. if (isEmptyValue(value) && !rule.required) {
  13488. return callback();
  13489. }
  13490. rules.required(rule, value, source, errors, options);
  13491. if (!isEmptyValue(value)) {
  13492. var dateObject;
  13493. if (typeof value === 'number') {
  13494. dateObject = new Date(value);
  13495. } else {
  13496. dateObject = value;
  13497. }
  13498. rules.type(rule, dateObject, source, errors, options);
  13499. if (dateObject) {
  13500. rules.range(rule, dateObject.getTime(), source, errors, options);
  13501. }
  13502. }
  13503. }
  13504. callback(errors);
  13505. }
  13506. function required$1(rule, value, callback, source, options) {
  13507. var errors = [];
  13508. var type = Array.isArray(value) ? 'array' : (0, _typeof2.default)(value);
  13509. rules.required(rule, value, source, errors, options, type);
  13510. callback(errors);
  13511. }
  13512. function type$1(rule, value, callback, source, options) {
  13513. var ruleType = rule.type;
  13514. var errors = [];
  13515. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  13516. if (validate) {
  13517. if (isEmptyValue(value, ruleType) && !rule.required) {
  13518. return callback();
  13519. }
  13520. rules.required(rule, value, source, errors, options, ruleType);
  13521. if (!isEmptyValue(value, ruleType)) {
  13522. rules.type(rule, value, source, errors, options);
  13523. }
  13524. }
  13525. callback(errors);
  13526. }
  13527. /**
  13528. * Performs validation for any type.
  13529. *
  13530. * @param rule The validation rule.
  13531. * @param value The value of the field on the source object.
  13532. * @param callback The callback function.
  13533. * @param source The source object being validated.
  13534. * @param options The validation options.
  13535. * @param options.messages The validation messages.
  13536. */
  13537. function any(rule, value, callback, source, options) {
  13538. var errors = [];
  13539. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  13540. if (validate) {
  13541. if (isEmptyValue(value) && !rule.required) {
  13542. return callback();
  13543. }
  13544. rules.required(rule, value, source, errors, options);
  13545. }
  13546. callback(errors);
  13547. }
  13548. var validators = {
  13549. string: string,
  13550. method: method,
  13551. number: number,
  13552. "boolean": _boolean,
  13553. regexp: regexp,
  13554. integer: integer,
  13555. "float": floatFn,
  13556. array: array,
  13557. object: object,
  13558. "enum": enumerable$1,
  13559. pattern: pattern$2,
  13560. date: date,
  13561. url: type$1,
  13562. hex: type$1,
  13563. email: type$1,
  13564. required: required$1,
  13565. any: any
  13566. };
  13567. function newMessages() {
  13568. return {
  13569. "default": 'Validation error on field %s',
  13570. required: '%s is required',
  13571. "enum": '%s must be one of %s',
  13572. whitespace: '%s cannot be empty',
  13573. date: {
  13574. format: '%s date %s is invalid for format %s',
  13575. parse: '%s date could not be parsed, %s is invalid ',
  13576. invalid: '%s date %s is invalid'
  13577. },
  13578. types: {
  13579. string: '%s is not a %s',
  13580. method: '%s is not a %s (function)',
  13581. array: '%s is not an %s',
  13582. object: '%s is not an %s',
  13583. number: '%s is not a %s',
  13584. date: '%s is not a %s',
  13585. "boolean": '%s is not a %s',
  13586. integer: '%s is not an %s',
  13587. "float": '%s is not a %s',
  13588. regexp: '%s is not a valid %s',
  13589. email: '%s is not a valid %s',
  13590. url: '%s is not a valid %s',
  13591. hex: '%s is not a valid %s'
  13592. },
  13593. string: {
  13594. len: '%s must be exactly %s characters',
  13595. min: '%s must be at least %s characters',
  13596. max: '%s cannot be longer than %s characters',
  13597. range: '%s must be between %s and %s characters'
  13598. },
  13599. number: {
  13600. len: '%s must equal %s',
  13601. min: '%s cannot be less than %s',
  13602. max: '%s cannot be greater than %s',
  13603. range: '%s must be between %s and %s'
  13604. },
  13605. array: {
  13606. len: '%s must be exactly %s in length',
  13607. min: '%s cannot be less than %s in length',
  13608. max: '%s cannot be greater than %s in length',
  13609. range: '%s must be between %s and %s in length'
  13610. },
  13611. pattern: {
  13612. mismatch: '%s value %s does not match pattern %s'
  13613. },
  13614. clone: function clone() {
  13615. var cloned = JSON.parse(JSON.stringify(this));
  13616. cloned.clone = this.clone;
  13617. return cloned;
  13618. }
  13619. };
  13620. }
  13621. var messages = newMessages();
  13622. /**
  13623. * Encapsulates a validation schema.
  13624. *
  13625. * @param descriptor An object declaring validation rules
  13626. * for this schema.
  13627. */
  13628. function Schema(descriptor) {
  13629. this.rules = null;
  13630. this._messages = messages;
  13631. this.define(descriptor);
  13632. }
  13633. Schema.prototype = {
  13634. messages: function messages(_messages) {
  13635. if (_messages) {
  13636. this._messages = deepMerge(newMessages(), _messages);
  13637. }
  13638. return this._messages;
  13639. },
  13640. define: function define(rules) {
  13641. if (!rules) {
  13642. throw new Error('Cannot configure a schema with no rules');
  13643. }
  13644. if ((0, _typeof2.default)(rules) !== 'object' || Array.isArray(rules)) {
  13645. throw new Error('Rules must be an object');
  13646. }
  13647. this.rules = {};
  13648. var z;
  13649. var item;
  13650. for (z in rules) {
  13651. if (rules.hasOwnProperty(z)) {
  13652. item = rules[z];
  13653. this.rules[z] = Array.isArray(item) ? item : [item];
  13654. }
  13655. }
  13656. },
  13657. validate: function validate(source_, o, oc) {
  13658. var _this = this;
  13659. if (o === void 0) {
  13660. o = {};
  13661. }
  13662. if (oc === void 0) {
  13663. oc = function oc() {};
  13664. }
  13665. var source = source_;
  13666. var options = o;
  13667. var callback = oc;
  13668. if (typeof options === 'function') {
  13669. callback = options;
  13670. options = {};
  13671. }
  13672. if (!this.rules || Object.keys(this.rules).length === 0) {
  13673. if (callback) {
  13674. callback();
  13675. }
  13676. return Promise.resolve();
  13677. }
  13678. function complete(results) {
  13679. var i;
  13680. var errors = [];
  13681. var fields = {};
  13682. function add(e) {
  13683. if (Array.isArray(e)) {
  13684. var _errors;
  13685. errors = (_errors = errors).concat.apply(_errors, e);
  13686. } else {
  13687. errors.push(e);
  13688. }
  13689. }
  13690. for (i = 0; i < results.length; i++) {
  13691. add(results[i]);
  13692. }
  13693. if (!errors.length) {
  13694. errors = null;
  13695. fields = null;
  13696. } else {
  13697. fields = convertFieldsError(errors);
  13698. }
  13699. callback(errors, fields);
  13700. }
  13701. if (options.messages) {
  13702. var messages$1 = this.messages();
  13703. if (messages$1 === messages) {
  13704. messages$1 = newMessages();
  13705. }
  13706. deepMerge(messages$1, options.messages);
  13707. options.messages = messages$1;
  13708. } else {
  13709. options.messages = this.messages();
  13710. }
  13711. var arr;
  13712. var value;
  13713. var series = {};
  13714. var keys = options.keys || Object.keys(this.rules);
  13715. keys.forEach(function (z) {
  13716. arr = _this.rules[z];
  13717. value = source[z];
  13718. arr.forEach(function (r) {
  13719. var rule = r;
  13720. if (typeof rule.transform === 'function') {
  13721. if (source === source_) {
  13722. source = _extends({}, source);
  13723. }
  13724. value = source[z] = rule.transform(value);
  13725. }
  13726. if (typeof rule === 'function') {
  13727. rule = {
  13728. validator: rule
  13729. };
  13730. } else {
  13731. rule = _extends({}, rule);
  13732. }
  13733. rule.validator = _this.getValidationMethod(rule);
  13734. rule.field = z;
  13735. rule.fullField = rule.fullField || z;
  13736. rule.type = _this.getType(rule);
  13737. if (!rule.validator) {
  13738. return;
  13739. }
  13740. series[z] = series[z] || [];
  13741. series[z].push({
  13742. rule: rule,
  13743. value: value,
  13744. source: source,
  13745. field: z
  13746. });
  13747. });
  13748. });
  13749. var errorFields = {};
  13750. return asyncMap(series, options, function (data, doIt) {
  13751. var rule = data.rule;
  13752. var deep = (rule.type === 'object' || rule.type === 'array') && ((0, _typeof2.default)(rule.fields) === 'object' || (0, _typeof2.default)(rule.defaultField) === 'object');
  13753. deep = deep && (rule.required || !rule.required && data.value);
  13754. rule.field = data.field;
  13755. function addFullfield(key, schema) {
  13756. return _extends({}, schema, {
  13757. fullField: rule.fullField + "." + key
  13758. });
  13759. }
  13760. function cb(e) {
  13761. if (e === void 0) {
  13762. e = [];
  13763. }
  13764. var errors = e;
  13765. if (!Array.isArray(errors)) {
  13766. errors = [errors];
  13767. }
  13768. if (!options.suppressWarning && errors.length) {
  13769. Schema.warning('async-validator:', errors);
  13770. }
  13771. if (errors.length && rule.message) {
  13772. errors = [].concat(rule.message);
  13773. }
  13774. errors = errors.map(complementError(rule));
  13775. if (options.first && errors.length) {
  13776. errorFields[rule.field] = 1;
  13777. return doIt(errors);
  13778. }
  13779. if (!deep) {
  13780. doIt(errors);
  13781. } else {
  13782. // if rule is required but the target object
  13783. // does not exist fail at the rule level and don't
  13784. // go deeper
  13785. if (rule.required && !data.value) {
  13786. if (rule.message) {
  13787. errors = [].concat(rule.message).map(complementError(rule));
  13788. } else if (options.error) {
  13789. errors = [options.error(rule, format(options.messages.required, rule.field))];
  13790. } else {
  13791. errors = [];
  13792. }
  13793. return doIt(errors);
  13794. }
  13795. var fieldsSchema = {};
  13796. if (rule.defaultField) {
  13797. for (var k in data.value) {
  13798. if (data.value.hasOwnProperty(k)) {
  13799. fieldsSchema[k] = rule.defaultField;
  13800. }
  13801. }
  13802. }
  13803. fieldsSchema = _extends({}, fieldsSchema, {}, data.rule.fields);
  13804. for (var f in fieldsSchema) {
  13805. if (fieldsSchema.hasOwnProperty(f)) {
  13806. var fieldSchema = Array.isArray(fieldsSchema[f]) ? fieldsSchema[f] : [fieldsSchema[f]];
  13807. fieldsSchema[f] = fieldSchema.map(addFullfield.bind(null, f));
  13808. }
  13809. }
  13810. var schema = new Schema(fieldsSchema);
  13811. schema.messages(options.messages);
  13812. if (data.rule.options) {
  13813. data.rule.options.messages = options.messages;
  13814. data.rule.options.error = options.error;
  13815. }
  13816. schema.validate(data.value, data.rule.options || options, function (errs) {
  13817. var finalErrors = [];
  13818. if (errors && errors.length) {
  13819. finalErrors.push.apply(finalErrors, errors);
  13820. }
  13821. if (errs && errs.length) {
  13822. finalErrors.push.apply(finalErrors, errs);
  13823. }
  13824. doIt(finalErrors.length ? finalErrors : null);
  13825. });
  13826. }
  13827. }
  13828. var res;
  13829. if (rule.asyncValidator) {
  13830. res = rule.asyncValidator(rule, data.value, cb, data.source, options);
  13831. } else if (rule.validator) {
  13832. res = rule.validator(rule, data.value, cb, data.source, options);
  13833. if (res === true) {
  13834. cb();
  13835. } else if (res === false) {
  13836. cb(rule.message || rule.field + " fails");
  13837. } else if (res instanceof Array) {
  13838. cb(res);
  13839. } else if (res instanceof Error) {
  13840. cb(res.message);
  13841. }
  13842. }
  13843. if (res && res.then) {
  13844. res.then(function () {
  13845. return cb();
  13846. }, function (e) {
  13847. return cb(e);
  13848. });
  13849. }
  13850. }, function (results) {
  13851. complete(results);
  13852. });
  13853. },
  13854. getType: function getType(rule) {
  13855. if (rule.type === undefined && rule.pattern instanceof RegExp) {
  13856. rule.type = 'pattern';
  13857. }
  13858. if (typeof rule.validator !== 'function' && rule.type && !validators.hasOwnProperty(rule.type)) {
  13859. throw new Error(format('Unknown rule type %s', rule.type));
  13860. }
  13861. return rule.type || 'string';
  13862. },
  13863. getValidationMethod: function getValidationMethod(rule) {
  13864. if (typeof rule.validator === 'function') {
  13865. return rule.validator;
  13866. }
  13867. var keys = Object.keys(rule);
  13868. var messageIndex = keys.indexOf('message');
  13869. if (messageIndex !== -1) {
  13870. keys.splice(messageIndex, 1);
  13871. }
  13872. if (keys.length === 1 && keys[0] === 'required') {
  13873. return validators.required;
  13874. }
  13875. return validators[this.getType(rule)] || false;
  13876. }
  13877. };
  13878. Schema.register = function register(type, validator) {
  13879. if (typeof validator !== 'function') {
  13880. throw new Error('Cannot register a validator by type, validator is not a function');
  13881. }
  13882. validators[type] = validator;
  13883. };
  13884. Schema.warning = warning;
  13885. Schema.messages = messages;
  13886. var _default = Schema;
  13887. exports.default = _default;
  13888. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/node-libs-browser/mock/process.js */ 514)))
  13889. /***/ }),
  13890. /***/ 514:
  13891. /*!********************************************************!*\
  13892. !*** ./node_modules/node-libs-browser/mock/process.js ***!
  13893. \********************************************************/
  13894. /*! no static exports found */
  13895. /***/ (function(module, exports, __webpack_require__) {
  13896. exports.nextTick = function nextTick(fn) {
  13897. var args = Array.prototype.slice.call(arguments);
  13898. args.shift();
  13899. setTimeout(function () {
  13900. fn.apply(null, args);
  13901. }, 0);
  13902. };
  13903. exports.platform = exports.arch =
  13904. exports.execPath = exports.title = 'browser';
  13905. exports.pid = 1;
  13906. exports.browser = true;
  13907. exports.env = {};
  13908. exports.argv = [];
  13909. exports.binding = function (name) {
  13910. throw new Error('No such module. (Possibly not yet loaded)')
  13911. };
  13912. (function () {
  13913. var cwd = '/';
  13914. var path;
  13915. exports.cwd = function () { return cwd };
  13916. exports.chdir = function (dir) {
  13917. if (!path) path = __webpack_require__(/*! path */ 515);
  13918. cwd = path.resolve(dir, cwd);
  13919. };
  13920. })();
  13921. exports.exit = exports.kill =
  13922. exports.umask = exports.dlopen =
  13923. exports.uptime = exports.memoryUsage =
  13924. exports.uvCounters = function() {};
  13925. exports.features = {};
  13926. /***/ }),
  13927. /***/ 515:
  13928. /*!***********************************************!*\
  13929. !*** ./node_modules/path-browserify/index.js ***!
  13930. \***********************************************/
  13931. /*! no static exports found */
  13932. /***/ (function(module, exports, __webpack_require__) {
  13933. /* WEBPACK VAR INJECTION */(function(process) {// .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1,
  13934. // backported and transplited with Babel, with backwards-compat fixes
  13935. // Copyright Joyent, Inc. and other Node contributors.
  13936. //
  13937. // Permission is hereby granted, free of charge, to any person obtaining a
  13938. // copy of this software and associated documentation files (the
  13939. // "Software"), to deal in the Software without restriction, including
  13940. // without limitation the rights to use, copy, modify, merge, publish,
  13941. // distribute, sublicense, and/or sell copies of the Software, and to permit
  13942. // persons to whom the Software is furnished to do so, subject to the
  13943. // following conditions:
  13944. //
  13945. // The above copyright notice and this permission notice shall be included
  13946. // in all copies or substantial portions of the Software.
  13947. //
  13948. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  13949. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  13950. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  13951. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  13952. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  13953. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  13954. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  13955. // resolves . and .. elements in a path array with directory names there
  13956. // must be no slashes, empty elements, or device names (c:\) in the array
  13957. // (so also no leading and trailing slashes - it does not distinguish
  13958. // relative and absolute paths)
  13959. function normalizeArray(parts, allowAboveRoot) {
  13960. // if the path tries to go above the root, `up` ends up > 0
  13961. var up = 0;
  13962. for (var i = parts.length - 1; i >= 0; i--) {
  13963. var last = parts[i];
  13964. if (last === '.') {
  13965. parts.splice(i, 1);
  13966. } else if (last === '..') {
  13967. parts.splice(i, 1);
  13968. up++;
  13969. } else if (up) {
  13970. parts.splice(i, 1);
  13971. up--;
  13972. }
  13973. }
  13974. // if the path is allowed to go above the root, restore leading ..s
  13975. if (allowAboveRoot) {
  13976. for (; up--; up) {
  13977. parts.unshift('..');
  13978. }
  13979. }
  13980. return parts;
  13981. }
  13982. // path.resolve([from ...], to)
  13983. // posix version
  13984. exports.resolve = function() {
  13985. var resolvedPath = '',
  13986. resolvedAbsolute = false;
  13987. for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
  13988. var path = (i >= 0) ? arguments[i] : process.cwd();
  13989. // Skip empty and invalid entries
  13990. if (typeof path !== 'string') {
  13991. throw new TypeError('Arguments to path.resolve must be strings');
  13992. } else if (!path) {
  13993. continue;
  13994. }
  13995. resolvedPath = path + '/' + resolvedPath;
  13996. resolvedAbsolute = path.charAt(0) === '/';
  13997. }
  13998. // At this point the path should be resolved to a full absolute path, but
  13999. // handle relative paths to be safe (might happen when process.cwd() fails)
  14000. // Normalize the path
  14001. resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
  14002. return !!p;
  14003. }), !resolvedAbsolute).join('/');
  14004. return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
  14005. };
  14006. // path.normalize(path)
  14007. // posix version
  14008. exports.normalize = function(path) {
  14009. var isAbsolute = exports.isAbsolute(path),
  14010. trailingSlash = substr(path, -1) === '/';
  14011. // Normalize the path
  14012. path = normalizeArray(filter(path.split('/'), function(p) {
  14013. return !!p;
  14014. }), !isAbsolute).join('/');
  14015. if (!path && !isAbsolute) {
  14016. path = '.';
  14017. }
  14018. if (path && trailingSlash) {
  14019. path += '/';
  14020. }
  14021. return (isAbsolute ? '/' : '') + path;
  14022. };
  14023. // posix version
  14024. exports.isAbsolute = function(path) {
  14025. return path.charAt(0) === '/';
  14026. };
  14027. // posix version
  14028. exports.join = function() {
  14029. var paths = Array.prototype.slice.call(arguments, 0);
  14030. return exports.normalize(filter(paths, function(p, index) {
  14031. if (typeof p !== 'string') {
  14032. throw new TypeError('Arguments to path.join must be strings');
  14033. }
  14034. return p;
  14035. }).join('/'));
  14036. };
  14037. // path.relative(from, to)
  14038. // posix version
  14039. exports.relative = function(from, to) {
  14040. from = exports.resolve(from).substr(1);
  14041. to = exports.resolve(to).substr(1);
  14042. function trim(arr) {
  14043. var start = 0;
  14044. for (; start < arr.length; start++) {
  14045. if (arr[start] !== '') break;
  14046. }
  14047. var end = arr.length - 1;
  14048. for (; end >= 0; end--) {
  14049. if (arr[end] !== '') break;
  14050. }
  14051. if (start > end) return [];
  14052. return arr.slice(start, end - start + 1);
  14053. }
  14054. var fromParts = trim(from.split('/'));
  14055. var toParts = trim(to.split('/'));
  14056. var length = Math.min(fromParts.length, toParts.length);
  14057. var samePartsLength = length;
  14058. for (var i = 0; i < length; i++) {
  14059. if (fromParts[i] !== toParts[i]) {
  14060. samePartsLength = i;
  14061. break;
  14062. }
  14063. }
  14064. var outputParts = [];
  14065. for (var i = samePartsLength; i < fromParts.length; i++) {
  14066. outputParts.push('..');
  14067. }
  14068. outputParts = outputParts.concat(toParts.slice(samePartsLength));
  14069. return outputParts.join('/');
  14070. };
  14071. exports.sep = '/';
  14072. exports.delimiter = ':';
  14073. exports.dirname = function (path) {
  14074. if (typeof path !== 'string') path = path + '';
  14075. if (path.length === 0) return '.';
  14076. var code = path.charCodeAt(0);
  14077. var hasRoot = code === 47 /*/*/;
  14078. var end = -1;
  14079. var matchedSlash = true;
  14080. for (var i = path.length - 1; i >= 1; --i) {
  14081. code = path.charCodeAt(i);
  14082. if (code === 47 /*/*/) {
  14083. if (!matchedSlash) {
  14084. end = i;
  14085. break;
  14086. }
  14087. } else {
  14088. // We saw the first non-path separator
  14089. matchedSlash = false;
  14090. }
  14091. }
  14092. if (end === -1) return hasRoot ? '/' : '.';
  14093. if (hasRoot && end === 1) {
  14094. // return '//';
  14095. // Backwards-compat fix:
  14096. return '/';
  14097. }
  14098. return path.slice(0, end);
  14099. };
  14100. function basename(path) {
  14101. if (typeof path !== 'string') path = path + '';
  14102. var start = 0;
  14103. var end = -1;
  14104. var matchedSlash = true;
  14105. var i;
  14106. for (i = path.length - 1; i >= 0; --i) {
  14107. if (path.charCodeAt(i) === 47 /*/*/) {
  14108. // If we reached a path separator that was not part of a set of path
  14109. // separators at the end of the string, stop now
  14110. if (!matchedSlash) {
  14111. start = i + 1;
  14112. break;
  14113. }
  14114. } else if (end === -1) {
  14115. // We saw the first non-path separator, mark this as the end of our
  14116. // path component
  14117. matchedSlash = false;
  14118. end = i + 1;
  14119. }
  14120. }
  14121. if (end === -1) return '';
  14122. return path.slice(start, end);
  14123. }
  14124. // Uses a mixed approach for backwards-compatibility, as ext behavior changed
  14125. // in new Node.js versions, so only basename() above is backported here
  14126. exports.basename = function (path, ext) {
  14127. var f = basename(path);
  14128. if (ext && f.substr(-1 * ext.length) === ext) {
  14129. f = f.substr(0, f.length - ext.length);
  14130. }
  14131. return f;
  14132. };
  14133. exports.extname = function (path) {
  14134. if (typeof path !== 'string') path = path + '';
  14135. var startDot = -1;
  14136. var startPart = 0;
  14137. var end = -1;
  14138. var matchedSlash = true;
  14139. // Track the state of characters (if any) we see before our first dot and
  14140. // after any path separator we find
  14141. var preDotState = 0;
  14142. for (var i = path.length - 1; i >= 0; --i) {
  14143. var code = path.charCodeAt(i);
  14144. if (code === 47 /*/*/) {
  14145. // If we reached a path separator that was not part of a set of path
  14146. // separators at the end of the string, stop now
  14147. if (!matchedSlash) {
  14148. startPart = i + 1;
  14149. break;
  14150. }
  14151. continue;
  14152. }
  14153. if (end === -1) {
  14154. // We saw the first non-path separator, mark this as the end of our
  14155. // extension
  14156. matchedSlash = false;
  14157. end = i + 1;
  14158. }
  14159. if (code === 46 /*.*/) {
  14160. // If this is our first dot, mark it as the start of our extension
  14161. if (startDot === -1)
  14162. startDot = i;
  14163. else if (preDotState !== 1)
  14164. preDotState = 1;
  14165. } else if (startDot !== -1) {
  14166. // We saw a non-dot and non-path separator before our dot, so we should
  14167. // have a good chance at having a non-empty extension
  14168. preDotState = -1;
  14169. }
  14170. }
  14171. if (startDot === -1 || end === -1 ||
  14172. // We saw a non-dot character immediately before the dot
  14173. preDotState === 0 ||
  14174. // The (right-most) trimmed path component is exactly '..'
  14175. preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
  14176. return '';
  14177. }
  14178. return path.slice(startDot, end);
  14179. };
  14180. function filter (xs, f) {
  14181. if (xs.filter) return xs.filter(f);
  14182. var res = [];
  14183. for (var i = 0; i < xs.length; i++) {
  14184. if (f(xs[i], i, xs)) res.push(xs[i]);
  14185. }
  14186. return res;
  14187. }
  14188. // String.prototype.substr - negative index don't work in IE8
  14189. var substr = 'ab'.substr(-1) === 'b'
  14190. ? function (str, start, len) { return str.substr(start, len) }
  14191. : function (str, start, len) {
  14192. if (start < 0) start = str.length + start;
  14193. return str.substr(start, len);
  14194. }
  14195. ;
  14196. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/mock/process.js */ 514)))
  14197. /***/ }),
  14198. /***/ 52:
  14199. /*!*********************************************************************!*\
  14200. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/random.js ***!
  14201. \*********************************************************************/
  14202. /*! no static exports found */
  14203. /***/ (function(module, exports, __webpack_require__) {
  14204. "use strict";
  14205. Object.defineProperty(exports, "__esModule", {
  14206. value: true
  14207. });
  14208. exports.default = void 0;
  14209. function random(min, max) {
  14210. if (min >= 0 && max > 0 && max >= min) {
  14211. var gab = max - min + 1;
  14212. return Math.floor(Math.random() * gab + min);
  14213. } else {
  14214. return 0;
  14215. }
  14216. }
  14217. var _default = random;
  14218. exports.default = _default;
  14219. /***/ }),
  14220. /***/ 53:
  14221. /*!*******************************************************************!*\
  14222. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/trim.js ***!
  14223. \*******************************************************************/
  14224. /*! no static exports found */
  14225. /***/ (function(module, exports, __webpack_require__) {
  14226. "use strict";
  14227. Object.defineProperty(exports, "__esModule", {
  14228. value: true
  14229. });
  14230. exports.default = void 0;
  14231. function trim(str) {
  14232. var pos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'both';
  14233. if (pos == 'both') {
  14234. return str.replace(/^\s+|\s+$/g, "");
  14235. } else if (pos == "left") {
  14236. return str.replace(/^\s*/, '');
  14237. } else if (pos == 'right') {
  14238. return str.replace(/(\s*$)/g, "");
  14239. } else if (pos == 'all') {
  14240. return str.replace(/\s+/g, "");
  14241. } else {
  14242. return str;
  14243. }
  14244. }
  14245. var _default = trim;
  14246. exports.default = _default;
  14247. /***/ }),
  14248. /***/ 54:
  14249. /*!********************************************************************!*\
  14250. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/toast.js ***!
  14251. \********************************************************************/
  14252. /*! no static exports found */
  14253. /***/ (function(module, exports, __webpack_require__) {
  14254. "use strict";
  14255. /* WEBPACK VAR INJECTION */(function(uni) {
  14256. Object.defineProperty(exports, "__esModule", {
  14257. value: true
  14258. });
  14259. exports.default = void 0;
  14260. function toast(title) {
  14261. var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1500;
  14262. uni.showToast({
  14263. title: title,
  14264. icon: 'none',
  14265. duration: duration
  14266. });
  14267. }
  14268. var _default = toast;
  14269. exports.default = _default;
  14270. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  14271. /***/ }),
  14272. /***/ 55:
  14273. /*!************************************************************************!*\
  14274. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/getParent.js ***!
  14275. \************************************************************************/
  14276. /*! no static exports found */
  14277. /***/ (function(module, exports, __webpack_require__) {
  14278. "use strict";
  14279. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  14280. Object.defineProperty(exports, "__esModule", {
  14281. value: true
  14282. });
  14283. exports.default = getParent;
  14284. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  14285. // 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
  14286. // this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
  14287. function getParent(name, keys) {
  14288. var parent = this.$parent;
  14289. // 通过while历遍,这里主要是为了H5需要多层解析的问题
  14290. while (parent) {
  14291. // 父组件
  14292. if (parent.$options.name !== name) {
  14293. // 如果组件的name不相等,继续上一级寻找
  14294. parent = parent.$parent;
  14295. } else {
  14296. var _ret = function () {
  14297. var data = {};
  14298. // 判断keys是否数组,如果传过来的是一个数组,那么直接使用数组元素值当做键值去父组件寻找
  14299. if (Array.isArray(keys)) {
  14300. keys.map(function (val) {
  14301. data[val] = parent[val] ? parent[val] : '';
  14302. });
  14303. } else {
  14304. // 历遍传过来的对象参数
  14305. for (var i in keys) {
  14306. // 如果子组件有此值则用,无此值则用父组件的值
  14307. // 判断是否空数组,如果是,则用父组件的值,否则用子组件的值
  14308. if (Array.isArray(keys[i])) {
  14309. if (keys[i].length) {
  14310. data[i] = keys[i];
  14311. } else {
  14312. data[i] = parent[i];
  14313. }
  14314. } else if (keys[i].constructor === Object) {
  14315. // 判断是否对象,如果是对象,且有属性,那么使用子组件的值,否则使用父组件的值
  14316. if (Object.keys(keys[i]).length) {
  14317. data[i] = keys[i];
  14318. } else {
  14319. data[i] = parent[i];
  14320. }
  14321. } else {
  14322. // 只要子组件有传值,即使是false值,也是“传值”了,也需要覆盖父组件的同名参数
  14323. data[i] = keys[i] || keys[i] === false ? keys[i] : parent[i];
  14324. }
  14325. }
  14326. }
  14327. return {
  14328. v: data
  14329. };
  14330. }();
  14331. if ((0, _typeof2.default)(_ret) === "object") return _ret.v;
  14332. }
  14333. }
  14334. return {};
  14335. }
  14336. /***/ }),
  14337. /***/ 56:
  14338. /*!**********************************************************************!*\
  14339. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/$parent.js ***!
  14340. \**********************************************************************/
  14341. /*! no static exports found */
  14342. /***/ (function(module, exports, __webpack_require__) {
  14343. "use strict";
  14344. Object.defineProperty(exports, "__esModule", {
  14345. value: true
  14346. });
  14347. exports.default = $parent;
  14348. // 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
  14349. // this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
  14350. // 这里默认值等于undefined有它的含义,因为最顶层元素(组件)的$parent就是undefined,意味着不传name
  14351. // 值(默认为undefined),就是查找最顶层的$parent
  14352. function $parent() {
  14353. var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  14354. var parent = this.$parent;
  14355. // 通过while历遍,这里主要是为了H5需要多层解析的问题
  14356. while (parent) {
  14357. // 父组件
  14358. if (parent.$options && parent.$options.name !== name) {
  14359. // 如果组件的name不相等,继续上一级寻找
  14360. parent = parent.$parent;
  14361. } else {
  14362. return parent;
  14363. }
  14364. }
  14365. return false;
  14366. }
  14367. /***/ }),
  14368. /***/ 57:
  14369. /*!******************************************************************!*\
  14370. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/sys.js ***!
  14371. \******************************************************************/
  14372. /*! no static exports found */
  14373. /***/ (function(module, exports, __webpack_require__) {
  14374. "use strict";
  14375. /* WEBPACK VAR INJECTION */(function(uni) {
  14376. Object.defineProperty(exports, "__esModule", {
  14377. value: true
  14378. });
  14379. exports.os = os;
  14380. exports.sys = sys;
  14381. function os() {
  14382. return uni.getSystemInfoSync().platform;
  14383. }
  14384. ;
  14385. function sys() {
  14386. return uni.getSystemInfoSync();
  14387. }
  14388. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  14389. /***/ }),
  14390. /***/ 58:
  14391. /*!***********************************************************************!*\
  14392. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/debounce.js ***!
  14393. \***********************************************************************/
  14394. /*! no static exports found */
  14395. /***/ (function(module, exports, __webpack_require__) {
  14396. "use strict";
  14397. Object.defineProperty(exports, "__esModule", {
  14398. value: true
  14399. });
  14400. exports.default = void 0;
  14401. var timeout = null;
  14402. /**
  14403. * 防抖原理:一定时间内,只有最后一次操作,再过wait毫秒后才执行函数
  14404. *
  14405. * @param {Function} func 要执行的回调函数
  14406. * @param {Number} wait 延时的时间
  14407. * @param {Boolean} immediate 是否立即执行
  14408. * @return null
  14409. */
  14410. function debounce(func) {
  14411. var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;
  14412. var immediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  14413. // 清除定时器
  14414. if (timeout !== null) clearTimeout(timeout);
  14415. // 立即执行,此类情况一般用不到
  14416. if (immediate) {
  14417. var callNow = !timeout;
  14418. timeout = setTimeout(function () {
  14419. timeout = null;
  14420. }, wait);
  14421. if (callNow) typeof func === 'function' && func();
  14422. } else {
  14423. // 设置定时器,当最后一次操作后,timeout不会再被清除,所以在延时wait毫秒后执行func回调方法
  14424. timeout = setTimeout(function () {
  14425. typeof func === 'function' && func();
  14426. }, wait);
  14427. }
  14428. }
  14429. var _default = debounce;
  14430. exports.default = _default;
  14431. /***/ }),
  14432. /***/ 59:
  14433. /*!***********************************************************************!*\
  14434. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/throttle.js ***!
  14435. \***********************************************************************/
  14436. /*! no static exports found */
  14437. /***/ (function(module, exports, __webpack_require__) {
  14438. "use strict";
  14439. Object.defineProperty(exports, "__esModule", {
  14440. value: true
  14441. });
  14442. exports.default = void 0;
  14443. var timeoutArr = [];
  14444. var flagArr = [];
  14445. /**
  14446. * 节流函数
  14447. * 节流原理:在一定时间内,只能触发一次
  14448. * @param {Function} fn 要执行的回调函数
  14449. * @param {Number} time 延时的时间
  14450. * @param {Boolean} isImmediate 是否立即执行
  14451. * @param {String} timeoutName 定时器ID
  14452. * @return null
  14453. */
  14454. function throttle(fn) {
  14455. var time = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;
  14456. var isImmediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  14457. var timeoutName = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "default";
  14458. if (!timeoutArr[timeoutName]) timeoutArr[timeoutName] = null;
  14459. if (isImmediate) {
  14460. if (!flagArr[timeoutName]) {
  14461. flagArr[timeoutName] = true;
  14462. // 如果是立即执行,则在time毫秒内开始时执行
  14463. if (typeof fn === 'function') fn();
  14464. timeoutArr[timeoutName] = setTimeout(function () {
  14465. flagArr[timeoutName] = false;
  14466. }, time);
  14467. }
  14468. } else {
  14469. if (!flagArr[timeoutName]) {
  14470. flagArr[timeoutName] = true;
  14471. // 如果是非立即执行,则在time毫秒内的结束处执行
  14472. timeoutArr[timeoutName] = setTimeout(function () {
  14473. flagArr[timeoutName] = false;
  14474. if (typeof fn === 'function') fn();
  14475. }, time);
  14476. }
  14477. }
  14478. }
  14479. ;
  14480. var _default = throttle;
  14481. exports.default = _default;
  14482. /***/ }),
  14483. /***/ 6:
  14484. /*!***************************************************************!*\
  14485. !*** ./node_modules/@babel/runtime/helpers/arrayWithHoles.js ***!
  14486. \***************************************************************/
  14487. /*! no static exports found */
  14488. /***/ (function(module, exports) {
  14489. function _arrayWithHoles(arr) {
  14490. if (Array.isArray(arr)) return arr;
  14491. }
  14492. module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  14493. /***/ }),
  14494. /***/ 60:
  14495. /*!***********************************************************************!*\
  14496. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/function/addStyle.js ***!
  14497. \***********************************************************************/
  14498. /*! no static exports found */
  14499. /***/ (function(module, exports, __webpack_require__) {
  14500. "use strict";
  14501. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  14502. Object.defineProperty(exports, "__esModule", {
  14503. value: true
  14504. });
  14505. exports.default = void 0;
  14506. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  14507. var _test = _interopRequireDefault(__webpack_require__(/*! ./test.js */ 38));
  14508. /**
  14509. * @description 样式转换
  14510. * 对象转字符串,或者字符串转对象
  14511. * @param {object | string} customStyle 需要转换的目标
  14512. * @param {String} target 转换的目的,object-转为对象,string-转为字符串
  14513. * @returns {object|string}
  14514. */
  14515. function addStyle(customStyle) {
  14516. var target = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'object';
  14517. // 字符串转字符串,对象转对象情形,直接返回
  14518. if (_test.default.empty(customStyle) || (0, _typeof2.default)(customStyle) === 'object' && target === 'object' || target === 'string' && typeof customStyle === 'string') {
  14519. return customStyle;
  14520. }
  14521. // 字符串转对象
  14522. if (target === 'object') {
  14523. // 去除字符串样式中的两端空格(中间的空格不能去掉,比如padding: 20px 0如果去掉了就错了),空格是无用的
  14524. customStyle = trim(customStyle);
  14525. // 根据";"将字符串转为数组形式
  14526. var styleArray = customStyle.split(';');
  14527. var style = {};
  14528. // 历遍数组,拼接成对象
  14529. for (var i = 0; i < styleArray.length; i++) {
  14530. // 'font-size:20px;color:red;',如此最后字符串有";"的话,会导致styleArray最后一个元素为空字符串,这里需要过滤
  14531. if (styleArray[i]) {
  14532. var item = styleArray[i].split(':');
  14533. style[trim(item[0])] = trim(item[1]);
  14534. }
  14535. }
  14536. return style;
  14537. }
  14538. // 这里为对象转字符串形式
  14539. var string = '';
  14540. for (var _i in customStyle) {
  14541. // 驼峰转为中划线的形式,否则css内联样式,无法识别驼峰样式属性名
  14542. var key = _i.replace(/([A-Z])/g, '-$1').toLowerCase();
  14543. string += "".concat(key, ":").concat(customStyle[_i], ";");
  14544. }
  14545. // 去除两端空格
  14546. return trim(string);
  14547. }
  14548. var _default = addStyle;
  14549. exports.default = _default;
  14550. /***/ }),
  14551. /***/ 61:
  14552. /*!*******************************************************************!*\
  14553. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/config/config.js ***!
  14554. \*******************************************************************/
  14555. /*! no static exports found */
  14556. /***/ (function(module, exports, __webpack_require__) {
  14557. "use strict";
  14558. Object.defineProperty(exports, "__esModule", {
  14559. value: true
  14560. });
  14561. exports.default = void 0;
  14562. // 第一版 1.10.1 版本发布于2021-11-18
  14563. var version = '1.10.1';
  14564. var _default = {
  14565. v: version,
  14566. version: version,
  14567. // 主题名称
  14568. type: ['primary', 'success', 'info', 'error', 'warning']
  14569. };
  14570. exports.default = _default;
  14571. /***/ }),
  14572. /***/ 62:
  14573. /*!*******************************************************************!*\
  14574. !*** E:/work/mdapp/uni_modules/vk-uview-ui/libs/config/zIndex.js ***!
  14575. \*******************************************************************/
  14576. /*! no static exports found */
  14577. /***/ (function(module, exports, __webpack_require__) {
  14578. "use strict";
  14579. Object.defineProperty(exports, "__esModule", {
  14580. value: true
  14581. });
  14582. exports.default = void 0;
  14583. // uniapp在H5中各API的z-index值如下:
  14584. /**
  14585. * actionsheet: 999
  14586. * modal: 999
  14587. * navigate: 998
  14588. * tabbar: 998
  14589. * toast: 999
  14590. */
  14591. var _default = {
  14592. toast: 10090,
  14593. noNetwork: 10080,
  14594. // popup包含popup,actionsheet,keyboard,picker的值
  14595. popup: 10075,
  14596. mask: 10070,
  14597. navbar: 980,
  14598. topTips: 975,
  14599. sticky: 970,
  14600. indexListSticky: 965
  14601. };
  14602. exports.default = _default;
  14603. /***/ }),
  14604. /***/ 63:
  14605. /*!**********************************!*\
  14606. !*** E:/work/mdapp/api/index.js ***!
  14607. \**********************************/
  14608. /*! no static exports found */
  14609. /***/ (function(module, exports, __webpack_require__) {
  14610. "use strict";
  14611. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  14612. Object.defineProperty(exports, "__esModule", {
  14613. value: true
  14614. });
  14615. exports.default = void 0;
  14616. var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ 64));
  14617. var _estate = _interopRequireDefault(__webpack_require__(/*! ./estate */ 67));
  14618. var _cust = _interopRequireDefault(__webpack_require__(/*! ./cust */ 68));
  14619. var _default = {
  14620. base: _base.default,
  14621. estate: _estate.default,
  14622. cust: _cust.default
  14623. };
  14624. exports.default = _default;
  14625. /***/ }),
  14626. /***/ 64:
  14627. /*!*********************************!*\
  14628. !*** E:/work/mdapp/api/base.js ***!
  14629. \*********************************/
  14630. /*! no static exports found */
  14631. /***/ (function(module, exports, __webpack_require__) {
  14632. "use strict";
  14633. Object.defineProperty(exports, "__esModule", {
  14634. value: true
  14635. });
  14636. exports.default = void 0;
  14637. var _http = __webpack_require__(/*! @/utils/http */ 65);
  14638. var _default = {
  14639. apilogin: function apilogin(params) {
  14640. // 登录
  14641. return (0, _http.request)('api/login', params, 'loading');
  14642. },
  14643. apiregister: function apiregister(params) {
  14644. // 注册
  14645. return (0, _http.request)('api/register', params, 'loading');
  14646. },
  14647. apisendsms: function apisendsms(params) {
  14648. // 发送短信
  14649. return (0, _http.request)('api/send/sms', params, 'loading');
  14650. },
  14651. apicaptcha: function apicaptcha(params) {
  14652. // 验证码图片
  14653. return (0, _http.request)('api/captcha', params, 'loading');
  14654. },
  14655. apicheckcaptcha: function apicheckcaptcha(params) {
  14656. // 检查手机号
  14657. return (0, _http.request)('api/check/captcha', params);
  14658. },
  14659. apiwxlogin: function apiwxlogin(params) {
  14660. // 微信登录
  14661. return (0, _http.request)('api/wx/login', params, 'loading');
  14662. },
  14663. apiwxautologin: function apiwxautologin(params) {
  14664. // 微信登录 自动
  14665. return (0, _http.request)('api/wx/autologin', params, 'loading');
  14666. },
  14667. apiuserinfo: function apiuserinfo(params) {
  14668. // 用户信息
  14669. return (0, _http.request)('api/user/info', params, 'loading');
  14670. },
  14671. apiuseredit: function apiuseredit(params) {
  14672. // 用户编辑
  14673. return (0, _http.request)('api/user/edit', params, 'loading');
  14674. },
  14675. apiuserbindwechat: function apiuserbindwechat(params) {
  14676. // 绑定微信
  14677. return (0, _http.request)('api/user/bind/wechat', params, 'loading');
  14678. },
  14679. apiuserauthadd: function apiuserauthadd(params) {
  14680. // 用户认证 - 提交认证
  14681. return (0, _http.request)('api/user/auth/add', params, 'loading');
  14682. },
  14683. apiuserauthinfo: function apiuserauthinfo(params) {
  14684. // 用户认证 - 认证详情
  14685. return (0, _http.request)('api/user/auth/info', params, 'loading');
  14686. },
  14687. apiuploadcloudpiv: function apiuploadcloudpiv(params) {
  14688. // 图片上传云接口
  14689. return (0, _http.request)('api/upload/cloudpiv', params, 'loading');
  14690. },
  14691. apidicttree: function apidicttree(params) {
  14692. // 字典
  14693. return (0, _http.request)('api/dict/tree', params, 'loading');
  14694. },
  14695. apiuserauthlist: function apiuserauthlist(params) {
  14696. // 认证列表
  14697. return (0, _http.request)('api/user/auth/list', params, 'loading');
  14698. },
  14699. apiuserauthedit: function apiuserauthedit(params) {
  14700. // 认证 审核 中介
  14701. return (0, _http.request)('api/user/auth/edit', params, 'loading');
  14702. },
  14703. apideptauthedit: function apideptauthedit(params) {
  14704. // 认证 审核 渠道
  14705. return (0, _http.request)('api/dept/auth/edit', params, 'loading');
  14706. },
  14707. apiuserreferreredit: function apiuserreferreredit(params) {
  14708. // 修改推荐人
  14709. return (0, _http.request)('api/user/referrer/edit', params, 'loading');
  14710. },
  14711. apiusernoticeopen: function apiusernoticeopen(params) {
  14712. // 公众号 推送 打开
  14713. return (0, _http.request)('api/user/notice/open', params, 'loading');
  14714. },
  14715. apiusernoticeclose: function apiusernoticeclose(params) {
  14716. // 公众号 推送 关闭
  14717. return (0, _http.request)('api/user/notice/close', params, 'loading');
  14718. }
  14719. };
  14720. exports.default = _default;
  14721. /***/ }),
  14722. /***/ 65:
  14723. /*!***********************************!*\
  14724. !*** E:/work/mdapp/utils/http.js ***!
  14725. \***********************************/
  14726. /*! no static exports found */
  14727. /***/ (function(module, exports, __webpack_require__) {
  14728. "use strict";
  14729. /* WEBPACK VAR INJECTION */(function(uni) {
  14730. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  14731. Object.defineProperty(exports, "__esModule", {
  14732. value: true
  14733. });
  14734. exports.request = request;
  14735. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  14736. var _utils = __webpack_require__(/*! @utils */ 66);
  14737. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
  14738. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
  14739. var Http = function Http() {
  14740. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
  14741. data: {}
  14742. };
  14743. return new Promise(function (resolve, reject) {
  14744. if (options.loadingStr === 'loading') {
  14745. uni.showLoading({
  14746. mask: true,
  14747. title: '加载中..'
  14748. });
  14749. }
  14750. var token = uni.getStorageSync('MD_token') || '';
  14751. var header = {
  14752. 'Content-Type': 'application/json',
  14753. 'token': token
  14754. // 'Content-Type': 'application/x-www-form-urlencoded'
  14755. };
  14756. var params = _objectSpread({}, options.data);
  14757. if (uni.getStorageSync('APP_token')) params.token = uni.getStorageSync('APP_token');
  14758. for (var key in options.data) {
  14759. if (options.data[key] === undefined || options.data[key] === 'undefined') {
  14760. params[key] = '';
  14761. }
  14762. }
  14763. var url = uni.baseUrl + options.url;
  14764. // let url = options.url
  14765. if (options.queryData) {
  14766. var qStr = '';
  14767. for (var k in options.queryData) {
  14768. qStr += "".concat(k, "=").concat(options.queryData[k], "&");
  14769. }
  14770. qStr = qStr.substr(0, qStr.length - 1);
  14771. url += "?".concat(qStr);
  14772. }
  14773. uni.request({
  14774. url: url,
  14775. data: _objectSpread({}, params),
  14776. header: header,
  14777. method: options.method || 'POST',
  14778. complete: function complete(res) {
  14779. if (options.loadingStr === 'loading') {
  14780. uni.hideLoading();
  14781. }
  14782. },
  14783. success: function success(res) {
  14784. var cData = res.data;
  14785. var code = cData.errno;
  14786. switch (code) {
  14787. case 0:
  14788. return resolve((0, _utils.noEmpty)(cData.data) ? cData.data : cData);
  14789. break;
  14790. case 401:
  14791. case 404:
  14792. case 405:
  14793. uni.removeStorageSync('MD_userInfo');
  14794. var u2 = uni.getStorageSync('MD_userInfo2');
  14795. if (u2.bind_wechat === '1' && uni.getStorageSync('MD_token')) {
  14796. uni.login({
  14797. success: function success(res) {
  14798. if (res.code) {
  14799. uni.api.base.apiwxautologin({
  14800. code: res.code
  14801. }).then(function (cData) {
  14802. if (cData.token === 'error') {
  14803. uni.removeStorageSync('MD_token');
  14804. } else {
  14805. uni.setStorageSync('MD_userInfo', cData);
  14806. uni.setStorageSync('MD_token', cData.token);
  14807. uni.api.base.apidicttree().then(function (res) {
  14808. var cObj = res || {};
  14809. var newDict = {};
  14810. for (var _k in cObj) {
  14811. var cArr = cObj[_k].map(function (item) {
  14812. return _objectSpread(_objectSpread({}, item), {}, {
  14813. key: item.dict_label,
  14814. val: item.dict_value
  14815. });
  14816. });
  14817. newDict[_k] = cArr;
  14818. }
  14819. uni.setStorageSync('MD_dict', newDict);
  14820. });
  14821. uni.api.base.apiuserinfo().then(function (res2) {
  14822. uni.setStorageSync('MD_userInfo2', res2);
  14823. uni.reLaunch({
  14824. url: '/pages/index/index'
  14825. });
  14826. });
  14827. }
  14828. });
  14829. }
  14830. }
  14831. });
  14832. } else {
  14833. uni.showToast({
  14834. title: "\u8BF7\u5148\u767B\u5F55~",
  14835. icon: 'none'
  14836. });
  14837. uni.navigateTo({
  14838. url: '/pages/user/login/login'
  14839. });
  14840. }
  14841. break;
  14842. default:
  14843. uni.showModal({
  14844. title: '提示',
  14845. content: "".concat(cData.errmsg, "(").concat(code, ")")
  14846. });
  14847. return reject(cData);
  14848. }
  14849. // resolve()
  14850. },
  14851. fail: function fail(err) {
  14852. console.log(err);
  14853. reject(err);
  14854. }
  14855. });
  14856. });
  14857. };
  14858. // export default Http
  14859. function request(url, data, loadingStr, queryData) {
  14860. return Http({
  14861. url: url,
  14862. data: data,
  14863. loadingStr: loadingStr,
  14864. queryData: queryData
  14865. });
  14866. }
  14867. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  14868. /***/ }),
  14869. /***/ 66:
  14870. /*!************************************!*\
  14871. !*** E:/work/mdapp/utils/index.js ***!
  14872. \************************************/
  14873. /*! no static exports found */
  14874. /***/ (function(module, exports, __webpack_require__) {
  14875. "use strict";
  14876. Object.defineProperty(exports, "__esModule", {
  14877. value: true
  14878. });
  14879. exports.arrToObj = arrToObj;
  14880. exports.comGetTime = comGetTime;
  14881. exports.noEmpty = noEmpty;
  14882. exports.numFormat3 = numFormat3;
  14883. exports.strTrim = strTrim;
  14884. /**
  14885. * @param {string} str
  14886. * @returns {string}
  14887. */
  14888. function strTrim(str) {
  14889. return str.replace(/(^\s*)|(\s*$)/g, '');
  14890. }
  14891. /**
  14892. * @param {Number} num
  14893. * @returns {string}
  14894. */
  14895. function numFormat3(num) {
  14896. var dotNum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
  14897. var numArr = Number(num).toFixed(dotNum).toString().split('.');
  14898. var arr = numArr[0].split('').reverse();
  14899. var res = [];
  14900. for (var i = 0; i < arr.length; i++) {
  14901. if (i % 3 === 0 && i !== 0) {
  14902. res.push(',');
  14903. }
  14904. res.push(arr[i]);
  14905. }
  14906. res.reverse();
  14907. if (numArr[1]) {
  14908. res = res.join('').concat('.' + numArr[1]);
  14909. } else {
  14910. res = res.join('');
  14911. }
  14912. // let res = num.toString().replace(/\d+/, function(n){
  14913. // return n.replace(/(\d)(?=(\d{3})+$)/g,function($1){
  14914. // return $1 + ","
  14915. // })
  14916. // })
  14917. // toLocaleString()
  14918. return res;
  14919. }
  14920. /**
  14921. * @param {Array} arr
  14922. * @returns {Object}
  14923. */
  14924. function arrToObj(arr) {
  14925. var obj = {};
  14926. if (Object.prototype.toString.call(arr) === '[object Array]') {
  14927. if (arr.length > 0) {
  14928. arr.forEach(function (item) {
  14929. obj[item.val] = item.key;
  14930. });
  14931. }
  14932. }
  14933. return obj;
  14934. }
  14935. /**
  14936. * @param {any} val
  14937. * @returns {Boolean}
  14938. */
  14939. function noEmpty(val) {
  14940. if (val === null || val === undefined || val === '') {
  14941. return false;
  14942. } else {
  14943. return true;
  14944. }
  14945. }
  14946. /**
  14947. * @param {Number} date
  14948. * @param {Boolean} onlyDate
  14949. * @returns {String}
  14950. * function time(time = +new Date()) {
  14951. var date = new Date(time + 8 * 3600 * 1000); // 增加8小时
  14952. return date.toJSON().substr(0, 19).replace('T', ' ');
  14953. }
  14954. */
  14955. function comGetTime() {
  14956. var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Date();
  14957. var onlyDate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  14958. var year = date.getFullYear();
  14959. var month = date.getMonth() + 1;
  14960. month = month > 9 ? month : '0' + month;
  14961. var day = date.getDate();
  14962. day = day > 9 ? day : '0' + day;
  14963. var hour = date.getHours();
  14964. hour = hour > 9 ? hour : '0' + hour;
  14965. var minute = date.getMinutes();
  14966. minute = minute > 9 ? minute : '0' + minute;
  14967. var second = date.getSeconds();
  14968. second = second > 9 ? second : '0' + second;
  14969. var milli = date.getMilliseconds();
  14970. milli = milli > 100 ? milli : milli > 10 ? '0' + milli : '00' + milli;
  14971. return onlyDate ? "".concat(year, "-").concat(month, "-").concat(day) : "".concat(year).concat(month).concat(day).concat(hour).concat(minute).concat(second).concat(milli);
  14972. }
  14973. /***/ }),
  14974. /***/ 67:
  14975. /*!***********************************!*\
  14976. !*** E:/work/mdapp/api/estate.js ***!
  14977. \***********************************/
  14978. /*! no static exports found */
  14979. /***/ (function(module, exports, __webpack_require__) {
  14980. "use strict";
  14981. Object.defineProperty(exports, "__esModule", {
  14982. value: true
  14983. });
  14984. exports.default = void 0;
  14985. var _http = __webpack_require__(/*! @/utils/http */ 65);
  14986. var _default = {
  14987. apiestatelist: function apiestatelist(params) {
  14988. // 楼盘列表
  14989. return (0, _http.request)('api/estate/list', params, 'loading');
  14990. },
  14991. apiestatecontentdetail: function apiestatecontentdetail(params) {
  14992. // 楼盘 介绍详情
  14993. return (0, _http.request)('api/estate/content/detail', params, 'loading');
  14994. },
  14995. apireportadd: function apireportadd(params) {
  14996. // 报备 - 添加报备
  14997. return (0, _http.request)('api/report/add', params, 'loading');
  14998. },
  14999. apireportlist: function apireportlist(params) {
  15000. // 报备 - 报备列表
  15001. return (0, _http.request)('api/report/list', params, 'loading');
  15002. },
  15003. apireportdetail: function apireportdetail(params) {
  15004. // 报备 - 报备详情
  15005. return (0, _http.request)('api/report/detail', params, 'loading');
  15006. },
  15007. apireport2detail: function apireport2detail(params) {
  15008. // 报备 - 报备详情2 普通的报备详情
  15009. return (0, _http.request)('api/report2/detail', params, 'loading');
  15010. },
  15011. apigoverndetail: function apigoverndetail(params) {
  15012. // 报备 - 报备详情 /govern/detail
  15013. return (0, _http.request)('api/govern/detail', params, 'loading');
  15014. },
  15015. apireportsite: function apireportsite(params) {
  15016. // 案场 - 报备详情
  15017. return (0, _http.request)('api/report/site', params, 'loading');
  15018. },
  15019. apireportconfirm: function apireportconfirm(params) {
  15020. // 报备 - 报备确认
  15021. return (0, _http.request)('api/report/confirm', params, 'loading');
  15022. },
  15023. apireportcount: function apireportcount(params) {
  15024. // 报备 - 报备统计
  15025. return (0, _http.request)('api/report/count', params, 'loading');
  15026. },
  15027. apireportgroupcount: function apireportgroupcount(params) {
  15028. // 报备 - 报备分组统计
  15029. return (0, _http.request)('api/report/group/count', params, 'loading');
  15030. },
  15031. apiestateinfodetail: function apiestateinfodetail(params) {
  15032. // 楼盘一页纸
  15033. return (0, _http.request)('api/estate/info/detail', params, 'loading');
  15034. },
  15035. apiestatedetail: function apiestatedetail(params) {
  15036. // 楼盘详情 copy plus
  15037. return (0, _http.request)('api/estate/detail', params, 'loading');
  15038. },
  15039. apigovernlist: function apigovernlist(params) {
  15040. // 案场缺课列表
  15041. return (0, _http.request)('api/govern/list', params, 'loading');
  15042. },
  15043. apireportedit: function apireportedit(params) {
  15044. // 报备修改 接口
  15045. return (0, _http.request)('api/report/edit', params, 'loading');
  15046. },
  15047. apireportsubscrlist: function apireportsubscrlist(params) {
  15048. // 认购审核列表
  15049. return (0, _http.request)('api/report/subscr/list', params, 'loading');
  15050. },
  15051. apireportsubscrDeal: function apireportsubscrDeal(params) {
  15052. // 已认购审核
  15053. return (0, _http.request)('api/report/subscr', params, 'loading');
  15054. },
  15055. apireportsignupDeal: function apireportsignupDeal(params) {
  15056. // 已签约审核
  15057. return (0, _http.request)('api/report/signup', params, 'loading');
  15058. },
  15059. apiestateliblist: function apiestateliblist(params) {
  15060. // 内部 各楼盘各平台佣金汇集
  15061. return (0, _http.request)('api/estate/lib/list', params, 'loading');
  15062. },
  15063. apiestatelibdetail: function apiestatelibdetail(params) {
  15064. // 内部 各楼盘各平台佣金汇集 详情
  15065. return (0, _http.request)('api/estate/lib/detail', params, 'loading');
  15066. },
  15067. apideptstorelist: function apideptstorelist(params) {
  15068. // 渠道门店所有列表
  15069. return (0, _http.request)('api/dept/store/list', params, 'loading');
  15070. },
  15071. apideptstorecount: function apideptstorecount(params) {
  15072. // 渠道门店 品牌统计
  15073. return (0, _http.request)('api/dept/store/count', params, 'loading');
  15074. }
  15075. };
  15076. exports.default = _default;
  15077. /***/ }),
  15078. /***/ 68:
  15079. /*!*********************************!*\
  15080. !*** E:/work/mdapp/api/cust.js ***!
  15081. \*********************************/
  15082. /*! no static exports found */
  15083. /***/ (function(module, exports, __webpack_require__) {
  15084. "use strict";
  15085. Object.defineProperty(exports, "__esModule", {
  15086. value: true
  15087. });
  15088. exports.default = void 0;
  15089. var _http = __webpack_require__(/*! @/utils/http */ 65);
  15090. var _default = {
  15091. apicustomerlist: function apicustomerlist(params) {
  15092. // 客户 列表
  15093. return (0, _http.request)('api/customer/list', params);
  15094. },
  15095. apicustomeradd: function apicustomeradd(params) {
  15096. // 客户 添加
  15097. return (0, _http.request)('api/customer/add', params, 'loading');
  15098. },
  15099. apicustomeredit: function apicustomeredit(params) {
  15100. // 客户 编辑
  15101. return (0, _http.request)('api/customer/edit', params, 'loading');
  15102. },
  15103. apicustomerdel: function apicustomerdel(params) {
  15104. // 客户 删除
  15105. return (0, _http.request)('api/customer/del', params, 'loading');
  15106. },
  15107. apicustomerdetail: function apicustomerdetail(params) {
  15108. // 客户 详情
  15109. return (0, _http.request)('api/customer/detail', params, 'loading');
  15110. },
  15111. apireportvisitchange: function apireportvisitchange(params) {
  15112. // 到访材料添加
  15113. return (0, _http.request)('api/report/visit/change', params, 'loading');
  15114. },
  15115. apireportvisitdetail: function apireportvisitdetail(params) {
  15116. // 到访材料详情
  15117. return (0, _http.request)('api/report/visit/detail', params, 'loading');
  15118. },
  15119. apireportvisit: function apireportvisit(params) {
  15120. // 报备到访
  15121. return (0, _http.request)('api/report/visit', params, 'loading');
  15122. },
  15123. apireportverify: function apireportverify(params) {
  15124. // 报备审核
  15125. return (0, _http.request)('api/report/verify', params, 'loading');
  15126. },
  15127. apideptuserlist: function apideptuserlist(params) {
  15128. // 我的门店下级人员
  15129. return (0, _http.request)('api/dept/user/list', params, 'loading');
  15130. },
  15131. apiprivatecustomerlist: function apiprivatecustomerlist(params) {
  15132. // 内部客户 列表
  15133. return (0, _http.request)('api/private/customer/list', params);
  15134. },
  15135. apiprivatecustomeradd: function apiprivatecustomeradd(params) {
  15136. // 内部客户 添加
  15137. return (0, _http.request)('api/private/customer/add', params, 'loading');
  15138. },
  15139. apiprivatecustomeredit: function apiprivatecustomeredit(params) {
  15140. // 内部客户 编辑
  15141. return (0, _http.request)('api/private/customer/edit', params, 'loading');
  15142. },
  15143. apiprivatecustomerdel: function apiprivatecustomerdel(params) {
  15144. // 内部客户 删除
  15145. return (0, _http.request)('api/private/customer/del', params, 'loading');
  15146. },
  15147. apiprivatecustomerdetail: function apiprivatecustomerdetail(params) {
  15148. // 内部客户 详情
  15149. return (0, _http.request)('api/private/customer/detail', params, 'loading');
  15150. },
  15151. apiprivaterecordlist: function apiprivaterecordlist(params) {
  15152. // 内部客户 - 跟进记录 - 列表
  15153. return (0, _http.request)('api/private/record/list', params);
  15154. },
  15155. apiprivaterecordadd: function apiprivaterecordadd(params) {
  15156. // 内部客户 - 跟进记录 - 添加
  15157. return (0, _http.request)('api/private/record/add', params, 'loading');
  15158. },
  15159. apiprivaterecordedit: function apiprivaterecordedit(params) {
  15160. // 内部客户 - 跟进记录 - 编辑
  15161. return (0, _http.request)('api/private/record/edit', params, 'loading');
  15162. },
  15163. apiprivaterecorddel: function apiprivaterecorddel(params) {
  15164. // 内部客户 - 跟进记录 - 删除
  15165. return (0, _http.request)('api/private/record/del', params, 'loading');
  15166. },
  15167. apirecordremindcount: function apirecordremindcount(params) {
  15168. // 内部客户 - 跟进记录 - 数量统计
  15169. return (0, _http.request)('api/record/remind/count', params, 'loading');
  15170. },
  15171. apitradelist: function apitradelist(params) {
  15172. // 成交 - 列表
  15173. return (0, _http.request)('api/trade/list', params);
  15174. },
  15175. apitradeadd: function apitradeadd(params) {
  15176. // 成交 - 添加
  15177. return (0, _http.request)('api/trade/add', params, 'loading');
  15178. },
  15179. apitradeedit: function apitradeedit(params) {
  15180. // 成交 - 编辑
  15181. return (0, _http.request)('api/trade/edit', params, 'loading');
  15182. },
  15183. apitradedetail: function apitradedetail(params) {
  15184. // 成交 - 详情
  15185. return (0, _http.request)('api/trade/detail', params, 'loading');
  15186. },
  15187. apitradedel: function apitradedel(params) {
  15188. // 成交 - 删除
  15189. return (0, _http.request)('api/trade/del', params, 'loading');
  15190. },
  15191. apitraderecordlist: function apitraderecordlist(params) {
  15192. // 成交 更新记录 - 列表
  15193. return (0, _http.request)('api/trade/record/list', params);
  15194. },
  15195. apitraderecordadd: function apitraderecordadd(params) {
  15196. // 成交 更新记录 - 添加
  15197. return (0, _http.request)('api/trade/record/add', params, 'loading');
  15198. },
  15199. apitraderecordedit: function apitraderecordedit(params) {
  15200. // 成交 更新记录 - 编辑
  15201. return (0, _http.request)('api/trade/record/edit', params, 'loading');
  15202. },
  15203. apitraderecorddel: function apitraderecorddel(params) {
  15204. // 成交 更新记录 - 删除
  15205. return (0, _http.request)('api/trade/record/del', params, 'loading');
  15206. },
  15207. apitradesubmit: function apitradesubmit(params) {
  15208. // 成交审核 - 提交审核
  15209. return (0, _http.request)('api/trade/submit', params, 'loading');
  15210. },
  15211. apitradereview: function apitradereview(params) {
  15212. // 成交审核 - 一二三审 审核
  15213. return (0, _http.request)('api/trade/review', params, 'loading');
  15214. },
  15215. apitradesubtotal: function apitradesubtotal(params) {
  15216. // 成交审核 - 成交月度小计
  15217. return (0, _http.request)('api/trade/subtotal', params, 'loading');
  15218. },
  15219. apiactivitylist: function apiactivitylist(params) {
  15220. // 活动 列表
  15221. return (0, _http.request)('api/activity/list', params, 'loading');
  15222. },
  15223. apiactivityinfo: function apiactivityinfo(params) {
  15224. // 活动 详情
  15225. return (0, _http.request)('api/activity/info', params, 'loading');
  15226. },
  15227. apiactivityenroll: function apiactivityenroll(params) {
  15228. // 活动 报名
  15229. return (0, _http.request)('api/activity/enroll', params, 'loading');
  15230. },
  15231. apiactivitysign: function apiactivitysign(params) {
  15232. // 活动 报名 扫码签到
  15233. return (0, _http.request)('api/activity/sign', params, 'loading');
  15234. }
  15235. };
  15236. exports.default = _default;
  15237. /***/ }),
  15238. /***/ 69:
  15239. /*!***********************************!*\
  15240. !*** E:/work/mdapp/utils/tool.js ***!
  15241. \***********************************/
  15242. /*! no static exports found */
  15243. /***/ (function(module, exports, __webpack_require__) {
  15244. "use strict";
  15245. /* WEBPACK VAR INJECTION */(function(uni) {
  15246. Object.defineProperty(exports, "__esModule", {
  15247. value: true
  15248. });
  15249. exports.msgBase = exports.getRandomNum = exports.confirmMsgFn = void 0;
  15250. var getRandomNum = function getRandomNum(len, radix) {
  15251. // getRandomNum(24, 16)
  15252. var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
  15253. var uuid = [];
  15254. radix = radix || chars.length;
  15255. if (len) {
  15256. // Compact form
  15257. for (var i = 0; i < len; i++) {
  15258. uuid[i] = chars[0 | Math.random() * radix];
  15259. }
  15260. } else {
  15261. // rfc4122, version 4 form
  15262. var r;
  15263. // rfc4122 requires these characters
  15264. uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
  15265. uuid[14] = '4';
  15266. // Fill in random data.  At i==19 set the high bits of clock sequence as
  15267. // per rfc4122, sec. 4.1.5
  15268. for (var _i = 0; _i < 36; _i++) {
  15269. if (!uuid[_i]) {
  15270. r = 0 | Math.random() * 16;
  15271. uuid[_i] = chars[_i === 19 ? r & 0x3 | 0x8 : r];
  15272. }
  15273. }
  15274. }
  15275. return uuid.join('') + new Date().getTime();
  15276. };
  15277. exports.getRandomNum = getRandomNum;
  15278. var msgBase = function msgBase(msgText, bc) {
  15279. uni.showToast({
  15280. title: msgText,
  15281. icon: 'none',
  15282. duration: 2000
  15283. }).then(function () {
  15284. if (bc) bc();
  15285. });
  15286. };
  15287. exports.msgBase = msgBase;
  15288. var confirmMsgFn = function confirmMsgFn(msgText, successBc, errorBc) {
  15289. var title = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '提示';
  15290. uni.showModal({
  15291. title: title,
  15292. content: msgText,
  15293. success: function success(res) {
  15294. if (res.confirm) {
  15295. if (successBc) successBc();
  15296. } else if (res.cancel) {
  15297. if (errorBc) errorBc();
  15298. }
  15299. }
  15300. });
  15301. };
  15302. exports.confirmMsgFn = confirmMsgFn;
  15303. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  15304. /***/ }),
  15305. /***/ 7:
  15306. /*!*********************************************************************!*\
  15307. !*** ./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***!
  15308. \*********************************************************************/
  15309. /*! no static exports found */
  15310. /***/ (function(module, exports) {
  15311. function _iterableToArrayLimit(arr, i) {
  15312. var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
  15313. if (null != _i) {
  15314. var _s,
  15315. _e,
  15316. _x,
  15317. _r,
  15318. _arr = [],
  15319. _n = !0,
  15320. _d = !1;
  15321. try {
  15322. if (_x = (_i = _i.call(arr)).next, 0 === i) {
  15323. if (Object(_i) !== _i) return;
  15324. _n = !1;
  15325. } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) {
  15326. ;
  15327. }
  15328. } catch (err) {
  15329. _d = !0, _e = err;
  15330. } finally {
  15331. try {
  15332. if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
  15333. } finally {
  15334. if (_d) throw _e;
  15335. }
  15336. }
  15337. return _arr;
  15338. }
  15339. }
  15340. module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
  15341. /***/ }),
  15342. /***/ 8:
  15343. /*!***************************************************************************!*\
  15344. !*** ./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***!
  15345. \***************************************************************************/
  15346. /*! no static exports found */
  15347. /***/ (function(module, exports, __webpack_require__) {
  15348. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  15349. function _unsupportedIterableToArray(o, minLen) {
  15350. if (!o) return;
  15351. if (typeof o === "string") return arrayLikeToArray(o, minLen);
  15352. var n = Object.prototype.toString.call(o).slice(8, -1);
  15353. if (n === "Object" && o.constructor) n = o.constructor.name;
  15354. if (n === "Map" || n === "Set") return Array.from(o);
  15355. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
  15356. }
  15357. module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  15358. /***/ }),
  15359. /***/ 9:
  15360. /*!*****************************************************************!*\
  15361. !*** ./node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
  15362. \*****************************************************************/
  15363. /*! no static exports found */
  15364. /***/ (function(module, exports) {
  15365. function _arrayLikeToArray(arr, len) {
  15366. if (len == null || len > arr.length) len = arr.length;
  15367. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  15368. arr2[i] = arr[i];
  15369. }
  15370. return arr2;
  15371. }
  15372. module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  15373. /***/ })
  15374. }]);
  15375. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map