vendor.js 473 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],{
  2. /***/ 1:
  3. /*!************************************************************!*\
  4. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  5. \************************************************************/
  6. /*! no static exports found */
  7. /***/ (function(module, exports, __webpack_require__) {
  8. "use strict";
  9. /* WEBPACK VAR INJECTION */(function(global) {Object.defineProperty(exports, "__esModule", { value: true });exports.createApp = createApp;exports.createComponent = createComponent;exports.createPage = createPage;exports.createPlugin = createPlugin;exports.createSubpackageApp = createSubpackageApp;exports.default = void 0;var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 3);
  10. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 4));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArrayLimit(arr, i) {if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"] != null) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _toConsumableArray(arr) {return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();}function _nonIterableSpread() {throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _iterableToArray(iter) {if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);}function _arrayWithoutHoles(arr) {if (Array.isArray(arr)) return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;}
  11. var realAtob;
  12. var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  13. var b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  14. if (typeof atob !== 'function') {
  15. realAtob = function realAtob(str) {
  16. str = String(str).replace(/[\t\n\f\r ]+/g, '');
  17. if (!b64re.test(str)) {throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");}
  18. // Adding the padding if missing, for semplicity
  19. str += '=='.slice(2 - (str.length & 3));
  20. var bitmap;var result = '';var r1;var r2;var i = 0;
  21. for (; i < str.length;) {
  22. bitmap = b64.indexOf(str.charAt(i++)) << 18 | b64.indexOf(str.charAt(i++)) << 12 |
  23. (r1 = b64.indexOf(str.charAt(i++))) << 6 | (r2 = b64.indexOf(str.charAt(i++)));
  24. result += r1 === 64 ? String.fromCharCode(bitmap >> 16 & 255) :
  25. r2 === 64 ? String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255) :
  26. String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255);
  27. }
  28. return result;
  29. };
  30. } else {
  31. // 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法
  32. realAtob = atob;
  33. }
  34. function b64DecodeUnicode(str) {
  35. return decodeURIComponent(realAtob(str).split('').map(function (c) {
  36. return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
  37. }).join(''));
  38. }
  39. function getCurrentUserInfo() {
  40. var token = wx.getStorageSync('uni_id_token') || '';
  41. var tokenArr = token.split('.');
  42. if (!token || tokenArr.length !== 3) {
  43. return {
  44. uid: null,
  45. role: [],
  46. permission: [],
  47. tokenExpired: 0 };
  48. }
  49. var userInfo;
  50. try {
  51. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  52. } catch (error) {
  53. throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message);
  54. }
  55. userInfo.tokenExpired = userInfo.exp * 1000;
  56. delete userInfo.exp;
  57. delete userInfo.iat;
  58. return userInfo;
  59. }
  60. function uniIdMixin(Vue) {
  61. Vue.prototype.uniIDHasRole = function (roleId) {var _getCurrentUserInfo =
  62. getCurrentUserInfo(),role = _getCurrentUserInfo.role;
  63. return role.indexOf(roleId) > -1;
  64. };
  65. Vue.prototype.uniIDHasPermission = function (permissionId) {var _getCurrentUserInfo2 =
  66. getCurrentUserInfo(),permission = _getCurrentUserInfo2.permission;
  67. return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1;
  68. };
  69. Vue.prototype.uniIDTokenValid = function () {var _getCurrentUserInfo3 =
  70. getCurrentUserInfo(),tokenExpired = _getCurrentUserInfo3.tokenExpired;
  71. return tokenExpired > Date.now();
  72. };
  73. }
  74. var _toString = Object.prototype.toString;
  75. var hasOwnProperty = Object.prototype.hasOwnProperty;
  76. function isFn(fn) {
  77. return typeof fn === 'function';
  78. }
  79. function isStr(str) {
  80. return typeof str === 'string';
  81. }
  82. function isPlainObject(obj) {
  83. return _toString.call(obj) === '[object Object]';
  84. }
  85. function hasOwn(obj, key) {
  86. return hasOwnProperty.call(obj, key);
  87. }
  88. function noop() {}
  89. /**
  90. * Create a cached version of a pure function.
  91. */
  92. function cached(fn) {
  93. var cache = Object.create(null);
  94. return function cachedFn(str) {
  95. var hit = cache[str];
  96. return hit || (cache[str] = fn(str));
  97. };
  98. }
  99. /**
  100. * Camelize a hyphen-delimited string.
  101. */
  102. var camelizeRE = /-(\w)/g;
  103. var camelize = cached(function (str) {
  104. return str.replace(camelizeRE, function (_, c) {return c ? c.toUpperCase() : '';});
  105. });
  106. function sortObject(obj) {
  107. var sortObj = {};
  108. if (isPlainObject(obj)) {
  109. Object.keys(obj).sort().forEach(function (key) {
  110. sortObj[key] = obj[key];
  111. });
  112. }
  113. return !Object.keys(sortObj) ? obj : sortObj;
  114. }
  115. var HOOKS = [
  116. 'invoke',
  117. 'success',
  118. 'fail',
  119. 'complete',
  120. 'returnValue'];
  121. var globalInterceptors = {};
  122. var scopedInterceptors = {};
  123. function mergeHook(parentVal, childVal) {
  124. var res = childVal ?
  125. parentVal ?
  126. parentVal.concat(childVal) :
  127. Array.isArray(childVal) ?
  128. childVal : [childVal] :
  129. parentVal;
  130. return res ?
  131. dedupeHooks(res) :
  132. res;
  133. }
  134. function dedupeHooks(hooks) {
  135. var res = [];
  136. for (var i = 0; i < hooks.length; i++) {
  137. if (res.indexOf(hooks[i]) === -1) {
  138. res.push(hooks[i]);
  139. }
  140. }
  141. return res;
  142. }
  143. function removeHook(hooks, hook) {
  144. var index = hooks.indexOf(hook);
  145. if (index !== -1) {
  146. hooks.splice(index, 1);
  147. }
  148. }
  149. function mergeInterceptorHook(interceptor, option) {
  150. Object.keys(option).forEach(function (hook) {
  151. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  152. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  153. }
  154. });
  155. }
  156. function removeInterceptorHook(interceptor, option) {
  157. if (!interceptor || !option) {
  158. return;
  159. }
  160. Object.keys(option).forEach(function (hook) {
  161. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  162. removeHook(interceptor[hook], option[hook]);
  163. }
  164. });
  165. }
  166. function addInterceptor(method, option) {
  167. if (typeof method === 'string' && isPlainObject(option)) {
  168. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  169. } else if (isPlainObject(method)) {
  170. mergeInterceptorHook(globalInterceptors, method);
  171. }
  172. }
  173. function removeInterceptor(method, option) {
  174. if (typeof method === 'string') {
  175. if (isPlainObject(option)) {
  176. removeInterceptorHook(scopedInterceptors[method], option);
  177. } else {
  178. delete scopedInterceptors[method];
  179. }
  180. } else if (isPlainObject(method)) {
  181. removeInterceptorHook(globalInterceptors, method);
  182. }
  183. }
  184. function wrapperHook(hook) {
  185. return function (data) {
  186. return hook(data) || data;
  187. };
  188. }
  189. function isPromise(obj) {
  190. return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  191. }
  192. function queue(hooks, data) {
  193. var promise = false;
  194. for (var i = 0; i < hooks.length; i++) {
  195. var hook = hooks[i];
  196. if (promise) {
  197. promise = Promise.resolve(wrapperHook(hook));
  198. } else {
  199. var res = hook(data);
  200. if (isPromise(res)) {
  201. promise = Promise.resolve(res);
  202. }
  203. if (res === false) {
  204. return {
  205. then: function then() {} };
  206. }
  207. }
  208. }
  209. return promise || {
  210. then: function then(callback) {
  211. return callback(data);
  212. } };
  213. }
  214. function wrapperOptions(interceptor) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  215. ['success', 'fail', 'complete'].forEach(function (name) {
  216. if (Array.isArray(interceptor[name])) {
  217. var oldCallback = options[name];
  218. options[name] = function callbackInterceptor(res) {
  219. queue(interceptor[name], res).then(function (res) {
  220. /* eslint-disable no-mixed-operators */
  221. return isFn(oldCallback) && oldCallback(res) || res;
  222. });
  223. };
  224. }
  225. });
  226. return options;
  227. }
  228. function wrapperReturnValue(method, returnValue) {
  229. var returnValueHooks = [];
  230. if (Array.isArray(globalInterceptors.returnValue)) {
  231. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(globalInterceptors.returnValue));
  232. }
  233. var interceptor = scopedInterceptors[method];
  234. if (interceptor && Array.isArray(interceptor.returnValue)) {
  235. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(interceptor.returnValue));
  236. }
  237. returnValueHooks.forEach(function (hook) {
  238. returnValue = hook(returnValue) || returnValue;
  239. });
  240. return returnValue;
  241. }
  242. function getApiInterceptorHooks(method) {
  243. var interceptor = Object.create(null);
  244. Object.keys(globalInterceptors).forEach(function (hook) {
  245. if (hook !== 'returnValue') {
  246. interceptor[hook] = globalInterceptors[hook].slice();
  247. }
  248. });
  249. var scopedInterceptor = scopedInterceptors[method];
  250. if (scopedInterceptor) {
  251. Object.keys(scopedInterceptor).forEach(function (hook) {
  252. if (hook !== 'returnValue') {
  253. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  254. }
  255. });
  256. }
  257. return interceptor;
  258. }
  259. function invokeApi(method, api, options) {for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {params[_key - 3] = arguments[_key];}
  260. var interceptor = getApiInterceptorHooks(method);
  261. if (interceptor && Object.keys(interceptor).length) {
  262. if (Array.isArray(interceptor.invoke)) {
  263. var res = queue(interceptor.invoke, options);
  264. return res.then(function (options) {
  265. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  266. });
  267. } else {
  268. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  269. }
  270. }
  271. return api.apply(void 0, [options].concat(params));
  272. }
  273. var promiseInterceptor = {
  274. returnValue: function returnValue(res) {
  275. if (!isPromise(res)) {
  276. return res;
  277. }
  278. return new Promise(function (resolve, reject) {
  279. res.then(function (res) {
  280. if (res[0]) {
  281. reject(res[0]);
  282. } else {
  283. resolve(res[1]);
  284. }
  285. });
  286. });
  287. } };
  288. var SYNC_API_RE =
  289. /^\$|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/;
  290. var CONTEXT_API_RE = /^create|Manager$/;
  291. // Context例外情况
  292. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  293. // 同步例外情况
  294. var ASYNC_API = ['createBLEConnection'];
  295. var CALLBACK_API_RE = /^on|^off/;
  296. function isContextApi(name) {
  297. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  298. }
  299. function isSyncApi(name) {
  300. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  301. }
  302. function isCallbackApi(name) {
  303. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  304. }
  305. function handlePromise(promise) {
  306. return promise.then(function (data) {
  307. return [null, data];
  308. }).
  309. catch(function (err) {return [err];});
  310. }
  311. function shouldPromise(name) {
  312. if (
  313. isContextApi(name) ||
  314. isSyncApi(name) ||
  315. isCallbackApi(name))
  316. {
  317. return false;
  318. }
  319. return true;
  320. }
  321. /* eslint-disable no-extend-native */
  322. if (!Promise.prototype.finally) {
  323. Promise.prototype.finally = function (callback) {
  324. var promise = this.constructor;
  325. return this.then(
  326. function (value) {return promise.resolve(callback()).then(function () {return value;});},
  327. function (reason) {return promise.resolve(callback()).then(function () {
  328. throw reason;
  329. });});
  330. };
  331. }
  332. function promisify(name, api) {
  333. if (!shouldPromise(name)) {
  334. return api;
  335. }
  336. return function promiseApi() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {params[_key2 - 1] = arguments[_key2];}
  337. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  338. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  339. }
  340. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  341. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  342. success: resolve,
  343. fail: reject })].concat(
  344. params));
  345. })));
  346. };
  347. }
  348. var EPS = 1e-4;
  349. var BASE_DEVICE_WIDTH = 750;
  350. var isIOS = false;
  351. var deviceWidth = 0;
  352. var deviceDPR = 0;
  353. function checkDeviceWidth() {var _wx$getSystemInfoSync =
  354. wx.getSystemInfoSync(),platform = _wx$getSystemInfoSync.platform,pixelRatio = _wx$getSystemInfoSync.pixelRatio,windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  355. deviceWidth = windowWidth;
  356. deviceDPR = pixelRatio;
  357. isIOS = platform === 'ios';
  358. }
  359. function upx2px(number, newDeviceWidth) {
  360. if (deviceWidth === 0) {
  361. checkDeviceWidth();
  362. }
  363. number = Number(number);
  364. if (number === 0) {
  365. return 0;
  366. }
  367. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  368. if (result < 0) {
  369. result = -result;
  370. }
  371. result = Math.floor(result + EPS);
  372. if (result === 0) {
  373. if (deviceDPR === 1 || !isIOS) {
  374. result = 1;
  375. } else {
  376. result = 0.5;
  377. }
  378. }
  379. return number < 0 ? -result : result;
  380. }
  381. var LOCALE_ZH_HANS = 'zh-Hans';
  382. var LOCALE_ZH_HANT = 'zh-Hant';
  383. var LOCALE_EN = 'en';
  384. var LOCALE_FR = 'fr';
  385. var LOCALE_ES = 'es';
  386. var messages = {};
  387. var locale;
  388. {
  389. locale = normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  390. }
  391. function initI18nMessages() {
  392. if (!isEnableLocale()) {
  393. return;
  394. }
  395. var localeKeys = Object.keys(__uniConfig.locales);
  396. if (localeKeys.length) {
  397. localeKeys.forEach(function (locale) {
  398. var curMessages = messages[locale];
  399. var userMessages = __uniConfig.locales[locale];
  400. if (curMessages) {
  401. Object.assign(curMessages, userMessages);
  402. } else {
  403. messages[locale] = userMessages;
  404. }
  405. });
  406. }
  407. }
  408. initI18nMessages();
  409. var i18n = (0, _uniI18n.initVueI18n)(
  410. locale,
  411. {});
  412. var t = i18n.t;
  413. var i18nMixin = i18n.mixin = {
  414. beforeCreate: function beforeCreate() {var _this = this;
  415. var unwatch = i18n.i18n.watchLocale(function () {
  416. _this.$forceUpdate();
  417. });
  418. this.$once('hook:beforeDestroy', function () {
  419. unwatch();
  420. });
  421. },
  422. methods: {
  423. $$t: function $$t(key, values) {
  424. return t(key, values);
  425. } } };
  426. var setLocale = i18n.setLocale;
  427. var getLocale = i18n.getLocale;
  428. function initAppLocale(Vue, appVm, locale) {
  429. var state = Vue.observable({
  430. locale: locale || i18n.getLocale() });
  431. var localeWatchers = [];
  432. appVm.$watchLocale = function (fn) {
  433. localeWatchers.push(fn);
  434. };
  435. Object.defineProperty(appVm, '$locale', {
  436. get: function get() {
  437. return state.locale;
  438. },
  439. set: function set(v) {
  440. state.locale = v;
  441. localeWatchers.forEach(function (watch) {return watch(v);});
  442. } });
  443. }
  444. function isEnableLocale() {
  445. return typeof __uniConfig !== 'undefined' && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length;
  446. }
  447. function include(str, parts) {
  448. return !!parts.find(function (part) {return str.indexOf(part) !== -1;});
  449. }
  450. function startsWith(str, parts) {
  451. return parts.find(function (part) {return str.indexOf(part) === 0;});
  452. }
  453. function normalizeLocale(locale, messages) {
  454. if (!locale) {
  455. return;
  456. }
  457. locale = locale.trim().replace(/_/g, '-');
  458. if (messages && messages[locale]) {
  459. return locale;
  460. }
  461. locale = locale.toLowerCase();
  462. if (locale === 'chinese') {
  463. // 支付宝
  464. return LOCALE_ZH_HANS;
  465. }
  466. if (locale.indexOf('zh') === 0) {
  467. if (locale.indexOf('-hans') > -1) {
  468. return LOCALE_ZH_HANS;
  469. }
  470. if (locale.indexOf('-hant') > -1) {
  471. return LOCALE_ZH_HANT;
  472. }
  473. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  474. return LOCALE_ZH_HANT;
  475. }
  476. return LOCALE_ZH_HANS;
  477. }
  478. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  479. if (lang) {
  480. return lang;
  481. }
  482. }
  483. // export function initI18n() {
  484. // const localeKeys = Object.keys(__uniConfig.locales || {})
  485. // if (localeKeys.length) {
  486. // localeKeys.forEach((locale) =>
  487. // i18n.add(locale, __uniConfig.locales[locale])
  488. // )
  489. // }
  490. // }
  491. function getLocale$1() {
  492. // 优先使用 $locale
  493. var app = getApp({
  494. allowDefault: true });
  495. if (app && app.$vm) {
  496. return app.$vm.$locale;
  497. }
  498. return normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  499. }
  500. function setLocale$1(locale) {
  501. var app = getApp();
  502. if (!app) {
  503. return false;
  504. }
  505. var oldLocale = app.$vm.$locale;
  506. if (oldLocale !== locale) {
  507. app.$vm.$locale = locale;
  508. onLocaleChangeCallbacks.forEach(function (fn) {return fn({
  509. locale: locale });});
  510. return true;
  511. }
  512. return false;
  513. }
  514. var onLocaleChangeCallbacks = [];
  515. function onLocaleChange(fn) {
  516. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  517. onLocaleChangeCallbacks.push(fn);
  518. }
  519. }
  520. if (typeof global !== 'undefined') {
  521. global.getLocale = getLocale$1;
  522. }
  523. var interceptors = {
  524. promiseInterceptor: promiseInterceptor };
  525. var baseApi = /*#__PURE__*/Object.freeze({
  526. __proto__: null,
  527. upx2px: upx2px,
  528. getLocale: getLocale$1,
  529. setLocale: setLocale$1,
  530. onLocaleChange: onLocaleChange,
  531. addInterceptor: addInterceptor,
  532. removeInterceptor: removeInterceptor,
  533. interceptors: interceptors });
  534. function findExistsPageIndex(url) {
  535. var pages = getCurrentPages();
  536. var len = pages.length;
  537. while (len--) {
  538. var page = pages[len];
  539. if (page.$page && page.$page.fullPath === url) {
  540. return len;
  541. }
  542. }
  543. return -1;
  544. }
  545. var redirectTo = {
  546. name: function name(fromArgs) {
  547. if (fromArgs.exists === 'back' && fromArgs.delta) {
  548. return 'navigateBack';
  549. }
  550. return 'redirectTo';
  551. },
  552. args: function args(fromArgs) {
  553. if (fromArgs.exists === 'back' && fromArgs.url) {
  554. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  555. if (existsPageIndex !== -1) {
  556. var delta = getCurrentPages().length - 1 - existsPageIndex;
  557. if (delta > 0) {
  558. fromArgs.delta = delta;
  559. }
  560. }
  561. }
  562. } };
  563. var previewImage = {
  564. args: function args(fromArgs) {
  565. var currentIndex = parseInt(fromArgs.current);
  566. if (isNaN(currentIndex)) {
  567. return;
  568. }
  569. var urls = fromArgs.urls;
  570. if (!Array.isArray(urls)) {
  571. return;
  572. }
  573. var len = urls.length;
  574. if (!len) {
  575. return;
  576. }
  577. if (currentIndex < 0) {
  578. currentIndex = 0;
  579. } else if (currentIndex >= len) {
  580. currentIndex = len - 1;
  581. }
  582. if (currentIndex > 0) {
  583. fromArgs.current = urls[currentIndex];
  584. fromArgs.urls = urls.filter(
  585. function (item, index) {return index < currentIndex ? item !== urls[currentIndex] : true;});
  586. } else {
  587. fromArgs.current = urls[0];
  588. }
  589. return {
  590. indicator: false,
  591. loop: false };
  592. } };
  593. var UUID_KEY = '__DC_STAT_UUID';
  594. var deviceId;
  595. function useDeviceId(result) {
  596. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  597. if (!deviceId) {
  598. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  599. wx.setStorage({
  600. key: UUID_KEY,
  601. data: deviceId });
  602. }
  603. result.deviceId = deviceId;
  604. }
  605. function addSafeAreaInsets(result) {
  606. if (result.safeArea) {
  607. var safeArea = result.safeArea;
  608. result.safeAreaInsets = {
  609. top: safeArea.top,
  610. left: safeArea.left,
  611. right: result.windowWidth - safeArea.right,
  612. bottom: result.screenHeight - safeArea.bottom };
  613. }
  614. }
  615. function populateParameters(result) {var _result$brand =
  616. result.brand,brand = _result$brand === void 0 ? '' : _result$brand,_result$model = result.model,model = _result$model === void 0 ? '' : _result$model,_result$system = result.system,system = _result$system === void 0 ? '' : _result$system,_result$language = result.language,language = _result$language === void 0 ? '' : _result$language,theme = result.theme,version = result.version,platform = result.platform,fontSizeSetting = result.fontSizeSetting,SDKVersion = result.SDKVersion,pixelRatio = result.pixelRatio,deviceOrientation = result.deviceOrientation;
  617. // const isQuickApp = "mp-weixin".indexOf('quickapp-webview') !== -1
  618. // osName osVersion
  619. var osName = '';
  620. var osVersion = '';
  621. {
  622. osName = system.split(' ')[0] || '';
  623. osVersion = system.split(' ')[1] || '';
  624. }
  625. var hostVersion = version;
  626. // deviceType
  627. var deviceType = getGetDeviceType(result, model);
  628. // deviceModel
  629. var deviceBrand = getDeviceBrand(brand);
  630. // hostName
  631. var _hostName = getHostName(result);
  632. // deviceOrientation
  633. var _deviceOrientation = deviceOrientation; // 仅 微信 百度 支持
  634. // devicePixelRatio
  635. var _devicePixelRatio = pixelRatio;
  636. // SDKVersion
  637. var _SDKVersion = SDKVersion;
  638. // hostLanguage
  639. var hostLanguage = language.replace(/_/g, '-');
  640. // wx.getAccountInfoSync
  641. var parameters = {
  642. appId: "__UNI__1C40FB4",
  643. appName: "mdapp",
  644. appVersion: "1.0.0",
  645. appVersionCode: "100",
  646. appLanguage: getAppLanguage(hostLanguage),
  647. uniCompileVersion: "3.4.18",
  648. uniRuntimeVersion: "3.4.18",
  649. uniPlatform: undefined || "mp-weixin",
  650. deviceBrand: deviceBrand,
  651. deviceModel: model,
  652. deviceType: deviceType,
  653. devicePixelRatio: _devicePixelRatio,
  654. deviceOrientation: _deviceOrientation,
  655. osName: osName.toLocaleLowerCase(),
  656. osVersion: osVersion,
  657. hostTheme: theme,
  658. hostVersion: hostVersion,
  659. hostLanguage: hostLanguage,
  660. hostName: _hostName,
  661. hostSDKVersion: _SDKVersion,
  662. hostFontSizeSetting: fontSizeSetting,
  663. windowTop: 0,
  664. windowBottom: 0,
  665. // TODO
  666. osLanguage: undefined,
  667. osTheme: undefined,
  668. ua: undefined,
  669. hostPackageName: undefined,
  670. browserName: undefined,
  671. browserVersion: undefined };
  672. Object.assign(result, parameters);
  673. }
  674. function getGetDeviceType(result, model) {
  675. var deviceType = result.deviceType || 'phone';
  676. {
  677. var deviceTypeMaps = {
  678. ipad: 'pad',
  679. windows: 'pc',
  680. mac: 'pc' };
  681. var deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
  682. var _model = model.toLocaleLowerCase();
  683. for (var index = 0; index < deviceTypeMapsKeys.length; index++) {
  684. var _m = deviceTypeMapsKeys[index];
  685. if (_model.indexOf(_m) !== -1) {
  686. deviceType = deviceTypeMaps[_m];
  687. break;
  688. }
  689. }
  690. }
  691. return deviceType;
  692. }
  693. function getDeviceBrand(brand) {
  694. var deviceBrand = brand;
  695. if (deviceBrand) {
  696. deviceBrand = brand.toLocaleLowerCase();
  697. }
  698. return deviceBrand;
  699. }
  700. function getAppLanguage(defaultLanguage) {
  701. return getLocale$1 ?
  702. getLocale$1() :
  703. defaultLanguage;
  704. }
  705. function getHostName(result) {
  706. var _platform = 'WeChat';
  707. var _hostName = result.hostName || _platform; // mp-jd
  708. {
  709. if (result.environment) {
  710. _hostName = result.environment;
  711. } else if (result.host && result.host.env) {
  712. _hostName = result.host.env;
  713. }
  714. }
  715. return _hostName;
  716. }
  717. var getSystemInfo = {
  718. returnValue: function returnValue(result) {
  719. useDeviceId(result);
  720. addSafeAreaInsets(result);
  721. populateParameters(result);
  722. } };
  723. var showActionSheet = {
  724. args: function args(fromArgs) {
  725. if (typeof fromArgs === 'object') {
  726. fromArgs.alertText = fromArgs.title;
  727. }
  728. } };
  729. var getAppBaseInfo = {
  730. returnValue: function returnValue(result) {var _result =
  731. result,version = _result.version,language = _result.language,SDKVersion = _result.SDKVersion,theme = _result.theme;
  732. var _hostName = getHostName(result);
  733. var hostLanguage = language.replace('_', '-');
  734. result = sortObject(Object.assign(result, {
  735. appId: "__UNI__1C40FB4",
  736. appName: "mdapp",
  737. appVersion: "1.0.0",
  738. appVersionCode: "100",
  739. appLanguage: getAppLanguage(hostLanguage),
  740. hostVersion: version,
  741. hostLanguage: hostLanguage,
  742. hostName: _hostName,
  743. hostSDKVersion: SDKVersion,
  744. hostTheme: theme }));
  745. } };
  746. var getDeviceInfo = {
  747. returnValue: function returnValue(result) {var _result2 =
  748. result,brand = _result2.brand,model = _result2.model;
  749. var deviceType = getGetDeviceType(result, model);
  750. var deviceBrand = getDeviceBrand(brand);
  751. useDeviceId(result);
  752. result = sortObject(Object.assign(result, {
  753. deviceType: deviceType,
  754. deviceBrand: deviceBrand,
  755. deviceModel: model }));
  756. } };
  757. var getWindowInfo = {
  758. returnValue: function returnValue(result) {
  759. addSafeAreaInsets(result);
  760. result = sortObject(Object.assign(result, {
  761. windowTop: 0,
  762. windowBottom: 0 }));
  763. } };
  764. // import navigateTo from 'uni-helpers/navigate-to'
  765. var protocols = {
  766. redirectTo: redirectTo,
  767. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  768. previewImage: previewImage,
  769. getSystemInfo: getSystemInfo,
  770. getSystemInfoSync: getSystemInfo,
  771. showActionSheet: showActionSheet,
  772. getAppBaseInfo: getAppBaseInfo,
  773. getDeviceInfo: getDeviceInfo,
  774. getWindowInfo: getWindowInfo };
  775. var todos = [
  776. 'vibrate',
  777. 'preloadPage',
  778. 'unPreloadPage',
  779. 'loadSubPackage'];
  780. var canIUses = [];
  781. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  782. function processCallback(methodName, method, returnValue) {
  783. return function (res) {
  784. return method(processReturnValue(methodName, res, returnValue));
  785. };
  786. }
  787. function processArgs(methodName, fromArgs) {var argsOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};var returnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};var keepFromArgs = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  788. if (isPlainObject(fromArgs)) {// 一般 api 的参数解析
  789. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  790. if (isFn(argsOption)) {
  791. argsOption = argsOption(fromArgs, toArgs) || {};
  792. }
  793. for (var key in fromArgs) {
  794. if (hasOwn(argsOption, key)) {
  795. var keyOption = argsOption[key];
  796. if (isFn(keyOption)) {
  797. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  798. }
  799. if (!keyOption) {// 不支持的参数
  800. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  801. } else if (isStr(keyOption)) {// 重写参数 key
  802. toArgs[keyOption] = fromArgs[key];
  803. } else if (isPlainObject(keyOption)) {// {name:newName,value:value}可重新指定参数 key:value
  804. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  805. }
  806. } else if (CALLBACKS.indexOf(key) !== -1) {
  807. if (isFn(fromArgs[key])) {
  808. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  809. }
  810. } else {
  811. if (!keepFromArgs) {
  812. toArgs[key] = fromArgs[key];
  813. }
  814. }
  815. }
  816. return toArgs;
  817. } else if (isFn(fromArgs)) {
  818. fromArgs = processCallback(methodName, fromArgs, returnValue);
  819. }
  820. return fromArgs;
  821. }
  822. function processReturnValue(methodName, res, returnValue) {var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  823. if (isFn(protocols.returnValue)) {// 处理通用 returnValue
  824. res = protocols.returnValue(methodName, res);
  825. }
  826. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  827. }
  828. function wrapper(methodName, method) {
  829. if (hasOwn(protocols, methodName)) {
  830. var protocol = protocols[methodName];
  831. if (!protocol) {// 暂不支持的 api
  832. return function () {
  833. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  834. };
  835. }
  836. return function (arg1, arg2) {// 目前 api 最多两个参数
  837. var options = protocol;
  838. if (isFn(protocol)) {
  839. options = protocol(arg1);
  840. }
  841. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  842. var args = [arg1];
  843. if (typeof arg2 !== 'undefined') {
  844. args.push(arg2);
  845. }
  846. if (isFn(options.name)) {
  847. methodName = options.name(arg1);
  848. } else if (isStr(options.name)) {
  849. methodName = options.name;
  850. }
  851. var returnValue = wx[methodName].apply(wx, args);
  852. if (isSyncApi(methodName)) {// 同步 api
  853. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  854. }
  855. return returnValue;
  856. };
  857. }
  858. return method;
  859. }
  860. var todoApis = Object.create(null);
  861. var TODOS = [
  862. 'onTabBarMidButtonTap',
  863. 'subscribePush',
  864. 'unsubscribePush',
  865. 'onPush',
  866. 'offPush',
  867. 'share'];
  868. function createTodoApi(name) {
  869. return function todoApi(_ref)
  870. {var fail = _ref.fail,complete = _ref.complete;
  871. var res = {
  872. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported") };
  873. isFn(fail) && fail(res);
  874. isFn(complete) && complete(res);
  875. };
  876. }
  877. TODOS.forEach(function (name) {
  878. todoApis[name] = createTodoApi(name);
  879. });
  880. var providers = {
  881. oauth: ['weixin'],
  882. share: ['weixin'],
  883. payment: ['wxpay'],
  884. push: ['weixin'] };
  885. function getProvider(_ref2)
  886. {var service = _ref2.service,success = _ref2.success,fail = _ref2.fail,complete = _ref2.complete;
  887. var res = false;
  888. if (providers[service]) {
  889. res = {
  890. errMsg: 'getProvider:ok',
  891. service: service,
  892. provider: providers[service] };
  893. isFn(success) && success(res);
  894. } else {
  895. res = {
  896. errMsg: 'getProvider:fail service not found' };
  897. isFn(fail) && fail(res);
  898. }
  899. isFn(complete) && complete(res);
  900. }
  901. var extraApi = /*#__PURE__*/Object.freeze({
  902. __proto__: null,
  903. getProvider: getProvider });
  904. var getEmitter = function () {
  905. var Emitter;
  906. return function getUniEmitter() {
  907. if (!Emitter) {
  908. Emitter = new _vue.default();
  909. }
  910. return Emitter;
  911. };
  912. }();
  913. function apply(ctx, method, args) {
  914. return ctx[method].apply(ctx, args);
  915. }
  916. function $on() {
  917. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  918. }
  919. function $off() {
  920. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  921. }
  922. function $once() {
  923. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  924. }
  925. function $emit() {
  926. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  927. }
  928. var eventApi = /*#__PURE__*/Object.freeze({
  929. __proto__: null,
  930. $on: $on,
  931. $off: $off,
  932. $once: $once,
  933. $emit: $emit });
  934. /**
  935. * 框架内 try-catch
  936. */
  937. /**
  938. * 开发者 try-catch
  939. */
  940. function tryCatch(fn) {
  941. return function () {
  942. try {
  943. return fn.apply(fn, arguments);
  944. } catch (e) {
  945. // TODO
  946. console.error(e);
  947. }
  948. };
  949. }
  950. function getApiCallbacks(params) {
  951. var apiCallbacks = {};
  952. for (var name in params) {
  953. var param = params[name];
  954. if (isFn(param)) {
  955. apiCallbacks[name] = tryCatch(param);
  956. delete params[name];
  957. }
  958. }
  959. return apiCallbacks;
  960. }
  961. var cid;
  962. var cidErrMsg;
  963. function normalizePushMessage(message) {
  964. try {
  965. return JSON.parse(message);
  966. } catch (e) {}
  967. return message;
  968. }
  969. function invokePushCallback(
  970. args)
  971. {
  972. if (args.type === 'clientId') {
  973. cid = args.cid;
  974. cidErrMsg = args.errMsg;
  975. invokeGetPushCidCallbacks(cid, args.errMsg);
  976. } else if (args.type === 'pushMsg') {
  977. onPushMessageCallbacks.forEach(function (callback) {
  978. callback({
  979. type: 'receive',
  980. data: normalizePushMessage(args.message) });
  981. });
  982. } else if (args.type === 'click') {
  983. onPushMessageCallbacks.forEach(function (callback) {
  984. callback({
  985. type: 'click',
  986. data: normalizePushMessage(args.message) });
  987. });
  988. }
  989. }
  990. var getPushCidCallbacks = [];
  991. function invokeGetPushCidCallbacks(cid, errMsg) {
  992. getPushCidCallbacks.forEach(function (callback) {
  993. callback(cid, errMsg);
  994. });
  995. getPushCidCallbacks.length = 0;
  996. }
  997. function getPushClientid(args) {
  998. if (!isPlainObject(args)) {
  999. args = {};
  1000. }var _getApiCallbacks =
  1001. getApiCallbacks(args),success = _getApiCallbacks.success,fail = _getApiCallbacks.fail,complete = _getApiCallbacks.complete;
  1002. var hasSuccess = isFn(success);
  1003. var hasFail = isFn(fail);
  1004. var hasComplete = isFn(complete);
  1005. getPushCidCallbacks.push(function (cid, errMsg) {
  1006. var res;
  1007. if (cid) {
  1008. res = {
  1009. errMsg: 'getPushClientid:ok',
  1010. cid: cid };
  1011. hasSuccess && success(res);
  1012. } else {
  1013. res = {
  1014. errMsg: 'getPushClientid:fail' + (errMsg ? ' ' + errMsg : '') };
  1015. hasFail && fail(res);
  1016. }
  1017. hasComplete && complete(res);
  1018. });
  1019. if (typeof cid !== 'undefined') {
  1020. Promise.resolve().then(function () {return invokeGetPushCidCallbacks(cid, cidErrMsg);});
  1021. }
  1022. }
  1023. var onPushMessageCallbacks = [];
  1024. // 不使用 defineOnApi 实现,是因为 defineOnApi 依赖 UniServiceJSBridge ,该对象目前在小程序上未提供,故简单实现
  1025. var onPushMessage = function onPushMessage(fn) {
  1026. if (onPushMessageCallbacks.indexOf(fn) === -1) {
  1027. onPushMessageCallbacks.push(fn);
  1028. }
  1029. };
  1030. var offPushMessage = function offPushMessage(fn) {
  1031. if (!fn) {
  1032. onPushMessageCallbacks.length = 0;
  1033. } else {
  1034. var index = onPushMessageCallbacks.indexOf(fn);
  1035. if (index > -1) {
  1036. onPushMessageCallbacks.splice(index, 1);
  1037. }
  1038. }
  1039. };
  1040. var api = /*#__PURE__*/Object.freeze({
  1041. __proto__: null,
  1042. getPushClientid: getPushClientid,
  1043. onPushMessage: onPushMessage,
  1044. offPushMessage: offPushMessage,
  1045. invokePushCallback: invokePushCallback });
  1046. var MPPage = Page;
  1047. var MPComponent = Component;
  1048. var customizeRE = /:/g;
  1049. var customize = cached(function (str) {
  1050. return camelize(str.replace(customizeRE, '-'));
  1051. });
  1052. function initTriggerEvent(mpInstance) {
  1053. var oldTriggerEvent = mpInstance.triggerEvent;
  1054. var newTriggerEvent = function newTriggerEvent(event) {for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {args[_key3 - 1] = arguments[_key3];}
  1055. return oldTriggerEvent.apply(mpInstance, [customize(event)].concat(args));
  1056. };
  1057. try {
  1058. // 京东小程序 triggerEvent 为只读
  1059. mpInstance.triggerEvent = newTriggerEvent;
  1060. } catch (error) {
  1061. mpInstance._triggerEvent = newTriggerEvent;
  1062. }
  1063. }
  1064. function initHook(name, options, isComponent) {
  1065. var oldHook = options[name];
  1066. if (!oldHook) {
  1067. options[name] = function () {
  1068. initTriggerEvent(this);
  1069. };
  1070. } else {
  1071. options[name] = function () {
  1072. initTriggerEvent(this);for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {args[_key4] = arguments[_key4];}
  1073. return oldHook.apply(this, args);
  1074. };
  1075. }
  1076. }
  1077. if (!MPPage.__$wrappered) {
  1078. MPPage.__$wrappered = true;
  1079. Page = function Page() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1080. initHook('onLoad', options);
  1081. return MPPage(options);
  1082. };
  1083. Page.after = MPPage.after;
  1084. Component = function Component() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1085. initHook('created', options);
  1086. return MPComponent(options);
  1087. };
  1088. }
  1089. var PAGE_EVENT_HOOKS = [
  1090. 'onPullDownRefresh',
  1091. 'onReachBottom',
  1092. 'onAddToFavorites',
  1093. 'onShareTimeline',
  1094. 'onShareAppMessage',
  1095. 'onPageScroll',
  1096. 'onResize',
  1097. 'onTabItemTap'];
  1098. function initMocks(vm, mocks) {
  1099. var mpInstance = vm.$mp[vm.mpType];
  1100. mocks.forEach(function (mock) {
  1101. if (hasOwn(mpInstance, mock)) {
  1102. vm[mock] = mpInstance[mock];
  1103. }
  1104. });
  1105. }
  1106. function hasHook(hook, vueOptions) {
  1107. if (!vueOptions) {
  1108. return true;
  1109. }
  1110. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  1111. return true;
  1112. }
  1113. vueOptions = vueOptions.default || vueOptions;
  1114. if (isFn(vueOptions)) {
  1115. if (isFn(vueOptions.extendOptions[hook])) {
  1116. return true;
  1117. }
  1118. if (vueOptions.super &&
  1119. vueOptions.super.options &&
  1120. Array.isArray(vueOptions.super.options[hook])) {
  1121. return true;
  1122. }
  1123. return false;
  1124. }
  1125. if (isFn(vueOptions[hook])) {
  1126. return true;
  1127. }
  1128. var mixins = vueOptions.mixins;
  1129. if (Array.isArray(mixins)) {
  1130. return !!mixins.find(function (mixin) {return hasHook(hook, mixin);});
  1131. }
  1132. }
  1133. function initHooks(mpOptions, hooks, vueOptions) {
  1134. hooks.forEach(function (hook) {
  1135. if (hasHook(hook, vueOptions)) {
  1136. mpOptions[hook] = function (args) {
  1137. return this.$vm && this.$vm.__call_hook(hook, args);
  1138. };
  1139. }
  1140. });
  1141. }
  1142. function initVueComponent(Vue, vueOptions) {
  1143. vueOptions = vueOptions.default || vueOptions;
  1144. var VueComponent;
  1145. if (isFn(vueOptions)) {
  1146. VueComponent = vueOptions;
  1147. } else {
  1148. VueComponent = Vue.extend(vueOptions);
  1149. }
  1150. vueOptions = VueComponent.options;
  1151. return [VueComponent, vueOptions];
  1152. }
  1153. function initSlots(vm, vueSlots) {
  1154. if (Array.isArray(vueSlots) && vueSlots.length) {
  1155. var $slots = Object.create(null);
  1156. vueSlots.forEach(function (slotName) {
  1157. $slots[slotName] = true;
  1158. });
  1159. vm.$scopedSlots = vm.$slots = $slots;
  1160. }
  1161. }
  1162. function initVueIds(vueIds, mpInstance) {
  1163. vueIds = (vueIds || '').split(',');
  1164. var len = vueIds.length;
  1165. if (len === 1) {
  1166. mpInstance._$vueId = vueIds[0];
  1167. } else if (len === 2) {
  1168. mpInstance._$vueId = vueIds[0];
  1169. mpInstance._$vuePid = vueIds[1];
  1170. }
  1171. }
  1172. function initData(vueOptions, context) {
  1173. var data = vueOptions.data || {};
  1174. var methods = vueOptions.methods || {};
  1175. if (typeof data === 'function') {
  1176. try {
  1177. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  1178. } catch (e) {
  1179. if (Object({"VUE_APP_NAME":"mdapp","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  1180. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  1181. }
  1182. }
  1183. } else {
  1184. try {
  1185. // 对 data 格式化
  1186. data = JSON.parse(JSON.stringify(data));
  1187. } catch (e) {}
  1188. }
  1189. if (!isPlainObject(data)) {
  1190. data = {};
  1191. }
  1192. Object.keys(methods).forEach(function (methodName) {
  1193. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  1194. data[methodName] = methods[methodName];
  1195. }
  1196. });
  1197. return data;
  1198. }
  1199. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  1200. function createObserver(name) {
  1201. return function observer(newVal, oldVal) {
  1202. if (this.$vm) {
  1203. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  1204. }
  1205. };
  1206. }
  1207. function initBehaviors(vueOptions, initBehavior) {
  1208. var vueBehaviors = vueOptions.behaviors;
  1209. var vueExtends = vueOptions.extends;
  1210. var vueMixins = vueOptions.mixins;
  1211. var vueProps = vueOptions.props;
  1212. if (!vueProps) {
  1213. vueOptions.props = vueProps = [];
  1214. }
  1215. var behaviors = [];
  1216. if (Array.isArray(vueBehaviors)) {
  1217. vueBehaviors.forEach(function (behavior) {
  1218. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  1219. if (behavior === 'uni://form-field') {
  1220. if (Array.isArray(vueProps)) {
  1221. vueProps.push('name');
  1222. vueProps.push('value');
  1223. } else {
  1224. vueProps.name = {
  1225. type: String,
  1226. default: '' };
  1227. vueProps.value = {
  1228. type: [String, Number, Boolean, Array, Object, Date],
  1229. default: '' };
  1230. }
  1231. }
  1232. });
  1233. }
  1234. if (isPlainObject(vueExtends) && vueExtends.props) {
  1235. behaviors.push(
  1236. initBehavior({
  1237. properties: initProperties(vueExtends.props, true) }));
  1238. }
  1239. if (Array.isArray(vueMixins)) {
  1240. vueMixins.forEach(function (vueMixin) {
  1241. if (isPlainObject(vueMixin) && vueMixin.props) {
  1242. behaviors.push(
  1243. initBehavior({
  1244. properties: initProperties(vueMixin.props, true) }));
  1245. }
  1246. });
  1247. }
  1248. return behaviors;
  1249. }
  1250. function parsePropType(key, type, defaultValue, file) {
  1251. // [String]=>String
  1252. if (Array.isArray(type) && type.length === 1) {
  1253. return type[0];
  1254. }
  1255. return type;
  1256. }
  1257. function initProperties(props) {var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  1258. var properties = {};
  1259. if (!isBehavior) {
  1260. properties.vueId = {
  1261. type: String,
  1262. value: '' };
  1263. // 用于字节跳动小程序模拟抽象节点
  1264. properties.generic = {
  1265. type: Object,
  1266. value: null };
  1267. // scopedSlotsCompiler auto
  1268. properties.scopedSlotsCompiler = {
  1269. type: String,
  1270. value: '' };
  1271. properties.vueSlots = { // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  1272. type: null,
  1273. value: [],
  1274. observer: function observer(newVal, oldVal) {
  1275. var $slots = Object.create(null);
  1276. newVal.forEach(function (slotName) {
  1277. $slots[slotName] = true;
  1278. });
  1279. this.setData({
  1280. $slots: $slots });
  1281. } };
  1282. }
  1283. if (Array.isArray(props)) {// ['title']
  1284. props.forEach(function (key) {
  1285. properties[key] = {
  1286. type: null,
  1287. observer: createObserver(key) };
  1288. });
  1289. } else if (isPlainObject(props)) {// {title:{type:String,default:''},content:String}
  1290. Object.keys(props).forEach(function (key) {
  1291. var opts = props[key];
  1292. if (isPlainObject(opts)) {// title:{type:String,default:''}
  1293. var value = opts.default;
  1294. if (isFn(value)) {
  1295. value = value();
  1296. }
  1297. opts.type = parsePropType(key, opts.type);
  1298. properties[key] = {
  1299. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  1300. value: value,
  1301. observer: createObserver(key) };
  1302. } else {// content:String
  1303. var type = parsePropType(key, opts);
  1304. properties[key] = {
  1305. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  1306. observer: createObserver(key) };
  1307. }
  1308. });
  1309. }
  1310. return properties;
  1311. }
  1312. function wrapper$1(event) {
  1313. // TODO 又得兼容 mpvue 的 mp 对象
  1314. try {
  1315. event.mp = JSON.parse(JSON.stringify(event));
  1316. } catch (e) {}
  1317. event.stopPropagation = noop;
  1318. event.preventDefault = noop;
  1319. event.target = event.target || {};
  1320. if (!hasOwn(event, 'detail')) {
  1321. event.detail = {};
  1322. }
  1323. if (hasOwn(event, 'markerId')) {
  1324. event.detail = typeof event.detail === 'object' ? event.detail : {};
  1325. event.detail.markerId = event.markerId;
  1326. }
  1327. if (isPlainObject(event.detail)) {
  1328. event.target = Object.assign({}, event.target, event.detail);
  1329. }
  1330. return event;
  1331. }
  1332. function getExtraValue(vm, dataPathsArray) {
  1333. var context = vm;
  1334. dataPathsArray.forEach(function (dataPathArray) {
  1335. var dataPath = dataPathArray[0];
  1336. var value = dataPathArray[2];
  1337. if (dataPath || typeof value !== 'undefined') {// ['','',index,'disable']
  1338. var propPath = dataPathArray[1];
  1339. var valuePath = dataPathArray[3];
  1340. var vFor;
  1341. if (Number.isInteger(dataPath)) {
  1342. vFor = dataPath;
  1343. } else if (!dataPath) {
  1344. vFor = context;
  1345. } else if (typeof dataPath === 'string' && dataPath) {
  1346. if (dataPath.indexOf('#s#') === 0) {
  1347. vFor = dataPath.substr(3);
  1348. } else {
  1349. vFor = vm.__get_value(dataPath, context);
  1350. }
  1351. }
  1352. if (Number.isInteger(vFor)) {
  1353. context = value;
  1354. } else if (!propPath) {
  1355. context = vFor[value];
  1356. } else {
  1357. if (Array.isArray(vFor)) {
  1358. context = vFor.find(function (vForItem) {
  1359. return vm.__get_value(propPath, vForItem) === value;
  1360. });
  1361. } else if (isPlainObject(vFor)) {
  1362. context = Object.keys(vFor).find(function (vForKey) {
  1363. return vm.__get_value(propPath, vFor[vForKey]) === value;
  1364. });
  1365. } else {
  1366. console.error('v-for 暂不支持循环数据:', vFor);
  1367. }
  1368. }
  1369. if (valuePath) {
  1370. context = vm.__get_value(valuePath, context);
  1371. }
  1372. }
  1373. });
  1374. return context;
  1375. }
  1376. function processEventExtra(vm, extra, event) {
  1377. var extraObj = {};
  1378. if (Array.isArray(extra) && extra.length) {
  1379. /**
  1380. *[
  1381. * ['data.items', 'data.id', item.data.id],
  1382. * ['metas', 'id', meta.id]
  1383. *],
  1384. *[
  1385. * ['data.items', 'data.id', item.data.id],
  1386. * ['metas', 'id', meta.id]
  1387. *],
  1388. *'test'
  1389. */
  1390. extra.forEach(function (dataPath, index) {
  1391. if (typeof dataPath === 'string') {
  1392. if (!dataPath) {// model,prop.sync
  1393. extraObj['$' + index] = vm;
  1394. } else {
  1395. if (dataPath === '$event') {// $event
  1396. extraObj['$' + index] = event;
  1397. } else if (dataPath === 'arguments') {
  1398. if (event.detail && event.detail.__args__) {
  1399. extraObj['$' + index] = event.detail.__args__;
  1400. } else {
  1401. extraObj['$' + index] = [event];
  1402. }
  1403. } else if (dataPath.indexOf('$event.') === 0) {// $event.target.value
  1404. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  1405. } else {
  1406. extraObj['$' + index] = vm.__get_value(dataPath);
  1407. }
  1408. }
  1409. } else {
  1410. extraObj['$' + index] = getExtraValue(vm, dataPath);
  1411. }
  1412. });
  1413. }
  1414. return extraObj;
  1415. }
  1416. function getObjByArray(arr) {
  1417. var obj = {};
  1418. for (var i = 1; i < arr.length; i++) {
  1419. var element = arr[i];
  1420. obj[element[0]] = element[1];
  1421. }
  1422. return obj;
  1423. }
  1424. function processEventArgs(vm, event) {var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];var extra = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];var isCustom = arguments.length > 4 ? arguments[4] : undefined;var methodName = arguments.length > 5 ? arguments[5] : undefined;
  1425. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  1426. if (isCustom) {// 自定义事件
  1427. isCustomMPEvent = event.currentTarget &&
  1428. event.currentTarget.dataset &&
  1429. event.currentTarget.dataset.comType === 'wx';
  1430. if (!args.length) {// 无参数,直接传入 event 或 detail 数组
  1431. if (isCustomMPEvent) {
  1432. return [event];
  1433. }
  1434. return event.detail.__args__ || event.detail;
  1435. }
  1436. }
  1437. var extraObj = processEventExtra(vm, extra, event);
  1438. var ret = [];
  1439. args.forEach(function (arg) {
  1440. if (arg === '$event') {
  1441. if (methodName === '__set_model' && !isCustom) {// input v-model value
  1442. ret.push(event.target.value);
  1443. } else {
  1444. if (isCustom && !isCustomMPEvent) {
  1445. ret.push(event.detail.__args__[0]);
  1446. } else {// wxcomponent 组件或内置组件
  1447. ret.push(event);
  1448. }
  1449. }
  1450. } else {
  1451. if (Array.isArray(arg) && arg[0] === 'o') {
  1452. ret.push(getObjByArray(arg));
  1453. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  1454. ret.push(extraObj[arg]);
  1455. } else {
  1456. ret.push(arg);
  1457. }
  1458. }
  1459. });
  1460. return ret;
  1461. }
  1462. var ONCE = '~';
  1463. var CUSTOM = '^';
  1464. function isMatchEventType(eventType, optType) {
  1465. return eventType === optType ||
  1466. optType === 'regionchange' && (
  1467. eventType === 'begin' ||
  1468. eventType === 'end');
  1469. }
  1470. function getContextVm(vm) {
  1471. var $parent = vm.$parent;
  1472. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  1473. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  1474. $parent = $parent.$parent;
  1475. }
  1476. return $parent && $parent.$parent;
  1477. }
  1478. function handleEvent(event) {var _this2 = this;
  1479. event = wrapper$1(event);
  1480. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  1481. var dataset = (event.currentTarget || event.target).dataset;
  1482. if (!dataset) {
  1483. return console.warn('事件信息不存在');
  1484. }
  1485. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  1486. if (!eventOpts) {
  1487. return console.warn('事件信息不存在');
  1488. }
  1489. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  1490. var eventType = event.type;
  1491. var ret = [];
  1492. eventOpts.forEach(function (eventOpt) {
  1493. var type = eventOpt[0];
  1494. var eventsArray = eventOpt[1];
  1495. var isCustom = type.charAt(0) === CUSTOM;
  1496. type = isCustom ? type.slice(1) : type;
  1497. var isOnce = type.charAt(0) === ONCE;
  1498. type = isOnce ? type.slice(1) : type;
  1499. if (eventsArray && isMatchEventType(eventType, type)) {
  1500. eventsArray.forEach(function (eventArray) {
  1501. var methodName = eventArray[0];
  1502. if (methodName) {
  1503. var handlerCtx = _this2.$vm;
  1504. if (handlerCtx.$options.generic) {// mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  1505. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  1506. }
  1507. if (methodName === '$emit') {
  1508. handlerCtx.$emit.apply(handlerCtx,
  1509. processEventArgs(
  1510. _this2.$vm,
  1511. event,
  1512. eventArray[1],
  1513. eventArray[2],
  1514. isCustom,
  1515. methodName));
  1516. return;
  1517. }
  1518. var handler = handlerCtx[methodName];
  1519. if (!isFn(handler)) {
  1520. throw new Error(" _vm.".concat(methodName, " is not a function"));
  1521. }
  1522. if (isOnce) {
  1523. if (handler.once) {
  1524. return;
  1525. }
  1526. handler.once = true;
  1527. }
  1528. var params = processEventArgs(
  1529. _this2.$vm,
  1530. event,
  1531. eventArray[1],
  1532. eventArray[2],
  1533. isCustom,
  1534. methodName);
  1535. params = Array.isArray(params) ? params : [];
  1536. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  1537. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  1538. // eslint-disable-next-line no-sparse-arrays
  1539. params = params.concat([,,,,,,,,,, event]);
  1540. }
  1541. ret.push(handler.apply(handlerCtx, params));
  1542. }
  1543. });
  1544. }
  1545. });
  1546. if (
  1547. eventType === 'input' &&
  1548. ret.length === 1 &&
  1549. typeof ret[0] !== 'undefined')
  1550. {
  1551. return ret[0];
  1552. }
  1553. }
  1554. var eventChannels = {};
  1555. var eventChannelStack = [];
  1556. function getEventChannel(id) {
  1557. if (id) {
  1558. var eventChannel = eventChannels[id];
  1559. delete eventChannels[id];
  1560. return eventChannel;
  1561. }
  1562. return eventChannelStack.shift();
  1563. }
  1564. var hooks = [
  1565. 'onShow',
  1566. 'onHide',
  1567. 'onError',
  1568. 'onPageNotFound',
  1569. 'onThemeChange',
  1570. 'onUnhandledRejection'];
  1571. function initEventChannel() {
  1572. _vue.default.prototype.getOpenerEventChannel = function () {
  1573. // 微信小程序使用自身getOpenerEventChannel
  1574. {
  1575. return this.$scope.getOpenerEventChannel();
  1576. }
  1577. };
  1578. var callHook = _vue.default.prototype.__call_hook;
  1579. _vue.default.prototype.__call_hook = function (hook, args) {
  1580. if (hook === 'onLoad' && args && args.__id__) {
  1581. this.__eventChannel__ = getEventChannel(args.__id__);
  1582. delete args.__id__;
  1583. }
  1584. return callHook.call(this, hook, args);
  1585. };
  1586. }
  1587. function initScopedSlotsParams() {
  1588. var center = {};
  1589. var parents = {};
  1590. _vue.default.prototype.$hasScopedSlotsParams = function (vueId) {
  1591. var has = center[vueId];
  1592. if (!has) {
  1593. parents[vueId] = this;
  1594. this.$on('hook:destroyed', function () {
  1595. delete parents[vueId];
  1596. });
  1597. }
  1598. return has;
  1599. };
  1600. _vue.default.prototype.$getScopedSlotsParams = function (vueId, name, key) {
  1601. var data = center[vueId];
  1602. if (data) {
  1603. var object = data[name] || {};
  1604. return key ? object[key] : object;
  1605. } else {
  1606. parents[vueId] = this;
  1607. this.$on('hook:destroyed', function () {
  1608. delete parents[vueId];
  1609. });
  1610. }
  1611. };
  1612. _vue.default.prototype.$setScopedSlotsParams = function (name, value) {
  1613. var vueIds = this.$options.propsData.vueId;
  1614. if (vueIds) {
  1615. var vueId = vueIds.split(',')[0];
  1616. var object = center[vueId] = center[vueId] || {};
  1617. object[name] = value;
  1618. if (parents[vueId]) {
  1619. parents[vueId].$forceUpdate();
  1620. }
  1621. }
  1622. };
  1623. _vue.default.mixin({
  1624. destroyed: function destroyed() {
  1625. var propsData = this.$options.propsData;
  1626. var vueId = propsData && propsData.vueId;
  1627. if (vueId) {
  1628. delete center[vueId];
  1629. delete parents[vueId];
  1630. }
  1631. } });
  1632. }
  1633. function parseBaseApp(vm, _ref3)
  1634. {var mocks = _ref3.mocks,initRefs = _ref3.initRefs;
  1635. initEventChannel();
  1636. {
  1637. initScopedSlotsParams();
  1638. }
  1639. if (vm.$options.store) {
  1640. _vue.default.prototype.$store = vm.$options.store;
  1641. }
  1642. uniIdMixin(_vue.default);
  1643. _vue.default.prototype.mpHost = "mp-weixin";
  1644. _vue.default.mixin({
  1645. beforeCreate: function beforeCreate() {
  1646. if (!this.$options.mpType) {
  1647. return;
  1648. }
  1649. this.mpType = this.$options.mpType;
  1650. this.$mp = _defineProperty({
  1651. data: {} },
  1652. this.mpType, this.$options.mpInstance);
  1653. this.$scope = this.$options.mpInstance;
  1654. delete this.$options.mpType;
  1655. delete this.$options.mpInstance;
  1656. if (this.mpType === 'page' && typeof getApp === 'function') {// hack vue-i18n
  1657. var app = getApp();
  1658. if (app.$vm && app.$vm.$i18n) {
  1659. this._i18n = app.$vm.$i18n;
  1660. }
  1661. }
  1662. if (this.mpType !== 'app') {
  1663. initRefs(this);
  1664. initMocks(this, mocks);
  1665. }
  1666. } });
  1667. var appOptions = {
  1668. onLaunch: function onLaunch(args) {
  1669. if (this.$vm) {// 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  1670. return;
  1671. }
  1672. {
  1673. if (wx.canIUse && !wx.canIUse('nextTick')) {// 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  1674. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  1675. }
  1676. }
  1677. this.$vm = vm;
  1678. this.$vm.$mp = {
  1679. app: this };
  1680. this.$vm.$scope = this;
  1681. // vm 上也挂载 globalData
  1682. this.$vm.globalData = this.globalData;
  1683. this.$vm._isMounted = true;
  1684. this.$vm.__call_hook('mounted', args);
  1685. this.$vm.__call_hook('onLaunch', args);
  1686. } };
  1687. // 兼容旧版本 globalData
  1688. appOptions.globalData = vm.$options.globalData || {};
  1689. // 将 methods 中的方法挂在 getApp() 中
  1690. var methods = vm.$options.methods;
  1691. if (methods) {
  1692. Object.keys(methods).forEach(function (name) {
  1693. appOptions[name] = methods[name];
  1694. });
  1695. }
  1696. initAppLocale(_vue.default, vm, normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN);
  1697. initHooks(appOptions, hooks);
  1698. return appOptions;
  1699. }
  1700. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1701. function findVmByVueId(vm, vuePid) {
  1702. var $children = vm.$children;
  1703. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1704. for (var i = $children.length - 1; i >= 0; i--) {
  1705. var childVm = $children[i];
  1706. if (childVm.$scope._$vueId === vuePid) {
  1707. return childVm;
  1708. }
  1709. }
  1710. // 反向递归查找
  1711. var parentVm;
  1712. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1713. parentVm = findVmByVueId($children[_i], vuePid);
  1714. if (parentVm) {
  1715. return parentVm;
  1716. }
  1717. }
  1718. }
  1719. function initBehavior(options) {
  1720. return Behavior(options);
  1721. }
  1722. function isPage() {
  1723. return !!this.route;
  1724. }
  1725. function initRelation(detail) {
  1726. this.triggerEvent('__l', detail);
  1727. }
  1728. function selectAllComponents(mpInstance, selector, $refs) {
  1729. var components = mpInstance.selectAllComponents(selector);
  1730. components.forEach(function (component) {
  1731. var ref = component.dataset.ref;
  1732. $refs[ref] = component.$vm || component;
  1733. {
  1734. if (component.dataset.vueGeneric === 'scoped') {
  1735. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  1736. selectAllComponents(scopedComponent, selector, $refs);
  1737. });
  1738. }
  1739. }
  1740. });
  1741. }
  1742. function initRefs(vm) {
  1743. var mpInstance = vm.$scope;
  1744. Object.defineProperty(vm, '$refs', {
  1745. get: function get() {
  1746. var $refs = {};
  1747. selectAllComponents(mpInstance, '.vue-ref', $refs);
  1748. // TODO 暂不考虑 for 中的 scoped
  1749. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for');
  1750. forComponents.forEach(function (component) {
  1751. var ref = component.dataset.ref;
  1752. if (!$refs[ref]) {
  1753. $refs[ref] = [];
  1754. }
  1755. $refs[ref].push(component.$vm || component);
  1756. });
  1757. return $refs;
  1758. } });
  1759. }
  1760. function handleLink(event) {var _ref4 =
  1761. event.detail || event.value,vuePid = _ref4.vuePid,vueOptions = _ref4.vueOptions; // detail 是微信,value 是百度(dipatch)
  1762. var parentVm;
  1763. if (vuePid) {
  1764. parentVm = findVmByVueId(this.$vm, vuePid);
  1765. }
  1766. if (!parentVm) {
  1767. parentVm = this.$vm;
  1768. }
  1769. vueOptions.parent = parentVm;
  1770. }
  1771. function parseApp(vm) {
  1772. return parseBaseApp(vm, {
  1773. mocks: mocks,
  1774. initRefs: initRefs });
  1775. }
  1776. function createApp(vm) {
  1777. App(parseApp(vm));
  1778. return vm;
  1779. }
  1780. var encodeReserveRE = /[!'()*]/g;
  1781. var encodeReserveReplacer = function encodeReserveReplacer(c) {return '%' + c.charCodeAt(0).toString(16);};
  1782. var commaRE = /%2C/g;
  1783. // fixed encodeURIComponent which is more conformant to RFC3986:
  1784. // - escapes [!'()*]
  1785. // - preserve commas
  1786. var encode = function encode(str) {return encodeURIComponent(str).
  1787. replace(encodeReserveRE, encodeReserveReplacer).
  1788. replace(commaRE, ',');};
  1789. function stringifyQuery(obj) {var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  1790. var res = obj ? Object.keys(obj).map(function (key) {
  1791. var val = obj[key];
  1792. if (val === undefined) {
  1793. return '';
  1794. }
  1795. if (val === null) {
  1796. return encodeStr(key);
  1797. }
  1798. if (Array.isArray(val)) {
  1799. var result = [];
  1800. val.forEach(function (val2) {
  1801. if (val2 === undefined) {
  1802. return;
  1803. }
  1804. if (val2 === null) {
  1805. result.push(encodeStr(key));
  1806. } else {
  1807. result.push(encodeStr(key) + '=' + encodeStr(val2));
  1808. }
  1809. });
  1810. return result.join('&');
  1811. }
  1812. return encodeStr(key) + '=' + encodeStr(val);
  1813. }).filter(function (x) {return x.length > 0;}).join('&') : null;
  1814. return res ? "?".concat(res) : '';
  1815. }
  1816. function parseBaseComponent(vueComponentOptions)
  1817. {var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},isPage = _ref5.isPage,initRelation = _ref5.initRelation;var _initVueComponent =
  1818. initVueComponent(_vue.default, vueComponentOptions),_initVueComponent2 = _slicedToArray(_initVueComponent, 2),VueComponent = _initVueComponent2[0],vueOptions = _initVueComponent2[1];
  1819. var options = _objectSpread({
  1820. multipleSlots: true,
  1821. addGlobalClass: true },
  1822. vueOptions.options || {});
  1823. {
  1824. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  1825. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  1826. Object.assign(options, vueOptions['mp-weixin'].options);
  1827. }
  1828. }
  1829. var componentOptions = {
  1830. options: options,
  1831. data: initData(vueOptions, _vue.default.prototype),
  1832. behaviors: initBehaviors(vueOptions, initBehavior),
  1833. properties: initProperties(vueOptions.props, false, vueOptions.__file),
  1834. lifetimes: {
  1835. attached: function attached() {
  1836. var properties = this.properties;
  1837. var options = {
  1838. mpType: isPage.call(this) ? 'page' : 'component',
  1839. mpInstance: this,
  1840. propsData: properties };
  1841. initVueIds(properties.vueId, this);
  1842. // 处理父子关系
  1843. initRelation.call(this, {
  1844. vuePid: this._$vuePid,
  1845. vueOptions: options });
  1846. // 初始化 vue 实例
  1847. this.$vm = new VueComponent(options);
  1848. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  1849. initSlots(this.$vm, properties.vueSlots);
  1850. // 触发首次 setData
  1851. this.$vm.$mount();
  1852. },
  1853. ready: function ready() {
  1854. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  1855. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  1856. if (this.$vm) {
  1857. this.$vm._isMounted = true;
  1858. this.$vm.__call_hook('mounted');
  1859. this.$vm.__call_hook('onReady');
  1860. }
  1861. },
  1862. detached: function detached() {
  1863. this.$vm && this.$vm.$destroy();
  1864. } },
  1865. pageLifetimes: {
  1866. show: function show(args) {
  1867. this.$vm && this.$vm.__call_hook('onPageShow', args);
  1868. },
  1869. hide: function hide() {
  1870. this.$vm && this.$vm.__call_hook('onPageHide');
  1871. },
  1872. resize: function resize(size) {
  1873. this.$vm && this.$vm.__call_hook('onPageResize', size);
  1874. } },
  1875. methods: {
  1876. __l: handleLink,
  1877. __e: handleEvent } };
  1878. // externalClasses
  1879. if (vueOptions.externalClasses) {
  1880. componentOptions.externalClasses = vueOptions.externalClasses;
  1881. }
  1882. if (Array.isArray(vueOptions.wxsCallMethods)) {
  1883. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  1884. componentOptions.methods[callMethod] = function (args) {
  1885. return this.$vm[callMethod](args);
  1886. };
  1887. });
  1888. }
  1889. if (isPage) {
  1890. return componentOptions;
  1891. }
  1892. return [componentOptions, VueComponent];
  1893. }
  1894. function parseComponent(vueComponentOptions) {
  1895. return parseBaseComponent(vueComponentOptions, {
  1896. isPage: isPage,
  1897. initRelation: initRelation });
  1898. }
  1899. var hooks$1 = [
  1900. 'onShow',
  1901. 'onHide',
  1902. 'onUnload'];
  1903. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  1904. function parseBasePage(vuePageOptions, _ref6)
  1905. {var isPage = _ref6.isPage,initRelation = _ref6.initRelation;
  1906. var pageOptions = parseComponent(vuePageOptions);
  1907. initHooks(pageOptions.methods, hooks$1, vuePageOptions);
  1908. pageOptions.methods.onLoad = function (query) {
  1909. this.options = query;
  1910. var copyQuery = Object.assign({}, query);
  1911. delete copyQuery.__id__;
  1912. this.$page = {
  1913. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery) };
  1914. this.$vm.$mp.query = query; // 兼容 mpvue
  1915. this.$vm.__call_hook('onLoad', query);
  1916. };
  1917. return pageOptions;
  1918. }
  1919. function parsePage(vuePageOptions) {
  1920. return parseBasePage(vuePageOptions, {
  1921. isPage: isPage,
  1922. initRelation: initRelation });
  1923. }
  1924. function createPage(vuePageOptions) {
  1925. {
  1926. return Component(parsePage(vuePageOptions));
  1927. }
  1928. }
  1929. function createComponent(vueOptions) {
  1930. {
  1931. return Component(parseComponent(vueOptions));
  1932. }
  1933. }
  1934. function createSubpackageApp(vm) {
  1935. var appOptions = parseApp(vm);
  1936. var app = getApp({
  1937. allowDefault: true });
  1938. vm.$scope = app;
  1939. var globalData = app.globalData;
  1940. if (globalData) {
  1941. Object.keys(appOptions.globalData).forEach(function (name) {
  1942. if (!hasOwn(globalData, name)) {
  1943. globalData[name] = appOptions.globalData[name];
  1944. }
  1945. });
  1946. }
  1947. Object.keys(appOptions).forEach(function (name) {
  1948. if (!hasOwn(app, name)) {
  1949. app[name] = appOptions[name];
  1950. }
  1951. });
  1952. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1953. wx.onAppShow(function () {for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {args[_key5] = arguments[_key5];}
  1954. vm.__call_hook('onShow', args);
  1955. });
  1956. }
  1957. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1958. wx.onAppHide(function () {for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {args[_key6] = arguments[_key6];}
  1959. vm.__call_hook('onHide', args);
  1960. });
  1961. }
  1962. if (isFn(appOptions.onLaunch)) {
  1963. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  1964. vm.__call_hook('onLaunch', args);
  1965. }
  1966. return vm;
  1967. }
  1968. function createPlugin(vm) {
  1969. var appOptions = parseApp(vm);
  1970. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1971. wx.onAppShow(function () {for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {args[_key7] = arguments[_key7];}
  1972. vm.__call_hook('onShow', args);
  1973. });
  1974. }
  1975. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1976. wx.onAppHide(function () {for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {args[_key8] = arguments[_key8];}
  1977. vm.__call_hook('onHide', args);
  1978. });
  1979. }
  1980. if (isFn(appOptions.onLaunch)) {
  1981. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  1982. vm.__call_hook('onLaunch', args);
  1983. }
  1984. return vm;
  1985. }
  1986. todos.forEach(function (todoApi) {
  1987. protocols[todoApi] = false;
  1988. });
  1989. canIUses.forEach(function (canIUseApi) {
  1990. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name :
  1991. canIUseApi;
  1992. if (!wx.canIUse(apiName)) {
  1993. protocols[canIUseApi] = false;
  1994. }
  1995. });
  1996. var uni = {};
  1997. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  1998. uni = new Proxy({}, {
  1999. get: function get(target, name) {
  2000. if (hasOwn(target, name)) {
  2001. return target[name];
  2002. }
  2003. if (baseApi[name]) {
  2004. return baseApi[name];
  2005. }
  2006. if (api[name]) {
  2007. return promisify(name, api[name]);
  2008. }
  2009. {
  2010. if (extraApi[name]) {
  2011. return promisify(name, extraApi[name]);
  2012. }
  2013. if (todoApis[name]) {
  2014. return promisify(name, todoApis[name]);
  2015. }
  2016. }
  2017. if (eventApi[name]) {
  2018. return eventApi[name];
  2019. }
  2020. if (!hasOwn(wx, name) && !hasOwn(protocols, name)) {
  2021. return;
  2022. }
  2023. return promisify(name, wrapper(name, wx[name]));
  2024. },
  2025. set: function set(target, name, value) {
  2026. target[name] = value;
  2027. return true;
  2028. } });
  2029. } else {
  2030. Object.keys(baseApi).forEach(function (name) {
  2031. uni[name] = baseApi[name];
  2032. });
  2033. {
  2034. Object.keys(todoApis).forEach(function (name) {
  2035. uni[name] = promisify(name, todoApis[name]);
  2036. });
  2037. Object.keys(extraApi).forEach(function (name) {
  2038. uni[name] = promisify(name, todoApis[name]);
  2039. });
  2040. }
  2041. Object.keys(eventApi).forEach(function (name) {
  2042. uni[name] = eventApi[name];
  2043. });
  2044. Object.keys(api).forEach(function (name) {
  2045. uni[name] = promisify(name, api[name]);
  2046. });
  2047. Object.keys(wx).forEach(function (name) {
  2048. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  2049. uni[name] = promisify(name, wrapper(name, wx[name]));
  2050. }
  2051. });
  2052. }
  2053. wx.createApp = createApp;
  2054. wx.createPage = createPage;
  2055. wx.createComponent = createComponent;
  2056. wx.createSubpackageApp = createSubpackageApp;
  2057. wx.createPlugin = createPlugin;
  2058. var uni$1 = uni;var _default =
  2059. uni$1;exports.default = _default;
  2060. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 2)))
  2061. /***/ }),
  2062. /***/ 11:
  2063. /*!**********************************************************************************************************!*\
  2064. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  2065. \**********************************************************************************************************/
  2066. /*! exports provided: default */
  2067. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2068. "use strict";
  2069. __webpack_require__.r(__webpack_exports__);
  2070. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  2071. /* globals __VUE_SSR_CONTEXT__ */
  2072. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  2073. // This module is a runtime utility for cleaner component module output and will
  2074. // be included in the final webpack user bundle.
  2075. function normalizeComponent (
  2076. scriptExports,
  2077. render,
  2078. staticRenderFns,
  2079. functionalTemplate,
  2080. injectStyles,
  2081. scopeId,
  2082. moduleIdentifier, /* server only */
  2083. shadowMode, /* vue-cli only */
  2084. components, // fixed by xxxxxx auto components
  2085. renderjs // fixed by xxxxxx renderjs
  2086. ) {
  2087. // Vue.extend constructor export interop
  2088. var options = typeof scriptExports === 'function'
  2089. ? scriptExports.options
  2090. : scriptExports
  2091. // fixed by xxxxxx auto components
  2092. if (components) {
  2093. if (!options.components) {
  2094. options.components = {}
  2095. }
  2096. var hasOwn = Object.prototype.hasOwnProperty
  2097. for (var name in components) {
  2098. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  2099. options.components[name] = components[name]
  2100. }
  2101. }
  2102. }
  2103. // fixed by xxxxxx renderjs
  2104. if (renderjs) {
  2105. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  2106. this[renderjs.__module] = this
  2107. });
  2108. (options.mixins || (options.mixins = [])).push(renderjs)
  2109. }
  2110. // render functions
  2111. if (render) {
  2112. options.render = render
  2113. options.staticRenderFns = staticRenderFns
  2114. options._compiled = true
  2115. }
  2116. // functional template
  2117. if (functionalTemplate) {
  2118. options.functional = true
  2119. }
  2120. // scopedId
  2121. if (scopeId) {
  2122. options._scopeId = 'data-v-' + scopeId
  2123. }
  2124. var hook
  2125. if (moduleIdentifier) { // server build
  2126. hook = function (context) {
  2127. // 2.3 injection
  2128. context =
  2129. context || // cached call
  2130. (this.$vnode && this.$vnode.ssrContext) || // stateful
  2131. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  2132. // 2.2 with runInNewContext: true
  2133. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  2134. context = __VUE_SSR_CONTEXT__
  2135. }
  2136. // inject component styles
  2137. if (injectStyles) {
  2138. injectStyles.call(this, context)
  2139. }
  2140. // register component module identifier for async chunk inferrence
  2141. if (context && context._registeredComponents) {
  2142. context._registeredComponents.add(moduleIdentifier)
  2143. }
  2144. }
  2145. // used by ssr in case component is cached and beforeCreate
  2146. // never gets called
  2147. options._ssrRegister = hook
  2148. } else if (injectStyles) {
  2149. hook = shadowMode
  2150. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  2151. : injectStyles
  2152. }
  2153. if (hook) {
  2154. if (options.functional) {
  2155. // for template-only hot-reload because in that case the render fn doesn't
  2156. // go through the normalizer
  2157. options._injectStyles = hook
  2158. // register for functioal component in vue file
  2159. var originalRender = options.render
  2160. options.render = function renderWithStyleInjection (h, context) {
  2161. hook.call(context)
  2162. return originalRender(h, context)
  2163. }
  2164. } else {
  2165. // inject component registration as beforeCreate hook
  2166. var existing = options.beforeCreate
  2167. options.beforeCreate = existing
  2168. ? [].concat(existing, hook)
  2169. : [hook]
  2170. }
  2171. }
  2172. return {
  2173. exports: scriptExports,
  2174. options: options
  2175. }
  2176. }
  2177. /***/ }),
  2178. /***/ 12:
  2179. /*!*******************************************************!*\
  2180. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/index.js ***!
  2181. \*******************************************************/
  2182. /*! no static exports found */
  2183. /***/ (function(module, exports, __webpack_require__) {
  2184. "use strict";
  2185. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  2186. var _mixin = _interopRequireDefault(__webpack_require__(/*! ./libs/mixin/mixin.js */ 13));
  2187. var _request = _interopRequireDefault(__webpack_require__(/*! ./libs/request */ 14));
  2188. var _queryParams = _interopRequireDefault(__webpack_require__(/*! ./libs/function/queryParams.js */ 18));
  2189. var _route = _interopRequireDefault(__webpack_require__(/*! ./libs/function/route.js */ 19));
  2190. var _timeFormat = _interopRequireDefault(__webpack_require__(/*! ./libs/function/timeFormat.js */ 23));
  2191. var _timeFrom = _interopRequireDefault(__webpack_require__(/*! ./libs/function/timeFrom.js */ 24));
  2192. var _colorGradient = _interopRequireDefault(__webpack_require__(/*! ./libs/function/colorGradient.js */ 25));
  2193. var _guid = _interopRequireDefault(__webpack_require__(/*! ./libs/function/guid.js */ 26));
  2194. var _color = _interopRequireDefault(__webpack_require__(/*! ./libs/function/color.js */ 27));
  2195. var _type2icon = _interopRequireDefault(__webpack_require__(/*! ./libs/function/type2icon.js */ 28));
  2196. var _randomArray = _interopRequireDefault(__webpack_require__(/*! ./libs/function/randomArray.js */ 29));
  2197. var _deepClone = _interopRequireDefault(__webpack_require__(/*! ./libs/function/deepClone.js */ 16));
  2198. var _deepMerge = _interopRequireDefault(__webpack_require__(/*! ./libs/function/deepMerge.js */ 15));
  2199. var _addUnit = _interopRequireDefault(__webpack_require__(/*! ./libs/function/addUnit.js */ 30));
  2200. var _test = _interopRequireDefault(__webpack_require__(/*! ./libs/function/test.js */ 17));
  2201. var _random = _interopRequireDefault(__webpack_require__(/*! ./libs/function/random.js */ 31));
  2202. var _trim = _interopRequireDefault(__webpack_require__(/*! ./libs/function/trim.js */ 32));
  2203. var _toast = _interopRequireDefault(__webpack_require__(/*! ./libs/function/toast.js */ 33));
  2204. var _getParent = _interopRequireDefault(__webpack_require__(/*! ./libs/function/getParent.js */ 34));
  2205. var _$parent = _interopRequireDefault(__webpack_require__(/*! ./libs/function/$parent.js */ 35));
  2206. var _sys = __webpack_require__(/*! ./libs/function/sys.js */ 36);
  2207. var _debounce = _interopRequireDefault(__webpack_require__(/*! ./libs/function/debounce.js */ 37));
  2208. var _throttle = _interopRequireDefault(__webpack_require__(/*! ./libs/function/throttle.js */ 38));
  2209. var _config = _interopRequireDefault(__webpack_require__(/*! ./libs/config/config.js */ 39));
  2210. var _zIndex = _interopRequireDefault(__webpack_require__(/*! ./libs/config/zIndex.js */ 40));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} // 引入全局mixin
  2211. // 引入关于是否mixin集成小程序分享的配置
  2212. // import wxshare from './libs/mixin/mpShare.js'
  2213. // 全局挂载引入http相关请求拦截插件
  2214. function wranning(str) {// 开发环境进行信息输出,主要是一些报错信息
  2215. // 这个环境的来由是在程序编写时候,点击hx编辑器运行调试代码的时候,详见:
  2216. // 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
  2217. if (true) {console.warn(str);}} // 尝试判断在根目录的/store中是否有$u.mixin.js,此文件uView默认为需要挂在到全局的vuex的state变量
  2218. // HX2.6.11版本,放到try中,控制台依然会警告,暂时不用此方式,
  2219. // let vuexStore = {};
  2220. // try {
  2221. // vuexStore = require("@/store/$u.mixin.js");
  2222. // } catch (e) {
  2223. // //TODO handle the exception
  2224. // }
  2225. // post类型对象参数转为get类型url参数
  2226. var $u = { queryParams: _queryParams.default, route: _route.default, timeFormat: _timeFormat.default, date: _timeFormat.default, // 另名date
  2227. timeFrom: _timeFrom.default, colorGradient: _colorGradient.default.colorGradient, colorToRgba: _colorGradient.default.colorToRgba, guid: _guid.default, color: _color.default, sys: _sys.sys, os: _sys.os, type2icon: _type2icon.default, randomArray: _randomArray.default, wranning: wranning, get: _request.default.get,
  2228. post: _request.default.post,
  2229. put: _request.default.put,
  2230. 'delete': _request.default.delete,
  2231. hexToRgb: _colorGradient.default.hexToRgb,
  2232. rgbToHex: _colorGradient.default.rgbToHex,
  2233. test: _test.default,
  2234. random: _random.default,
  2235. deepClone: _deepClone.default,
  2236. deepMerge: _deepMerge.default,
  2237. getParent: _getParent.default,
  2238. $parent: _$parent.default,
  2239. addUnit: _addUnit.default,
  2240. trim: _trim.default,
  2241. type: ['primary', 'success', 'error', 'warning', 'info'],
  2242. http: _request.default,
  2243. toast: _toast.default,
  2244. config: _config.default, // uView配置信息相关,比如版本号
  2245. zIndex: _zIndex.default,
  2246. debounce: _debounce.default,
  2247. throttle: _throttle.default };
  2248. // $u挂载到uni对象上
  2249. uni.$u = $u;
  2250. var install = function install(Vue) {
  2251. Vue.mixin(_mixin.default);
  2252. if (Vue.prototype.openShare) {
  2253. Vue.mixin(mpShare);
  2254. }
  2255. // Vue.mixin(vuexStore);
  2256. // 时间格式化,同时两个名称,date和timeFormat
  2257. Vue.filter('timeFormat', function (timestamp, format) {
  2258. return (0, _timeFormat.default)(timestamp, format);
  2259. });
  2260. Vue.filter('date', function (timestamp, format) {
  2261. return (0, _timeFormat.default)(timestamp, format);
  2262. });
  2263. // 将多久以前的方法,注入到全局过滤器
  2264. Vue.filter('timeFrom', function (timestamp, format) {
  2265. return (0, _timeFrom.default)(timestamp, format);
  2266. });
  2267. Vue.prototype.$u = $u;
  2268. };var _default =
  2269. {
  2270. install: install };exports.default = _default;
  2271. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  2272. /***/ }),
  2273. /***/ 13:
  2274. /*!******************************************************************!*\
  2275. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/mixin/mixin.js ***!
  2276. \******************************************************************/
  2277. /*! no static exports found */
  2278. /***/ (function(module, exports, __webpack_require__) {
  2279. "use strict";
  2280. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = {
  2281. data: function data() {
  2282. return {};
  2283. },
  2284. onLoad: function onLoad() {
  2285. // getRect挂载到$u上,因为这方法需要使用in(this),所以无法把它独立成一个单独的文件导出
  2286. this.$u.getRect = this.$uGetRect;
  2287. },
  2288. methods: {
  2289. // 查询节点信息
  2290. // 目前此方法在支付宝小程序中无法获取组件跟接点的尺寸,为支付宝的bug(2020-07-21)
  2291. // 解决办法为在组件根部再套一个没有任何作用的view元素
  2292. $uGetRect: function $uGetRect(selector, all) {var _this = this;
  2293. return new Promise(function (resolve) {
  2294. uni.createSelectorQuery().
  2295. in(_this)[all ? 'selectAll' : 'select'](selector).
  2296. boundingClientRect(function (rect) {
  2297. if (all && Array.isArray(rect) && rect.length) {
  2298. resolve(rect);
  2299. }
  2300. if (!all && rect) {
  2301. resolve(rect);
  2302. }
  2303. }).
  2304. exec();
  2305. });
  2306. },
  2307. getParentData: function getParentData() {var _this2 = this;var parentName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  2308. // 避免在created中去定义parent变量
  2309. if (!this.parent) this.parent = false;
  2310. // 这里的本质原理是,通过获取父组件实例(也即u-radio-group的this)
  2311. // 将父组件this中对应的参数,赋值给本组件(u-radio的this)的parentData对象中对应的属性
  2312. // 之所以需要这么做,是因为所有端中,头条小程序不支持通过this.parent.xxx去监听父组件参数的变化
  2313. this.parent = this.$u.$parent.call(this, parentName);
  2314. if (this.parent) {
  2315. // 历遍parentData中的属性,将parent中的同名属性赋值给parentData
  2316. Object.keys(this.parentData).map(function (key) {
  2317. _this2.parentData[key] = _this2.parent[key];
  2318. });
  2319. }
  2320. },
  2321. // 阻止事件冒泡
  2322. preventEvent: function preventEvent(e) {
  2323. e && e.stopPropagation && e.stopPropagation();
  2324. } },
  2325. onReachBottom: function onReachBottom() {
  2326. uni.$emit('uOnReachBottom');
  2327. },
  2328. beforeDestroy: function beforeDestroy() {var _this3 = this;
  2329. // 判断当前页面是否存在parent和chldren,一般在checkbox和checkbox-group父子联动的场景会有此情况
  2330. // 组件销毁时,移除子组件在父组件children数组中的实例,释放资源,避免数据混乱
  2331. if (this.parent && uni.$u.test.array(this.parent.children)) {
  2332. // 组件销毁时,移除父组件中的children数组中对应的实例
  2333. var childrenList = this.parent.children;
  2334. childrenList.map(function (child, index) {
  2335. // 如果相等,则移除
  2336. if (child === _this3) {
  2337. childrenList.splice(index, 1);
  2338. }
  2339. });
  2340. }
  2341. } };exports.default = _default;
  2342. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  2343. /***/ }),
  2344. /***/ 14:
  2345. /*!********************************************************************!*\
  2346. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/request/index.js ***!
  2347. \********************************************************************/
  2348. /*! no static exports found */
  2349. /***/ (function(module, exports, __webpack_require__) {
  2350. "use strict";
  2351. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _deepMerge = _interopRequireDefault(__webpack_require__(/*! ../function/deepMerge */ 15));
  2352. var _test = _interopRequireDefault(__webpack_require__(/*! ../function/test */ 17));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;}var
  2353. Request = /*#__PURE__*/function () {_createClass(Request, [{ key: "setConfig",
  2354. // 设置全局默认配置
  2355. value: function setConfig(customConfig) {
  2356. // 深度合并对象,否则会造成对象深层属性丢失
  2357. this.config = (0, _deepMerge.default)(this.config, customConfig);
  2358. }
  2359. // 主要请求部分
  2360. }, { key: "request", value: function request() {var _this = this;var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  2361. // 检查请求拦截
  2362. if (this.interceptor.request && typeof this.interceptor.request === 'function') {
  2363. var tmpConfig = {};
  2364. var interceptorRequest = this.interceptor.request(options);
  2365. if (interceptorRequest === false) {
  2366. // 返回一个处于pending状态中的Promise,来取消原promise,避免进入then()回调
  2367. return new Promise(function () {});
  2368. }
  2369. this.options = interceptorRequest;
  2370. }
  2371. options.dataType = options.dataType || this.config.dataType;
  2372. options.responseType = options.responseType || this.config.responseType;
  2373. options.url = options.url || '';
  2374. options.params = options.params || {};
  2375. options.header = Object.assign({}, this.config.header, options.header);
  2376. options.method = options.method || this.config.method;
  2377. return new Promise(function (resolve, reject) {
  2378. options.complete = function (response) {
  2379. // 请求返回后,隐藏loading(如果请求返回快的话,可能会没有loading)
  2380. uni.hideLoading();
  2381. // 清除定时器,如果请求回来了,就无需loading
  2382. clearTimeout(_this.config.timer);
  2383. _this.config.timer = null;
  2384. // 判断用户对拦截返回数据的要求,如果originalData为true,返回所有的数据(response)到拦截器,否则只返回response.data
  2385. if (_this.config.originalData) {
  2386. // 判断是否存在拦截器
  2387. if (_this.interceptor.response && typeof _this.interceptor.response === 'function') {
  2388. var resInterceptors = _this.interceptor.response(response);
  2389. // 如果拦截器不返回false,就将拦截器返回的内容给this.$u.post的then回调
  2390. if (resInterceptors !== false) {
  2391. resolve(resInterceptors);
  2392. } else {
  2393. // 如果拦截器返回false,意味着拦截器定义者认为返回有问题,直接接入catch回调
  2394. reject(response);
  2395. }
  2396. } else {
  2397. // 如果要求返回原始数据,就算没有拦截器,也返回最原始的数据
  2398. resolve(response);
  2399. }
  2400. } else {
  2401. if (response.statusCode == 200) {
  2402. if (_this.interceptor.response && typeof _this.interceptor.response === 'function') {
  2403. var _resInterceptors = _this.interceptor.response(response.data);
  2404. if (_resInterceptors !== false) {
  2405. resolve(_resInterceptors);
  2406. } else {
  2407. reject(response.data);
  2408. }
  2409. } else {
  2410. // 如果不是返回原始数据(originalData=false),且没有拦截器的情况下,返回纯数据给then回调
  2411. resolve(response.data);
  2412. }
  2413. } else {
  2414. // 不返回原始数据的情况下,服务器状态码不为200,modal弹框提示
  2415. // if(response.errMsg) {
  2416. // uni.showModal({
  2417. // title: response.errMsg
  2418. // });
  2419. // }
  2420. reject(response);
  2421. }
  2422. }
  2423. };
  2424. // 判断用户传递的URL是否/开头,如果不是,加上/,这里使用了uView的test.js验证库的url()方法
  2425. options.url = _test.default.url(options.url) ? options.url : _this.config.baseUrl + (options.url.indexOf('/') == 0 ?
  2426. options.url : '/' + options.url);
  2427. // 是否显示loading
  2428. // 加一个是否已有timer定时器的判断,否则有两个同时请求的时候,后者会清除前者的定时器id
  2429. // 而没有清除前者的定时器,导致前者超时,一直显示loading
  2430. if (_this.config.showLoading && !_this.config.timer) {
  2431. _this.config.timer = setTimeout(function () {
  2432. uni.showLoading({
  2433. title: _this.config.loadingText,
  2434. mask: _this.config.loadingMask });
  2435. _this.config.timer = null;
  2436. }, _this.config.loadingTime);
  2437. }
  2438. uni.request(options);
  2439. });
  2440. // .catch(res => {
  2441. // // 如果返回reject(),不让其进入this.$u.post().then().catch()后面的catct()
  2442. // // 因为很多人都会忘了写后面的catch(),导致报错捕获不到catch
  2443. // return new Promise(()=>{});
  2444. // })
  2445. } }]);
  2446. function Request() {var _this2 = this;_classCallCheck(this, Request);
  2447. this.config = {
  2448. baseUrl: '', // 请求的根域名
  2449. // 默认的请求头
  2450. header: {},
  2451. method: 'POST',
  2452. // 设置为json,返回后uni.request会对数据进行一次JSON.parse
  2453. dataType: 'json',
  2454. // 此参数无需处理,因为5+和支付宝小程序不支持,默认为text即可
  2455. responseType: 'text',
  2456. showLoading: true, // 是否显示请求中的loading
  2457. loadingText: '请求中...',
  2458. loadingTime: 800, // 在此时间内,请求还没回来的话,就显示加载中动画,单位ms
  2459. timer: null, // 定时器
  2460. originalData: false, // 是否在拦截器中返回服务端的原始数据,见文档说明
  2461. loadingMask: true // 展示loading的时候,是否给一个透明的蒙层,防止触摸穿透
  2462. };
  2463. // 拦截器
  2464. this.interceptor = {
  2465. // 请求前的拦截
  2466. request: null,
  2467. // 请求后的拦截
  2468. response: null };
  2469. // get请求
  2470. this.get = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  2471. return _this2.request({
  2472. method: 'GET',
  2473. url: url,
  2474. header: header,
  2475. data: data });
  2476. };
  2477. // post请求
  2478. this.post = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  2479. return _this2.request({
  2480. url: url,
  2481. method: 'POST',
  2482. header: header,
  2483. data: data });
  2484. };
  2485. // put请求,不支持支付宝小程序(HX2.6.15)
  2486. this.put = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  2487. return _this2.request({
  2488. url: url,
  2489. method: 'PUT',
  2490. header: header,
  2491. data: data });
  2492. };
  2493. // delete请求,不支持支付宝和头条小程序(HX2.6.15)
  2494. this.delete = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  2495. return _this2.request({
  2496. url: url,
  2497. method: 'DELETE',
  2498. header: header,
  2499. data: data });
  2500. };
  2501. }return Request;}();var _default =
  2502. new Request();exports.default = _default;
  2503. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  2504. /***/ }),
  2505. /***/ 15:
  2506. /*!*************************************************************************!*\
  2507. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/deepMerge.js ***!
  2508. \*************************************************************************/
  2509. /*! no static exports found */
  2510. /***/ (function(module, exports, __webpack_require__) {
  2511. "use strict";
  2512. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _deepClone = _interopRequireDefault(__webpack_require__(/*! ./deepClone */ 16));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  2513. // JS对象深度合并
  2514. function deepMerge() {var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  2515. target = (0, _deepClone.default)(target);
  2516. if (typeof target !== 'object' || typeof source !== 'object') return false;
  2517. for (var prop in source) {
  2518. if (!source.hasOwnProperty(prop)) continue;
  2519. if (prop in target) {
  2520. if (typeof target[prop] !== 'object') {
  2521. target[prop] = source[prop];
  2522. } else {
  2523. if (typeof source[prop] !== 'object') {
  2524. target[prop] = source[prop];
  2525. } else {
  2526. if (target[prop].concat && source[prop].concat) {
  2527. target[prop] = target[prop].concat(source[prop]);
  2528. } else {
  2529. target[prop] = deepMerge(target[prop], source[prop]);
  2530. }
  2531. }
  2532. }
  2533. } else {
  2534. target[prop] = source[prop];
  2535. }
  2536. }
  2537. return target;
  2538. }var _default =
  2539. deepMerge;exports.default = _default;
  2540. /***/ }),
  2541. /***/ 16:
  2542. /*!*************************************************************************!*\
  2543. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/deepClone.js ***!
  2544. \*************************************************************************/
  2545. /*! no static exports found */
  2546. /***/ (function(module, exports, __webpack_require__) {
  2547. "use strict";
  2548. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 判断arr是否为一个数组,返回一个bool值
  2549. function isArray(arr) {
  2550. return Object.prototype.toString.call(arr) === '[object Array]';
  2551. }
  2552. // 深度克隆
  2553. function deepClone(obj) {
  2554. // 对常见的“非”值,直接返回原来值
  2555. if ([null, undefined, NaN, false].includes(obj)) return obj;
  2556. if (typeof obj !== "object" && typeof obj !== 'function') {
  2557. //原始类型直接返回
  2558. return obj;
  2559. }
  2560. var o = isArray(obj) ? [] : {};
  2561. for (var i in obj) {
  2562. if (obj.hasOwnProperty(i)) {
  2563. o[i] = typeof obj[i] === "object" ? deepClone(obj[i]) : obj[i];
  2564. }
  2565. }
  2566. return o;
  2567. }var _default =
  2568. deepClone;exports.default = _default;
  2569. /***/ }),
  2570. /***/ 17:
  2571. /*!********************************************************************!*\
  2572. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/test.js ***!
  2573. \********************************************************************/
  2574. /*! no static exports found */
  2575. /***/ (function(module, exports, __webpack_require__) {
  2576. "use strict";
  2577. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  2578. * 验证电子邮箱格式
  2579. */
  2580. function email(value) {
  2581. return /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(value);
  2582. }
  2583. /**
  2584. * 验证手机格式
  2585. */
  2586. function mobile(value) {
  2587. return /^1[23456789]\d{9}$/.test(value);
  2588. }
  2589. /**
  2590. * 验证URL格式
  2591. */
  2592. function url(value) {
  2593. return /http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w-.\/?%&=]*)?/.test(value);
  2594. }
  2595. /**
  2596. * 验证日期格式
  2597. */
  2598. function date(value) {
  2599. return !/Invalid|NaN/.test(new Date(value).toString());
  2600. }
  2601. /**
  2602. * 验证ISO类型的日期格式
  2603. */
  2604. function dateISO(value) {
  2605. return /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value);
  2606. }
  2607. /**
  2608. * 验证十进制数字
  2609. */
  2610. function number(value) {
  2611. return /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value);
  2612. }
  2613. /**
  2614. * 验证整数
  2615. */
  2616. function digits(value) {
  2617. return /^\d+$/.test(value);
  2618. }
  2619. /**
  2620. * 验证身份证号码
  2621. */
  2622. function idCard(value) {
  2623. 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(
  2624. value);
  2625. }
  2626. /**
  2627. * 是否车牌号
  2628. */
  2629. function carNo(value) {
  2630. // 新能源车牌
  2631. var xreg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF]$)|([DF][A-HJ-NP-Z0-9][0-9]{4}$))/;
  2632. // 旧车牌
  2633. var creg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$/;
  2634. if (value.length === 7) {
  2635. return creg.test(value);
  2636. } else if (value.length === 8) {
  2637. return xreg.test(value);
  2638. } else {
  2639. return false;
  2640. }
  2641. }
  2642. /**
  2643. * 金额,只允许2位小数
  2644. */
  2645. function amount(value) {
  2646. //金额,只允许保留两位小数
  2647. return /^[1-9]\d*(,\d{3})*(\.\d{1,2})?$|^0\.\d{1,2}$/.test(value);
  2648. }
  2649. /**
  2650. * 中文
  2651. */
  2652. function chinese(value) {
  2653. var reg = /^[\u4e00-\u9fa5]+$/gi;
  2654. return reg.test(value);
  2655. }
  2656. /**
  2657. * 只能输入字母
  2658. */
  2659. function letter(value) {
  2660. return /^[a-zA-Z]*$/.test(value);
  2661. }
  2662. /**
  2663. * 只能是字母或者数字
  2664. */
  2665. function enOrNum(value) {
  2666. //英文或者数字
  2667. var reg = /^[0-9a-zA-Z]*$/g;
  2668. return reg.test(value);
  2669. }
  2670. /**
  2671. * 验证是否包含某个值
  2672. */
  2673. function contains(value, param) {
  2674. return value.indexOf(param) >= 0;
  2675. }
  2676. /**
  2677. * 验证一个值范围[min, max]
  2678. */
  2679. function range(value, param) {
  2680. return value >= param[0] && value <= param[1];
  2681. }
  2682. /**
  2683. * 验证一个长度范围[min, max]
  2684. */
  2685. function rangeLength(value, param) {
  2686. return value.length >= param[0] && value.length <= param[1];
  2687. }
  2688. /**
  2689. * 是否固定电话
  2690. */
  2691. function landline(value) {
  2692. var reg = /^\d{3,4}-\d{7,8}(-\d{3,4})?$/;
  2693. return reg.test(value);
  2694. }
  2695. /**
  2696. * 判断是否为空
  2697. */
  2698. function empty(value) {
  2699. switch (typeof value) {
  2700. case 'undefined':
  2701. return true;
  2702. case 'string':
  2703. if (value.replace(/(^[ \t\n\r]*)|([ \t\n\r]*$)/g, '').length == 0) return true;
  2704. break;
  2705. case 'boolean':
  2706. if (!value) return true;
  2707. break;
  2708. case 'number':
  2709. if (0 === value || isNaN(value)) return true;
  2710. break;
  2711. case 'object':
  2712. if (null === value || value.length === 0) return true;
  2713. for (var i in value) {
  2714. return false;
  2715. }
  2716. return true;}
  2717. return false;
  2718. }
  2719. /**
  2720. * 是否json字符串
  2721. */
  2722. function jsonString(value) {
  2723. if (typeof value == 'string') {
  2724. try {
  2725. var obj = JSON.parse(value);
  2726. if (typeof obj == 'object' && obj) {
  2727. return true;
  2728. } else {
  2729. return false;
  2730. }
  2731. } catch (e) {
  2732. return false;
  2733. }
  2734. }
  2735. return false;
  2736. }
  2737. /**
  2738. * 是否数组
  2739. */
  2740. function array(value) {
  2741. if (typeof Array.isArray === "function") {
  2742. return Array.isArray(value);
  2743. } else {
  2744. return Object.prototype.toString.call(value) === "[object Array]";
  2745. }
  2746. }
  2747. /**
  2748. * 是否对象
  2749. */
  2750. function object(value) {
  2751. return Object.prototype.toString.call(value) === '[object Object]';
  2752. }
  2753. /**
  2754. * 是否短信验证码
  2755. */
  2756. function code(value) {var len = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 6;
  2757. return new RegExp("^\\d{".concat(len, "}$")).test(value);
  2758. }var _default =
  2759. {
  2760. email: email,
  2761. mobile: mobile,
  2762. url: url,
  2763. date: date,
  2764. dateISO: dateISO,
  2765. number: number,
  2766. digits: digits,
  2767. idCard: idCard,
  2768. carNo: carNo,
  2769. amount: amount,
  2770. chinese: chinese,
  2771. letter: letter,
  2772. enOrNum: enOrNum,
  2773. contains: contains,
  2774. range: range,
  2775. rangeLength: rangeLength,
  2776. empty: empty,
  2777. isEmpty: empty,
  2778. jsonString: jsonString,
  2779. landline: landline,
  2780. object: object,
  2781. array: array,
  2782. code: code };exports.default = _default;
  2783. /***/ }),
  2784. /***/ 18:
  2785. /*!***************************************************************************!*\
  2786. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/queryParams.js ***!
  2787. \***************************************************************************/
  2788. /*! no static exports found */
  2789. /***/ (function(module, exports, __webpack_require__) {
  2790. "use strict";
  2791. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  2792. * 对象转url参数
  2793. * @param {*} data,对象
  2794. * @param {*} isPrefix,是否自动加上"?"
  2795. */
  2796. function queryParams() {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};var isPrefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;var arrayFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'brackets';
  2797. var prefix = isPrefix ? '?' : '';
  2798. var _result = [];
  2799. if (['indices', 'brackets', 'repeat', 'comma'].indexOf(arrayFormat) == -1) arrayFormat = 'brackets';var _loop = function _loop(
  2800. key) {
  2801. var value = data[key];
  2802. // 去掉为空的参数
  2803. if (['', undefined, null].indexOf(value) >= 0) {
  2804. return "continue";
  2805. }
  2806. // 如果值为数组,另行处理
  2807. if (value.constructor === Array) {
  2808. // e.g. {ids: [1, 2, 3]}
  2809. switch (arrayFormat) {
  2810. case 'indices':
  2811. // 结果: ids[0]=1&ids[1]=2&ids[2]=3
  2812. for (var i = 0; i < value.length; i++) {
  2813. _result.push(key + '[' + i + ']=' + value[i]);
  2814. }
  2815. break;
  2816. case 'brackets':
  2817. // 结果: ids[]=1&ids[]=2&ids[]=3
  2818. value.forEach(function (_value) {
  2819. _result.push(key + '[]=' + _value);
  2820. });
  2821. break;
  2822. case 'repeat':
  2823. // 结果: ids=1&ids=2&ids=3
  2824. value.forEach(function (_value) {
  2825. _result.push(key + '=' + _value);
  2826. });
  2827. break;
  2828. case 'comma':
  2829. // 结果: ids=1,2,3
  2830. var commaStr = "";
  2831. value.forEach(function (_value) {
  2832. commaStr += (commaStr ? "," : "") + _value;
  2833. });
  2834. _result.push(key + '=' + commaStr);
  2835. break;
  2836. default:
  2837. value.forEach(function (_value) {
  2838. _result.push(key + '[]=' + _value);
  2839. });}
  2840. } else {
  2841. _result.push(key + '=' + value);
  2842. }};for (var key in data) {var _ret = _loop(key);if (_ret === "continue") continue;
  2843. }
  2844. return _result.length ? prefix + _result.join('&') : '';
  2845. }var _default =
  2846. queryParams;exports.default = _default;
  2847. /***/ }),
  2848. /***/ 19:
  2849. /*!*********************************************************************!*\
  2850. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/route.js ***!
  2851. \*********************************************************************/
  2852. /*! no static exports found */
  2853. /***/ (function(module, exports, __webpack_require__) {
  2854. "use strict";
  2855. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _regenerator = _interopRequireDefault(__webpack_require__(/*! ./node_modules/@babel/runtime/regenerator */ 20));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {Promise.resolve(value).then(_next, _throw);}}function _asyncToGenerator(fn) {return function () {var self = this,args = arguments;return new Promise(function (resolve, reject) {var gen = fn.apply(self, args);function _next(value) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);}function _throw(err) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);}_next(undefined);});};}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;} /**
  2856. * 路由跳转方法,该方法相对于直接使用uni.xxx的好处是使用更加简单快捷
  2857. * 并且带有路由拦截功能
  2858. */var
  2859. Router = /*#__PURE__*/function () {
  2860. function Router() {_classCallCheck(this, Router);
  2861. // 原始属性定义
  2862. this.config = {
  2863. type: 'navigateTo',
  2864. url: '',
  2865. delta: 1, // navigateBack页面后退时,回退的层数
  2866. params: {}, // 传递的参数
  2867. animationType: 'pop-in', // 窗口动画,只在APP有效
  2868. animationDuration: 300, // 窗口动画持续时间,单位毫秒,只在APP有效
  2869. intercept: false // 是否需要拦截
  2870. };
  2871. // 因为route方法是需要对外赋值给另外的对象使用,同时route内部有使用this,会导致route失去上下文
  2872. // 这里在构造函数中进行this绑定
  2873. this.route = this.route.bind(this);
  2874. }
  2875. // 判断url前面是否有"/",如果没有则加上,否则无法跳转
  2876. _createClass(Router, [{ key: "addRootPath", value: function addRootPath(url) {
  2877. return url[0] === '/' ? url : "/".concat(url);
  2878. }
  2879. // 整合路由参数
  2880. }, { key: "mixinParam", value: function mixinParam(url, params) {
  2881. url = url && this.addRootPath(url);
  2882. // 使用正则匹配,主要依据是判断是否有"/","?","="等,如“/page/index/index?name=mary"
  2883. // 如果有url中有get参数,转换后无需带上"?"
  2884. var query = '';
  2885. if (/.*\/.*\?.*=.*/.test(url)) {
  2886. // object对象转为get类型的参数
  2887. query = uni.$u.queryParams(params, false);
  2888. // 因为已有get参数,所以后面拼接的参数需要带上"&"隔开
  2889. return url += "&" + query;
  2890. } else {
  2891. // 直接拼接参数,因为此处url中没有后面的query参数,也就没有"?/&"之类的符号
  2892. query = uni.$u.queryParams(params);
  2893. return url += query;
  2894. }
  2895. }
  2896. // 对外的方法名称
  2897. }, { key: "route", value: function () {var _route = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee() {var options,params,mergeConfig,isNext,_args = arguments;return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:options = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};params = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
  2898. // 合并用户的配置和内部的默认配置
  2899. mergeConfig = {};
  2900. if (typeof options === 'string') {
  2901. // 如果options为字符串,则为route(url, params)的形式
  2902. mergeConfig.url = this.mixinParam(options, params);
  2903. mergeConfig.type = 'navigateTo';
  2904. } else {
  2905. mergeConfig = uni.$u.deepClone(options, this.config);
  2906. // 否则正常使用mergeConfig中的url和params进行拼接
  2907. mergeConfig.url = this.mixinParam(options.url, options.params);
  2908. }
  2909. if (params.intercept) {
  2910. this.config.intercept = params.intercept;
  2911. }
  2912. // params参数也带给拦截器
  2913. mergeConfig.params = params;
  2914. // 合并内外部参数
  2915. mergeConfig = uni.$u.deepMerge(this.config, mergeConfig);
  2916. // 判断用户是否定义了拦截器
  2917. if (!(typeof uni.$u.routeIntercept === 'function')) {_context.next = 14;break;}_context.next = 10;return (
  2918. new Promise(function (resolve, reject) {
  2919. uni.$u.routeIntercept(mergeConfig, resolve);
  2920. }));case 10:isNext = _context.sent;
  2921. // 如果isNext为true,则执行路由跳转
  2922. isNext && this.openPage(mergeConfig);_context.next = 15;break;case 14:
  2923. this.openPage(mergeConfig);case 15:case "end":return _context.stop();}}}, _callee, this);}));function route() {return _route.apply(this, arguments);}return route;}()
  2924. // 执行路由跳转
  2925. }, { key: "openPage", value: function openPage(config) {
  2926. // 解构参数
  2927. var
  2928. url =
  2929. config.url,type = config.type,delta = config.delta,animationType = config.animationType,animationDuration = config.animationDuration;
  2930. if (config.type == 'navigateTo' || config.type == 'to') {
  2931. uni.navigateTo({
  2932. url: url,
  2933. animationType: animationType,
  2934. animationDuration: animationDuration });
  2935. }
  2936. if (config.type == 'redirectTo' || config.type == 'redirect') {
  2937. uni.redirectTo({
  2938. url: url });
  2939. }
  2940. if (config.type == 'switchTab' || config.type == 'tab') {
  2941. uni.switchTab({
  2942. url: url });
  2943. }
  2944. if (config.type == 'reLaunch' || config.type == 'launch') {
  2945. uni.reLaunch({
  2946. url: url });
  2947. }
  2948. if (config.type == 'navigateBack' || config.type == 'back') {
  2949. uni.navigateBack({
  2950. delta: delta });
  2951. }
  2952. } }]);return Router;}();var _default =
  2953. new Router().route;exports.default = _default;
  2954. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  2955. /***/ }),
  2956. /***/ 2:
  2957. /*!***********************************!*\
  2958. !*** (webpack)/buildin/global.js ***!
  2959. \***********************************/
  2960. /*! no static exports found */
  2961. /***/ (function(module, exports) {
  2962. var g;
  2963. // This works in non-strict mode
  2964. g = (function() {
  2965. return this;
  2966. })();
  2967. try {
  2968. // This works if eval is allowed (see CSP)
  2969. g = g || new Function("return this")();
  2970. } catch (e) {
  2971. // This works if the window reference is available
  2972. if (typeof window === "object") g = window;
  2973. }
  2974. // g can still be undefined, but nothing to do about it...
  2975. // We return undefined, instead of nothing here, so it's
  2976. // easier to handle this case. if(!global) { ...}
  2977. module.exports = g;
  2978. /***/ }),
  2979. /***/ 20:
  2980. /*!**********************************************************!*\
  2981. !*** ./node_modules/@babel/runtime/regenerator/index.js ***!
  2982. \**********************************************************/
  2983. /*! no static exports found */
  2984. /***/ (function(module, exports, __webpack_require__) {
  2985. module.exports = __webpack_require__(/*! regenerator-runtime */ 21);
  2986. /***/ }),
  2987. /***/ 205:
  2988. /*!**************************************************************************************!*\
  2989. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/components/u-parse/libs/MpHtmlParser.js ***!
  2990. \**************************************************************************************/
  2991. /*! no static exports found */
  2992. /***/ (function(module, exports, __webpack_require__) {
  2993. "use strict";
  2994. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  2995. var _config = _interopRequireDefault(__webpack_require__(/*! ./config.js */ 206));
  2996. var _CssHandler = _interopRequireDefault(__webpack_require__(/*! ./CssHandler.js */ 207));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} /**
  2997. * html 解析器
  2998. * @tutorial https://github.com/jin-yufeng/Parser
  2999. * @version 20201029
  3000. * @author JinYufeng
  3001. * @listens MIT
  3002. */var blankChar = _config.default.blankChar;var windowWidth = uni.getSystemInfoSync().windowWidth;var emoji;function MpHtmlParser(data) {var _this = this;var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  3003. this.attrs = {};
  3004. this.CssHandler = new _CssHandler.default(options.tagStyle, windowWidth);
  3005. this.data = data;
  3006. this.domain = options.domain;
  3007. this.DOM = [];
  3008. this.i = this.start = this.audioNum = this.imgNum = this.videoNum = 0;
  3009. options.prot = (this.domain || '').includes('://') ? this.domain.split('://')[0] : 'http';
  3010. this.options = options;
  3011. this.state = this.Text;
  3012. this.STACK = [];
  3013. // 工具函数
  3014. this.bubble = function () {
  3015. for (var i = _this.STACK.length, item; item = _this.STACK[--i];) {
  3016. if (_config.default.richOnlyTags[item.name]) return false;
  3017. item.c = 1;
  3018. }
  3019. return true;
  3020. };
  3021. this.decode = function (val, amp) {
  3022. var i = -1,
  3023. j,en;
  3024. while (1) {
  3025. if ((i = val.indexOf('&', i + 1)) == -1) break;
  3026. if ((j = val.indexOf(';', i + 2)) == -1) break;
  3027. if (val[i + 1] == '#') {
  3028. en = parseInt((val[i + 2] == 'x' ? '0' : '') + val.substring(i + 2, j));
  3029. if (!isNaN(en)) val = val.substr(0, i) + String.fromCharCode(en) + val.substr(j + 1);
  3030. } else {
  3031. en = val.substring(i + 1, j);
  3032. if (_config.default.entities[en] || en == amp)
  3033. val = val.substr(0, i) + (_config.default.entities[en] || '&') + val.substr(j + 1);
  3034. }
  3035. }
  3036. return val;
  3037. };
  3038. this.getUrl = function (url) {
  3039. if (url[0] == '/') {
  3040. if (url[1] == '/') url = _this.options.prot + ':' + url;else
  3041. if (_this.domain) url = _this.domain + url;
  3042. } else if (_this.domain && url.indexOf('data:') != 0 && !url.includes('://'))
  3043. url = _this.domain + '/' + url;
  3044. return url;
  3045. };
  3046. this.isClose = function () {return _this.data[_this.i] == '>' || _this.data[_this.i] == '/' && _this.data[_this.i + 1] == '>';};
  3047. this.section = function () {return _this.data.substring(_this.start, _this.i);};
  3048. this.parent = function () {return _this.STACK[_this.STACK.length - 1];};
  3049. this.siblings = function () {return _this.STACK.length ? _this.parent().children : _this.DOM;};
  3050. }
  3051. MpHtmlParser.prototype.parse = function () {
  3052. if (emoji) this.data = emoji.parseEmoji(this.data);
  3053. for (var c; c = this.data[this.i]; this.i++) {
  3054. this.state(c);}
  3055. if (this.state == this.Text) this.setText();
  3056. while (this.STACK.length) {this.popNode(this.STACK.pop());}
  3057. return this.DOM;
  3058. };
  3059. // 设置属性
  3060. MpHtmlParser.prototype.setAttr = function () {
  3061. var name = this.attrName.toLowerCase(),
  3062. val = this.attrVal;
  3063. if (_config.default.boolAttrs[name]) this.attrs[name] = 'T';else
  3064. if (val) {
  3065. if (name == 'src' || name == 'data-src' && !this.attrs.src) this.attrs.src = this.getUrl(this.decode(val, 'amp'));else
  3066. if (name == 'href' || name == 'style') this.attrs[name] = this.decode(val, 'amp');else
  3067. if (name.substr(0, 5) != 'data-') this.attrs[name] = val;
  3068. }
  3069. this.attrVal = '';
  3070. while (blankChar[this.data[this.i]]) {this.i++;}
  3071. if (this.isClose()) this.setNode();else
  3072. {
  3073. this.start = this.i;
  3074. this.state = this.AttrName;
  3075. }
  3076. };
  3077. // 设置文本节点
  3078. MpHtmlParser.prototype.setText = function () {
  3079. var back,text = this.section();
  3080. if (!text) return;
  3081. text = _config.default.onText && _config.default.onText(text, function () {return back = true;}) || text;
  3082. if (back) {
  3083. this.data = this.data.substr(0, this.start) + text + this.data.substr(this.i);
  3084. var j = this.start + text.length;
  3085. for (this.i = this.start; this.i < j; this.i++) {this.state(this.data[this.i]);}
  3086. return;
  3087. }
  3088. if (!this.pre) {
  3089. // 合并空白符
  3090. var flag,tmp = [];
  3091. for (var i = text.length, c; c = text[--i];) {
  3092. if (!blankChar[c]) {
  3093. tmp.unshift(c);
  3094. if (!flag) flag = 1;
  3095. } else {
  3096. if (tmp[0] != ' ') tmp.unshift(' ');
  3097. if (c == '\n' && flag == void 0) flag = 0;
  3098. }}
  3099. if (flag == 0) return;
  3100. text = tmp.join('');
  3101. }
  3102. this.siblings().push({
  3103. type: 'text',
  3104. text: this.decode(text) });
  3105. };
  3106. // 设置元素节点
  3107. MpHtmlParser.prototype.setNode = function () {
  3108. var node = {
  3109. name: this.tagName.toLowerCase(),
  3110. attrs: this.attrs },
  3111. close = _config.default.selfClosingTags[node.name];
  3112. if (this.options.nodes.length) node.type = 'node';
  3113. this.attrs = {};
  3114. if (!_config.default.ignoreTags[node.name]) {
  3115. // 处理属性
  3116. var attrs = node.attrs,
  3117. style = this.CssHandler.match(node.name, attrs, node) + (attrs.style || ''),
  3118. styleObj = {};
  3119. if (attrs.id) {
  3120. if (this.options.compress & 1) attrs.id = void 0;else
  3121. if (this.options.useAnchor) this.bubble();
  3122. }
  3123. if (this.options.compress & 2 && attrs.class) attrs.class = void 0;
  3124. switch (node.name) {
  3125. case 'a':
  3126. case 'ad':
  3127. this.bubble();
  3128. break;
  3129. case 'font':
  3130. if (attrs.color) {
  3131. styleObj['color'] = attrs.color;
  3132. attrs.color = void 0;
  3133. }
  3134. if (attrs.face) {
  3135. styleObj['font-family'] = attrs.face;
  3136. attrs.face = void 0;
  3137. }
  3138. if (attrs.size) {
  3139. var size = parseInt(attrs.size);
  3140. if (size < 1) size = 1;else
  3141. if (size > 7) size = 7;
  3142. var map = ['xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'];
  3143. styleObj['font-size'] = map[size - 1];
  3144. attrs.size = void 0;
  3145. }
  3146. break;
  3147. case 'embed':
  3148. var src = node.attrs.src || '',
  3149. type = node.attrs.type || '';
  3150. if (type.includes('video') || src.includes('.mp4') || src.includes('.3gp') || src.includes('.m3u8'))
  3151. node.name = 'video';else
  3152. if (type.includes('audio') || src.includes('.m4a') || src.includes('.wav') || src.includes('.mp3') || src.includes(
  3153. '.aac'))
  3154. node.name = 'audio';else
  3155. break;
  3156. if (node.attrs.autostart)
  3157. node.attrs.autoplay = 'T';
  3158. node.attrs.controls = 'T';
  3159. case 'video':
  3160. case 'audio':
  3161. if (!attrs.id) attrs.id = node.name + ++this["".concat(node.name, "Num")];else
  3162. this["".concat(node.name, "Num")]++;
  3163. if (node.name == 'video') {
  3164. if (this.videoNum > 3)
  3165. node.lazyLoad = 1;
  3166. if (attrs.width) {
  3167. styleObj.width = parseFloat(attrs.width) + (attrs.width.includes('%') ? '%' : 'px');
  3168. attrs.width = void 0;
  3169. }
  3170. if (attrs.height) {
  3171. styleObj.height = parseFloat(attrs.height) + (attrs.height.includes('%') ? '%' : 'px');
  3172. attrs.height = void 0;
  3173. }
  3174. }
  3175. if (!attrs.controls && !attrs.autoplay) attrs.controls = 'T';
  3176. attrs.source = [];
  3177. if (attrs.src) {
  3178. attrs.source.push(attrs.src);
  3179. attrs.src = void 0;
  3180. }
  3181. this.bubble();
  3182. break;
  3183. case 'td':
  3184. case 'th':
  3185. if (attrs.colspan || attrs.rowspan)
  3186. for (var k = this.STACK.length, item; item = this.STACK[--k];) {
  3187. if (item.name == 'table') {
  3188. item.flag = 1;
  3189. break;
  3190. }}}
  3191. if (attrs.align) {
  3192. if (node.name == 'table') {
  3193. if (attrs.align == 'center') styleObj['margin-inline-start'] = styleObj['margin-inline-end'] = 'auto';else
  3194. styleObj['float'] = attrs.align;
  3195. } else styleObj['text-align'] = attrs.align;
  3196. attrs.align = void 0;
  3197. }
  3198. // 压缩 style
  3199. var styles = style.split(';');
  3200. style = '';
  3201. for (var i = 0, len = styles.length; i < len; i++) {
  3202. var info = styles[i].split(':');
  3203. if (info.length < 2) continue;
  3204. var _key = info[0].trim().toLowerCase(),
  3205. _value = info.slice(1).join(':').trim();
  3206. if (_value[0] == '-' || _value.includes('safe'))
  3207. style += ";".concat(_key, ":").concat(_value);else
  3208. if (!styleObj[_key] || _value.includes('import') || !styleObj[_key].includes('import'))
  3209. styleObj[_key] = _value;
  3210. }
  3211. if (node.name == 'img') {
  3212. if (attrs.src && !attrs.ignore) {
  3213. if (this.bubble())
  3214. attrs.i = (this.imgNum++).toString();else
  3215. attrs.ignore = 'T';
  3216. }
  3217. if (attrs.ignore) {
  3218. style += ';-webkit-touch-callout:none';
  3219. styleObj['max-width'] = '100%';
  3220. }
  3221. var width;
  3222. if (styleObj.width) width = styleObj.width;else
  3223. if (attrs.width) width = attrs.width.includes('%') ? attrs.width : parseFloat(attrs.width) + 'px';
  3224. if (width) {
  3225. styleObj.width = width;
  3226. attrs.width = '100%';
  3227. if (parseInt(width) > windowWidth) {
  3228. styleObj.height = '';
  3229. if (attrs.height) attrs.height = void 0;
  3230. }
  3231. }
  3232. if (styleObj.height) {
  3233. attrs.height = styleObj.height;
  3234. styleObj.height = '';
  3235. } else if (attrs.height && !attrs.height.includes('%'))
  3236. attrs.height = parseFloat(attrs.height) + 'px';
  3237. }
  3238. for (var key in styleObj) {
  3239. var value = styleObj[key];
  3240. if (!value) continue;
  3241. if (key.includes('flex') || key == 'order' || key == 'self-align') node.c = 1;
  3242. // 填充链接
  3243. if (value.includes('url')) {
  3244. var j = value.indexOf('(');
  3245. if (j++ != -1) {
  3246. while (value[j] == '"' || value[j] == "'" || blankChar[value[j]]) {j++;}
  3247. value = value.substr(0, j) + this.getUrl(value.substr(j));
  3248. }
  3249. }
  3250. // 转换 rpx
  3251. else if (value.includes('rpx'))
  3252. value = value.replace(/[0-9.]+\s*rpx/g, function ($) {return parseFloat($) * windowWidth / 750 + 'px';});else
  3253. if (key == 'white-space' && value.includes('pre') && !close)
  3254. this.pre = node.pre = true;
  3255. style += ";".concat(key, ":").concat(value);
  3256. }
  3257. style = style.substr(1);
  3258. if (style) attrs.style = style;
  3259. if (!close) {
  3260. node.children = [];
  3261. if (node.name == 'pre' && _config.default.highlight) {
  3262. this.remove(node);
  3263. this.pre = node.pre = true;
  3264. }
  3265. this.siblings().push(node);
  3266. this.STACK.push(node);
  3267. } else if (!_config.default.filter || _config.default.filter(node, this) != false)
  3268. this.siblings().push(node);
  3269. } else {
  3270. if (!close) this.remove(node);else
  3271. if (node.name == 'source') {
  3272. var parent = this.parent();
  3273. if (parent && (parent.name == 'video' || parent.name == 'audio') && node.attrs.src)
  3274. parent.attrs.source.push(node.attrs.src);
  3275. } else if (node.name == 'base' && !this.domain) this.domain = node.attrs.href;
  3276. }
  3277. if (this.data[this.i] == '/') this.i++;
  3278. this.start = this.i + 1;
  3279. this.state = this.Text;
  3280. };
  3281. // 移除标签
  3282. MpHtmlParser.prototype.remove = function (node) {var _this2 = this;
  3283. var name = node.name,
  3284. j = this.i;
  3285. // 处理 svg
  3286. var handleSvg = function handleSvg() {
  3287. var src = _this2.data.substring(j, _this2.i + 1);
  3288. node.attrs.xmlns = 'http://www.w3.org/2000/svg';
  3289. for (var key in node.attrs) {
  3290. if (key == 'viewbox') src = " viewBox=\"".concat(node.attrs.viewbox, "\"") + src;else
  3291. if (key != 'style') src = " ".concat(key, "=\"").concat(node.attrs[key], "\"") + src;
  3292. }
  3293. src = '<svg' + src;
  3294. var parent = _this2.parent();
  3295. if (node.attrs.width == '100%' && parent && (parent.attrs.style || '').includes('inline'))
  3296. parent.attrs.style = 'width:300px;max-width:100%;' + parent.attrs.style;
  3297. _this2.siblings().push({
  3298. name: 'img',
  3299. attrs: {
  3300. src: 'data:image/svg+xml;utf8,' + src.replace(/#/g, '%23'),
  3301. style: node.attrs.style,
  3302. ignore: 'T' } });
  3303. };
  3304. if (node.name == 'svg' && this.data[j] == '/') return handleSvg(this.i++);
  3305. while (1) {
  3306. if ((this.i = this.data.indexOf('</', this.i + 1)) == -1) {
  3307. if (name == 'pre' || name == 'svg') this.i = j;else
  3308. this.i = this.data.length;
  3309. return;
  3310. }
  3311. this.start = this.i += 2;
  3312. while (!blankChar[this.data[this.i]] && !this.isClose()) {this.i++;}
  3313. if (this.section().toLowerCase() == name) {
  3314. // 代码块高亮
  3315. if (name == 'pre') {
  3316. this.data = this.data.substr(0, j + 1) + _config.default.highlight(this.data.substring(j + 1, this.i - 5), node.attrs) + this.data.
  3317. substr(this.i - 5);
  3318. return this.i = j;
  3319. } else if (name == 'style')
  3320. this.CssHandler.getStyle(this.data.substring(j + 1, this.i - 7));else
  3321. if (name == 'title')
  3322. this.DOM.title = this.data.substring(j + 1, this.i - 7);
  3323. if ((this.i = this.data.indexOf('>', this.i)) == -1) this.i = this.data.length;
  3324. if (name == 'svg') handleSvg();
  3325. return;
  3326. }
  3327. }
  3328. };
  3329. // 节点出栈处理
  3330. MpHtmlParser.prototype.popNode = function (node) {
  3331. // 空白符处理
  3332. if (node.pre) {
  3333. node.pre = this.pre = void 0;
  3334. for (var i = this.STACK.length; i--;) {
  3335. if (this.STACK[i].pre)
  3336. this.pre = true;}
  3337. }
  3338. var siblings = this.siblings(),
  3339. len = siblings.length,
  3340. childs = node.children;
  3341. if (node.name == 'head' || _config.default.filter && _config.default.filter(node, this) == false)
  3342. return siblings.pop();
  3343. var attrs = node.attrs;
  3344. // 替换一些标签名
  3345. if (_config.default.blockTags[node.name]) node.name = 'div';else
  3346. if (!_config.default.trustTags[node.name]) node.name = 'span';
  3347. // 处理列表
  3348. if (node.c && (node.name == 'ul' || node.name == 'ol')) {
  3349. if ((node.attrs.style || '').includes('list-style:none')) {
  3350. for (var _i = 0, child; child = childs[_i++];) {
  3351. if (child.name == 'li')
  3352. child.name = 'div';}
  3353. } else if (node.name == 'ul') {
  3354. var floor = 1;
  3355. for (var _i2 = this.STACK.length; _i2--;) {
  3356. if (this.STACK[_i2].name == 'ul') floor++;}
  3357. if (floor != 1)
  3358. for (var _i3 = childs.length; _i3--;) {
  3359. childs[_i3].floor = floor;}
  3360. } else {
  3361. for (var _i4 = 0, num = 1, _child; _child = childs[_i4++];) {
  3362. if (_child.name == 'li') {
  3363. _child.type = 'ol';
  3364. _child.num = function (num, type) {
  3365. if (type == 'a') return String.fromCharCode(97 + (num - 1) % 26);
  3366. if (type == 'A') return String.fromCharCode(65 + (num - 1) % 26);
  3367. if (type == 'i' || type == 'I') {
  3368. num = (num - 1) % 99 + 1;
  3369. var one = ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX'],
  3370. ten = ['X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC'],
  3371. res = (ten[Math.floor(num / 10) - 1] || '') + (one[num % 10 - 1] || '');
  3372. if (type == 'i') return res.toLowerCase();
  3373. return res;
  3374. }
  3375. return num;
  3376. }(num++, attrs.type) + '.';
  3377. }}
  3378. }
  3379. }
  3380. // 处理表格
  3381. if (node.name == 'table') {
  3382. var padding = parseFloat(attrs.cellpadding),
  3383. spacing = parseFloat(attrs.cellspacing),
  3384. border = parseFloat(attrs.border);
  3385. if (node.c) {
  3386. if (isNaN(padding)) padding = 2;
  3387. if (isNaN(spacing)) spacing = 2;
  3388. }
  3389. if (border) attrs.style = "border:".concat(border, "px solid gray;").concat(attrs.style || '');
  3390. if (node.flag && node.c) {
  3391. // 有 colspan 或 rowspan 且含有链接的表格转为 grid 布局实现
  3392. attrs.style = "".concat(attrs.style || '', ";").concat(spacing ? ";grid-gap:".concat(spacing, "px") : ';border-left:0;border-top:0');
  3393. var row = 1,
  3394. col = 1,
  3395. colNum,
  3396. trs = [],
  3397. children = [],
  3398. map = {};
  3399. (function f(ns) {
  3400. for (var i = 0; i < ns.length; i++) {
  3401. if (ns[i].name == 'tr') trs.push(ns[i]);else
  3402. f(ns[i].children || []);
  3403. }
  3404. })(node.children);
  3405. for (var _i5 = 0; _i5 < trs.length; _i5++) {
  3406. for (var j = 0, td; td = trs[_i5].children[j]; j++) {
  3407. if (td.name == 'td' || td.name == 'th') {
  3408. while (map[row + '.' + col]) {col++;}
  3409. var cell = {
  3410. name: 'div',
  3411. c: 1,
  3412. attrs: {
  3413. style: (td.attrs.style || '') + (border ? ";border:".concat(border, "px solid gray") + (spacing ? '' :
  3414. ';border-right:0;border-bottom:0') : '') + (padding ? ";padding:".concat(padding, "px") : '') },
  3415. children: td.children };
  3416. if (td.attrs.colspan) {
  3417. cell.attrs.style += ';grid-column-start:' + col + ';grid-column-end:' + (col + parseInt(td.attrs.colspan));
  3418. if (!td.attrs.rowspan) cell.attrs.style += ';grid-row-start:' + row + ';grid-row-end:' + (row + 1);
  3419. col += parseInt(td.attrs.colspan) - 1;
  3420. }
  3421. if (td.attrs.rowspan) {
  3422. cell.attrs.style += ';grid-row-start:' + row + ';grid-row-end:' + (row + parseInt(td.attrs.rowspan));
  3423. if (!td.attrs.colspan) cell.attrs.style += ';grid-column-start:' + col + ';grid-column-end:' + (col + 1);
  3424. for (var k = 1; k < td.attrs.rowspan; k++) {map[row + k + '.' + col] = 1;}
  3425. }
  3426. children.push(cell);
  3427. col++;
  3428. }
  3429. }
  3430. if (!colNum) {
  3431. colNum = col - 1;
  3432. attrs.style += ";grid-template-columns:repeat(".concat(colNum, ",auto)");
  3433. }
  3434. col = 1;
  3435. row++;
  3436. }
  3437. node.children = children;
  3438. } else {
  3439. attrs.style = "border-spacing:".concat(spacing, "px;").concat(attrs.style || '');
  3440. if (border || padding)
  3441. (function f(ns) {
  3442. for (var i = 0, n; n = ns[i]; i++) {
  3443. if (n.name == 'th' || n.name == 'td') {
  3444. if (border) n.attrs.style = "border:".concat(border, "px solid gray;").concat(n.attrs.style || '');
  3445. if (padding) n.attrs.style = "padding:".concat(padding, "px;").concat(n.attrs.style || '');
  3446. } else f(n.children || []);
  3447. }
  3448. })(childs);
  3449. }
  3450. if (this.options.autoscroll) {
  3451. var table = Object.assign({}, node);
  3452. node.name = 'div';
  3453. node.attrs = {
  3454. style: 'overflow:scroll' };
  3455. node.children = [table];
  3456. }
  3457. }
  3458. this.CssHandler.pop && this.CssHandler.pop(node);
  3459. // 自动压缩
  3460. if (node.name == 'div' && !Object.keys(attrs).length && childs.length == 1 && childs[0].name == 'div')
  3461. siblings[len - 1] = childs[0];
  3462. };
  3463. // 状态机
  3464. MpHtmlParser.prototype.Text = function (c) {
  3465. if (c == '<') {
  3466. var next = this.data[this.i + 1],
  3467. isLetter = function isLetter(c) {return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z';};
  3468. if (isLetter(next)) {
  3469. this.setText();
  3470. this.start = this.i + 1;
  3471. this.state = this.TagName;
  3472. } else if (next == '/') {
  3473. this.setText();
  3474. if (isLetter(this.data[++this.i + 1])) {
  3475. this.start = this.i + 1;
  3476. this.state = this.EndTag;
  3477. } else this.Comment();
  3478. } else if (next == '!' || next == '?') {
  3479. this.setText();
  3480. this.Comment();
  3481. }
  3482. }
  3483. };
  3484. MpHtmlParser.prototype.Comment = function () {
  3485. var key;
  3486. if (this.data.substring(this.i + 2, this.i + 4) == '--') key = '-->';else
  3487. if (this.data.substring(this.i + 2, this.i + 9) == '[CDATA[') key = ']]>';else
  3488. key = '>';
  3489. if ((this.i = this.data.indexOf(key, this.i + 2)) == -1) this.i = this.data.length;else
  3490. this.i += key.length - 1;
  3491. this.start = this.i + 1;
  3492. this.state = this.Text;
  3493. };
  3494. MpHtmlParser.prototype.TagName = function (c) {
  3495. if (blankChar[c]) {
  3496. this.tagName = this.section();
  3497. while (blankChar[this.data[this.i]]) {this.i++;}
  3498. if (this.isClose()) this.setNode();else
  3499. {
  3500. this.start = this.i;
  3501. this.state = this.AttrName;
  3502. }
  3503. } else if (this.isClose()) {
  3504. this.tagName = this.section();
  3505. this.setNode();
  3506. }
  3507. };
  3508. MpHtmlParser.prototype.AttrName = function (c) {
  3509. if (c == '=' || blankChar[c] || this.isClose()) {
  3510. this.attrName = this.section();
  3511. if (blankChar[c])
  3512. while (blankChar[this.data[++this.i]]) {;}
  3513. if (this.data[this.i] == '=') {
  3514. while (blankChar[this.data[++this.i]]) {;}
  3515. this.start = this.i--;
  3516. this.state = this.AttrValue;
  3517. } else this.setAttr();
  3518. }
  3519. };
  3520. MpHtmlParser.prototype.AttrValue = function (c) {
  3521. if (c == '"' || c == "'") {
  3522. this.start++;
  3523. if ((this.i = this.data.indexOf(c, this.i + 1)) == -1) return this.i = this.data.length;
  3524. this.attrVal = this.section();
  3525. this.i++;
  3526. } else {
  3527. for (; !blankChar[this.data[this.i]] && !this.isClose(); this.i++) {;}
  3528. this.attrVal = this.section();
  3529. }
  3530. this.setAttr();
  3531. };
  3532. MpHtmlParser.prototype.EndTag = function (c) {
  3533. if (blankChar[c] || c == '>' || c == '/') {
  3534. var name = this.section().toLowerCase();
  3535. for (var i = this.STACK.length; i--;) {
  3536. if (this.STACK[i].name == name) break;}
  3537. if (i != -1) {
  3538. var node;
  3539. while ((node = this.STACK.pop()).name != name) {this.popNode(node);}
  3540. this.popNode(node);
  3541. } else if (name == 'p' || name == 'br')
  3542. this.siblings().push({
  3543. name: name,
  3544. attrs: {} });
  3545. this.i = this.data.indexOf('>', this.i);
  3546. this.start = this.i + 1;
  3547. if (this.i == -1) this.i = this.data.length;else
  3548. this.state = this.Text;
  3549. }
  3550. };var _default =
  3551. MpHtmlParser;exports.default = _default;
  3552. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  3553. /***/ }),
  3554. /***/ 206:
  3555. /*!********************************************************************************!*\
  3556. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/components/u-parse/libs/config.js ***!
  3557. \********************************************************************************/
  3558. /*! no static exports found */
  3559. /***/ (function(module, exports, __webpack_require__) {
  3560. "use strict";
  3561. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /* 配置文件 */
  3562. var cfg = {
  3563. // 出错占位图
  3564. errorImg: null,
  3565. // 过滤器函数
  3566. filter: null,
  3567. // 代码高亮函数
  3568. highlight: null,
  3569. // 文本处理函数
  3570. onText: null,
  3571. // 实体编码列表
  3572. entities: {
  3573. quot: '"',
  3574. apos: "'",
  3575. semi: ';',
  3576. nbsp: '\xA0',
  3577. ensp: "\u2002",
  3578. emsp: "\u2003",
  3579. ndash: '–',
  3580. mdash: '—',
  3581. middot: '·',
  3582. lsquo: '‘',
  3583. rsquo: '’',
  3584. ldquo: '“',
  3585. rdquo: '”',
  3586. bull: '•',
  3587. hellip: '…' },
  3588. blankChar: makeMap(' ,\xA0,\t,\r,\n,\f'),
  3589. boolAttrs: makeMap('allowfullscreen,autoplay,autostart,controls,ignore,loop,muted'),
  3590. // 块级标签,将被转为 div
  3591. blockTags: makeMap('address,article,aside,body,caption,center,cite,footer,header,html,nav,pre,section'),
  3592. // 将被移除的标签
  3593. ignoreTags: makeMap('area,base,canvas,frame,iframe,input,link,map,meta,param,script,source,style,svg,textarea,title,track,wbr'),
  3594. // 只能被 rich-text 显示的标签
  3595. richOnlyTags: makeMap('a,colgroup,fieldset,legend'),
  3596. // 自闭合的标签
  3597. selfClosingTags: makeMap('area,base,br,col,circle,ellipse,embed,frame,hr,img,input,line,link,meta,param,path,polygon,rect,source,track,use,wbr'),
  3598. // 信任的标签
  3599. 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'),
  3600. // 默认的标签样式
  3601. userAgentStyles: {
  3602. address: 'font-style:italic',
  3603. big: 'display:inline;font-size:1.2em',
  3604. blockquote: 'background-color:#f6f6f6;border-left:3px solid #dbdbdb;color:#6c6c6c;padding:5px 0 5px 10px',
  3605. caption: 'display:table-caption;text-align:center',
  3606. center: 'text-align:center',
  3607. cite: 'font-style:italic',
  3608. dd: 'margin-left:40px',
  3609. mark: 'background-color:yellow',
  3610. pre: 'font-family:monospace;white-space:pre;overflow:scroll',
  3611. s: 'text-decoration:line-through',
  3612. small: 'display:inline;font-size:0.8em',
  3613. u: 'text-decoration:underline' } };
  3614. function makeMap(str) {
  3615. var map = Object.create(null),
  3616. list = str.split(',');
  3617. for (var i = list.length; i--;) {
  3618. map[list[i]] = true;}
  3619. return map;
  3620. }
  3621. if (wx.canIUse('editor')) {
  3622. cfg.blockTags.pre = void 0;
  3623. cfg.ignoreTags.rp = true;
  3624. Object.assign(cfg.richOnlyTags, makeMap('bdi,bdo,caption,rt,ruby'));
  3625. Object.assign(cfg.trustTags, makeMap('bdi,bdo,caption,pre,rt,ruby'));
  3626. }var _default =
  3627. cfg;exports.default = _default;
  3628. /***/ }),
  3629. /***/ 207:
  3630. /*!************************************************************************************!*\
  3631. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/components/u-parse/libs/CssHandler.js ***!
  3632. \************************************************************************************/
  3633. /*! no static exports found */
  3634. /***/ (function(module, exports, __webpack_require__) {
  3635. "use strict";
  3636. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _config = _interopRequireDefault(__webpack_require__(/*! ./config.js */ 206));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  3637. var isLetter = function isLetter(c) {return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z';};
  3638. function CssHandler(tagStyle) {
  3639. var styles = Object.assign(Object.create(null), _config.default.userAgentStyles);
  3640. for (var item in tagStyle) {
  3641. styles[item] = (styles[item] ? styles[item] + ';' : '') + tagStyle[item];}
  3642. this.styles = styles;
  3643. }
  3644. CssHandler.prototype.getStyle = function (data) {
  3645. this.styles = new parser(data, this.styles).parse();
  3646. };
  3647. CssHandler.prototype.match = function (name, attrs) {
  3648. var tmp,matched = (tmp = this.styles[name]) ? tmp + ';' : '';
  3649. if (attrs.class) {
  3650. var items = attrs.class.split(' ');
  3651. for (var i = 0, item; item = items[i]; i++) {
  3652. if (tmp = this.styles['.' + item])
  3653. matched += tmp + ';';}
  3654. }
  3655. if (tmp = this.styles['#' + attrs.id])
  3656. matched += tmp + ';';
  3657. return matched;
  3658. };var _default =
  3659. CssHandler;exports.default = _default;
  3660. function parser(data, init) {
  3661. this.data = data;
  3662. this.floor = 0;
  3663. this.i = 0;
  3664. this.list = [];
  3665. this.res = init;
  3666. this.state = this.Space;
  3667. }
  3668. parser.prototype.parse = function () {
  3669. for (var c; c = this.data[this.i]; this.i++) {
  3670. this.state(c);}
  3671. return this.res;
  3672. };
  3673. parser.prototype.section = function () {
  3674. return this.data.substring(this.start, this.i);
  3675. };
  3676. // 状态机
  3677. parser.prototype.Space = function (c) {
  3678. if (c == '.' || c == '#' || isLetter(c)) {
  3679. this.start = this.i;
  3680. this.state = this.Name;
  3681. } else if (c == '/' && this.data[this.i + 1] == '*')
  3682. this.Comment();else
  3683. if (!_config.default.blankChar[c] && c != ';')
  3684. this.state = this.Ignore;
  3685. };
  3686. parser.prototype.Comment = function () {
  3687. this.i = this.data.indexOf('*/', this.i) + 1;
  3688. if (!this.i) this.i = this.data.length;
  3689. this.state = this.Space;
  3690. };
  3691. parser.prototype.Ignore = function (c) {
  3692. if (c == '{') this.floor++;else
  3693. if (c == '}' && ! --this.floor) {
  3694. this.list = [];
  3695. this.state = this.Space;
  3696. }
  3697. };
  3698. parser.prototype.Name = function (c) {
  3699. if (_config.default.blankChar[c]) {
  3700. this.list.push(this.section());
  3701. this.state = this.NameSpace;
  3702. } else if (c == '{') {
  3703. this.list.push(this.section());
  3704. this.Content();
  3705. } else if (c == ',') {
  3706. this.list.push(this.section());
  3707. this.Comma();
  3708. } else if (!isLetter(c) && (c < '0' || c > '9') && c != '-' && c != '_')
  3709. this.state = this.Ignore;
  3710. };
  3711. parser.prototype.NameSpace = function (c) {
  3712. if (c == '{') this.Content();else
  3713. if (c == ',') this.Comma();else
  3714. if (!_config.default.blankChar[c]) this.state = this.Ignore;
  3715. };
  3716. parser.prototype.Comma = function () {
  3717. while (_config.default.blankChar[this.data[++this.i]]) {;}
  3718. if (this.data[this.i] == '{') this.Content();else
  3719. {
  3720. this.start = this.i--;
  3721. this.state = this.Name;
  3722. }
  3723. };
  3724. parser.prototype.Content = function () {
  3725. this.start = ++this.i;
  3726. if ((this.i = this.data.indexOf('}', this.i)) == -1) this.i = this.data.length;
  3727. var content = this.section();
  3728. for (var i = 0, item; item = this.list[i++];) {
  3729. if (this.res[item]) this.res[item] += ';' + content;else
  3730. this.res[item] = content;}
  3731. this.list = [];
  3732. this.state = this.Space;
  3733. };
  3734. /***/ }),
  3735. /***/ 21:
  3736. /*!************************************************************!*\
  3737. !*** ./node_modules/regenerator-runtime/runtime-module.js ***!
  3738. \************************************************************/
  3739. /*! no static exports found */
  3740. /***/ (function(module, exports, __webpack_require__) {
  3741. /**
  3742. * Copyright (c) 2014-present, Facebook, Inc.
  3743. *
  3744. * This source code is licensed under the MIT license found in the
  3745. * LICENSE file in the root directory of this source tree.
  3746. */
  3747. // This method of obtaining a reference to the global object needs to be
  3748. // kept identical to the way it is obtained in runtime.js
  3749. var g = (function() {
  3750. return this || (typeof self === "object" && self);
  3751. })() || Function("return this")();
  3752. // Use `getOwnPropertyNames` because not all browsers support calling
  3753. // `hasOwnProperty` on the global `self` object in a worker. See #183.
  3754. var hadRuntime = g.regeneratorRuntime &&
  3755. Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0;
  3756. // Save the old regeneratorRuntime in case it needs to be restored later.
  3757. var oldRuntime = hadRuntime && g.regeneratorRuntime;
  3758. // Force reevalutation of runtime.js.
  3759. g.regeneratorRuntime = undefined;
  3760. module.exports = __webpack_require__(/*! ./runtime */ 22);
  3761. if (hadRuntime) {
  3762. // Restore the original runtime.
  3763. g.regeneratorRuntime = oldRuntime;
  3764. } else {
  3765. // Remove the global property added by runtime.js.
  3766. try {
  3767. delete g.regeneratorRuntime;
  3768. } catch(e) {
  3769. g.regeneratorRuntime = undefined;
  3770. }
  3771. }
  3772. /***/ }),
  3773. /***/ 22:
  3774. /*!*****************************************************!*\
  3775. !*** ./node_modules/regenerator-runtime/runtime.js ***!
  3776. \*****************************************************/
  3777. /*! no static exports found */
  3778. /***/ (function(module, exports) {
  3779. /**
  3780. * Copyright (c) 2014-present, Facebook, Inc.
  3781. *
  3782. * This source code is licensed under the MIT license found in the
  3783. * LICENSE file in the root directory of this source tree.
  3784. */
  3785. !(function(global) {
  3786. "use strict";
  3787. var Op = Object.prototype;
  3788. var hasOwn = Op.hasOwnProperty;
  3789. var undefined; // More compressible than void 0.
  3790. var $Symbol = typeof Symbol === "function" ? Symbol : {};
  3791. var iteratorSymbol = $Symbol.iterator || "@@iterator";
  3792. var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
  3793. var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  3794. var inModule = typeof module === "object";
  3795. var runtime = global.regeneratorRuntime;
  3796. if (runtime) {
  3797. if (inModule) {
  3798. // If regeneratorRuntime is defined globally and we're in a module,
  3799. // make the exports object identical to regeneratorRuntime.
  3800. module.exports = runtime;
  3801. }
  3802. // Don't bother evaluating the rest of this file if the runtime was
  3803. // already defined globally.
  3804. return;
  3805. }
  3806. // Define the runtime globally (as expected by generated code) as either
  3807. // module.exports (if we're in a module) or a new, empty object.
  3808. runtime = global.regeneratorRuntime = inModule ? module.exports : {};
  3809. function wrap(innerFn, outerFn, self, tryLocsList) {
  3810. // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
  3811. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
  3812. var generator = Object.create(protoGenerator.prototype);
  3813. var context = new Context(tryLocsList || []);
  3814. // The ._invoke method unifies the implementations of the .next,
  3815. // .throw, and .return methods.
  3816. generator._invoke = makeInvokeMethod(innerFn, self, context);
  3817. return generator;
  3818. }
  3819. runtime.wrap = wrap;
  3820. // Try/catch helper to minimize deoptimizations. Returns a completion
  3821. // record like context.tryEntries[i].completion. This interface could
  3822. // have been (and was previously) designed to take a closure to be
  3823. // invoked without arguments, but in all the cases we care about we
  3824. // already have an existing method we want to call, so there's no need
  3825. // to create a new function object. We can even get away with assuming
  3826. // the method takes exactly one argument, since that happens to be true
  3827. // in every case, so we don't have to touch the arguments object. The
  3828. // only additional allocation required is the completion record, which
  3829. // has a stable shape and so hopefully should be cheap to allocate.
  3830. function tryCatch(fn, obj, arg) {
  3831. try {
  3832. return { type: "normal", arg: fn.call(obj, arg) };
  3833. } catch (err) {
  3834. return { type: "throw", arg: err };
  3835. }
  3836. }
  3837. var GenStateSuspendedStart = "suspendedStart";
  3838. var GenStateSuspendedYield = "suspendedYield";
  3839. var GenStateExecuting = "executing";
  3840. var GenStateCompleted = "completed";
  3841. // Returning this object from the innerFn has the same effect as
  3842. // breaking out of the dispatch switch statement.
  3843. var ContinueSentinel = {};
  3844. // Dummy constructor functions that we use as the .constructor and
  3845. // .constructor.prototype properties for functions that return Generator
  3846. // objects. For full spec compliance, you may wish to configure your
  3847. // minifier not to mangle the names of these two functions.
  3848. function Generator() {}
  3849. function GeneratorFunction() {}
  3850. function GeneratorFunctionPrototype() {}
  3851. // This is a polyfill for %IteratorPrototype% for environments that
  3852. // don't natively support it.
  3853. var IteratorPrototype = {};
  3854. IteratorPrototype[iteratorSymbol] = function () {
  3855. return this;
  3856. };
  3857. var getProto = Object.getPrototypeOf;
  3858. var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  3859. if (NativeIteratorPrototype &&
  3860. NativeIteratorPrototype !== Op &&
  3861. hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
  3862. // This environment has a native %IteratorPrototype%; use it instead
  3863. // of the polyfill.
  3864. IteratorPrototype = NativeIteratorPrototype;
  3865. }
  3866. var Gp = GeneratorFunctionPrototype.prototype =
  3867. Generator.prototype = Object.create(IteratorPrototype);
  3868. GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
  3869. GeneratorFunctionPrototype.constructor = GeneratorFunction;
  3870. GeneratorFunctionPrototype[toStringTagSymbol] =
  3871. GeneratorFunction.displayName = "GeneratorFunction";
  3872. // Helper for defining the .next, .throw, and .return methods of the
  3873. // Iterator interface in terms of a single ._invoke method.
  3874. function defineIteratorMethods(prototype) {
  3875. ["next", "throw", "return"].forEach(function(method) {
  3876. prototype[method] = function(arg) {
  3877. return this._invoke(method, arg);
  3878. };
  3879. });
  3880. }
  3881. runtime.isGeneratorFunction = function(genFun) {
  3882. var ctor = typeof genFun === "function" && genFun.constructor;
  3883. return ctor
  3884. ? ctor === GeneratorFunction ||
  3885. // For the native GeneratorFunction constructor, the best we can
  3886. // do is to check its .name property.
  3887. (ctor.displayName || ctor.name) === "GeneratorFunction"
  3888. : false;
  3889. };
  3890. runtime.mark = function(genFun) {
  3891. if (Object.setPrototypeOf) {
  3892. Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
  3893. } else {
  3894. genFun.__proto__ = GeneratorFunctionPrototype;
  3895. if (!(toStringTagSymbol in genFun)) {
  3896. genFun[toStringTagSymbol] = "GeneratorFunction";
  3897. }
  3898. }
  3899. genFun.prototype = Object.create(Gp);
  3900. return genFun;
  3901. };
  3902. // Within the body of any async function, `await x` is transformed to
  3903. // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
  3904. // `hasOwn.call(value, "__await")` to determine if the yielded value is
  3905. // meant to be awaited.
  3906. runtime.awrap = function(arg) {
  3907. return { __await: arg };
  3908. };
  3909. function AsyncIterator(generator) {
  3910. function invoke(method, arg, resolve, reject) {
  3911. var record = tryCatch(generator[method], generator, arg);
  3912. if (record.type === "throw") {
  3913. reject(record.arg);
  3914. } else {
  3915. var result = record.arg;
  3916. var value = result.value;
  3917. if (value &&
  3918. typeof value === "object" &&
  3919. hasOwn.call(value, "__await")) {
  3920. return Promise.resolve(value.__await).then(function(value) {
  3921. invoke("next", value, resolve, reject);
  3922. }, function(err) {
  3923. invoke("throw", err, resolve, reject);
  3924. });
  3925. }
  3926. return Promise.resolve(value).then(function(unwrapped) {
  3927. // When a yielded Promise is resolved, its final value becomes
  3928. // the .value of the Promise<{value,done}> result for the
  3929. // current iteration.
  3930. result.value = unwrapped;
  3931. resolve(result);
  3932. }, function(error) {
  3933. // If a rejected Promise was yielded, throw the rejection back
  3934. // into the async generator function so it can be handled there.
  3935. return invoke("throw", error, resolve, reject);
  3936. });
  3937. }
  3938. }
  3939. var previousPromise;
  3940. function enqueue(method, arg) {
  3941. function callInvokeWithMethodAndArg() {
  3942. return new Promise(function(resolve, reject) {
  3943. invoke(method, arg, resolve, reject);
  3944. });
  3945. }
  3946. return previousPromise =
  3947. // If enqueue has been called before, then we want to wait until
  3948. // all previous Promises have been resolved before calling invoke,
  3949. // so that results are always delivered in the correct order. If
  3950. // enqueue has not been called before, then it is important to
  3951. // call invoke immediately, without waiting on a callback to fire,
  3952. // so that the async generator function has the opportunity to do
  3953. // any necessary setup in a predictable way. This predictability
  3954. // is why the Promise constructor synchronously invokes its
  3955. // executor callback, and why async functions synchronously
  3956. // execute code before the first await. Since we implement simple
  3957. // async functions in terms of async generators, it is especially
  3958. // important to get this right, even though it requires care.
  3959. previousPromise ? previousPromise.then(
  3960. callInvokeWithMethodAndArg,
  3961. // Avoid propagating failures to Promises returned by later
  3962. // invocations of the iterator.
  3963. callInvokeWithMethodAndArg
  3964. ) : callInvokeWithMethodAndArg();
  3965. }
  3966. // Define the unified helper method that is used to implement .next,
  3967. // .throw, and .return (see defineIteratorMethods).
  3968. this._invoke = enqueue;
  3969. }
  3970. defineIteratorMethods(AsyncIterator.prototype);
  3971. AsyncIterator.prototype[asyncIteratorSymbol] = function () {
  3972. return this;
  3973. };
  3974. runtime.AsyncIterator = AsyncIterator;
  3975. // Note that simple async functions are implemented on top of
  3976. // AsyncIterator objects; they just return a Promise for the value of
  3977. // the final result produced by the iterator.
  3978. runtime.async = function(innerFn, outerFn, self, tryLocsList) {
  3979. var iter = new AsyncIterator(
  3980. wrap(innerFn, outerFn, self, tryLocsList)
  3981. );
  3982. return runtime.isGeneratorFunction(outerFn)
  3983. ? iter // If outerFn is a generator, return the full iterator.
  3984. : iter.next().then(function(result) {
  3985. return result.done ? result.value : iter.next();
  3986. });
  3987. };
  3988. function makeInvokeMethod(innerFn, self, context) {
  3989. var state = GenStateSuspendedStart;
  3990. return function invoke(method, arg) {
  3991. if (state === GenStateExecuting) {
  3992. throw new Error("Generator is already running");
  3993. }
  3994. if (state === GenStateCompleted) {
  3995. if (method === "throw") {
  3996. throw arg;
  3997. }
  3998. // Be forgiving, per 25.3.3.3.3 of the spec:
  3999. // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
  4000. return doneResult();
  4001. }
  4002. context.method = method;
  4003. context.arg = arg;
  4004. while (true) {
  4005. var delegate = context.delegate;
  4006. if (delegate) {
  4007. var delegateResult = maybeInvokeDelegate(delegate, context);
  4008. if (delegateResult) {
  4009. if (delegateResult === ContinueSentinel) continue;
  4010. return delegateResult;
  4011. }
  4012. }
  4013. if (context.method === "next") {
  4014. // Setting context._sent for legacy support of Babel's
  4015. // function.sent implementation.
  4016. context.sent = context._sent = context.arg;
  4017. } else if (context.method === "throw") {
  4018. if (state === GenStateSuspendedStart) {
  4019. state = GenStateCompleted;
  4020. throw context.arg;
  4021. }
  4022. context.dispatchException(context.arg);
  4023. } else if (context.method === "return") {
  4024. context.abrupt("return", context.arg);
  4025. }
  4026. state = GenStateExecuting;
  4027. var record = tryCatch(innerFn, self, context);
  4028. if (record.type === "normal") {
  4029. // If an exception is thrown from innerFn, we leave state ===
  4030. // GenStateExecuting and loop back for another invocation.
  4031. state = context.done
  4032. ? GenStateCompleted
  4033. : GenStateSuspendedYield;
  4034. if (record.arg === ContinueSentinel) {
  4035. continue;
  4036. }
  4037. return {
  4038. value: record.arg,
  4039. done: context.done
  4040. };
  4041. } else if (record.type === "throw") {
  4042. state = GenStateCompleted;
  4043. // Dispatch the exception by looping back around to the
  4044. // context.dispatchException(context.arg) call above.
  4045. context.method = "throw";
  4046. context.arg = record.arg;
  4047. }
  4048. }
  4049. };
  4050. }
  4051. // Call delegate.iterator[context.method](context.arg) and handle the
  4052. // result, either by returning a { value, done } result from the
  4053. // delegate iterator, or by modifying context.method and context.arg,
  4054. // setting context.delegate to null, and returning the ContinueSentinel.
  4055. function maybeInvokeDelegate(delegate, context) {
  4056. var method = delegate.iterator[context.method];
  4057. if (method === undefined) {
  4058. // A .throw or .return when the delegate iterator has no .throw
  4059. // method always terminates the yield* loop.
  4060. context.delegate = null;
  4061. if (context.method === "throw") {
  4062. if (delegate.iterator.return) {
  4063. // If the delegate iterator has a return method, give it a
  4064. // chance to clean up.
  4065. context.method = "return";
  4066. context.arg = undefined;
  4067. maybeInvokeDelegate(delegate, context);
  4068. if (context.method === "throw") {
  4069. // If maybeInvokeDelegate(context) changed context.method from
  4070. // "return" to "throw", let that override the TypeError below.
  4071. return ContinueSentinel;
  4072. }
  4073. }
  4074. context.method = "throw";
  4075. context.arg = new TypeError(
  4076. "The iterator does not provide a 'throw' method");
  4077. }
  4078. return ContinueSentinel;
  4079. }
  4080. var record = tryCatch(method, delegate.iterator, context.arg);
  4081. if (record.type === "throw") {
  4082. context.method = "throw";
  4083. context.arg = record.arg;
  4084. context.delegate = null;
  4085. return ContinueSentinel;
  4086. }
  4087. var info = record.arg;
  4088. if (! info) {
  4089. context.method = "throw";
  4090. context.arg = new TypeError("iterator result is not an object");
  4091. context.delegate = null;
  4092. return ContinueSentinel;
  4093. }
  4094. if (info.done) {
  4095. // Assign the result of the finished delegate to the temporary
  4096. // variable specified by delegate.resultName (see delegateYield).
  4097. context[delegate.resultName] = info.value;
  4098. // Resume execution at the desired location (see delegateYield).
  4099. context.next = delegate.nextLoc;
  4100. // If context.method was "throw" but the delegate handled the
  4101. // exception, let the outer generator proceed normally. If
  4102. // context.method was "next", forget context.arg since it has been
  4103. // "consumed" by the delegate iterator. If context.method was
  4104. // "return", allow the original .return call to continue in the
  4105. // outer generator.
  4106. if (context.method !== "return") {
  4107. context.method = "next";
  4108. context.arg = undefined;
  4109. }
  4110. } else {
  4111. // Re-yield the result returned by the delegate method.
  4112. return info;
  4113. }
  4114. // The delegate iterator is finished, so forget it and continue with
  4115. // the outer generator.
  4116. context.delegate = null;
  4117. return ContinueSentinel;
  4118. }
  4119. // Define Generator.prototype.{next,throw,return} in terms of the
  4120. // unified ._invoke helper method.
  4121. defineIteratorMethods(Gp);
  4122. Gp[toStringTagSymbol] = "Generator";
  4123. // A Generator should always return itself as the iterator object when the
  4124. // @@iterator function is called on it. Some browsers' implementations of the
  4125. // iterator prototype chain incorrectly implement this, causing the Generator
  4126. // object to not be returned from this call. This ensures that doesn't happen.
  4127. // See https://github.com/facebook/regenerator/issues/274 for more details.
  4128. Gp[iteratorSymbol] = function() {
  4129. return this;
  4130. };
  4131. Gp.toString = function() {
  4132. return "[object Generator]";
  4133. };
  4134. function pushTryEntry(locs) {
  4135. var entry = { tryLoc: locs[0] };
  4136. if (1 in locs) {
  4137. entry.catchLoc = locs[1];
  4138. }
  4139. if (2 in locs) {
  4140. entry.finallyLoc = locs[2];
  4141. entry.afterLoc = locs[3];
  4142. }
  4143. this.tryEntries.push(entry);
  4144. }
  4145. function resetTryEntry(entry) {
  4146. var record = entry.completion || {};
  4147. record.type = "normal";
  4148. delete record.arg;
  4149. entry.completion = record;
  4150. }
  4151. function Context(tryLocsList) {
  4152. // The root entry object (effectively a try statement without a catch
  4153. // or a finally block) gives us a place to store values thrown from
  4154. // locations where there is no enclosing try statement.
  4155. this.tryEntries = [{ tryLoc: "root" }];
  4156. tryLocsList.forEach(pushTryEntry, this);
  4157. this.reset(true);
  4158. }
  4159. runtime.keys = function(object) {
  4160. var keys = [];
  4161. for (var key in object) {
  4162. keys.push(key);
  4163. }
  4164. keys.reverse();
  4165. // Rather than returning an object with a next method, we keep
  4166. // things simple and return the next function itself.
  4167. return function next() {
  4168. while (keys.length) {
  4169. var key = keys.pop();
  4170. if (key in object) {
  4171. next.value = key;
  4172. next.done = false;
  4173. return next;
  4174. }
  4175. }
  4176. // To avoid creating an additional object, we just hang the .value
  4177. // and .done properties off the next function object itself. This
  4178. // also ensures that the minifier will not anonymize the function.
  4179. next.done = true;
  4180. return next;
  4181. };
  4182. };
  4183. function values(iterable) {
  4184. if (iterable) {
  4185. var iteratorMethod = iterable[iteratorSymbol];
  4186. if (iteratorMethod) {
  4187. return iteratorMethod.call(iterable);
  4188. }
  4189. if (typeof iterable.next === "function") {
  4190. return iterable;
  4191. }
  4192. if (!isNaN(iterable.length)) {
  4193. var i = -1, next = function next() {
  4194. while (++i < iterable.length) {
  4195. if (hasOwn.call(iterable, i)) {
  4196. next.value = iterable[i];
  4197. next.done = false;
  4198. return next;
  4199. }
  4200. }
  4201. next.value = undefined;
  4202. next.done = true;
  4203. return next;
  4204. };
  4205. return next.next = next;
  4206. }
  4207. }
  4208. // Return an iterator with no values.
  4209. return { next: doneResult };
  4210. }
  4211. runtime.values = values;
  4212. function doneResult() {
  4213. return { value: undefined, done: true };
  4214. }
  4215. Context.prototype = {
  4216. constructor: Context,
  4217. reset: function(skipTempReset) {
  4218. this.prev = 0;
  4219. this.next = 0;
  4220. // Resetting context._sent for legacy support of Babel's
  4221. // function.sent implementation.
  4222. this.sent = this._sent = undefined;
  4223. this.done = false;
  4224. this.delegate = null;
  4225. this.method = "next";
  4226. this.arg = undefined;
  4227. this.tryEntries.forEach(resetTryEntry);
  4228. if (!skipTempReset) {
  4229. for (var name in this) {
  4230. // Not sure about the optimal order of these conditions:
  4231. if (name.charAt(0) === "t" &&
  4232. hasOwn.call(this, name) &&
  4233. !isNaN(+name.slice(1))) {
  4234. this[name] = undefined;
  4235. }
  4236. }
  4237. }
  4238. },
  4239. stop: function() {
  4240. this.done = true;
  4241. var rootEntry = this.tryEntries[0];
  4242. var rootRecord = rootEntry.completion;
  4243. if (rootRecord.type === "throw") {
  4244. throw rootRecord.arg;
  4245. }
  4246. return this.rval;
  4247. },
  4248. dispatchException: function(exception) {
  4249. if (this.done) {
  4250. throw exception;
  4251. }
  4252. var context = this;
  4253. function handle(loc, caught) {
  4254. record.type = "throw";
  4255. record.arg = exception;
  4256. context.next = loc;
  4257. if (caught) {
  4258. // If the dispatched exception was caught by a catch block,
  4259. // then let that catch block handle the exception normally.
  4260. context.method = "next";
  4261. context.arg = undefined;
  4262. }
  4263. return !! caught;
  4264. }
  4265. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  4266. var entry = this.tryEntries[i];
  4267. var record = entry.completion;
  4268. if (entry.tryLoc === "root") {
  4269. // Exception thrown outside of any try block that could handle
  4270. // it, so set the completion value of the entire function to
  4271. // throw the exception.
  4272. return handle("end");
  4273. }
  4274. if (entry.tryLoc <= this.prev) {
  4275. var hasCatch = hasOwn.call(entry, "catchLoc");
  4276. var hasFinally = hasOwn.call(entry, "finallyLoc");
  4277. if (hasCatch && hasFinally) {
  4278. if (this.prev < entry.catchLoc) {
  4279. return handle(entry.catchLoc, true);
  4280. } else if (this.prev < entry.finallyLoc) {
  4281. return handle(entry.finallyLoc);
  4282. }
  4283. } else if (hasCatch) {
  4284. if (this.prev < entry.catchLoc) {
  4285. return handle(entry.catchLoc, true);
  4286. }
  4287. } else if (hasFinally) {
  4288. if (this.prev < entry.finallyLoc) {
  4289. return handle(entry.finallyLoc);
  4290. }
  4291. } else {
  4292. throw new Error("try statement without catch or finally");
  4293. }
  4294. }
  4295. }
  4296. },
  4297. abrupt: function(type, arg) {
  4298. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  4299. var entry = this.tryEntries[i];
  4300. if (entry.tryLoc <= this.prev &&
  4301. hasOwn.call(entry, "finallyLoc") &&
  4302. this.prev < entry.finallyLoc) {
  4303. var finallyEntry = entry;
  4304. break;
  4305. }
  4306. }
  4307. if (finallyEntry &&
  4308. (type === "break" ||
  4309. type === "continue") &&
  4310. finallyEntry.tryLoc <= arg &&
  4311. arg <= finallyEntry.finallyLoc) {
  4312. // Ignore the finally entry if control is not jumping to a
  4313. // location outside the try/catch block.
  4314. finallyEntry = null;
  4315. }
  4316. var record = finallyEntry ? finallyEntry.completion : {};
  4317. record.type = type;
  4318. record.arg = arg;
  4319. if (finallyEntry) {
  4320. this.method = "next";
  4321. this.next = finallyEntry.finallyLoc;
  4322. return ContinueSentinel;
  4323. }
  4324. return this.complete(record);
  4325. },
  4326. complete: function(record, afterLoc) {
  4327. if (record.type === "throw") {
  4328. throw record.arg;
  4329. }
  4330. if (record.type === "break" ||
  4331. record.type === "continue") {
  4332. this.next = record.arg;
  4333. } else if (record.type === "return") {
  4334. this.rval = this.arg = record.arg;
  4335. this.method = "return";
  4336. this.next = "end";
  4337. } else if (record.type === "normal" && afterLoc) {
  4338. this.next = afterLoc;
  4339. }
  4340. return ContinueSentinel;
  4341. },
  4342. finish: function(finallyLoc) {
  4343. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  4344. var entry = this.tryEntries[i];
  4345. if (entry.finallyLoc === finallyLoc) {
  4346. this.complete(entry.completion, entry.afterLoc);
  4347. resetTryEntry(entry);
  4348. return ContinueSentinel;
  4349. }
  4350. }
  4351. },
  4352. "catch": function(tryLoc) {
  4353. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  4354. var entry = this.tryEntries[i];
  4355. if (entry.tryLoc === tryLoc) {
  4356. var record = entry.completion;
  4357. if (record.type === "throw") {
  4358. var thrown = record.arg;
  4359. resetTryEntry(entry);
  4360. }
  4361. return thrown;
  4362. }
  4363. }
  4364. // The context.catch method must only be called with a location
  4365. // argument that corresponds to a known catch block.
  4366. throw new Error("illegal catch attempt");
  4367. },
  4368. delegateYield: function(iterable, resultName, nextLoc) {
  4369. this.delegate = {
  4370. iterator: values(iterable),
  4371. resultName: resultName,
  4372. nextLoc: nextLoc
  4373. };
  4374. if (this.method === "next") {
  4375. // Deliberately forget the last sent value so that we don't
  4376. // accidentally pass it on to the delegate.
  4377. this.arg = undefined;
  4378. }
  4379. return ContinueSentinel;
  4380. }
  4381. };
  4382. })(
  4383. // In sloppy mode, unbound `this` refers to the global object, fallback to
  4384. // Function constructor if we're in global strict mode. That is sadly a form
  4385. // of indirect eval which violates Content Security Policy.
  4386. (function() {
  4387. return this || (typeof self === "object" && self);
  4388. })() || Function("return this")()
  4389. );
  4390. /***/ }),
  4391. /***/ 23:
  4392. /*!**************************************************************************!*\
  4393. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/timeFormat.js ***!
  4394. \**************************************************************************/
  4395. /*! no static exports found */
  4396. /***/ (function(module, exports, __webpack_require__) {
  4397. "use strict";
  4398. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // padStart 的 polyfill,因为某些机型或情况,还无法支持es7的padStart,比如电脑版的微信小程序
  4399. // 所以这里做一个兼容polyfill的兼容处理
  4400. if (!String.prototype.padStart) {
  4401. // 为了方便表示这里 fillString 用了ES6 的默认参数,不影响理解
  4402. String.prototype.padStart = function (maxLength) {var fillString = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ' ';
  4403. if (Object.prototype.toString.call(fillString) !== "[object String]") throw new TypeError(
  4404. 'fillString must be String');
  4405. var str = this;
  4406. // 返回 String(str) 这里是为了使返回的值是字符串字面量,在控制台中更符合直觉
  4407. if (str.length >= maxLength) return String(str);
  4408. var fillLength = maxLength - str.length,
  4409. times = Math.ceil(fillLength / fillString.length);
  4410. while (times >>= 1) {
  4411. fillString += fillString;
  4412. if (times === 1) {
  4413. fillString += fillString;
  4414. }
  4415. }
  4416. return fillString.slice(0, fillLength) + str;
  4417. };
  4418. }
  4419. // 其他更多是格式化有如下:
  4420. // yyyy:mm:dd|yyyy:mm|yyyy年mm月dd日|yyyy年mm月dd日 hh时MM分等,可自定义组合
  4421. function timeFormat() {var dateTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;var fmt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-mm-dd';
  4422. // 如果为null,则格式化当前时间
  4423. if (!dateTime) dateTime = Number(new Date());
  4424. // 如果dateTime长度为10或者13,则为秒和毫秒的时间戳,如果超过13位,则为其他的时间格式
  4425. if (dateTime.toString().length == 10) dateTime *= 1000;
  4426. var date = new Date(dateTime);
  4427. var ret;
  4428. var opt = {
  4429. "y+": date.getFullYear().toString(), // 年
  4430. "m+": (date.getMonth() + 1).toString(), // 月
  4431. "d+": date.getDate().toString(), // 日
  4432. "h+": date.getHours().toString(), // 时
  4433. "M+": date.getMinutes().toString(), // 分
  4434. "s+": date.getSeconds().toString() // 秒
  4435. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  4436. };
  4437. for (var k in opt) {
  4438. ret = new RegExp("(" + k + ")").exec(fmt);
  4439. if (ret) {
  4440. fmt = fmt.replace(ret[1], ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, "0"));
  4441. };
  4442. };
  4443. return fmt;
  4444. }var _default =
  4445. timeFormat;exports.default = _default;
  4446. /***/ }),
  4447. /***/ 236:
  4448. /*!*******************************************************************!*\
  4449. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/util/emitter.js ***!
  4450. \*******************************************************************/
  4451. /*! no static exports found */
  4452. /***/ (function(module, exports, __webpack_require__) {
  4453. "use strict";
  4454. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  4455. * 递归使用 call 方式this指向
  4456. * @param componentName // 需要找的组件的名称
  4457. * @param eventName // 事件名称
  4458. * @param params // 需要传递的参数
  4459. */
  4460. function _broadcast(componentName, eventName, params) {
  4461. // 循环子节点找到名称一样的子节点 否则 递归 当前子节点
  4462. var $children;
  4463. $children = this.$children;
  4464. $children.map(function (child) {
  4465. if (componentName === child.$options.name) {
  4466. child.$emit.apply(child, [eventName].concat(params));
  4467. } else {
  4468. _broadcast.apply(child, [componentName, eventName].concat(params));
  4469. }
  4470. });
  4471. }var _default =
  4472. {
  4473. methods: {
  4474. /**
  4475. * 派发 (向上查找) (一个)
  4476. * @param componentName // 需要找的组件的名称
  4477. * @param eventName // 事件名称
  4478. * @param params // 需要传递的参数
  4479. */
  4480. dispatch: function dispatch(componentName, eventName, params) {
  4481. var parent = this.$parent || this.$root; //$parent 找到最近的父节点 $root 根节点
  4482. var name = parent.$options.name; // 获取当前组件实例的name
  4483. // 如果当前有节点 && 当前没名称 且 当前名称等于需要传进来的名称的时候就去查找当前的节点
  4484. // 循环出当前名称的一样的组件实例
  4485. while (parent && (!name || name !== componentName)) {
  4486. parent = parent.$parent;
  4487. if (parent) {
  4488. name = parent.$options.name;
  4489. }
  4490. }
  4491. // 有节点表示当前找到了name一样的实例
  4492. if (parent) {
  4493. parent.$emit.apply(parent, [eventName].concat(params));
  4494. }
  4495. },
  4496. /**
  4497. * 广播 (向下查找) (广播多个)
  4498. * @param componentName // 需要找的组件的名称
  4499. * @param eventName // 事件名称
  4500. * @param params // 需要传递的参数
  4501. */
  4502. broadcast: function broadcast(componentName, eventName, params) {
  4503. _broadcast.call(this, componentName, eventName, params);
  4504. } } };exports.default = _default;
  4505. /***/ }),
  4506. /***/ 237:
  4507. /*!***************************************************************************!*\
  4508. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/util/async-validator.js ***!
  4509. \***************************************************************************/
  4510. /*! no static exports found */
  4511. /***/ (function(module, exports, __webpack_require__) {
  4512. "use strict";
  4513. /* WEBPACK VAR INJECTION */(function(process) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function _extends() {
  4514. _extends = Object.assign || function (target) {
  4515. for (var i = 1; i < arguments.length; i++) {
  4516. var source = arguments[i];
  4517. for (var key in source) {
  4518. if (Object.prototype.hasOwnProperty.call(source, key)) {
  4519. target[key] = source[key];
  4520. }
  4521. }
  4522. }
  4523. return target;
  4524. };
  4525. return _extends.apply(this, arguments);
  4526. }
  4527. /* eslint no-console:0 */
  4528. var formatRegExp = /%[sdj%]/g;
  4529. var warning = function warning() {}; // don't print warning message when in production env or node runtime
  4530. if (typeof process !== 'undefined' && Object({"VUE_APP_NAME":"mdapp","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}) && "development" !== 'production' && typeof window !==
  4531. 'undefined' && typeof document !== 'undefined') {
  4532. warning = function warning(type, errors) {
  4533. if (typeof console !== 'undefined' && console.warn) {
  4534. if (errors.every(function (e) {
  4535. return typeof e === 'string';
  4536. })) {
  4537. console.warn(type, errors);
  4538. }
  4539. }
  4540. };
  4541. }
  4542. function convertFieldsError(errors) {
  4543. if (!errors || !errors.length) return null;
  4544. var fields = {};
  4545. errors.forEach(function (error) {
  4546. var field = error.field;
  4547. fields[field] = fields[field] || [];
  4548. fields[field].push(error);
  4549. });
  4550. return fields;
  4551. }
  4552. function format() {
  4553. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  4554. args[_key] = arguments[_key];
  4555. }
  4556. var i = 1;
  4557. var f = args[0];
  4558. var len = args.length;
  4559. if (typeof f === 'function') {
  4560. return f.apply(null, args.slice(1));
  4561. }
  4562. if (typeof f === 'string') {
  4563. var str = String(f).replace(formatRegExp, function (x) {
  4564. if (x === '%%') {
  4565. return '%';
  4566. }
  4567. if (i >= len) {
  4568. return x;
  4569. }
  4570. switch (x) {
  4571. case '%s':
  4572. return String(args[i++]);
  4573. case '%d':
  4574. return Number(args[i++]);
  4575. case '%j':
  4576. try {
  4577. return JSON.stringify(args[i++]);
  4578. } catch (_) {
  4579. return '[Circular]';
  4580. }
  4581. break;
  4582. default:
  4583. return x;}
  4584. });
  4585. for (var arg = args[i]; i < len; arg = args[++i]) {
  4586. str += " " + arg;
  4587. }
  4588. return str;
  4589. }
  4590. return f;
  4591. }
  4592. function isNativeStringType(type) {
  4593. return type === 'string' || type === 'url' || type === 'hex' || type === 'email' || type === 'pattern';
  4594. }
  4595. function isEmptyValue(value, type) {
  4596. if (value === undefined || value === null) {
  4597. return true;
  4598. }
  4599. if (type === 'array' && Array.isArray(value) && !value.length) {
  4600. return true;
  4601. }
  4602. if (isNativeStringType(type) && typeof value === 'string' && !value) {
  4603. return true;
  4604. }
  4605. return false;
  4606. }
  4607. function asyncParallelArray(arr, func, callback) {
  4608. var results = [];
  4609. var total = 0;
  4610. var arrLength = arr.length;
  4611. function count(errors) {
  4612. results.push.apply(results, errors);
  4613. total++;
  4614. if (total === arrLength) {
  4615. callback(results);
  4616. }
  4617. }
  4618. arr.forEach(function (a) {
  4619. func(a, count);
  4620. });
  4621. }
  4622. function asyncSerialArray(arr, func, callback) {
  4623. var index = 0;
  4624. var arrLength = arr.length;
  4625. function next(errors) {
  4626. if (errors && errors.length) {
  4627. callback(errors);
  4628. return;
  4629. }
  4630. var original = index;
  4631. index = index + 1;
  4632. if (original < arrLength) {
  4633. func(arr[original], next);
  4634. } else {
  4635. callback([]);
  4636. }
  4637. }
  4638. next([]);
  4639. }
  4640. function flattenObjArr(objArr) {
  4641. var ret = [];
  4642. Object.keys(objArr).forEach(function (k) {
  4643. ret.push.apply(ret, objArr[k]);
  4644. });
  4645. return ret;
  4646. }
  4647. function asyncMap(objArr, option, func, callback) {
  4648. if (option.first) {
  4649. var _pending = new Promise(function (resolve, reject) {
  4650. var next = function next(errors) {
  4651. callback(errors);
  4652. return errors.length ? reject({
  4653. errors: errors,
  4654. fields: convertFieldsError(errors) }) :
  4655. resolve();
  4656. };
  4657. var flattenArr = flattenObjArr(objArr);
  4658. asyncSerialArray(flattenArr, func, next);
  4659. });
  4660. _pending["catch"](function (e) {
  4661. return e;
  4662. });
  4663. return _pending;
  4664. }
  4665. var firstFields = option.firstFields || [];
  4666. if (firstFields === true) {
  4667. firstFields = Object.keys(objArr);
  4668. }
  4669. var objArrKeys = Object.keys(objArr);
  4670. var objArrLength = objArrKeys.length;
  4671. var total = 0;
  4672. var results = [];
  4673. var pending = new Promise(function (resolve, reject) {
  4674. var next = function next(errors) {
  4675. results.push.apply(results, errors);
  4676. total++;
  4677. if (total === objArrLength) {
  4678. callback(results);
  4679. return results.length ? reject({
  4680. errors: results,
  4681. fields: convertFieldsError(results) }) :
  4682. resolve();
  4683. }
  4684. };
  4685. if (!objArrKeys.length) {
  4686. callback(results);
  4687. resolve();
  4688. }
  4689. objArrKeys.forEach(function (key) {
  4690. var arr = objArr[key];
  4691. if (firstFields.indexOf(key) !== -1) {
  4692. asyncSerialArray(arr, func, next);
  4693. } else {
  4694. asyncParallelArray(arr, func, next);
  4695. }
  4696. });
  4697. });
  4698. pending["catch"](function (e) {
  4699. return e;
  4700. });
  4701. return pending;
  4702. }
  4703. function complementError(rule) {
  4704. return function (oe) {
  4705. if (oe && oe.message) {
  4706. oe.field = oe.field || rule.fullField;
  4707. return oe;
  4708. }
  4709. return {
  4710. message: typeof oe === 'function' ? oe() : oe,
  4711. field: oe.field || rule.fullField };
  4712. };
  4713. }
  4714. function deepMerge(target, source) {
  4715. if (source) {
  4716. for (var s in source) {
  4717. if (source.hasOwnProperty(s)) {
  4718. var value = source[s];
  4719. if (typeof value === 'object' && typeof target[s] === 'object') {
  4720. target[s] = _extends({}, target[s], {}, value);
  4721. } else {
  4722. target[s] = value;
  4723. }
  4724. }
  4725. }
  4726. }
  4727. return target;
  4728. }
  4729. /**
  4730. * Rule for validating required fields.
  4731. *
  4732. * @param rule The validation rule.
  4733. * @param value The value of the field on the source object.
  4734. * @param source The source object being validated.
  4735. * @param errors An array of errors that this rule may add
  4736. * validation errors to.
  4737. * @param options The validation options.
  4738. * @param options.messages The validation messages.
  4739. */
  4740. function required(rule, value, source, errors, options, type) {
  4741. if (rule.required && (!source.hasOwnProperty(rule.field) || isEmptyValue(value, type || rule.type))) {
  4742. errors.push(format(options.messages.required, rule.fullField));
  4743. }
  4744. }
  4745. /**
  4746. * Rule for validating whitespace.
  4747. *
  4748. * @param rule The validation rule.
  4749. * @param value The value of the field on the source object.
  4750. * @param source The source object being validated.
  4751. * @param errors An array of errors that this rule may add
  4752. * validation errors to.
  4753. * @param options The validation options.
  4754. * @param options.messages The validation messages.
  4755. */
  4756. function whitespace(rule, value, source, errors, options) {
  4757. if (/^\s+$/.test(value) || value === '') {
  4758. errors.push(format(options.messages.whitespace, rule.fullField));
  4759. }
  4760. }
  4761. /* eslint max-len:0 */
  4762. var pattern = {
  4763. // http://emailregex.com/
  4764. 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,}))$/,
  4765. url: new RegExp(
  4766. "^(?!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]*)?$",
  4767. 'i'),
  4768. hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i };
  4769. var types = {
  4770. integer: function integer(value) {
  4771. return types.number(value) && parseInt(value, 10) === value;
  4772. },
  4773. "float": function float(value) {
  4774. return types.number(value) && !types.integer(value);
  4775. },
  4776. array: function array(value) {
  4777. return Array.isArray(value);
  4778. },
  4779. regexp: function regexp(value) {
  4780. if (value instanceof RegExp) {
  4781. return true;
  4782. }
  4783. try {
  4784. return !!new RegExp(value);
  4785. } catch (e) {
  4786. return false;
  4787. }
  4788. },
  4789. date: function date(value) {
  4790. return typeof value.getTime === 'function' && typeof value.getMonth === 'function' && typeof value.getYear ===
  4791. 'function';
  4792. },
  4793. number: function number(value) {
  4794. if (isNaN(value)) {
  4795. return false;
  4796. }
  4797. // 修改源码,将字符串数值先转为数值
  4798. return typeof +value === 'number';
  4799. },
  4800. object: function object(value) {
  4801. return typeof value === 'object' && !types.array(value);
  4802. },
  4803. method: function method(value) {
  4804. return typeof value === 'function';
  4805. },
  4806. email: function email(value) {
  4807. return typeof value === 'string' && !!value.match(pattern.email) && value.length < 255;
  4808. },
  4809. url: function url(value) {
  4810. return typeof value === 'string' && !!value.match(pattern.url);
  4811. },
  4812. hex: function hex(value) {
  4813. return typeof value === 'string' && !!value.match(pattern.hex);
  4814. } };
  4815. /**
  4816. * Rule for validating the type of a value.
  4817. *
  4818. * @param rule The validation rule.
  4819. * @param value The value of the field on the source object.
  4820. * @param source The source object being validated.
  4821. * @param errors An array of errors that this rule may add
  4822. * validation errors to.
  4823. * @param options The validation options.
  4824. * @param options.messages The validation messages.
  4825. */
  4826. function type(rule, value, source, errors, options) {
  4827. if (rule.required && value === undefined) {
  4828. required(rule, value, source, errors, options);
  4829. return;
  4830. }
  4831. var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];
  4832. var ruleType = rule.type;
  4833. if (custom.indexOf(ruleType) > -1) {
  4834. if (!types[ruleType](value)) {
  4835. errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
  4836. } // straight typeof check
  4837. } else if (ruleType && typeof value !== rule.type) {
  4838. errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
  4839. }
  4840. }
  4841. /**
  4842. * Rule for validating minimum and maximum allowed values.
  4843. *
  4844. * @param rule The validation rule.
  4845. * @param value The value of the field on the source object.
  4846. * @param source The source object being validated.
  4847. * @param errors An array of errors that this rule may add
  4848. * validation errors to.
  4849. * @param options The validation options.
  4850. * @param options.messages The validation messages.
  4851. */
  4852. function range(rule, value, source, errors, options) {
  4853. var len = typeof rule.len === 'number';
  4854. var min = typeof rule.min === 'number';
  4855. var max = typeof rule.max === 'number'; // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)
  4856. var spRegexp = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
  4857. var val = value;
  4858. var key = null;
  4859. var num = typeof value === 'number';
  4860. var str = typeof value === 'string';
  4861. var arr = Array.isArray(value);
  4862. if (num) {
  4863. key = 'number';
  4864. } else if (str) {
  4865. key = 'string';
  4866. } else if (arr) {
  4867. key = 'array';
  4868. } // if the value is not of a supported type for range validation
  4869. // the validation rule rule should use the
  4870. // type property to also test for a particular type
  4871. if (!key) {
  4872. return false;
  4873. }
  4874. if (arr) {
  4875. val = value.length;
  4876. }
  4877. if (str) {
  4878. // 处理码点大于U+010000的文字length属性不准确的bug,如"𠮷𠮷𠮷".lenght !== 3
  4879. val = value.replace(spRegexp, '_').length;
  4880. }
  4881. if (len) {
  4882. if (val !== rule.len) {
  4883. errors.push(format(options.messages[key].len, rule.fullField, rule.len));
  4884. }
  4885. } else if (min && !max && val < rule.min) {
  4886. errors.push(format(options.messages[key].min, rule.fullField, rule.min));
  4887. } else if (max && !min && val > rule.max) {
  4888. errors.push(format(options.messages[key].max, rule.fullField, rule.max));
  4889. } else if (min && max && (val < rule.min || val > rule.max)) {
  4890. errors.push(format(options.messages[key].range, rule.fullField, rule.min, rule.max));
  4891. }
  4892. }
  4893. var ENUM = 'enum';
  4894. /**
  4895. * Rule for validating a value exists in an enumerable list.
  4896. *
  4897. * @param rule The validation rule.
  4898. * @param value The value of the field on the source object.
  4899. * @param source The source object being validated.
  4900. * @param errors An array of errors that this rule may add
  4901. * validation errors to.
  4902. * @param options The validation options.
  4903. * @param options.messages The validation messages.
  4904. */
  4905. function enumerable(rule, value, source, errors, options) {
  4906. rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];
  4907. if (rule[ENUM].indexOf(value) === -1) {
  4908. errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));
  4909. }
  4910. }
  4911. /**
  4912. * Rule for validating a regular expression pattern.
  4913. *
  4914. * @param rule The validation rule.
  4915. * @param value The value of the field on the source object.
  4916. * @param source The source object being validated.
  4917. * @param errors An array of errors that this rule may add
  4918. * validation errors to.
  4919. * @param options The validation options.
  4920. * @param options.messages The validation messages.
  4921. */
  4922. function pattern$1(rule, value, source, errors, options) {
  4923. if (rule.pattern) {
  4924. if (rule.pattern instanceof RegExp) {
  4925. // if a RegExp instance is passed, reset `lastIndex` in case its `global`
  4926. // flag is accidentally set to `true`, which in a validation scenario
  4927. // is not necessary and the result might be misleading
  4928. rule.pattern.lastIndex = 0;
  4929. if (!rule.pattern.test(value)) {
  4930. errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
  4931. }
  4932. } else if (typeof rule.pattern === 'string') {
  4933. var _pattern = new RegExp(rule.pattern);
  4934. if (!_pattern.test(value)) {
  4935. errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
  4936. }
  4937. }
  4938. }
  4939. }
  4940. var rules = {
  4941. required: required,
  4942. whitespace: whitespace,
  4943. type: type,
  4944. range: range,
  4945. "enum": enumerable,
  4946. pattern: pattern$1 };
  4947. /**
  4948. * Performs validation for string types.
  4949. *
  4950. * @param rule The validation rule.
  4951. * @param value The value of the field on the source object.
  4952. * @param callback The callback function.
  4953. * @param source The source object being validated.
  4954. * @param options The validation options.
  4955. * @param options.messages The validation messages.
  4956. */
  4957. function string(rule, value, callback, source, options) {
  4958. var errors = [];
  4959. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  4960. if (validate) {
  4961. if (isEmptyValue(value, 'string') && !rule.required) {
  4962. return callback();
  4963. }
  4964. rules.required(rule, value, source, errors, options, 'string');
  4965. if (!isEmptyValue(value, 'string')) {
  4966. rules.type(rule, value, source, errors, options);
  4967. rules.range(rule, value, source, errors, options);
  4968. rules.pattern(rule, value, source, errors, options);
  4969. if (rule.whitespace === true) {
  4970. rules.whitespace(rule, value, source, errors, options);
  4971. }
  4972. }
  4973. }
  4974. callback(errors);
  4975. }
  4976. /**
  4977. * Validates a function.
  4978. *
  4979. * @param rule The validation rule.
  4980. * @param value The value of the field on the source object.
  4981. * @param callback The callback function.
  4982. * @param source The source object being validated.
  4983. * @param options The validation options.
  4984. * @param options.messages The validation messages.
  4985. */
  4986. function method(rule, value, callback, source, options) {
  4987. var errors = [];
  4988. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  4989. if (validate) {
  4990. if (isEmptyValue(value) && !rule.required) {
  4991. return callback();
  4992. }
  4993. rules.required(rule, value, source, errors, options);
  4994. if (value !== undefined) {
  4995. rules.type(rule, value, source, errors, options);
  4996. }
  4997. }
  4998. callback(errors);
  4999. }
  5000. /**
  5001. * Validates a number.
  5002. *
  5003. * @param rule The validation rule.
  5004. * @param value The value of the field on the source object.
  5005. * @param callback The callback function.
  5006. * @param source The source object being validated.
  5007. * @param options The validation options.
  5008. * @param options.messages The validation messages.
  5009. */
  5010. function number(rule, value, callback, source, options) {
  5011. var errors = [];
  5012. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  5013. if (validate) {
  5014. if (value === '') {
  5015. value = undefined;
  5016. }
  5017. if (isEmptyValue(value) && !rule.required) {
  5018. return callback();
  5019. }
  5020. rules.required(rule, value, source, errors, options);
  5021. if (value !== undefined) {
  5022. rules.type(rule, value, source, errors, options);
  5023. rules.range(rule, value, source, errors, options);
  5024. }
  5025. }
  5026. callback(errors);
  5027. }
  5028. /**
  5029. * Validates a boolean.
  5030. *
  5031. * @param rule The validation rule.
  5032. * @param value The value of the field on the source object.
  5033. * @param callback The callback function.
  5034. * @param source The source object being validated.
  5035. * @param options The validation options.
  5036. * @param options.messages The validation messages.
  5037. */
  5038. function _boolean(rule, value, callback, source, options) {
  5039. var errors = [];
  5040. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  5041. if (validate) {
  5042. if (isEmptyValue(value) && !rule.required) {
  5043. return callback();
  5044. }
  5045. rules.required(rule, value, source, errors, options);
  5046. if (value !== undefined) {
  5047. rules.type(rule, value, source, errors, options);
  5048. }
  5049. }
  5050. callback(errors);
  5051. }
  5052. /**
  5053. * Validates the regular expression type.
  5054. *
  5055. * @param rule The validation rule.
  5056. * @param value The value of the field on the source object.
  5057. * @param callback The callback function.
  5058. * @param source The source object being validated.
  5059. * @param options The validation options.
  5060. * @param options.messages The validation messages.
  5061. */
  5062. function regexp(rule, value, callback, source, options) {
  5063. var errors = [];
  5064. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  5065. if (validate) {
  5066. if (isEmptyValue(value) && !rule.required) {
  5067. return callback();
  5068. }
  5069. rules.required(rule, value, source, errors, options);
  5070. if (!isEmptyValue(value)) {
  5071. rules.type(rule, value, source, errors, options);
  5072. }
  5073. }
  5074. callback(errors);
  5075. }
  5076. /**
  5077. * Validates a number is an integer.
  5078. *
  5079. * @param rule The validation rule.
  5080. * @param value The value of the field on the source object.
  5081. * @param callback The callback function.
  5082. * @param source The source object being validated.
  5083. * @param options The validation options.
  5084. * @param options.messages The validation messages.
  5085. */
  5086. function integer(rule, value, callback, source, options) {
  5087. var errors = [];
  5088. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  5089. if (validate) {
  5090. if (isEmptyValue(value) && !rule.required) {
  5091. return callback();
  5092. }
  5093. rules.required(rule, value, source, errors, options);
  5094. if (value !== undefined) {
  5095. rules.type(rule, value, source, errors, options);
  5096. rules.range(rule, value, source, errors, options);
  5097. }
  5098. }
  5099. callback(errors);
  5100. }
  5101. /**
  5102. * Validates a number is a floating point number.
  5103. *
  5104. * @param rule The validation rule.
  5105. * @param value The value of the field on the source object.
  5106. * @param callback The callback function.
  5107. * @param source The source object being validated.
  5108. * @param options The validation options.
  5109. * @param options.messages The validation messages.
  5110. */
  5111. function floatFn(rule, value, callback, source, options) {
  5112. var errors = [];
  5113. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  5114. if (validate) {
  5115. if (isEmptyValue(value) && !rule.required) {
  5116. return callback();
  5117. }
  5118. rules.required(rule, value, source, errors, options);
  5119. if (value !== undefined) {
  5120. rules.type(rule, value, source, errors, options);
  5121. rules.range(rule, value, source, errors, options);
  5122. }
  5123. }
  5124. callback(errors);
  5125. }
  5126. /**
  5127. * Validates an array.
  5128. *
  5129. * @param rule The validation rule.
  5130. * @param value The value of the field on the source object.
  5131. * @param callback The callback function.
  5132. * @param source The source object being validated.
  5133. * @param options The validation options.
  5134. * @param options.messages The validation messages.
  5135. */
  5136. function array(rule, value, callback, source, options) {
  5137. var errors = [];
  5138. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  5139. if (validate) {
  5140. if (isEmptyValue(value, 'array') && !rule.required) {
  5141. return callback();
  5142. }
  5143. rules.required(rule, value, source, errors, options, 'array');
  5144. if (!isEmptyValue(value, 'array')) {
  5145. rules.type(rule, value, source, errors, options);
  5146. rules.range(rule, value, source, errors, options);
  5147. }
  5148. }
  5149. callback(errors);
  5150. }
  5151. /**
  5152. * Validates an object.
  5153. *
  5154. * @param rule The validation rule.
  5155. * @param value The value of the field on the source object.
  5156. * @param callback The callback function.
  5157. * @param source The source object being validated.
  5158. * @param options The validation options.
  5159. * @param options.messages The validation messages.
  5160. */
  5161. function object(rule, value, callback, source, options) {
  5162. var errors = [];
  5163. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  5164. if (validate) {
  5165. if (isEmptyValue(value) && !rule.required) {
  5166. return callback();
  5167. }
  5168. rules.required(rule, value, source, errors, options);
  5169. if (value !== undefined) {
  5170. rules.type(rule, value, source, errors, options);
  5171. }
  5172. }
  5173. callback(errors);
  5174. }
  5175. var ENUM$1 = 'enum';
  5176. /**
  5177. * Validates an enumerable list.
  5178. *
  5179. * @param rule The validation rule.
  5180. * @param value The value of the field on the source object.
  5181. * @param callback The callback function.
  5182. * @param source The source object being validated.
  5183. * @param options The validation options.
  5184. * @param options.messages The validation messages.
  5185. */
  5186. function enumerable$1(rule, value, callback, source, options) {
  5187. var errors = [];
  5188. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  5189. if (validate) {
  5190. if (isEmptyValue(value) && !rule.required) {
  5191. return callback();
  5192. }
  5193. rules.required(rule, value, source, errors, options);
  5194. if (value !== undefined) {
  5195. rules[ENUM$1](rule, value, source, errors, options);
  5196. }
  5197. }
  5198. callback(errors);
  5199. }
  5200. /**
  5201. * Validates a regular expression pattern.
  5202. *
  5203. * Performs validation when a rule only contains
  5204. * a pattern property but is not declared as a string type.
  5205. *
  5206. * @param rule The validation rule.
  5207. * @param value The value of the field on the source object.
  5208. * @param callback The callback function.
  5209. * @param source The source object being validated.
  5210. * @param options The validation options.
  5211. * @param options.messages The validation messages.
  5212. */
  5213. function pattern$2(rule, value, callback, source, options) {
  5214. var errors = [];
  5215. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  5216. if (validate) {
  5217. if (isEmptyValue(value, 'string') && !rule.required) {
  5218. return callback();
  5219. }
  5220. rules.required(rule, value, source, errors, options);
  5221. if (!isEmptyValue(value, 'string')) {
  5222. rules.pattern(rule, value, source, errors, options);
  5223. }
  5224. }
  5225. callback(errors);
  5226. }
  5227. function date(rule, value, callback, source, options) {
  5228. var errors = [];
  5229. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  5230. if (validate) {
  5231. if (isEmptyValue(value) && !rule.required) {
  5232. return callback();
  5233. }
  5234. rules.required(rule, value, source, errors, options);
  5235. if (!isEmptyValue(value)) {
  5236. var dateObject;
  5237. if (typeof value === 'number') {
  5238. dateObject = new Date(value);
  5239. } else {
  5240. dateObject = value;
  5241. }
  5242. rules.type(rule, dateObject, source, errors, options);
  5243. if (dateObject) {
  5244. rules.range(rule, dateObject.getTime(), source, errors, options);
  5245. }
  5246. }
  5247. }
  5248. callback(errors);
  5249. }
  5250. function required$1(rule, value, callback, source, options) {
  5251. var errors = [];
  5252. var type = Array.isArray(value) ? 'array' : typeof value;
  5253. rules.required(rule, value, source, errors, options, type);
  5254. callback(errors);
  5255. }
  5256. function type$1(rule, value, callback, source, options) {
  5257. var ruleType = rule.type;
  5258. var errors = [];
  5259. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  5260. if (validate) {
  5261. if (isEmptyValue(value, ruleType) && !rule.required) {
  5262. return callback();
  5263. }
  5264. rules.required(rule, value, source, errors, options, ruleType);
  5265. if (!isEmptyValue(value, ruleType)) {
  5266. rules.type(rule, value, source, errors, options);
  5267. }
  5268. }
  5269. callback(errors);
  5270. }
  5271. /**
  5272. * Performs validation for any type.
  5273. *
  5274. * @param rule The validation rule.
  5275. * @param value The value of the field on the source object.
  5276. * @param callback The callback function.
  5277. * @param source The source object being validated.
  5278. * @param options The validation options.
  5279. * @param options.messages The validation messages.
  5280. */
  5281. function any(rule, value, callback, source, options) {
  5282. var errors = [];
  5283. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  5284. if (validate) {
  5285. if (isEmptyValue(value) && !rule.required) {
  5286. return callback();
  5287. }
  5288. rules.required(rule, value, source, errors, options);
  5289. }
  5290. callback(errors);
  5291. }
  5292. var validators = {
  5293. string: string,
  5294. method: method,
  5295. number: number,
  5296. "boolean": _boolean,
  5297. regexp: regexp,
  5298. integer: integer,
  5299. "float": floatFn,
  5300. array: array,
  5301. object: object,
  5302. "enum": enumerable$1,
  5303. pattern: pattern$2,
  5304. date: date,
  5305. url: type$1,
  5306. hex: type$1,
  5307. email: type$1,
  5308. required: required$1,
  5309. any: any };
  5310. function newMessages() {
  5311. return {
  5312. "default": 'Validation error on field %s',
  5313. required: '%s is required',
  5314. "enum": '%s must be one of %s',
  5315. whitespace: '%s cannot be empty',
  5316. date: {
  5317. format: '%s date %s is invalid for format %s',
  5318. parse: '%s date could not be parsed, %s is invalid ',
  5319. invalid: '%s date %s is invalid' },
  5320. types: {
  5321. string: '%s is not a %s',
  5322. method: '%s is not a %s (function)',
  5323. array: '%s is not an %s',
  5324. object: '%s is not an %s',
  5325. number: '%s is not a %s',
  5326. date: '%s is not a %s',
  5327. "boolean": '%s is not a %s',
  5328. integer: '%s is not an %s',
  5329. "float": '%s is not a %s',
  5330. regexp: '%s is not a valid %s',
  5331. email: '%s is not a valid %s',
  5332. url: '%s is not a valid %s',
  5333. hex: '%s is not a valid %s' },
  5334. string: {
  5335. len: '%s must be exactly %s characters',
  5336. min: '%s must be at least %s characters',
  5337. max: '%s cannot be longer than %s characters',
  5338. range: '%s must be between %s and %s characters' },
  5339. number: {
  5340. len: '%s must equal %s',
  5341. min: '%s cannot be less than %s',
  5342. max: '%s cannot be greater than %s',
  5343. range: '%s must be between %s and %s' },
  5344. array: {
  5345. len: '%s must be exactly %s in length',
  5346. min: '%s cannot be less than %s in length',
  5347. max: '%s cannot be greater than %s in length',
  5348. range: '%s must be between %s and %s in length' },
  5349. pattern: {
  5350. mismatch: '%s value %s does not match pattern %s' },
  5351. clone: function clone() {
  5352. var cloned = JSON.parse(JSON.stringify(this));
  5353. cloned.clone = this.clone;
  5354. return cloned;
  5355. } };
  5356. }
  5357. var messages = newMessages();
  5358. /**
  5359. * Encapsulates a validation schema.
  5360. *
  5361. * @param descriptor An object declaring validation rules
  5362. * for this schema.
  5363. */
  5364. function Schema(descriptor) {
  5365. this.rules = null;
  5366. this._messages = messages;
  5367. this.define(descriptor);
  5368. }
  5369. Schema.prototype = {
  5370. messages: function messages(_messages) {
  5371. if (_messages) {
  5372. this._messages = deepMerge(newMessages(), _messages);
  5373. }
  5374. return this._messages;
  5375. },
  5376. define: function define(rules) {
  5377. if (!rules) {
  5378. throw new Error('Cannot configure a schema with no rules');
  5379. }
  5380. if (typeof rules !== 'object' || Array.isArray(rules)) {
  5381. throw new Error('Rules must be an object');
  5382. }
  5383. this.rules = {};
  5384. var z;
  5385. var item;
  5386. for (z in rules) {
  5387. if (rules.hasOwnProperty(z)) {
  5388. item = rules[z];
  5389. this.rules[z] = Array.isArray(item) ? item : [item];
  5390. }
  5391. }
  5392. },
  5393. validate: function validate(source_, o, oc) {
  5394. var _this = this;
  5395. if (o === void 0) {
  5396. o = {};
  5397. }
  5398. if (oc === void 0) {
  5399. oc = function oc() {};
  5400. }
  5401. var source = source_;
  5402. var options = o;
  5403. var callback = oc;
  5404. if (typeof options === 'function') {
  5405. callback = options;
  5406. options = {};
  5407. }
  5408. if (!this.rules || Object.keys(this.rules).length === 0) {
  5409. if (callback) {
  5410. callback();
  5411. }
  5412. return Promise.resolve();
  5413. }
  5414. function complete(results) {
  5415. var i;
  5416. var errors = [];
  5417. var fields = {};
  5418. function add(e) {
  5419. if (Array.isArray(e)) {
  5420. var _errors;
  5421. errors = (_errors = errors).concat.apply(_errors, e);
  5422. } else {
  5423. errors.push(e);
  5424. }
  5425. }
  5426. for (i = 0; i < results.length; i++) {
  5427. add(results[i]);
  5428. }
  5429. if (!errors.length) {
  5430. errors = null;
  5431. fields = null;
  5432. } else {
  5433. fields = convertFieldsError(errors);
  5434. }
  5435. callback(errors, fields);
  5436. }
  5437. if (options.messages) {
  5438. var messages$1 = this.messages();
  5439. if (messages$1 === messages) {
  5440. messages$1 = newMessages();
  5441. }
  5442. deepMerge(messages$1, options.messages);
  5443. options.messages = messages$1;
  5444. } else {
  5445. options.messages = this.messages();
  5446. }
  5447. var arr;
  5448. var value;
  5449. var series = {};
  5450. var keys = options.keys || Object.keys(this.rules);
  5451. keys.forEach(function (z) {
  5452. arr = _this.rules[z];
  5453. value = source[z];
  5454. arr.forEach(function (r) {
  5455. var rule = r;
  5456. if (typeof rule.transform === 'function') {
  5457. if (source === source_) {
  5458. source = _extends({}, source);
  5459. }
  5460. value = source[z] = rule.transform(value);
  5461. }
  5462. if (typeof rule === 'function') {
  5463. rule = {
  5464. validator: rule };
  5465. } else {
  5466. rule = _extends({}, rule);
  5467. }
  5468. rule.validator = _this.getValidationMethod(rule);
  5469. rule.field = z;
  5470. rule.fullField = rule.fullField || z;
  5471. rule.type = _this.getType(rule);
  5472. if (!rule.validator) {
  5473. return;
  5474. }
  5475. series[z] = series[z] || [];
  5476. series[z].push({
  5477. rule: rule,
  5478. value: value,
  5479. source: source,
  5480. field: z });
  5481. });
  5482. });
  5483. var errorFields = {};
  5484. return asyncMap(series, options, function (data, doIt) {
  5485. var rule = data.rule;
  5486. var deep = (rule.type === 'object' || rule.type === 'array') && (typeof rule.fields === 'object' || typeof rule.defaultField ===
  5487. 'object');
  5488. deep = deep && (rule.required || !rule.required && data.value);
  5489. rule.field = data.field;
  5490. function addFullfield(key, schema) {
  5491. return _extends({}, schema, {
  5492. fullField: rule.fullField + "." + key });
  5493. }
  5494. function cb(e) {
  5495. if (e === void 0) {
  5496. e = [];
  5497. }
  5498. var errors = e;
  5499. if (!Array.isArray(errors)) {
  5500. errors = [errors];
  5501. }
  5502. if (!options.suppressWarning && errors.length) {
  5503. Schema.warning('async-validator:', errors);
  5504. }
  5505. if (errors.length && rule.message) {
  5506. errors = [].concat(rule.message);
  5507. }
  5508. errors = errors.map(complementError(rule));
  5509. if (options.first && errors.length) {
  5510. errorFields[rule.field] = 1;
  5511. return doIt(errors);
  5512. }
  5513. if (!deep) {
  5514. doIt(errors);
  5515. } else {
  5516. // if rule is required but the target object
  5517. // does not exist fail at the rule level and don't
  5518. // go deeper
  5519. if (rule.required && !data.value) {
  5520. if (rule.message) {
  5521. errors = [].concat(rule.message).map(complementError(rule));
  5522. } else if (options.error) {
  5523. errors = [options.error(rule, format(options.messages.required, rule.field))];
  5524. } else {
  5525. errors = [];
  5526. }
  5527. return doIt(errors);
  5528. }
  5529. var fieldsSchema = {};
  5530. if (rule.defaultField) {
  5531. for (var k in data.value) {
  5532. if (data.value.hasOwnProperty(k)) {
  5533. fieldsSchema[k] = rule.defaultField;
  5534. }
  5535. }
  5536. }
  5537. fieldsSchema = _extends({}, fieldsSchema, {}, data.rule.fields);
  5538. for (var f in fieldsSchema) {
  5539. if (fieldsSchema.hasOwnProperty(f)) {
  5540. var fieldSchema = Array.isArray(fieldsSchema[f]) ? fieldsSchema[f] : [fieldsSchema[f]];
  5541. fieldsSchema[f] = fieldSchema.map(addFullfield.bind(null, f));
  5542. }
  5543. }
  5544. var schema = new Schema(fieldsSchema);
  5545. schema.messages(options.messages);
  5546. if (data.rule.options) {
  5547. data.rule.options.messages = options.messages;
  5548. data.rule.options.error = options.error;
  5549. }
  5550. schema.validate(data.value, data.rule.options || options, function (errs) {
  5551. var finalErrors = [];
  5552. if (errors && errors.length) {
  5553. finalErrors.push.apply(finalErrors, errors);
  5554. }
  5555. if (errs && errs.length) {
  5556. finalErrors.push.apply(finalErrors, errs);
  5557. }
  5558. doIt(finalErrors.length ? finalErrors : null);
  5559. });
  5560. }
  5561. }
  5562. var res;
  5563. if (rule.asyncValidator) {
  5564. res = rule.asyncValidator(rule, data.value, cb, data.source, options);
  5565. } else if (rule.validator) {
  5566. res = rule.validator(rule, data.value, cb, data.source, options);
  5567. if (res === true) {
  5568. cb();
  5569. } else if (res === false) {
  5570. cb(rule.message || rule.field + " fails");
  5571. } else if (res instanceof Array) {
  5572. cb(res);
  5573. } else if (res instanceof Error) {
  5574. cb(res.message);
  5575. }
  5576. }
  5577. if (res && res.then) {
  5578. res.then(function () {
  5579. return cb();
  5580. }, function (e) {
  5581. return cb(e);
  5582. });
  5583. }
  5584. }, function (results) {
  5585. complete(results);
  5586. });
  5587. },
  5588. getType: function getType(rule) {
  5589. if (rule.type === undefined && rule.pattern instanceof RegExp) {
  5590. rule.type = 'pattern';
  5591. }
  5592. if (typeof rule.validator !== 'function' && rule.type && !validators.hasOwnProperty(rule.type)) {
  5593. throw new Error(format('Unknown rule type %s', rule.type));
  5594. }
  5595. return rule.type || 'string';
  5596. },
  5597. getValidationMethod: function getValidationMethod(rule) {
  5598. if (typeof rule.validator === 'function') {
  5599. return rule.validator;
  5600. }
  5601. var keys = Object.keys(rule);
  5602. var messageIndex = keys.indexOf('message');
  5603. if (messageIndex !== -1) {
  5604. keys.splice(messageIndex, 1);
  5605. }
  5606. if (keys.length === 1 && keys[0] === 'required') {
  5607. return validators.required;
  5608. }
  5609. return validators[this.getType(rule)] || false;
  5610. } };
  5611. Schema.register = function register(type, validator) {
  5612. if (typeof validator !== 'function') {
  5613. throw new Error('Cannot register a validator by type, validator is not a function');
  5614. }
  5615. validators[type] = validator;
  5616. };
  5617. Schema.warning = warning;
  5618. Schema.messages = messages;var _default =
  5619. Schema;exports.default = _default;
  5620. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/node-libs-browser/mock/process.js */ 238)))
  5621. /***/ }),
  5622. /***/ 238:
  5623. /*!********************************************************!*\
  5624. !*** ./node_modules/node-libs-browser/mock/process.js ***!
  5625. \********************************************************/
  5626. /*! no static exports found */
  5627. /***/ (function(module, exports, __webpack_require__) {
  5628. exports.nextTick = function nextTick(fn) {
  5629. var args = Array.prototype.slice.call(arguments);
  5630. args.shift();
  5631. setTimeout(function () {
  5632. fn.apply(null, args);
  5633. }, 0);
  5634. };
  5635. exports.platform = exports.arch =
  5636. exports.execPath = exports.title = 'browser';
  5637. exports.pid = 1;
  5638. exports.browser = true;
  5639. exports.env = {};
  5640. exports.argv = [];
  5641. exports.binding = function (name) {
  5642. throw new Error('No such module. (Possibly not yet loaded)')
  5643. };
  5644. (function () {
  5645. var cwd = '/';
  5646. var path;
  5647. exports.cwd = function () { return cwd };
  5648. exports.chdir = function (dir) {
  5649. if (!path) path = __webpack_require__(/*! path */ 239);
  5650. cwd = path.resolve(dir, cwd);
  5651. };
  5652. })();
  5653. exports.exit = exports.kill =
  5654. exports.umask = exports.dlopen =
  5655. exports.uptime = exports.memoryUsage =
  5656. exports.uvCounters = function() {};
  5657. exports.features = {};
  5658. /***/ }),
  5659. /***/ 239:
  5660. /*!***********************************************!*\
  5661. !*** ./node_modules/path-browserify/index.js ***!
  5662. \***********************************************/
  5663. /*! no static exports found */
  5664. /***/ (function(module, exports, __webpack_require__) {
  5665. /* WEBPACK VAR INJECTION */(function(process) {// .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1,
  5666. // backported and transplited with Babel, with backwards-compat fixes
  5667. // Copyright Joyent, Inc. and other Node contributors.
  5668. //
  5669. // Permission is hereby granted, free of charge, to any person obtaining a
  5670. // copy of this software and associated documentation files (the
  5671. // "Software"), to deal in the Software without restriction, including
  5672. // without limitation the rights to use, copy, modify, merge, publish,
  5673. // distribute, sublicense, and/or sell copies of the Software, and to permit
  5674. // persons to whom the Software is furnished to do so, subject to the
  5675. // following conditions:
  5676. //
  5677. // The above copyright notice and this permission notice shall be included
  5678. // in all copies or substantial portions of the Software.
  5679. //
  5680. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  5681. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  5682. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  5683. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  5684. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  5685. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  5686. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  5687. // resolves . and .. elements in a path array with directory names there
  5688. // must be no slashes, empty elements, or device names (c:\) in the array
  5689. // (so also no leading and trailing slashes - it does not distinguish
  5690. // relative and absolute paths)
  5691. function normalizeArray(parts, allowAboveRoot) {
  5692. // if the path tries to go above the root, `up` ends up > 0
  5693. var up = 0;
  5694. for (var i = parts.length - 1; i >= 0; i--) {
  5695. var last = parts[i];
  5696. if (last === '.') {
  5697. parts.splice(i, 1);
  5698. } else if (last === '..') {
  5699. parts.splice(i, 1);
  5700. up++;
  5701. } else if (up) {
  5702. parts.splice(i, 1);
  5703. up--;
  5704. }
  5705. }
  5706. // if the path is allowed to go above the root, restore leading ..s
  5707. if (allowAboveRoot) {
  5708. for (; up--; up) {
  5709. parts.unshift('..');
  5710. }
  5711. }
  5712. return parts;
  5713. }
  5714. // path.resolve([from ...], to)
  5715. // posix version
  5716. exports.resolve = function() {
  5717. var resolvedPath = '',
  5718. resolvedAbsolute = false;
  5719. for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
  5720. var path = (i >= 0) ? arguments[i] : process.cwd();
  5721. // Skip empty and invalid entries
  5722. if (typeof path !== 'string') {
  5723. throw new TypeError('Arguments to path.resolve must be strings');
  5724. } else if (!path) {
  5725. continue;
  5726. }
  5727. resolvedPath = path + '/' + resolvedPath;
  5728. resolvedAbsolute = path.charAt(0) === '/';
  5729. }
  5730. // At this point the path should be resolved to a full absolute path, but
  5731. // handle relative paths to be safe (might happen when process.cwd() fails)
  5732. // Normalize the path
  5733. resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
  5734. return !!p;
  5735. }), !resolvedAbsolute).join('/');
  5736. return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
  5737. };
  5738. // path.normalize(path)
  5739. // posix version
  5740. exports.normalize = function(path) {
  5741. var isAbsolute = exports.isAbsolute(path),
  5742. trailingSlash = substr(path, -1) === '/';
  5743. // Normalize the path
  5744. path = normalizeArray(filter(path.split('/'), function(p) {
  5745. return !!p;
  5746. }), !isAbsolute).join('/');
  5747. if (!path && !isAbsolute) {
  5748. path = '.';
  5749. }
  5750. if (path && trailingSlash) {
  5751. path += '/';
  5752. }
  5753. return (isAbsolute ? '/' : '') + path;
  5754. };
  5755. // posix version
  5756. exports.isAbsolute = function(path) {
  5757. return path.charAt(0) === '/';
  5758. };
  5759. // posix version
  5760. exports.join = function() {
  5761. var paths = Array.prototype.slice.call(arguments, 0);
  5762. return exports.normalize(filter(paths, function(p, index) {
  5763. if (typeof p !== 'string') {
  5764. throw new TypeError('Arguments to path.join must be strings');
  5765. }
  5766. return p;
  5767. }).join('/'));
  5768. };
  5769. // path.relative(from, to)
  5770. // posix version
  5771. exports.relative = function(from, to) {
  5772. from = exports.resolve(from).substr(1);
  5773. to = exports.resolve(to).substr(1);
  5774. function trim(arr) {
  5775. var start = 0;
  5776. for (; start < arr.length; start++) {
  5777. if (arr[start] !== '') break;
  5778. }
  5779. var end = arr.length - 1;
  5780. for (; end >= 0; end--) {
  5781. if (arr[end] !== '') break;
  5782. }
  5783. if (start > end) return [];
  5784. return arr.slice(start, end - start + 1);
  5785. }
  5786. var fromParts = trim(from.split('/'));
  5787. var toParts = trim(to.split('/'));
  5788. var length = Math.min(fromParts.length, toParts.length);
  5789. var samePartsLength = length;
  5790. for (var i = 0; i < length; i++) {
  5791. if (fromParts[i] !== toParts[i]) {
  5792. samePartsLength = i;
  5793. break;
  5794. }
  5795. }
  5796. var outputParts = [];
  5797. for (var i = samePartsLength; i < fromParts.length; i++) {
  5798. outputParts.push('..');
  5799. }
  5800. outputParts = outputParts.concat(toParts.slice(samePartsLength));
  5801. return outputParts.join('/');
  5802. };
  5803. exports.sep = '/';
  5804. exports.delimiter = ':';
  5805. exports.dirname = function (path) {
  5806. if (typeof path !== 'string') path = path + '';
  5807. if (path.length === 0) return '.';
  5808. var code = path.charCodeAt(0);
  5809. var hasRoot = code === 47 /*/*/;
  5810. var end = -1;
  5811. var matchedSlash = true;
  5812. for (var i = path.length - 1; i >= 1; --i) {
  5813. code = path.charCodeAt(i);
  5814. if (code === 47 /*/*/) {
  5815. if (!matchedSlash) {
  5816. end = i;
  5817. break;
  5818. }
  5819. } else {
  5820. // We saw the first non-path separator
  5821. matchedSlash = false;
  5822. }
  5823. }
  5824. if (end === -1) return hasRoot ? '/' : '.';
  5825. if (hasRoot && end === 1) {
  5826. // return '//';
  5827. // Backwards-compat fix:
  5828. return '/';
  5829. }
  5830. return path.slice(0, end);
  5831. };
  5832. function basename(path) {
  5833. if (typeof path !== 'string') path = path + '';
  5834. var start = 0;
  5835. var end = -1;
  5836. var matchedSlash = true;
  5837. var i;
  5838. for (i = path.length - 1; i >= 0; --i) {
  5839. if (path.charCodeAt(i) === 47 /*/*/) {
  5840. // If we reached a path separator that was not part of a set of path
  5841. // separators at the end of the string, stop now
  5842. if (!matchedSlash) {
  5843. start = i + 1;
  5844. break;
  5845. }
  5846. } else if (end === -1) {
  5847. // We saw the first non-path separator, mark this as the end of our
  5848. // path component
  5849. matchedSlash = false;
  5850. end = i + 1;
  5851. }
  5852. }
  5853. if (end === -1) return '';
  5854. return path.slice(start, end);
  5855. }
  5856. // Uses a mixed approach for backwards-compatibility, as ext behavior changed
  5857. // in new Node.js versions, so only basename() above is backported here
  5858. exports.basename = function (path, ext) {
  5859. var f = basename(path);
  5860. if (ext && f.substr(-1 * ext.length) === ext) {
  5861. f = f.substr(0, f.length - ext.length);
  5862. }
  5863. return f;
  5864. };
  5865. exports.extname = function (path) {
  5866. if (typeof path !== 'string') path = path + '';
  5867. var startDot = -1;
  5868. var startPart = 0;
  5869. var end = -1;
  5870. var matchedSlash = true;
  5871. // Track the state of characters (if any) we see before our first dot and
  5872. // after any path separator we find
  5873. var preDotState = 0;
  5874. for (var i = path.length - 1; i >= 0; --i) {
  5875. var code = path.charCodeAt(i);
  5876. if (code === 47 /*/*/) {
  5877. // If we reached a path separator that was not part of a set of path
  5878. // separators at the end of the string, stop now
  5879. if (!matchedSlash) {
  5880. startPart = i + 1;
  5881. break;
  5882. }
  5883. continue;
  5884. }
  5885. if (end === -1) {
  5886. // We saw the first non-path separator, mark this as the end of our
  5887. // extension
  5888. matchedSlash = false;
  5889. end = i + 1;
  5890. }
  5891. if (code === 46 /*.*/) {
  5892. // If this is our first dot, mark it as the start of our extension
  5893. if (startDot === -1)
  5894. startDot = i;
  5895. else if (preDotState !== 1)
  5896. preDotState = 1;
  5897. } else if (startDot !== -1) {
  5898. // We saw a non-dot and non-path separator before our dot, so we should
  5899. // have a good chance at having a non-empty extension
  5900. preDotState = -1;
  5901. }
  5902. }
  5903. if (startDot === -1 || end === -1 ||
  5904. // We saw a non-dot character immediately before the dot
  5905. preDotState === 0 ||
  5906. // The (right-most) trimmed path component is exactly '..'
  5907. preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
  5908. return '';
  5909. }
  5910. return path.slice(startDot, end);
  5911. };
  5912. function filter (xs, f) {
  5913. if (xs.filter) return xs.filter(f);
  5914. var res = [];
  5915. for (var i = 0; i < xs.length; i++) {
  5916. if (f(xs[i], i, xs)) res.push(xs[i]);
  5917. }
  5918. return res;
  5919. }
  5920. // String.prototype.substr - negative index don't work in IE8
  5921. var substr = 'ab'.substr(-1) === 'b'
  5922. ? function (str, start, len) { return str.substr(start, len) }
  5923. : function (str, start, len) {
  5924. if (start < 0) start = str.length + start;
  5925. return str.substr(start, len);
  5926. }
  5927. ;
  5928. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/mock/process.js */ 238)))
  5929. /***/ }),
  5930. /***/ 24:
  5931. /*!************************************************************************!*\
  5932. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/timeFrom.js ***!
  5933. \************************************************************************/
  5934. /*! no static exports found */
  5935. /***/ (function(module, exports, __webpack_require__) {
  5936. "use strict";
  5937. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _timeFormat = _interopRequireDefault(__webpack_require__(/*! ../../libs/function/timeFormat.js */ 23));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  5938. /**
  5939. * 时间戳转为多久之前
  5940. * @param String timestamp 时间戳
  5941. * @param String | Boolean format 如果为时间格式字符串,超出一定时间范围,返回固定的时间格式;
  5942. * 如果为布尔值false,无论什么时间,都返回多久以前的格式
  5943. */
  5944. function timeFrom() {var dateTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-mm-dd';
  5945. // 如果为null,则格式化当前时间
  5946. if (!dateTime) dateTime = Number(new Date());
  5947. // 如果dateTime长度为10或者13,则为秒和毫秒的时间戳,如果超过13位,则为其他的时间格式
  5948. if (dateTime.toString().length == 10) dateTime *= 1000;
  5949. var timestamp = +new Date(Number(dateTime));
  5950. var timer = (Number(new Date()) - timestamp) / 1000;
  5951. // 如果小于5分钟,则返回"刚刚",其他以此类推
  5952. var tips = '';
  5953. switch (true) {
  5954. case timer < 300:
  5955. tips = '刚刚';
  5956. break;
  5957. case timer >= 300 && timer < 3600:
  5958. tips = parseInt(timer / 60) + '分钟前';
  5959. break;
  5960. case timer >= 3600 && timer < 86400:
  5961. tips = parseInt(timer / 3600) + '小时前';
  5962. break;
  5963. case timer >= 86400 && timer < 2592000:
  5964. tips = parseInt(timer / 86400) + '天前';
  5965. break;
  5966. default:
  5967. // 如果format为false,则无论什么时间戳,都显示xx之前
  5968. if (format === false) {
  5969. if (timer >= 2592000 && timer < 365 * 86400) {
  5970. tips = parseInt(timer / (86400 * 30)) + '个月前';
  5971. } else {
  5972. tips = parseInt(timer / (86400 * 365)) + '年前';
  5973. }
  5974. } else {
  5975. tips = (0, _timeFormat.default)(timestamp, format);
  5976. }}
  5977. return tips;
  5978. }var _default =
  5979. timeFrom;exports.default = _default;
  5980. /***/ }),
  5981. /***/ 25:
  5982. /*!*****************************************************************************!*\
  5983. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/colorGradient.js ***!
  5984. \*****************************************************************************/
  5985. /*! no static exports found */
  5986. /***/ (function(module, exports, __webpack_require__) {
  5987. "use strict";
  5988. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  5989. * 求两个颜色之间的渐变值
  5990. * @param {string} startColor 开始的颜色
  5991. * @param {string} endColor 结束的颜色
  5992. * @param {number} step 颜色等分的份额
  5993. * */
  5994. function colorGradient() {var startColor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'rgb(0, 0, 0)';var endColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'rgb(255, 255, 255)';var step = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 10;
  5995. var startRGB = hexToRgb(startColor, false); //转换为rgb数组模式
  5996. var startR = startRGB[0];
  5997. var startG = startRGB[1];
  5998. var startB = startRGB[2];
  5999. var endRGB = hexToRgb(endColor, false);
  6000. var endR = endRGB[0];
  6001. var endG = endRGB[1];
  6002. var endB = endRGB[2];
  6003. var sR = (endR - startR) / step; //总差值
  6004. var sG = (endG - startG) / step;
  6005. var sB = (endB - startB) / step;
  6006. var colorArr = [];
  6007. for (var i = 0; i < step; i++) {
  6008. //计算每一步的hex值
  6009. var hex = rgbToHex('rgb(' + Math.round(sR * i + startR) + ',' + Math.round(sG * i + startG) + ',' + Math.round(sB *
  6010. i + startB) + ')');
  6011. colorArr.push(hex);
  6012. }
  6013. return colorArr;
  6014. }
  6015. // 将hex表示方式转换为rgb表示方式(这里返回rgb数组模式)
  6016. function hexToRgb(sColor) {var str = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  6017. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  6018. sColor = sColor.toLowerCase();
  6019. if (sColor && reg.test(sColor)) {
  6020. if (sColor.length === 4) {
  6021. var sColorNew = "#";
  6022. for (var i = 1; i < 4; i += 1) {
  6023. sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
  6024. }
  6025. sColor = sColorNew;
  6026. }
  6027. //处理六位的颜色值
  6028. var sColorChange = [];
  6029. for (var _i = 1; _i < 7; _i += 2) {
  6030. sColorChange.push(parseInt("0x" + sColor.slice(_i, _i + 2)));
  6031. }
  6032. if (!str) {
  6033. return sColorChange;
  6034. } else {
  6035. return "rgb(".concat(sColorChange[0], ",").concat(sColorChange[1], ",").concat(sColorChange[2], ")");
  6036. }
  6037. } else if (/^(rgb|RGB)/.test(sColor)) {
  6038. var arr = sColor.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
  6039. return arr.map(function (val) {return Number(val);});
  6040. } else {
  6041. return sColor;
  6042. }
  6043. };
  6044. // 将rgb表示方式转换为hex表示方式
  6045. function rgbToHex(rgb) {
  6046. var _this = rgb;
  6047. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  6048. if (/^(rgb|RGB)/.test(_this)) {
  6049. var aColor = _this.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
  6050. var strHex = "#";
  6051. for (var i = 0; i < aColor.length; i++) {
  6052. var hex = Number(aColor[i]).toString(16);
  6053. hex = String(hex).length == 1 ? 0 + '' + hex : hex; // 保证每个rgb的值为2位
  6054. if (hex === "0") {
  6055. hex += hex;
  6056. }
  6057. strHex += hex;
  6058. }
  6059. if (strHex.length !== 7) {
  6060. strHex = _this;
  6061. }
  6062. return strHex;
  6063. } else if (reg.test(_this)) {
  6064. var aNum = _this.replace(/#/, "").split("");
  6065. if (aNum.length === 6) {
  6066. return _this;
  6067. } else if (aNum.length === 3) {
  6068. var numHex = "#";
  6069. for (var _i2 = 0; _i2 < aNum.length; _i2 += 1) {
  6070. numHex += aNum[_i2] + aNum[_i2];
  6071. }
  6072. return numHex;
  6073. }
  6074. } else {
  6075. return _this;
  6076. }
  6077. }
  6078. /**
  6079. * JS颜色十六进制转换为rgb或rgba,返回的格式为 rgba(255,255,255,0.5)字符串
  6080. * sHex为传入的十六进制的色值
  6081. * alpha为rgba的透明度
  6082. */
  6083. function colorToRgba(color) {var alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.3;
  6084. color = rgbToHex(color);
  6085. // 十六进制颜色值的正则表达式
  6086. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  6087. /* 16进制颜色转为RGB格式 */
  6088. var sColor = color.toLowerCase();
  6089. if (sColor && reg.test(sColor)) {
  6090. if (sColor.length === 4) {
  6091. var sColorNew = '#';
  6092. for (var i = 1; i < 4; i += 1) {
  6093. sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
  6094. }
  6095. sColor = sColorNew;
  6096. }
  6097. // 处理六位的颜色值
  6098. var sColorChange = [];
  6099. for (var _i3 = 1; _i3 < 7; _i3 += 2) {
  6100. sColorChange.push(parseInt('0x' + sColor.slice(_i3, _i3 + 2)));
  6101. }
  6102. // return sColorChange.join(',')
  6103. return 'rgba(' + sColorChange.join(',') + ',' + alpha + ')';
  6104. } else
  6105. {
  6106. return sColor;
  6107. }
  6108. }var _default =
  6109. {
  6110. colorGradient: colorGradient,
  6111. hexToRgb: hexToRgb,
  6112. rgbToHex: rgbToHex,
  6113. colorToRgba: colorToRgba };exports.default = _default;
  6114. /***/ }),
  6115. /***/ 26:
  6116. /*!********************************************************************!*\
  6117. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/guid.js ***!
  6118. \********************************************************************/
  6119. /*! no static exports found */
  6120. /***/ (function(module, exports, __webpack_require__) {
  6121. "use strict";
  6122. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  6123. * 本算法来源于简书开源代码,详见:https://www.jianshu.com/p/fdbf293d0a85
  6124. * 全局唯一标识符(uuid,Globally Unique Identifier),也称作 uuid(Universally Unique IDentifier)
  6125. * 一般用于多个组件之间,给它一个唯一的标识符,或者v-for循环的时候,如果使用数组的index可能会导致更新列表出现问题
  6126. * 最可能的情况是左滑删除item或者对某条信息流"不喜欢"并去掉它的时候,会导致组件内的数据可能出现错乱
  6127. * v-for的时候,推荐使用后端返回的id而不是循环的index
  6128. * @param {Number} len uuid的长度
  6129. * @param {Boolean} firstU 将返回的首字母置为"u"
  6130. * @param {Nubmer} radix 生成uuid的基数(意味着返回的字符串都是这个基数),2-二进制,8-八进制,10-十进制,16-十六进制
  6131. */
  6132. function guid() {var len = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 32;var firstU = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;var radix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  6133. var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
  6134. var uuid = [];
  6135. radix = radix || chars.length;
  6136. if (len) {
  6137. // 如果指定uuid长度,只是取随机的字符,0|x为位运算,能去掉x的小数位,返回整数位
  6138. for (var i = 0; i < len; i++) {uuid[i] = chars[0 | Math.random() * radix];}
  6139. } else {
  6140. var r;
  6141. // rfc4122标准要求返回的uuid中,某些位为固定的字符
  6142. uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
  6143. uuid[14] = '4';
  6144. for (var _i = 0; _i < 36; _i++) {
  6145. if (!uuid[_i]) {
  6146. r = 0 | Math.random() * 16;
  6147. uuid[_i] = chars[_i == 19 ? r & 0x3 | 0x8 : r];
  6148. }
  6149. }
  6150. }
  6151. // 移除第一个字符,并用u替代,因为第一个字符为数值时,该guuid不能用作id或者class
  6152. if (firstU) {
  6153. uuid.shift();
  6154. return 'u' + uuid.join('');
  6155. } else {
  6156. return uuid.join('');
  6157. }
  6158. }var _default =
  6159. guid;exports.default = _default;
  6160. /***/ }),
  6161. /***/ 27:
  6162. /*!*********************************************************************!*\
  6163. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/color.js ***!
  6164. \*********************************************************************/
  6165. /*! no static exports found */
  6166. /***/ (function(module, exports, __webpack_require__) {
  6167. "use strict";
  6168. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 为了让用户能够自定义主题,会逐步弃用此文件,各颜色通过css提供
  6169. // 为了给某些特殊场景使用和向后兼容,无需删除此文件(2020-06-20)
  6170. var color = {
  6171. primary: "#2979ff",
  6172. primaryDark: "#2b85e4",
  6173. primaryDisabled: "#a0cfff",
  6174. primaryLight: "#ecf5ff",
  6175. bgColor: "#f3f4f6",
  6176. info: "#909399",
  6177. infoDark: "#82848a",
  6178. infoDisabled: "#c8c9cc",
  6179. infoLight: "#f4f4f5",
  6180. warning: "#ff9900",
  6181. warningDark: "#f29100",
  6182. warningDisabled: "#fcbd71",
  6183. warningLight: "#fdf6ec",
  6184. error: "#fa3534",
  6185. errorDark: "#dd6161",
  6186. errorDisabled: "#fab6b6",
  6187. errorLight: "#fef0f0",
  6188. success: "#19be6b",
  6189. successDark: "#18b566",
  6190. successDisabled: "#71d5a1",
  6191. successLight: "#dbf1e1",
  6192. mainColor: "#303133",
  6193. contentColor: "#606266",
  6194. tipsColor: "#909399",
  6195. lightColor: "#c0c4cc",
  6196. borderColor: "#e4e7ed" };var _default =
  6197. color;exports.default = _default;
  6198. /***/ }),
  6199. /***/ 28:
  6200. /*!*************************************************************************!*\
  6201. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/type2icon.js ***!
  6202. \*************************************************************************/
  6203. /*! no static exports found */
  6204. /***/ (function(module, exports, __webpack_require__) {
  6205. "use strict";
  6206. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  6207. * 根据主题type值,获取对应的图标
  6208. * @param String type 主题名称,primary|info|error|warning|success
  6209. * @param String fill 是否使用fill填充实体的图标
  6210. */
  6211. function type2icon() {var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'success';var fill = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  6212. // 如果非预置值,默认为success
  6213. if (['primary', 'info', 'error', 'warning', 'success'].indexOf(type) == -1) type = 'success';
  6214. var iconName = '';
  6215. // 目前(2019-12-12),info和primary使用同一个图标
  6216. switch (type) {
  6217. case 'primary':
  6218. iconName = 'info-circle';
  6219. break;
  6220. case 'info':
  6221. iconName = 'info-circle';
  6222. break;
  6223. case 'error':
  6224. iconName = 'close-circle';
  6225. break;
  6226. case 'warning':
  6227. iconName = 'error-circle';
  6228. break;
  6229. case 'success':
  6230. iconName = 'checkmark-circle';
  6231. break;
  6232. default:
  6233. iconName = 'checkmark-circle';}
  6234. // 是否是实体类型,加上-fill,在icon组件库中,实体的类名是后面加-fill的
  6235. if (fill) iconName += '-fill';
  6236. return iconName;
  6237. }var _default =
  6238. type2icon;exports.default = _default;
  6239. /***/ }),
  6240. /***/ 29:
  6241. /*!***************************************************************************!*\
  6242. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/randomArray.js ***!
  6243. \***************************************************************************/
  6244. /*! no static exports found */
  6245. /***/ (function(module, exports, __webpack_require__) {
  6246. "use strict";
  6247. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 打乱数组
  6248. function randomArray() {var array = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  6249. // 原理是sort排序,Math.random()产生0<= x < 1之间的数,会导致x-0.05大于或者小于0
  6250. return array.sort(function () {return Math.random() - 0.5;});
  6251. }var _default =
  6252. randomArray;exports.default = _default;
  6253. /***/ }),
  6254. /***/ 3:
  6255. /*!*************************************************************!*\
  6256. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  6257. \*************************************************************/
  6258. /*! no static exports found */
  6259. /***/ (function(module, exports, __webpack_require__) {
  6260. "use strict";
  6261. /* WEBPACK VAR INJECTION */(function(uni, global) {Object.defineProperty(exports, "__esModule", { value: true });exports.compileI18nJsonStr = compileI18nJsonStr;exports.hasI18nJson = hasI18nJson;exports.initVueI18n = initVueI18n;exports.isI18nStr = isI18nStr;exports.normalizeLocale = normalizeLocale;exports.parseI18nJson = parseI18nJson;exports.resolveLocale = resolveLocale;exports.isString = exports.LOCALE_ZH_HANT = exports.LOCALE_ZH_HANS = exports.LOCALE_FR = exports.LOCALE_ES = exports.LOCALE_EN = exports.I18n = exports.Formatter = void 0;function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;}function _iterableToArrayLimit(arr, i) {if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"] != null) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;}var isArray = Array.isArray;
  6262. var isObject = function isObject(val) {return val !== null && typeof val === 'object';};
  6263. var defaultDelimiters = ['{', '}'];var
  6264. BaseFormatter = /*#__PURE__*/function () {
  6265. function BaseFormatter() {_classCallCheck(this, BaseFormatter);
  6266. this._caches = Object.create(null);
  6267. }_createClass(BaseFormatter, [{ key: "interpolate", value: function interpolate(
  6268. message, values) {var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  6269. if (!values) {
  6270. return [message];
  6271. }
  6272. var tokens = this._caches[message];
  6273. if (!tokens) {
  6274. tokens = parse(message, delimiters);
  6275. this._caches[message] = tokens;
  6276. }
  6277. return compile(tokens, values);
  6278. } }]);return BaseFormatter;}();exports.Formatter = BaseFormatter;
  6279. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  6280. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  6281. function parse(format, _ref) {var _ref2 = _slicedToArray(_ref, 2),startDelimiter = _ref2[0],endDelimiter = _ref2[1];
  6282. var tokens = [];
  6283. var position = 0;
  6284. var text = '';
  6285. while (position < format.length) {
  6286. var char = format[position++];
  6287. if (char === startDelimiter) {
  6288. if (text) {
  6289. tokens.push({ type: 'text', value: text });
  6290. }
  6291. text = '';
  6292. var sub = '';
  6293. char = format[position++];
  6294. while (char !== undefined && char !== endDelimiter) {
  6295. sub += char;
  6296. char = format[position++];
  6297. }
  6298. var isClosed = char === endDelimiter;
  6299. var type = RE_TOKEN_LIST_VALUE.test(sub) ?
  6300. 'list' :
  6301. isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ?
  6302. 'named' :
  6303. 'unknown';
  6304. tokens.push({ value: sub, type: type });
  6305. }
  6306. // else if (char === '%') {
  6307. // // when found rails i18n syntax, skip text capture
  6308. // if (format[position] !== '{') {
  6309. // text += char
  6310. // }
  6311. // }
  6312. else {
  6313. text += char;
  6314. }
  6315. }
  6316. text && tokens.push({ type: 'text', value: text });
  6317. return tokens;
  6318. }
  6319. function compile(tokens, values) {
  6320. var compiled = [];
  6321. var index = 0;
  6322. var mode = isArray(values) ?
  6323. 'list' :
  6324. isObject(values) ?
  6325. 'named' :
  6326. 'unknown';
  6327. if (mode === 'unknown') {
  6328. return compiled;
  6329. }
  6330. while (index < tokens.length) {
  6331. var token = tokens[index];
  6332. switch (token.type) {
  6333. case 'text':
  6334. compiled.push(token.value);
  6335. break;
  6336. case 'list':
  6337. compiled.push(values[parseInt(token.value, 10)]);
  6338. break;
  6339. case 'named':
  6340. if (mode === 'named') {
  6341. compiled.push(values[token.value]);
  6342. } else
  6343. {
  6344. if (true) {
  6345. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  6346. }
  6347. }
  6348. break;
  6349. case 'unknown':
  6350. if (true) {
  6351. console.warn("Detect 'unknown' type of token!");
  6352. }
  6353. break;}
  6354. index++;
  6355. }
  6356. return compiled;
  6357. }
  6358. var LOCALE_ZH_HANS = 'zh-Hans';exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  6359. var LOCALE_ZH_HANT = 'zh-Hant';exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  6360. var LOCALE_EN = 'en';exports.LOCALE_EN = LOCALE_EN;
  6361. var LOCALE_FR = 'fr';exports.LOCALE_FR = LOCALE_FR;
  6362. var LOCALE_ES = 'es';exports.LOCALE_ES = LOCALE_ES;
  6363. var hasOwnProperty = Object.prototype.hasOwnProperty;
  6364. var hasOwn = function hasOwn(val, key) {return hasOwnProperty.call(val, key);};
  6365. var defaultFormatter = new BaseFormatter();
  6366. function include(str, parts) {
  6367. return !!parts.find(function (part) {return str.indexOf(part) !== -1;});
  6368. }
  6369. function startsWith(str, parts) {
  6370. return parts.find(function (part) {return str.indexOf(part) === 0;});
  6371. }
  6372. function normalizeLocale(locale, messages) {
  6373. if (!locale) {
  6374. return;
  6375. }
  6376. locale = locale.trim().replace(/_/g, '-');
  6377. if (messages && messages[locale]) {
  6378. return locale;
  6379. }
  6380. locale = locale.toLowerCase();
  6381. if (locale.indexOf('zh') === 0) {
  6382. if (locale.indexOf('-hans') > -1) {
  6383. return LOCALE_ZH_HANS;
  6384. }
  6385. if (locale.indexOf('-hant') > -1) {
  6386. return LOCALE_ZH_HANT;
  6387. }
  6388. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  6389. return LOCALE_ZH_HANT;
  6390. }
  6391. return LOCALE_ZH_HANS;
  6392. }
  6393. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  6394. if (lang) {
  6395. return lang;
  6396. }
  6397. }var
  6398. I18n = /*#__PURE__*/function () {
  6399. function I18n(_ref3) {var locale = _ref3.locale,fallbackLocale = _ref3.fallbackLocale,messages = _ref3.messages,watcher = _ref3.watcher,formater = _ref3.formater;_classCallCheck(this, I18n);
  6400. this.locale = LOCALE_EN;
  6401. this.fallbackLocale = LOCALE_EN;
  6402. this.message = {};
  6403. this.messages = {};
  6404. this.watchers = [];
  6405. if (fallbackLocale) {
  6406. this.fallbackLocale = fallbackLocale;
  6407. }
  6408. this.formater = formater || defaultFormatter;
  6409. this.messages = messages || {};
  6410. this.setLocale(locale || LOCALE_EN);
  6411. if (watcher) {
  6412. this.watchLocale(watcher);
  6413. }
  6414. }_createClass(I18n, [{ key: "setLocale", value: function setLocale(
  6415. locale) {var _this = this;
  6416. var oldLocale = this.locale;
  6417. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  6418. if (!this.messages[this.locale]) {
  6419. // 可能初始化时不存在
  6420. this.messages[this.locale] = {};
  6421. }
  6422. this.message = this.messages[this.locale];
  6423. // 仅发生变化时,通知
  6424. if (oldLocale !== this.locale) {
  6425. this.watchers.forEach(function (watcher) {
  6426. watcher(_this.locale, oldLocale);
  6427. });
  6428. }
  6429. } }, { key: "getLocale", value: function getLocale()
  6430. {
  6431. return this.locale;
  6432. } }, { key: "watchLocale", value: function watchLocale(
  6433. fn) {var _this2 = this;
  6434. var index = this.watchers.push(fn) - 1;
  6435. return function () {
  6436. _this2.watchers.splice(index, 1);
  6437. };
  6438. } }, { key: "add", value: function add(
  6439. locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  6440. var curMessages = this.messages[locale];
  6441. if (curMessages) {
  6442. if (override) {
  6443. Object.assign(curMessages, message);
  6444. } else
  6445. {
  6446. Object.keys(message).forEach(function (key) {
  6447. if (!hasOwn(curMessages, key)) {
  6448. curMessages[key] = message[key];
  6449. }
  6450. });
  6451. }
  6452. } else
  6453. {
  6454. this.messages[locale] = message;
  6455. }
  6456. } }, { key: "f", value: function f(
  6457. message, values, delimiters) {
  6458. return this.formater.interpolate(message, values, delimiters).join('');
  6459. } }, { key: "t", value: function t(
  6460. key, locale, values) {
  6461. var message = this.message;
  6462. if (typeof locale === 'string') {
  6463. locale = normalizeLocale(locale, this.messages);
  6464. locale && (message = this.messages[locale]);
  6465. } else
  6466. {
  6467. values = locale;
  6468. }
  6469. if (!hasOwn(message, key)) {
  6470. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  6471. return key;
  6472. }
  6473. return this.formater.interpolate(message[key], values).join('');
  6474. } }]);return I18n;}();exports.I18n = I18n;
  6475. function watchAppLocale(appVm, i18n) {
  6476. // 需要保证 watch 的触发在组件渲染之前
  6477. if (appVm.$watchLocale) {
  6478. // vue2
  6479. appVm.$watchLocale(function (newLocale) {
  6480. i18n.setLocale(newLocale);
  6481. });
  6482. } else
  6483. {
  6484. appVm.$watch(function () {return appVm.$locale;}, function (newLocale) {
  6485. i18n.setLocale(newLocale);
  6486. });
  6487. }
  6488. }
  6489. function getDefaultLocale() {
  6490. if (typeof uni !== 'undefined' && uni.getLocale) {
  6491. return uni.getLocale();
  6492. }
  6493. // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
  6494. if (typeof global !== 'undefined' && global.getLocale) {
  6495. return global.getLocale();
  6496. }
  6497. return LOCALE_EN;
  6498. }
  6499. function initVueI18n(locale) {var messages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var fallbackLocale = arguments.length > 2 ? arguments[2] : undefined;var watcher = arguments.length > 3 ? arguments[3] : undefined;
  6500. // 兼容旧版本入参
  6501. if (typeof locale !== 'string') {var _ref4 =
  6502. [
  6503. messages,
  6504. locale];locale = _ref4[0];messages = _ref4[1];
  6505. }
  6506. if (typeof locale !== 'string') {
  6507. // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
  6508. locale = getDefaultLocale();
  6509. }
  6510. if (typeof fallbackLocale !== 'string') {
  6511. fallbackLocale =
  6512. typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale ||
  6513. LOCALE_EN;
  6514. }
  6515. var i18n = new I18n({
  6516. locale: locale,
  6517. fallbackLocale: fallbackLocale,
  6518. messages: messages,
  6519. watcher: watcher });
  6520. var _t = function t(key, values) {
  6521. if (typeof getApp !== 'function') {
  6522. // app view
  6523. /* eslint-disable no-func-assign */
  6524. _t = function t(key, values) {
  6525. return i18n.t(key, values);
  6526. };
  6527. } else
  6528. {
  6529. var isWatchedAppLocale = false;
  6530. _t = function t(key, values) {
  6531. var appVm = getApp().$vm;
  6532. // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
  6533. // options: {
  6534. // type: Array,
  6535. // default () {
  6536. // return [{
  6537. // icon: 'shop',
  6538. // text: t("uni-goods-nav.options.shop"),
  6539. // }, {
  6540. // icon: 'cart',
  6541. // text: t("uni-goods-nav.options.cart")
  6542. // }]
  6543. // }
  6544. // },
  6545. if (appVm) {
  6546. // 触发响应式
  6547. appVm.$locale;
  6548. if (!isWatchedAppLocale) {
  6549. isWatchedAppLocale = true;
  6550. watchAppLocale(appVm, i18n);
  6551. }
  6552. }
  6553. return i18n.t(key, values);
  6554. };
  6555. }
  6556. return _t(key, values);
  6557. };
  6558. return {
  6559. i18n: i18n,
  6560. f: function f(message, values, delimiters) {
  6561. return i18n.f(message, values, delimiters);
  6562. },
  6563. t: function t(key, values) {
  6564. return _t(key, values);
  6565. },
  6566. add: function add(locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  6567. return i18n.add(locale, message, override);
  6568. },
  6569. watch: function watch(fn) {
  6570. return i18n.watchLocale(fn);
  6571. },
  6572. getLocale: function getLocale() {
  6573. return i18n.getLocale();
  6574. },
  6575. setLocale: function setLocale(newLocale) {
  6576. return i18n.setLocale(newLocale);
  6577. } };
  6578. }
  6579. var isString = function isString(val) {return typeof val === 'string';};exports.isString = isString;
  6580. var formater;
  6581. function hasI18nJson(jsonObj, delimiters) {
  6582. if (!formater) {
  6583. formater = new BaseFormatter();
  6584. }
  6585. return walkJsonObj(jsonObj, function (jsonObj, key) {
  6586. var value = jsonObj[key];
  6587. if (isString(value)) {
  6588. if (isI18nStr(value, delimiters)) {
  6589. return true;
  6590. }
  6591. } else
  6592. {
  6593. return hasI18nJson(value, delimiters);
  6594. }
  6595. });
  6596. }
  6597. function parseI18nJson(jsonObj, values, delimiters) {
  6598. if (!formater) {
  6599. formater = new BaseFormatter();
  6600. }
  6601. walkJsonObj(jsonObj, function (jsonObj, key) {
  6602. var value = jsonObj[key];
  6603. if (isString(value)) {
  6604. if (isI18nStr(value, delimiters)) {
  6605. jsonObj[key] = compileStr(value, values, delimiters);
  6606. }
  6607. } else
  6608. {
  6609. parseI18nJson(value, values, delimiters);
  6610. }
  6611. });
  6612. return jsonObj;
  6613. }
  6614. function compileI18nJsonStr(jsonStr, _ref5) {var locale = _ref5.locale,locales = _ref5.locales,delimiters = _ref5.delimiters;
  6615. if (!isI18nStr(jsonStr, delimiters)) {
  6616. return jsonStr;
  6617. }
  6618. if (!formater) {
  6619. formater = new BaseFormatter();
  6620. }
  6621. var localeValues = [];
  6622. Object.keys(locales).forEach(function (name) {
  6623. if (name !== locale) {
  6624. localeValues.push({
  6625. locale: name,
  6626. values: locales[name] });
  6627. }
  6628. });
  6629. localeValues.unshift({ locale: locale, values: locales[locale] });
  6630. try {
  6631. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  6632. }
  6633. catch (e) {}
  6634. return jsonStr;
  6635. }
  6636. function isI18nStr(value, delimiters) {
  6637. return value.indexOf(delimiters[0]) > -1;
  6638. }
  6639. function compileStr(value, values, delimiters) {
  6640. return formater.interpolate(value, values, delimiters).join('');
  6641. }
  6642. function compileValue(jsonObj, key, localeValues, delimiters) {
  6643. var value = jsonObj[key];
  6644. if (isString(value)) {
  6645. // 存在国际化
  6646. if (isI18nStr(value, delimiters)) {
  6647. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  6648. if (localeValues.length > 1) {
  6649. // 格式化国际化语言
  6650. var valueLocales = jsonObj[key + 'Locales'] = {};
  6651. localeValues.forEach(function (localValue) {
  6652. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  6653. });
  6654. }
  6655. }
  6656. } else
  6657. {
  6658. compileJsonObj(value, localeValues, delimiters);
  6659. }
  6660. }
  6661. function compileJsonObj(jsonObj, localeValues, delimiters) {
  6662. walkJsonObj(jsonObj, function (jsonObj, key) {
  6663. compileValue(jsonObj, key, localeValues, delimiters);
  6664. });
  6665. return jsonObj;
  6666. }
  6667. function walkJsonObj(jsonObj, walk) {
  6668. if (isArray(jsonObj)) {
  6669. for (var i = 0; i < jsonObj.length; i++) {
  6670. if (walk(jsonObj, i)) {
  6671. return true;
  6672. }
  6673. }
  6674. } else
  6675. if (isObject(jsonObj)) {
  6676. for (var key in jsonObj) {
  6677. if (walk(jsonObj, key)) {
  6678. return true;
  6679. }
  6680. }
  6681. }
  6682. return false;
  6683. }
  6684. function resolveLocale(locales) {
  6685. return function (locale) {
  6686. if (!locale) {
  6687. return locale;
  6688. }
  6689. locale = normalizeLocale(locale) || locale;
  6690. return resolveLocaleChain(locale).find(function (locale) {return locales.indexOf(locale) > -1;});
  6691. };
  6692. }
  6693. function resolveLocaleChain(locale) {
  6694. var chain = [];
  6695. var tokens = locale.split('-');
  6696. while (tokens.length) {
  6697. chain.push(tokens.join('-'));
  6698. tokens.pop();
  6699. }
  6700. return chain;
  6701. }
  6702. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"], __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 2)))
  6703. /***/ }),
  6704. /***/ 30:
  6705. /*!***********************************************************************!*\
  6706. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/addUnit.js ***!
  6707. \***********************************************************************/
  6708. /*! no static exports found */
  6709. /***/ (function(module, exports, __webpack_require__) {
  6710. "use strict";
  6711. Object.defineProperty(exports, "__esModule", { value: true });exports.default = addUnit;var _test = _interopRequireDefault(__webpack_require__(/*! ./test.js */ 17));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  6712. // 添加单位,如果有rpx,%,px等单位结尾或者值为auto,直接返回,否则加上rpx单位结尾
  6713. function addUnit() {var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'auto';var unit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'rpx';
  6714. value = String(value);
  6715. // 用uView内置验证规则中的number判断是否为数值
  6716. return _test.default.number(value) ? "".concat(value).concat(unit) : value;
  6717. }
  6718. /***/ }),
  6719. /***/ 31:
  6720. /*!**********************************************************************!*\
  6721. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/random.js ***!
  6722. \**********************************************************************/
  6723. /*! no static exports found */
  6724. /***/ (function(module, exports, __webpack_require__) {
  6725. "use strict";
  6726. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function random(min, max) {
  6727. if (min >= 0 && max > 0 && max >= min) {
  6728. var gab = max - min + 1;
  6729. return Math.floor(Math.random() * gab + min);
  6730. } else {
  6731. return 0;
  6732. }
  6733. }var _default =
  6734. random;exports.default = _default;
  6735. /***/ }),
  6736. /***/ 32:
  6737. /*!********************************************************************!*\
  6738. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/trim.js ***!
  6739. \********************************************************************/
  6740. /*! no static exports found */
  6741. /***/ (function(module, exports, __webpack_require__) {
  6742. "use strict";
  6743. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function trim(str) {var pos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'both';
  6744. if (pos == 'both') {
  6745. return str.replace(/^\s+|\s+$/g, "");
  6746. } else if (pos == "left") {
  6747. return str.replace(/^\s*/, '');
  6748. } else if (pos == 'right') {
  6749. return str.replace(/(\s*$)/g, "");
  6750. } else if (pos == 'all') {
  6751. return str.replace(/\s+/g, "");
  6752. } else {
  6753. return str;
  6754. }
  6755. }var _default =
  6756. trim;exports.default = _default;
  6757. /***/ }),
  6758. /***/ 33:
  6759. /*!*********************************************************************!*\
  6760. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/toast.js ***!
  6761. \*********************************************************************/
  6762. /*! no static exports found */
  6763. /***/ (function(module, exports, __webpack_require__) {
  6764. "use strict";
  6765. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function toast(title) {var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1500;
  6766. uni.showToast({
  6767. title: title,
  6768. icon: 'none',
  6769. duration: duration });
  6770. }var _default =
  6771. toast;exports.default = _default;
  6772. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  6773. /***/ }),
  6774. /***/ 34:
  6775. /*!*************************************************************************!*\
  6776. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/getParent.js ***!
  6777. \*************************************************************************/
  6778. /*! no static exports found */
  6779. /***/ (function(module, exports, __webpack_require__) {
  6780. "use strict";
  6781. Object.defineProperty(exports, "__esModule", { value: true });exports.default = getParent; // 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
  6782. // this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
  6783. function getParent(name, keys) {
  6784. var parent = this.$parent;
  6785. // 通过while历遍,这里主要是为了H5需要多层解析的问题
  6786. while (parent) {
  6787. // 父组件
  6788. if (parent.$options.name !== name) {
  6789. // 如果组件的name不相等,继续上一级寻找
  6790. parent = parent.$parent;
  6791. } else {var _ret = function () {
  6792. var data = {};
  6793. // 判断keys是否数组,如果传过来的是一个数组,那么直接使用数组元素值当做键值去父组件寻找
  6794. if (Array.isArray(keys)) {
  6795. keys.map(function (val) {
  6796. data[val] = parent[val] ? parent[val] : '';
  6797. });
  6798. } else {
  6799. // 历遍传过来的对象参数
  6800. for (var i in keys) {
  6801. // 如果子组件有此值则用,无此值则用父组件的值
  6802. // 判断是否空数组,如果是,则用父组件的值,否则用子组件的值
  6803. if (Array.isArray(keys[i])) {
  6804. if (keys[i].length) {
  6805. data[i] = keys[i];
  6806. } else {
  6807. data[i] = parent[i];
  6808. }
  6809. } else if (keys[i].constructor === Object) {
  6810. // 判断是否对象,如果是对象,且有属性,那么使用子组件的值,否则使用父组件的值
  6811. if (Object.keys(keys[i]).length) {
  6812. data[i] = keys[i];
  6813. } else {
  6814. data[i] = parent[i];
  6815. }
  6816. } else {
  6817. // 只要子组件有传值,即使是false值,也是“传值”了,也需要覆盖父组件的同名参数
  6818. data[i] = keys[i] || keys[i] === false ? keys[i] : parent[i];
  6819. }
  6820. }
  6821. }
  6822. return { v: data };}();if (typeof _ret === "object") return _ret.v;
  6823. }
  6824. }
  6825. return {};
  6826. }
  6827. /***/ }),
  6828. /***/ 35:
  6829. /*!***********************************************************************!*\
  6830. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/$parent.js ***!
  6831. \***********************************************************************/
  6832. /*! no static exports found */
  6833. /***/ (function(module, exports, __webpack_require__) {
  6834. "use strict";
  6835. Object.defineProperty(exports, "__esModule", { value: true });exports.default = $parent; // 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
  6836. // this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
  6837. // 这里默认值等于undefined有它的含义,因为最顶层元素(组件)的$parent就是undefined,意味着不传name
  6838. // 值(默认为undefined),就是查找最顶层的$parent
  6839. function $parent() {var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  6840. var parent = this.$parent;
  6841. // 通过while历遍,这里主要是为了H5需要多层解析的问题
  6842. while (parent) {
  6843. // 父组件
  6844. if (parent.$options && parent.$options.name !== name) {
  6845. // 如果组件的name不相等,继续上一级寻找
  6846. parent = parent.$parent;
  6847. } else {
  6848. return parent;
  6849. }
  6850. }
  6851. return false;
  6852. }
  6853. /***/ }),
  6854. /***/ 36:
  6855. /*!*******************************************************************!*\
  6856. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/sys.js ***!
  6857. \*******************************************************************/
  6858. /*! no static exports found */
  6859. /***/ (function(module, exports, __webpack_require__) {
  6860. "use strict";
  6861. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.os = os;exports.sys = sys;function os() {
  6862. return uni.getSystemInfoSync().platform;
  6863. };
  6864. function sys() {
  6865. return uni.getSystemInfoSync();
  6866. }
  6867. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  6868. /***/ }),
  6869. /***/ 37:
  6870. /*!************************************************************************!*\
  6871. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/debounce.js ***!
  6872. \************************************************************************/
  6873. /*! no static exports found */
  6874. /***/ (function(module, exports, __webpack_require__) {
  6875. "use strict";
  6876. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var timeout = null;
  6877. /**
  6878. * 防抖原理:一定时间内,只有最后一次操作,再过wait毫秒后才执行函数
  6879. *
  6880. * @param {Function} func 要执行的回调函数
  6881. * @param {Number} wait 延时的时间
  6882. * @param {Boolean} immediate 是否立即执行
  6883. * @return null
  6884. */
  6885. function debounce(func) {var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;var immediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  6886. // 清除定时器
  6887. if (timeout !== null) clearTimeout(timeout);
  6888. // 立即执行,此类情况一般用不到
  6889. if (immediate) {
  6890. var callNow = !timeout;
  6891. timeout = setTimeout(function () {
  6892. timeout = null;
  6893. }, wait);
  6894. if (callNow) typeof func === 'function' && func();
  6895. } else {
  6896. // 设置定时器,当最后一次操作后,timeout不会再被清除,所以在延时wait毫秒后执行func回调方法
  6897. timeout = setTimeout(function () {
  6898. typeof func === 'function' && func();
  6899. }, wait);
  6900. }
  6901. }var _default =
  6902. debounce;exports.default = _default;
  6903. /***/ }),
  6904. /***/ 38:
  6905. /*!************************************************************************!*\
  6906. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/function/throttle.js ***!
  6907. \************************************************************************/
  6908. /*! no static exports found */
  6909. /***/ (function(module, exports, __webpack_require__) {
  6910. "use strict";
  6911. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var timeoutArr = [];
  6912. var flagArr = [];
  6913. /**
  6914. * 节流函数
  6915. * 节流原理:在一定时间内,只能触发一次
  6916. * @param {Function} fn 要执行的回调函数
  6917. * @param {Number} time 延时的时间
  6918. * @param {Boolean} isImmediate 是否立即执行
  6919. * @param {String} timeoutName 定时器ID
  6920. * @return null
  6921. */
  6922. function throttle(fn) {var time = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;var isImmediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;var timeoutName = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "default";
  6923. if (!timeoutArr[timeoutName]) timeoutArr[timeoutName] = null;
  6924. if (isImmediate) {
  6925. if (!flagArr[timeoutName]) {
  6926. flagArr[timeoutName] = true;
  6927. // 如果是立即执行,则在time毫秒内开始时执行
  6928. if (typeof fn === 'function') fn();
  6929. timeoutArr[timeoutName] = setTimeout(function () {
  6930. flagArr[timeoutName] = false;
  6931. }, time);
  6932. }
  6933. } else {
  6934. if (!flagArr[timeoutName]) {
  6935. flagArr[timeoutName] = true;
  6936. // 如果是非立即执行,则在time毫秒内的结束处执行
  6937. timeoutArr[timeoutName] = setTimeout(function () {
  6938. flagArr[timeoutName] = false;
  6939. if (typeof fn === 'function') fn();
  6940. }, time);
  6941. }
  6942. }
  6943. };var _default =
  6944. throttle;exports.default = _default;
  6945. /***/ }),
  6946. /***/ 39:
  6947. /*!********************************************************************!*\
  6948. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/config/config.js ***!
  6949. \********************************************************************/
  6950. /*! no static exports found */
  6951. /***/ (function(module, exports, __webpack_require__) {
  6952. "use strict";
  6953. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 第一版 1.10.1 版本发布于2021-11-18
  6954. var version = '1.10.1';var _default =
  6955. {
  6956. v: version,
  6957. version: version,
  6958. // 主题名称
  6959. type: [
  6960. 'primary',
  6961. 'success',
  6962. 'info',
  6963. 'error',
  6964. 'warning'] };exports.default = _default;
  6965. /***/ }),
  6966. /***/ 4:
  6967. /*!******************************************************************************************!*\
  6968. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  6969. \******************************************************************************************/
  6970. /*! exports provided: default */
  6971. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6972. "use strict";
  6973. __webpack_require__.r(__webpack_exports__);
  6974. /* WEBPACK VAR INJECTION */(function(global) {/*!
  6975. * Vue.js v2.6.11
  6976. * (c) 2014-2022 Evan You
  6977. * Released under the MIT License.
  6978. */
  6979. /* */
  6980. var emptyObject = Object.freeze({});
  6981. // These helpers produce better VM code in JS engines due to their
  6982. // explicitness and function inlining.
  6983. function isUndef (v) {
  6984. return v === undefined || v === null
  6985. }
  6986. function isDef (v) {
  6987. return v !== undefined && v !== null
  6988. }
  6989. function isTrue (v) {
  6990. return v === true
  6991. }
  6992. function isFalse (v) {
  6993. return v === false
  6994. }
  6995. /**
  6996. * Check if value is primitive.
  6997. */
  6998. function isPrimitive (value) {
  6999. return (
  7000. typeof value === 'string' ||
  7001. typeof value === 'number' ||
  7002. // $flow-disable-line
  7003. typeof value === 'symbol' ||
  7004. typeof value === 'boolean'
  7005. )
  7006. }
  7007. /**
  7008. * Quick object check - this is primarily used to tell
  7009. * Objects from primitive values when we know the value
  7010. * is a JSON-compliant type.
  7011. */
  7012. function isObject (obj) {
  7013. return obj !== null && typeof obj === 'object'
  7014. }
  7015. /**
  7016. * Get the raw type string of a value, e.g., [object Object].
  7017. */
  7018. var _toString = Object.prototype.toString;
  7019. function toRawType (value) {
  7020. return _toString.call(value).slice(8, -1)
  7021. }
  7022. /**
  7023. * Strict object type check. Only returns true
  7024. * for plain JavaScript objects.
  7025. */
  7026. function isPlainObject (obj) {
  7027. return _toString.call(obj) === '[object Object]'
  7028. }
  7029. function isRegExp (v) {
  7030. return _toString.call(v) === '[object RegExp]'
  7031. }
  7032. /**
  7033. * Check if val is a valid array index.
  7034. */
  7035. function isValidArrayIndex (val) {
  7036. var n = parseFloat(String(val));
  7037. return n >= 0 && Math.floor(n) === n && isFinite(val)
  7038. }
  7039. function isPromise (val) {
  7040. return (
  7041. isDef(val) &&
  7042. typeof val.then === 'function' &&
  7043. typeof val.catch === 'function'
  7044. )
  7045. }
  7046. /**
  7047. * Convert a value to a string that is actually rendered.
  7048. */
  7049. function toString (val) {
  7050. return val == null
  7051. ? ''
  7052. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  7053. ? JSON.stringify(val, null, 2)
  7054. : String(val)
  7055. }
  7056. /**
  7057. * Convert an input value to a number for persistence.
  7058. * If the conversion fails, return original string.
  7059. */
  7060. function toNumber (val) {
  7061. var n = parseFloat(val);
  7062. return isNaN(n) ? val : n
  7063. }
  7064. /**
  7065. * Make a map and return a function for checking if a key
  7066. * is in that map.
  7067. */
  7068. function makeMap (
  7069. str,
  7070. expectsLowerCase
  7071. ) {
  7072. var map = Object.create(null);
  7073. var list = str.split(',');
  7074. for (var i = 0; i < list.length; i++) {
  7075. map[list[i]] = true;
  7076. }
  7077. return expectsLowerCase
  7078. ? function (val) { return map[val.toLowerCase()]; }
  7079. : function (val) { return map[val]; }
  7080. }
  7081. /**
  7082. * Check if a tag is a built-in tag.
  7083. */
  7084. var isBuiltInTag = makeMap('slot,component', true);
  7085. /**
  7086. * Check if an attribute is a reserved attribute.
  7087. */
  7088. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  7089. /**
  7090. * Remove an item from an array.
  7091. */
  7092. function remove (arr, item) {
  7093. if (arr.length) {
  7094. var index = arr.indexOf(item);
  7095. if (index > -1) {
  7096. return arr.splice(index, 1)
  7097. }
  7098. }
  7099. }
  7100. /**
  7101. * Check whether an object has the property.
  7102. */
  7103. var hasOwnProperty = Object.prototype.hasOwnProperty;
  7104. function hasOwn (obj, key) {
  7105. return hasOwnProperty.call(obj, key)
  7106. }
  7107. /**
  7108. * Create a cached version of a pure function.
  7109. */
  7110. function cached (fn) {
  7111. var cache = Object.create(null);
  7112. return (function cachedFn (str) {
  7113. var hit = cache[str];
  7114. return hit || (cache[str] = fn(str))
  7115. })
  7116. }
  7117. /**
  7118. * Camelize a hyphen-delimited string.
  7119. */
  7120. var camelizeRE = /-(\w)/g;
  7121. var camelize = cached(function (str) {
  7122. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  7123. });
  7124. /**
  7125. * Capitalize a string.
  7126. */
  7127. var capitalize = cached(function (str) {
  7128. return str.charAt(0).toUpperCase() + str.slice(1)
  7129. });
  7130. /**
  7131. * Hyphenate a camelCase string.
  7132. */
  7133. var hyphenateRE = /\B([A-Z])/g;
  7134. var hyphenate = cached(function (str) {
  7135. return str.replace(hyphenateRE, '-$1').toLowerCase()
  7136. });
  7137. /**
  7138. * Simple bind polyfill for environments that do not support it,
  7139. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  7140. * since native bind is now performant enough in most browsers.
  7141. * But removing it would mean breaking code that was able to run in
  7142. * PhantomJS 1.x, so this must be kept for backward compatibility.
  7143. */
  7144. /* istanbul ignore next */
  7145. function polyfillBind (fn, ctx) {
  7146. function boundFn (a) {
  7147. var l = arguments.length;
  7148. return l
  7149. ? l > 1
  7150. ? fn.apply(ctx, arguments)
  7151. : fn.call(ctx, a)
  7152. : fn.call(ctx)
  7153. }
  7154. boundFn._length = fn.length;
  7155. return boundFn
  7156. }
  7157. function nativeBind (fn, ctx) {
  7158. return fn.bind(ctx)
  7159. }
  7160. var bind = Function.prototype.bind
  7161. ? nativeBind
  7162. : polyfillBind;
  7163. /**
  7164. * Convert an Array-like object to a real Array.
  7165. */
  7166. function toArray (list, start) {
  7167. start = start || 0;
  7168. var i = list.length - start;
  7169. var ret = new Array(i);
  7170. while (i--) {
  7171. ret[i] = list[i + start];
  7172. }
  7173. return ret
  7174. }
  7175. /**
  7176. * Mix properties into target object.
  7177. */
  7178. function extend (to, _from) {
  7179. for (var key in _from) {
  7180. to[key] = _from[key];
  7181. }
  7182. return to
  7183. }
  7184. /**
  7185. * Merge an Array of Objects into a single Object.
  7186. */
  7187. function toObject (arr) {
  7188. var res = {};
  7189. for (var i = 0; i < arr.length; i++) {
  7190. if (arr[i]) {
  7191. extend(res, arr[i]);
  7192. }
  7193. }
  7194. return res
  7195. }
  7196. /* eslint-disable no-unused-vars */
  7197. /**
  7198. * Perform no operation.
  7199. * Stubbing args to make Flow happy without leaving useless transpiled code
  7200. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  7201. */
  7202. function noop (a, b, c) {}
  7203. /**
  7204. * Always return false.
  7205. */
  7206. var no = function (a, b, c) { return false; };
  7207. /* eslint-enable no-unused-vars */
  7208. /**
  7209. * Return the same value.
  7210. */
  7211. var identity = function (_) { return _; };
  7212. /**
  7213. * Check if two values are loosely equal - that is,
  7214. * if they are plain objects, do they have the same shape?
  7215. */
  7216. function looseEqual (a, b) {
  7217. if (a === b) { return true }
  7218. var isObjectA = isObject(a);
  7219. var isObjectB = isObject(b);
  7220. if (isObjectA && isObjectB) {
  7221. try {
  7222. var isArrayA = Array.isArray(a);
  7223. var isArrayB = Array.isArray(b);
  7224. if (isArrayA && isArrayB) {
  7225. return a.length === b.length && a.every(function (e, i) {
  7226. return looseEqual(e, b[i])
  7227. })
  7228. } else if (a instanceof Date && b instanceof Date) {
  7229. return a.getTime() === b.getTime()
  7230. } else if (!isArrayA && !isArrayB) {
  7231. var keysA = Object.keys(a);
  7232. var keysB = Object.keys(b);
  7233. return keysA.length === keysB.length && keysA.every(function (key) {
  7234. return looseEqual(a[key], b[key])
  7235. })
  7236. } else {
  7237. /* istanbul ignore next */
  7238. return false
  7239. }
  7240. } catch (e) {
  7241. /* istanbul ignore next */
  7242. return false
  7243. }
  7244. } else if (!isObjectA && !isObjectB) {
  7245. return String(a) === String(b)
  7246. } else {
  7247. return false
  7248. }
  7249. }
  7250. /**
  7251. * Return the first index at which a loosely equal value can be
  7252. * found in the array (if value is a plain object, the array must
  7253. * contain an object of the same shape), or -1 if it is not present.
  7254. */
  7255. function looseIndexOf (arr, val) {
  7256. for (var i = 0; i < arr.length; i++) {
  7257. if (looseEqual(arr[i], val)) { return i }
  7258. }
  7259. return -1
  7260. }
  7261. /**
  7262. * Ensure a function is called only once.
  7263. */
  7264. function once (fn) {
  7265. var called = false;
  7266. return function () {
  7267. if (!called) {
  7268. called = true;
  7269. fn.apply(this, arguments);
  7270. }
  7271. }
  7272. }
  7273. var ASSET_TYPES = [
  7274. 'component',
  7275. 'directive',
  7276. 'filter'
  7277. ];
  7278. var LIFECYCLE_HOOKS = [
  7279. 'beforeCreate',
  7280. 'created',
  7281. 'beforeMount',
  7282. 'mounted',
  7283. 'beforeUpdate',
  7284. 'updated',
  7285. 'beforeDestroy',
  7286. 'destroyed',
  7287. 'activated',
  7288. 'deactivated',
  7289. 'errorCaptured',
  7290. 'serverPrefetch'
  7291. ];
  7292. /* */
  7293. var config = ({
  7294. /**
  7295. * Option merge strategies (used in core/util/options)
  7296. */
  7297. // $flow-disable-line
  7298. optionMergeStrategies: Object.create(null),
  7299. /**
  7300. * Whether to suppress warnings.
  7301. */
  7302. silent: false,
  7303. /**
  7304. * Show production mode tip message on boot?
  7305. */
  7306. productionTip: "development" !== 'production',
  7307. /**
  7308. * Whether to enable devtools
  7309. */
  7310. devtools: "development" !== 'production',
  7311. /**
  7312. * Whether to record perf
  7313. */
  7314. performance: false,
  7315. /**
  7316. * Error handler for watcher errors
  7317. */
  7318. errorHandler: null,
  7319. /**
  7320. * Warn handler for watcher warns
  7321. */
  7322. warnHandler: null,
  7323. /**
  7324. * Ignore certain custom elements
  7325. */
  7326. ignoredElements: [],
  7327. /**
  7328. * Custom user key aliases for v-on
  7329. */
  7330. // $flow-disable-line
  7331. keyCodes: Object.create(null),
  7332. /**
  7333. * Check if a tag is reserved so that it cannot be registered as a
  7334. * component. This is platform-dependent and may be overwritten.
  7335. */
  7336. isReservedTag: no,
  7337. /**
  7338. * Check if an attribute is reserved so that it cannot be used as a component
  7339. * prop. This is platform-dependent and may be overwritten.
  7340. */
  7341. isReservedAttr: no,
  7342. /**
  7343. * Check if a tag is an unknown element.
  7344. * Platform-dependent.
  7345. */
  7346. isUnknownElement: no,
  7347. /**
  7348. * Get the namespace of an element
  7349. */
  7350. getTagNamespace: noop,
  7351. /**
  7352. * Parse the real tag name for the specific platform.
  7353. */
  7354. parsePlatformTagName: identity,
  7355. /**
  7356. * Check if an attribute must be bound using property, e.g. value
  7357. * Platform-dependent.
  7358. */
  7359. mustUseProp: no,
  7360. /**
  7361. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  7362. * This will significantly reduce performance if set to false.
  7363. */
  7364. async: true,
  7365. /**
  7366. * Exposed for legacy reasons
  7367. */
  7368. _lifecycleHooks: LIFECYCLE_HOOKS
  7369. });
  7370. /* */
  7371. /**
  7372. * unicode letters used for parsing html tags, component names and property paths.
  7373. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  7374. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  7375. */
  7376. 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/;
  7377. /**
  7378. * Check if a string starts with $ or _
  7379. */
  7380. function isReserved (str) {
  7381. var c = (str + '').charCodeAt(0);
  7382. return c === 0x24 || c === 0x5F
  7383. }
  7384. /**
  7385. * Define a property.
  7386. */
  7387. function def (obj, key, val, enumerable) {
  7388. Object.defineProperty(obj, key, {
  7389. value: val,
  7390. enumerable: !!enumerable,
  7391. writable: true,
  7392. configurable: true
  7393. });
  7394. }
  7395. /**
  7396. * Parse simple path.
  7397. */
  7398. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  7399. function parsePath (path) {
  7400. if (bailRE.test(path)) {
  7401. return
  7402. }
  7403. var segments = path.split('.');
  7404. return function (obj) {
  7405. for (var i = 0; i < segments.length; i++) {
  7406. if (!obj) { return }
  7407. obj = obj[segments[i]];
  7408. }
  7409. return obj
  7410. }
  7411. }
  7412. /* */
  7413. // can we use __proto__?
  7414. var hasProto = '__proto__' in {};
  7415. // Browser environment sniffing
  7416. var inBrowser = typeof window !== 'undefined';
  7417. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  7418. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  7419. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  7420. var isIE = UA && /msie|trident/.test(UA);
  7421. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  7422. var isEdge = UA && UA.indexOf('edge/') > 0;
  7423. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  7424. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  7425. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  7426. var isPhantomJS = UA && /phantomjs/.test(UA);
  7427. var isFF = UA && UA.match(/firefox\/(\d+)/);
  7428. // Firefox has a "watch" function on Object.prototype...
  7429. var nativeWatch = ({}).watch;
  7430. if (inBrowser) {
  7431. try {
  7432. var opts = {};
  7433. Object.defineProperty(opts, 'passive', ({
  7434. get: function get () {
  7435. }
  7436. })); // https://github.com/facebook/flow/issues/285
  7437. window.addEventListener('test-passive', null, opts);
  7438. } catch (e) {}
  7439. }
  7440. // this needs to be lazy-evaled because vue may be required before
  7441. // vue-server-renderer can set VUE_ENV
  7442. var _isServer;
  7443. var isServerRendering = function () {
  7444. if (_isServer === undefined) {
  7445. /* istanbul ignore if */
  7446. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  7447. // detect presence of vue-server-renderer and avoid
  7448. // Webpack shimming the process
  7449. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  7450. } else {
  7451. _isServer = false;
  7452. }
  7453. }
  7454. return _isServer
  7455. };
  7456. // detect devtools
  7457. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  7458. /* istanbul ignore next */
  7459. function isNative (Ctor) {
  7460. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  7461. }
  7462. var hasSymbol =
  7463. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  7464. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  7465. var _Set;
  7466. /* istanbul ignore if */ // $flow-disable-line
  7467. if (typeof Set !== 'undefined' && isNative(Set)) {
  7468. // use native Set when available.
  7469. _Set = Set;
  7470. } else {
  7471. // a non-standard Set polyfill that only works with primitive keys.
  7472. _Set = /*@__PURE__*/(function () {
  7473. function Set () {
  7474. this.set = Object.create(null);
  7475. }
  7476. Set.prototype.has = function has (key) {
  7477. return this.set[key] === true
  7478. };
  7479. Set.prototype.add = function add (key) {
  7480. this.set[key] = true;
  7481. };
  7482. Set.prototype.clear = function clear () {
  7483. this.set = Object.create(null);
  7484. };
  7485. return Set;
  7486. }());
  7487. }
  7488. /* */
  7489. var warn = noop;
  7490. var tip = noop;
  7491. var generateComponentTrace = (noop); // work around flow check
  7492. var formatComponentName = (noop);
  7493. if (true) {
  7494. var hasConsole = typeof console !== 'undefined';
  7495. var classifyRE = /(?:^|[-_])(\w)/g;
  7496. var classify = function (str) { return str
  7497. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  7498. .replace(/[-_]/g, ''); };
  7499. warn = function (msg, vm) {
  7500. var trace = vm ? generateComponentTrace(vm) : '';
  7501. if (config.warnHandler) {
  7502. config.warnHandler.call(null, msg, vm, trace);
  7503. } else if (hasConsole && (!config.silent)) {
  7504. console.error(("[Vue warn]: " + msg + trace));
  7505. }
  7506. };
  7507. tip = function (msg, vm) {
  7508. if (hasConsole && (!config.silent)) {
  7509. console.warn("[Vue tip]: " + msg + (
  7510. vm ? generateComponentTrace(vm) : ''
  7511. ));
  7512. }
  7513. };
  7514. formatComponentName = function (vm, includeFile) {
  7515. if (vm.$root === vm) {
  7516. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  7517. return ('') + vm.$options.__file
  7518. }
  7519. return '<Root>'
  7520. }
  7521. var options = typeof vm === 'function' && vm.cid != null
  7522. ? vm.options
  7523. : vm._isVue
  7524. ? vm.$options || vm.constructor.options
  7525. : vm;
  7526. var name = options.name || options._componentTag;
  7527. var file = options.__file;
  7528. if (!name && file) {
  7529. var match = file.match(/([^/\\]+)\.vue$/);
  7530. name = match && match[1];
  7531. }
  7532. return (
  7533. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  7534. (file && includeFile !== false ? (" at " + file) : '')
  7535. )
  7536. };
  7537. var repeat = function (str, n) {
  7538. var res = '';
  7539. while (n) {
  7540. if (n % 2 === 1) { res += str; }
  7541. if (n > 1) { str += str; }
  7542. n >>= 1;
  7543. }
  7544. return res
  7545. };
  7546. generateComponentTrace = function (vm) {
  7547. if (vm._isVue && vm.$parent) {
  7548. var tree = [];
  7549. var currentRecursiveSequence = 0;
  7550. while (vm && vm.$options.name !== 'PageBody') {
  7551. if (tree.length > 0) {
  7552. var last = tree[tree.length - 1];
  7553. if (last.constructor === vm.constructor) {
  7554. currentRecursiveSequence++;
  7555. vm = vm.$parent;
  7556. continue
  7557. } else if (currentRecursiveSequence > 0) {
  7558. tree[tree.length - 1] = [last, currentRecursiveSequence];
  7559. currentRecursiveSequence = 0;
  7560. }
  7561. }
  7562. !vm.$options.isReserved && tree.push(vm);
  7563. vm = vm.$parent;
  7564. }
  7565. return '\n\nfound in\n\n' + tree
  7566. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  7567. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  7568. : formatComponentName(vm))); })
  7569. .join('\n')
  7570. } else {
  7571. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  7572. }
  7573. };
  7574. }
  7575. /* */
  7576. var uid = 0;
  7577. /**
  7578. * A dep is an observable that can have multiple
  7579. * directives subscribing to it.
  7580. */
  7581. var Dep = function Dep () {
  7582. this.id = uid++;
  7583. this.subs = [];
  7584. };
  7585. Dep.prototype.addSub = function addSub (sub) {
  7586. this.subs.push(sub);
  7587. };
  7588. Dep.prototype.removeSub = function removeSub (sub) {
  7589. remove(this.subs, sub);
  7590. };
  7591. Dep.prototype.depend = function depend () {
  7592. if (Dep.SharedObject.target) {
  7593. Dep.SharedObject.target.addDep(this);
  7594. }
  7595. };
  7596. Dep.prototype.notify = function notify () {
  7597. // stabilize the subscriber list first
  7598. var subs = this.subs.slice();
  7599. if ( true && !config.async) {
  7600. // subs aren't sorted in scheduler if not running async
  7601. // we need to sort them now to make sure they fire in correct
  7602. // order
  7603. subs.sort(function (a, b) { return a.id - b.id; });
  7604. }
  7605. for (var i = 0, l = subs.length; i < l; i++) {
  7606. subs[i].update();
  7607. }
  7608. };
  7609. // The current target watcher being evaluated.
  7610. // This is globally unique because only one watcher
  7611. // can be evaluated at a time.
  7612. // fixed by xxxxxx (nvue shared vuex)
  7613. /* eslint-disable no-undef */
  7614. Dep.SharedObject = {};
  7615. Dep.SharedObject.target = null;
  7616. Dep.SharedObject.targetStack = [];
  7617. function pushTarget (target) {
  7618. Dep.SharedObject.targetStack.push(target);
  7619. Dep.SharedObject.target = target;
  7620. Dep.target = target;
  7621. }
  7622. function popTarget () {
  7623. Dep.SharedObject.targetStack.pop();
  7624. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  7625. Dep.target = Dep.SharedObject.target;
  7626. }
  7627. /* */
  7628. var VNode = function VNode (
  7629. tag,
  7630. data,
  7631. children,
  7632. text,
  7633. elm,
  7634. context,
  7635. componentOptions,
  7636. asyncFactory
  7637. ) {
  7638. this.tag = tag;
  7639. this.data = data;
  7640. this.children = children;
  7641. this.text = text;
  7642. this.elm = elm;
  7643. this.ns = undefined;
  7644. this.context = context;
  7645. this.fnContext = undefined;
  7646. this.fnOptions = undefined;
  7647. this.fnScopeId = undefined;
  7648. this.key = data && data.key;
  7649. this.componentOptions = componentOptions;
  7650. this.componentInstance = undefined;
  7651. this.parent = undefined;
  7652. this.raw = false;
  7653. this.isStatic = false;
  7654. this.isRootInsert = true;
  7655. this.isComment = false;
  7656. this.isCloned = false;
  7657. this.isOnce = false;
  7658. this.asyncFactory = asyncFactory;
  7659. this.asyncMeta = undefined;
  7660. this.isAsyncPlaceholder = false;
  7661. };
  7662. var prototypeAccessors = { child: { configurable: true } };
  7663. // DEPRECATED: alias for componentInstance for backwards compat.
  7664. /* istanbul ignore next */
  7665. prototypeAccessors.child.get = function () {
  7666. return this.componentInstance
  7667. };
  7668. Object.defineProperties( VNode.prototype, prototypeAccessors );
  7669. var createEmptyVNode = function (text) {
  7670. if ( text === void 0 ) text = '';
  7671. var node = new VNode();
  7672. node.text = text;
  7673. node.isComment = true;
  7674. return node
  7675. };
  7676. function createTextVNode (val) {
  7677. return new VNode(undefined, undefined, undefined, String(val))
  7678. }
  7679. // optimized shallow clone
  7680. // used for static nodes and slot nodes because they may be reused across
  7681. // multiple renders, cloning them avoids errors when DOM manipulations rely
  7682. // on their elm reference.
  7683. function cloneVNode (vnode) {
  7684. var cloned = new VNode(
  7685. vnode.tag,
  7686. vnode.data,
  7687. // #7975
  7688. // clone children array to avoid mutating original in case of cloning
  7689. // a child.
  7690. vnode.children && vnode.children.slice(),
  7691. vnode.text,
  7692. vnode.elm,
  7693. vnode.context,
  7694. vnode.componentOptions,
  7695. vnode.asyncFactory
  7696. );
  7697. cloned.ns = vnode.ns;
  7698. cloned.isStatic = vnode.isStatic;
  7699. cloned.key = vnode.key;
  7700. cloned.isComment = vnode.isComment;
  7701. cloned.fnContext = vnode.fnContext;
  7702. cloned.fnOptions = vnode.fnOptions;
  7703. cloned.fnScopeId = vnode.fnScopeId;
  7704. cloned.asyncMeta = vnode.asyncMeta;
  7705. cloned.isCloned = true;
  7706. return cloned
  7707. }
  7708. /*
  7709. * not type checking this file because flow doesn't play well with
  7710. * dynamically accessing methods on Array prototype
  7711. */
  7712. var arrayProto = Array.prototype;
  7713. var arrayMethods = Object.create(arrayProto);
  7714. var methodsToPatch = [
  7715. 'push',
  7716. 'pop',
  7717. 'shift',
  7718. 'unshift',
  7719. 'splice',
  7720. 'sort',
  7721. 'reverse'
  7722. ];
  7723. /**
  7724. * Intercept mutating methods and emit events
  7725. */
  7726. methodsToPatch.forEach(function (method) {
  7727. // cache original method
  7728. var original = arrayProto[method];
  7729. def(arrayMethods, method, function mutator () {
  7730. var args = [], len = arguments.length;
  7731. while ( len-- ) args[ len ] = arguments[ len ];
  7732. var result = original.apply(this, args);
  7733. var ob = this.__ob__;
  7734. var inserted;
  7735. switch (method) {
  7736. case 'push':
  7737. case 'unshift':
  7738. inserted = args;
  7739. break
  7740. case 'splice':
  7741. inserted = args.slice(2);
  7742. break
  7743. }
  7744. if (inserted) { ob.observeArray(inserted); }
  7745. // notify change
  7746. ob.dep.notify();
  7747. return result
  7748. });
  7749. });
  7750. /* */
  7751. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  7752. /**
  7753. * In some cases we may want to disable observation inside a component's
  7754. * update computation.
  7755. */
  7756. var shouldObserve = true;
  7757. function toggleObserving (value) {
  7758. shouldObserve = value;
  7759. }
  7760. /**
  7761. * Observer class that is attached to each observed
  7762. * object. Once attached, the observer converts the target
  7763. * object's property keys into getter/setters that
  7764. * collect dependencies and dispatch updates.
  7765. */
  7766. var Observer = function Observer (value) {
  7767. this.value = value;
  7768. this.dep = new Dep();
  7769. this.vmCount = 0;
  7770. def(value, '__ob__', this);
  7771. if (Array.isArray(value)) {
  7772. if (hasProto) {
  7773. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  7774. if(value.push !== value.__proto__.push){
  7775. copyAugment(value, arrayMethods, arrayKeys);
  7776. } else {
  7777. protoAugment(value, arrayMethods);
  7778. }
  7779. }
  7780. } else {
  7781. copyAugment(value, arrayMethods, arrayKeys);
  7782. }
  7783. this.observeArray(value);
  7784. } else {
  7785. this.walk(value);
  7786. }
  7787. };
  7788. /**
  7789. * Walk through all properties and convert them into
  7790. * getter/setters. This method should only be called when
  7791. * value type is Object.
  7792. */
  7793. Observer.prototype.walk = function walk (obj) {
  7794. var keys = Object.keys(obj);
  7795. for (var i = 0; i < keys.length; i++) {
  7796. defineReactive$$1(obj, keys[i]);
  7797. }
  7798. };
  7799. /**
  7800. * Observe a list of Array items.
  7801. */
  7802. Observer.prototype.observeArray = function observeArray (items) {
  7803. for (var i = 0, l = items.length; i < l; i++) {
  7804. observe(items[i]);
  7805. }
  7806. };
  7807. // helpers
  7808. /**
  7809. * Augment a target Object or Array by intercepting
  7810. * the prototype chain using __proto__
  7811. */
  7812. function protoAugment (target, src) {
  7813. /* eslint-disable no-proto */
  7814. target.__proto__ = src;
  7815. /* eslint-enable no-proto */
  7816. }
  7817. /**
  7818. * Augment a target Object or Array by defining
  7819. * hidden properties.
  7820. */
  7821. /* istanbul ignore next */
  7822. function copyAugment (target, src, keys) {
  7823. for (var i = 0, l = keys.length; i < l; i++) {
  7824. var key = keys[i];
  7825. def(target, key, src[key]);
  7826. }
  7827. }
  7828. /**
  7829. * Attempt to create an observer instance for a value,
  7830. * returns the new observer if successfully observed,
  7831. * or the existing observer if the value already has one.
  7832. */
  7833. function observe (value, asRootData) {
  7834. if (!isObject(value) || value instanceof VNode) {
  7835. return
  7836. }
  7837. var ob;
  7838. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  7839. ob = value.__ob__;
  7840. } else if (
  7841. shouldObserve &&
  7842. !isServerRendering() &&
  7843. (Array.isArray(value) || isPlainObject(value)) &&
  7844. Object.isExtensible(value) &&
  7845. !value._isVue
  7846. ) {
  7847. ob = new Observer(value);
  7848. }
  7849. if (asRootData && ob) {
  7850. ob.vmCount++;
  7851. }
  7852. return ob
  7853. }
  7854. /**
  7855. * Define a reactive property on an Object.
  7856. */
  7857. function defineReactive$$1 (
  7858. obj,
  7859. key,
  7860. val,
  7861. customSetter,
  7862. shallow
  7863. ) {
  7864. var dep = new Dep();
  7865. var property = Object.getOwnPropertyDescriptor(obj, key);
  7866. if (property && property.configurable === false) {
  7867. return
  7868. }
  7869. // cater for pre-defined getter/setters
  7870. var getter = property && property.get;
  7871. var setter = property && property.set;
  7872. if ((!getter || setter) && arguments.length === 2) {
  7873. val = obj[key];
  7874. }
  7875. var childOb = !shallow && observe(val);
  7876. Object.defineProperty(obj, key, {
  7877. enumerable: true,
  7878. configurable: true,
  7879. get: function reactiveGetter () {
  7880. var value = getter ? getter.call(obj) : val;
  7881. if (Dep.SharedObject.target) { // fixed by xxxxxx
  7882. dep.depend();
  7883. if (childOb) {
  7884. childOb.dep.depend();
  7885. if (Array.isArray(value)) {
  7886. dependArray(value);
  7887. }
  7888. }
  7889. }
  7890. return value
  7891. },
  7892. set: function reactiveSetter (newVal) {
  7893. var value = getter ? getter.call(obj) : val;
  7894. /* eslint-disable no-self-compare */
  7895. if (newVal === value || (newVal !== newVal && value !== value)) {
  7896. return
  7897. }
  7898. /* eslint-enable no-self-compare */
  7899. if ( true && customSetter) {
  7900. customSetter();
  7901. }
  7902. // #7981: for accessor properties without setter
  7903. if (getter && !setter) { return }
  7904. if (setter) {
  7905. setter.call(obj, newVal);
  7906. } else {
  7907. val = newVal;
  7908. }
  7909. childOb = !shallow && observe(newVal);
  7910. dep.notify();
  7911. }
  7912. });
  7913. }
  7914. /**
  7915. * Set a property on an object. Adds the new property and
  7916. * triggers change notification if the property doesn't
  7917. * already exist.
  7918. */
  7919. function set (target, key, val) {
  7920. if ( true &&
  7921. (isUndef(target) || isPrimitive(target))
  7922. ) {
  7923. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  7924. }
  7925. if (Array.isArray(target) && isValidArrayIndex(key)) {
  7926. target.length = Math.max(target.length, key);
  7927. target.splice(key, 1, val);
  7928. return val
  7929. }
  7930. if (key in target && !(key in Object.prototype)) {
  7931. target[key] = val;
  7932. return val
  7933. }
  7934. var ob = (target).__ob__;
  7935. if (target._isVue || (ob && ob.vmCount)) {
  7936. true && warn(
  7937. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  7938. 'at runtime - declare it upfront in the data option.'
  7939. );
  7940. return val
  7941. }
  7942. if (!ob) {
  7943. target[key] = val;
  7944. return val
  7945. }
  7946. defineReactive$$1(ob.value, key, val);
  7947. ob.dep.notify();
  7948. return val
  7949. }
  7950. /**
  7951. * Delete a property and trigger change if necessary.
  7952. */
  7953. function del (target, key) {
  7954. if ( true &&
  7955. (isUndef(target) || isPrimitive(target))
  7956. ) {
  7957. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  7958. }
  7959. if (Array.isArray(target) && isValidArrayIndex(key)) {
  7960. target.splice(key, 1);
  7961. return
  7962. }
  7963. var ob = (target).__ob__;
  7964. if (target._isVue || (ob && ob.vmCount)) {
  7965. true && warn(
  7966. 'Avoid deleting properties on a Vue instance or its root $data ' +
  7967. '- just set it to null.'
  7968. );
  7969. return
  7970. }
  7971. if (!hasOwn(target, key)) {
  7972. return
  7973. }
  7974. delete target[key];
  7975. if (!ob) {
  7976. return
  7977. }
  7978. ob.dep.notify();
  7979. }
  7980. /**
  7981. * Collect dependencies on array elements when the array is touched, since
  7982. * we cannot intercept array element access like property getters.
  7983. */
  7984. function dependArray (value) {
  7985. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  7986. e = value[i];
  7987. e && e.__ob__ && e.__ob__.dep.depend();
  7988. if (Array.isArray(e)) {
  7989. dependArray(e);
  7990. }
  7991. }
  7992. }
  7993. /* */
  7994. /**
  7995. * Option overwriting strategies are functions that handle
  7996. * how to merge a parent option value and a child option
  7997. * value into the final value.
  7998. */
  7999. var strats = config.optionMergeStrategies;
  8000. /**
  8001. * Options with restrictions
  8002. */
  8003. if (true) {
  8004. strats.el = strats.propsData = function (parent, child, vm, key) {
  8005. if (!vm) {
  8006. warn(
  8007. "option \"" + key + "\" can only be used during instance " +
  8008. 'creation with the `new` keyword.'
  8009. );
  8010. }
  8011. return defaultStrat(parent, child)
  8012. };
  8013. }
  8014. /**
  8015. * Helper that recursively merges two data objects together.
  8016. */
  8017. function mergeData (to, from) {
  8018. if (!from) { return to }
  8019. var key, toVal, fromVal;
  8020. var keys = hasSymbol
  8021. ? Reflect.ownKeys(from)
  8022. : Object.keys(from);
  8023. for (var i = 0; i < keys.length; i++) {
  8024. key = keys[i];
  8025. // in case the object is already observed...
  8026. if (key === '__ob__') { continue }
  8027. toVal = to[key];
  8028. fromVal = from[key];
  8029. if (!hasOwn(to, key)) {
  8030. set(to, key, fromVal);
  8031. } else if (
  8032. toVal !== fromVal &&
  8033. isPlainObject(toVal) &&
  8034. isPlainObject(fromVal)
  8035. ) {
  8036. mergeData(toVal, fromVal);
  8037. }
  8038. }
  8039. return to
  8040. }
  8041. /**
  8042. * Data
  8043. */
  8044. function mergeDataOrFn (
  8045. parentVal,
  8046. childVal,
  8047. vm
  8048. ) {
  8049. if (!vm) {
  8050. // in a Vue.extend merge, both should be functions
  8051. if (!childVal) {
  8052. return parentVal
  8053. }
  8054. if (!parentVal) {
  8055. return childVal
  8056. }
  8057. // when parentVal & childVal are both present,
  8058. // we need to return a function that returns the
  8059. // merged result of both functions... no need to
  8060. // check if parentVal is a function here because
  8061. // it has to be a function to pass previous merges.
  8062. return function mergedDataFn () {
  8063. return mergeData(
  8064. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  8065. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  8066. )
  8067. }
  8068. } else {
  8069. return function mergedInstanceDataFn () {
  8070. // instance merge
  8071. var instanceData = typeof childVal === 'function'
  8072. ? childVal.call(vm, vm)
  8073. : childVal;
  8074. var defaultData = typeof parentVal === 'function'
  8075. ? parentVal.call(vm, vm)
  8076. : parentVal;
  8077. if (instanceData) {
  8078. return mergeData(instanceData, defaultData)
  8079. } else {
  8080. return defaultData
  8081. }
  8082. }
  8083. }
  8084. }
  8085. strats.data = function (
  8086. parentVal,
  8087. childVal,
  8088. vm
  8089. ) {
  8090. if (!vm) {
  8091. if (childVal && typeof childVal !== 'function') {
  8092. true && warn(
  8093. 'The "data" option should be a function ' +
  8094. 'that returns a per-instance value in component ' +
  8095. 'definitions.',
  8096. vm
  8097. );
  8098. return parentVal
  8099. }
  8100. return mergeDataOrFn(parentVal, childVal)
  8101. }
  8102. return mergeDataOrFn(parentVal, childVal, vm)
  8103. };
  8104. /**
  8105. * Hooks and props are merged as arrays.
  8106. */
  8107. function mergeHook (
  8108. parentVal,
  8109. childVal
  8110. ) {
  8111. var res = childVal
  8112. ? parentVal
  8113. ? parentVal.concat(childVal)
  8114. : Array.isArray(childVal)
  8115. ? childVal
  8116. : [childVal]
  8117. : parentVal;
  8118. return res
  8119. ? dedupeHooks(res)
  8120. : res
  8121. }
  8122. function dedupeHooks (hooks) {
  8123. var res = [];
  8124. for (var i = 0; i < hooks.length; i++) {
  8125. if (res.indexOf(hooks[i]) === -1) {
  8126. res.push(hooks[i]);
  8127. }
  8128. }
  8129. return res
  8130. }
  8131. LIFECYCLE_HOOKS.forEach(function (hook) {
  8132. strats[hook] = mergeHook;
  8133. });
  8134. /**
  8135. * Assets
  8136. *
  8137. * When a vm is present (instance creation), we need to do
  8138. * a three-way merge between constructor options, instance
  8139. * options and parent options.
  8140. */
  8141. function mergeAssets (
  8142. parentVal,
  8143. childVal,
  8144. vm,
  8145. key
  8146. ) {
  8147. var res = Object.create(parentVal || null);
  8148. if (childVal) {
  8149. true && assertObjectType(key, childVal, vm);
  8150. return extend(res, childVal)
  8151. } else {
  8152. return res
  8153. }
  8154. }
  8155. ASSET_TYPES.forEach(function (type) {
  8156. strats[type + 's'] = mergeAssets;
  8157. });
  8158. /**
  8159. * Watchers.
  8160. *
  8161. * Watchers hashes should not overwrite one
  8162. * another, so we merge them as arrays.
  8163. */
  8164. strats.watch = function (
  8165. parentVal,
  8166. childVal,
  8167. vm,
  8168. key
  8169. ) {
  8170. // work around Firefox's Object.prototype.watch...
  8171. if (parentVal === nativeWatch) { parentVal = undefined; }
  8172. if (childVal === nativeWatch) { childVal = undefined; }
  8173. /* istanbul ignore if */
  8174. if (!childVal) { return Object.create(parentVal || null) }
  8175. if (true) {
  8176. assertObjectType(key, childVal, vm);
  8177. }
  8178. if (!parentVal) { return childVal }
  8179. var ret = {};
  8180. extend(ret, parentVal);
  8181. for (var key$1 in childVal) {
  8182. var parent = ret[key$1];
  8183. var child = childVal[key$1];
  8184. if (parent && !Array.isArray(parent)) {
  8185. parent = [parent];
  8186. }
  8187. ret[key$1] = parent
  8188. ? parent.concat(child)
  8189. : Array.isArray(child) ? child : [child];
  8190. }
  8191. return ret
  8192. };
  8193. /**
  8194. * Other object hashes.
  8195. */
  8196. strats.props =
  8197. strats.methods =
  8198. strats.inject =
  8199. strats.computed = function (
  8200. parentVal,
  8201. childVal,
  8202. vm,
  8203. key
  8204. ) {
  8205. if (childVal && "development" !== 'production') {
  8206. assertObjectType(key, childVal, vm);
  8207. }
  8208. if (!parentVal) { return childVal }
  8209. var ret = Object.create(null);
  8210. extend(ret, parentVal);
  8211. if (childVal) { extend(ret, childVal); }
  8212. return ret
  8213. };
  8214. strats.provide = mergeDataOrFn;
  8215. /**
  8216. * Default strategy.
  8217. */
  8218. var defaultStrat = function (parentVal, childVal) {
  8219. return childVal === undefined
  8220. ? parentVal
  8221. : childVal
  8222. };
  8223. /**
  8224. * Validate component names
  8225. */
  8226. function checkComponents (options) {
  8227. for (var key in options.components) {
  8228. validateComponentName(key);
  8229. }
  8230. }
  8231. function validateComponentName (name) {
  8232. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  8233. warn(
  8234. 'Invalid component name: "' + name + '". Component names ' +
  8235. 'should conform to valid custom element name in html5 specification.'
  8236. );
  8237. }
  8238. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  8239. warn(
  8240. 'Do not use built-in or reserved HTML elements as component ' +
  8241. 'id: ' + name
  8242. );
  8243. }
  8244. }
  8245. /**
  8246. * Ensure all props option syntax are normalized into the
  8247. * Object-based format.
  8248. */
  8249. function normalizeProps (options, vm) {
  8250. var props = options.props;
  8251. if (!props) { return }
  8252. var res = {};
  8253. var i, val, name;
  8254. if (Array.isArray(props)) {
  8255. i = props.length;
  8256. while (i--) {
  8257. val = props[i];
  8258. if (typeof val === 'string') {
  8259. name = camelize(val);
  8260. res[name] = { type: null };
  8261. } else if (true) {
  8262. warn('props must be strings when using array syntax.');
  8263. }
  8264. }
  8265. } else if (isPlainObject(props)) {
  8266. for (var key in props) {
  8267. val = props[key];
  8268. name = camelize(key);
  8269. res[name] = isPlainObject(val)
  8270. ? val
  8271. : { type: val };
  8272. }
  8273. } else if (true) {
  8274. warn(
  8275. "Invalid value for option \"props\": expected an Array or an Object, " +
  8276. "but got " + (toRawType(props)) + ".",
  8277. vm
  8278. );
  8279. }
  8280. options.props = res;
  8281. }
  8282. /**
  8283. * Normalize all injections into Object-based format
  8284. */
  8285. function normalizeInject (options, vm) {
  8286. var inject = options.inject;
  8287. if (!inject) { return }
  8288. var normalized = options.inject = {};
  8289. if (Array.isArray(inject)) {
  8290. for (var i = 0; i < inject.length; i++) {
  8291. normalized[inject[i]] = { from: inject[i] };
  8292. }
  8293. } else if (isPlainObject(inject)) {
  8294. for (var key in inject) {
  8295. var val = inject[key];
  8296. normalized[key] = isPlainObject(val)
  8297. ? extend({ from: key }, val)
  8298. : { from: val };
  8299. }
  8300. } else if (true) {
  8301. warn(
  8302. "Invalid value for option \"inject\": expected an Array or an Object, " +
  8303. "but got " + (toRawType(inject)) + ".",
  8304. vm
  8305. );
  8306. }
  8307. }
  8308. /**
  8309. * Normalize raw function directives into object format.
  8310. */
  8311. function normalizeDirectives (options) {
  8312. var dirs = options.directives;
  8313. if (dirs) {
  8314. for (var key in dirs) {
  8315. var def$$1 = dirs[key];
  8316. if (typeof def$$1 === 'function') {
  8317. dirs[key] = { bind: def$$1, update: def$$1 };
  8318. }
  8319. }
  8320. }
  8321. }
  8322. function assertObjectType (name, value, vm) {
  8323. if (!isPlainObject(value)) {
  8324. warn(
  8325. "Invalid value for option \"" + name + "\": expected an Object, " +
  8326. "but got " + (toRawType(value)) + ".",
  8327. vm
  8328. );
  8329. }
  8330. }
  8331. /**
  8332. * Merge two option objects into a new one.
  8333. * Core utility used in both instantiation and inheritance.
  8334. */
  8335. function mergeOptions (
  8336. parent,
  8337. child,
  8338. vm
  8339. ) {
  8340. if (true) {
  8341. checkComponents(child);
  8342. }
  8343. if (typeof child === 'function') {
  8344. child = child.options;
  8345. }
  8346. normalizeProps(child, vm);
  8347. normalizeInject(child, vm);
  8348. normalizeDirectives(child);
  8349. // Apply extends and mixins on the child options,
  8350. // but only if it is a raw options object that isn't
  8351. // the result of another mergeOptions call.
  8352. // Only merged options has the _base property.
  8353. if (!child._base) {
  8354. if (child.extends) {
  8355. parent = mergeOptions(parent, child.extends, vm);
  8356. }
  8357. if (child.mixins) {
  8358. for (var i = 0, l = child.mixins.length; i < l; i++) {
  8359. parent = mergeOptions(parent, child.mixins[i], vm);
  8360. }
  8361. }
  8362. }
  8363. var options = {};
  8364. var key;
  8365. for (key in parent) {
  8366. mergeField(key);
  8367. }
  8368. for (key in child) {
  8369. if (!hasOwn(parent, key)) {
  8370. mergeField(key);
  8371. }
  8372. }
  8373. function mergeField (key) {
  8374. var strat = strats[key] || defaultStrat;
  8375. options[key] = strat(parent[key], child[key], vm, key);
  8376. }
  8377. return options
  8378. }
  8379. /**
  8380. * Resolve an asset.
  8381. * This function is used because child instances need access
  8382. * to assets defined in its ancestor chain.
  8383. */
  8384. function resolveAsset (
  8385. options,
  8386. type,
  8387. id,
  8388. warnMissing
  8389. ) {
  8390. /* istanbul ignore if */
  8391. if (typeof id !== 'string') {
  8392. return
  8393. }
  8394. var assets = options[type];
  8395. // check local registration variations first
  8396. if (hasOwn(assets, id)) { return assets[id] }
  8397. var camelizedId = camelize(id);
  8398. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  8399. var PascalCaseId = capitalize(camelizedId);
  8400. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  8401. // fallback to prototype chain
  8402. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  8403. if ( true && warnMissing && !res) {
  8404. warn(
  8405. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  8406. options
  8407. );
  8408. }
  8409. return res
  8410. }
  8411. /* */
  8412. function validateProp (
  8413. key,
  8414. propOptions,
  8415. propsData,
  8416. vm
  8417. ) {
  8418. var prop = propOptions[key];
  8419. var absent = !hasOwn(propsData, key);
  8420. var value = propsData[key];
  8421. // boolean casting
  8422. var booleanIndex = getTypeIndex(Boolean, prop.type);
  8423. if (booleanIndex > -1) {
  8424. if (absent && !hasOwn(prop, 'default')) {
  8425. value = false;
  8426. } else if (value === '' || value === hyphenate(key)) {
  8427. // only cast empty string / same name to boolean if
  8428. // boolean has higher priority
  8429. var stringIndex = getTypeIndex(String, prop.type);
  8430. if (stringIndex < 0 || booleanIndex < stringIndex) {
  8431. value = true;
  8432. }
  8433. }
  8434. }
  8435. // check default value
  8436. if (value === undefined) {
  8437. value = getPropDefaultValue(vm, prop, key);
  8438. // since the default value is a fresh copy,
  8439. // make sure to observe it.
  8440. var prevShouldObserve = shouldObserve;
  8441. toggleObserving(true);
  8442. observe(value);
  8443. toggleObserving(prevShouldObserve);
  8444. }
  8445. if (
  8446. true
  8447. ) {
  8448. assertProp(prop, key, value, vm, absent);
  8449. }
  8450. return value
  8451. }
  8452. /**
  8453. * Get the default value of a prop.
  8454. */
  8455. function getPropDefaultValue (vm, prop, key) {
  8456. // no default, return undefined
  8457. if (!hasOwn(prop, 'default')) {
  8458. return undefined
  8459. }
  8460. var def = prop.default;
  8461. // warn against non-factory defaults for Object & Array
  8462. if ( true && isObject(def)) {
  8463. warn(
  8464. 'Invalid default value for prop "' + key + '": ' +
  8465. 'Props with type Object/Array must use a factory function ' +
  8466. 'to return the default value.',
  8467. vm
  8468. );
  8469. }
  8470. // the raw prop value was also undefined from previous render,
  8471. // return previous default value to avoid unnecessary watcher trigger
  8472. if (vm && vm.$options.propsData &&
  8473. vm.$options.propsData[key] === undefined &&
  8474. vm._props[key] !== undefined
  8475. ) {
  8476. return vm._props[key]
  8477. }
  8478. // call factory function for non-Function types
  8479. // a value is Function if its prototype is function even across different execution context
  8480. return typeof def === 'function' && getType(prop.type) !== 'Function'
  8481. ? def.call(vm)
  8482. : def
  8483. }
  8484. /**
  8485. * Assert whether a prop is valid.
  8486. */
  8487. function assertProp (
  8488. prop,
  8489. name,
  8490. value,
  8491. vm,
  8492. absent
  8493. ) {
  8494. if (prop.required && absent) {
  8495. warn(
  8496. 'Missing required prop: "' + name + '"',
  8497. vm
  8498. );
  8499. return
  8500. }
  8501. if (value == null && !prop.required) {
  8502. return
  8503. }
  8504. var type = prop.type;
  8505. var valid = !type || type === true;
  8506. var expectedTypes = [];
  8507. if (type) {
  8508. if (!Array.isArray(type)) {
  8509. type = [type];
  8510. }
  8511. for (var i = 0; i < type.length && !valid; i++) {
  8512. var assertedType = assertType(value, type[i]);
  8513. expectedTypes.push(assertedType.expectedType || '');
  8514. valid = assertedType.valid;
  8515. }
  8516. }
  8517. if (!valid) {
  8518. warn(
  8519. getInvalidTypeMessage(name, value, expectedTypes),
  8520. vm
  8521. );
  8522. return
  8523. }
  8524. var validator = prop.validator;
  8525. if (validator) {
  8526. if (!validator(value)) {
  8527. warn(
  8528. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  8529. vm
  8530. );
  8531. }
  8532. }
  8533. }
  8534. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  8535. function assertType (value, type) {
  8536. var valid;
  8537. var expectedType = getType(type);
  8538. if (simpleCheckRE.test(expectedType)) {
  8539. var t = typeof value;
  8540. valid = t === expectedType.toLowerCase();
  8541. // for primitive wrapper objects
  8542. if (!valid && t === 'object') {
  8543. valid = value instanceof type;
  8544. }
  8545. } else if (expectedType === 'Object') {
  8546. valid = isPlainObject(value);
  8547. } else if (expectedType === 'Array') {
  8548. valid = Array.isArray(value);
  8549. } else {
  8550. valid = value instanceof type;
  8551. }
  8552. return {
  8553. valid: valid,
  8554. expectedType: expectedType
  8555. }
  8556. }
  8557. /**
  8558. * Use function string name to check built-in types,
  8559. * because a simple equality check will fail when running
  8560. * across different vms / iframes.
  8561. */
  8562. function getType (fn) {
  8563. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  8564. return match ? match[1] : ''
  8565. }
  8566. function isSameType (a, b) {
  8567. return getType(a) === getType(b)
  8568. }
  8569. function getTypeIndex (type, expectedTypes) {
  8570. if (!Array.isArray(expectedTypes)) {
  8571. return isSameType(expectedTypes, type) ? 0 : -1
  8572. }
  8573. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  8574. if (isSameType(expectedTypes[i], type)) {
  8575. return i
  8576. }
  8577. }
  8578. return -1
  8579. }
  8580. function getInvalidTypeMessage (name, value, expectedTypes) {
  8581. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  8582. " Expected " + (expectedTypes.map(capitalize).join(', '));
  8583. var expectedType = expectedTypes[0];
  8584. var receivedType = toRawType(value);
  8585. var expectedValue = styleValue(value, expectedType);
  8586. var receivedValue = styleValue(value, receivedType);
  8587. // check if we need to specify expected value
  8588. if (expectedTypes.length === 1 &&
  8589. isExplicable(expectedType) &&
  8590. !isBoolean(expectedType, receivedType)) {
  8591. message += " with value " + expectedValue;
  8592. }
  8593. message += ", got " + receivedType + " ";
  8594. // check if we need to specify received value
  8595. if (isExplicable(receivedType)) {
  8596. message += "with value " + receivedValue + ".";
  8597. }
  8598. return message
  8599. }
  8600. function styleValue (value, type) {
  8601. if (type === 'String') {
  8602. return ("\"" + value + "\"")
  8603. } else if (type === 'Number') {
  8604. return ("" + (Number(value)))
  8605. } else {
  8606. return ("" + value)
  8607. }
  8608. }
  8609. function isExplicable (value) {
  8610. var explicitTypes = ['string', 'number', 'boolean'];
  8611. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  8612. }
  8613. function isBoolean () {
  8614. var args = [], len = arguments.length;
  8615. while ( len-- ) args[ len ] = arguments[ len ];
  8616. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  8617. }
  8618. /* */
  8619. function handleError (err, vm, info) {
  8620. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  8621. // See: https://github.com/vuejs/vuex/issues/1505
  8622. pushTarget();
  8623. try {
  8624. if (vm) {
  8625. var cur = vm;
  8626. while ((cur = cur.$parent)) {
  8627. var hooks = cur.$options.errorCaptured;
  8628. if (hooks) {
  8629. for (var i = 0; i < hooks.length; i++) {
  8630. try {
  8631. var capture = hooks[i].call(cur, err, vm, info) === false;
  8632. if (capture) { return }
  8633. } catch (e) {
  8634. globalHandleError(e, cur, 'errorCaptured hook');
  8635. }
  8636. }
  8637. }
  8638. }
  8639. }
  8640. globalHandleError(err, vm, info);
  8641. } finally {
  8642. popTarget();
  8643. }
  8644. }
  8645. function invokeWithErrorHandling (
  8646. handler,
  8647. context,
  8648. args,
  8649. vm,
  8650. info
  8651. ) {
  8652. var res;
  8653. try {
  8654. res = args ? handler.apply(context, args) : handler.call(context);
  8655. if (res && !res._isVue && isPromise(res) && !res._handled) {
  8656. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  8657. // issue #9511
  8658. // avoid catch triggering multiple times when nested calls
  8659. res._handled = true;
  8660. }
  8661. } catch (e) {
  8662. handleError(e, vm, info);
  8663. }
  8664. return res
  8665. }
  8666. function globalHandleError (err, vm, info) {
  8667. if (config.errorHandler) {
  8668. try {
  8669. return config.errorHandler.call(null, err, vm, info)
  8670. } catch (e) {
  8671. // if the user intentionally throws the original error in the handler,
  8672. // do not log it twice
  8673. if (e !== err) {
  8674. logError(e, null, 'config.errorHandler');
  8675. }
  8676. }
  8677. }
  8678. logError(err, vm, info);
  8679. }
  8680. function logError (err, vm, info) {
  8681. if (true) {
  8682. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  8683. }
  8684. /* istanbul ignore else */
  8685. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  8686. console.error(err);
  8687. } else {
  8688. throw err
  8689. }
  8690. }
  8691. /* */
  8692. var callbacks = [];
  8693. var pending = false;
  8694. function flushCallbacks () {
  8695. pending = false;
  8696. var copies = callbacks.slice(0);
  8697. callbacks.length = 0;
  8698. for (var i = 0; i < copies.length; i++) {
  8699. copies[i]();
  8700. }
  8701. }
  8702. // Here we have async deferring wrappers using microtasks.
  8703. // In 2.5 we used (macro) tasks (in combination with microtasks).
  8704. // However, it has subtle problems when state is changed right before repaint
  8705. // (e.g. #6813, out-in transitions).
  8706. // Also, using (macro) tasks in event handler would cause some weird behaviors
  8707. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  8708. // So we now use microtasks everywhere, again.
  8709. // A major drawback of this tradeoff is that there are some scenarios
  8710. // where microtasks have too high a priority and fire in between supposedly
  8711. // sequential events (e.g. #4521, #6690, which have workarounds)
  8712. // or even between bubbling of the same event (#6566).
  8713. var timerFunc;
  8714. // The nextTick behavior leverages the microtask queue, which can be accessed
  8715. // via either native Promise.then or MutationObserver.
  8716. // MutationObserver has wider support, however it is seriously bugged in
  8717. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  8718. // completely stops working after triggering a few times... so, if native
  8719. // Promise is available, we will use it:
  8720. /* istanbul ignore next, $flow-disable-line */
  8721. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  8722. var p = Promise.resolve();
  8723. timerFunc = function () {
  8724. p.then(flushCallbacks);
  8725. // In problematic UIWebViews, Promise.then doesn't completely break, but
  8726. // it can get stuck in a weird state where callbacks are pushed into the
  8727. // microtask queue but the queue isn't being flushed, until the browser
  8728. // needs to do some other work, e.g. handle a timer. Therefore we can
  8729. // "force" the microtask queue to be flushed by adding an empty timer.
  8730. if (isIOS) { setTimeout(noop); }
  8731. };
  8732. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  8733. isNative(MutationObserver) ||
  8734. // PhantomJS and iOS 7.x
  8735. MutationObserver.toString() === '[object MutationObserverConstructor]'
  8736. )) {
  8737. // Use MutationObserver where native Promise is not available,
  8738. // e.g. PhantomJS, iOS7, Android 4.4
  8739. // (#6466 MutationObserver is unreliable in IE11)
  8740. var counter = 1;
  8741. var observer = new MutationObserver(flushCallbacks);
  8742. var textNode = document.createTextNode(String(counter));
  8743. observer.observe(textNode, {
  8744. characterData: true
  8745. });
  8746. timerFunc = function () {
  8747. counter = (counter + 1) % 2;
  8748. textNode.data = String(counter);
  8749. };
  8750. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  8751. // Fallback to setImmediate.
  8752. // Technically it leverages the (macro) task queue,
  8753. // but it is still a better choice than setTimeout.
  8754. timerFunc = function () {
  8755. setImmediate(flushCallbacks);
  8756. };
  8757. } else {
  8758. // Fallback to setTimeout.
  8759. timerFunc = function () {
  8760. setTimeout(flushCallbacks, 0);
  8761. };
  8762. }
  8763. function nextTick (cb, ctx) {
  8764. var _resolve;
  8765. callbacks.push(function () {
  8766. if (cb) {
  8767. try {
  8768. cb.call(ctx);
  8769. } catch (e) {
  8770. handleError(e, ctx, 'nextTick');
  8771. }
  8772. } else if (_resolve) {
  8773. _resolve(ctx);
  8774. }
  8775. });
  8776. if (!pending) {
  8777. pending = true;
  8778. timerFunc();
  8779. }
  8780. // $flow-disable-line
  8781. if (!cb && typeof Promise !== 'undefined') {
  8782. return new Promise(function (resolve) {
  8783. _resolve = resolve;
  8784. })
  8785. }
  8786. }
  8787. /* */
  8788. /* not type checking this file because flow doesn't play well with Proxy */
  8789. var initProxy;
  8790. if (true) {
  8791. var allowedGlobals = makeMap(
  8792. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  8793. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  8794. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  8795. 'require' // for Webpack/Browserify
  8796. );
  8797. var warnNonPresent = function (target, key) {
  8798. warn(
  8799. "Property or method \"" + key + "\" is not defined on the instance but " +
  8800. 'referenced during render. Make sure that this property is reactive, ' +
  8801. 'either in the data option, or for class-based components, by ' +
  8802. 'initializing the property. ' +
  8803. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  8804. target
  8805. );
  8806. };
  8807. var warnReservedPrefix = function (target, key) {
  8808. warn(
  8809. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  8810. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  8811. 'prevent conflicts with Vue internals. ' +
  8812. 'See: https://vuejs.org/v2/api/#data',
  8813. target
  8814. );
  8815. };
  8816. var hasProxy =
  8817. typeof Proxy !== 'undefined' && isNative(Proxy);
  8818. if (hasProxy) {
  8819. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  8820. config.keyCodes = new Proxy(config.keyCodes, {
  8821. set: function set (target, key, value) {
  8822. if (isBuiltInModifier(key)) {
  8823. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  8824. return false
  8825. } else {
  8826. target[key] = value;
  8827. return true
  8828. }
  8829. }
  8830. });
  8831. }
  8832. var hasHandler = {
  8833. has: function has (target, key) {
  8834. var has = key in target;
  8835. var isAllowed = allowedGlobals(key) ||
  8836. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  8837. if (!has && !isAllowed) {
  8838. if (key in target.$data) { warnReservedPrefix(target, key); }
  8839. else { warnNonPresent(target, key); }
  8840. }
  8841. return has || !isAllowed
  8842. }
  8843. };
  8844. var getHandler = {
  8845. get: function get (target, key) {
  8846. if (typeof key === 'string' && !(key in target)) {
  8847. if (key in target.$data) { warnReservedPrefix(target, key); }
  8848. else { warnNonPresent(target, key); }
  8849. }
  8850. return target[key]
  8851. }
  8852. };
  8853. initProxy = function initProxy (vm) {
  8854. if (hasProxy) {
  8855. // determine which proxy handler to use
  8856. var options = vm.$options;
  8857. var handlers = options.render && options.render._withStripped
  8858. ? getHandler
  8859. : hasHandler;
  8860. vm._renderProxy = new Proxy(vm, handlers);
  8861. } else {
  8862. vm._renderProxy = vm;
  8863. }
  8864. };
  8865. }
  8866. /* */
  8867. var seenObjects = new _Set();
  8868. /**
  8869. * Recursively traverse an object to evoke all converted
  8870. * getters, so that every nested property inside the object
  8871. * is collected as a "deep" dependency.
  8872. */
  8873. function traverse (val) {
  8874. _traverse(val, seenObjects);
  8875. seenObjects.clear();
  8876. }
  8877. function _traverse (val, seen) {
  8878. var i, keys;
  8879. var isA = Array.isArray(val);
  8880. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  8881. return
  8882. }
  8883. if (val.__ob__) {
  8884. var depId = val.__ob__.dep.id;
  8885. if (seen.has(depId)) {
  8886. return
  8887. }
  8888. seen.add(depId);
  8889. }
  8890. if (isA) {
  8891. i = val.length;
  8892. while (i--) { _traverse(val[i], seen); }
  8893. } else {
  8894. keys = Object.keys(val);
  8895. i = keys.length;
  8896. while (i--) { _traverse(val[keys[i]], seen); }
  8897. }
  8898. }
  8899. var mark;
  8900. var measure;
  8901. if (true) {
  8902. var perf = inBrowser && window.performance;
  8903. /* istanbul ignore if */
  8904. if (
  8905. perf &&
  8906. perf.mark &&
  8907. perf.measure &&
  8908. perf.clearMarks &&
  8909. perf.clearMeasures
  8910. ) {
  8911. mark = function (tag) { return perf.mark(tag); };
  8912. measure = function (name, startTag, endTag) {
  8913. perf.measure(name, startTag, endTag);
  8914. perf.clearMarks(startTag);
  8915. perf.clearMarks(endTag);
  8916. // perf.clearMeasures(name)
  8917. };
  8918. }
  8919. }
  8920. /* */
  8921. var normalizeEvent = cached(function (name) {
  8922. var passive = name.charAt(0) === '&';
  8923. name = passive ? name.slice(1) : name;
  8924. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  8925. name = once$$1 ? name.slice(1) : name;
  8926. var capture = name.charAt(0) === '!';
  8927. name = capture ? name.slice(1) : name;
  8928. return {
  8929. name: name,
  8930. once: once$$1,
  8931. capture: capture,
  8932. passive: passive
  8933. }
  8934. });
  8935. function createFnInvoker (fns, vm) {
  8936. function invoker () {
  8937. var arguments$1 = arguments;
  8938. var fns = invoker.fns;
  8939. if (Array.isArray(fns)) {
  8940. var cloned = fns.slice();
  8941. for (var i = 0; i < cloned.length; i++) {
  8942. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  8943. }
  8944. } else {
  8945. // return handler return value for single handlers
  8946. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  8947. }
  8948. }
  8949. invoker.fns = fns;
  8950. return invoker
  8951. }
  8952. function updateListeners (
  8953. on,
  8954. oldOn,
  8955. add,
  8956. remove$$1,
  8957. createOnceHandler,
  8958. vm
  8959. ) {
  8960. var name, def$$1, cur, old, event;
  8961. for (name in on) {
  8962. def$$1 = cur = on[name];
  8963. old = oldOn[name];
  8964. event = normalizeEvent(name);
  8965. if (isUndef(cur)) {
  8966. true && warn(
  8967. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  8968. vm
  8969. );
  8970. } else if (isUndef(old)) {
  8971. if (isUndef(cur.fns)) {
  8972. cur = on[name] = createFnInvoker(cur, vm);
  8973. }
  8974. if (isTrue(event.once)) {
  8975. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  8976. }
  8977. add(event.name, cur, event.capture, event.passive, event.params);
  8978. } else if (cur !== old) {
  8979. old.fns = cur;
  8980. on[name] = old;
  8981. }
  8982. }
  8983. for (name in oldOn) {
  8984. if (isUndef(on[name])) {
  8985. event = normalizeEvent(name);
  8986. remove$$1(event.name, oldOn[name], event.capture);
  8987. }
  8988. }
  8989. }
  8990. /* */
  8991. /* */
  8992. // fixed by xxxxxx (mp properties)
  8993. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  8994. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  8995. if (isUndef(propOptions)) {
  8996. return res
  8997. }
  8998. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  8999. var attrs = data.attrs;
  9000. var props = data.props;
  9001. if (isDef(attrs) || isDef(props)) {
  9002. for (var key in propOptions) {
  9003. var altKey = hyphenate(key);
  9004. var result = checkProp(res, props, key, altKey, true) ||
  9005. checkProp(res, attrs, key, altKey, false);
  9006. // externalClass
  9007. if (
  9008. result &&
  9009. res[key] &&
  9010. externalClasses.indexOf(altKey) !== -1 &&
  9011. context[camelize(res[key])]
  9012. ) {
  9013. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  9014. res[key] = context[camelize(res[key])];
  9015. }
  9016. }
  9017. }
  9018. return res
  9019. }
  9020. function extractPropsFromVNodeData (
  9021. data,
  9022. Ctor,
  9023. tag,
  9024. context// fixed by xxxxxx
  9025. ) {
  9026. // we are only extracting raw values here.
  9027. // validation and default values are handled in the child
  9028. // component itself.
  9029. var propOptions = Ctor.options.props;
  9030. if (isUndef(propOptions)) {
  9031. // fixed by xxxxxx
  9032. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  9033. }
  9034. var res = {};
  9035. var attrs = data.attrs;
  9036. var props = data.props;
  9037. if (isDef(attrs) || isDef(props)) {
  9038. for (var key in propOptions) {
  9039. var altKey = hyphenate(key);
  9040. if (true) {
  9041. var keyInLowerCase = key.toLowerCase();
  9042. if (
  9043. key !== keyInLowerCase &&
  9044. attrs && hasOwn(attrs, keyInLowerCase)
  9045. ) {
  9046. tip(
  9047. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  9048. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  9049. " \"" + key + "\". " +
  9050. "Note that HTML attributes are case-insensitive and camelCased " +
  9051. "props need to use their kebab-case equivalents when using in-DOM " +
  9052. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  9053. );
  9054. }
  9055. }
  9056. checkProp(res, props, key, altKey, true) ||
  9057. checkProp(res, attrs, key, altKey, false);
  9058. }
  9059. }
  9060. // fixed by xxxxxx
  9061. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  9062. }
  9063. function checkProp (
  9064. res,
  9065. hash,
  9066. key,
  9067. altKey,
  9068. preserve
  9069. ) {
  9070. if (isDef(hash)) {
  9071. if (hasOwn(hash, key)) {
  9072. res[key] = hash[key];
  9073. if (!preserve) {
  9074. delete hash[key];
  9075. }
  9076. return true
  9077. } else if (hasOwn(hash, altKey)) {
  9078. res[key] = hash[altKey];
  9079. if (!preserve) {
  9080. delete hash[altKey];
  9081. }
  9082. return true
  9083. }
  9084. }
  9085. return false
  9086. }
  9087. /* */
  9088. // The template compiler attempts to minimize the need for normalization by
  9089. // statically analyzing the template at compile time.
  9090. //
  9091. // For plain HTML markup, normalization can be completely skipped because the
  9092. // generated render function is guaranteed to return Array<VNode>. There are
  9093. // two cases where extra normalization is needed:
  9094. // 1. When the children contains components - because a functional component
  9095. // may return an Array instead of a single root. In this case, just a simple
  9096. // normalization is needed - if any child is an Array, we flatten the whole
  9097. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  9098. // because functional components already normalize their own children.
  9099. function simpleNormalizeChildren (children) {
  9100. for (var i = 0; i < children.length; i++) {
  9101. if (Array.isArray(children[i])) {
  9102. return Array.prototype.concat.apply([], children)
  9103. }
  9104. }
  9105. return children
  9106. }
  9107. // 2. When the children contains constructs that always generated nested Arrays,
  9108. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  9109. // with hand-written render functions / JSX. In such cases a full normalization
  9110. // is needed to cater to all possible types of children values.
  9111. function normalizeChildren (children) {
  9112. return isPrimitive(children)
  9113. ? [createTextVNode(children)]
  9114. : Array.isArray(children)
  9115. ? normalizeArrayChildren(children)
  9116. : undefined
  9117. }
  9118. function isTextNode (node) {
  9119. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  9120. }
  9121. function normalizeArrayChildren (children, nestedIndex) {
  9122. var res = [];
  9123. var i, c, lastIndex, last;
  9124. for (i = 0; i < children.length; i++) {
  9125. c = children[i];
  9126. if (isUndef(c) || typeof c === 'boolean') { continue }
  9127. lastIndex = res.length - 1;
  9128. last = res[lastIndex];
  9129. // nested
  9130. if (Array.isArray(c)) {
  9131. if (c.length > 0) {
  9132. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  9133. // merge adjacent text nodes
  9134. if (isTextNode(c[0]) && isTextNode(last)) {
  9135. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  9136. c.shift();
  9137. }
  9138. res.push.apply(res, c);
  9139. }
  9140. } else if (isPrimitive(c)) {
  9141. if (isTextNode(last)) {
  9142. // merge adjacent text nodes
  9143. // this is necessary for SSR hydration because text nodes are
  9144. // essentially merged when rendered to HTML strings
  9145. res[lastIndex] = createTextVNode(last.text + c);
  9146. } else if (c !== '') {
  9147. // convert primitive to vnode
  9148. res.push(createTextVNode(c));
  9149. }
  9150. } else {
  9151. if (isTextNode(c) && isTextNode(last)) {
  9152. // merge adjacent text nodes
  9153. res[lastIndex] = createTextVNode(last.text + c.text);
  9154. } else {
  9155. // default key for nested array children (likely generated by v-for)
  9156. if (isTrue(children._isVList) &&
  9157. isDef(c.tag) &&
  9158. isUndef(c.key) &&
  9159. isDef(nestedIndex)) {
  9160. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  9161. }
  9162. res.push(c);
  9163. }
  9164. }
  9165. }
  9166. return res
  9167. }
  9168. /* */
  9169. function initProvide (vm) {
  9170. var provide = vm.$options.provide;
  9171. if (provide) {
  9172. vm._provided = typeof provide === 'function'
  9173. ? provide.call(vm)
  9174. : provide;
  9175. }
  9176. }
  9177. function initInjections (vm) {
  9178. var result = resolveInject(vm.$options.inject, vm);
  9179. if (result) {
  9180. toggleObserving(false);
  9181. Object.keys(result).forEach(function (key) {
  9182. /* istanbul ignore else */
  9183. if (true) {
  9184. defineReactive$$1(vm, key, result[key], function () {
  9185. warn(
  9186. "Avoid mutating an injected value directly since the changes will be " +
  9187. "overwritten whenever the provided component re-renders. " +
  9188. "injection being mutated: \"" + key + "\"",
  9189. vm
  9190. );
  9191. });
  9192. } else {}
  9193. });
  9194. toggleObserving(true);
  9195. }
  9196. }
  9197. function resolveInject (inject, vm) {
  9198. if (inject) {
  9199. // inject is :any because flow is not smart enough to figure out cached
  9200. var result = Object.create(null);
  9201. var keys = hasSymbol
  9202. ? Reflect.ownKeys(inject)
  9203. : Object.keys(inject);
  9204. for (var i = 0; i < keys.length; i++) {
  9205. var key = keys[i];
  9206. // #6574 in case the inject object is observed...
  9207. if (key === '__ob__') { continue }
  9208. var provideKey = inject[key].from;
  9209. var source = vm;
  9210. while (source) {
  9211. if (source._provided && hasOwn(source._provided, provideKey)) {
  9212. result[key] = source._provided[provideKey];
  9213. break
  9214. }
  9215. source = source.$parent;
  9216. }
  9217. if (!source) {
  9218. if ('default' in inject[key]) {
  9219. var provideDefault = inject[key].default;
  9220. result[key] = typeof provideDefault === 'function'
  9221. ? provideDefault.call(vm)
  9222. : provideDefault;
  9223. } else if (true) {
  9224. warn(("Injection \"" + key + "\" not found"), vm);
  9225. }
  9226. }
  9227. }
  9228. return result
  9229. }
  9230. }
  9231. /* */
  9232. /**
  9233. * Runtime helper for resolving raw children VNodes into a slot object.
  9234. */
  9235. function resolveSlots (
  9236. children,
  9237. context
  9238. ) {
  9239. if (!children || !children.length) {
  9240. return {}
  9241. }
  9242. var slots = {};
  9243. for (var i = 0, l = children.length; i < l; i++) {
  9244. var child = children[i];
  9245. var data = child.data;
  9246. // remove slot attribute if the node is resolved as a Vue slot node
  9247. if (data && data.attrs && data.attrs.slot) {
  9248. delete data.attrs.slot;
  9249. }
  9250. // named slots should only be respected if the vnode was rendered in the
  9251. // same context.
  9252. if ((child.context === context || child.fnContext === context) &&
  9253. data && data.slot != null
  9254. ) {
  9255. var name = data.slot;
  9256. var slot = (slots[name] || (slots[name] = []));
  9257. if (child.tag === 'template') {
  9258. slot.push.apply(slot, child.children || []);
  9259. } else {
  9260. slot.push(child);
  9261. }
  9262. } else {
  9263. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  9264. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  9265. (slots['page'] || (slots['page'] = [])).push(child);
  9266. }else{
  9267. (slots.default || (slots.default = [])).push(child);
  9268. }
  9269. }
  9270. }
  9271. // ignore slots that contains only whitespace
  9272. for (var name$1 in slots) {
  9273. if (slots[name$1].every(isWhitespace)) {
  9274. delete slots[name$1];
  9275. }
  9276. }
  9277. return slots
  9278. }
  9279. function isWhitespace (node) {
  9280. return (node.isComment && !node.asyncFactory) || node.text === ' '
  9281. }
  9282. /* */
  9283. function normalizeScopedSlots (
  9284. slots,
  9285. normalSlots,
  9286. prevSlots
  9287. ) {
  9288. var res;
  9289. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  9290. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  9291. var key = slots && slots.$key;
  9292. if (!slots) {
  9293. res = {};
  9294. } else if (slots._normalized) {
  9295. // fast path 1: child component re-render only, parent did not change
  9296. return slots._normalized
  9297. } else if (
  9298. isStable &&
  9299. prevSlots &&
  9300. prevSlots !== emptyObject &&
  9301. key === prevSlots.$key &&
  9302. !hasNormalSlots &&
  9303. !prevSlots.$hasNormal
  9304. ) {
  9305. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  9306. // only need to normalize once
  9307. return prevSlots
  9308. } else {
  9309. res = {};
  9310. for (var key$1 in slots) {
  9311. if (slots[key$1] && key$1[0] !== '$') {
  9312. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  9313. }
  9314. }
  9315. }
  9316. // expose normal slots on scopedSlots
  9317. for (var key$2 in normalSlots) {
  9318. if (!(key$2 in res)) {
  9319. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  9320. }
  9321. }
  9322. // avoriaz seems to mock a non-extensible $scopedSlots object
  9323. // and when that is passed down this would cause an error
  9324. if (slots && Object.isExtensible(slots)) {
  9325. (slots)._normalized = res;
  9326. }
  9327. def(res, '$stable', isStable);
  9328. def(res, '$key', key);
  9329. def(res, '$hasNormal', hasNormalSlots);
  9330. return res
  9331. }
  9332. function normalizeScopedSlot(normalSlots, key, fn) {
  9333. var normalized = function () {
  9334. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  9335. res = res && typeof res === 'object' && !Array.isArray(res)
  9336. ? [res] // single vnode
  9337. : normalizeChildren(res);
  9338. return res && (
  9339. res.length === 0 ||
  9340. (res.length === 1 && res[0].isComment) // #9658
  9341. ) ? undefined
  9342. : res
  9343. };
  9344. // this is a slot using the new v-slot syntax without scope. although it is
  9345. // compiled as a scoped slot, render fn users would expect it to be present
  9346. // on this.$slots because the usage is semantically a normal slot.
  9347. if (fn.proxy) {
  9348. Object.defineProperty(normalSlots, key, {
  9349. get: normalized,
  9350. enumerable: true,
  9351. configurable: true
  9352. });
  9353. }
  9354. return normalized
  9355. }
  9356. function proxyNormalSlot(slots, key) {
  9357. return function () { return slots[key]; }
  9358. }
  9359. /* */
  9360. /**
  9361. * Runtime helper for rendering v-for lists.
  9362. */
  9363. function renderList (
  9364. val,
  9365. render
  9366. ) {
  9367. var ret, i, l, keys, key;
  9368. if (Array.isArray(val) || typeof val === 'string') {
  9369. ret = new Array(val.length);
  9370. for (i = 0, l = val.length; i < l; i++) {
  9371. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  9372. }
  9373. } else if (typeof val === 'number') {
  9374. ret = new Array(val);
  9375. for (i = 0; i < val; i++) {
  9376. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  9377. }
  9378. } else if (isObject(val)) {
  9379. if (hasSymbol && val[Symbol.iterator]) {
  9380. ret = [];
  9381. var iterator = val[Symbol.iterator]();
  9382. var result = iterator.next();
  9383. while (!result.done) {
  9384. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  9385. result = iterator.next();
  9386. }
  9387. } else {
  9388. keys = Object.keys(val);
  9389. ret = new Array(keys.length);
  9390. for (i = 0, l = keys.length; i < l; i++) {
  9391. key = keys[i];
  9392. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  9393. }
  9394. }
  9395. }
  9396. if (!isDef(ret)) {
  9397. ret = [];
  9398. }
  9399. (ret)._isVList = true;
  9400. return ret
  9401. }
  9402. /* */
  9403. /**
  9404. * Runtime helper for rendering <slot>
  9405. */
  9406. function renderSlot (
  9407. name,
  9408. fallback,
  9409. props,
  9410. bindObject
  9411. ) {
  9412. var scopedSlotFn = this.$scopedSlots[name];
  9413. var nodes;
  9414. if (scopedSlotFn) { // scoped slot
  9415. props = props || {};
  9416. if (bindObject) {
  9417. if ( true && !isObject(bindObject)) {
  9418. warn(
  9419. 'slot v-bind without argument expects an Object',
  9420. this
  9421. );
  9422. }
  9423. props = extend(extend({}, bindObject), props);
  9424. }
  9425. // fixed by xxxxxx app-plus scopedSlot
  9426. nodes = scopedSlotFn(props, this, props._i) || fallback;
  9427. } else {
  9428. nodes = this.$slots[name] || fallback;
  9429. }
  9430. var target = props && props.slot;
  9431. if (target) {
  9432. return this.$createElement('template', { slot: target }, nodes)
  9433. } else {
  9434. return nodes
  9435. }
  9436. }
  9437. /* */
  9438. /**
  9439. * Runtime helper for resolving filters
  9440. */
  9441. function resolveFilter (id) {
  9442. return resolveAsset(this.$options, 'filters', id, true) || identity
  9443. }
  9444. /* */
  9445. function isKeyNotMatch (expect, actual) {
  9446. if (Array.isArray(expect)) {
  9447. return expect.indexOf(actual) === -1
  9448. } else {
  9449. return expect !== actual
  9450. }
  9451. }
  9452. /**
  9453. * Runtime helper for checking keyCodes from config.
  9454. * exposed as Vue.prototype._k
  9455. * passing in eventKeyName as last argument separately for backwards compat
  9456. */
  9457. function checkKeyCodes (
  9458. eventKeyCode,
  9459. key,
  9460. builtInKeyCode,
  9461. eventKeyName,
  9462. builtInKeyName
  9463. ) {
  9464. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  9465. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  9466. return isKeyNotMatch(builtInKeyName, eventKeyName)
  9467. } else if (mappedKeyCode) {
  9468. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  9469. } else if (eventKeyName) {
  9470. return hyphenate(eventKeyName) !== key
  9471. }
  9472. }
  9473. /* */
  9474. /**
  9475. * Runtime helper for merging v-bind="object" into a VNode's data.
  9476. */
  9477. function bindObjectProps (
  9478. data,
  9479. tag,
  9480. value,
  9481. asProp,
  9482. isSync
  9483. ) {
  9484. if (value) {
  9485. if (!isObject(value)) {
  9486. true && warn(
  9487. 'v-bind without argument expects an Object or Array value',
  9488. this
  9489. );
  9490. } else {
  9491. if (Array.isArray(value)) {
  9492. value = toObject(value);
  9493. }
  9494. var hash;
  9495. var loop = function ( key ) {
  9496. if (
  9497. key === 'class' ||
  9498. key === 'style' ||
  9499. isReservedAttribute(key)
  9500. ) {
  9501. hash = data;
  9502. } else {
  9503. var type = data.attrs && data.attrs.type;
  9504. hash = asProp || config.mustUseProp(tag, type, key)
  9505. ? data.domProps || (data.domProps = {})
  9506. : data.attrs || (data.attrs = {});
  9507. }
  9508. var camelizedKey = camelize(key);
  9509. var hyphenatedKey = hyphenate(key);
  9510. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  9511. hash[key] = value[key];
  9512. if (isSync) {
  9513. var on = data.on || (data.on = {});
  9514. on[("update:" + key)] = function ($event) {
  9515. value[key] = $event;
  9516. };
  9517. }
  9518. }
  9519. };
  9520. for (var key in value) loop( key );
  9521. }
  9522. }
  9523. return data
  9524. }
  9525. /* */
  9526. /**
  9527. * Runtime helper for rendering static trees.
  9528. */
  9529. function renderStatic (
  9530. index,
  9531. isInFor
  9532. ) {
  9533. var cached = this._staticTrees || (this._staticTrees = []);
  9534. var tree = cached[index];
  9535. // if has already-rendered static tree and not inside v-for,
  9536. // we can reuse the same tree.
  9537. if (tree && !isInFor) {
  9538. return tree
  9539. }
  9540. // otherwise, render a fresh tree.
  9541. tree = cached[index] = this.$options.staticRenderFns[index].call(
  9542. this._renderProxy,
  9543. null,
  9544. this // for render fns generated for functional component templates
  9545. );
  9546. markStatic(tree, ("__static__" + index), false);
  9547. return tree
  9548. }
  9549. /**
  9550. * Runtime helper for v-once.
  9551. * Effectively it means marking the node as static with a unique key.
  9552. */
  9553. function markOnce (
  9554. tree,
  9555. index,
  9556. key
  9557. ) {
  9558. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  9559. return tree
  9560. }
  9561. function markStatic (
  9562. tree,
  9563. key,
  9564. isOnce
  9565. ) {
  9566. if (Array.isArray(tree)) {
  9567. for (var i = 0; i < tree.length; i++) {
  9568. if (tree[i] && typeof tree[i] !== 'string') {
  9569. markStaticNode(tree[i], (key + "_" + i), isOnce);
  9570. }
  9571. }
  9572. } else {
  9573. markStaticNode(tree, key, isOnce);
  9574. }
  9575. }
  9576. function markStaticNode (node, key, isOnce) {
  9577. node.isStatic = true;
  9578. node.key = key;
  9579. node.isOnce = isOnce;
  9580. }
  9581. /* */
  9582. function bindObjectListeners (data, value) {
  9583. if (value) {
  9584. if (!isPlainObject(value)) {
  9585. true && warn(
  9586. 'v-on without argument expects an Object value',
  9587. this
  9588. );
  9589. } else {
  9590. var on = data.on = data.on ? extend({}, data.on) : {};
  9591. for (var key in value) {
  9592. var existing = on[key];
  9593. var ours = value[key];
  9594. on[key] = existing ? [].concat(existing, ours) : ours;
  9595. }
  9596. }
  9597. }
  9598. return data
  9599. }
  9600. /* */
  9601. function resolveScopedSlots (
  9602. fns, // see flow/vnode
  9603. res,
  9604. // the following are added in 2.6
  9605. hasDynamicKeys,
  9606. contentHashKey
  9607. ) {
  9608. res = res || { $stable: !hasDynamicKeys };
  9609. for (var i = 0; i < fns.length; i++) {
  9610. var slot = fns[i];
  9611. if (Array.isArray(slot)) {
  9612. resolveScopedSlots(slot, res, hasDynamicKeys);
  9613. } else if (slot) {
  9614. // marker for reverse proxying v-slot without scope on this.$slots
  9615. if (slot.proxy) {
  9616. slot.fn.proxy = true;
  9617. }
  9618. res[slot.key] = slot.fn;
  9619. }
  9620. }
  9621. if (contentHashKey) {
  9622. (res).$key = contentHashKey;
  9623. }
  9624. return res
  9625. }
  9626. /* */
  9627. function bindDynamicKeys (baseObj, values) {
  9628. for (var i = 0; i < values.length; i += 2) {
  9629. var key = values[i];
  9630. if (typeof key === 'string' && key) {
  9631. baseObj[values[i]] = values[i + 1];
  9632. } else if ( true && key !== '' && key !== null) {
  9633. // null is a special value for explicitly removing a binding
  9634. warn(
  9635. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  9636. this
  9637. );
  9638. }
  9639. }
  9640. return baseObj
  9641. }
  9642. // helper to dynamically append modifier runtime markers to event names.
  9643. // ensure only append when value is already string, otherwise it will be cast
  9644. // to string and cause the type check to miss.
  9645. function prependModifier (value, symbol) {
  9646. return typeof value === 'string' ? symbol + value : value
  9647. }
  9648. /* */
  9649. function installRenderHelpers (target) {
  9650. target._o = markOnce;
  9651. target._n = toNumber;
  9652. target._s = toString;
  9653. target._l = renderList;
  9654. target._t = renderSlot;
  9655. target._q = looseEqual;
  9656. target._i = looseIndexOf;
  9657. target._m = renderStatic;
  9658. target._f = resolveFilter;
  9659. target._k = checkKeyCodes;
  9660. target._b = bindObjectProps;
  9661. target._v = createTextVNode;
  9662. target._e = createEmptyVNode;
  9663. target._u = resolveScopedSlots;
  9664. target._g = bindObjectListeners;
  9665. target._d = bindDynamicKeys;
  9666. target._p = prependModifier;
  9667. }
  9668. /* */
  9669. function FunctionalRenderContext (
  9670. data,
  9671. props,
  9672. children,
  9673. parent,
  9674. Ctor
  9675. ) {
  9676. var this$1 = this;
  9677. var options = Ctor.options;
  9678. // ensure the createElement function in functional components
  9679. // gets a unique context - this is necessary for correct named slot check
  9680. var contextVm;
  9681. if (hasOwn(parent, '_uid')) {
  9682. contextVm = Object.create(parent);
  9683. // $flow-disable-line
  9684. contextVm._original = parent;
  9685. } else {
  9686. // the context vm passed in is a functional context as well.
  9687. // in this case we want to make sure we are able to get a hold to the
  9688. // real context instance.
  9689. contextVm = parent;
  9690. // $flow-disable-line
  9691. parent = parent._original;
  9692. }
  9693. var isCompiled = isTrue(options._compiled);
  9694. var needNormalization = !isCompiled;
  9695. this.data = data;
  9696. this.props = props;
  9697. this.children = children;
  9698. this.parent = parent;
  9699. this.listeners = data.on || emptyObject;
  9700. this.injections = resolveInject(options.inject, parent);
  9701. this.slots = function () {
  9702. if (!this$1.$slots) {
  9703. normalizeScopedSlots(
  9704. data.scopedSlots,
  9705. this$1.$slots = resolveSlots(children, parent)
  9706. );
  9707. }
  9708. return this$1.$slots
  9709. };
  9710. Object.defineProperty(this, 'scopedSlots', ({
  9711. enumerable: true,
  9712. get: function get () {
  9713. return normalizeScopedSlots(data.scopedSlots, this.slots())
  9714. }
  9715. }));
  9716. // support for compiled functional template
  9717. if (isCompiled) {
  9718. // exposing $options for renderStatic()
  9719. this.$options = options;
  9720. // pre-resolve slots for renderSlot()
  9721. this.$slots = this.slots();
  9722. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  9723. }
  9724. if (options._scopeId) {
  9725. this._c = function (a, b, c, d) {
  9726. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  9727. if (vnode && !Array.isArray(vnode)) {
  9728. vnode.fnScopeId = options._scopeId;
  9729. vnode.fnContext = parent;
  9730. }
  9731. return vnode
  9732. };
  9733. } else {
  9734. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  9735. }
  9736. }
  9737. installRenderHelpers(FunctionalRenderContext.prototype);
  9738. function createFunctionalComponent (
  9739. Ctor,
  9740. propsData,
  9741. data,
  9742. contextVm,
  9743. children
  9744. ) {
  9745. var options = Ctor.options;
  9746. var props = {};
  9747. var propOptions = options.props;
  9748. if (isDef(propOptions)) {
  9749. for (var key in propOptions) {
  9750. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  9751. }
  9752. } else {
  9753. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  9754. if (isDef(data.props)) { mergeProps(props, data.props); }
  9755. }
  9756. var renderContext = new FunctionalRenderContext(
  9757. data,
  9758. props,
  9759. children,
  9760. contextVm,
  9761. Ctor
  9762. );
  9763. var vnode = options.render.call(null, renderContext._c, renderContext);
  9764. if (vnode instanceof VNode) {
  9765. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  9766. } else if (Array.isArray(vnode)) {
  9767. var vnodes = normalizeChildren(vnode) || [];
  9768. var res = new Array(vnodes.length);
  9769. for (var i = 0; i < vnodes.length; i++) {
  9770. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  9771. }
  9772. return res
  9773. }
  9774. }
  9775. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  9776. // #7817 clone node before setting fnContext, otherwise if the node is reused
  9777. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  9778. // that should not be matched to match.
  9779. var clone = cloneVNode(vnode);
  9780. clone.fnContext = contextVm;
  9781. clone.fnOptions = options;
  9782. if (true) {
  9783. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  9784. }
  9785. if (data.slot) {
  9786. (clone.data || (clone.data = {})).slot = data.slot;
  9787. }
  9788. return clone
  9789. }
  9790. function mergeProps (to, from) {
  9791. for (var key in from) {
  9792. to[camelize(key)] = from[key];
  9793. }
  9794. }
  9795. /* */
  9796. /* */
  9797. /* */
  9798. /* */
  9799. // inline hooks to be invoked on component VNodes during patch
  9800. var componentVNodeHooks = {
  9801. init: function init (vnode, hydrating) {
  9802. if (
  9803. vnode.componentInstance &&
  9804. !vnode.componentInstance._isDestroyed &&
  9805. vnode.data.keepAlive
  9806. ) {
  9807. // kept-alive components, treat as a patch
  9808. var mountedNode = vnode; // work around flow
  9809. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  9810. } else {
  9811. var child = vnode.componentInstance = createComponentInstanceForVnode(
  9812. vnode,
  9813. activeInstance
  9814. );
  9815. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  9816. }
  9817. },
  9818. prepatch: function prepatch (oldVnode, vnode) {
  9819. var options = vnode.componentOptions;
  9820. var child = vnode.componentInstance = oldVnode.componentInstance;
  9821. updateChildComponent(
  9822. child,
  9823. options.propsData, // updated props
  9824. options.listeners, // updated listeners
  9825. vnode, // new parent vnode
  9826. options.children // new children
  9827. );
  9828. },
  9829. insert: function insert (vnode) {
  9830. var context = vnode.context;
  9831. var componentInstance = vnode.componentInstance;
  9832. if (!componentInstance._isMounted) {
  9833. callHook(componentInstance, 'onServiceCreated');
  9834. callHook(componentInstance, 'onServiceAttached');
  9835. componentInstance._isMounted = true;
  9836. callHook(componentInstance, 'mounted');
  9837. }
  9838. if (vnode.data.keepAlive) {
  9839. if (context._isMounted) {
  9840. // vue-router#1212
  9841. // During updates, a kept-alive component's child components may
  9842. // change, so directly walking the tree here may call activated hooks
  9843. // on incorrect children. Instead we push them into a queue which will
  9844. // be processed after the whole patch process ended.
  9845. queueActivatedComponent(componentInstance);
  9846. } else {
  9847. activateChildComponent(componentInstance, true /* direct */);
  9848. }
  9849. }
  9850. },
  9851. destroy: function destroy (vnode) {
  9852. var componentInstance = vnode.componentInstance;
  9853. if (!componentInstance._isDestroyed) {
  9854. if (!vnode.data.keepAlive) {
  9855. componentInstance.$destroy();
  9856. } else {
  9857. deactivateChildComponent(componentInstance, true /* direct */);
  9858. }
  9859. }
  9860. }
  9861. };
  9862. var hooksToMerge = Object.keys(componentVNodeHooks);
  9863. function createComponent (
  9864. Ctor,
  9865. data,
  9866. context,
  9867. children,
  9868. tag
  9869. ) {
  9870. if (isUndef(Ctor)) {
  9871. return
  9872. }
  9873. var baseCtor = context.$options._base;
  9874. // plain options object: turn it into a constructor
  9875. if (isObject(Ctor)) {
  9876. Ctor = baseCtor.extend(Ctor);
  9877. }
  9878. // if at this stage it's not a constructor or an async component factory,
  9879. // reject.
  9880. if (typeof Ctor !== 'function') {
  9881. if (true) {
  9882. warn(("Invalid Component definition: " + (String(Ctor))), context);
  9883. }
  9884. return
  9885. }
  9886. // async component
  9887. var asyncFactory;
  9888. if (isUndef(Ctor.cid)) {
  9889. asyncFactory = Ctor;
  9890. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  9891. if (Ctor === undefined) {
  9892. // return a placeholder node for async component, which is rendered
  9893. // as a comment node but preserves all the raw information for the node.
  9894. // the information will be used for async server-rendering and hydration.
  9895. return createAsyncPlaceholder(
  9896. asyncFactory,
  9897. data,
  9898. context,
  9899. children,
  9900. tag
  9901. )
  9902. }
  9903. }
  9904. data = data || {};
  9905. // resolve constructor options in case global mixins are applied after
  9906. // component constructor creation
  9907. resolveConstructorOptions(Ctor);
  9908. // transform component v-model data into props & events
  9909. if (isDef(data.model)) {
  9910. transformModel(Ctor.options, data);
  9911. }
  9912. // extract props
  9913. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  9914. // functional component
  9915. if (isTrue(Ctor.options.functional)) {
  9916. return createFunctionalComponent(Ctor, propsData, data, context, children)
  9917. }
  9918. // extract listeners, since these needs to be treated as
  9919. // child component listeners instead of DOM listeners
  9920. var listeners = data.on;
  9921. // replace with listeners with .native modifier
  9922. // so it gets processed during parent component patch.
  9923. data.on = data.nativeOn;
  9924. if (isTrue(Ctor.options.abstract)) {
  9925. // abstract components do not keep anything
  9926. // other than props & listeners & slot
  9927. // work around flow
  9928. var slot = data.slot;
  9929. data = {};
  9930. if (slot) {
  9931. data.slot = slot;
  9932. }
  9933. }
  9934. // install component management hooks onto the placeholder node
  9935. installComponentHooks(data);
  9936. // return a placeholder vnode
  9937. var name = Ctor.options.name || tag;
  9938. var vnode = new VNode(
  9939. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  9940. data, undefined, undefined, undefined, context,
  9941. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  9942. asyncFactory
  9943. );
  9944. return vnode
  9945. }
  9946. function createComponentInstanceForVnode (
  9947. vnode, // we know it's MountedComponentVNode but flow doesn't
  9948. parent // activeInstance in lifecycle state
  9949. ) {
  9950. var options = {
  9951. _isComponent: true,
  9952. _parentVnode: vnode,
  9953. parent: parent
  9954. };
  9955. // check inline-template render functions
  9956. var inlineTemplate = vnode.data.inlineTemplate;
  9957. if (isDef(inlineTemplate)) {
  9958. options.render = inlineTemplate.render;
  9959. options.staticRenderFns = inlineTemplate.staticRenderFns;
  9960. }
  9961. return new vnode.componentOptions.Ctor(options)
  9962. }
  9963. function installComponentHooks (data) {
  9964. var hooks = data.hook || (data.hook = {});
  9965. for (var i = 0; i < hooksToMerge.length; i++) {
  9966. var key = hooksToMerge[i];
  9967. var existing = hooks[key];
  9968. var toMerge = componentVNodeHooks[key];
  9969. if (existing !== toMerge && !(existing && existing._merged)) {
  9970. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  9971. }
  9972. }
  9973. }
  9974. function mergeHook$1 (f1, f2) {
  9975. var merged = function (a, b) {
  9976. // flow complains about extra args which is why we use any
  9977. f1(a, b);
  9978. f2(a, b);
  9979. };
  9980. merged._merged = true;
  9981. return merged
  9982. }
  9983. // transform component v-model info (value and callback) into
  9984. // prop and event handler respectively.
  9985. function transformModel (options, data) {
  9986. var prop = (options.model && options.model.prop) || 'value';
  9987. var event = (options.model && options.model.event) || 'input'
  9988. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  9989. var on = data.on || (data.on = {});
  9990. var existing = on[event];
  9991. var callback = data.model.callback;
  9992. if (isDef(existing)) {
  9993. if (
  9994. Array.isArray(existing)
  9995. ? existing.indexOf(callback) === -1
  9996. : existing !== callback
  9997. ) {
  9998. on[event] = [callback].concat(existing);
  9999. }
  10000. } else {
  10001. on[event] = callback;
  10002. }
  10003. }
  10004. /* */
  10005. var SIMPLE_NORMALIZE = 1;
  10006. var ALWAYS_NORMALIZE = 2;
  10007. // wrapper function for providing a more flexible interface
  10008. // without getting yelled at by flow
  10009. function createElement (
  10010. context,
  10011. tag,
  10012. data,
  10013. children,
  10014. normalizationType,
  10015. alwaysNormalize
  10016. ) {
  10017. if (Array.isArray(data) || isPrimitive(data)) {
  10018. normalizationType = children;
  10019. children = data;
  10020. data = undefined;
  10021. }
  10022. if (isTrue(alwaysNormalize)) {
  10023. normalizationType = ALWAYS_NORMALIZE;
  10024. }
  10025. return _createElement(context, tag, data, children, normalizationType)
  10026. }
  10027. function _createElement (
  10028. context,
  10029. tag,
  10030. data,
  10031. children,
  10032. normalizationType
  10033. ) {
  10034. if (isDef(data) && isDef((data).__ob__)) {
  10035. true && warn(
  10036. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  10037. 'Always create fresh vnode data objects in each render!',
  10038. context
  10039. );
  10040. return createEmptyVNode()
  10041. }
  10042. // object syntax in v-bind
  10043. if (isDef(data) && isDef(data.is)) {
  10044. tag = data.is;
  10045. }
  10046. if (!tag) {
  10047. // in case of component :is set to falsy value
  10048. return createEmptyVNode()
  10049. }
  10050. // warn against non-primitive key
  10051. if ( true &&
  10052. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  10053. ) {
  10054. {
  10055. warn(
  10056. 'Avoid using non-primitive value as key, ' +
  10057. 'use string/number value instead.',
  10058. context
  10059. );
  10060. }
  10061. }
  10062. // support single function children as default scoped slot
  10063. if (Array.isArray(children) &&
  10064. typeof children[0] === 'function'
  10065. ) {
  10066. data = data || {};
  10067. data.scopedSlots = { default: children[0] };
  10068. children.length = 0;
  10069. }
  10070. if (normalizationType === ALWAYS_NORMALIZE) {
  10071. children = normalizeChildren(children);
  10072. } else if (normalizationType === SIMPLE_NORMALIZE) {
  10073. children = simpleNormalizeChildren(children);
  10074. }
  10075. var vnode, ns;
  10076. if (typeof tag === 'string') {
  10077. var Ctor;
  10078. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  10079. if (config.isReservedTag(tag)) {
  10080. // platform built-in elements
  10081. if ( true && isDef(data) && isDef(data.nativeOn)) {
  10082. warn(
  10083. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  10084. context
  10085. );
  10086. }
  10087. vnode = new VNode(
  10088. config.parsePlatformTagName(tag), data, children,
  10089. undefined, undefined, context
  10090. );
  10091. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  10092. // component
  10093. vnode = createComponent(Ctor, data, context, children, tag);
  10094. } else {
  10095. // unknown or unlisted namespaced elements
  10096. // check at runtime because it may get assigned a namespace when its
  10097. // parent normalizes children
  10098. vnode = new VNode(
  10099. tag, data, children,
  10100. undefined, undefined, context
  10101. );
  10102. }
  10103. } else {
  10104. // direct component options / constructor
  10105. vnode = createComponent(tag, data, context, children);
  10106. }
  10107. if (Array.isArray(vnode)) {
  10108. return vnode
  10109. } else if (isDef(vnode)) {
  10110. if (isDef(ns)) { applyNS(vnode, ns); }
  10111. if (isDef(data)) { registerDeepBindings(data); }
  10112. return vnode
  10113. } else {
  10114. return createEmptyVNode()
  10115. }
  10116. }
  10117. function applyNS (vnode, ns, force) {
  10118. vnode.ns = ns;
  10119. if (vnode.tag === 'foreignObject') {
  10120. // use default namespace inside foreignObject
  10121. ns = undefined;
  10122. force = true;
  10123. }
  10124. if (isDef(vnode.children)) {
  10125. for (var i = 0, l = vnode.children.length; i < l; i++) {
  10126. var child = vnode.children[i];
  10127. if (isDef(child.tag) && (
  10128. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  10129. applyNS(child, ns, force);
  10130. }
  10131. }
  10132. }
  10133. }
  10134. // ref #5318
  10135. // necessary to ensure parent re-render when deep bindings like :style and
  10136. // :class are used on slot nodes
  10137. function registerDeepBindings (data) {
  10138. if (isObject(data.style)) {
  10139. traverse(data.style);
  10140. }
  10141. if (isObject(data.class)) {
  10142. traverse(data.class);
  10143. }
  10144. }
  10145. /* */
  10146. function initRender (vm) {
  10147. vm._vnode = null; // the root of the child tree
  10148. vm._staticTrees = null; // v-once cached trees
  10149. var options = vm.$options;
  10150. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  10151. var renderContext = parentVnode && parentVnode.context;
  10152. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  10153. vm.$scopedSlots = emptyObject;
  10154. // bind the createElement fn to this instance
  10155. // so that we get proper render context inside it.
  10156. // args order: tag, data, children, normalizationType, alwaysNormalize
  10157. // internal version is used by render functions compiled from templates
  10158. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  10159. // normalization is always applied for the public version, used in
  10160. // user-written render functions.
  10161. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  10162. // $attrs & $listeners are exposed for easier HOC creation.
  10163. // they need to be reactive so that HOCs using them are always updated
  10164. var parentData = parentVnode && parentVnode.data;
  10165. /* istanbul ignore else */
  10166. if (true) {
  10167. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  10168. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  10169. }, true);
  10170. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  10171. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  10172. }, true);
  10173. } else {}
  10174. }
  10175. var currentRenderingInstance = null;
  10176. function renderMixin (Vue) {
  10177. // install runtime convenience helpers
  10178. installRenderHelpers(Vue.prototype);
  10179. Vue.prototype.$nextTick = function (fn) {
  10180. return nextTick(fn, this)
  10181. };
  10182. Vue.prototype._render = function () {
  10183. var vm = this;
  10184. var ref = vm.$options;
  10185. var render = ref.render;
  10186. var _parentVnode = ref._parentVnode;
  10187. if (_parentVnode) {
  10188. vm.$scopedSlots = normalizeScopedSlots(
  10189. _parentVnode.data.scopedSlots,
  10190. vm.$slots,
  10191. vm.$scopedSlots
  10192. );
  10193. }
  10194. // set parent vnode. this allows render functions to have access
  10195. // to the data on the placeholder node.
  10196. vm.$vnode = _parentVnode;
  10197. // render self
  10198. var vnode;
  10199. try {
  10200. // There's no need to maintain a stack because all render fns are called
  10201. // separately from one another. Nested component's render fns are called
  10202. // when parent component is patched.
  10203. currentRenderingInstance = vm;
  10204. vnode = render.call(vm._renderProxy, vm.$createElement);
  10205. } catch (e) {
  10206. handleError(e, vm, "render");
  10207. // return error render result,
  10208. // or previous vnode to prevent render error causing blank component
  10209. /* istanbul ignore else */
  10210. if ( true && vm.$options.renderError) {
  10211. try {
  10212. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  10213. } catch (e) {
  10214. handleError(e, vm, "renderError");
  10215. vnode = vm._vnode;
  10216. }
  10217. } else {
  10218. vnode = vm._vnode;
  10219. }
  10220. } finally {
  10221. currentRenderingInstance = null;
  10222. }
  10223. // if the returned array contains only a single node, allow it
  10224. if (Array.isArray(vnode) && vnode.length === 1) {
  10225. vnode = vnode[0];
  10226. }
  10227. // return empty vnode in case the render function errored out
  10228. if (!(vnode instanceof VNode)) {
  10229. if ( true && Array.isArray(vnode)) {
  10230. warn(
  10231. 'Multiple root nodes returned from render function. Render function ' +
  10232. 'should return a single root node.',
  10233. vm
  10234. );
  10235. }
  10236. vnode = createEmptyVNode();
  10237. }
  10238. // set parent
  10239. vnode.parent = _parentVnode;
  10240. return vnode
  10241. };
  10242. }
  10243. /* */
  10244. function ensureCtor (comp, base) {
  10245. if (
  10246. comp.__esModule ||
  10247. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  10248. ) {
  10249. comp = comp.default;
  10250. }
  10251. return isObject(comp)
  10252. ? base.extend(comp)
  10253. : comp
  10254. }
  10255. function createAsyncPlaceholder (
  10256. factory,
  10257. data,
  10258. context,
  10259. children,
  10260. tag
  10261. ) {
  10262. var node = createEmptyVNode();
  10263. node.asyncFactory = factory;
  10264. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  10265. return node
  10266. }
  10267. function resolveAsyncComponent (
  10268. factory,
  10269. baseCtor
  10270. ) {
  10271. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  10272. return factory.errorComp
  10273. }
  10274. if (isDef(factory.resolved)) {
  10275. return factory.resolved
  10276. }
  10277. var owner = currentRenderingInstance;
  10278. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  10279. // already pending
  10280. factory.owners.push(owner);
  10281. }
  10282. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  10283. return factory.loadingComp
  10284. }
  10285. if (owner && !isDef(factory.owners)) {
  10286. var owners = factory.owners = [owner];
  10287. var sync = true;
  10288. var timerLoading = null;
  10289. var timerTimeout = null
  10290. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  10291. var forceRender = function (renderCompleted) {
  10292. for (var i = 0, l = owners.length; i < l; i++) {
  10293. (owners[i]).$forceUpdate();
  10294. }
  10295. if (renderCompleted) {
  10296. owners.length = 0;
  10297. if (timerLoading !== null) {
  10298. clearTimeout(timerLoading);
  10299. timerLoading = null;
  10300. }
  10301. if (timerTimeout !== null) {
  10302. clearTimeout(timerTimeout);
  10303. timerTimeout = null;
  10304. }
  10305. }
  10306. };
  10307. var resolve = once(function (res) {
  10308. // cache resolved
  10309. factory.resolved = ensureCtor(res, baseCtor);
  10310. // invoke callbacks only if this is not a synchronous resolve
  10311. // (async resolves are shimmed as synchronous during SSR)
  10312. if (!sync) {
  10313. forceRender(true);
  10314. } else {
  10315. owners.length = 0;
  10316. }
  10317. });
  10318. var reject = once(function (reason) {
  10319. true && warn(
  10320. "Failed to resolve async component: " + (String(factory)) +
  10321. (reason ? ("\nReason: " + reason) : '')
  10322. );
  10323. if (isDef(factory.errorComp)) {
  10324. factory.error = true;
  10325. forceRender(true);
  10326. }
  10327. });
  10328. var res = factory(resolve, reject);
  10329. if (isObject(res)) {
  10330. if (isPromise(res)) {
  10331. // () => Promise
  10332. if (isUndef(factory.resolved)) {
  10333. res.then(resolve, reject);
  10334. }
  10335. } else if (isPromise(res.component)) {
  10336. res.component.then(resolve, reject);
  10337. if (isDef(res.error)) {
  10338. factory.errorComp = ensureCtor(res.error, baseCtor);
  10339. }
  10340. if (isDef(res.loading)) {
  10341. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  10342. if (res.delay === 0) {
  10343. factory.loading = true;
  10344. } else {
  10345. timerLoading = setTimeout(function () {
  10346. timerLoading = null;
  10347. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  10348. factory.loading = true;
  10349. forceRender(false);
  10350. }
  10351. }, res.delay || 200);
  10352. }
  10353. }
  10354. if (isDef(res.timeout)) {
  10355. timerTimeout = setTimeout(function () {
  10356. timerTimeout = null;
  10357. if (isUndef(factory.resolved)) {
  10358. reject(
  10359. true
  10360. ? ("timeout (" + (res.timeout) + "ms)")
  10361. : undefined
  10362. );
  10363. }
  10364. }, res.timeout);
  10365. }
  10366. }
  10367. }
  10368. sync = false;
  10369. // return in case resolved synchronously
  10370. return factory.loading
  10371. ? factory.loadingComp
  10372. : factory.resolved
  10373. }
  10374. }
  10375. /* */
  10376. function isAsyncPlaceholder (node) {
  10377. return node.isComment && node.asyncFactory
  10378. }
  10379. /* */
  10380. function getFirstComponentChild (children) {
  10381. if (Array.isArray(children)) {
  10382. for (var i = 0; i < children.length; i++) {
  10383. var c = children[i];
  10384. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  10385. return c
  10386. }
  10387. }
  10388. }
  10389. }
  10390. /* */
  10391. /* */
  10392. function initEvents (vm) {
  10393. vm._events = Object.create(null);
  10394. vm._hasHookEvent = false;
  10395. // init parent attached events
  10396. var listeners = vm.$options._parentListeners;
  10397. if (listeners) {
  10398. updateComponentListeners(vm, listeners);
  10399. }
  10400. }
  10401. var target;
  10402. function add (event, fn) {
  10403. target.$on(event, fn);
  10404. }
  10405. function remove$1 (event, fn) {
  10406. target.$off(event, fn);
  10407. }
  10408. function createOnceHandler (event, fn) {
  10409. var _target = target;
  10410. return function onceHandler () {
  10411. var res = fn.apply(null, arguments);
  10412. if (res !== null) {
  10413. _target.$off(event, onceHandler);
  10414. }
  10415. }
  10416. }
  10417. function updateComponentListeners (
  10418. vm,
  10419. listeners,
  10420. oldListeners
  10421. ) {
  10422. target = vm;
  10423. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  10424. target = undefined;
  10425. }
  10426. function eventsMixin (Vue) {
  10427. var hookRE = /^hook:/;
  10428. Vue.prototype.$on = function (event, fn) {
  10429. var vm = this;
  10430. if (Array.isArray(event)) {
  10431. for (var i = 0, l = event.length; i < l; i++) {
  10432. vm.$on(event[i], fn);
  10433. }
  10434. } else {
  10435. (vm._events[event] || (vm._events[event] = [])).push(fn);
  10436. // optimize hook:event cost by using a boolean flag marked at registration
  10437. // instead of a hash lookup
  10438. if (hookRE.test(event)) {
  10439. vm._hasHookEvent = true;
  10440. }
  10441. }
  10442. return vm
  10443. };
  10444. Vue.prototype.$once = function (event, fn) {
  10445. var vm = this;
  10446. function on () {
  10447. vm.$off(event, on);
  10448. fn.apply(vm, arguments);
  10449. }
  10450. on.fn = fn;
  10451. vm.$on(event, on);
  10452. return vm
  10453. };
  10454. Vue.prototype.$off = function (event, fn) {
  10455. var vm = this;
  10456. // all
  10457. if (!arguments.length) {
  10458. vm._events = Object.create(null);
  10459. return vm
  10460. }
  10461. // array of events
  10462. if (Array.isArray(event)) {
  10463. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  10464. vm.$off(event[i$1], fn);
  10465. }
  10466. return vm
  10467. }
  10468. // specific event
  10469. var cbs = vm._events[event];
  10470. if (!cbs) {
  10471. return vm
  10472. }
  10473. if (!fn) {
  10474. vm._events[event] = null;
  10475. return vm
  10476. }
  10477. // specific handler
  10478. var cb;
  10479. var i = cbs.length;
  10480. while (i--) {
  10481. cb = cbs[i];
  10482. if (cb === fn || cb.fn === fn) {
  10483. cbs.splice(i, 1);
  10484. break
  10485. }
  10486. }
  10487. return vm
  10488. };
  10489. Vue.prototype.$emit = function (event) {
  10490. var vm = this;
  10491. if (true) {
  10492. var lowerCaseEvent = event.toLowerCase();
  10493. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  10494. tip(
  10495. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  10496. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  10497. "Note that HTML attributes are case-insensitive and you cannot use " +
  10498. "v-on to listen to camelCase events when using in-DOM templates. " +
  10499. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  10500. );
  10501. }
  10502. }
  10503. var cbs = vm._events[event];
  10504. if (cbs) {
  10505. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  10506. var args = toArray(arguments, 1);
  10507. var info = "event handler for \"" + event + "\"";
  10508. for (var i = 0, l = cbs.length; i < l; i++) {
  10509. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  10510. }
  10511. }
  10512. return vm
  10513. };
  10514. }
  10515. /* */
  10516. var activeInstance = null;
  10517. var isUpdatingChildComponent = false;
  10518. function setActiveInstance(vm) {
  10519. var prevActiveInstance = activeInstance;
  10520. activeInstance = vm;
  10521. return function () {
  10522. activeInstance = prevActiveInstance;
  10523. }
  10524. }
  10525. function initLifecycle (vm) {
  10526. var options = vm.$options;
  10527. // locate first non-abstract parent
  10528. var parent = options.parent;
  10529. if (parent && !options.abstract) {
  10530. while (parent.$options.abstract && parent.$parent) {
  10531. parent = parent.$parent;
  10532. }
  10533. parent.$children.push(vm);
  10534. }
  10535. vm.$parent = parent;
  10536. vm.$root = parent ? parent.$root : vm;
  10537. vm.$children = [];
  10538. vm.$refs = {};
  10539. vm._watcher = null;
  10540. vm._inactive = null;
  10541. vm._directInactive = false;
  10542. vm._isMounted = false;
  10543. vm._isDestroyed = false;
  10544. vm._isBeingDestroyed = false;
  10545. }
  10546. function lifecycleMixin (Vue) {
  10547. Vue.prototype._update = function (vnode, hydrating) {
  10548. var vm = this;
  10549. var prevEl = vm.$el;
  10550. var prevVnode = vm._vnode;
  10551. var restoreActiveInstance = setActiveInstance(vm);
  10552. vm._vnode = vnode;
  10553. // Vue.prototype.__patch__ is injected in entry points
  10554. // based on the rendering backend used.
  10555. if (!prevVnode) {
  10556. // initial render
  10557. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  10558. } else {
  10559. // updates
  10560. vm.$el = vm.__patch__(prevVnode, vnode);
  10561. }
  10562. restoreActiveInstance();
  10563. // update __vue__ reference
  10564. if (prevEl) {
  10565. prevEl.__vue__ = null;
  10566. }
  10567. if (vm.$el) {
  10568. vm.$el.__vue__ = vm;
  10569. }
  10570. // if parent is an HOC, update its $el as well
  10571. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  10572. vm.$parent.$el = vm.$el;
  10573. }
  10574. // updated hook is called by the scheduler to ensure that children are
  10575. // updated in a parent's updated hook.
  10576. };
  10577. Vue.prototype.$forceUpdate = function () {
  10578. var vm = this;
  10579. if (vm._watcher) {
  10580. vm._watcher.update();
  10581. }
  10582. };
  10583. Vue.prototype.$destroy = function () {
  10584. var vm = this;
  10585. if (vm._isBeingDestroyed) {
  10586. return
  10587. }
  10588. callHook(vm, 'beforeDestroy');
  10589. vm._isBeingDestroyed = true;
  10590. // remove self from parent
  10591. var parent = vm.$parent;
  10592. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  10593. remove(parent.$children, vm);
  10594. }
  10595. // teardown watchers
  10596. if (vm._watcher) {
  10597. vm._watcher.teardown();
  10598. }
  10599. var i = vm._watchers.length;
  10600. while (i--) {
  10601. vm._watchers[i].teardown();
  10602. }
  10603. // remove reference from data ob
  10604. // frozen object may not have observer.
  10605. if (vm._data.__ob__) {
  10606. vm._data.__ob__.vmCount--;
  10607. }
  10608. // call the last hook...
  10609. vm._isDestroyed = true;
  10610. // invoke destroy hooks on current rendered tree
  10611. vm.__patch__(vm._vnode, null);
  10612. // fire destroyed hook
  10613. callHook(vm, 'destroyed');
  10614. // turn off all instance listeners.
  10615. vm.$off();
  10616. // remove __vue__ reference
  10617. if (vm.$el) {
  10618. vm.$el.__vue__ = null;
  10619. }
  10620. // release circular reference (#6759)
  10621. if (vm.$vnode) {
  10622. vm.$vnode.parent = null;
  10623. }
  10624. };
  10625. }
  10626. function updateChildComponent (
  10627. vm,
  10628. propsData,
  10629. listeners,
  10630. parentVnode,
  10631. renderChildren
  10632. ) {
  10633. if (true) {
  10634. isUpdatingChildComponent = true;
  10635. }
  10636. // determine whether component has slot children
  10637. // we need to do this before overwriting $options._renderChildren.
  10638. // check if there are dynamic scopedSlots (hand-written or compiled but with
  10639. // dynamic slot names). Static scoped slots compiled from template has the
  10640. // "$stable" marker.
  10641. var newScopedSlots = parentVnode.data.scopedSlots;
  10642. var oldScopedSlots = vm.$scopedSlots;
  10643. var hasDynamicScopedSlot = !!(
  10644. (newScopedSlots && !newScopedSlots.$stable) ||
  10645. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  10646. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  10647. );
  10648. // Any static slot children from the parent may have changed during parent's
  10649. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  10650. // update is necessary to ensure correctness.
  10651. var needsForceUpdate = !!(
  10652. renderChildren || // has new static slots
  10653. vm.$options._renderChildren || // has old static slots
  10654. hasDynamicScopedSlot
  10655. );
  10656. vm.$options._parentVnode = parentVnode;
  10657. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  10658. if (vm._vnode) { // update child tree's parent
  10659. vm._vnode.parent = parentVnode;
  10660. }
  10661. vm.$options._renderChildren = renderChildren;
  10662. // update $attrs and $listeners hash
  10663. // these are also reactive so they may trigger child update if the child
  10664. // used them during render
  10665. vm.$attrs = parentVnode.data.attrs || emptyObject;
  10666. vm.$listeners = listeners || emptyObject;
  10667. // update props
  10668. if (propsData && vm.$options.props) {
  10669. toggleObserving(false);
  10670. var props = vm._props;
  10671. var propKeys = vm.$options._propKeys || [];
  10672. for (var i = 0; i < propKeys.length; i++) {
  10673. var key = propKeys[i];
  10674. var propOptions = vm.$options.props; // wtf flow?
  10675. props[key] = validateProp(key, propOptions, propsData, vm);
  10676. }
  10677. toggleObserving(true);
  10678. // keep a copy of raw propsData
  10679. vm.$options.propsData = propsData;
  10680. }
  10681. // fixed by xxxxxx update properties(mp runtime)
  10682. vm._$updateProperties && vm._$updateProperties(vm);
  10683. // update listeners
  10684. listeners = listeners || emptyObject;
  10685. var oldListeners = vm.$options._parentListeners;
  10686. vm.$options._parentListeners = listeners;
  10687. updateComponentListeners(vm, listeners, oldListeners);
  10688. // resolve slots + force update if has children
  10689. if (needsForceUpdate) {
  10690. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  10691. vm.$forceUpdate();
  10692. }
  10693. if (true) {
  10694. isUpdatingChildComponent = false;
  10695. }
  10696. }
  10697. function isInInactiveTree (vm) {
  10698. while (vm && (vm = vm.$parent)) {
  10699. if (vm._inactive) { return true }
  10700. }
  10701. return false
  10702. }
  10703. function activateChildComponent (vm, direct) {
  10704. if (direct) {
  10705. vm._directInactive = false;
  10706. if (isInInactiveTree(vm)) {
  10707. return
  10708. }
  10709. } else if (vm._directInactive) {
  10710. return
  10711. }
  10712. if (vm._inactive || vm._inactive === null) {
  10713. vm._inactive = false;
  10714. for (var i = 0; i < vm.$children.length; i++) {
  10715. activateChildComponent(vm.$children[i]);
  10716. }
  10717. callHook(vm, 'activated');
  10718. }
  10719. }
  10720. function deactivateChildComponent (vm, direct) {
  10721. if (direct) {
  10722. vm._directInactive = true;
  10723. if (isInInactiveTree(vm)) {
  10724. return
  10725. }
  10726. }
  10727. if (!vm._inactive) {
  10728. vm._inactive = true;
  10729. for (var i = 0; i < vm.$children.length; i++) {
  10730. deactivateChildComponent(vm.$children[i]);
  10731. }
  10732. callHook(vm, 'deactivated');
  10733. }
  10734. }
  10735. function callHook (vm, hook) {
  10736. // #7573 disable dep collection when invoking lifecycle hooks
  10737. pushTarget();
  10738. var handlers = vm.$options[hook];
  10739. var info = hook + " hook";
  10740. if (handlers) {
  10741. for (var i = 0, j = handlers.length; i < j; i++) {
  10742. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  10743. }
  10744. }
  10745. if (vm._hasHookEvent) {
  10746. vm.$emit('hook:' + hook);
  10747. }
  10748. popTarget();
  10749. }
  10750. /* */
  10751. var MAX_UPDATE_COUNT = 100;
  10752. var queue = [];
  10753. var activatedChildren = [];
  10754. var has = {};
  10755. var circular = {};
  10756. var waiting = false;
  10757. var flushing = false;
  10758. var index = 0;
  10759. /**
  10760. * Reset the scheduler's state.
  10761. */
  10762. function resetSchedulerState () {
  10763. index = queue.length = activatedChildren.length = 0;
  10764. has = {};
  10765. if (true) {
  10766. circular = {};
  10767. }
  10768. waiting = flushing = false;
  10769. }
  10770. // Async edge case #6566 requires saving the timestamp when event listeners are
  10771. // attached. However, calling performance.now() has a perf overhead especially
  10772. // if the page has thousands of event listeners. Instead, we take a timestamp
  10773. // every time the scheduler flushes and use that for all event listeners
  10774. // attached during that flush.
  10775. var currentFlushTimestamp = 0;
  10776. // Async edge case fix requires storing an event listener's attach timestamp.
  10777. var getNow = Date.now;
  10778. // Determine what event timestamp the browser is using. Annoyingly, the
  10779. // timestamp can either be hi-res (relative to page load) or low-res
  10780. // (relative to UNIX epoch), so in order to compare time we have to use the
  10781. // same timestamp type when saving the flush timestamp.
  10782. // All IE versions use low-res event timestamps, and have problematic clock
  10783. // implementations (#9632)
  10784. if (inBrowser && !isIE) {
  10785. var performance = window.performance;
  10786. if (
  10787. performance &&
  10788. typeof performance.now === 'function' &&
  10789. getNow() > document.createEvent('Event').timeStamp
  10790. ) {
  10791. // if the event timestamp, although evaluated AFTER the Date.now(), is
  10792. // smaller than it, it means the event is using a hi-res timestamp,
  10793. // and we need to use the hi-res version for event listener timestamps as
  10794. // well.
  10795. getNow = function () { return performance.now(); };
  10796. }
  10797. }
  10798. /**
  10799. * Flush both queues and run the watchers.
  10800. */
  10801. function flushSchedulerQueue () {
  10802. currentFlushTimestamp = getNow();
  10803. flushing = true;
  10804. var watcher, id;
  10805. // Sort queue before flush.
  10806. // This ensures that:
  10807. // 1. Components are updated from parent to child. (because parent is always
  10808. // created before the child)
  10809. // 2. A component's user watchers are run before its render watcher (because
  10810. // user watchers are created before the render watcher)
  10811. // 3. If a component is destroyed during a parent component's watcher run,
  10812. // its watchers can be skipped.
  10813. queue.sort(function (a, b) { return a.id - b.id; });
  10814. // do not cache length because more watchers might be pushed
  10815. // as we run existing watchers
  10816. for (index = 0; index < queue.length; index++) {
  10817. watcher = queue[index];
  10818. if (watcher.before) {
  10819. watcher.before();
  10820. }
  10821. id = watcher.id;
  10822. has[id] = null;
  10823. watcher.run();
  10824. // in dev build, check and stop circular updates.
  10825. if ( true && has[id] != null) {
  10826. circular[id] = (circular[id] || 0) + 1;
  10827. if (circular[id] > MAX_UPDATE_COUNT) {
  10828. warn(
  10829. 'You may have an infinite update loop ' + (
  10830. watcher.user
  10831. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  10832. : "in a component render function."
  10833. ),
  10834. watcher.vm
  10835. );
  10836. break
  10837. }
  10838. }
  10839. }
  10840. // keep copies of post queues before resetting state
  10841. var activatedQueue = activatedChildren.slice();
  10842. var updatedQueue = queue.slice();
  10843. resetSchedulerState();
  10844. // call component updated and activated hooks
  10845. callActivatedHooks(activatedQueue);
  10846. callUpdatedHooks(updatedQueue);
  10847. // devtool hook
  10848. /* istanbul ignore if */
  10849. if (devtools && config.devtools) {
  10850. devtools.emit('flush');
  10851. }
  10852. }
  10853. function callUpdatedHooks (queue) {
  10854. var i = queue.length;
  10855. while (i--) {
  10856. var watcher = queue[i];
  10857. var vm = watcher.vm;
  10858. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  10859. callHook(vm, 'updated');
  10860. }
  10861. }
  10862. }
  10863. /**
  10864. * Queue a kept-alive component that was activated during patch.
  10865. * The queue will be processed after the entire tree has been patched.
  10866. */
  10867. function queueActivatedComponent (vm) {
  10868. // setting _inactive to false here so that a render function can
  10869. // rely on checking whether it's in an inactive tree (e.g. router-view)
  10870. vm._inactive = false;
  10871. activatedChildren.push(vm);
  10872. }
  10873. function callActivatedHooks (queue) {
  10874. for (var i = 0; i < queue.length; i++) {
  10875. queue[i]._inactive = true;
  10876. activateChildComponent(queue[i], true /* true */);
  10877. }
  10878. }
  10879. /**
  10880. * Push a watcher into the watcher queue.
  10881. * Jobs with duplicate IDs will be skipped unless it's
  10882. * pushed when the queue is being flushed.
  10883. */
  10884. function queueWatcher (watcher) {
  10885. var id = watcher.id;
  10886. if (has[id] == null) {
  10887. has[id] = true;
  10888. if (!flushing) {
  10889. queue.push(watcher);
  10890. } else {
  10891. // if already flushing, splice the watcher based on its id
  10892. // if already past its id, it will be run next immediately.
  10893. var i = queue.length - 1;
  10894. while (i > index && queue[i].id > watcher.id) {
  10895. i--;
  10896. }
  10897. queue.splice(i + 1, 0, watcher);
  10898. }
  10899. // queue the flush
  10900. if (!waiting) {
  10901. waiting = true;
  10902. if ( true && !config.async) {
  10903. flushSchedulerQueue();
  10904. return
  10905. }
  10906. nextTick(flushSchedulerQueue);
  10907. }
  10908. }
  10909. }
  10910. /* */
  10911. var uid$2 = 0;
  10912. /**
  10913. * A watcher parses an expression, collects dependencies,
  10914. * and fires callback when the expression value changes.
  10915. * This is used for both the $watch() api and directives.
  10916. */
  10917. var Watcher = function Watcher (
  10918. vm,
  10919. expOrFn,
  10920. cb,
  10921. options,
  10922. isRenderWatcher
  10923. ) {
  10924. this.vm = vm;
  10925. if (isRenderWatcher) {
  10926. vm._watcher = this;
  10927. }
  10928. vm._watchers.push(this);
  10929. // options
  10930. if (options) {
  10931. this.deep = !!options.deep;
  10932. this.user = !!options.user;
  10933. this.lazy = !!options.lazy;
  10934. this.sync = !!options.sync;
  10935. this.before = options.before;
  10936. } else {
  10937. this.deep = this.user = this.lazy = this.sync = false;
  10938. }
  10939. this.cb = cb;
  10940. this.id = ++uid$2; // uid for batching
  10941. this.active = true;
  10942. this.dirty = this.lazy; // for lazy watchers
  10943. this.deps = [];
  10944. this.newDeps = [];
  10945. this.depIds = new _Set();
  10946. this.newDepIds = new _Set();
  10947. this.expression = true
  10948. ? expOrFn.toString()
  10949. : undefined;
  10950. // parse expression for getter
  10951. if (typeof expOrFn === 'function') {
  10952. this.getter = expOrFn;
  10953. } else {
  10954. this.getter = parsePath(expOrFn);
  10955. if (!this.getter) {
  10956. this.getter = noop;
  10957. true && warn(
  10958. "Failed watching path: \"" + expOrFn + "\" " +
  10959. 'Watcher only accepts simple dot-delimited paths. ' +
  10960. 'For full control, use a function instead.',
  10961. vm
  10962. );
  10963. }
  10964. }
  10965. this.value = this.lazy
  10966. ? undefined
  10967. : this.get();
  10968. };
  10969. /**
  10970. * Evaluate the getter, and re-collect dependencies.
  10971. */
  10972. Watcher.prototype.get = function get () {
  10973. pushTarget(this);
  10974. var value;
  10975. var vm = this.vm;
  10976. try {
  10977. value = this.getter.call(vm, vm);
  10978. } catch (e) {
  10979. if (this.user) {
  10980. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  10981. } else {
  10982. throw e
  10983. }
  10984. } finally {
  10985. // "touch" every property so they are all tracked as
  10986. // dependencies for deep watching
  10987. if (this.deep) {
  10988. traverse(value);
  10989. }
  10990. popTarget();
  10991. this.cleanupDeps();
  10992. }
  10993. return value
  10994. };
  10995. /**
  10996. * Add a dependency to this directive.
  10997. */
  10998. Watcher.prototype.addDep = function addDep (dep) {
  10999. var id = dep.id;
  11000. if (!this.newDepIds.has(id)) {
  11001. this.newDepIds.add(id);
  11002. this.newDeps.push(dep);
  11003. if (!this.depIds.has(id)) {
  11004. dep.addSub(this);
  11005. }
  11006. }
  11007. };
  11008. /**
  11009. * Clean up for dependency collection.
  11010. */
  11011. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  11012. var i = this.deps.length;
  11013. while (i--) {
  11014. var dep = this.deps[i];
  11015. if (!this.newDepIds.has(dep.id)) {
  11016. dep.removeSub(this);
  11017. }
  11018. }
  11019. var tmp = this.depIds;
  11020. this.depIds = this.newDepIds;
  11021. this.newDepIds = tmp;
  11022. this.newDepIds.clear();
  11023. tmp = this.deps;
  11024. this.deps = this.newDeps;
  11025. this.newDeps = tmp;
  11026. this.newDeps.length = 0;
  11027. };
  11028. /**
  11029. * Subscriber interface.
  11030. * Will be called when a dependency changes.
  11031. */
  11032. Watcher.prototype.update = function update () {
  11033. /* istanbul ignore else */
  11034. if (this.lazy) {
  11035. this.dirty = true;
  11036. } else if (this.sync) {
  11037. this.run();
  11038. } else {
  11039. queueWatcher(this);
  11040. }
  11041. };
  11042. /**
  11043. * Scheduler job interface.
  11044. * Will be called by the scheduler.
  11045. */
  11046. Watcher.prototype.run = function run () {
  11047. if (this.active) {
  11048. var value = this.get();
  11049. if (
  11050. value !== this.value ||
  11051. // Deep watchers and watchers on Object/Arrays should fire even
  11052. // when the value is the same, because the value may
  11053. // have mutated.
  11054. isObject(value) ||
  11055. this.deep
  11056. ) {
  11057. // set new value
  11058. var oldValue = this.value;
  11059. this.value = value;
  11060. if (this.user) {
  11061. try {
  11062. this.cb.call(this.vm, value, oldValue);
  11063. } catch (e) {
  11064. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  11065. }
  11066. } else {
  11067. this.cb.call(this.vm, value, oldValue);
  11068. }
  11069. }
  11070. }
  11071. };
  11072. /**
  11073. * Evaluate the value of the watcher.
  11074. * This only gets called for lazy watchers.
  11075. */
  11076. Watcher.prototype.evaluate = function evaluate () {
  11077. this.value = this.get();
  11078. this.dirty = false;
  11079. };
  11080. /**
  11081. * Depend on all deps collected by this watcher.
  11082. */
  11083. Watcher.prototype.depend = function depend () {
  11084. var i = this.deps.length;
  11085. while (i--) {
  11086. this.deps[i].depend();
  11087. }
  11088. };
  11089. /**
  11090. * Remove self from all dependencies' subscriber list.
  11091. */
  11092. Watcher.prototype.teardown = function teardown () {
  11093. if (this.active) {
  11094. // remove self from vm's watcher list
  11095. // this is a somewhat expensive operation so we skip it
  11096. // if the vm is being destroyed.
  11097. if (!this.vm._isBeingDestroyed) {
  11098. remove(this.vm._watchers, this);
  11099. }
  11100. var i = this.deps.length;
  11101. while (i--) {
  11102. this.deps[i].removeSub(this);
  11103. }
  11104. this.active = false;
  11105. }
  11106. };
  11107. /* */
  11108. var sharedPropertyDefinition = {
  11109. enumerable: true,
  11110. configurable: true,
  11111. get: noop,
  11112. set: noop
  11113. };
  11114. function proxy (target, sourceKey, key) {
  11115. sharedPropertyDefinition.get = function proxyGetter () {
  11116. return this[sourceKey][key]
  11117. };
  11118. sharedPropertyDefinition.set = function proxySetter (val) {
  11119. this[sourceKey][key] = val;
  11120. };
  11121. Object.defineProperty(target, key, sharedPropertyDefinition);
  11122. }
  11123. function initState (vm) {
  11124. vm._watchers = [];
  11125. var opts = vm.$options;
  11126. if (opts.props) { initProps(vm, opts.props); }
  11127. if (opts.methods) { initMethods(vm, opts.methods); }
  11128. if (opts.data) {
  11129. initData(vm);
  11130. } else {
  11131. observe(vm._data = {}, true /* asRootData */);
  11132. }
  11133. if (opts.computed) { initComputed(vm, opts.computed); }
  11134. if (opts.watch && opts.watch !== nativeWatch) {
  11135. initWatch(vm, opts.watch);
  11136. }
  11137. }
  11138. function initProps (vm, propsOptions) {
  11139. var propsData = vm.$options.propsData || {};
  11140. var props = vm._props = {};
  11141. // cache prop keys so that future props updates can iterate using Array
  11142. // instead of dynamic object key enumeration.
  11143. var keys = vm.$options._propKeys = [];
  11144. var isRoot = !vm.$parent;
  11145. // root instance props should be converted
  11146. if (!isRoot) {
  11147. toggleObserving(false);
  11148. }
  11149. var loop = function ( key ) {
  11150. keys.push(key);
  11151. var value = validateProp(key, propsOptions, propsData, vm);
  11152. /* istanbul ignore else */
  11153. if (true) {
  11154. var hyphenatedKey = hyphenate(key);
  11155. if (isReservedAttribute(hyphenatedKey) ||
  11156. config.isReservedAttr(hyphenatedKey)) {
  11157. warn(
  11158. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  11159. vm
  11160. );
  11161. }
  11162. defineReactive$$1(props, key, value, function () {
  11163. if (!isRoot && !isUpdatingChildComponent) {
  11164. {
  11165. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou' || vm.mpHost === 'mp-xhs'){//百度、快手、小红书 observer 在 setData callback 之后触发,直接忽略该 warn
  11166. return
  11167. }
  11168. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  11169. if(
  11170. key === 'value' &&
  11171. Array.isArray(vm.$options.behaviors) &&
  11172. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  11173. ){
  11174. return
  11175. }
  11176. if(vm._getFormData){
  11177. return
  11178. }
  11179. var $parent = vm.$parent;
  11180. while($parent){
  11181. if($parent.__next_tick_pending){
  11182. return
  11183. }
  11184. $parent = $parent.$parent;
  11185. }
  11186. }
  11187. warn(
  11188. "Avoid mutating a prop directly since the value will be " +
  11189. "overwritten whenever the parent component re-renders. " +
  11190. "Instead, use a data or computed property based on the prop's " +
  11191. "value. Prop being mutated: \"" + key + "\"",
  11192. vm
  11193. );
  11194. }
  11195. });
  11196. } else {}
  11197. // static props are already proxied on the component's prototype
  11198. // during Vue.extend(). We only need to proxy props defined at
  11199. // instantiation here.
  11200. if (!(key in vm)) {
  11201. proxy(vm, "_props", key);
  11202. }
  11203. };
  11204. for (var key in propsOptions) loop( key );
  11205. toggleObserving(true);
  11206. }
  11207. function initData (vm) {
  11208. var data = vm.$options.data;
  11209. data = vm._data = typeof data === 'function'
  11210. ? getData(data, vm)
  11211. : data || {};
  11212. if (!isPlainObject(data)) {
  11213. data = {};
  11214. true && warn(
  11215. 'data functions should return an object:\n' +
  11216. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  11217. vm
  11218. );
  11219. }
  11220. // proxy data on instance
  11221. var keys = Object.keys(data);
  11222. var props = vm.$options.props;
  11223. var methods = vm.$options.methods;
  11224. var i = keys.length;
  11225. while (i--) {
  11226. var key = keys[i];
  11227. if (true) {
  11228. if (methods && hasOwn(methods, key)) {
  11229. warn(
  11230. ("Method \"" + key + "\" has already been defined as a data property."),
  11231. vm
  11232. );
  11233. }
  11234. }
  11235. if (props && hasOwn(props, key)) {
  11236. true && warn(
  11237. "The data property \"" + key + "\" is already declared as a prop. " +
  11238. "Use prop default value instead.",
  11239. vm
  11240. );
  11241. } else if (!isReserved(key)) {
  11242. proxy(vm, "_data", key);
  11243. }
  11244. }
  11245. // observe data
  11246. observe(data, true /* asRootData */);
  11247. }
  11248. function getData (data, vm) {
  11249. // #7573 disable dep collection when invoking data getters
  11250. pushTarget();
  11251. try {
  11252. return data.call(vm, vm)
  11253. } catch (e) {
  11254. handleError(e, vm, "data()");
  11255. return {}
  11256. } finally {
  11257. popTarget();
  11258. }
  11259. }
  11260. var computedWatcherOptions = { lazy: true };
  11261. function initComputed (vm, computed) {
  11262. // $flow-disable-line
  11263. var watchers = vm._computedWatchers = Object.create(null);
  11264. // computed properties are just getters during SSR
  11265. var isSSR = isServerRendering();
  11266. for (var key in computed) {
  11267. var userDef = computed[key];
  11268. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  11269. if ( true && getter == null) {
  11270. warn(
  11271. ("Getter is missing for computed property \"" + key + "\"."),
  11272. vm
  11273. );
  11274. }
  11275. if (!isSSR) {
  11276. // create internal watcher for the computed property.
  11277. watchers[key] = new Watcher(
  11278. vm,
  11279. getter || noop,
  11280. noop,
  11281. computedWatcherOptions
  11282. );
  11283. }
  11284. // component-defined computed properties are already defined on the
  11285. // component prototype. We only need to define computed properties defined
  11286. // at instantiation here.
  11287. if (!(key in vm)) {
  11288. defineComputed(vm, key, userDef);
  11289. } else if (true) {
  11290. if (key in vm.$data) {
  11291. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  11292. } else if (vm.$options.props && key in vm.$options.props) {
  11293. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  11294. }
  11295. }
  11296. }
  11297. }
  11298. function defineComputed (
  11299. target,
  11300. key,
  11301. userDef
  11302. ) {
  11303. var shouldCache = !isServerRendering();
  11304. if (typeof userDef === 'function') {
  11305. sharedPropertyDefinition.get = shouldCache
  11306. ? createComputedGetter(key)
  11307. : createGetterInvoker(userDef);
  11308. sharedPropertyDefinition.set = noop;
  11309. } else {
  11310. sharedPropertyDefinition.get = userDef.get
  11311. ? shouldCache && userDef.cache !== false
  11312. ? createComputedGetter(key)
  11313. : createGetterInvoker(userDef.get)
  11314. : noop;
  11315. sharedPropertyDefinition.set = userDef.set || noop;
  11316. }
  11317. if ( true &&
  11318. sharedPropertyDefinition.set === noop) {
  11319. sharedPropertyDefinition.set = function () {
  11320. warn(
  11321. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  11322. this
  11323. );
  11324. };
  11325. }
  11326. Object.defineProperty(target, key, sharedPropertyDefinition);
  11327. }
  11328. function createComputedGetter (key) {
  11329. return function computedGetter () {
  11330. var watcher = this._computedWatchers && this._computedWatchers[key];
  11331. if (watcher) {
  11332. if (watcher.dirty) {
  11333. watcher.evaluate();
  11334. }
  11335. if (Dep.SharedObject.target) {// fixed by xxxxxx
  11336. watcher.depend();
  11337. }
  11338. return watcher.value
  11339. }
  11340. }
  11341. }
  11342. function createGetterInvoker(fn) {
  11343. return function computedGetter () {
  11344. return fn.call(this, this)
  11345. }
  11346. }
  11347. function initMethods (vm, methods) {
  11348. var props = vm.$options.props;
  11349. for (var key in methods) {
  11350. if (true) {
  11351. if (typeof methods[key] !== 'function') {
  11352. warn(
  11353. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  11354. "Did you reference the function correctly?",
  11355. vm
  11356. );
  11357. }
  11358. if (props && hasOwn(props, key)) {
  11359. warn(
  11360. ("Method \"" + key + "\" has already been defined as a prop."),
  11361. vm
  11362. );
  11363. }
  11364. if ((key in vm) && isReserved(key)) {
  11365. warn(
  11366. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  11367. "Avoid defining component methods that start with _ or $."
  11368. );
  11369. }
  11370. }
  11371. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  11372. }
  11373. }
  11374. function initWatch (vm, watch) {
  11375. for (var key in watch) {
  11376. var handler = watch[key];
  11377. if (Array.isArray(handler)) {
  11378. for (var i = 0; i < handler.length; i++) {
  11379. createWatcher(vm, key, handler[i]);
  11380. }
  11381. } else {
  11382. createWatcher(vm, key, handler);
  11383. }
  11384. }
  11385. }
  11386. function createWatcher (
  11387. vm,
  11388. expOrFn,
  11389. handler,
  11390. options
  11391. ) {
  11392. if (isPlainObject(handler)) {
  11393. options = handler;
  11394. handler = handler.handler;
  11395. }
  11396. if (typeof handler === 'string') {
  11397. handler = vm[handler];
  11398. }
  11399. return vm.$watch(expOrFn, handler, options)
  11400. }
  11401. function stateMixin (Vue) {
  11402. // flow somehow has problems with directly declared definition object
  11403. // when using Object.defineProperty, so we have to procedurally build up
  11404. // the object here.
  11405. var dataDef = {};
  11406. dataDef.get = function () { return this._data };
  11407. var propsDef = {};
  11408. propsDef.get = function () { return this._props };
  11409. if (true) {
  11410. dataDef.set = function () {
  11411. warn(
  11412. 'Avoid replacing instance root $data. ' +
  11413. 'Use nested data properties instead.',
  11414. this
  11415. );
  11416. };
  11417. propsDef.set = function () {
  11418. warn("$props is readonly.", this);
  11419. };
  11420. }
  11421. Object.defineProperty(Vue.prototype, '$data', dataDef);
  11422. Object.defineProperty(Vue.prototype, '$props', propsDef);
  11423. Vue.prototype.$set = set;
  11424. Vue.prototype.$delete = del;
  11425. Vue.prototype.$watch = function (
  11426. expOrFn,
  11427. cb,
  11428. options
  11429. ) {
  11430. var vm = this;
  11431. if (isPlainObject(cb)) {
  11432. return createWatcher(vm, expOrFn, cb, options)
  11433. }
  11434. options = options || {};
  11435. options.user = true;
  11436. var watcher = new Watcher(vm, expOrFn, cb, options);
  11437. if (options.immediate) {
  11438. try {
  11439. cb.call(vm, watcher.value);
  11440. } catch (error) {
  11441. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  11442. }
  11443. }
  11444. return function unwatchFn () {
  11445. watcher.teardown();
  11446. }
  11447. };
  11448. }
  11449. /* */
  11450. var uid$3 = 0;
  11451. function initMixin (Vue) {
  11452. Vue.prototype._init = function (options) {
  11453. var vm = this;
  11454. // a uid
  11455. vm._uid = uid$3++;
  11456. var startTag, endTag;
  11457. /* istanbul ignore if */
  11458. if ( true && config.performance && mark) {
  11459. startTag = "vue-perf-start:" + (vm._uid);
  11460. endTag = "vue-perf-end:" + (vm._uid);
  11461. mark(startTag);
  11462. }
  11463. // a flag to avoid this being observed
  11464. vm._isVue = true;
  11465. // merge options
  11466. if (options && options._isComponent) {
  11467. // optimize internal component instantiation
  11468. // since dynamic options merging is pretty slow, and none of the
  11469. // internal component options needs special treatment.
  11470. initInternalComponent(vm, options);
  11471. } else {
  11472. vm.$options = mergeOptions(
  11473. resolveConstructorOptions(vm.constructor),
  11474. options || {},
  11475. vm
  11476. );
  11477. }
  11478. /* istanbul ignore else */
  11479. if (true) {
  11480. initProxy(vm);
  11481. } else {}
  11482. // expose real self
  11483. vm._self = vm;
  11484. initLifecycle(vm);
  11485. initEvents(vm);
  11486. initRender(vm);
  11487. callHook(vm, 'beforeCreate');
  11488. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  11489. initState(vm);
  11490. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  11491. !vm._$fallback && callHook(vm, 'created');
  11492. /* istanbul ignore if */
  11493. if ( true && config.performance && mark) {
  11494. vm._name = formatComponentName(vm, false);
  11495. mark(endTag);
  11496. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  11497. }
  11498. if (vm.$options.el) {
  11499. vm.$mount(vm.$options.el);
  11500. }
  11501. };
  11502. }
  11503. function initInternalComponent (vm, options) {
  11504. var opts = vm.$options = Object.create(vm.constructor.options);
  11505. // doing this because it's faster than dynamic enumeration.
  11506. var parentVnode = options._parentVnode;
  11507. opts.parent = options.parent;
  11508. opts._parentVnode = parentVnode;
  11509. var vnodeComponentOptions = parentVnode.componentOptions;
  11510. opts.propsData = vnodeComponentOptions.propsData;
  11511. opts._parentListeners = vnodeComponentOptions.listeners;
  11512. opts._renderChildren = vnodeComponentOptions.children;
  11513. opts._componentTag = vnodeComponentOptions.tag;
  11514. if (options.render) {
  11515. opts.render = options.render;
  11516. opts.staticRenderFns = options.staticRenderFns;
  11517. }
  11518. }
  11519. function resolveConstructorOptions (Ctor) {
  11520. var options = Ctor.options;
  11521. if (Ctor.super) {
  11522. var superOptions = resolveConstructorOptions(Ctor.super);
  11523. var cachedSuperOptions = Ctor.superOptions;
  11524. if (superOptions !== cachedSuperOptions) {
  11525. // super option changed,
  11526. // need to resolve new options.
  11527. Ctor.superOptions = superOptions;
  11528. // check if there are any late-modified/attached options (#4976)
  11529. var modifiedOptions = resolveModifiedOptions(Ctor);
  11530. // update base extend options
  11531. if (modifiedOptions) {
  11532. extend(Ctor.extendOptions, modifiedOptions);
  11533. }
  11534. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  11535. if (options.name) {
  11536. options.components[options.name] = Ctor;
  11537. }
  11538. }
  11539. }
  11540. return options
  11541. }
  11542. function resolveModifiedOptions (Ctor) {
  11543. var modified;
  11544. var latest = Ctor.options;
  11545. var sealed = Ctor.sealedOptions;
  11546. for (var key in latest) {
  11547. if (latest[key] !== sealed[key]) {
  11548. if (!modified) { modified = {}; }
  11549. modified[key] = latest[key];
  11550. }
  11551. }
  11552. return modified
  11553. }
  11554. function Vue (options) {
  11555. if ( true &&
  11556. !(this instanceof Vue)
  11557. ) {
  11558. warn('Vue is a constructor and should be called with the `new` keyword');
  11559. }
  11560. this._init(options);
  11561. }
  11562. initMixin(Vue);
  11563. stateMixin(Vue);
  11564. eventsMixin(Vue);
  11565. lifecycleMixin(Vue);
  11566. renderMixin(Vue);
  11567. /* */
  11568. function initUse (Vue) {
  11569. Vue.use = function (plugin) {
  11570. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  11571. if (installedPlugins.indexOf(plugin) > -1) {
  11572. return this
  11573. }
  11574. // additional parameters
  11575. var args = toArray(arguments, 1);
  11576. args.unshift(this);
  11577. if (typeof plugin.install === 'function') {
  11578. plugin.install.apply(plugin, args);
  11579. } else if (typeof plugin === 'function') {
  11580. plugin.apply(null, args);
  11581. }
  11582. installedPlugins.push(plugin);
  11583. return this
  11584. };
  11585. }
  11586. /* */
  11587. function initMixin$1 (Vue) {
  11588. Vue.mixin = function (mixin) {
  11589. this.options = mergeOptions(this.options, mixin);
  11590. return this
  11591. };
  11592. }
  11593. /* */
  11594. function initExtend (Vue) {
  11595. /**
  11596. * Each instance constructor, including Vue, has a unique
  11597. * cid. This enables us to create wrapped "child
  11598. * constructors" for prototypal inheritance and cache them.
  11599. */
  11600. Vue.cid = 0;
  11601. var cid = 1;
  11602. /**
  11603. * Class inheritance
  11604. */
  11605. Vue.extend = function (extendOptions) {
  11606. extendOptions = extendOptions || {};
  11607. var Super = this;
  11608. var SuperId = Super.cid;
  11609. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  11610. if (cachedCtors[SuperId]) {
  11611. return cachedCtors[SuperId]
  11612. }
  11613. var name = extendOptions.name || Super.options.name;
  11614. if ( true && name) {
  11615. validateComponentName(name);
  11616. }
  11617. var Sub = function VueComponent (options) {
  11618. this._init(options);
  11619. };
  11620. Sub.prototype = Object.create(Super.prototype);
  11621. Sub.prototype.constructor = Sub;
  11622. Sub.cid = cid++;
  11623. Sub.options = mergeOptions(
  11624. Super.options,
  11625. extendOptions
  11626. );
  11627. Sub['super'] = Super;
  11628. // For props and computed properties, we define the proxy getters on
  11629. // the Vue instances at extension time, on the extended prototype. This
  11630. // avoids Object.defineProperty calls for each instance created.
  11631. if (Sub.options.props) {
  11632. initProps$1(Sub);
  11633. }
  11634. if (Sub.options.computed) {
  11635. initComputed$1(Sub);
  11636. }
  11637. // allow further extension/mixin/plugin usage
  11638. Sub.extend = Super.extend;
  11639. Sub.mixin = Super.mixin;
  11640. Sub.use = Super.use;
  11641. // create asset registers, so extended classes
  11642. // can have their private assets too.
  11643. ASSET_TYPES.forEach(function (type) {
  11644. Sub[type] = Super[type];
  11645. });
  11646. // enable recursive self-lookup
  11647. if (name) {
  11648. Sub.options.components[name] = Sub;
  11649. }
  11650. // keep a reference to the super options at extension time.
  11651. // later at instantiation we can check if Super's options have
  11652. // been updated.
  11653. Sub.superOptions = Super.options;
  11654. Sub.extendOptions = extendOptions;
  11655. Sub.sealedOptions = extend({}, Sub.options);
  11656. // cache constructor
  11657. cachedCtors[SuperId] = Sub;
  11658. return Sub
  11659. };
  11660. }
  11661. function initProps$1 (Comp) {
  11662. var props = Comp.options.props;
  11663. for (var key in props) {
  11664. proxy(Comp.prototype, "_props", key);
  11665. }
  11666. }
  11667. function initComputed$1 (Comp) {
  11668. var computed = Comp.options.computed;
  11669. for (var key in computed) {
  11670. defineComputed(Comp.prototype, key, computed[key]);
  11671. }
  11672. }
  11673. /* */
  11674. function initAssetRegisters (Vue) {
  11675. /**
  11676. * Create asset registration methods.
  11677. */
  11678. ASSET_TYPES.forEach(function (type) {
  11679. Vue[type] = function (
  11680. id,
  11681. definition
  11682. ) {
  11683. if (!definition) {
  11684. return this.options[type + 's'][id]
  11685. } else {
  11686. /* istanbul ignore if */
  11687. if ( true && type === 'component') {
  11688. validateComponentName(id);
  11689. }
  11690. if (type === 'component' && isPlainObject(definition)) {
  11691. definition.name = definition.name || id;
  11692. definition = this.options._base.extend(definition);
  11693. }
  11694. if (type === 'directive' && typeof definition === 'function') {
  11695. definition = { bind: definition, update: definition };
  11696. }
  11697. this.options[type + 's'][id] = definition;
  11698. return definition
  11699. }
  11700. };
  11701. });
  11702. }
  11703. /* */
  11704. function getComponentName (opts) {
  11705. return opts && (opts.Ctor.options.name || opts.tag)
  11706. }
  11707. function matches (pattern, name) {
  11708. if (Array.isArray(pattern)) {
  11709. return pattern.indexOf(name) > -1
  11710. } else if (typeof pattern === 'string') {
  11711. return pattern.split(',').indexOf(name) > -1
  11712. } else if (isRegExp(pattern)) {
  11713. return pattern.test(name)
  11714. }
  11715. /* istanbul ignore next */
  11716. return false
  11717. }
  11718. function pruneCache (keepAliveInstance, filter) {
  11719. var cache = keepAliveInstance.cache;
  11720. var keys = keepAliveInstance.keys;
  11721. var _vnode = keepAliveInstance._vnode;
  11722. for (var key in cache) {
  11723. var cachedNode = cache[key];
  11724. if (cachedNode) {
  11725. var name = getComponentName(cachedNode.componentOptions);
  11726. if (name && !filter(name)) {
  11727. pruneCacheEntry(cache, key, keys, _vnode);
  11728. }
  11729. }
  11730. }
  11731. }
  11732. function pruneCacheEntry (
  11733. cache,
  11734. key,
  11735. keys,
  11736. current
  11737. ) {
  11738. var cached$$1 = cache[key];
  11739. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  11740. cached$$1.componentInstance.$destroy();
  11741. }
  11742. cache[key] = null;
  11743. remove(keys, key);
  11744. }
  11745. var patternTypes = [String, RegExp, Array];
  11746. var KeepAlive = {
  11747. name: 'keep-alive',
  11748. abstract: true,
  11749. props: {
  11750. include: patternTypes,
  11751. exclude: patternTypes,
  11752. max: [String, Number]
  11753. },
  11754. created: function created () {
  11755. this.cache = Object.create(null);
  11756. this.keys = [];
  11757. },
  11758. destroyed: function destroyed () {
  11759. for (var key in this.cache) {
  11760. pruneCacheEntry(this.cache, key, this.keys);
  11761. }
  11762. },
  11763. mounted: function mounted () {
  11764. var this$1 = this;
  11765. this.$watch('include', function (val) {
  11766. pruneCache(this$1, function (name) { return matches(val, name); });
  11767. });
  11768. this.$watch('exclude', function (val) {
  11769. pruneCache(this$1, function (name) { return !matches(val, name); });
  11770. });
  11771. },
  11772. render: function render () {
  11773. var slot = this.$slots.default;
  11774. var vnode = getFirstComponentChild(slot);
  11775. var componentOptions = vnode && vnode.componentOptions;
  11776. if (componentOptions) {
  11777. // check pattern
  11778. var name = getComponentName(componentOptions);
  11779. var ref = this;
  11780. var include = ref.include;
  11781. var exclude = ref.exclude;
  11782. if (
  11783. // not included
  11784. (include && (!name || !matches(include, name))) ||
  11785. // excluded
  11786. (exclude && name && matches(exclude, name))
  11787. ) {
  11788. return vnode
  11789. }
  11790. var ref$1 = this;
  11791. var cache = ref$1.cache;
  11792. var keys = ref$1.keys;
  11793. var key = vnode.key == null
  11794. // same constructor may get registered as different local components
  11795. // so cid alone is not enough (#3269)
  11796. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  11797. : vnode.key;
  11798. if (cache[key]) {
  11799. vnode.componentInstance = cache[key].componentInstance;
  11800. // make current key freshest
  11801. remove(keys, key);
  11802. keys.push(key);
  11803. } else {
  11804. cache[key] = vnode;
  11805. keys.push(key);
  11806. // prune oldest entry
  11807. if (this.max && keys.length > parseInt(this.max)) {
  11808. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  11809. }
  11810. }
  11811. vnode.data.keepAlive = true;
  11812. }
  11813. return vnode || (slot && slot[0])
  11814. }
  11815. };
  11816. var builtInComponents = {
  11817. KeepAlive: KeepAlive
  11818. };
  11819. /* */
  11820. function initGlobalAPI (Vue) {
  11821. // config
  11822. var configDef = {};
  11823. configDef.get = function () { return config; };
  11824. if (true) {
  11825. configDef.set = function () {
  11826. warn(
  11827. 'Do not replace the Vue.config object, set individual fields instead.'
  11828. );
  11829. };
  11830. }
  11831. Object.defineProperty(Vue, 'config', configDef);
  11832. // exposed util methods.
  11833. // NOTE: these are not considered part of the public API - avoid relying on
  11834. // them unless you are aware of the risk.
  11835. Vue.util = {
  11836. warn: warn,
  11837. extend: extend,
  11838. mergeOptions: mergeOptions,
  11839. defineReactive: defineReactive$$1
  11840. };
  11841. Vue.set = set;
  11842. Vue.delete = del;
  11843. Vue.nextTick = nextTick;
  11844. // 2.6 explicit observable API
  11845. Vue.observable = function (obj) {
  11846. observe(obj);
  11847. return obj
  11848. };
  11849. Vue.options = Object.create(null);
  11850. ASSET_TYPES.forEach(function (type) {
  11851. Vue.options[type + 's'] = Object.create(null);
  11852. });
  11853. // this is used to identify the "base" constructor to extend all plain-object
  11854. // components with in Weex's multi-instance scenarios.
  11855. Vue.options._base = Vue;
  11856. extend(Vue.options.components, builtInComponents);
  11857. initUse(Vue);
  11858. initMixin$1(Vue);
  11859. initExtend(Vue);
  11860. initAssetRegisters(Vue);
  11861. }
  11862. initGlobalAPI(Vue);
  11863. Object.defineProperty(Vue.prototype, '$isServer', {
  11864. get: isServerRendering
  11865. });
  11866. Object.defineProperty(Vue.prototype, '$ssrContext', {
  11867. get: function get () {
  11868. /* istanbul ignore next */
  11869. return this.$vnode && this.$vnode.ssrContext
  11870. }
  11871. });
  11872. // expose FunctionalRenderContext for ssr runtime helper installation
  11873. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  11874. value: FunctionalRenderContext
  11875. });
  11876. Vue.version = '2.6.11';
  11877. /**
  11878. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  11879. */
  11880. var ARRAYTYPE = '[object Array]';
  11881. var OBJECTTYPE = '[object Object]';
  11882. // const FUNCTIONTYPE = '[object Function]'
  11883. function diff(current, pre) {
  11884. var result = {};
  11885. syncKeys(current, pre);
  11886. _diff(current, pre, '', result);
  11887. return result
  11888. }
  11889. function syncKeys(current, pre) {
  11890. if (current === pre) { return }
  11891. var rootCurrentType = type(current);
  11892. var rootPreType = type(pre);
  11893. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  11894. if(Object.keys(current).length >= Object.keys(pre).length){
  11895. for (var key in pre) {
  11896. var currentValue = current[key];
  11897. if (currentValue === undefined) {
  11898. current[key] = null;
  11899. } else {
  11900. syncKeys(currentValue, pre[key]);
  11901. }
  11902. }
  11903. }
  11904. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  11905. if (current.length >= pre.length) {
  11906. pre.forEach(function (item, index) {
  11907. syncKeys(current[index], item);
  11908. });
  11909. }
  11910. }
  11911. }
  11912. function _diff(current, pre, path, result) {
  11913. if (current === pre) { return }
  11914. var rootCurrentType = type(current);
  11915. var rootPreType = type(pre);
  11916. if (rootCurrentType == OBJECTTYPE) {
  11917. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  11918. setResult(result, path, current);
  11919. } else {
  11920. var loop = function ( key ) {
  11921. var currentValue = current[key];
  11922. var preValue = pre[key];
  11923. var currentType = type(currentValue);
  11924. var preType = type(preValue);
  11925. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  11926. if (currentValue !== pre[key]) {
  11927. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  11928. }
  11929. } else if (currentType == ARRAYTYPE) {
  11930. if (preType != ARRAYTYPE) {
  11931. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  11932. } else {
  11933. if (currentValue.length < preValue.length) {
  11934. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  11935. } else {
  11936. currentValue.forEach(function (item, index) {
  11937. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  11938. });
  11939. }
  11940. }
  11941. } else if (currentType == OBJECTTYPE) {
  11942. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  11943. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  11944. } else {
  11945. for (var subKey in currentValue) {
  11946. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  11947. }
  11948. }
  11949. }
  11950. };
  11951. for (var key in current) loop( key );
  11952. }
  11953. } else if (rootCurrentType == ARRAYTYPE) {
  11954. if (rootPreType != ARRAYTYPE) {
  11955. setResult(result, path, current);
  11956. } else {
  11957. if (current.length < pre.length) {
  11958. setResult(result, path, current);
  11959. } else {
  11960. current.forEach(function (item, index) {
  11961. _diff(item, pre[index], path + '[' + index + ']', result);
  11962. });
  11963. }
  11964. }
  11965. } else {
  11966. setResult(result, path, current);
  11967. }
  11968. }
  11969. function setResult(result, k, v) {
  11970. // if (type(v) != FUNCTIONTYPE) {
  11971. result[k] = v;
  11972. // }
  11973. }
  11974. function type(obj) {
  11975. return Object.prototype.toString.call(obj)
  11976. }
  11977. /* */
  11978. function flushCallbacks$1(vm) {
  11979. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  11980. if (Object({"VUE_APP_NAME":"mdapp","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  11981. var mpInstance = vm.$scope;
  11982. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  11983. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  11984. }
  11985. var copies = vm.__next_tick_callbacks.slice(0);
  11986. vm.__next_tick_callbacks.length = 0;
  11987. for (var i = 0; i < copies.length; i++) {
  11988. copies[i]();
  11989. }
  11990. }
  11991. }
  11992. function hasRenderWatcher(vm) {
  11993. return queue.find(function (watcher) { return vm._watcher === watcher; })
  11994. }
  11995. function nextTick$1(vm, cb) {
  11996. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  11997. //2.nextTick 之前存在 render watcher
  11998. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  11999. if(Object({"VUE_APP_NAME":"mdapp","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  12000. var mpInstance = vm.$scope;
  12001. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  12002. ']:nextVueTick');
  12003. }
  12004. return nextTick(cb, vm)
  12005. }else{
  12006. if(Object({"VUE_APP_NAME":"mdapp","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  12007. var mpInstance$1 = vm.$scope;
  12008. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  12009. ']:nextMPTick');
  12010. }
  12011. }
  12012. var _resolve;
  12013. if (!vm.__next_tick_callbacks) {
  12014. vm.__next_tick_callbacks = [];
  12015. }
  12016. vm.__next_tick_callbacks.push(function () {
  12017. if (cb) {
  12018. try {
  12019. cb.call(vm);
  12020. } catch (e) {
  12021. handleError(e, vm, 'nextTick');
  12022. }
  12023. } else if (_resolve) {
  12024. _resolve(vm);
  12025. }
  12026. });
  12027. // $flow-disable-line
  12028. if (!cb && typeof Promise !== 'undefined') {
  12029. return new Promise(function (resolve) {
  12030. _resolve = resolve;
  12031. })
  12032. }
  12033. }
  12034. /* */
  12035. function cloneWithData(vm) {
  12036. // 确保当前 vm 所有数据被同步
  12037. var ret = Object.create(null);
  12038. var dataKeys = [].concat(
  12039. Object.keys(vm._data || {}),
  12040. Object.keys(vm._computedWatchers || {}));
  12041. dataKeys.reduce(function(ret, key) {
  12042. ret[key] = vm[key];
  12043. return ret
  12044. }, ret);
  12045. // vue-composition-api
  12046. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  12047. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  12048. if (rawBindings) {
  12049. Object.keys(rawBindings).forEach(function (key) {
  12050. ret[key] = vm[key];
  12051. });
  12052. }
  12053. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  12054. Object.assign(ret, vm.$mp.data || {});
  12055. if (
  12056. Array.isArray(vm.$options.behaviors) &&
  12057. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  12058. ) { //form-field
  12059. ret['name'] = vm.name;
  12060. ret['value'] = vm.value;
  12061. }
  12062. return JSON.parse(JSON.stringify(ret))
  12063. }
  12064. var patch = function(oldVnode, vnode) {
  12065. var this$1 = this;
  12066. if (vnode === null) { //destroy
  12067. return
  12068. }
  12069. if (this.mpType === 'page' || this.mpType === 'component') {
  12070. var mpInstance = this.$scope;
  12071. var data = Object.create(null);
  12072. try {
  12073. data = cloneWithData(this);
  12074. } catch (err) {
  12075. console.error(err);
  12076. }
  12077. data.__webviewId__ = mpInstance.data.__webviewId__;
  12078. var mpData = Object.create(null);
  12079. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  12080. mpData[key] = mpInstance.data[key];
  12081. });
  12082. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  12083. if (Object.keys(diffData).length) {
  12084. if (Object({"VUE_APP_NAME":"mdapp","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  12085. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  12086. ']差量更新',
  12087. JSON.stringify(diffData));
  12088. }
  12089. this.__next_tick_pending = true;
  12090. mpInstance.setData(diffData, function () {
  12091. this$1.__next_tick_pending = false;
  12092. flushCallbacks$1(this$1);
  12093. });
  12094. } else {
  12095. flushCallbacks$1(this);
  12096. }
  12097. }
  12098. };
  12099. /* */
  12100. function createEmptyRender() {
  12101. }
  12102. function mountComponent$1(
  12103. vm,
  12104. el,
  12105. hydrating
  12106. ) {
  12107. if (!vm.mpType) {//main.js 中的 new Vue
  12108. return vm
  12109. }
  12110. if (vm.mpType === 'app') {
  12111. vm.$options.render = createEmptyRender;
  12112. }
  12113. if (!vm.$options.render) {
  12114. vm.$options.render = createEmptyRender;
  12115. if (true) {
  12116. /* istanbul ignore if */
  12117. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  12118. vm.$options.el || el) {
  12119. warn(
  12120. 'You are using the runtime-only build of Vue where the template ' +
  12121. 'compiler is not available. Either pre-compile the templates into ' +
  12122. 'render functions, or use the compiler-included build.',
  12123. vm
  12124. );
  12125. } else {
  12126. warn(
  12127. 'Failed to mount component: template or render function not defined.',
  12128. vm
  12129. );
  12130. }
  12131. }
  12132. }
  12133. !vm._$fallback && callHook(vm, 'beforeMount');
  12134. var updateComponent = function () {
  12135. vm._update(vm._render(), hydrating);
  12136. };
  12137. // we set this to vm._watcher inside the watcher's constructor
  12138. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  12139. // component's mounted hook), which relies on vm._watcher being already defined
  12140. new Watcher(vm, updateComponent, noop, {
  12141. before: function before() {
  12142. if (vm._isMounted && !vm._isDestroyed) {
  12143. callHook(vm, 'beforeUpdate');
  12144. }
  12145. }
  12146. }, true /* isRenderWatcher */);
  12147. hydrating = false;
  12148. return vm
  12149. }
  12150. /* */
  12151. function renderClass (
  12152. staticClass,
  12153. dynamicClass
  12154. ) {
  12155. if (isDef(staticClass) || isDef(dynamicClass)) {
  12156. return concat(staticClass, stringifyClass(dynamicClass))
  12157. }
  12158. /* istanbul ignore next */
  12159. return ''
  12160. }
  12161. function concat (a, b) {
  12162. return a ? b ? (a + ' ' + b) : a : (b || '')
  12163. }
  12164. function stringifyClass (value) {
  12165. if (Array.isArray(value)) {
  12166. return stringifyArray(value)
  12167. }
  12168. if (isObject(value)) {
  12169. return stringifyObject(value)
  12170. }
  12171. if (typeof value === 'string') {
  12172. return value
  12173. }
  12174. /* istanbul ignore next */
  12175. return ''
  12176. }
  12177. function stringifyArray (value) {
  12178. var res = '';
  12179. var stringified;
  12180. for (var i = 0, l = value.length; i < l; i++) {
  12181. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  12182. if (res) { res += ' '; }
  12183. res += stringified;
  12184. }
  12185. }
  12186. return res
  12187. }
  12188. function stringifyObject (value) {
  12189. var res = '';
  12190. for (var key in value) {
  12191. if (value[key]) {
  12192. if (res) { res += ' '; }
  12193. res += key;
  12194. }
  12195. }
  12196. return res
  12197. }
  12198. /* */
  12199. var parseStyleText = cached(function (cssText) {
  12200. var res = {};
  12201. var listDelimiter = /;(?![^(]*\))/g;
  12202. var propertyDelimiter = /:(.+)/;
  12203. cssText.split(listDelimiter).forEach(function (item) {
  12204. if (item) {
  12205. var tmp = item.split(propertyDelimiter);
  12206. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  12207. }
  12208. });
  12209. return res
  12210. });
  12211. // normalize possible array / string values into Object
  12212. function normalizeStyleBinding (bindingStyle) {
  12213. if (Array.isArray(bindingStyle)) {
  12214. return toObject(bindingStyle)
  12215. }
  12216. if (typeof bindingStyle === 'string') {
  12217. return parseStyleText(bindingStyle)
  12218. }
  12219. return bindingStyle
  12220. }
  12221. /* */
  12222. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  12223. function getTarget(obj, path) {
  12224. var parts = path.split('.');
  12225. var key = parts[0];
  12226. if (key.indexOf('__$n') === 0) { //number index
  12227. key = parseInt(key.replace('__$n', ''));
  12228. }
  12229. if (parts.length === 1) {
  12230. return obj[key]
  12231. }
  12232. return getTarget(obj[key], parts.slice(1).join('.'))
  12233. }
  12234. function internalMixin(Vue) {
  12235. Vue.config.errorHandler = function(err, vm, info) {
  12236. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  12237. console.error(err);
  12238. /* eslint-disable no-undef */
  12239. var app = typeof getApp === 'function' && getApp();
  12240. if (app && app.onError) {
  12241. app.onError(err);
  12242. }
  12243. };
  12244. var oldEmit = Vue.prototype.$emit;
  12245. Vue.prototype.$emit = function(event) {
  12246. if (this.$scope && event) {
  12247. (this.$scope['_triggerEvent'] || this.$scope['triggerEvent']).call(this.$scope, event, {
  12248. __args__: toArray(arguments, 1)
  12249. });
  12250. }
  12251. return oldEmit.apply(this, arguments)
  12252. };
  12253. Vue.prototype.$nextTick = function(fn) {
  12254. return nextTick$1(this, fn)
  12255. };
  12256. MP_METHODS.forEach(function (method) {
  12257. Vue.prototype[method] = function(args) {
  12258. if (this.$scope && this.$scope[method]) {
  12259. return this.$scope[method](args)
  12260. }
  12261. // mp-alipay
  12262. if (typeof my === 'undefined') {
  12263. return
  12264. }
  12265. if (method === 'createSelectorQuery') {
  12266. /* eslint-disable no-undef */
  12267. return my.createSelectorQuery(args)
  12268. } else if (method === 'createIntersectionObserver') {
  12269. /* eslint-disable no-undef */
  12270. return my.createIntersectionObserver(args)
  12271. }
  12272. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  12273. };
  12274. });
  12275. Vue.prototype.__init_provide = initProvide;
  12276. Vue.prototype.__init_injections = initInjections;
  12277. Vue.prototype.__call_hook = function(hook, args) {
  12278. var vm = this;
  12279. // #7573 disable dep collection when invoking lifecycle hooks
  12280. pushTarget();
  12281. var handlers = vm.$options[hook];
  12282. var info = hook + " hook";
  12283. var ret;
  12284. if (handlers) {
  12285. for (var i = 0, j = handlers.length; i < j; i++) {
  12286. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  12287. }
  12288. }
  12289. if (vm._hasHookEvent) {
  12290. vm.$emit('hook:' + hook, args);
  12291. }
  12292. popTarget();
  12293. return ret
  12294. };
  12295. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  12296. if (Array.isArray(modifiers)) {
  12297. if (modifiers.indexOf('trim') !== -1) {
  12298. value = value.trim();
  12299. }
  12300. if (modifiers.indexOf('number') !== -1) {
  12301. value = this._n(value);
  12302. }
  12303. }
  12304. if (!target) {
  12305. target = this;
  12306. }
  12307. // 解决动态属性添加
  12308. Vue.set(target, key, value);
  12309. };
  12310. Vue.prototype.__set_sync = function(target, key, value) {
  12311. if (!target) {
  12312. target = this;
  12313. }
  12314. // 解决动态属性添加
  12315. Vue.set(target, key, value);
  12316. };
  12317. Vue.prototype.__get_orig = function(item) {
  12318. if (isPlainObject(item)) {
  12319. return item['$orig'] || item
  12320. }
  12321. return item
  12322. };
  12323. Vue.prototype.__get_value = function(dataPath, target) {
  12324. return getTarget(target || this, dataPath)
  12325. };
  12326. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  12327. return renderClass(staticClass, dynamicClass)
  12328. };
  12329. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  12330. if (!dynamicStyle && !staticStyle) {
  12331. return ''
  12332. }
  12333. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  12334. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  12335. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  12336. };
  12337. Vue.prototype.__map = function(val, iteratee) {
  12338. //TODO 暂不考虑 string
  12339. var ret, i, l, keys, key;
  12340. if (Array.isArray(val)) {
  12341. ret = new Array(val.length);
  12342. for (i = 0, l = val.length; i < l; i++) {
  12343. ret[i] = iteratee(val[i], i);
  12344. }
  12345. return ret
  12346. } else if (isObject(val)) {
  12347. keys = Object.keys(val);
  12348. ret = Object.create(null);
  12349. for (i = 0, l = keys.length; i < l; i++) {
  12350. key = keys[i];
  12351. ret[key] = iteratee(val[key], key, i);
  12352. }
  12353. return ret
  12354. } else if (typeof val === 'number') {
  12355. ret = new Array(val);
  12356. for (i = 0, l = val; i < l; i++) {
  12357. // 第一个参数暂时仍和小程序一致
  12358. ret[i] = iteratee(i, i);
  12359. }
  12360. return ret
  12361. }
  12362. return []
  12363. };
  12364. }
  12365. /* */
  12366. var LIFECYCLE_HOOKS$1 = [
  12367. //App
  12368. 'onLaunch',
  12369. 'onShow',
  12370. 'onHide',
  12371. 'onUniNViewMessage',
  12372. 'onPageNotFound',
  12373. 'onThemeChange',
  12374. 'onError',
  12375. 'onUnhandledRejection',
  12376. //Page
  12377. 'onInit',
  12378. 'onLoad',
  12379. // 'onShow',
  12380. 'onReady',
  12381. // 'onHide',
  12382. 'onUnload',
  12383. 'onPullDownRefresh',
  12384. 'onReachBottom',
  12385. 'onTabItemTap',
  12386. 'onAddToFavorites',
  12387. 'onShareTimeline',
  12388. 'onShareAppMessage',
  12389. 'onResize',
  12390. 'onPageScroll',
  12391. 'onNavigationBarButtonTap',
  12392. 'onBackPress',
  12393. 'onNavigationBarSearchInputChanged',
  12394. 'onNavigationBarSearchInputConfirmed',
  12395. 'onNavigationBarSearchInputClicked',
  12396. //Component
  12397. // 'onReady', // 兼容旧版本,应该移除该事件
  12398. 'onPageShow',
  12399. 'onPageHide',
  12400. 'onPageResize'
  12401. ];
  12402. function lifecycleMixin$1(Vue) {
  12403. //fixed vue-class-component
  12404. var oldExtend = Vue.extend;
  12405. Vue.extend = function(extendOptions) {
  12406. extendOptions = extendOptions || {};
  12407. var methods = extendOptions.methods;
  12408. if (methods) {
  12409. Object.keys(methods).forEach(function (methodName) {
  12410. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  12411. extendOptions[methodName] = methods[methodName];
  12412. delete methods[methodName];
  12413. }
  12414. });
  12415. }
  12416. return oldExtend.call(this, extendOptions)
  12417. };
  12418. var strategies = Vue.config.optionMergeStrategies;
  12419. var mergeHook = strategies.created;
  12420. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  12421. strategies[hook] = mergeHook;
  12422. });
  12423. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  12424. }
  12425. /* */
  12426. // install platform patch function
  12427. Vue.prototype.__patch__ = patch;
  12428. // public mount method
  12429. Vue.prototype.$mount = function(
  12430. el ,
  12431. hydrating
  12432. ) {
  12433. return mountComponent$1(this, el, hydrating)
  12434. };
  12435. lifecycleMixin$1(Vue);
  12436. internalMixin(Vue);
  12437. /* */
  12438. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  12439. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 2)))
  12440. /***/ }),
  12441. /***/ 40:
  12442. /*!********************************************************************!*\
  12443. !*** E:/fp/md/mdapp/uni_modules/vk-uview-ui/libs/config/zIndex.js ***!
  12444. \********************************************************************/
  12445. /*! no static exports found */
  12446. /***/ (function(module, exports, __webpack_require__) {
  12447. "use strict";
  12448. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // uniapp在H5中各API的z-index值如下:
  12449. /**
  12450. * actionsheet: 999
  12451. * modal: 999
  12452. * navigate: 998
  12453. * tabbar: 998
  12454. * toast: 999
  12455. */var _default =
  12456. {
  12457. toast: 10090,
  12458. noNetwork: 10080,
  12459. // popup包含popup,actionsheet,keyboard,picker的值
  12460. popup: 10075,
  12461. mask: 10070,
  12462. navbar: 980,
  12463. topTips: 975,
  12464. sticky: 970,
  12465. indexListSticky: 965 };exports.default = _default;
  12466. /***/ }),
  12467. /***/ 41:
  12468. /*!***********************************!*\
  12469. !*** E:/fp/md/mdapp/api/index.js ***!
  12470. \***********************************/
  12471. /*! no static exports found */
  12472. /***/ (function(module, exports, __webpack_require__) {
  12473. "use strict";
  12474. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ 42));
  12475. var _estate = _interopRequireDefault(__webpack_require__(/*! ./estate */ 45));
  12476. var _cust = _interopRequireDefault(__webpack_require__(/*! ./cust */ 46));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}var _default =
  12477. {
  12478. base: _base.default,
  12479. estate: _estate.default,
  12480. cust: _cust.default };exports.default = _default;
  12481. /***/ }),
  12482. /***/ 42:
  12483. /*!**********************************!*\
  12484. !*** E:/fp/md/mdapp/api/base.js ***!
  12485. \**********************************/
  12486. /*! no static exports found */
  12487. /***/ (function(module, exports, __webpack_require__) {
  12488. "use strict";
  12489. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _http = __webpack_require__(/*! @/utils/http */ 43);var _default =
  12490. {
  12491. apilogin: function apilogin(params) {// 登录
  12492. return (0, _http.request)('api/login', params, 'loading');
  12493. },
  12494. apiregister: function apiregister(params) {// 注册
  12495. return (0, _http.request)('api/register', params, 'loading');
  12496. },
  12497. apisendsms: function apisendsms(params) {// 发送短信
  12498. return (0, _http.request)('api/send/sms', params, 'loading');
  12499. },
  12500. apicaptcha: function apicaptcha(params) {// 验证码图片
  12501. return (0, _http.request)('api/captcha', params, 'loading');
  12502. },
  12503. apicheckcaptcha: function apicheckcaptcha(params) {// 检查手机号
  12504. return (0, _http.request)('api/check/captcha', params);
  12505. },
  12506. apiwxlogin: function apiwxlogin(params) {// 微信登录
  12507. return (0, _http.request)('api/wx/login', params, 'loading');
  12508. },
  12509. apiwxautologin: function apiwxautologin(params) {// 微信登录 自动
  12510. return (0, _http.request)('api/wx/autologin', params, 'loading');
  12511. },
  12512. apiuserinfo: function apiuserinfo(params) {// 用户信息
  12513. return (0, _http.request)('api/user/info', params, 'loading');
  12514. },
  12515. apiuseredit: function apiuseredit(params) {// 用户编辑
  12516. return (0, _http.request)('api/user/edit', params, 'loading');
  12517. },
  12518. apiuserbindwechat: function apiuserbindwechat(params) {// 绑定微信
  12519. return (0, _http.request)('api/user/bind/wechat', params, 'loading');
  12520. },
  12521. apiuserauthadd: function apiuserauthadd(params) {// 用户认证 - 提交认证
  12522. return (0, _http.request)('api/user/auth/add', params, 'loading');
  12523. },
  12524. apiuserauthinfo: function apiuserauthinfo(params) {// 用户认证 - 认证详情
  12525. return (0, _http.request)('api/user/auth/info', params, 'loading');
  12526. },
  12527. apiuploadcloudpiv: function apiuploadcloudpiv(params) {// 图片上传云接口
  12528. return (0, _http.request)('api/upload/cloudpiv', params, 'loading');
  12529. } };exports.default = _default;
  12530. /***/ }),
  12531. /***/ 43:
  12532. /*!************************************!*\
  12533. !*** E:/fp/md/mdapp/utils/http.js ***!
  12534. \************************************/
  12535. /*! no static exports found */
  12536. /***/ (function(module, exports, __webpack_require__) {
  12537. "use strict";
  12538. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.request = request;var _utils = __webpack_require__(/*! @utils */ 44);function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}
  12539. var Http = function Http() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { data: {} };
  12540. return new Promise(function (resolve, reject) {
  12541. if (options.loadingStr === 'loading') {
  12542. uni.showLoading({
  12543. mask: true,
  12544. title: '加载中..' });
  12545. }
  12546. var token = uni.getStorageSync('MD_token') || '';
  12547. var header = {
  12548. 'Content-Type': 'application/json',
  12549. 'token': token
  12550. // 'Content-Type': 'application/x-www-form-urlencoded'
  12551. };
  12552. var params = _objectSpread({}, options.data);
  12553. if (uni.getStorageSync('APP_token')) params.token = uni.getStorageSync('APP_token');
  12554. for (var key in options.data) {
  12555. if (options.data[key] === undefined || options.data[key] === 'undefined') {
  12556. params[key] = '';
  12557. }
  12558. }
  12559. var url = uni.baseUrl + options.url;
  12560. // let url = options.url
  12561. if (options.queryData) {
  12562. var qStr = '';
  12563. for (var k in options.queryData) {
  12564. qStr += "".concat(k, "=").concat(options.queryData[k], "&");
  12565. }
  12566. qStr = qStr.substr(0, qStr.length - 1);
  12567. url += "?".concat(qStr);
  12568. }
  12569. uni.request({
  12570. url: url,
  12571. data: _objectSpread({},
  12572. params),
  12573. header: header,
  12574. method: options.method || 'POST',
  12575. complete: function complete(res) {
  12576. if (options.loadingStr === 'loading') {
  12577. uni.hideLoading();
  12578. }
  12579. },
  12580. success: function success(res) {var
  12581. cData = res.data;
  12582. var code = cData.errno;
  12583. switch (code) {
  12584. case 0:
  12585. return resolve((0, _utils.noEmpty)(cData.data) ? cData.data : cData);
  12586. break;
  12587. case 401:
  12588. case 404:
  12589. case 405:
  12590. uni.removeStorageSync('MD_userInfo');
  12591. uni.removeStorageSync('MD_token');
  12592. // 差一个补是否绑定微信
  12593. if (uni.getStorageSync('APP_token')) {
  12594. uni.login({
  12595. success: function success(res) {
  12596. if (res.code) {
  12597. uni.api.base.apiwxautologin({ code: res.code }).then(function (cData) {
  12598. if (cData.token === 'error') {
  12599. uni.removeStorageSync('APP_token');
  12600. } else {
  12601. uni.setStorageSync('APP_userInfo', cData);
  12602. uni.setStorageSync('APP_token', cData.token);
  12603. }
  12604. });
  12605. }
  12606. } });
  12607. } else {
  12608. uni.showToast({
  12609. title: "\u8BF7\u5148\u767B\u5F55~",
  12610. icon: 'none' });
  12611. }
  12612. uni.navigateTo({
  12613. url: '/pages/user/login/login' });
  12614. break;
  12615. default:
  12616. uni.showModal({
  12617. title: '提示',
  12618. content: "".concat(cData.errmsg, "(").concat(code, ")") });
  12619. return reject(cData);}
  12620. // resolve()
  12621. },
  12622. fail: function fail(err) {
  12623. console.log(err);
  12624. reject(err);
  12625. } });
  12626. });
  12627. };
  12628. // export default Http
  12629. function request(url, data, loadingStr, queryData) {
  12630. return Http({
  12631. url: url,
  12632. data: data,
  12633. loadingStr: loadingStr,
  12634. queryData: queryData });
  12635. }
  12636. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  12637. /***/ }),
  12638. /***/ 44:
  12639. /*!*************************************!*\
  12640. !*** E:/fp/md/mdapp/utils/index.js ***!
  12641. \*************************************/
  12642. /*! no static exports found */
  12643. /***/ (function(module, exports, __webpack_require__) {
  12644. "use strict";
  12645. Object.defineProperty(exports, "__esModule", { value: true });exports.strTrim = strTrim;exports.numFormat3 = numFormat3;exports.arrToObj = arrToObj;exports.noEmpty = noEmpty;exports.comGetTime = comGetTime; /**
  12646. * @param {string} str
  12647. * @returns {string}
  12648. */
  12649. function strTrim(str) {
  12650. return str.replace(/(^\s*)|(\s*$)/g, '');
  12651. }
  12652. /**
  12653. * @param {Number} num
  12654. * @returns {string}
  12655. */
  12656. function numFormat3(num) {var dotNum = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
  12657. var numArr = Number(num).toFixed(dotNum).toString().split('.');
  12658. var arr = numArr[0].split('').reverse();
  12659. var res = [];
  12660. for (var i = 0; i < arr.length; i++) {
  12661. if (i % 3 === 0 && i !== 0) {
  12662. res.push(',');
  12663. }
  12664. res.push(arr[i]);
  12665. }
  12666. res.reverse();
  12667. if (numArr[1]) {
  12668. res = res.join('').concat('.' + numArr[1]);
  12669. } else {
  12670. res = res.join('');
  12671. }
  12672. // let res = num.toString().replace(/\d+/, function(n){
  12673. // return n.replace(/(\d)(?=(\d{3})+$)/g,function($1){
  12674. // return $1 + ","
  12675. // })
  12676. // })
  12677. // toLocaleString()
  12678. return res;
  12679. }
  12680. /**
  12681. * @param {Array} arr
  12682. * @returns {Object}
  12683. */
  12684. function arrToObj(arr) {
  12685. var obj = {};
  12686. if (Object.prototype.toString.call(arr) === '[object Array]') {
  12687. if (arr.length > 0) {
  12688. arr.forEach(function (item) {
  12689. obj[item.val] = item.key;
  12690. });
  12691. }
  12692. }
  12693. return obj;
  12694. }
  12695. /**
  12696. * @param {any} val
  12697. * @returns {Boolean}
  12698. */
  12699. function noEmpty(val) {
  12700. if (val === null || val === undefined || val === '') {
  12701. return false;
  12702. } else {
  12703. return true;
  12704. }
  12705. }
  12706. /**
  12707. * @param {Number} date
  12708. * @param {Boolean} onlyDate
  12709. * @returns {String}
  12710. * function time(time = +new Date()) {
  12711. var date = new Date(time + 8 * 3600 * 1000); // 增加8小时
  12712. return date.toJSON().substr(0, 19).replace('T', ' ');
  12713. }
  12714. */
  12715. function comGetTime() {var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Date();var onlyDate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  12716. var year = date.getFullYear();
  12717. var month = date.getMonth() + 1;
  12718. month = month > 9 ? month : '0' + month;
  12719. var day = date.getDate();
  12720. day = day > 9 ? day : '0' + day;
  12721. var hour = date.getHours();
  12722. hour = hour > 9 ? hour : '0' + hour;
  12723. var minute = date.getMinutes();
  12724. minute = minute > 9 ? minute : '0' + minute;
  12725. var second = date.getSeconds();
  12726. second = second > 9 ? second : '0' + second;
  12727. var milli = date.getMilliseconds();
  12728. milli = milli > 100 ? milli : milli > 10 ? '0' + milli : '00' + milli;
  12729. return onlyDate ? "".concat(year, "-").concat(month, "-").concat(day) : "".concat(year).concat(month).concat(day).concat(hour).concat(minute).concat(second).concat(milli);
  12730. }
  12731. /***/ }),
  12732. /***/ 45:
  12733. /*!************************************!*\
  12734. !*** E:/fp/md/mdapp/api/estate.js ***!
  12735. \************************************/
  12736. /*! no static exports found */
  12737. /***/ (function(module, exports, __webpack_require__) {
  12738. "use strict";
  12739. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _http = __webpack_require__(/*! @/utils/http */ 43);var _default =
  12740. {
  12741. apiestatelist: function apiestatelist(params) {// 楼盘列表
  12742. return (0, _http.request)('api/estate/list', params, 'loading');
  12743. },
  12744. apireportadd: function apireportadd(params) {// 报备 - 添加报备
  12745. return (0, _http.request)('api/report/add', params, 'loading');
  12746. },
  12747. apireportlist: function apireportlist(params) {// 报备 - 报备列表
  12748. return (0, _http.request)('api/report/list', params, 'loading');
  12749. },
  12750. apireportdetail: function apireportdetail(params) {// 报备 - 报备详情
  12751. return (0, _http.request)('api/report/detail', params, 'loading');
  12752. },
  12753. apireportsite: function apireportsite(params) {// 案场 - 报备详情
  12754. return (0, _http.request)('api/report/site', params, 'loading');
  12755. },
  12756. apireportconfirm: function apireportconfirm(params) {// 报备 - 报备确认
  12757. return (0, _http.request)('api/report/confirm', params, 'loading');
  12758. },
  12759. apireportcount: function apireportcount(params) {// 报备 - 报备统计
  12760. return (0, _http.request)('api/report/count', params, 'loading');
  12761. } };exports.default = _default;
  12762. /***/ }),
  12763. /***/ 46:
  12764. /*!**********************************!*\
  12765. !*** E:/fp/md/mdapp/api/cust.js ***!
  12766. \**********************************/
  12767. /*! no static exports found */
  12768. /***/ (function(module, exports, __webpack_require__) {
  12769. "use strict";
  12770. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _http = __webpack_require__(/*! @/utils/http */ 43);var _default =
  12771. {
  12772. apicustomerlist: function apicustomerlist(params) {// 客户 列表
  12773. return (0, _http.request)('api/customer/list', params);
  12774. },
  12775. apicustomeradd: function apicustomeradd(params) {// 客户 添加
  12776. return (0, _http.request)('api/customer/add', params, 'loading');
  12777. },
  12778. apicustomeredit: function apicustomeredit(params) {// 客户 编辑
  12779. return (0, _http.request)('api/customer/edit', params, 'loading');
  12780. },
  12781. apicustomerdel: function apicustomerdel(params) {// 客户 删除
  12782. return (0, _http.request)('api/customer/del', params, 'loading');
  12783. },
  12784. apicustomerdetail: function apicustomerdetail(params) {// 客户 详情
  12785. return (0, _http.request)('api/customer/detail', params, 'loading');
  12786. } };exports.default = _default;
  12787. /***/ }),
  12788. /***/ 47:
  12789. /*!************************************!*\
  12790. !*** E:/fp/md/mdapp/utils/tool.js ***!
  12791. \************************************/
  12792. /*! no static exports found */
  12793. /***/ (function(module, exports, __webpack_require__) {
  12794. "use strict";
  12795. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.getRandomNum = exports.confirmMsgFn = exports.msgBase = void 0;var getRandomNum = function getRandomNum(len, radix) {
  12796. // getRandomNum(24, 16)
  12797. var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
  12798. var uuid = [];
  12799. radix = radix || chars.length;
  12800. if (len) {
  12801. // Compact form
  12802. for (var i = 0; i < len; i++) {uuid[i] = chars[0 | Math.random() * radix];}
  12803. } else {
  12804. // rfc4122, version 4 form
  12805. var r;
  12806. // rfc4122 requires these characters
  12807. uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
  12808. uuid[14] = '4';
  12809. // Fill in random data.  At i==19 set the high bits of clock sequence as
  12810. // per rfc4122, sec. 4.1.5
  12811. for (var _i = 0; _i < 36; _i++) {
  12812. if (!uuid[_i]) {
  12813. r = 0 | Math.random() * 16;
  12814. uuid[_i] = chars[_i === 19 ? r & 0x3 | 0x8 : r];
  12815. }
  12816. }
  12817. }
  12818. return uuid.join('') + new Date().getTime();
  12819. };exports.getRandomNum = getRandomNum;
  12820. var msgBase = function msgBase(msgText, bc) {
  12821. uni.showToast({
  12822. title: msgText,
  12823. icon: 'none',
  12824. duration: 2000 }).
  12825. then(function () {
  12826. if (bc) bc();
  12827. });
  12828. };exports.msgBase = msgBase;
  12829. var confirmMsgFn = function confirmMsgFn(msgText, successBc, errorBc) {var title = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '提示';
  12830. uni.showModal({
  12831. title: title,
  12832. content: msgText,
  12833. success: function success(res) {
  12834. if (res.confirm) {
  12835. if (successBc) successBc();
  12836. } else if (res.cancel) {
  12837. if (errorBc) errorBc();
  12838. }
  12839. } });
  12840. };exports.confirmMsgFn = confirmMsgFn;
  12841. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  12842. /***/ }),
  12843. /***/ 5:
  12844. /*!*********************************!*\
  12845. !*** E:/fp/md/mdapp/pages.json ***!
  12846. \*********************************/
  12847. /*! no static exports found */
  12848. /***/ (function(module, exports) {
  12849. /***/ }),
  12850. /***/ 94:
  12851. /*!**************************************!*\
  12852. !*** E:/fp/md/mdapp/utils/qrcode.js ***!
  12853. \**************************************/
  12854. /*! no static exports found */
  12855. /***/ (function(module, exports, __webpack_require__) {
  12856. "use strict";
  12857. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;} /**
  12858. * qrcode-wx-miniprogram
  12859. */
  12860. var QRMode = {
  12861. MODE_NUMBER: 1 << 0,
  12862. MODE_ALPHA_NUM: 1 << 1,
  12863. MODE_8BIT_BYTE: 1 << 2,
  12864. MODE_KANJI: 1 << 3 },
  12865. QRErrorCorrectLevel = {
  12866. L: 1,
  12867. M: 0,
  12868. Q: 3,
  12869. H: 2 },
  12870. QRMaskPattern = {
  12871. PATTERN000: 0,
  12872. PATTERN001: 1,
  12873. PATTERN010: 2,
  12874. PATTERN011: 3,
  12875. PATTERN100: 4,
  12876. PATTERN101: 5,
  12877. PATTERN110: 6,
  12878. PATTERN111: 7 },
  12879. QRUtil = {
  12880. PATTERN_POSITION_TABLE: [
  12881. [],
  12882. [6, 18],
  12883. [6, 22],
  12884. [6, 26],
  12885. [6, 30],
  12886. [6, 34],
  12887. [6, 22, 38],
  12888. [6, 24, 42],
  12889. [6, 26, 46],
  12890. [6, 28, 50],
  12891. [6, 30, 54],
  12892. [6, 32, 58],
  12893. [6, 34, 62],
  12894. [6, 26, 46, 66],
  12895. [6, 26, 48, 70],
  12896. [6, 26, 50, 74],
  12897. [6, 30, 54, 78],
  12898. [6, 30, 56, 82],
  12899. [6, 30, 58, 86],
  12900. [6, 34, 62, 90],
  12901. [6, 28, 50, 72, 94],
  12902. [6, 26, 50, 74, 98],
  12903. [6, 30, 54, 78, 102],
  12904. [6, 28, 54, 80, 106],
  12905. [6, 32, 58, 84, 110],
  12906. [6, 30, 58, 86, 114],
  12907. [6, 34, 62, 90, 118],
  12908. [6, 26, 50, 74, 98, 122],
  12909. [6, 30, 54, 78, 102, 126],
  12910. [6, 26, 52, 78, 104, 130],
  12911. [6, 30, 56, 82, 108, 134],
  12912. [6, 34, 60, 86, 112, 138],
  12913. [6, 30, 58, 86, 114, 142],
  12914. [6, 34, 62, 90, 118, 146],
  12915. [6, 30, 54, 78, 102, 126, 150],
  12916. [6, 24, 50, 76, 102, 128, 154],
  12917. [6, 28, 54, 80, 106, 132, 158],
  12918. [6, 32, 58, 84, 110, 136, 162],
  12919. [6, 26, 54, 82, 110, 138, 166],
  12920. [6, 30, 58, 86, 114, 142, 170]],
  12921. G15: 1 << 10 | 1 << 8 | 1 << 5 | 1 << 4 | 1 << 2 | 1 << 1 | 1 << 0,
  12922. G18: 1 << 12 | 1 << 11 | 1 << 10 | 1 << 9 | 1 << 8 | 1 << 5 | 1 << 2 | 1 << 0,
  12923. G15_MASK: 1 << 14 | 1 << 12 | 1 << 10 | 1 << 4 | 1 << 1,
  12924. getBCHTypeInfo: function getBCHTypeInfo(data) {
  12925. var d = data << 10;
  12926. while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15) >= 0) {
  12927. d ^= QRUtil.G15 << QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15);
  12928. }
  12929. return (data << 10 | d) ^ QRUtil.G15_MASK;
  12930. },
  12931. getBCHTypeNumber: function getBCHTypeNumber(data) {
  12932. var d = data << 12;
  12933. while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18) >= 0) {
  12934. d ^= QRUtil.G18 << QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18);
  12935. }
  12936. return data << 12 | d;
  12937. },
  12938. getBCHDigit: function getBCHDigit(data) {
  12939. var digit = 0;
  12940. while (data != 0) {
  12941. digit++;
  12942. data >>>= 1;
  12943. }
  12944. return digit;
  12945. },
  12946. getPatternPosition: function getPatternPosition(typeNumber) {
  12947. return QRUtil.PATTERN_POSITION_TABLE[typeNumber - 1];
  12948. },
  12949. getMask: function getMask(maskPattern, i, j) {
  12950. switch (maskPattern) {
  12951. case QRMaskPattern.PATTERN000:
  12952. return (i + j) % 2 == 0;
  12953. case QRMaskPattern.PATTERN001:
  12954. return i % 2 == 0;
  12955. case QRMaskPattern.PATTERN010:
  12956. return j % 3 == 0;
  12957. case QRMaskPattern.PATTERN011:
  12958. return (i + j) % 3 == 0;
  12959. case QRMaskPattern.PATTERN100:
  12960. return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 == 0;
  12961. case QRMaskPattern.PATTERN101:
  12962. return i * j % 2 + i * j % 3 == 0;
  12963. case QRMaskPattern.PATTERN110:
  12964. return (i * j % 2 + i * j % 3) % 2 == 0;
  12965. case QRMaskPattern.PATTERN111:
  12966. return (i * j % 3 + (i + j) % 2) % 2 == 0;
  12967. default:
  12968. //throw new Error("bad maskPattern:" + maskPattern);
  12969. throwError("bad maskPattern:" + maskPattern);}
  12970. },
  12971. getErrorCorrectPolynomial: function getErrorCorrectPolynomial(errorCorrectLength) {
  12972. var a = new QRPolynomial([1], 0);
  12973. for (var i = 0; i < errorCorrectLength; i++) {
  12974. a = a.multiply(new QRPolynomial([1, QRMath.gexp(i)], 0));
  12975. }
  12976. return a;
  12977. },
  12978. getLengthInBits: function getLengthInBits(mode, type) {
  12979. if (1 <= type && type < 10) {
  12980. switch (mode) {
  12981. case QRMode.MODE_NUMBER:
  12982. return 10;
  12983. case QRMode.MODE_ALPHA_NUM:
  12984. return 9;
  12985. case QRMode.MODE_8BIT_BYTE:
  12986. return 8;
  12987. case QRMode.MODE_KANJI:
  12988. return 8;
  12989. default:
  12990. //throw new Error("mode:" + mode);
  12991. throwError("mode:" + mode);}
  12992. } else if (type < 27) {
  12993. switch (mode) {
  12994. case QRMode.MODE_NUMBER:
  12995. return 12;
  12996. case QRMode.MODE_ALPHA_NUM:
  12997. return 11;
  12998. case QRMode.MODE_8BIT_BYTE:
  12999. return 16;
  13000. case QRMode.MODE_KANJI:
  13001. return 10;
  13002. default:
  13003. //throw new Error("mode:" + mode);
  13004. throwError("mode:" + mode);}
  13005. } else if (type < 41) {
  13006. switch (mode) {
  13007. case QRMode.MODE_NUMBER:
  13008. return 14;
  13009. case QRMode.MODE_ALPHA_NUM:
  13010. return 13;
  13011. case QRMode.MODE_8BIT_BYTE:
  13012. return 16;
  13013. case QRMode.MODE_KANJI:
  13014. return 12;
  13015. default:
  13016. //throw new Error("mode:" + mode);
  13017. throwError("mode:" + mode);}
  13018. } else {
  13019. //throw new Error("type:" + type);
  13020. throwError("type:" + type);
  13021. }
  13022. },
  13023. getLostPoint: function getLostPoint(qrCode) {
  13024. var moduleCount = qrCode.getModuleCount();
  13025. var lostPoint = 0;
  13026. for (var row = 0; row < moduleCount; row++) {
  13027. for (var col = 0; col < moduleCount; col++) {
  13028. var sameCount = 0;
  13029. var dark = qrCode.isDark(row, col);
  13030. for (var r = -1; r <= 1; r++) {
  13031. if (row + r < 0 || moduleCount <= row + r) {
  13032. continue;
  13033. }
  13034. for (var c = -1; c <= 1; c++) {
  13035. if (col + c < 0 || moduleCount <= col + c) {
  13036. continue;
  13037. }
  13038. if (r == 0 && c == 0) {
  13039. continue;
  13040. }
  13041. if (dark == qrCode.isDark(row + r, col + c)) {
  13042. sameCount++;
  13043. }
  13044. }
  13045. }
  13046. if (sameCount > 5) {
  13047. lostPoint += 3 + sameCount - 5;
  13048. }
  13049. }
  13050. }
  13051. for (var row = 0; row < moduleCount - 1; row++) {
  13052. for (var col = 0; col < moduleCount - 1; col++) {
  13053. var count = 0;
  13054. if (qrCode.isDark(row, col)) count++;
  13055. if (qrCode.isDark(row + 1, col)) count++;
  13056. if (qrCode.isDark(row, col + 1)) count++;
  13057. if (qrCode.isDark(row + 1, col + 1)) count++;
  13058. if (count == 0 || count == 4) {
  13059. lostPoint += 3;
  13060. }
  13061. }
  13062. }
  13063. for (var row = 0; row < moduleCount; row++) {
  13064. for (var col = 0; col < moduleCount - 6; col++) {
  13065. if (qrCode.isDark(row, col) && !qrCode.isDark(row, col + 1) && qrCode.isDark(row, col + 2) &&
  13066. qrCode.isDark(row, col + 3) && qrCode.isDark(row, col + 4) && !qrCode.isDark(row, col +
  13067. 5) && qrCode.isDark(row, col + 6)) {
  13068. lostPoint += 40;
  13069. }
  13070. }
  13071. }
  13072. for (var col = 0; col < moduleCount; col++) {
  13073. for (var row = 0; row < moduleCount - 6; row++) {
  13074. if (qrCode.isDark(row, col) && !qrCode.isDark(row + 1, col) && qrCode.isDark(row + 2, col) &&
  13075. qrCode.isDark(row + 3, col) && qrCode.isDark(row + 4, col) && !qrCode.isDark(row + 5,
  13076. col) && qrCode.isDark(row + 6, col)) {
  13077. lostPoint += 40;
  13078. }
  13079. }
  13080. }
  13081. var darkCount = 0;
  13082. for (var col = 0; col < moduleCount; col++) {
  13083. for (var row = 0; row < moduleCount; row++) {
  13084. if (qrCode.isDark(row, col)) {
  13085. darkCount++;
  13086. }
  13087. }
  13088. }
  13089. var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5;
  13090. lostPoint += ratio * 10;
  13091. return lostPoint;
  13092. } },
  13093. QRMath = {
  13094. glog: function glog(n) {
  13095. if (n < 1) {
  13096. //throw new Error("glog(" + n + ")");
  13097. throwError("glog(" + n + ")");
  13098. }
  13099. return QRMath.LOG_TABLE[n];
  13100. },
  13101. gexp: function gexp(n) {
  13102. while (n < 0) {
  13103. n += 255;
  13104. }
  13105. while (n >= 256) {
  13106. n -= 255;
  13107. }
  13108. return QRMath.EXP_TABLE[n];
  13109. },
  13110. EXP_TABLE: new Array(256),
  13111. LOG_TABLE: new Array(256) };
  13112. for (var i = 0; i < 8; i++) {
  13113. QRMath.EXP_TABLE[i] = 1 << i;
  13114. }
  13115. for (var _i = 8; _i < 256; _i++) {
  13116. QRMath.EXP_TABLE[_i] = QRMath.EXP_TABLE[_i - 4] ^ QRMath.EXP_TABLE[_i - 5] ^ QRMath.EXP_TABLE[_i - 6] ^ QRMath.
  13117. EXP_TABLE[_i - 8];
  13118. }
  13119. for (var _i2 = 0; _i2 < 255; _i2++) {
  13120. QRMath.LOG_TABLE[QRMath.EXP_TABLE[_i2]] = _i2;
  13121. }
  13122. /*
  13123. * class QR8bitByte
  13124. * */var
  13125. QR8bitByte = /*#__PURE__*/function () {
  13126. function QR8bitByte(data) {_classCallCheck(this, QR8bitByte);
  13127. this.mode = QRMode.MODE_8BIT_BYTE;
  13128. this.data = data;
  13129. this.parsedData = [];
  13130. // Added to support UTF-8 Characters
  13131. for (var _i3 = 0, l = this.data.length; _i3 < l; _i3++) {
  13132. var byteArray = [],
  13133. code = this.data.charCodeAt(_i3);
  13134. if (code > 0x10000) {
  13135. byteArray[0] = 0xF0 | (code & 0x1C0000) >>> 18;
  13136. byteArray[1] = 0x80 | (code & 0x3F000) >>> 12;
  13137. byteArray[2] = 0x80 | (code & 0xFC0) >>> 6;
  13138. byteArray[3] = 0x80 | code & 0x3F;
  13139. } else if (code > 0x800) {
  13140. byteArray[0] = 0xE0 | (code & 0xF000) >>> 12;
  13141. byteArray[1] = 0x80 | (code & 0xFC0) >>> 6;
  13142. byteArray[2] = 0x80 | code & 0x3F;
  13143. } else if (code > 0x80) {
  13144. byteArray[0] = 0xC0 | (code & 0x7C0) >>> 6;
  13145. byteArray[1] = 0x80 | code & 0x3F;
  13146. } else {
  13147. byteArray[0] = code;
  13148. }
  13149. this.parsedData.push(byteArray);
  13150. }
  13151. this.parsedData = Array.prototype.concat.apply([], this.parsedData);
  13152. if (this.parsedData.length !== this.data.length) {
  13153. this.parsedData.unshift(191);
  13154. this.parsedData.unshift(187);
  13155. this.parsedData.unshift(239);
  13156. }
  13157. }_createClass(QR8bitByte, [{ key: "getLength", value: function getLength(
  13158. buffer) {
  13159. return this.parsedData.length;
  13160. } }, { key: "write", value: function write(
  13161. buffer) {
  13162. for (var _i4 = 0, l = this.parsedData.length; _i4 < l; _i4++) {
  13163. buffer.put(this.parsedData[_i4], 8);
  13164. }
  13165. } }]);return QR8bitByte;}();
  13166. /*
  13167. * class QRCodeModel
  13168. * */var
  13169. QRCodeModel = /*#__PURE__*/function () {
  13170. function QRCodeModel(typeNumber, errorCorrectLevel) {_classCallCheck(this, QRCodeModel);
  13171. this.typeNumber = typeNumber;
  13172. this.errorCorrectLevel = errorCorrectLevel;
  13173. this.modules = null;
  13174. this.moduleCount = 0;
  13175. this.dataCache = null;
  13176. this.dataList = [];
  13177. }_createClass(QRCodeModel, [{ key: "addData", value: function addData(
  13178. data) {
  13179. var newData = new QR8bitByte(data);
  13180. this.dataList.push(newData);
  13181. this.dataCache = null;
  13182. } }, { key: "isDark", value: function isDark(
  13183. row, col) {
  13184. if (row < 0 || this.moduleCount <= row || col < 0 || this.moduleCount <= col) {
  13185. //throw new Error(row + ',' + col);
  13186. throwError(row + ',' + col);
  13187. }
  13188. return this.modules[row][col];
  13189. } }, { key: "getModuleCount", value: function getModuleCount()
  13190. {
  13191. return this.moduleCount;
  13192. } }, { key: "make", value: function make()
  13193. {
  13194. this.makeImpl(false, this.getBestMaskPattern());
  13195. } }, { key: "makeImpl", value: function makeImpl(
  13196. test, maskPattern) {
  13197. this.moduleCount = this.typeNumber * 4 + 17;
  13198. this.modules = new Array(this.moduleCount);
  13199. for (var row = 0; row < this.moduleCount; row++) {
  13200. this.modules[row] = new Array(this.moduleCount);
  13201. for (var col = 0; col < this.moduleCount; col++) {
  13202. this.modules[row][col] = null;
  13203. }
  13204. }
  13205. this.setupPositionProbePattern(0, 0);
  13206. this.setupPositionProbePattern(this.moduleCount - 7, 0);
  13207. this.setupPositionProbePattern(0, this.moduleCount - 7);
  13208. this.setupPositionAdjustPattern();
  13209. this.setupTimingPattern();
  13210. this.setupTypeInfo(test, maskPattern);
  13211. if (this.typeNumber >= 7) {
  13212. this.setupTypeNumber(test);
  13213. }
  13214. if (this.dataCache == null) {
  13215. this.dataCache = QRCodeModel.createData(this.typeNumber, this.errorCorrectLevel, this.dataList);
  13216. }
  13217. this.mapData(this.dataCache, maskPattern);
  13218. } }, { key: "setupPositionProbePattern", value: function setupPositionProbePattern(
  13219. row, col) {
  13220. for (var r = -1; r <= 7; r++) {
  13221. if (row + r <= -1 || this.moduleCount <= row + r) {
  13222. continue;
  13223. }
  13224. for (var c = -1; c <= 7; c++) {
  13225. if (col + c <= -1 || this.moduleCount <= col + c) {
  13226. continue;
  13227. }
  13228. this.modules[row + r][col + c] = 0 <= r && r <= 6 && (c == 0 || c == 6) ||
  13229. 0 <= c && c <= 6 && (r == 0 || r == 6) || 2 <= r && r <= 4 && 2 <= c && c <= 4;
  13230. }
  13231. }
  13232. } }, { key: "getBestMaskPattern", value: function getBestMaskPattern()
  13233. {
  13234. var minLostPoint = 0,
  13235. pattern = 0;
  13236. for (var _i5 = 0; _i5 < 8; _i5++) {
  13237. this.makeImpl(true, _i5);
  13238. var lostPoint = QRUtil.getLostPoint(this);
  13239. if (_i5 == 0 || minLostPoint > lostPoint) {
  13240. minLostPoint = lostPoint;
  13241. pattern = _i5;
  13242. }
  13243. }
  13244. return pattern;
  13245. } }, { key: "setupTimingPattern", value: function setupTimingPattern()
  13246. {
  13247. for (var r = 8; r < this.moduleCount - 8; r++) {
  13248. if (this.modules[r][6] != null) {
  13249. continue;
  13250. }
  13251. this.modules[r][6] = r % 2 == 0;
  13252. }
  13253. for (var c = 8; c < this.moduleCount - 8; c++) {
  13254. if (this.modules[6][c] != null) {
  13255. continue;
  13256. }
  13257. this.modules[6][c] = c % 2 == 0;
  13258. }
  13259. } }, { key: "setupPositionAdjustPattern", value: function setupPositionAdjustPattern()
  13260. {
  13261. var pos = QRUtil.getPatternPosition(this.typeNumber);
  13262. for (var _i6 = 0; _i6 < pos.length; _i6++) {
  13263. for (var j = 0; j < pos.length; j++) {
  13264. var row = pos[_i6],
  13265. col = pos[j];
  13266. if (this.modules[row][col] != null) {
  13267. continue;
  13268. }
  13269. for (var r = -2; r <= 2; r++) {
  13270. for (var c = -2; c <= 2; c++) {
  13271. this.modules[row + r][col + c] = r == -2 || r == 2 || c == -2 || c == 2 || r == 0 && c ==
  13272. 0;
  13273. }
  13274. }
  13275. }
  13276. }
  13277. } }, { key: "setupTypeNumber", value: function setupTypeNumber(
  13278. test) {
  13279. var bits = QRUtil.getBCHTypeNumber(this.typeNumber);
  13280. for (var _i7 = 0; _i7 < 18; _i7++) {
  13281. this.modules[Math.floor(_i7 / 3)][_i7 % 3 + this.moduleCount - 8 - 3] = !test && (bits >> _i7 & 1) == 1;
  13282. }
  13283. for (var _i8 = 0; _i8 < 18; _i8++) {
  13284. this.modules[_i8 % 3 + this.moduleCount - 8 - 3][Math.floor(_i8 / 3)] = !test && (bits >> _i8 & 1) == 1;
  13285. }
  13286. } }, { key: "setupTypeInfo", value: function setupTypeInfo(
  13287. test, maskPattern) {
  13288. var data = this.errorCorrectLevel << 3 | maskPattern,
  13289. bits = QRUtil.getBCHTypeInfo(data);
  13290. for (var _i9 = 0; _i9 < 15; _i9++) {
  13291. var mod = !test && (bits >> _i9 & 1) == 1;
  13292. if (_i9 < 6) {
  13293. this.modules[_i9][8] = mod;
  13294. } else if (_i9 < 8) {
  13295. this.modules[_i9 + 1][8] = mod;
  13296. } else {
  13297. this.modules[this.moduleCount - 15 + _i9][8] = mod;
  13298. }
  13299. }
  13300. for (var _i10 = 0; _i10 < 15; _i10++) {
  13301. var _mod = !test && (bits >> _i10 & 1) == 1;
  13302. if (_i10 < 8) {
  13303. this.modules[8][this.moduleCount - _i10 - 1] = _mod;
  13304. } else if (_i10 < 9) {
  13305. this.modules[8][15 - _i10 - 1 + 1] = _mod;
  13306. } else {
  13307. this.modules[8][15 - _i10 - 1] = _mod;
  13308. }
  13309. }
  13310. this.modules[this.moduleCount - 8][8] = !test;
  13311. } }, { key: "mapData", value: function mapData(
  13312. data, maskPattern) {
  13313. var inc = -1,
  13314. row = this.moduleCount - 1,
  13315. bitIndex = 7,
  13316. byteIndex = 0;
  13317. for (var col = this.moduleCount - 1; col > 0; col -= 2) {
  13318. if (col == 6) col--;
  13319. while (true) {
  13320. for (var c = 0; c < 2; c++) {
  13321. if (this.modules[row][col - c] == null) {
  13322. var dark = false;
  13323. if (byteIndex < data.length) {
  13324. dark = (data[byteIndex] >>> bitIndex & 1) == 1;
  13325. }
  13326. var mask = QRUtil.getMask(maskPattern, row, col - c);
  13327. if (mask) {
  13328. dark = !dark;
  13329. }
  13330. this.modules[row][col - c] = dark;
  13331. bitIndex--;
  13332. if (bitIndex == -1) {
  13333. byteIndex++;
  13334. bitIndex = 7;
  13335. }
  13336. }
  13337. }
  13338. row += inc;
  13339. if (row < 0 || this.moduleCount <= row) {
  13340. row -= inc;
  13341. inc = -inc;
  13342. break;
  13343. }
  13344. }
  13345. }
  13346. } }]);return QRCodeModel;}();
  13347. QRCodeModel.PAD0 = 0xEC;
  13348. QRCodeModel.PAD1 = 0x11;
  13349. QRCodeModel.createData = function (typeNumber, errorCorrectLevel, dataList) {
  13350. var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, errorCorrectLevel),
  13351. buffer = new QRBitBuffer();
  13352. for (var _i11 = 0; _i11 < dataList.length; _i11++) {
  13353. var data = dataList[_i11];
  13354. buffer.put(data.mode, 4);
  13355. buffer.put(data.getLength(), QRUtil.getLengthInBits(data.mode, typeNumber));
  13356. data.write(buffer);
  13357. }
  13358. var totalDataCount = 0;
  13359. for (var _i12 = 0; _i12 < rsBlocks.length; _i12++) {
  13360. totalDataCount += rsBlocks[_i12].dataCount;
  13361. }
  13362. if (buffer.getLengthInBits() > totalDataCount * 8) {
  13363. /*
  13364. throw new Error("code length overflow. (" +
  13365. buffer.getLengthInBits() +
  13366. ">" +
  13367. totalDataCount * 8 +
  13368. ")");
  13369. */
  13370. throwError("code length overflow. (" +
  13371. buffer.getLengthInBits() +
  13372. ">" +
  13373. totalDataCount * 8 +
  13374. ")");
  13375. }
  13376. if (buffer.getLengthInBits() + 4 <= totalDataCount * 8) {
  13377. buffer.put(0, 4);
  13378. }
  13379. while (buffer.getLengthInBits() % 8 != 0) {
  13380. buffer.putBit(false);
  13381. }
  13382. while (true) {
  13383. if (buffer.getLengthInBits() >= totalDataCount * 8) {
  13384. break;
  13385. }
  13386. buffer.put(QRCodeModel.PAD0, 8);
  13387. if (buffer.getLengthInBits() >= totalDataCount * 8) {
  13388. break;
  13389. }
  13390. buffer.put(QRCodeModel.PAD1, 8);
  13391. }
  13392. return QRCodeModel.createBytes(buffer, rsBlocks);
  13393. };
  13394. QRCodeModel.createBytes = function (buffer, rsBlocks) {
  13395. var offset = 0,
  13396. maxDcCount = 0,
  13397. maxEcCount = 0,
  13398. dcData = new Array(rsBlocks.length),
  13399. ecData = new Array(rsBlocks.length);
  13400. for (var r = 0; r < rsBlocks.length; r++) {
  13401. var dcCount = rsBlocks[r].dataCount,
  13402. ecCount = rsBlocks[r].totalCount - dcCount;
  13403. maxDcCount = Math.max(maxDcCount, dcCount);
  13404. maxEcCount = Math.max(maxEcCount, ecCount);
  13405. dcData[r] = new Array(dcCount);
  13406. for (var _i13 = 0; _i13 < dcData[r].length; _i13++) {
  13407. dcData[r][_i13] = 0xff & buffer.buffer[_i13 + offset];
  13408. }
  13409. offset += dcCount;
  13410. var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount),
  13411. rawPoly = new QRPolynomial(dcData[r], rsPoly.getLength() - 1),
  13412. modPoly = rawPoly.mod(rsPoly);
  13413. ecData[r] = new Array(rsPoly.getLength() - 1);
  13414. for (var _i14 = 0; _i14 < ecData[r].length; _i14++) {
  13415. var modIndex = _i14 + modPoly.getLength() - ecData[r].length;
  13416. ecData[r][_i14] = modIndex >= 0 ? modPoly.get(modIndex) : 0;
  13417. }
  13418. }
  13419. var totalCodeCount = 0;
  13420. for (var _i15 = 0; _i15 < rsBlocks.length; _i15++) {
  13421. totalCodeCount += rsBlocks[_i15].totalCount;
  13422. }
  13423. var data = new Array(totalCodeCount),
  13424. index = 0;
  13425. for (var _i16 = 0; _i16 < maxDcCount; _i16++) {
  13426. for (var _r = 0; _r < rsBlocks.length; _r++) {
  13427. if (_i16 < dcData[_r].length) {
  13428. data[index++] = dcData[_r][_i16];
  13429. }
  13430. }
  13431. }
  13432. for (var _i17 = 0; _i17 < maxEcCount; _i17++) {
  13433. for (var _r2 = 0; _r2 < rsBlocks.length; _r2++) {
  13434. if (_i17 < ecData[_r2].length) {
  13435. data[index++] = ecData[_r2][_i17];
  13436. }
  13437. }
  13438. }
  13439. return data;
  13440. };
  13441. /*
  13442. * class QRPolynomial
  13443. * */var
  13444. QRPolynomial = /*#__PURE__*/function () {
  13445. function QRPolynomial(num, shift) {_classCallCheck(this, QRPolynomial);
  13446. if (num.length == undefined) {
  13447. //throw new Error(num.length + '/' + shift);
  13448. throwError(num.length + '/' + shift);
  13449. }
  13450. var offset = 0;
  13451. while (offset < num.length && num[offset] == 0) {
  13452. offset++;
  13453. }
  13454. this.num = new Array(num.length - offset + shift);
  13455. for (var _i18 = 0; _i18 < num.length - offset; _i18++) {
  13456. this.num[_i18] = num[_i18 + offset];
  13457. }
  13458. }_createClass(QRPolynomial, [{ key: "get", value: function get(
  13459. index) {
  13460. return this.num[index];
  13461. } }, { key: "getLength", value: function getLength()
  13462. {
  13463. return this.num.length;
  13464. } }, { key: "multiply", value: function multiply(
  13465. e) {
  13466. var num = new Array(this.getLength() + e.getLength() - 1);
  13467. for (var _i19 = 0; _i19 < this.getLength(); _i19++) {
  13468. for (var j = 0; j < e.getLength(); j++) {
  13469. num[_i19 + j] ^= QRMath.gexp(QRMath.glog(this.get(_i19)) + QRMath.glog(e.get(j)));
  13470. }
  13471. }
  13472. return new QRPolynomial(num, 0);
  13473. } }, { key: "mod", value: function mod(
  13474. e) {
  13475. if (this.getLength() - e.getLength() < 0) {
  13476. return this;
  13477. }
  13478. var ratio = QRMath.glog(this.get(0)) - QRMath.glog(e.get(0)),
  13479. num = new Array(this.getLength());
  13480. for (var _i20 = 0; _i20 < this.getLength(); _i20++) {
  13481. num[_i20] = this.get(_i20);
  13482. }
  13483. for (var _i21 = 0; _i21 < e.getLength(); _i21++) {
  13484. num[_i21] ^= QRMath.gexp(QRMath.glog(e.get(_i21)) + ratio);
  13485. }
  13486. return new QRPolynomial(num, 0).mod(e);
  13487. } }]);return QRPolynomial;}();
  13488. /*
  13489. * class QRRSBlock
  13490. * */var
  13491. QRRSBlock =
  13492. function QRRSBlock(totalCount, dataCount) {_classCallCheck(this, QRRSBlock);
  13493. this.totalCount = totalCount;
  13494. this.dataCount = dataCount;
  13495. };
  13496. QRRSBlock.RS_BLOCK_TABLE = [
  13497. [1, 26, 19],
  13498. [1, 26, 16],
  13499. [1, 26, 13],
  13500. [1, 26, 9],
  13501. [1, 44, 34],
  13502. [1, 44, 28],
  13503. [1, 44, 22],
  13504. [1, 44, 16],
  13505. [1, 70, 55],
  13506. [1, 70, 44],
  13507. [2, 35, 17],
  13508. [2, 35, 13],
  13509. [1, 100, 80],
  13510. [2, 50, 32],
  13511. [2, 50, 24],
  13512. [4, 25, 9],
  13513. [1, 134, 108],
  13514. [2, 67, 43],
  13515. [2, 33, 15, 2, 34, 16],
  13516. [2, 33, 11, 2, 34, 12],
  13517. [2, 86, 68],
  13518. [4, 43, 27],
  13519. [4, 43, 19],
  13520. [4, 43, 15],
  13521. [2, 98, 78],
  13522. [4, 49, 31],
  13523. [2, 32, 14, 4, 33, 15],
  13524. [4, 39, 13, 1, 40, 14],
  13525. [2, 121, 97],
  13526. [2, 60, 38, 2, 61, 39],
  13527. [4, 40, 18, 2, 41, 19],
  13528. [4, 40, 14, 2, 41, 15],
  13529. [2, 146, 116],
  13530. [3, 58, 36, 2, 59, 37],
  13531. [4, 36, 16, 4, 37, 17],
  13532. [4, 36, 12, 4, 37, 13],
  13533. [2, 86, 68, 2, 87, 69],
  13534. [4, 69, 43, 1, 70, 44],
  13535. [6, 43, 19, 2, 44, 20],
  13536. [6, 43, 15, 2, 44, 16],
  13537. [4, 101, 81],
  13538. [1, 80, 50, 4, 81, 51],
  13539. [4, 50, 22, 4, 51, 23],
  13540. [3, 36, 12, 8, 37, 13],
  13541. [2, 116, 92, 2, 117, 93],
  13542. [6, 58, 36, 2, 59, 37],
  13543. [4, 46, 20, 6, 47, 21],
  13544. [7, 42, 14, 4, 43, 15],
  13545. [4, 133, 107],
  13546. [8, 59, 37, 1, 60, 38],
  13547. [8, 44, 20, 4, 45, 21],
  13548. [12, 33, 11, 4, 34, 12],
  13549. [3, 145, 115, 1, 146, 116],
  13550. [4, 64, 40, 5, 65, 41],
  13551. [11, 36, 16, 5, 37, 17],
  13552. [11, 36, 12, 5, 37, 13],
  13553. [5, 109, 87, 1, 110, 88],
  13554. [5, 65, 41, 5, 66, 42],
  13555. [5, 54, 24, 7, 55, 25],
  13556. [11, 36, 12],
  13557. [5, 122, 98, 1, 123, 99],
  13558. [7, 73, 45, 3, 74, 46],
  13559. [15, 43, 19, 2, 44, 20],
  13560. [3, 45, 15, 13, 46, 16],
  13561. [1, 135, 107, 5, 136, 108],
  13562. [10, 74, 46, 1, 75, 47],
  13563. [1, 50, 22, 15, 51, 23],
  13564. [2, 42, 14, 17, 43, 15],
  13565. [5, 150, 120, 1, 151, 121],
  13566. [9, 69, 43, 4, 70, 44],
  13567. [17, 50, 22, 1, 51, 23],
  13568. [2, 42, 14, 19, 43, 15],
  13569. [3, 141, 113, 4, 142, 114],
  13570. [3, 70, 44, 11, 71, 45],
  13571. [17, 47, 21, 4, 48, 22],
  13572. [9, 39, 13, 16, 40, 14],
  13573. [3, 135, 107, 5, 136, 108],
  13574. [3, 67, 41, 13, 68, 42],
  13575. [15, 54, 24, 5, 55, 25],
  13576. [15, 43, 15, 10, 44, 16],
  13577. [4, 144, 116, 4, 145, 117],
  13578. [17, 68, 42],
  13579. [17, 50, 22, 6, 51, 23],
  13580. [19, 46, 16, 6, 47, 17],
  13581. [2, 139, 111, 7, 140, 112],
  13582. [17, 74, 46],
  13583. [7, 54, 24, 16, 55, 25],
  13584. [34, 37, 13],
  13585. [4, 151, 121, 5, 152, 122],
  13586. [4, 75, 47, 14, 76, 48],
  13587. [11, 54, 24, 14, 55, 25],
  13588. [16, 45, 15, 14, 46, 16],
  13589. [6, 147, 117, 4, 148, 118],
  13590. [6, 73, 45, 14, 74, 46],
  13591. [11, 54, 24, 16, 55, 25],
  13592. [30, 46, 16, 2, 47, 17],
  13593. [8, 132, 106, 4, 133, 107],
  13594. [8, 75, 47, 13, 76, 48],
  13595. [7, 54, 24, 22, 55, 25],
  13596. [22, 45, 15, 13, 46, 16],
  13597. [10, 142, 114, 2, 143, 115],
  13598. [19, 74, 46, 4, 75, 47],
  13599. [28, 50, 22, 6, 51, 23],
  13600. [33, 46, 16, 4, 47, 17],
  13601. [8, 152, 122, 4, 153, 123],
  13602. [22, 73, 45, 3, 74, 46],
  13603. [8, 53, 23, 26, 54, 24],
  13604. [12, 45, 15, 28, 46, 16],
  13605. [3, 147, 117, 10, 148, 118],
  13606. [3, 73, 45, 23, 74, 46],
  13607. [4, 54, 24, 31, 55, 25],
  13608. [11, 45, 15, 31, 46, 16],
  13609. [7, 146, 116, 7, 147, 117],
  13610. [21, 73, 45, 7, 74, 46],
  13611. [1, 53, 23, 37, 54, 24],
  13612. [19, 45, 15, 26, 46, 16],
  13613. [5, 145, 115, 10, 146, 116],
  13614. [19, 75, 47, 10, 76, 48],
  13615. [15, 54, 24, 25, 55, 25],
  13616. [23, 45, 15, 25, 46, 16],
  13617. [13, 145, 115, 3, 146, 116],
  13618. [2, 74, 46, 29, 75, 47],
  13619. [42, 54, 24, 1, 55, 25],
  13620. [23, 45, 15, 28, 46, 16],
  13621. [17, 145, 115],
  13622. [10, 74, 46, 23, 75, 47],
  13623. [10, 54, 24, 35, 55, 25],
  13624. [19, 45, 15, 35, 46, 16],
  13625. [17, 145, 115, 1, 146, 116],
  13626. [14, 74, 46, 21, 75, 47],
  13627. [29, 54, 24, 19, 55, 25],
  13628. [11, 45, 15, 46, 46, 16],
  13629. [13, 145, 115, 6, 146, 116],
  13630. [14, 74, 46, 23, 75, 47],
  13631. [44, 54, 24, 7, 55, 25],
  13632. [59, 46, 16, 1, 47, 17],
  13633. [12, 151, 121, 7, 152, 122],
  13634. [12, 75, 47, 26, 76, 48],
  13635. [39, 54, 24, 14, 55, 25],
  13636. [22, 45, 15, 41, 46, 16],
  13637. [6, 151, 121, 14, 152, 122],
  13638. [6, 75, 47, 34, 76, 48],
  13639. [46, 54, 24, 10, 55, 25],
  13640. [2, 45, 15, 64, 46, 16],
  13641. [17, 152, 122, 4, 153, 123],
  13642. [29, 74, 46, 14, 75, 47],
  13643. [49, 54, 24, 10, 55, 25],
  13644. [24, 45, 15, 46, 46, 16],
  13645. [4, 152, 122, 18, 153, 123],
  13646. [13, 74, 46, 32, 75, 47],
  13647. [48, 54, 24, 14, 55, 25],
  13648. [42, 45, 15, 32, 46, 16],
  13649. [20, 147, 117, 4, 148, 118],
  13650. [40, 75, 47, 7, 76, 48],
  13651. [43, 54, 24, 22, 55, 25],
  13652. [10, 45, 15, 67, 46, 16],
  13653. [19, 148, 118, 6, 149, 119],
  13654. [18, 75, 47, 31, 76, 48],
  13655. [34, 54, 24, 34, 55, 25],
  13656. [20, 45, 15, 61, 46, 16]];
  13657. QRRSBlock.getRSBlocks = function (typeNumber, errorCorrectLevel) {
  13658. var rsBlock = QRRSBlock.getRsBlockTable(typeNumber, errorCorrectLevel);
  13659. if (!rsBlock) {
  13660. //throw new Error("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + errorCorrectLevel);
  13661. throwError("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + errorCorrectLevel);
  13662. }
  13663. var length = rsBlock.length / 3,
  13664. list = [];
  13665. for (var _i22 = 0; _i22 < length; _i22++) {
  13666. var count = rsBlock[_i22 * 3],
  13667. totalCount = rsBlock[_i22 * 3 + 1],
  13668. dataCount = rsBlock[_i22 * 3 + 2];
  13669. for (var j = 0; j < count; j++) {
  13670. list.push(new QRRSBlock(totalCount, dataCount));
  13671. }
  13672. }
  13673. return list;
  13674. };
  13675. QRRSBlock.getRsBlockTable = function (typeNumber, errorCorrectLevel) {
  13676. switch (errorCorrectLevel) {
  13677. case QRErrorCorrectLevel.L:
  13678. return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4];
  13679. case QRErrorCorrectLevel.M:
  13680. return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 1];
  13681. case QRErrorCorrectLevel.Q:
  13682. return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 2];
  13683. case QRErrorCorrectLevel.H:
  13684. return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 3];
  13685. default:
  13686. return undefined;}
  13687. };
  13688. /*
  13689. * class QRBitBuffer
  13690. * */var
  13691. QRBitBuffer = /*#__PURE__*/function () {
  13692. function QRBitBuffer() {_classCallCheck(this, QRBitBuffer);
  13693. this.buffer = [];
  13694. this.length = 0;
  13695. }_createClass(QRBitBuffer, [{ key: "get", value: function get(
  13696. index) {
  13697. var bufIndex = Math.floor(index / 8);
  13698. return (this.buffer[bufIndex] >>> 7 - index % 8 & 1) == 1;
  13699. } }, { key: "put", value: function put(
  13700. num, length) {
  13701. for (var _i23 = 0; _i23 < length; _i23++) {
  13702. this.putBit((num >>> length - _i23 - 1 & 1) == 1);
  13703. }
  13704. } }, { key: "getLengthInBits", value: function getLengthInBits()
  13705. {
  13706. return this.length;
  13707. } }, { key: "putBit", value: function putBit(
  13708. bit) {
  13709. var bufIndex = Math.floor(this.length / 8);
  13710. if (this.buffer.length <= bufIndex) {
  13711. this.buffer.push(0);
  13712. }
  13713. if (bit) {
  13714. this.buffer[bufIndex] |= 0x80 >>> this.length % 8;
  13715. }
  13716. this.length++;
  13717. } }]);return QRBitBuffer;}();
  13718. /*
  13719. * Class Drawing
  13720. * */var
  13721. Drawing = /*#__PURE__*/function () {
  13722. function Drawing(el, opts) {_classCallCheck(this, Drawing);
  13723. this._opts = opts;
  13724. this._el = el;
  13725. this._ctx = uni.createCanvasContext(el);
  13726. }_createClass(Drawing, [{ key: "draw", value: function draw(
  13727. QRCode) {
  13728. var ctx = this._ctx,
  13729. opts = this._opts;
  13730. var ctxPosFix = opts.width / 20;
  13731. //console.log(opts.width)
  13732. var count = QRCode.getModuleCount(),
  13733. width = (opts.width - 2 * ctxPosFix) / count,
  13734. height = (opts.height - 2 * ctxPosFix) / count,
  13735. roundedWidth = Math.round(width),
  13736. roundedHeight = Math.round(height);
  13737. this.clear();
  13738. ctx.setFillStyle('#fff');
  13739. ctx.fillRect(0, 0, this._opts.width + 4 * ctxPosFix, this._opts.width + 4 * ctxPosFix);
  13740. for (var row = 0; row < count; row++) {
  13741. for (var col = 0; col < count; col++) {
  13742. var isDark = QRCode.isDark(row, col),
  13743. left = col * width + ctxPosFix,
  13744. top = row * height + ctxPosFix;
  13745. ctx.setStrokeStyle(isDark ? opts.colorDark : opts.colorLight);
  13746. ctx.setLineWidth(1);
  13747. ctx.setFillStyle(isDark ? opts.colorDark : opts.colorLight);
  13748. ctx.fillRect(left, top, width, height);
  13749. ctx.strokeRect(
  13750. Math.floor(left) + 0.5,
  13751. Math.floor(top) + 0.5,
  13752. roundedWidth,
  13753. roundedHeight);
  13754. ctx.strokeRect(
  13755. Math.ceil(left) - 0.5,
  13756. Math.ceil(top) - 0.5,
  13757. roundedWidth,
  13758. roundedHeight);
  13759. }
  13760. }
  13761. this._opts.logo && this.drawImg(this._opts.logo, this._opts.width, ctx);
  13762. ctx.draw();
  13763. this._bIsPainted = true;
  13764. if (this._opts.successTips && drawingOptsSuccessTips) {
  13765. uni.hideLoading();
  13766. uni.showToast({
  13767. title: '生成成功',
  13768. icon: 'success',
  13769. duration: 1000 });
  13770. }
  13771. drawingOptsSuccessTips = true;
  13772. } }, { key: "clear", value: function clear()
  13773. {
  13774. this._ctx.clearRect(0, 0, this._opts.width, this._opts.height);
  13775. }
  13776. /** anlib **/
  13777. /**
  13778. * 二维码上添加图片
  13779. */ }, { key: "drawImg", value: function drawImg(
  13780. src, width, ctx) {
  13781. // logo相对二维码的比例
  13782. var scale = 5;
  13783. // logo相对二维码的大小
  13784. var imgSize = width / scale;
  13785. // 偏移位置起始点
  13786. var imgPos = width / scale * 2;
  13787. // 二维码边框尺寸,这里设置为原宽度的80分之一
  13788. var imgPosFix = width / 80;
  13789. //console.log('width', width);
  13790. //console.log('imgSize', imgSize);
  13791. //console.log('imgPos', imgPos);
  13792. //console.log('imgPosFix', imgPosFix);
  13793. //console.log('src', src);
  13794. ctx.setFillStyle('#fff');
  13795. ctx.fillRect(imgPos - imgPosFix, imgPos - imgPosFix, imgSize + imgPosFix * 2, imgSize + imgPosFix * 2);
  13796. ctx.beginPath();
  13797. ctx.moveTo(imgPos - imgPosFix, imgPos - imgPosFix);
  13798. ctx.stroke();
  13799. ctx.closePath();
  13800. ctx.drawImage(src, imgPos, imgPos, imgSize, imgSize);
  13801. ctx.beginPath();
  13802. } }]);return Drawing;}();
  13803. /*
  13804. * Class QRCode
  13805. * */
  13806. var QRCode = function () {
  13807. /**
  13808. * Get the type by string length
  13809. * @author anlib
  13810. * @private
  13811. * @param {String} text
  13812. * @param {Number} correctLevel
  13813. * @return {Number} type
  13814. */
  13815. function getTypeNumber(text, correctLevel) {
  13816. var type = 1,
  13817. length = getUTF8Length(text),
  13818. QRCodeLimitLength = [
  13819. [17, 14, 11, 7],
  13820. [32, 26, 20, 14],
  13821. [53, 42, 32, 24],
  13822. [78, 62, 46, 34],
  13823. [106, 84, 60, 44],
  13824. [134, 106, 74, 58],
  13825. [154, 122, 86, 64],
  13826. [192, 152, 108, 84],
  13827. [230, 180, 130, 98],
  13828. [271, 213, 151, 119],
  13829. [321, 251, 177, 137],
  13830. [367, 287, 203, 155],
  13831. [425, 331, 241, 177],
  13832. [458, 362, 258, 194],
  13833. [520, 412, 292, 220],
  13834. [586, 450, 322, 250],
  13835. [644, 504, 364, 280],
  13836. [718, 560, 394, 310],
  13837. [792, 624, 442, 338],
  13838. [858, 666, 482, 382],
  13839. [929, 711, 509, 403],
  13840. [1003, 779, 565, 439],
  13841. [1091, 857, 611, 461],
  13842. [1171, 911, 661, 511],
  13843. [1273, 997, 715, 535],
  13844. [1367, 1059, 751, 593],
  13845. [1465, 1125, 805, 625],
  13846. [1528, 1190, 868, 658],
  13847. [1628, 1264, 908, 698],
  13848. [1732, 1370, 982, 742],
  13849. [1840, 1452, 1030, 790],
  13850. [1952, 1538, 1112, 842],
  13851. [2068, 1628, 1168, 898],
  13852. [2188, 1722, 1228, 958],
  13853. [2303, 1809, 1283, 983],
  13854. [2431, 1911, 1351, 1051],
  13855. [2563, 1989, 1423, 1093],
  13856. [2699, 2099, 1499, 1139],
  13857. [2809, 2213, 1579, 1219],
  13858. [2953, 2331, 1663, 1273]];
  13859. for (var _i24 = 0, len = QRCodeLimitLength.length; _i24 <= len; _i24++) {
  13860. var limit = 0;
  13861. switch (correctLevel) {
  13862. case QRErrorCorrectLevel.L:
  13863. limit = QRCodeLimitLength[_i24][0];
  13864. break;
  13865. case QRErrorCorrectLevel.M:
  13866. limit = QRCodeLimitLength[_i24][1];
  13867. break;
  13868. case QRErrorCorrectLevel.Q:
  13869. limit = QRCodeLimitLength[_i24][2];
  13870. break;
  13871. case QRErrorCorrectLevel.H:
  13872. limit = QRCodeLimitLength[_i24][3];
  13873. break;}
  13874. if (length <= limit) {
  13875. break;
  13876. } else {
  13877. type++;
  13878. }
  13879. }
  13880. if (type > QRCodeLimitLength.length) {
  13881. // throw new Error('Too long data'); //supfire
  13882. throwError('Too long data');
  13883. }
  13884. return type;
  13885. }
  13886. function getUTF8Length(text) {
  13887. var replacedText = encodeURI(text).toString().replace(/\%[0-9a-fA-F]{2}/g, 'a');
  13888. return replacedText.length + (replacedText.length != text ? 3 : 0);
  13889. }var
  13890. Fn = /*#__PURE__*/function () {
  13891. function Fn(el, opts) {_classCallCheck(this, Fn);
  13892. this._opts = {
  13893. width: 300,
  13894. height: 300,
  13895. typeNumber: 4,
  13896. colorDark: '#000000',
  13897. colorLight: '#ffffff',
  13898. correctLevel: Fn.correctLevel.H,
  13899. logo: false,
  13900. successTips: false };
  13901. if (typeof opts === 'string') {
  13902. opts = {
  13903. text: opts };
  13904. }
  13905. // Overwrites options 简单拷贝
  13906. if (opts) {
  13907. for (var _i25 in opts) {
  13908. if (opts.hasOwnProperty(_i25)) {
  13909. this._opts[_i25] = opts[_i25];
  13910. }
  13911. }
  13912. }
  13913. this._el = el;
  13914. this._QRCode = null;
  13915. this._drawing = new Drawing(this._el, this._opts);
  13916. if (this._opts.text) {
  13917. this.makeCode(this._opts.text);
  13918. }
  13919. }_createClass(Fn, [{ key: "makeCode", value: function makeCode(
  13920. text) {
  13921. this._QRCode = new QRCodeModel(getTypeNumber(text, this._opts.correctLevel), this._opts.
  13922. correctLevel);
  13923. this._QRCode.addData(text);
  13924. this._QRCode.make();
  13925. this._drawing.draw(this._QRCode);
  13926. } }, { key: "clear", value: function clear()
  13927. {
  13928. this._drawing.clear();
  13929. } }]);return Fn;}();
  13930. Fn.correctLevel = QRErrorCorrectLevel;
  13931. return Fn;
  13932. }();
  13933. /** anlib **/
  13934. var drawingOptsSuccessTips = true;
  13935. /**
  13936. * 抛出错误
  13937. */
  13938. function throwError(str) {
  13939. uni.hideLoading();
  13940. uni.showToast({
  13941. title: '有字符暂不支持',
  13942. icon: 'none',
  13943. duration: 2000 });
  13944. drawingOptsSuccessTips = false;
  13945. //throw new Error(str);
  13946. }var _default =
  13947. QRCode;exports.default = _default;
  13948. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  13949. /***/ })
  13950. }]);
  13951. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map