vendor.js 686 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777
  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|getSystemSetting|getAppAuthorizeSetting/;
  290. var CONTEXT_API_RE = /^create|Manager$/;
  291. // Context例外情况
  292. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  293. // 同步例外情况
  294. var ASYNC_API = ['createBLEConnection', 'createPushMessage'];
  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__617FB52",
  643. appName: "test",
  644. appVersion: "1.0.0",
  645. appVersionCode: "100",
  646. appLanguage: getAppLanguage(hostLanguage),
  647. uniCompileVersion: "3.6.3",
  648. uniRuntimeVersion: "3.6.3",
  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__617FB52",
  736. appName: "test",
  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. var getAppAuthorizeSetting = {
  765. returnValue: function returnValue(result) {var
  766. locationReducedAccuracy = result.locationReducedAccuracy;
  767. result.locationAccuracy = 'unsupported';
  768. if (locationReducedAccuracy === true) {
  769. result.locationAccuracy = 'reduced';
  770. } else if (locationReducedAccuracy === false) {
  771. result.locationAccuracy = 'full';
  772. }
  773. } };
  774. // import navigateTo from 'uni-helpers/navigate-to'
  775. var protocols = {
  776. redirectTo: redirectTo,
  777. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  778. previewImage: previewImage,
  779. getSystemInfo: getSystemInfo,
  780. getSystemInfoSync: getSystemInfo,
  781. showActionSheet: showActionSheet,
  782. getAppBaseInfo: getAppBaseInfo,
  783. getDeviceInfo: getDeviceInfo,
  784. getWindowInfo: getWindowInfo,
  785. getAppAuthorizeSetting: getAppAuthorizeSetting };
  786. var todos = [
  787. 'vibrate',
  788. 'preloadPage',
  789. 'unPreloadPage',
  790. 'loadSubPackage'];
  791. var canIUses = [];
  792. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  793. function processCallback(methodName, method, returnValue) {
  794. return function (res) {
  795. return method(processReturnValue(methodName, res, returnValue));
  796. };
  797. }
  798. 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;
  799. if (isPlainObject(fromArgs)) {// 一般 api 的参数解析
  800. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  801. if (isFn(argsOption)) {
  802. argsOption = argsOption(fromArgs, toArgs) || {};
  803. }
  804. for (var key in fromArgs) {
  805. if (hasOwn(argsOption, key)) {
  806. var keyOption = argsOption[key];
  807. if (isFn(keyOption)) {
  808. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  809. }
  810. if (!keyOption) {// 不支持的参数
  811. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  812. } else if (isStr(keyOption)) {// 重写参数 key
  813. toArgs[keyOption] = fromArgs[key];
  814. } else if (isPlainObject(keyOption)) {// {name:newName,value:value}可重新指定参数 key:value
  815. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  816. }
  817. } else if (CALLBACKS.indexOf(key) !== -1) {
  818. if (isFn(fromArgs[key])) {
  819. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  820. }
  821. } else {
  822. if (!keepFromArgs) {
  823. toArgs[key] = fromArgs[key];
  824. }
  825. }
  826. }
  827. return toArgs;
  828. } else if (isFn(fromArgs)) {
  829. fromArgs = processCallback(methodName, fromArgs, returnValue);
  830. }
  831. return fromArgs;
  832. }
  833. function processReturnValue(methodName, res, returnValue) {var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  834. if (isFn(protocols.returnValue)) {// 处理通用 returnValue
  835. res = protocols.returnValue(methodName, res);
  836. }
  837. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  838. }
  839. function wrapper(methodName, method) {
  840. if (hasOwn(protocols, methodName)) {
  841. var protocol = protocols[methodName];
  842. if (!protocol) {// 暂不支持的 api
  843. return function () {
  844. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  845. };
  846. }
  847. return function (arg1, arg2) {// 目前 api 最多两个参数
  848. var options = protocol;
  849. if (isFn(protocol)) {
  850. options = protocol(arg1);
  851. }
  852. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  853. var args = [arg1];
  854. if (typeof arg2 !== 'undefined') {
  855. args.push(arg2);
  856. }
  857. if (isFn(options.name)) {
  858. methodName = options.name(arg1);
  859. } else if (isStr(options.name)) {
  860. methodName = options.name;
  861. }
  862. var returnValue = wx[methodName].apply(wx, args);
  863. if (isSyncApi(methodName)) {// 同步 api
  864. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  865. }
  866. return returnValue;
  867. };
  868. }
  869. return method;
  870. }
  871. var todoApis = Object.create(null);
  872. var TODOS = [
  873. 'onTabBarMidButtonTap',
  874. 'subscribePush',
  875. 'unsubscribePush',
  876. 'onPush',
  877. 'offPush',
  878. 'share'];
  879. function createTodoApi(name) {
  880. return function todoApi(_ref)
  881. {var fail = _ref.fail,complete = _ref.complete;
  882. var res = {
  883. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported") };
  884. isFn(fail) && fail(res);
  885. isFn(complete) && complete(res);
  886. };
  887. }
  888. TODOS.forEach(function (name) {
  889. todoApis[name] = createTodoApi(name);
  890. });
  891. var providers = {
  892. oauth: ['weixin'],
  893. share: ['weixin'],
  894. payment: ['wxpay'],
  895. push: ['weixin'] };
  896. function getProvider(_ref2)
  897. {var service = _ref2.service,success = _ref2.success,fail = _ref2.fail,complete = _ref2.complete;
  898. var res = false;
  899. if (providers[service]) {
  900. res = {
  901. errMsg: 'getProvider:ok',
  902. service: service,
  903. provider: providers[service] };
  904. isFn(success) && success(res);
  905. } else {
  906. res = {
  907. errMsg: 'getProvider:fail service not found' };
  908. isFn(fail) && fail(res);
  909. }
  910. isFn(complete) && complete(res);
  911. }
  912. var extraApi = /*#__PURE__*/Object.freeze({
  913. __proto__: null,
  914. getProvider: getProvider });
  915. var getEmitter = function () {
  916. var Emitter;
  917. return function getUniEmitter() {
  918. if (!Emitter) {
  919. Emitter = new _vue.default();
  920. }
  921. return Emitter;
  922. };
  923. }();
  924. function apply(ctx, method, args) {
  925. return ctx[method].apply(ctx, args);
  926. }
  927. function $on() {
  928. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  929. }
  930. function $off() {
  931. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  932. }
  933. function $once() {
  934. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  935. }
  936. function $emit() {
  937. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  938. }
  939. var eventApi = /*#__PURE__*/Object.freeze({
  940. __proto__: null,
  941. $on: $on,
  942. $off: $off,
  943. $once: $once,
  944. $emit: $emit });
  945. /**
  946. * 框架内 try-catch
  947. */
  948. /**
  949. * 开发者 try-catch
  950. */
  951. function tryCatch(fn) {
  952. return function () {
  953. try {
  954. return fn.apply(fn, arguments);
  955. } catch (e) {
  956. // TODO
  957. console.error(e);
  958. }
  959. };
  960. }
  961. function getApiCallbacks(params) {
  962. var apiCallbacks = {};
  963. for (var name in params) {
  964. var param = params[name];
  965. if (isFn(param)) {
  966. apiCallbacks[name] = tryCatch(param);
  967. delete params[name];
  968. }
  969. }
  970. return apiCallbacks;
  971. }
  972. var cid;
  973. var cidErrMsg;
  974. var enabled;
  975. function normalizePushMessage(message) {
  976. try {
  977. return JSON.parse(message);
  978. } catch (e) {}
  979. return message;
  980. }
  981. function invokePushCallback(
  982. args)
  983. {
  984. if (args.type === 'enabled') {
  985. enabled = true;
  986. } else if (args.type === 'clientId') {
  987. cid = args.cid;
  988. cidErrMsg = args.errMsg;
  989. invokeGetPushCidCallbacks(cid, args.errMsg);
  990. } else if (args.type === 'pushMsg') {
  991. var message = {
  992. type: 'receive',
  993. data: normalizePushMessage(args.message) };
  994. for (var i = 0; i < onPushMessageCallbacks.length; i++) {
  995. var callback = onPushMessageCallbacks[i];
  996. callback(message);
  997. // 该消息已被阻止
  998. if (message.stopped) {
  999. break;
  1000. }
  1001. }
  1002. } else if (args.type === 'click') {
  1003. onPushMessageCallbacks.forEach(function (callback) {
  1004. callback({
  1005. type: 'click',
  1006. data: normalizePushMessage(args.message) });
  1007. });
  1008. }
  1009. }
  1010. var getPushCidCallbacks = [];
  1011. function invokeGetPushCidCallbacks(cid, errMsg) {
  1012. getPushCidCallbacks.forEach(function (callback) {
  1013. callback(cid, errMsg);
  1014. });
  1015. getPushCidCallbacks.length = 0;
  1016. }
  1017. function getPushClientId(args) {
  1018. if (!isPlainObject(args)) {
  1019. args = {};
  1020. }var _getApiCallbacks =
  1021. getApiCallbacks(args),success = _getApiCallbacks.success,fail = _getApiCallbacks.fail,complete = _getApiCallbacks.complete;
  1022. var hasSuccess = isFn(success);
  1023. var hasFail = isFn(fail);
  1024. var hasComplete = isFn(complete);
  1025. Promise.resolve().then(function () {
  1026. if (typeof enabled === 'undefined') {
  1027. enabled = false;
  1028. cid = '';
  1029. cidErrMsg = 'uniPush is not enabled';
  1030. }
  1031. getPushCidCallbacks.push(function (cid, errMsg) {
  1032. var res;
  1033. if (cid) {
  1034. res = {
  1035. errMsg: 'getPushClientId:ok',
  1036. cid: cid };
  1037. hasSuccess && success(res);
  1038. } else {
  1039. res = {
  1040. errMsg: 'getPushClientId:fail' + (errMsg ? ' ' + errMsg : '') };
  1041. hasFail && fail(res);
  1042. }
  1043. hasComplete && complete(res);
  1044. });
  1045. if (typeof cid !== 'undefined') {
  1046. invokeGetPushCidCallbacks(cid, cidErrMsg);
  1047. }
  1048. });
  1049. }
  1050. var onPushMessageCallbacks = [];
  1051. // 不使用 defineOnApi 实现,是因为 defineOnApi 依赖 UniServiceJSBridge ,该对象目前在小程序上未提供,故简单实现
  1052. var onPushMessage = function onPushMessage(fn) {
  1053. if (onPushMessageCallbacks.indexOf(fn) === -1) {
  1054. onPushMessageCallbacks.push(fn);
  1055. }
  1056. };
  1057. var offPushMessage = function offPushMessage(fn) {
  1058. if (!fn) {
  1059. onPushMessageCallbacks.length = 0;
  1060. } else {
  1061. var index = onPushMessageCallbacks.indexOf(fn);
  1062. if (index > -1) {
  1063. onPushMessageCallbacks.splice(index, 1);
  1064. }
  1065. }
  1066. };
  1067. var api = /*#__PURE__*/Object.freeze({
  1068. __proto__: null,
  1069. getPushClientId: getPushClientId,
  1070. onPushMessage: onPushMessage,
  1071. offPushMessage: offPushMessage,
  1072. invokePushCallback: invokePushCallback });
  1073. var MPPage = Page;
  1074. var MPComponent = Component;
  1075. var customizeRE = /:/g;
  1076. var customize = cached(function (str) {
  1077. return camelize(str.replace(customizeRE, '-'));
  1078. });
  1079. function initTriggerEvent(mpInstance) {
  1080. var oldTriggerEvent = mpInstance.triggerEvent;
  1081. 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];}
  1082. // 事件名统一转驼峰格式,仅处理:当前组件为 vue 组件、当前组件为 vue 组件子组件
  1083. if (this.$vm || this.dataset && this.dataset.comType) {
  1084. event = customize(event);
  1085. } else {
  1086. // 针对微信/QQ小程序单独补充驼峰格式事件,以兼容历史项目
  1087. var newEvent = customize(event);
  1088. if (newEvent !== event) {
  1089. oldTriggerEvent.apply(this, [newEvent].concat(args));
  1090. }
  1091. }
  1092. return oldTriggerEvent.apply(this, [event].concat(args));
  1093. };
  1094. try {
  1095. // 京东小程序 triggerEvent 为只读
  1096. mpInstance.triggerEvent = newTriggerEvent;
  1097. } catch (error) {
  1098. mpInstance._triggerEvent = newTriggerEvent;
  1099. }
  1100. }
  1101. function initHook(name, options, isComponent) {
  1102. var oldHook = options[name];
  1103. if (!oldHook) {
  1104. options[name] = function () {
  1105. initTriggerEvent(this);
  1106. };
  1107. } else {
  1108. options[name] = function () {
  1109. initTriggerEvent(this);for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {args[_key4] = arguments[_key4];}
  1110. return oldHook.apply(this, args);
  1111. };
  1112. }
  1113. }
  1114. if (!MPPage.__$wrappered) {
  1115. MPPage.__$wrappered = true;
  1116. Page = function Page() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1117. initHook('onLoad', options);
  1118. return MPPage(options);
  1119. };
  1120. Page.after = MPPage.after;
  1121. Component = function Component() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1122. initHook('created', options);
  1123. return MPComponent(options);
  1124. };
  1125. }
  1126. var PAGE_EVENT_HOOKS = [
  1127. 'onPullDownRefresh',
  1128. 'onReachBottom',
  1129. 'onAddToFavorites',
  1130. 'onShareTimeline',
  1131. 'onShareAppMessage',
  1132. 'onPageScroll',
  1133. 'onResize',
  1134. 'onTabItemTap'];
  1135. function initMocks(vm, mocks) {
  1136. var mpInstance = vm.$mp[vm.mpType];
  1137. mocks.forEach(function (mock) {
  1138. if (hasOwn(mpInstance, mock)) {
  1139. vm[mock] = mpInstance[mock];
  1140. }
  1141. });
  1142. }
  1143. function hasHook(hook, vueOptions) {
  1144. if (!vueOptions) {
  1145. return true;
  1146. }
  1147. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  1148. return true;
  1149. }
  1150. vueOptions = vueOptions.default || vueOptions;
  1151. if (isFn(vueOptions)) {
  1152. if (isFn(vueOptions.extendOptions[hook])) {
  1153. return true;
  1154. }
  1155. if (vueOptions.super &&
  1156. vueOptions.super.options &&
  1157. Array.isArray(vueOptions.super.options[hook])) {
  1158. return true;
  1159. }
  1160. return false;
  1161. }
  1162. if (isFn(vueOptions[hook])) {
  1163. return true;
  1164. }
  1165. var mixins = vueOptions.mixins;
  1166. if (Array.isArray(mixins)) {
  1167. return !!mixins.find(function (mixin) {return hasHook(hook, mixin);});
  1168. }
  1169. }
  1170. function initHooks(mpOptions, hooks, vueOptions) {
  1171. hooks.forEach(function (hook) {
  1172. if (hasHook(hook, vueOptions)) {
  1173. mpOptions[hook] = function (args) {
  1174. return this.$vm && this.$vm.__call_hook(hook, args);
  1175. };
  1176. }
  1177. });
  1178. }
  1179. function initUnknownHooks(mpOptions, vueOptions) {var excludes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  1180. findHooks(vueOptions).forEach(function (hook) {return initHook$1(mpOptions, hook, excludes);});
  1181. }
  1182. function findHooks(vueOptions) {var hooks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  1183. if (vueOptions) {
  1184. Object.keys(vueOptions).forEach(function (name) {
  1185. if (name.indexOf('on') === 0 && isFn(vueOptions[name])) {
  1186. hooks.push(name);
  1187. }
  1188. });
  1189. }
  1190. return hooks;
  1191. }
  1192. function initHook$1(mpOptions, hook, excludes) {
  1193. if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
  1194. mpOptions[hook] = function (args) {
  1195. return this.$vm && this.$vm.__call_hook(hook, args);
  1196. };
  1197. }
  1198. }
  1199. function initVueComponent(Vue, vueOptions) {
  1200. vueOptions = vueOptions.default || vueOptions;
  1201. var VueComponent;
  1202. if (isFn(vueOptions)) {
  1203. VueComponent = vueOptions;
  1204. } else {
  1205. VueComponent = Vue.extend(vueOptions);
  1206. }
  1207. vueOptions = VueComponent.options;
  1208. return [VueComponent, vueOptions];
  1209. }
  1210. function initSlots(vm, vueSlots) {
  1211. if (Array.isArray(vueSlots) && vueSlots.length) {
  1212. var $slots = Object.create(null);
  1213. vueSlots.forEach(function (slotName) {
  1214. $slots[slotName] = true;
  1215. });
  1216. vm.$scopedSlots = vm.$slots = $slots;
  1217. }
  1218. }
  1219. function initVueIds(vueIds, mpInstance) {
  1220. vueIds = (vueIds || '').split(',');
  1221. var len = vueIds.length;
  1222. if (len === 1) {
  1223. mpInstance._$vueId = vueIds[0];
  1224. } else if (len === 2) {
  1225. mpInstance._$vueId = vueIds[0];
  1226. mpInstance._$vuePid = vueIds[1];
  1227. }
  1228. }
  1229. function initData(vueOptions, context) {
  1230. var data = vueOptions.data || {};
  1231. var methods = vueOptions.methods || {};
  1232. if (typeof data === 'function') {
  1233. try {
  1234. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  1235. } catch (e) {
  1236. if (Object({"NODE_ENV":"development","VUE_APP_NAME":"test","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  1237. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  1238. }
  1239. }
  1240. } else {
  1241. try {
  1242. // 对 data 格式化
  1243. data = JSON.parse(JSON.stringify(data));
  1244. } catch (e) {}
  1245. }
  1246. if (!isPlainObject(data)) {
  1247. data = {};
  1248. }
  1249. Object.keys(methods).forEach(function (methodName) {
  1250. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  1251. data[methodName] = methods[methodName];
  1252. }
  1253. });
  1254. return data;
  1255. }
  1256. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  1257. function createObserver(name) {
  1258. return function observer(newVal, oldVal) {
  1259. if (this.$vm) {
  1260. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  1261. }
  1262. };
  1263. }
  1264. function initBehaviors(vueOptions, initBehavior) {
  1265. var vueBehaviors = vueOptions.behaviors;
  1266. var vueExtends = vueOptions.extends;
  1267. var vueMixins = vueOptions.mixins;
  1268. var vueProps = vueOptions.props;
  1269. if (!vueProps) {
  1270. vueOptions.props = vueProps = [];
  1271. }
  1272. var behaviors = [];
  1273. if (Array.isArray(vueBehaviors)) {
  1274. vueBehaviors.forEach(function (behavior) {
  1275. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  1276. if (behavior === 'uni://form-field') {
  1277. if (Array.isArray(vueProps)) {
  1278. vueProps.push('name');
  1279. vueProps.push('value');
  1280. } else {
  1281. vueProps.name = {
  1282. type: String,
  1283. default: '' };
  1284. vueProps.value = {
  1285. type: [String, Number, Boolean, Array, Object, Date],
  1286. default: '' };
  1287. }
  1288. }
  1289. });
  1290. }
  1291. if (isPlainObject(vueExtends) && vueExtends.props) {
  1292. behaviors.push(
  1293. initBehavior({
  1294. properties: initProperties(vueExtends.props, true) }));
  1295. }
  1296. if (Array.isArray(vueMixins)) {
  1297. vueMixins.forEach(function (vueMixin) {
  1298. if (isPlainObject(vueMixin) && vueMixin.props) {
  1299. behaviors.push(
  1300. initBehavior({
  1301. properties: initProperties(vueMixin.props, true) }));
  1302. }
  1303. });
  1304. }
  1305. return behaviors;
  1306. }
  1307. function parsePropType(key, type, defaultValue, file) {
  1308. // [String]=>String
  1309. if (Array.isArray(type) && type.length === 1) {
  1310. return type[0];
  1311. }
  1312. return type;
  1313. }
  1314. function initProperties(props) {var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';var options = arguments.length > 3 ? arguments[3] : undefined;
  1315. var properties = {};
  1316. if (!isBehavior) {
  1317. properties.vueId = {
  1318. type: String,
  1319. value: '' };
  1320. {
  1321. if (options.virtualHost) {
  1322. properties.virtualHostStyle = {
  1323. type: null,
  1324. value: '' };
  1325. properties.virtualHostClass = {
  1326. type: null,
  1327. value: '' };
  1328. }
  1329. }
  1330. // scopedSlotsCompiler auto
  1331. properties.scopedSlotsCompiler = {
  1332. type: String,
  1333. value: '' };
  1334. properties.vueSlots = { // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  1335. type: null,
  1336. value: [],
  1337. observer: function observer(newVal, oldVal) {
  1338. var $slots = Object.create(null);
  1339. newVal.forEach(function (slotName) {
  1340. $slots[slotName] = true;
  1341. });
  1342. this.setData({
  1343. $slots: $slots });
  1344. } };
  1345. }
  1346. if (Array.isArray(props)) {// ['title']
  1347. props.forEach(function (key) {
  1348. properties[key] = {
  1349. type: null,
  1350. observer: createObserver(key) };
  1351. });
  1352. } else if (isPlainObject(props)) {// {title:{type:String,default:''},content:String}
  1353. Object.keys(props).forEach(function (key) {
  1354. var opts = props[key];
  1355. if (isPlainObject(opts)) {// title:{type:String,default:''}
  1356. var value = opts.default;
  1357. if (isFn(value)) {
  1358. value = value();
  1359. }
  1360. opts.type = parsePropType(key, opts.type);
  1361. properties[key] = {
  1362. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  1363. value: value,
  1364. observer: createObserver(key) };
  1365. } else {// content:String
  1366. var type = parsePropType(key, opts);
  1367. properties[key] = {
  1368. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  1369. observer: createObserver(key) };
  1370. }
  1371. });
  1372. }
  1373. return properties;
  1374. }
  1375. function wrapper$1(event) {
  1376. // TODO 又得兼容 mpvue 的 mp 对象
  1377. try {
  1378. event.mp = JSON.parse(JSON.stringify(event));
  1379. } catch (e) {}
  1380. event.stopPropagation = noop;
  1381. event.preventDefault = noop;
  1382. event.target = event.target || {};
  1383. if (!hasOwn(event, 'detail')) {
  1384. event.detail = {};
  1385. }
  1386. if (hasOwn(event, 'markerId')) {
  1387. event.detail = typeof event.detail === 'object' ? event.detail : {};
  1388. event.detail.markerId = event.markerId;
  1389. }
  1390. if (isPlainObject(event.detail)) {
  1391. event.target = Object.assign({}, event.target, event.detail);
  1392. }
  1393. return event;
  1394. }
  1395. function getExtraValue(vm, dataPathsArray) {
  1396. var context = vm;
  1397. dataPathsArray.forEach(function (dataPathArray) {
  1398. var dataPath = dataPathArray[0];
  1399. var value = dataPathArray[2];
  1400. if (dataPath || typeof value !== 'undefined') {// ['','',index,'disable']
  1401. var propPath = dataPathArray[1];
  1402. var valuePath = dataPathArray[3];
  1403. var vFor;
  1404. if (Number.isInteger(dataPath)) {
  1405. vFor = dataPath;
  1406. } else if (!dataPath) {
  1407. vFor = context;
  1408. } else if (typeof dataPath === 'string' && dataPath) {
  1409. if (dataPath.indexOf('#s#') === 0) {
  1410. vFor = dataPath.substr(3);
  1411. } else {
  1412. vFor = vm.__get_value(dataPath, context);
  1413. }
  1414. }
  1415. if (Number.isInteger(vFor)) {
  1416. context = value;
  1417. } else if (!propPath) {
  1418. context = vFor[value];
  1419. } else {
  1420. if (Array.isArray(vFor)) {
  1421. context = vFor.find(function (vForItem) {
  1422. return vm.__get_value(propPath, vForItem) === value;
  1423. });
  1424. } else if (isPlainObject(vFor)) {
  1425. context = Object.keys(vFor).find(function (vForKey) {
  1426. return vm.__get_value(propPath, vFor[vForKey]) === value;
  1427. });
  1428. } else {
  1429. console.error('v-for 暂不支持循环数据:', vFor);
  1430. }
  1431. }
  1432. if (valuePath) {
  1433. context = vm.__get_value(valuePath, context);
  1434. }
  1435. }
  1436. });
  1437. return context;
  1438. }
  1439. function processEventExtra(vm, extra, event, __args__) {
  1440. var extraObj = {};
  1441. if (Array.isArray(extra) && extra.length) {
  1442. /**
  1443. *[
  1444. * ['data.items', 'data.id', item.data.id],
  1445. * ['metas', 'id', meta.id]
  1446. *],
  1447. *[
  1448. * ['data.items', 'data.id', item.data.id],
  1449. * ['metas', 'id', meta.id]
  1450. *],
  1451. *'test'
  1452. */
  1453. extra.forEach(function (dataPath, index) {
  1454. if (typeof dataPath === 'string') {
  1455. if (!dataPath) {// model,prop.sync
  1456. extraObj['$' + index] = vm;
  1457. } else {
  1458. if (dataPath === '$event') {// $event
  1459. extraObj['$' + index] = event;
  1460. } else if (dataPath === 'arguments') {
  1461. extraObj['$' + index] = event.detail ? event.detail.__args__ || __args__ : __args__;
  1462. } else if (dataPath.indexOf('$event.') === 0) {// $event.target.value
  1463. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  1464. } else {
  1465. extraObj['$' + index] = vm.__get_value(dataPath);
  1466. }
  1467. }
  1468. } else {
  1469. extraObj['$' + index] = getExtraValue(vm, dataPath);
  1470. }
  1471. });
  1472. }
  1473. return extraObj;
  1474. }
  1475. function getObjByArray(arr) {
  1476. var obj = {};
  1477. for (var i = 1; i < arr.length; i++) {
  1478. var element = arr[i];
  1479. obj[element[0]] = element[1];
  1480. }
  1481. return obj;
  1482. }
  1483. 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;
  1484. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  1485. // fixed 用户直接触发 mpInstance.triggerEvent
  1486. var __args__ = isPlainObject(event.detail) ?
  1487. event.detail.__args__ || [event.detail] :
  1488. [event.detail];
  1489. if (isCustom) {// 自定义事件
  1490. isCustomMPEvent = event.currentTarget &&
  1491. event.currentTarget.dataset &&
  1492. event.currentTarget.dataset.comType === 'wx';
  1493. if (!args.length) {// 无参数,直接传入 event 或 detail 数组
  1494. if (isCustomMPEvent) {
  1495. return [event];
  1496. }
  1497. return __args__;
  1498. }
  1499. }
  1500. var extraObj = processEventExtra(vm, extra, event, __args__);
  1501. var ret = [];
  1502. args.forEach(function (arg) {
  1503. if (arg === '$event') {
  1504. if (methodName === '__set_model' && !isCustom) {// input v-model value
  1505. ret.push(event.target.value);
  1506. } else {
  1507. if (isCustom && !isCustomMPEvent) {
  1508. ret.push(__args__[0]);
  1509. } else {// wxcomponent 组件或内置组件
  1510. ret.push(event);
  1511. }
  1512. }
  1513. } else {
  1514. if (Array.isArray(arg) && arg[0] === 'o') {
  1515. ret.push(getObjByArray(arg));
  1516. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  1517. ret.push(extraObj[arg]);
  1518. } else {
  1519. ret.push(arg);
  1520. }
  1521. }
  1522. });
  1523. return ret;
  1524. }
  1525. var ONCE = '~';
  1526. var CUSTOM = '^';
  1527. function isMatchEventType(eventType, optType) {
  1528. return eventType === optType ||
  1529. optType === 'regionchange' && (
  1530. eventType === 'begin' ||
  1531. eventType === 'end');
  1532. }
  1533. function getContextVm(vm) {
  1534. var $parent = vm.$parent;
  1535. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  1536. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  1537. $parent = $parent.$parent;
  1538. }
  1539. return $parent && $parent.$parent;
  1540. }
  1541. function handleEvent(event) {var _this2 = this;
  1542. event = wrapper$1(event);
  1543. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  1544. var dataset = (event.currentTarget || event.target).dataset;
  1545. if (!dataset) {
  1546. return console.warn('事件信息不存在');
  1547. }
  1548. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  1549. if (!eventOpts) {
  1550. return console.warn('事件信息不存在');
  1551. }
  1552. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  1553. var eventType = event.type;
  1554. var ret = [];
  1555. eventOpts.forEach(function (eventOpt) {
  1556. var type = eventOpt[0];
  1557. var eventsArray = eventOpt[1];
  1558. var isCustom = type.charAt(0) === CUSTOM;
  1559. type = isCustom ? type.slice(1) : type;
  1560. var isOnce = type.charAt(0) === ONCE;
  1561. type = isOnce ? type.slice(1) : type;
  1562. if (eventsArray && isMatchEventType(eventType, type)) {
  1563. eventsArray.forEach(function (eventArray) {
  1564. var methodName = eventArray[0];
  1565. if (methodName) {
  1566. var handlerCtx = _this2.$vm;
  1567. if (handlerCtx.$options.generic) {// mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  1568. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  1569. }
  1570. if (methodName === '$emit') {
  1571. handlerCtx.$emit.apply(handlerCtx,
  1572. processEventArgs(
  1573. _this2.$vm,
  1574. event,
  1575. eventArray[1],
  1576. eventArray[2],
  1577. isCustom,
  1578. methodName));
  1579. return;
  1580. }
  1581. var handler = handlerCtx[methodName];
  1582. if (!isFn(handler)) {
  1583. var _type = _this2.$vm.mpType === 'page' ? 'Page' : 'Component';
  1584. var path = _this2.route || _this2.is;
  1585. throw new Error("".concat(_type, " \"").concat(path, "\" does not have a method \"").concat(methodName, "\""));
  1586. }
  1587. if (isOnce) {
  1588. if (handler.once) {
  1589. return;
  1590. }
  1591. handler.once = true;
  1592. }
  1593. var params = processEventArgs(
  1594. _this2.$vm,
  1595. event,
  1596. eventArray[1],
  1597. eventArray[2],
  1598. isCustom,
  1599. methodName);
  1600. params = Array.isArray(params) ? params : [];
  1601. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  1602. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  1603. // eslint-disable-next-line no-sparse-arrays
  1604. params = params.concat([,,,,,,,,,, event]);
  1605. }
  1606. ret.push(handler.apply(handlerCtx, params));
  1607. }
  1608. });
  1609. }
  1610. });
  1611. if (
  1612. eventType === 'input' &&
  1613. ret.length === 1 &&
  1614. typeof ret[0] !== 'undefined')
  1615. {
  1616. return ret[0];
  1617. }
  1618. }
  1619. var eventChannels = {};
  1620. var eventChannelStack = [];
  1621. function getEventChannel(id) {
  1622. if (id) {
  1623. var eventChannel = eventChannels[id];
  1624. delete eventChannels[id];
  1625. return eventChannel;
  1626. }
  1627. return eventChannelStack.shift();
  1628. }
  1629. var hooks = [
  1630. 'onShow',
  1631. 'onHide',
  1632. 'onError',
  1633. 'onPageNotFound',
  1634. 'onThemeChange',
  1635. 'onUnhandledRejection'];
  1636. function initEventChannel() {
  1637. _vue.default.prototype.getOpenerEventChannel = function () {
  1638. // 微信小程序使用自身getOpenerEventChannel
  1639. {
  1640. return this.$scope.getOpenerEventChannel();
  1641. }
  1642. };
  1643. var callHook = _vue.default.prototype.__call_hook;
  1644. _vue.default.prototype.__call_hook = function (hook, args) {
  1645. if (hook === 'onLoad' && args && args.__id__) {
  1646. this.__eventChannel__ = getEventChannel(args.__id__);
  1647. delete args.__id__;
  1648. }
  1649. return callHook.call(this, hook, args);
  1650. };
  1651. }
  1652. function initScopedSlotsParams() {
  1653. var center = {};
  1654. var parents = {};
  1655. _vue.default.prototype.$hasScopedSlotsParams = function (vueId) {
  1656. var has = center[vueId];
  1657. if (!has) {
  1658. parents[vueId] = this;
  1659. this.$on('hook:destroyed', function () {
  1660. delete parents[vueId];
  1661. });
  1662. }
  1663. return has;
  1664. };
  1665. _vue.default.prototype.$getScopedSlotsParams = function (vueId, name, key) {
  1666. var data = center[vueId];
  1667. if (data) {
  1668. var object = data[name] || {};
  1669. return key ? object[key] : object;
  1670. } else {
  1671. parents[vueId] = this;
  1672. this.$on('hook:destroyed', function () {
  1673. delete parents[vueId];
  1674. });
  1675. }
  1676. };
  1677. _vue.default.prototype.$setScopedSlotsParams = function (name, value) {
  1678. var vueIds = this.$options.propsData.vueId;
  1679. if (vueIds) {
  1680. var vueId = vueIds.split(',')[0];
  1681. var object = center[vueId] = center[vueId] || {};
  1682. object[name] = value;
  1683. if (parents[vueId]) {
  1684. parents[vueId].$forceUpdate();
  1685. }
  1686. }
  1687. };
  1688. _vue.default.mixin({
  1689. destroyed: function destroyed() {
  1690. var propsData = this.$options.propsData;
  1691. var vueId = propsData && propsData.vueId;
  1692. if (vueId) {
  1693. delete center[vueId];
  1694. delete parents[vueId];
  1695. }
  1696. } });
  1697. }
  1698. function parseBaseApp(vm, _ref3)
  1699. {var mocks = _ref3.mocks,initRefs = _ref3.initRefs;
  1700. initEventChannel();
  1701. {
  1702. initScopedSlotsParams();
  1703. }
  1704. if (vm.$options.store) {
  1705. _vue.default.prototype.$store = vm.$options.store;
  1706. }
  1707. uniIdMixin(_vue.default);
  1708. _vue.default.prototype.mpHost = "mp-weixin";
  1709. _vue.default.mixin({
  1710. beforeCreate: function beforeCreate() {
  1711. if (!this.$options.mpType) {
  1712. return;
  1713. }
  1714. this.mpType = this.$options.mpType;
  1715. this.$mp = _defineProperty({
  1716. data: {} },
  1717. this.mpType, this.$options.mpInstance);
  1718. this.$scope = this.$options.mpInstance;
  1719. delete this.$options.mpType;
  1720. delete this.$options.mpInstance;
  1721. if (this.mpType === 'page' && typeof getApp === 'function') {// hack vue-i18n
  1722. var app = getApp();
  1723. if (app.$vm && app.$vm.$i18n) {
  1724. this._i18n = app.$vm.$i18n;
  1725. }
  1726. }
  1727. if (this.mpType !== 'app') {
  1728. initRefs(this);
  1729. initMocks(this, mocks);
  1730. }
  1731. } });
  1732. var appOptions = {
  1733. onLaunch: function onLaunch(args) {
  1734. if (this.$vm) {// 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  1735. return;
  1736. }
  1737. {
  1738. if (wx.canIUse && !wx.canIUse('nextTick')) {// 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  1739. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  1740. }
  1741. }
  1742. this.$vm = vm;
  1743. this.$vm.$mp = {
  1744. app: this };
  1745. this.$vm.$scope = this;
  1746. // vm 上也挂载 globalData
  1747. this.$vm.globalData = this.globalData;
  1748. this.$vm._isMounted = true;
  1749. this.$vm.__call_hook('mounted', args);
  1750. this.$vm.__call_hook('onLaunch', args);
  1751. } };
  1752. // 兼容旧版本 globalData
  1753. appOptions.globalData = vm.$options.globalData || {};
  1754. // 将 methods 中的方法挂在 getApp() 中
  1755. var methods = vm.$options.methods;
  1756. if (methods) {
  1757. Object.keys(methods).forEach(function (name) {
  1758. appOptions[name] = methods[name];
  1759. });
  1760. }
  1761. initAppLocale(_vue.default, vm, normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN);
  1762. initHooks(appOptions, hooks);
  1763. initUnknownHooks(appOptions, vm.$options);
  1764. return appOptions;
  1765. }
  1766. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1767. function findVmByVueId(vm, vuePid) {
  1768. var $children = vm.$children;
  1769. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1770. for (var i = $children.length - 1; i >= 0; i--) {
  1771. var childVm = $children[i];
  1772. if (childVm.$scope._$vueId === vuePid) {
  1773. return childVm;
  1774. }
  1775. }
  1776. // 反向递归查找
  1777. var parentVm;
  1778. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1779. parentVm = findVmByVueId($children[_i], vuePid);
  1780. if (parentVm) {
  1781. return parentVm;
  1782. }
  1783. }
  1784. }
  1785. function initBehavior(options) {
  1786. return Behavior(options);
  1787. }
  1788. function isPage() {
  1789. return !!this.route;
  1790. }
  1791. function initRelation(detail) {
  1792. this.triggerEvent('__l', detail);
  1793. }
  1794. function selectAllComponents(mpInstance, selector, $refs) {
  1795. var components = mpInstance.selectAllComponents(selector);
  1796. components.forEach(function (component) {
  1797. var ref = component.dataset.ref;
  1798. $refs[ref] = component.$vm || component;
  1799. {
  1800. if (component.dataset.vueGeneric === 'scoped') {
  1801. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  1802. selectAllComponents(scopedComponent, selector, $refs);
  1803. });
  1804. }
  1805. }
  1806. });
  1807. }
  1808. function initRefs(vm) {
  1809. var mpInstance = vm.$scope;
  1810. Object.defineProperty(vm, '$refs', {
  1811. get: function get() {
  1812. var $refs = {};
  1813. selectAllComponents(mpInstance, '.vue-ref', $refs);
  1814. // TODO 暂不考虑 for 中的 scoped
  1815. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for');
  1816. forComponents.forEach(function (component) {
  1817. var ref = component.dataset.ref;
  1818. if (!$refs[ref]) {
  1819. $refs[ref] = [];
  1820. }
  1821. $refs[ref].push(component.$vm || component);
  1822. });
  1823. return $refs;
  1824. } });
  1825. }
  1826. function handleLink(event) {var _ref4 =
  1827. event.detail || event.value,vuePid = _ref4.vuePid,vueOptions = _ref4.vueOptions; // detail 是微信,value 是百度(dipatch)
  1828. var parentVm;
  1829. if (vuePid) {
  1830. parentVm = findVmByVueId(this.$vm, vuePid);
  1831. }
  1832. if (!parentVm) {
  1833. parentVm = this.$vm;
  1834. }
  1835. vueOptions.parent = parentVm;
  1836. }
  1837. function parseApp(vm) {
  1838. return parseBaseApp(vm, {
  1839. mocks: mocks,
  1840. initRefs: initRefs });
  1841. }
  1842. function createApp(vm) {
  1843. App(parseApp(vm));
  1844. return vm;
  1845. }
  1846. var encodeReserveRE = /[!'()*]/g;
  1847. var encodeReserveReplacer = function encodeReserveReplacer(c) {return '%' + c.charCodeAt(0).toString(16);};
  1848. var commaRE = /%2C/g;
  1849. // fixed encodeURIComponent which is more conformant to RFC3986:
  1850. // - escapes [!'()*]
  1851. // - preserve commas
  1852. var encode = function encode(str) {return encodeURIComponent(str).
  1853. replace(encodeReserveRE, encodeReserveReplacer).
  1854. replace(commaRE, ',');};
  1855. function stringifyQuery(obj) {var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  1856. var res = obj ? Object.keys(obj).map(function (key) {
  1857. var val = obj[key];
  1858. if (val === undefined) {
  1859. return '';
  1860. }
  1861. if (val === null) {
  1862. return encodeStr(key);
  1863. }
  1864. if (Array.isArray(val)) {
  1865. var result = [];
  1866. val.forEach(function (val2) {
  1867. if (val2 === undefined) {
  1868. return;
  1869. }
  1870. if (val2 === null) {
  1871. result.push(encodeStr(key));
  1872. } else {
  1873. result.push(encodeStr(key) + '=' + encodeStr(val2));
  1874. }
  1875. });
  1876. return result.join('&');
  1877. }
  1878. return encodeStr(key) + '=' + encodeStr(val);
  1879. }).filter(function (x) {return x.length > 0;}).join('&') : null;
  1880. return res ? "?".concat(res) : '';
  1881. }
  1882. function parseBaseComponent(vueComponentOptions)
  1883. {var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},isPage = _ref5.isPage,initRelation = _ref5.initRelation;var _initVueComponent =
  1884. initVueComponent(_vue.default, vueComponentOptions),_initVueComponent2 = _slicedToArray(_initVueComponent, 2),VueComponent = _initVueComponent2[0],vueOptions = _initVueComponent2[1];
  1885. var options = _objectSpread({
  1886. multipleSlots: true,
  1887. addGlobalClass: true },
  1888. vueOptions.options || {});
  1889. {
  1890. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  1891. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  1892. Object.assign(options, vueOptions['mp-weixin'].options);
  1893. }
  1894. }
  1895. var componentOptions = {
  1896. options: options,
  1897. data: initData(vueOptions, _vue.default.prototype),
  1898. behaviors: initBehaviors(vueOptions, initBehavior),
  1899. properties: initProperties(vueOptions.props, false, vueOptions.__file, options),
  1900. lifetimes: {
  1901. attached: function attached() {
  1902. var properties = this.properties;
  1903. var options = {
  1904. mpType: isPage.call(this) ? 'page' : 'component',
  1905. mpInstance: this,
  1906. propsData: properties };
  1907. initVueIds(properties.vueId, this);
  1908. // 处理父子关系
  1909. initRelation.call(this, {
  1910. vuePid: this._$vuePid,
  1911. vueOptions: options });
  1912. // 初始化 vue 实例
  1913. this.$vm = new VueComponent(options);
  1914. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  1915. initSlots(this.$vm, properties.vueSlots);
  1916. // 触发首次 setData
  1917. this.$vm.$mount();
  1918. },
  1919. ready: function ready() {
  1920. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  1921. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  1922. if (this.$vm) {
  1923. this.$vm._isMounted = true;
  1924. this.$vm.__call_hook('mounted');
  1925. this.$vm.__call_hook('onReady');
  1926. }
  1927. },
  1928. detached: function detached() {
  1929. this.$vm && this.$vm.$destroy();
  1930. } },
  1931. pageLifetimes: {
  1932. show: function show(args) {
  1933. this.$vm && this.$vm.__call_hook('onPageShow', args);
  1934. },
  1935. hide: function hide() {
  1936. this.$vm && this.$vm.__call_hook('onPageHide');
  1937. },
  1938. resize: function resize(size) {
  1939. this.$vm && this.$vm.__call_hook('onPageResize', size);
  1940. } },
  1941. methods: {
  1942. __l: handleLink,
  1943. __e: handleEvent } };
  1944. // externalClasses
  1945. if (vueOptions.externalClasses) {
  1946. componentOptions.externalClasses = vueOptions.externalClasses;
  1947. }
  1948. if (Array.isArray(vueOptions.wxsCallMethods)) {
  1949. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  1950. componentOptions.methods[callMethod] = function (args) {
  1951. return this.$vm[callMethod](args);
  1952. };
  1953. });
  1954. }
  1955. if (isPage) {
  1956. return componentOptions;
  1957. }
  1958. return [componentOptions, VueComponent];
  1959. }
  1960. function parseComponent(vueComponentOptions) {
  1961. return parseBaseComponent(vueComponentOptions, {
  1962. isPage: isPage,
  1963. initRelation: initRelation });
  1964. }
  1965. var hooks$1 = [
  1966. 'onShow',
  1967. 'onHide',
  1968. 'onUnload'];
  1969. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  1970. function parseBasePage(vuePageOptions, _ref6)
  1971. {var isPage = _ref6.isPage,initRelation = _ref6.initRelation;
  1972. var pageOptions = parseComponent(vuePageOptions);
  1973. initHooks(pageOptions.methods, hooks$1, vuePageOptions);
  1974. pageOptions.methods.onLoad = function (query) {
  1975. this.options = query;
  1976. var copyQuery = Object.assign({}, query);
  1977. delete copyQuery.__id__;
  1978. this.$page = {
  1979. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery) };
  1980. this.$vm.$mp.query = query; // 兼容 mpvue
  1981. this.$vm.__call_hook('onLoad', query);
  1982. };
  1983. initUnknownHooks(pageOptions.methods, vuePageOptions, ['onReady']);
  1984. return pageOptions;
  1985. }
  1986. function parsePage(vuePageOptions) {
  1987. return parseBasePage(vuePageOptions, {
  1988. isPage: isPage,
  1989. initRelation: initRelation });
  1990. }
  1991. function createPage(vuePageOptions) {
  1992. {
  1993. return Component(parsePage(vuePageOptions));
  1994. }
  1995. }
  1996. function createComponent(vueOptions) {
  1997. {
  1998. return Component(parseComponent(vueOptions));
  1999. }
  2000. }
  2001. function createSubpackageApp(vm) {
  2002. var appOptions = parseApp(vm);
  2003. var app = getApp({
  2004. allowDefault: true });
  2005. vm.$scope = app;
  2006. var globalData = app.globalData;
  2007. if (globalData) {
  2008. Object.keys(appOptions.globalData).forEach(function (name) {
  2009. if (!hasOwn(globalData, name)) {
  2010. globalData[name] = appOptions.globalData[name];
  2011. }
  2012. });
  2013. }
  2014. Object.keys(appOptions).forEach(function (name) {
  2015. if (!hasOwn(app, name)) {
  2016. app[name] = appOptions[name];
  2017. }
  2018. });
  2019. if (isFn(appOptions.onShow) && wx.onAppShow) {
  2020. wx.onAppShow(function () {for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {args[_key5] = arguments[_key5];}
  2021. vm.__call_hook('onShow', args);
  2022. });
  2023. }
  2024. if (isFn(appOptions.onHide) && wx.onAppHide) {
  2025. wx.onAppHide(function () {for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {args[_key6] = arguments[_key6];}
  2026. vm.__call_hook('onHide', args);
  2027. });
  2028. }
  2029. if (isFn(appOptions.onLaunch)) {
  2030. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  2031. vm.__call_hook('onLaunch', args);
  2032. }
  2033. return vm;
  2034. }
  2035. function createPlugin(vm) {
  2036. var appOptions = parseApp(vm);
  2037. if (isFn(appOptions.onShow) && wx.onAppShow) {
  2038. wx.onAppShow(function () {for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {args[_key7] = arguments[_key7];}
  2039. vm.__call_hook('onShow', args);
  2040. });
  2041. }
  2042. if (isFn(appOptions.onHide) && wx.onAppHide) {
  2043. wx.onAppHide(function () {for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {args[_key8] = arguments[_key8];}
  2044. vm.__call_hook('onHide', args);
  2045. });
  2046. }
  2047. if (isFn(appOptions.onLaunch)) {
  2048. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  2049. vm.__call_hook('onLaunch', args);
  2050. }
  2051. return vm;
  2052. }
  2053. todos.forEach(function (todoApi) {
  2054. protocols[todoApi] = false;
  2055. });
  2056. canIUses.forEach(function (canIUseApi) {
  2057. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name :
  2058. canIUseApi;
  2059. if (!wx.canIUse(apiName)) {
  2060. protocols[canIUseApi] = false;
  2061. }
  2062. });
  2063. var uni = {};
  2064. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  2065. uni = new Proxy({}, {
  2066. get: function get(target, name) {
  2067. if (hasOwn(target, name)) {
  2068. return target[name];
  2069. }
  2070. if (baseApi[name]) {
  2071. return baseApi[name];
  2072. }
  2073. if (api[name]) {
  2074. return promisify(name, api[name]);
  2075. }
  2076. {
  2077. if (extraApi[name]) {
  2078. return promisify(name, extraApi[name]);
  2079. }
  2080. if (todoApis[name]) {
  2081. return promisify(name, todoApis[name]);
  2082. }
  2083. }
  2084. if (eventApi[name]) {
  2085. return eventApi[name];
  2086. }
  2087. if (!hasOwn(wx, name) && !hasOwn(protocols, name)) {
  2088. return;
  2089. }
  2090. return promisify(name, wrapper(name, wx[name]));
  2091. },
  2092. set: function set(target, name, value) {
  2093. target[name] = value;
  2094. return true;
  2095. } });
  2096. } else {
  2097. Object.keys(baseApi).forEach(function (name) {
  2098. uni[name] = baseApi[name];
  2099. });
  2100. {
  2101. Object.keys(todoApis).forEach(function (name) {
  2102. uni[name] = promisify(name, todoApis[name]);
  2103. });
  2104. Object.keys(extraApi).forEach(function (name) {
  2105. uni[name] = promisify(name, todoApis[name]);
  2106. });
  2107. }
  2108. Object.keys(eventApi).forEach(function (name) {
  2109. uni[name] = eventApi[name];
  2110. });
  2111. Object.keys(api).forEach(function (name) {
  2112. uni[name] = promisify(name, api[name]);
  2113. });
  2114. Object.keys(wx).forEach(function (name) {
  2115. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  2116. uni[name] = promisify(name, wrapper(name, wx[name]));
  2117. }
  2118. });
  2119. }
  2120. wx.createApp = createApp;
  2121. wx.createPage = createPage;
  2122. wx.createComponent = createComponent;
  2123. wx.createSubpackageApp = createSubpackageApp;
  2124. wx.createPlugin = createPlugin;
  2125. var uni$1 = uni;var _default =
  2126. uni$1;exports.default = _default;
  2127. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 2)))
  2128. /***/ }),
  2129. /***/ 10:
  2130. /*!************************************************************!*\
  2131. !*** ./node_modules/regenerator-runtime/runtime-module.js ***!
  2132. \************************************************************/
  2133. /*! no static exports found */
  2134. /***/ (function(module, exports, __webpack_require__) {
  2135. /**
  2136. * Copyright (c) 2014-present, Facebook, Inc.
  2137. *
  2138. * This source code is licensed under the MIT license found in the
  2139. * LICENSE file in the root directory of this source tree.
  2140. */
  2141. // This method of obtaining a reference to the global object needs to be
  2142. // kept identical to the way it is obtained in runtime.js
  2143. var g = (function() {
  2144. return this || (typeof self === "object" && self);
  2145. })() || Function("return this")();
  2146. // Use `getOwnPropertyNames` because not all browsers support calling
  2147. // `hasOwnProperty` on the global `self` object in a worker. See #183.
  2148. var hadRuntime = g.regeneratorRuntime &&
  2149. Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0;
  2150. // Save the old regeneratorRuntime in case it needs to be restored later.
  2151. var oldRuntime = hadRuntime && g.regeneratorRuntime;
  2152. // Force reevalutation of runtime.js.
  2153. g.regeneratorRuntime = undefined;
  2154. module.exports = __webpack_require__(/*! ./runtime */ 11);
  2155. if (hadRuntime) {
  2156. // Restore the original runtime.
  2157. g.regeneratorRuntime = oldRuntime;
  2158. } else {
  2159. // Remove the global property added by runtime.js.
  2160. try {
  2161. delete g.regeneratorRuntime;
  2162. } catch(e) {
  2163. g.regeneratorRuntime = undefined;
  2164. }
  2165. }
  2166. /***/ }),
  2167. /***/ 11:
  2168. /*!*****************************************************!*\
  2169. !*** ./node_modules/regenerator-runtime/runtime.js ***!
  2170. \*****************************************************/
  2171. /*! no static exports found */
  2172. /***/ (function(module, exports) {
  2173. /**
  2174. * Copyright (c) 2014-present, Facebook, Inc.
  2175. *
  2176. * This source code is licensed under the MIT license found in the
  2177. * LICENSE file in the root directory of this source tree.
  2178. */
  2179. !(function(global) {
  2180. "use strict";
  2181. var Op = Object.prototype;
  2182. var hasOwn = Op.hasOwnProperty;
  2183. var undefined; // More compressible than void 0.
  2184. var $Symbol = typeof Symbol === "function" ? Symbol : {};
  2185. var iteratorSymbol = $Symbol.iterator || "@@iterator";
  2186. var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
  2187. var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  2188. var inModule = typeof module === "object";
  2189. var runtime = global.regeneratorRuntime;
  2190. if (runtime) {
  2191. if (inModule) {
  2192. // If regeneratorRuntime is defined globally and we're in a module,
  2193. // make the exports object identical to regeneratorRuntime.
  2194. module.exports = runtime;
  2195. }
  2196. // Don't bother evaluating the rest of this file if the runtime was
  2197. // already defined globally.
  2198. return;
  2199. }
  2200. // Define the runtime globally (as expected by generated code) as either
  2201. // module.exports (if we're in a module) or a new, empty object.
  2202. runtime = global.regeneratorRuntime = inModule ? module.exports : {};
  2203. function wrap(innerFn, outerFn, self, tryLocsList) {
  2204. // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
  2205. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
  2206. var generator = Object.create(protoGenerator.prototype);
  2207. var context = new Context(tryLocsList || []);
  2208. // The ._invoke method unifies the implementations of the .next,
  2209. // .throw, and .return methods.
  2210. generator._invoke = makeInvokeMethod(innerFn, self, context);
  2211. return generator;
  2212. }
  2213. runtime.wrap = wrap;
  2214. // Try/catch helper to minimize deoptimizations. Returns a completion
  2215. // record like context.tryEntries[i].completion. This interface could
  2216. // have been (and was previously) designed to take a closure to be
  2217. // invoked without arguments, but in all the cases we care about we
  2218. // already have an existing method we want to call, so there's no need
  2219. // to create a new function object. We can even get away with assuming
  2220. // the method takes exactly one argument, since that happens to be true
  2221. // in every case, so we don't have to touch the arguments object. The
  2222. // only additional allocation required is the completion record, which
  2223. // has a stable shape and so hopefully should be cheap to allocate.
  2224. function tryCatch(fn, obj, arg) {
  2225. try {
  2226. return { type: "normal", arg: fn.call(obj, arg) };
  2227. } catch (err) {
  2228. return { type: "throw", arg: err };
  2229. }
  2230. }
  2231. var GenStateSuspendedStart = "suspendedStart";
  2232. var GenStateSuspendedYield = "suspendedYield";
  2233. var GenStateExecuting = "executing";
  2234. var GenStateCompleted = "completed";
  2235. // Returning this object from the innerFn has the same effect as
  2236. // breaking out of the dispatch switch statement.
  2237. var ContinueSentinel = {};
  2238. // Dummy constructor functions that we use as the .constructor and
  2239. // .constructor.prototype properties for functions that return Generator
  2240. // objects. For full spec compliance, you may wish to configure your
  2241. // minifier not to mangle the names of these two functions.
  2242. function Generator() {}
  2243. function GeneratorFunction() {}
  2244. function GeneratorFunctionPrototype() {}
  2245. // This is a polyfill for %IteratorPrototype% for environments that
  2246. // don't natively support it.
  2247. var IteratorPrototype = {};
  2248. IteratorPrototype[iteratorSymbol] = function () {
  2249. return this;
  2250. };
  2251. var getProto = Object.getPrototypeOf;
  2252. var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  2253. if (NativeIteratorPrototype &&
  2254. NativeIteratorPrototype !== Op &&
  2255. hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
  2256. // This environment has a native %IteratorPrototype%; use it instead
  2257. // of the polyfill.
  2258. IteratorPrototype = NativeIteratorPrototype;
  2259. }
  2260. var Gp = GeneratorFunctionPrototype.prototype =
  2261. Generator.prototype = Object.create(IteratorPrototype);
  2262. GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
  2263. GeneratorFunctionPrototype.constructor = GeneratorFunction;
  2264. GeneratorFunctionPrototype[toStringTagSymbol] =
  2265. GeneratorFunction.displayName = "GeneratorFunction";
  2266. // Helper for defining the .next, .throw, and .return methods of the
  2267. // Iterator interface in terms of a single ._invoke method.
  2268. function defineIteratorMethods(prototype) {
  2269. ["next", "throw", "return"].forEach(function(method) {
  2270. prototype[method] = function(arg) {
  2271. return this._invoke(method, arg);
  2272. };
  2273. });
  2274. }
  2275. runtime.isGeneratorFunction = function(genFun) {
  2276. var ctor = typeof genFun === "function" && genFun.constructor;
  2277. return ctor
  2278. ? ctor === GeneratorFunction ||
  2279. // For the native GeneratorFunction constructor, the best we can
  2280. // do is to check its .name property.
  2281. (ctor.displayName || ctor.name) === "GeneratorFunction"
  2282. : false;
  2283. };
  2284. runtime.mark = function(genFun) {
  2285. if (Object.setPrototypeOf) {
  2286. Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
  2287. } else {
  2288. genFun.__proto__ = GeneratorFunctionPrototype;
  2289. if (!(toStringTagSymbol in genFun)) {
  2290. genFun[toStringTagSymbol] = "GeneratorFunction";
  2291. }
  2292. }
  2293. genFun.prototype = Object.create(Gp);
  2294. return genFun;
  2295. };
  2296. // Within the body of any async function, `await x` is transformed to
  2297. // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
  2298. // `hasOwn.call(value, "__await")` to determine if the yielded value is
  2299. // meant to be awaited.
  2300. runtime.awrap = function(arg) {
  2301. return { __await: arg };
  2302. };
  2303. function AsyncIterator(generator) {
  2304. function invoke(method, arg, resolve, reject) {
  2305. var record = tryCatch(generator[method], generator, arg);
  2306. if (record.type === "throw") {
  2307. reject(record.arg);
  2308. } else {
  2309. var result = record.arg;
  2310. var value = result.value;
  2311. if (value &&
  2312. typeof value === "object" &&
  2313. hasOwn.call(value, "__await")) {
  2314. return Promise.resolve(value.__await).then(function(value) {
  2315. invoke("next", value, resolve, reject);
  2316. }, function(err) {
  2317. invoke("throw", err, resolve, reject);
  2318. });
  2319. }
  2320. return Promise.resolve(value).then(function(unwrapped) {
  2321. // When a yielded Promise is resolved, its final value becomes
  2322. // the .value of the Promise<{value,done}> result for the
  2323. // current iteration.
  2324. result.value = unwrapped;
  2325. resolve(result);
  2326. }, function(error) {
  2327. // If a rejected Promise was yielded, throw the rejection back
  2328. // into the async generator function so it can be handled there.
  2329. return invoke("throw", error, resolve, reject);
  2330. });
  2331. }
  2332. }
  2333. var previousPromise;
  2334. function enqueue(method, arg) {
  2335. function callInvokeWithMethodAndArg() {
  2336. return new Promise(function(resolve, reject) {
  2337. invoke(method, arg, resolve, reject);
  2338. });
  2339. }
  2340. return previousPromise =
  2341. // If enqueue has been called before, then we want to wait until
  2342. // all previous Promises have been resolved before calling invoke,
  2343. // so that results are always delivered in the correct order. If
  2344. // enqueue has not been called before, then it is important to
  2345. // call invoke immediately, without waiting on a callback to fire,
  2346. // so that the async generator function has the opportunity to do
  2347. // any necessary setup in a predictable way. This predictability
  2348. // is why the Promise constructor synchronously invokes its
  2349. // executor callback, and why async functions synchronously
  2350. // execute code before the first await. Since we implement simple
  2351. // async functions in terms of async generators, it is especially
  2352. // important to get this right, even though it requires care.
  2353. previousPromise ? previousPromise.then(
  2354. callInvokeWithMethodAndArg,
  2355. // Avoid propagating failures to Promises returned by later
  2356. // invocations of the iterator.
  2357. callInvokeWithMethodAndArg
  2358. ) : callInvokeWithMethodAndArg();
  2359. }
  2360. // Define the unified helper method that is used to implement .next,
  2361. // .throw, and .return (see defineIteratorMethods).
  2362. this._invoke = enqueue;
  2363. }
  2364. defineIteratorMethods(AsyncIterator.prototype);
  2365. AsyncIterator.prototype[asyncIteratorSymbol] = function () {
  2366. return this;
  2367. };
  2368. runtime.AsyncIterator = AsyncIterator;
  2369. // Note that simple async functions are implemented on top of
  2370. // AsyncIterator objects; they just return a Promise for the value of
  2371. // the final result produced by the iterator.
  2372. runtime.async = function(innerFn, outerFn, self, tryLocsList) {
  2373. var iter = new AsyncIterator(
  2374. wrap(innerFn, outerFn, self, tryLocsList)
  2375. );
  2376. return runtime.isGeneratorFunction(outerFn)
  2377. ? iter // If outerFn is a generator, return the full iterator.
  2378. : iter.next().then(function(result) {
  2379. return result.done ? result.value : iter.next();
  2380. });
  2381. };
  2382. function makeInvokeMethod(innerFn, self, context) {
  2383. var state = GenStateSuspendedStart;
  2384. return function invoke(method, arg) {
  2385. if (state === GenStateExecuting) {
  2386. throw new Error("Generator is already running");
  2387. }
  2388. if (state === GenStateCompleted) {
  2389. if (method === "throw") {
  2390. throw arg;
  2391. }
  2392. // Be forgiving, per 25.3.3.3.3 of the spec:
  2393. // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
  2394. return doneResult();
  2395. }
  2396. context.method = method;
  2397. context.arg = arg;
  2398. while (true) {
  2399. var delegate = context.delegate;
  2400. if (delegate) {
  2401. var delegateResult = maybeInvokeDelegate(delegate, context);
  2402. if (delegateResult) {
  2403. if (delegateResult === ContinueSentinel) continue;
  2404. return delegateResult;
  2405. }
  2406. }
  2407. if (context.method === "next") {
  2408. // Setting context._sent for legacy support of Babel's
  2409. // function.sent implementation.
  2410. context.sent = context._sent = context.arg;
  2411. } else if (context.method === "throw") {
  2412. if (state === GenStateSuspendedStart) {
  2413. state = GenStateCompleted;
  2414. throw context.arg;
  2415. }
  2416. context.dispatchException(context.arg);
  2417. } else if (context.method === "return") {
  2418. context.abrupt("return", context.arg);
  2419. }
  2420. state = GenStateExecuting;
  2421. var record = tryCatch(innerFn, self, context);
  2422. if (record.type === "normal") {
  2423. // If an exception is thrown from innerFn, we leave state ===
  2424. // GenStateExecuting and loop back for another invocation.
  2425. state = context.done
  2426. ? GenStateCompleted
  2427. : GenStateSuspendedYield;
  2428. if (record.arg === ContinueSentinel) {
  2429. continue;
  2430. }
  2431. return {
  2432. value: record.arg,
  2433. done: context.done
  2434. };
  2435. } else if (record.type === "throw") {
  2436. state = GenStateCompleted;
  2437. // Dispatch the exception by looping back around to the
  2438. // context.dispatchException(context.arg) call above.
  2439. context.method = "throw";
  2440. context.arg = record.arg;
  2441. }
  2442. }
  2443. };
  2444. }
  2445. // Call delegate.iterator[context.method](context.arg) and handle the
  2446. // result, either by returning a { value, done } result from the
  2447. // delegate iterator, or by modifying context.method and context.arg,
  2448. // setting context.delegate to null, and returning the ContinueSentinel.
  2449. function maybeInvokeDelegate(delegate, context) {
  2450. var method = delegate.iterator[context.method];
  2451. if (method === undefined) {
  2452. // A .throw or .return when the delegate iterator has no .throw
  2453. // method always terminates the yield* loop.
  2454. context.delegate = null;
  2455. if (context.method === "throw") {
  2456. if (delegate.iterator.return) {
  2457. // If the delegate iterator has a return method, give it a
  2458. // chance to clean up.
  2459. context.method = "return";
  2460. context.arg = undefined;
  2461. maybeInvokeDelegate(delegate, context);
  2462. if (context.method === "throw") {
  2463. // If maybeInvokeDelegate(context) changed context.method from
  2464. // "return" to "throw", let that override the TypeError below.
  2465. return ContinueSentinel;
  2466. }
  2467. }
  2468. context.method = "throw";
  2469. context.arg = new TypeError(
  2470. "The iterator does not provide a 'throw' method");
  2471. }
  2472. return ContinueSentinel;
  2473. }
  2474. var record = tryCatch(method, delegate.iterator, context.arg);
  2475. if (record.type === "throw") {
  2476. context.method = "throw";
  2477. context.arg = record.arg;
  2478. context.delegate = null;
  2479. return ContinueSentinel;
  2480. }
  2481. var info = record.arg;
  2482. if (! info) {
  2483. context.method = "throw";
  2484. context.arg = new TypeError("iterator result is not an object");
  2485. context.delegate = null;
  2486. return ContinueSentinel;
  2487. }
  2488. if (info.done) {
  2489. // Assign the result of the finished delegate to the temporary
  2490. // variable specified by delegate.resultName (see delegateYield).
  2491. context[delegate.resultName] = info.value;
  2492. // Resume execution at the desired location (see delegateYield).
  2493. context.next = delegate.nextLoc;
  2494. // If context.method was "throw" but the delegate handled the
  2495. // exception, let the outer generator proceed normally. If
  2496. // context.method was "next", forget context.arg since it has been
  2497. // "consumed" by the delegate iterator. If context.method was
  2498. // "return", allow the original .return call to continue in the
  2499. // outer generator.
  2500. if (context.method !== "return") {
  2501. context.method = "next";
  2502. context.arg = undefined;
  2503. }
  2504. } else {
  2505. // Re-yield the result returned by the delegate method.
  2506. return info;
  2507. }
  2508. // The delegate iterator is finished, so forget it and continue with
  2509. // the outer generator.
  2510. context.delegate = null;
  2511. return ContinueSentinel;
  2512. }
  2513. // Define Generator.prototype.{next,throw,return} in terms of the
  2514. // unified ._invoke helper method.
  2515. defineIteratorMethods(Gp);
  2516. Gp[toStringTagSymbol] = "Generator";
  2517. // A Generator should always return itself as the iterator object when the
  2518. // @@iterator function is called on it. Some browsers' implementations of the
  2519. // iterator prototype chain incorrectly implement this, causing the Generator
  2520. // object to not be returned from this call. This ensures that doesn't happen.
  2521. // See https://github.com/facebook/regenerator/issues/274 for more details.
  2522. Gp[iteratorSymbol] = function() {
  2523. return this;
  2524. };
  2525. Gp.toString = function() {
  2526. return "[object Generator]";
  2527. };
  2528. function pushTryEntry(locs) {
  2529. var entry = { tryLoc: locs[0] };
  2530. if (1 in locs) {
  2531. entry.catchLoc = locs[1];
  2532. }
  2533. if (2 in locs) {
  2534. entry.finallyLoc = locs[2];
  2535. entry.afterLoc = locs[3];
  2536. }
  2537. this.tryEntries.push(entry);
  2538. }
  2539. function resetTryEntry(entry) {
  2540. var record = entry.completion || {};
  2541. record.type = "normal";
  2542. delete record.arg;
  2543. entry.completion = record;
  2544. }
  2545. function Context(tryLocsList) {
  2546. // The root entry object (effectively a try statement without a catch
  2547. // or a finally block) gives us a place to store values thrown from
  2548. // locations where there is no enclosing try statement.
  2549. this.tryEntries = [{ tryLoc: "root" }];
  2550. tryLocsList.forEach(pushTryEntry, this);
  2551. this.reset(true);
  2552. }
  2553. runtime.keys = function(object) {
  2554. var keys = [];
  2555. for (var key in object) {
  2556. keys.push(key);
  2557. }
  2558. keys.reverse();
  2559. // Rather than returning an object with a next method, we keep
  2560. // things simple and return the next function itself.
  2561. return function next() {
  2562. while (keys.length) {
  2563. var key = keys.pop();
  2564. if (key in object) {
  2565. next.value = key;
  2566. next.done = false;
  2567. return next;
  2568. }
  2569. }
  2570. // To avoid creating an additional object, we just hang the .value
  2571. // and .done properties off the next function object itself. This
  2572. // also ensures that the minifier will not anonymize the function.
  2573. next.done = true;
  2574. return next;
  2575. };
  2576. };
  2577. function values(iterable) {
  2578. if (iterable) {
  2579. var iteratorMethod = iterable[iteratorSymbol];
  2580. if (iteratorMethod) {
  2581. return iteratorMethod.call(iterable);
  2582. }
  2583. if (typeof iterable.next === "function") {
  2584. return iterable;
  2585. }
  2586. if (!isNaN(iterable.length)) {
  2587. var i = -1, next = function next() {
  2588. while (++i < iterable.length) {
  2589. if (hasOwn.call(iterable, i)) {
  2590. next.value = iterable[i];
  2591. next.done = false;
  2592. return next;
  2593. }
  2594. }
  2595. next.value = undefined;
  2596. next.done = true;
  2597. return next;
  2598. };
  2599. return next.next = next;
  2600. }
  2601. }
  2602. // Return an iterator with no values.
  2603. return { next: doneResult };
  2604. }
  2605. runtime.values = values;
  2606. function doneResult() {
  2607. return { value: undefined, done: true };
  2608. }
  2609. Context.prototype = {
  2610. constructor: Context,
  2611. reset: function(skipTempReset) {
  2612. this.prev = 0;
  2613. this.next = 0;
  2614. // Resetting context._sent for legacy support of Babel's
  2615. // function.sent implementation.
  2616. this.sent = this._sent = undefined;
  2617. this.done = false;
  2618. this.delegate = null;
  2619. this.method = "next";
  2620. this.arg = undefined;
  2621. this.tryEntries.forEach(resetTryEntry);
  2622. if (!skipTempReset) {
  2623. for (var name in this) {
  2624. // Not sure about the optimal order of these conditions:
  2625. if (name.charAt(0) === "t" &&
  2626. hasOwn.call(this, name) &&
  2627. !isNaN(+name.slice(1))) {
  2628. this[name] = undefined;
  2629. }
  2630. }
  2631. }
  2632. },
  2633. stop: function() {
  2634. this.done = true;
  2635. var rootEntry = this.tryEntries[0];
  2636. var rootRecord = rootEntry.completion;
  2637. if (rootRecord.type === "throw") {
  2638. throw rootRecord.arg;
  2639. }
  2640. return this.rval;
  2641. },
  2642. dispatchException: function(exception) {
  2643. if (this.done) {
  2644. throw exception;
  2645. }
  2646. var context = this;
  2647. function handle(loc, caught) {
  2648. record.type = "throw";
  2649. record.arg = exception;
  2650. context.next = loc;
  2651. if (caught) {
  2652. // If the dispatched exception was caught by a catch block,
  2653. // then let that catch block handle the exception normally.
  2654. context.method = "next";
  2655. context.arg = undefined;
  2656. }
  2657. return !! caught;
  2658. }
  2659. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  2660. var entry = this.tryEntries[i];
  2661. var record = entry.completion;
  2662. if (entry.tryLoc === "root") {
  2663. // Exception thrown outside of any try block that could handle
  2664. // it, so set the completion value of the entire function to
  2665. // throw the exception.
  2666. return handle("end");
  2667. }
  2668. if (entry.tryLoc <= this.prev) {
  2669. var hasCatch = hasOwn.call(entry, "catchLoc");
  2670. var hasFinally = hasOwn.call(entry, "finallyLoc");
  2671. if (hasCatch && hasFinally) {
  2672. if (this.prev < entry.catchLoc) {
  2673. return handle(entry.catchLoc, true);
  2674. } else if (this.prev < entry.finallyLoc) {
  2675. return handle(entry.finallyLoc);
  2676. }
  2677. } else if (hasCatch) {
  2678. if (this.prev < entry.catchLoc) {
  2679. return handle(entry.catchLoc, true);
  2680. }
  2681. } else if (hasFinally) {
  2682. if (this.prev < entry.finallyLoc) {
  2683. return handle(entry.finallyLoc);
  2684. }
  2685. } else {
  2686. throw new Error("try statement without catch or finally");
  2687. }
  2688. }
  2689. }
  2690. },
  2691. abrupt: function(type, arg) {
  2692. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  2693. var entry = this.tryEntries[i];
  2694. if (entry.tryLoc <= this.prev &&
  2695. hasOwn.call(entry, "finallyLoc") &&
  2696. this.prev < entry.finallyLoc) {
  2697. var finallyEntry = entry;
  2698. break;
  2699. }
  2700. }
  2701. if (finallyEntry &&
  2702. (type === "break" ||
  2703. type === "continue") &&
  2704. finallyEntry.tryLoc <= arg &&
  2705. arg <= finallyEntry.finallyLoc) {
  2706. // Ignore the finally entry if control is not jumping to a
  2707. // location outside the try/catch block.
  2708. finallyEntry = null;
  2709. }
  2710. var record = finallyEntry ? finallyEntry.completion : {};
  2711. record.type = type;
  2712. record.arg = arg;
  2713. if (finallyEntry) {
  2714. this.method = "next";
  2715. this.next = finallyEntry.finallyLoc;
  2716. return ContinueSentinel;
  2717. }
  2718. return this.complete(record);
  2719. },
  2720. complete: function(record, afterLoc) {
  2721. if (record.type === "throw") {
  2722. throw record.arg;
  2723. }
  2724. if (record.type === "break" ||
  2725. record.type === "continue") {
  2726. this.next = record.arg;
  2727. } else if (record.type === "return") {
  2728. this.rval = this.arg = record.arg;
  2729. this.method = "return";
  2730. this.next = "end";
  2731. } else if (record.type === "normal" && afterLoc) {
  2732. this.next = afterLoc;
  2733. }
  2734. return ContinueSentinel;
  2735. },
  2736. finish: function(finallyLoc) {
  2737. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  2738. var entry = this.tryEntries[i];
  2739. if (entry.finallyLoc === finallyLoc) {
  2740. this.complete(entry.completion, entry.afterLoc);
  2741. resetTryEntry(entry);
  2742. return ContinueSentinel;
  2743. }
  2744. }
  2745. },
  2746. "catch": function(tryLoc) {
  2747. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  2748. var entry = this.tryEntries[i];
  2749. if (entry.tryLoc === tryLoc) {
  2750. var record = entry.completion;
  2751. if (record.type === "throw") {
  2752. var thrown = record.arg;
  2753. resetTryEntry(entry);
  2754. }
  2755. return thrown;
  2756. }
  2757. }
  2758. // The context.catch method must only be called with a location
  2759. // argument that corresponds to a known catch block.
  2760. throw new Error("illegal catch attempt");
  2761. },
  2762. delegateYield: function(iterable, resultName, nextLoc) {
  2763. this.delegate = {
  2764. iterator: values(iterable),
  2765. resultName: resultName,
  2766. nextLoc: nextLoc
  2767. };
  2768. if (this.method === "next") {
  2769. // Deliberately forget the last sent value so that we don't
  2770. // accidentally pass it on to the delegate.
  2771. this.arg = undefined;
  2772. }
  2773. return ContinueSentinel;
  2774. }
  2775. };
  2776. })(
  2777. // In sloppy mode, unbound `this` refers to the global object, fallback to
  2778. // Function constructor if we're in global strict mode. That is sadly a form
  2779. // of indirect eval which violates Content Security Policy.
  2780. (function() {
  2781. return this || (typeof self === "object" && self);
  2782. })() || Function("return this")()
  2783. );
  2784. /***/ }),
  2785. /***/ 14:
  2786. /*!**********************************************************************************************************!*\
  2787. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  2788. \**********************************************************************************************************/
  2789. /*! exports provided: default */
  2790. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2791. "use strict";
  2792. __webpack_require__.r(__webpack_exports__);
  2793. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  2794. /* globals __VUE_SSR_CONTEXT__ */
  2795. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  2796. // This module is a runtime utility for cleaner component module output and will
  2797. // be included in the final webpack user bundle.
  2798. function normalizeComponent (
  2799. scriptExports,
  2800. render,
  2801. staticRenderFns,
  2802. functionalTemplate,
  2803. injectStyles,
  2804. scopeId,
  2805. moduleIdentifier, /* server only */
  2806. shadowMode, /* vue-cli only */
  2807. components, // fixed by xxxxxx auto components
  2808. renderjs // fixed by xxxxxx renderjs
  2809. ) {
  2810. // Vue.extend constructor export interop
  2811. var options = typeof scriptExports === 'function'
  2812. ? scriptExports.options
  2813. : scriptExports
  2814. // fixed by xxxxxx auto components
  2815. if (components) {
  2816. if (!options.components) {
  2817. options.components = {}
  2818. }
  2819. var hasOwn = Object.prototype.hasOwnProperty
  2820. for (var name in components) {
  2821. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  2822. options.components[name] = components[name]
  2823. }
  2824. }
  2825. }
  2826. // fixed by xxxxxx renderjs
  2827. if (renderjs) {
  2828. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  2829. this[renderjs.__module] = this
  2830. });
  2831. (options.mixins || (options.mixins = [])).push(renderjs)
  2832. }
  2833. // render functions
  2834. if (render) {
  2835. options.render = render
  2836. options.staticRenderFns = staticRenderFns
  2837. options._compiled = true
  2838. }
  2839. // functional template
  2840. if (functionalTemplate) {
  2841. options.functional = true
  2842. }
  2843. // scopedId
  2844. if (scopeId) {
  2845. options._scopeId = 'data-v-' + scopeId
  2846. }
  2847. var hook
  2848. if (moduleIdentifier) { // server build
  2849. hook = function (context) {
  2850. // 2.3 injection
  2851. context =
  2852. context || // cached call
  2853. (this.$vnode && this.$vnode.ssrContext) || // stateful
  2854. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  2855. // 2.2 with runInNewContext: true
  2856. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  2857. context = __VUE_SSR_CONTEXT__
  2858. }
  2859. // inject component styles
  2860. if (injectStyles) {
  2861. injectStyles.call(this, context)
  2862. }
  2863. // register component module identifier for async chunk inferrence
  2864. if (context && context._registeredComponents) {
  2865. context._registeredComponents.add(moduleIdentifier)
  2866. }
  2867. }
  2868. // used by ssr in case component is cached and beforeCreate
  2869. // never gets called
  2870. options._ssrRegister = hook
  2871. } else if (injectStyles) {
  2872. hook = shadowMode
  2873. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  2874. : injectStyles
  2875. }
  2876. if (hook) {
  2877. if (options.functional) {
  2878. // for template-only hot-reload because in that case the render fn doesn't
  2879. // go through the normalizer
  2880. options._injectStyles = hook
  2881. // register for functioal component in vue file
  2882. var originalRender = options.render
  2883. options.render = function renderWithStyleInjection (h, context) {
  2884. hook.call(context)
  2885. return originalRender(h, context)
  2886. }
  2887. } else {
  2888. // inject component registration as beforeCreate hook
  2889. var existing = options.beforeCreate
  2890. options.beforeCreate = existing
  2891. ? [].concat(existing, hook)
  2892. : [hook]
  2893. }
  2894. }
  2895. return {
  2896. exports: scriptExports,
  2897. options: options
  2898. }
  2899. }
  2900. /***/ }),
  2901. /***/ 15:
  2902. /*!*************************************************************!*\
  2903. !*** E:/project/新耗材小程序/material_applet/common/weapp-jwt.js ***!
  2904. \*************************************************************/
  2905. /*! no static exports found */
  2906. /***/ (function(module, exports, __webpack_require__) {
  2907. "use strict";
  2908. Object.defineProperty(exports, "__esModule", { value: true });
  2909. var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
  2910. var b64re = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;
  2911. exports.weBtoa = function (string) {
  2912. string = String(string);
  2913. var bitmap,a,b,c,result = "",i = 0,rest = string.length % 3;
  2914. for (; i < string.length;) {
  2915. if ((a = string.charCodeAt(i++)) > 255 ||
  2916. (b = string.charCodeAt(i++)) > 255 ||
  2917. (c = string.charCodeAt(i++)) > 255)
  2918. throw new TypeError("Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.");
  2919. bitmap = a << 16 | b << 8 | c;
  2920. result += b64.charAt(bitmap >> 18 & 63) + b64.charAt(bitmap >> 12 & 63) +
  2921. b64.charAt(bitmap >> 6 & 63) + b64.charAt(bitmap & 63);
  2922. }
  2923. return rest ? result.slice(0, rest - 3) + "===".substring(rest) : result;
  2924. };
  2925. exports.weAtob = function (string) {
  2926. string = String(string).replace(/[\t\n\f\r ]+/g, "");
  2927. if (!b64re.test(string))
  2928. throw new TypeError("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  2929. string += "==".slice(2 - (string.length & 3));
  2930. var bitmap,result = "",r1,r2,i = 0;
  2931. for (; i < string.length;) {
  2932. bitmap = b64.indexOf(string.charAt(i++)) << 18 | b64.indexOf(string.charAt(i++)) << 12 |
  2933. (r1 = b64.indexOf(string.charAt(i++))) << 6 | (r2 = b64.indexOf(string.charAt(i++)));
  2934. result += r1 === 64 ? String.fromCharCode(bitmap >> 16 & 255) :
  2935. r2 === 64 ? String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255) :
  2936. String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255);
  2937. }
  2938. return result;
  2939. };
  2940. function b64DecodeUnicode(str) {
  2941. return decodeURIComponent(exports.weAtob(str).replace(/(.)/g, function (p) {
  2942. var code = p.charCodeAt(0).toString(16).toUpperCase();
  2943. if (code.length < 2) {
  2944. code = "0" + code;
  2945. }
  2946. return "%" + code;
  2947. }));
  2948. }
  2949. function base64_url_decode(str) {
  2950. var output = str.replace(/-/g, "+").replace(/_/g, "/");
  2951. switch (output.length % 4) {
  2952. case 0:
  2953. break;
  2954. case 2:
  2955. output += "==";
  2956. break;
  2957. case 3:
  2958. output += "=";
  2959. break;
  2960. default:
  2961. throw "Illegal base64url string!";}
  2962. try {
  2963. return b64DecodeUnicode(output);
  2964. }
  2965. catch (err) {
  2966. return exports.weAtob(output);
  2967. }
  2968. }
  2969. function weappJwtDecode(token, options) {
  2970. if (typeof token !== "string") {
  2971. throw "Invalid token specified";
  2972. }
  2973. options = options || {};
  2974. var pos = options.header === true ? 0 : 1;
  2975. try {
  2976. return JSON.parse(base64_url_decode(token.split(".")[pos]));
  2977. }
  2978. catch (e) {
  2979. throw "Invalid token specified: " + e.message;
  2980. }
  2981. }
  2982. exports.default = weappJwtDecode;
  2983. /***/ }),
  2984. /***/ 16:
  2985. /*!*******************************************************!*\
  2986. !*** E:/project/新耗材小程序/material_applet/common/api.js ***!
  2987. \*******************************************************/
  2988. /*! no static exports found */
  2989. /***/ (function(module, exports, __webpack_require__) {
  2990. "use strict";
  2991. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.requestFile = exports.requestBase = exports.getToken = void 0;var _regenerator = _interopRequireDefault(__webpack_require__(/*! ./node_modules/@babel/runtime/regenerator */ 9));var _config = _interopRequireDefault(__webpack_require__(/*! ../config.js */ 17));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {Promise.resolve(value).then(_next, _throw);}}function _asyncToGenerator(fn) {return function () {var self = this,args = arguments;return new Promise(function (resolve, reject) {var gen = fn.apply(self, args);function _next(value) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);}function _throw(err) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);}_next(undefined);});};}
  2992. var getDomain = function getDomain(uri, method, type) {
  2993. var wx_env = _config.default.wx_miniProgram;
  2994. var system = _config.default.system;
  2995. var url = _config.default.serverUrl;
  2996. var Fileurl = _config.default.serverFile;
  2997. if (type && type == 'file') return Fileurl + "/files" + uri;else
  2998. return url + "/material/v1/api" + uri;
  2999. };
  3000. // 获取token
  3001. var getToken = /*#__PURE__*/function () {var _ref = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee(uri) {var method,data,type,baseUrl,header,_args = arguments;return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:method = _args.length > 1 && _args[1] !== undefined ? _args[1] : 'GET';data = _args.length > 2 ? _args[2] : undefined;type = _args.length > 3 ? _args[3] : undefined;
  3002. baseUrl = getDomain(uri, method, type);
  3003. header = {
  3004. token: data.token };return _context.abrupt("return",
  3005. new Promise(function (resolve, reject) {
  3006. uni.request({
  3007. url: baseUrl,
  3008. method: method || 'GET',
  3009. data: data || {},
  3010. header: header,
  3011. success: function success(res) {
  3012. resolve(res.data);
  3013. },
  3014. fail: function fail(err) {
  3015. uni.showToast({
  3016. title: '请求接口失败',
  3017. icon: 'fail' });
  3018. reject(err.data);
  3019. } });
  3020. }));case 6:case "end":return _context.stop();}}}, _callee);}));return function getToken(_x) {return _ref.apply(this, arguments);};}();exports.getToken = getToken;
  3021. var requestBase = /*#__PURE__*/function () {var _ref2 = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee2(uri) {var method,data,type,baseUrl,header,token,_args2 = arguments;return _regenerator.default.wrap(function _callee2$(_context2) {while (1) {switch (_context2.prev = _context2.next) {case 0:method = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : 'GET';data = _args2.length > 2 ? _args2[2] : undefined;type = _args2.length > 3 ? _args2[3] : undefined;
  3022. baseUrl = getDomain(uri, method, type);
  3023. header = {};
  3024. token = uni.getStorageSync('token');
  3025. if (token) header.token = token;return _context2.abrupt("return",
  3026. new Promise(function (resolve, reject) {
  3027. uni.request({
  3028. url: baseUrl,
  3029. method: method || 'GET',
  3030. data: data || {},
  3031. header: header,
  3032. success: function success(res) {
  3033. resolve(res.data);
  3034. },
  3035. fail: function fail(err) {
  3036. uni.showToast({
  3037. title: '请求接口失败',
  3038. icon: 'fail' });
  3039. reject(err.data);
  3040. } });
  3041. }));case 8:case "end":return _context2.stop();}}}, _callee2);}));return function requestBase(_x2) {return _ref2.apply(this, arguments);};}();exports.requestBase = requestBase;
  3042. var requestFile = function requestFile(uri, method, data, type) {
  3043. var baseUrl = getDomain(uri, method, type);
  3044. return new Promise(function (resolve, reject) {
  3045. uni.uploadFile({
  3046. url: baseUrl,
  3047. filePath: data,
  3048. name: method || 'file',
  3049. formData: {},
  3050. success: function success(res) {
  3051. var data = JSON.parse(res.data);
  3052. if (data.errcode != '0') {
  3053. return uni.showToast({
  3054. title: data.errmsg,
  3055. icon: 'error' });
  3056. }
  3057. resolve(data);
  3058. },
  3059. fail: function fail(err) {
  3060. var data = JSON.parse(err.data);
  3061. uni.showToast({
  3062. title: '请求接口失败',
  3063. icon: 'fail' });
  3064. reject(data);
  3065. } });
  3066. });
  3067. };exports.requestFile = requestFile;
  3068. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  3069. /***/ }),
  3070. /***/ 17:
  3071. /*!***************************************************!*\
  3072. !*** E:/project/新耗材小程序/material_applet/config.js ***!
  3073. \***************************************************/
  3074. /*! no static exports found */
  3075. /***/ (function(module, exports, __webpack_require__) {
  3076. "use strict";
  3077. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 微信版本
  3078. var wx_min = uni.getAccountInfoSync();
  3079. // 设备信息
  3080. var system = uni.getSystemInfoSync();
  3081. var wx_projectkey = 'materialApp';
  3082. if (system.uniPlatform == 'mp-weixin') {
  3083. var envV = wx_min.miniProgram.envVersion;
  3084. }var _default =
  3085. {
  3086. serverFile: 'https://broadcast.waityou24.cn',
  3087. serverUrl: 'http://192.168.255.1:13004',
  3088. wx_projectkey: wx_projectkey,
  3089. wx_miniProgram: wx_min.miniProgram,
  3090. system: system,
  3091. share: {},
  3092. orderList: [{
  3093. icon: "icon-shenpi",
  3094. title: "待审批",
  3095. status: "0",
  3096. type: "order",
  3097. route: "pagesMy/order/index" },
  3098. {
  3099. icon: "icon-31daifahuo",
  3100. title: "待发货",
  3101. status: "1",
  3102. type: "order",
  3103. route: "pagesMy/order/index" },
  3104. {
  3105. icon: "icon-daishouhuo",
  3106. title: "待收货",
  3107. status: "2",
  3108. type: "order",
  3109. route: "pagesMy/order/index" },
  3110. {
  3111. icon: "icon-transaction",
  3112. title: "待回款",
  3113. status: "3",
  3114. type: "order",
  3115. route: "pagesMy/order/index" },
  3116. {
  3117. icon: "icon-shezhi",
  3118. title: "待维修",
  3119. status: "4",
  3120. type: "order",
  3121. route: "pagesMy/repair/index" }],
  3122. menuList: [
  3123. {
  3124. icon: "icon-shenpi1",
  3125. title: "用户管理",
  3126. role: ['jdgly'],
  3127. route: "pagesMy/user/index" },
  3128. {
  3129. icon: "icon-zhuyuanriqingdanchaxunbeifen",
  3130. title: "采购清单",
  3131. role: ['jdgly', 'jdry', 'sqry'],
  3132. route: "pagesMy/shop/index" },
  3133. {
  3134. icon: "icon-shangpinguanli",
  3135. title: "商品管理",
  3136. role: ['cs'],
  3137. route: "pagesMy/goods/index" },
  3138. {
  3139. icon: "icon-shenpi1",
  3140. title: "采购审批",
  3141. role: ['ld', 'kj'],
  3142. route: "pagesMy/buyExamine/index" },
  3143. {
  3144. icon: "icon-shenpi1",
  3145. title: "回款审批",
  3146. role: ['ld', 'kj'],
  3147. route: "pagesMy/collectionExamin/index" },
  3148. {
  3149. icon: "icon-zhuyuanriqingdanchaxunbeifen",
  3150. title: "回款记录",
  3151. role: ['cs'],
  3152. route: "pagesMy/record/index" },
  3153. {
  3154. icon: "icon-shenpi1",
  3155. title: "维修记录",
  3156. role: ['cs'],
  3157. route: "pagesMy/maintenance/index" },
  3158. {
  3159. icon: "icon-yonghu",
  3160. title: "账号设置",
  3161. role: ['jdgly', 'jdry', 'sqry', 'cs', 'ld', 'kj'],
  3162. route: "pagesMy/account/index" }],
  3163. china: [
  3164. //全国地址
  3165. {
  3166. name: '北京市',
  3167. city: [{
  3168. name: '北京市',
  3169. area: [
  3170. '东城区',
  3171. '西城区',
  3172. '崇文区',
  3173. '宣武区',
  3174. '朝阳区',
  3175. '丰台区',
  3176. '石景山区',
  3177. '海淀区',
  3178. '门头沟区',
  3179. '房山区',
  3180. '通州区',
  3181. '顺义区',
  3182. '昌平区',
  3183. '大兴区',
  3184. '平谷区',
  3185. '怀柔区',
  3186. '密云县',
  3187. '延庆县'] }] },
  3188. {
  3189. name: '天津市',
  3190. city: [{
  3191. name: '天津市',
  3192. area: [
  3193. '和平区',
  3194. '河东区',
  3195. '河西区',
  3196. '南开区',
  3197. '河北区',
  3198. '红桥区',
  3199. '塘沽区',
  3200. '汉沽区',
  3201. '大港区',
  3202. '东丽区',
  3203. '西青区',
  3204. '津南区',
  3205. '北辰区',
  3206. '武清区',
  3207. '宝坻区',
  3208. '宁河县',
  3209. '静海县',
  3210. '蓟 县'] }] },
  3211. {
  3212. name: '河北省',
  3213. city: [{
  3214. name: '石家庄市',
  3215. area: [
  3216. '长安区',
  3217. '桥东区',
  3218. '桥西区',
  3219. '新华区',
  3220. '郊 区',
  3221. '井陉矿区',
  3222. '井陉县',
  3223. '正定县',
  3224. '栾城县',
  3225. '行唐县',
  3226. '灵寿县',
  3227. '高邑县',
  3228. '深泽县',
  3229. '赞皇县',
  3230. '无极县',
  3231. '平山县',
  3232. '元氏县',
  3233. '赵 县',
  3234. '辛集市',
  3235. '藁',
  3236. '晋州市',
  3237. '新乐市',
  3238. '鹿泉市'] },
  3239. {
  3240. name: '唐山市',
  3241. area: ['路南区', '路北区', '古冶区', '开平区', '新 区', '丰润县', '滦 县', '滦南县', '乐亭县', '迁西县', '玉田县', '唐海县',
  3242. '遵化市', '丰南市', '迁安市'] },
  3243. {
  3244. name: '秦皇岛市',
  3245. area: ['海港区', '山海关区', '北戴河区', '青龙满族自治县', '昌黎县', '抚宁县', '卢龙县'] },
  3246. {
  3247. name: '邯郸市',
  3248. area: [
  3249. '邯山区',
  3250. '丛台区',
  3251. '复兴区',
  3252. '峰峰矿区',
  3253. '邯郸县',
  3254. '临漳县',
  3255. '成安县',
  3256. '大名县',
  3257. '涉 县',
  3258. '磁 县',
  3259. '肥乡县',
  3260. '永年县',
  3261. '邱 县',
  3262. '鸡泽县',
  3263. '广平县',
  3264. '馆陶县',
  3265. '魏 县',
  3266. '曲周县',
  3267. '武安市'] },
  3268. {
  3269. name: '邢台市',
  3270. area: [
  3271. '桥东区',
  3272. '桥西区',
  3273. '邢台县',
  3274. '临城县',
  3275. '内丘县',
  3276. '柏乡县',
  3277. '隆尧县',
  3278. '任 县',
  3279. '南和县',
  3280. '宁晋县',
  3281. '巨鹿县',
  3282. '新河县',
  3283. '广宗县',
  3284. '平乡县',
  3285. '威 县',
  3286. '清河县',
  3287. '临西县',
  3288. '南宫市',
  3289. '沙河市'] },
  3290. {
  3291. name: '保定市',
  3292. area: [
  3293. '新市区',
  3294. '北市区',
  3295. '南市区',
  3296. '满城县',
  3297. '清苑县',
  3298. '涞水县',
  3299. '阜平县',
  3300. '徐水县',
  3301. '定兴县',
  3302. '唐 县',
  3303. '高阳县',
  3304. '容城县',
  3305. '涞源县',
  3306. '望都县',
  3307. '安新县',
  3308. '易 县',
  3309. '曲阳县',
  3310. '蠡 县',
  3311. '顺平县',
  3312. '博野',
  3313. '雄县',
  3314. '涿州市',
  3315. '定州市',
  3316. '安国市',
  3317. '高碑店市'] },
  3318. {
  3319. name: '张家口',
  3320. area: [
  3321. '桥东区',
  3322. '桥西区',
  3323. '宣化区',
  3324. '下花园区',
  3325. '宣化县',
  3326. '张北县',
  3327. '康保县',
  3328. '沽源县',
  3329. '尚义县',
  3330. '蔚 县',
  3331. '阳原县',
  3332. '怀安县',
  3333. '万全县',
  3334. '怀来县',
  3335. '涿鹿县',
  3336. '赤城县',
  3337. '崇礼县'] },
  3338. {
  3339. name: '承德市',
  3340. area: ['双桥区', '双滦区', '鹰手营子矿区', '承德县', '兴隆县', '平泉县', '滦平县', '隆化县', '丰宁满族自治县', '宽城满族自治县',
  3341. '围场满族蒙古族自治县'] },
  3342. {
  3343. name: '沧州市',
  3344. area: [
  3345. '新华区',
  3346. '运河区',
  3347. '沧 县',
  3348. '青 县',
  3349. '东光县',
  3350. '海兴县',
  3351. '盐山县',
  3352. '肃宁县',
  3353. '南皮县',
  3354. '吴桥县',
  3355. '献 县',
  3356. '孟村回族自治县',
  3357. '泊头市',
  3358. '任丘市',
  3359. '黄骅市',
  3360. '河间市'] },
  3361. {
  3362. name: '廊坊市',
  3363. area: ['安次区', '固安县', '永清县', '香河县', '大城县', '文安县', '大厂回族自治县', '霸州市', '三河市'] },
  3364. {
  3365. name: '衡水市',
  3366. area: ['桃城区', '枣强县', '武邑县', '武强县', '饶阳县', '安平县', '故城县', '景 县', '阜城县', '冀州市', '深州市'] }] },
  3367. {
  3368. name: '山西省',
  3369. city: [{
  3370. name: '太原市',
  3371. area: ['小店区', '迎泽区', '杏花岭区', '尖草坪区', '万柏林区', '晋源区', '清徐县', '阳曲县', '娄烦县', '古交市'] },
  3372. {
  3373. name: '大同市',
  3374. area: ['城 区', '矿 区', '南郊区', '新荣区', '阳高县', '天镇县', '广灵县', '灵丘县', '浑源县', '左云县', '大同县'] },
  3375. {
  3376. name: '阳泉市',
  3377. area: ['城 区', '矿 区', '郊 区', '平定县', '盂 县'] },
  3378. {
  3379. name: '长治市',
  3380. area: ['城 区', '郊 区', '长治县', '襄垣县', '屯留县', '平顺县', '黎城县', '壶关县', '长子县', '武乡县', '沁 县',
  3381. '沁源县', '潞城市'] },
  3382. {
  3383. name: '晋城市',
  3384. area: ['城 区', '沁水县', '阳城县', '陵川县', '泽州县', '高平市'] },
  3385. {
  3386. name: '朔州市',
  3387. area: ['朔城区', '平鲁区', '山阴县', '应 县', '右玉县', '怀仁县'] },
  3388. {
  3389. name: '忻州市',
  3390. area: ['忻府区', '原平市', '定襄县', '五台县', '代 县', '繁峙县', '宁武县', '静乐县', '神池县', '五寨县', '岢岚县', '河曲县',
  3391. '保德县', '偏关县'] },
  3392. {
  3393. name: '吕梁市',
  3394. area: ['离石区', '孝义市', '汾阳市', '文水县', '交城县', '兴 县', '临 县', '柳林县', '石楼县', '岚 县', '方山县',
  3395. '中阳县', '交口县'] },
  3396. {
  3397. name: '晋中市',
  3398. area: ['榆次市', '介休市', '榆社县', '左权县', '和顺县', '昔阳县', '寿阳县', '太谷县', '祁 县', '平遥县', '灵石县'] },
  3399. {
  3400. name: '临汾市',
  3401. area: [
  3402. '临汾市',
  3403. '侯马市',
  3404. '霍州市',
  3405. '曲沃县',
  3406. '翼城县',
  3407. '襄汾县',
  3408. '洪洞县',
  3409. '古 县',
  3410. '安泽县',
  3411. '浮山县',
  3412. '吉 县',
  3413. '乡宁县',
  3414. '蒲 县',
  3415. '大宁县',
  3416. '永和县',
  3417. '隰 县',
  3418. '汾西县'] },
  3419. {
  3420. name: '运城市',
  3421. area: ['运城市', '永济市', '河津市', '芮城县', '临猗县', '万荣县', '新绛县', '稷山县', '闻喜县', '夏 县', '绛 县', '平陆县',
  3422. '垣曲县'] }] },
  3423. {
  3424. name: '内蒙古',
  3425. city: [{
  3426. name: '呼和浩特市',
  3427. area: ['新城区', '回民区', '玉泉区', '郊 区', '土默特左旗', '托克托县', '和林格尔县', '清水河县', '武川县'] },
  3428. {
  3429. name: '包头市',
  3430. area: ['东河区', '昆都伦区', '青山区', '石拐矿区', '白云矿区', '郊 区', '土默特右旗', '固阳县', '达尔罕茂明安联合旗'] },
  3431. {
  3432. name: '乌海市',
  3433. area: ['海勃湾区', '海南区', '乌达区'] },
  3434. {
  3435. name: '赤峰市',
  3436. area: ['红山区', '元宝山区', '松山区', '阿鲁科尔沁旗', '巴林左旗', '巴林右旗', '林西县', '克什克腾旗', '翁牛特旗', '喀喇沁旗',
  3437. '宁城县', '敖汉旗'] },
  3438. {
  3439. name: '呼伦贝尔市',
  3440. area: [
  3441. '海拉尔市',
  3442. '满洲里市',
  3443. '扎兰屯市',
  3444. '牙克石市',
  3445. '根河市',
  3446. '额尔古纳市',
  3447. '阿荣旗',
  3448. '莫力达瓦达斡尔族自治旗',
  3449. '鄂伦春自治旗',
  3450. '鄂温克族自治旗',
  3451. '新巴尔虎右旗',
  3452. '新巴尔虎左旗',
  3453. '陈巴尔虎旗'] },
  3454. {
  3455. name: '兴安盟',
  3456. area: ['乌兰浩特市', '阿尔山市', '科尔沁右翼前旗', '科尔沁右翼中旗', '扎赉特旗', '突泉县'] },
  3457. {
  3458. name: '通辽市',
  3459. area: ['科尔沁区', '霍林郭勒市', '科尔沁左翼中旗', '科尔沁左翼后旗', '开鲁县', '库伦旗', '奈曼旗', '扎鲁特旗'] },
  3460. {
  3461. name: '锡林郭勒盟',
  3462. area: ['二连浩特市', '锡林浩特市', '阿巴嘎旗', '苏尼特左旗', '苏尼特右旗', '东乌珠穆沁旗', '西乌珠穆沁旗', '太仆寺旗', '镶黄旗',
  3463. '正镶白旗', '正蓝旗', '多伦县'] },
  3464. {
  3465. name: '乌兰察布盟',
  3466. area: ['集宁市', '丰镇市', '卓资县', '化德县', '商都县', '兴和县', '凉城县', '察哈尔右翼前旗', '察哈尔右翼中旗', '察哈尔右翼后旗',
  3467. '四子王旗'] },
  3468. {
  3469. name: '伊克昭盟',
  3470. area: ['东胜市', '达拉特旗', '准格尔旗', '鄂托克前旗', '鄂托克旗', '杭锦旗', '乌审旗', '伊金霍洛旗'] },
  3471. {
  3472. name: '巴彦淖尔盟',
  3473. area: ['临河市', '五原县', '磴口县', '乌拉特前旗', '乌拉特中旗', '乌拉特后旗', '杭锦后旗'] },
  3474. {
  3475. name: '阿拉善盟',
  3476. area: ['阿拉善左旗', '阿拉善右旗', '额济纳旗'] }] },
  3477. {
  3478. name: '辽宁省',
  3479. city: [{
  3480. name: '沈阳市',
  3481. area: ['沈河区', '皇姑区', '和平区', '大东区', '铁西区', '苏家屯区', '东陵区', '于洪区', '新民市', '法库县', '辽中县', '康平县',
  3482. '新城子区'] },
  3483. {
  3484. name: '大连市',
  3485. area: ['西岗区', '中山区', '沙河口区', '甘井子区', '旅顺口区', '金州区', '瓦房店市', '普兰店市', '庄河市', '长海县'] },
  3486. {
  3487. name: '鞍山市',
  3488. area: ['铁东区', '铁西区', '立山区', '千山区', '海城市', '台安县', '岫岩满族自治县'] },
  3489. {
  3490. name: '抚顺市',
  3491. area: ['顺城区', '新抚区', '东洲区', '望花区', '抚顺县', '清原满族自治县', '新宾满族自治县'] },
  3492. {
  3493. name: '本溪市',
  3494. area: ['平山区', '明山区', '溪湖区', '南芬区', '本溪满族自治县', '桓仁满族自治县'] },
  3495. {
  3496. name: '丹东市',
  3497. area: ['振兴区', '元宝区', '振安区', '东港市', '凤城市', '宽甸满族自治县'] },
  3498. {
  3499. name: '锦州市',
  3500. area: ['太和区', '古塔区', '凌河区', '凌海市', '黑山县', '义县', '北宁市'] },
  3501. {
  3502. name: '营口市',
  3503. area: ['站前区', '西市区', '鲅鱼圈区', '老边区', '大石桥市', '盖州市'] },
  3504. {
  3505. name: '阜新市',
  3506. area: ['海州区', '新邱区', '太平区', '清河门区', '细河区', '彰武县', '阜新蒙古族自治县'] },
  3507. {
  3508. name: '辽阳市',
  3509. area: ['白塔区', '文圣区', '宏伟区', '太子河区', '弓长岭区', '灯塔市', '辽阳县'] },
  3510. {
  3511. name: '盘锦',
  3512. area: ['双台子区', '兴隆台区', '盘山县', '大洼县'] },
  3513. {
  3514. name: '铁岭市',
  3515. area: ['银州区', '清河区', '调兵山市', '开原市', '铁岭县', '昌图县', '西丰县'] },
  3516. {
  3517. name: '朝阳市',
  3518. area: ['双塔区', '龙城区', '凌源市', '北票市', '朝阳县', '建平县', '喀喇沁左翼蒙古族自治县'] },
  3519. {
  3520. name: '葫芦岛市',
  3521. area: ['龙港区', '南票区', '连山区', '兴城市', '绥中县', '建昌县'] }] },
  3522. {
  3523. name: '吉林省',
  3524. city: [{
  3525. name: '长春市',
  3526. area: ['朝阳区', '宽城区', '二道区', '南关区', '绿园区', '双阳区', '九台市', '榆树市', '德惠市', '农安县'] },
  3527. {
  3528. name: '吉林市',
  3529. area: ['船营区', '昌邑区', '龙潭区', '丰满区', '舒兰市', '桦甸市', '蛟河市', '磐石市', '永吉县'] },
  3530. {
  3531. name: '四平',
  3532. area: ['铁西区', '铁东区', '公主岭市', '双辽市', '梨树县', '伊通满族自治县'] },
  3533. {
  3534. name: '辽源市',
  3535. area: ['龙山区', '西安区', '东辽县', '东丰县'] },
  3536. {
  3537. name: '通化市',
  3538. area: ['东昌区', '二道江区', '梅河口市', '集安市', '通化县', '辉南县', '柳河县'] },
  3539. {
  3540. name: '白山市',
  3541. area: ['八道江区', '江源区', '临江市', '靖宇县', '抚松县', '长白朝鲜族自治县'] },
  3542. {
  3543. name: '松原市',
  3544. area: ['宁江区', '乾安县', '长岭县', '扶余县', '前郭尔罗斯蒙古族自治县'] },
  3545. {
  3546. name: '白城市',
  3547. area: ['洮北区', '大安市', '洮南市', '镇赉县', '通榆县'] },
  3548. {
  3549. name: '延边朝鲜族自治州',
  3550. area: ['延吉市', '图们市', '敦化市', '龙井市', '珲春市', '和龙市', '安图县', '汪清县'] }] },
  3551. {
  3552. name: '黑龙江省',
  3553. city: [{
  3554. name: '哈尔滨市',
  3555. area: [
  3556. '松北区',
  3557. '道里区',
  3558. '南岗区',
  3559. '平房区',
  3560. '香坊区',
  3561. '道外区',
  3562. '呼兰区',
  3563. '阿城区',
  3564. '双城市',
  3565. '尚志市',
  3566. '五常市',
  3567. '宾县',
  3568. '方正县',
  3569. '通河县',
  3570. '巴彦县',
  3571. '延寿县',
  3572. '木兰县',
  3573. '依兰县'] },
  3574. {
  3575. name: '齐齐哈尔市',
  3576. area: [
  3577. '龙沙区',
  3578. '昂昂溪区',
  3579. '铁锋区',
  3580. '建华区',
  3581. '富拉尔基区',
  3582. '碾子山区',
  3583. '梅里斯达斡尔族区',
  3584. '讷河市',
  3585. '富裕县',
  3586. '拜泉县',
  3587. '甘南县',
  3588. '依安县',
  3589. '克山县',
  3590. '泰来县',
  3591. '克东县',
  3592. '龙江县'] },
  3593. {
  3594. name: '鹤岗市',
  3595. area: ['兴山区', '工农区', '南山区', '兴安区', '向阳区', '东山区', '萝北县', '绥滨县'] },
  3596. {
  3597. name: '双鸭山',
  3598. area: ['尖山区', '岭东区', '四方台区', '宝山区', '集贤县', '宝清县', '友谊县', '饶河县'] },
  3599. {
  3600. name: '鸡西市',
  3601. area: ['鸡冠区', '恒山区', '城子河区', '滴道区', '梨树区', '麻山区', '密山市', '虎林市', '鸡东县'] },
  3602. {
  3603. name: '大庆市',
  3604. area: ['萨尔图区', '红岗区', '龙凤区', '让胡路区', '大同区', '林甸县', '肇州县', '肇源县', '杜尔伯特蒙古族自治县'] },
  3605. {
  3606. name: '伊春市',
  3607. area: [
  3608. '伊春区',
  3609. '带岭区',
  3610. '南岔区',
  3611. '金山屯区',
  3612. '西林区',
  3613. '美溪区',
  3614. '乌马河区',
  3615. '翠峦区',
  3616. '友好区',
  3617. '上甘岭区',
  3618. '五营区',
  3619. '红星区',
  3620. '新青区',
  3621. '汤旺河区',
  3622. '乌伊岭区',
  3623. '铁力市',
  3624. '嘉荫县'] },
  3625. {
  3626. name: '牡丹江市',
  3627. area: ['爱民区', '东安区', '阳明区', '西安区', '绥芬河市', '宁安市', '海林市', '穆棱市', '林口县', '东宁县'] },
  3628. {
  3629. name: '佳木斯市',
  3630. area: ['向阳区', '前进区', '东风区', '郊区', '同江市', '富锦市', '桦川县', '抚远县', '桦南县', '汤原县'] },
  3631. {
  3632. name: '七台河市',
  3633. area: ['桃山区', '新兴区', '茄子河区', '勃利县'] },
  3634. {
  3635. name: '黑河市',
  3636. area: ['爱辉区', '北安市', '五大连池市', '逊克县', '嫩江县', '孙吴县'] },
  3637. {
  3638. name: '绥化市',
  3639. area: ['北林区', '安达市', '肇东市', '海伦市', '绥棱县', '兰西县', '明水县', '青冈县', '庆安县', '望奎县'] },
  3640. {
  3641. name: '大兴安岭地区',
  3642. area: ['呼玛县', '塔河县', '漠河县', '大兴安岭辖区'] }] },
  3643. {
  3644. name: '上海市',
  3645. city: [{
  3646. name: '上海市',
  3647. area: [
  3648. '黄浦区',
  3649. '卢湾区',
  3650. '徐汇区',
  3651. '长宁区',
  3652. '静安区',
  3653. '普陀区',
  3654. '闸北区',
  3655. '虹口区',
  3656. '杨浦区',
  3657. '宝山区',
  3658. '闵行区',
  3659. '嘉定区',
  3660. '松江区',
  3661. '金山区',
  3662. '青浦区',
  3663. '南汇区',
  3664. '奉贤区',
  3665. '浦东新区',
  3666. '崇明县'] }] },
  3667. {
  3668. name: '江苏省',
  3669. city: [{
  3670. name: '南京市',
  3671. area: ['玄武区', '白下区', '秦淮区', '建邺区', '鼓楼区', '下关区', '栖霞区', '雨花台区', '浦口区', '江宁区', '六合区', '溧水县',
  3672. '高淳县'] },
  3673. {
  3674. name: '苏州市',
  3675. area: ['金阊区', '平江区', '沧浪区', '虎丘区', '吴中区', '相城区', '常熟市', '张家港市', '昆山市', '吴江市', '太仓市'] },
  3676. {
  3677. name: '无锡市',
  3678. area: ['崇安区', '南长区', '北塘区', '滨湖区', '锡山区', '惠山区', '江阴市', '宜兴市'] },
  3679. {
  3680. name: '常州市',
  3681. area: ['钟楼区', '天宁区', '戚墅堰区', '新北区', '武进区', '金坛市', '溧阳市'] },
  3682. {
  3683. name: '镇江市',
  3684. area: ['京口区', '润州区', '丹徒区', '丹阳市', '扬中市', '句容市'] },
  3685. {
  3686. name: '南通市',
  3687. area: ['崇川区', '港闸区', '通州市', '如皋市', '海门市', '启东市', '海安县', '如东县'] },
  3688. {
  3689. name: '泰州市',
  3690. area: ['海陵区', '高港区', '姜堰市', '泰兴市', '靖江市', '兴化市'] },
  3691. {
  3692. name: '扬州市',
  3693. area: ['广陵区', '维扬区', '邗江区', '江都市', '仪征市', '高邮市', '宝应县'] },
  3694. {
  3695. name: '盐城市',
  3696. area: ['亭湖区', '盐都区', '大丰市', '东台市', '建湖县', '射阳县', '阜宁县', '滨海县', '响水县'] },
  3697. {
  3698. name: '连云港市',
  3699. area: ['新浦区', '海州区', '连云区', '东海县', '灌云县', '赣榆县', '灌南县'] },
  3700. {
  3701. name: '徐州市',
  3702. area: ['云龙区', '鼓楼区', '九里区', '泉山区', '贾汪区', '邳州市', '新沂市', '铜山县', '睢宁县', '沛县', '丰县'] },
  3703. {
  3704. name: '淮安市',
  3705. area: ['清河区', '清浦区', '楚州区', '淮阴区', '涟水县', '洪泽县', '金湖县', '盱眙县'] },
  3706. {
  3707. name: '宿迁市',
  3708. area: ['宿城区', '宿豫区', '沭阳县', '泗阳县', '泗洪县'] }] },
  3709. {
  3710. name: '浙江省',
  3711. city: [{
  3712. name: '杭州市',
  3713. area: ['拱墅区', '西湖区', '上城区', '下城区', '江干区', '滨江区', '余杭区', '萧山区', '建德市', '富阳市', '临安市', '桐庐县',
  3714. '淳安县'] },
  3715. {
  3716. name: '宁波市',
  3717. area: ['海曙区', '江东区', '江北区', '镇海区', '北仑区', '鄞州区', '余姚市', '慈溪市', '奉化市', '宁海县', '象山县'] },
  3718. {
  3719. name: '温州市',
  3720. area: ['鹿城区', '龙湾区', '瓯海区', '瑞安市', '乐清市', '永嘉县', '洞头县', '平阳县', '苍南县', '文成县', '泰顺县'] },
  3721. {
  3722. name: '嘉兴市',
  3723. area: ['秀城区', '秀洲区', '海宁市', '平湖市', '桐乡市', '嘉善县', '海盐县'] },
  3724. {
  3725. name: '湖州市',
  3726. area: ['吴兴区', '南浔区', '长兴县', '德清县', '安吉县'] },
  3727. {
  3728. name: '绍兴市',
  3729. area: ['越城区', '诸暨市', '上虞市', '嵊州市', '绍兴县', '新昌县'] },
  3730. {
  3731. name: '金华市',
  3732. area: ['婺城区', '金东区', '兰溪市', '义乌市', '东阳市', '永康市', '武义县', '浦江县', '磐安县'] },
  3733. {
  3734. name: '衢州市',
  3735. area: ['柯城区', '衢江区', '江山市', '龙游县', '常山县', '开化县'] },
  3736. {
  3737. name: '舟山市',
  3738. area: ['定海区', '普陀区', '岱山县', '嵊泗县'] },
  3739. {
  3740. name: '台州市',
  3741. area: ['椒江区', '黄岩区', '路桥区', '临海市', '温岭市', '玉环县', '天台县', '仙居县', '三门县'] },
  3742. {
  3743. name: '丽水市',
  3744. area: ['莲都区', '龙泉市', '缙云县', '青田县', '云和县', '遂昌县', '松阳县', '庆元县', '景宁畲族自治县'] }] },
  3745. {
  3746. name: '安徽省',
  3747. city: [{
  3748. name: '合肥市',
  3749. area: ['庐阳区', '瑶海区', '蜀山区', '包河区', '长丰县', '肥东县', '肥西县'] },
  3750. {
  3751. name: '芜湖市',
  3752. area: ['镜湖区', '弋江区', '鸠江区', '三山区', '芜湖县', '南陵县', '繁昌县'] },
  3753. {
  3754. name: '蚌埠市',
  3755. area: ['蚌山区', '龙子湖区', '禹会区', '淮上区', '怀远县', '固镇县', '五河县'] },
  3756. {
  3757. name: '淮南市',
  3758. area: ['田家庵区', '大通区', '谢家集区', '八公山区', '潘集区', '凤台县'] },
  3759. {
  3760. name: '马鞍山市',
  3761. area: ['雨山区', '花山区', '金家庄区', '当涂县'] },
  3762. {
  3763. name: '淮北市',
  3764. area: ['相山区', '杜集区', '烈山区', '濉溪县'] },
  3765. {
  3766. name: '铜陵市',
  3767. area: ['铜官山区', '狮子山区', '郊区', '铜陵县'] },
  3768. {
  3769. name: '安庆市',
  3770. area: ['迎江区', '大观区', '宜秀区', '桐城市', '宿松县', '枞阳县', '太湖县', '怀宁县', '岳西县', '望江县', '潜山县'] },
  3771. {
  3772. name: '黄山市',
  3773. area: ['屯溪区', '黄山区', '徽州区', '休宁县', '歙县', '祁门县', '黟县'] },
  3774. {
  3775. name: '滁州市',
  3776. area: ['琅琊区', '南谯区', '天长市', '明光市', '全椒县', '来安县', '定远县', '凤阳县'] },
  3777. {
  3778. name: '阜阳市',
  3779. area: ['颍州区', '颍东区', '颍泉区', '界首市', '临泉县', '颍上县', '阜南县', '太和县'] },
  3780. {
  3781. name: '宿州市',
  3782. area: ['埇桥区', '萧县', '泗县', '砀山县', '灵璧县'] },
  3783. {
  3784. name: '巢湖市',
  3785. area: ['居巢区', '含山县', '无为县', '庐江县', '和县'] },
  3786. {
  3787. name: '六安市',
  3788. area: ['金安区', '裕安区', '寿县', '霍山县', '霍邱县', '舒城县', '金寨县'] },
  3789. {
  3790. name: '亳州市',
  3791. area: ['谯城区', '利辛县', '涡阳县', '蒙城县'] },
  3792. {
  3793. name: '池州市',
  3794. area: ['贵池区', '东至县', '石台县', '青阳县'] },
  3795. {
  3796. name: '宣城市',
  3797. area: ['宣州区', '宁国市', '广德县', '郎溪县', '泾县', '旌德县', '绩溪县'] }] },
  3798. {
  3799. name: '福建省',
  3800. city: [{
  3801. name: '福州市',
  3802. area: ['鼓楼区', '台江区', '仓山区', '马尾区', '晋安区', '福清市', '长乐市', '闽侯县', '闽清县', '永泰县', '连江县', '罗源县',
  3803. '平潭县'] },
  3804. {
  3805. name: '厦门市',
  3806. area: ['思明区', '海沧区', '湖里区', '集美区', '同安区', '翔安区'] },
  3807. {
  3808. name: '莆田市',
  3809. area: ['城厢区', '涵江区', '荔城区', '秀屿区', '仙游县'] },
  3810. {
  3811. name: '三明市',
  3812. area: ['梅列区', '三元区', '永安市', '明溪县', '将乐县', '大田县', '宁化县', '建宁县', '沙县', '尤溪县', '清流县', '泰宁县'] },
  3813. {
  3814. name: '泉州市',
  3815. area: ['鲤城区', '丰泽区', '洛江区', '泉港区', '石狮市', '晋江市', '南安市', '惠安县', '永春县', '安溪县', '德化县', '金门县'] },
  3816. {
  3817. name: '漳州市',
  3818. area: ['芗城区', '龙文区', '龙海市', '平和县', '南靖县', '诏安县', '漳浦县', '华安县', '东山县', '长泰县', '云霄县'] },
  3819. {
  3820. name: '南平市',
  3821. area: ['延平区', '建瓯市', '邵武市', '武夷山市', '建阳市', '松溪县', '光泽县', '顺昌县', '浦城县', '政和县'] },
  3822. {
  3823. name: '龙岩市',
  3824. area: ['新罗区', '漳平市', '长汀县', '武平县', '上杭县', '永定县', '连城县'] },
  3825. {
  3826. name: '宁德市',
  3827. area: ['蕉城区', '福安市', '福鼎市', '寿宁县', '霞浦县', '柘荣县', '屏南县', '古田县', '周宁县'] }] },
  3828. {
  3829. name: '江西省',
  3830. city: [{
  3831. name: '南昌市',
  3832. area: ['东湖区', '西湖区', '青云谱区', '湾里区', '青山湖区', '新建县', '南昌县', '进贤县', '安义县'] },
  3833. {
  3834. name: '景德镇市',
  3835. area: ['珠山区', '昌江区', '乐平市', '浮梁县'] },
  3836. {
  3837. name: '萍乡市',
  3838. area: ['安源区', '湘东区', '莲花县', '上栗县', '芦溪县'] },
  3839. {
  3840. name: '九江市',
  3841. area: ['浔阳区', '庐山区', '瑞昌市', '九江县', '星子县', '武宁县', '彭泽县', '永修县', '修水县', '湖口县', '德安县', '都昌县'] },
  3842. {
  3843. name: '新余市',
  3844. area: ['渝水区', '分宜县'] },
  3845. {
  3846. name: '鹰潭市',
  3847. area: ['月湖区', '贵溪市', '余江县'] },
  3848. {
  3849. name: '赣州市',
  3850. area: [
  3851. '章贡区',
  3852. '瑞金市',
  3853. '南康市',
  3854. '石城县',
  3855. '安远县',
  3856. '赣县',
  3857. '宁都县',
  3858. '寻乌县',
  3859. '兴国县',
  3860. '定南县',
  3861. '上犹县',
  3862. '于都县',
  3863. '龙南县',
  3864. '崇义县',
  3865. '信丰县',
  3866. '全南县',
  3867. '大余县',
  3868. '会昌县'] },
  3869. {
  3870. name: '吉安市',
  3871. area: ['吉州区', '青原区', '井冈山市', '吉安县', '永丰县', '永新县', '新干县', '泰和县', '峡江县', '遂川县', '安福县', '吉水县',
  3872. '万安县'] },
  3873. {
  3874. name: '宜春市',
  3875. area: ['袁州区', '丰城市', '樟树市', '高安市', '铜鼓县', '靖安县', '宜丰县', '奉新县', '万载县', '上高县'] },
  3876. {
  3877. name: '抚州市',
  3878. area: ['临川区', '南丰县', '乐安县', '金溪县', '南城县', '东乡县', '资溪县', '宜黄县', '广昌县', '黎川县', '崇仁县'] },
  3879. {
  3880. name: '上饶市',
  3881. area: ['信州区', '德兴市', '上饶县', '广丰县', '鄱阳县', '婺源县', '铅山县', '余干县', '横峰县', '弋阳县', '玉山县', '万年县'] }] },
  3882. {
  3883. name: '山东省',
  3884. city: [{
  3885. name: '济南市',
  3886. area: ['市中区', '历下区', '天桥区', '槐荫区', '历城区', '长清区', '章丘市', '平阴县', '济阳县', '商河县'] },
  3887. {
  3888. name: '青岛市',
  3889. area: ['市南区', '市北区', '城阳区', '四方区', '李沧区', '黄岛区', '崂山区', '胶南市', '胶州市', '平度市', '莱西市', '即墨市'] },
  3890. {
  3891. name: '淄博市',
  3892. area: ['张店区', '临淄区', '淄川区', '博山区', '周村区', '桓台县', '高青县', '沂源县'] },
  3893. {
  3894. name: '枣庄市',
  3895. area: ['市中区', '山亭区', '峄城区', '台儿庄区', '薛城区', '滕州市'] },
  3896. {
  3897. name: '东营市',
  3898. area: ['东营区', '河口区', '垦利县', '广饶县', '利津县'] },
  3899. {
  3900. name: '烟台市',
  3901. area: ['芝罘区', '福山区', '牟平区', '莱山区', '龙口市', '莱阳市', '莱州市', '招远市', '蓬莱市', '栖霞市', '海阳市', '长岛县'] },
  3902. {
  3903. name: '潍坊市',
  3904. area: ['潍城区', '寒亭区', '坊子区', '奎文区', '青州市', '诸城市', '寿光市', '安丘市', '高密市', '昌邑市', '昌乐县', '临朐县'] },
  3905. {
  3906. name: '济宁市',
  3907. area: ['市中区', '任城区', '曲阜市', '兖州市', '邹城市', '鱼台县', '金乡县', '嘉祥县', '微山县', '汶上县', '泗水县', '梁山县'] },
  3908. {
  3909. name: '泰安市',
  3910. area: ['泰山区', '岱岳区', '新泰市', '肥城市', '宁阳县', '东平县'] },
  3911. {
  3912. name: '威海市',
  3913. area: ['环翠区', '乳山市', '文登市', '荣成市'] },
  3914. {
  3915. name: '日照市',
  3916. area: ['东港区', '岚山区', '五莲县', '莒县'] },
  3917. {
  3918. name: '莱芜市',
  3919. area: ['莱城区', '钢城区'] },
  3920. {
  3921. name: '临沂市',
  3922. area: ['兰山区', '罗庄区', '河东区', '沂南县', '郯城县', '沂水县', '苍山县', '费县', '平邑县', '莒南县', '蒙阴县', '临沭县'] },
  3923. {
  3924. name: '德州市',
  3925. area: ['德城区', '乐陵市', '禹城市', '陵县', '宁津县', '齐河县', '武城县', '庆云县', '平原县', '夏津县', '临邑县'] },
  3926. {
  3927. name: '聊城市',
  3928. area: ['东昌府区', '临清市', '高唐县', '阳谷县', '茌平县', '莘县', '东阿县', '冠县'] },
  3929. {
  3930. name: '滨州市',
  3931. area: ['滨城区', '邹平县', '沾化县', '惠民县', '博兴县', '阳信县', '无棣县'] },
  3932. {
  3933. name: '菏泽市',
  3934. area: ['牡丹区', '鄄城县', '单县', '郓城县', '曹县', '定陶县', '巨野县', '东明县', '成武县'] }] },
  3935. {
  3936. name: '河南省',
  3937. city: [{
  3938. name: '郑州市',
  3939. area: ['中原区', '金水区', '二七区', '管城回族区', '上街区', '惠济区', '巩义市', '新郑市', '新密市', '登封市', '荥阳市',
  3940. '中牟县'] },
  3941. {
  3942. name: '开封市',
  3943. area: ['鼓楼区', '龙亭区', '顺河回族区', '禹王台区', '金明区', '开封县', '尉氏县', '兰考县', '杞县', '通许县'] },
  3944. {
  3945. name: '洛阳市',
  3946. area: ['西工区', '老城区', '涧西区', '瀍河回族区', '洛龙区', '吉利区', '偃师市', '孟津县', '汝阳县', '伊川县', '洛宁县', '嵩县',
  3947. '宜阳县', '新安县', '栾川县'] },
  3948. {
  3949. name: '平顶山市',
  3950. area: ['新华区', '卫东区', '湛河区', '石龙区', '汝州市', '舞钢市', '宝丰县', '叶县', '郏县', '鲁山县'] },
  3951. {
  3952. name: '安阳市',
  3953. area: ['北关区', '文峰区', '殷都区', '龙安区', '林州市', '安阳县', '滑县', '内黄县', '汤阴县'] },
  3954. {
  3955. name: '鹤壁市',
  3956. area: ['淇滨区', '山城区', '鹤山区', '浚县', '淇县'] },
  3957. {
  3958. name: '新乡市',
  3959. area: ['卫滨区', '红旗区', '凤泉区', '牧野区', '卫辉市', '辉县市', '新乡县', '获嘉县', '原阳县', '长垣县', '封丘县', '延津县'] },
  3960. {
  3961. name: '焦作市',
  3962. area: ['解放区', '中站区', '马村区', '山阳区', '沁阳市', '孟州市', '修武县', '温县', '武陟县', '博爱县'] },
  3963. {
  3964. name: '濮阳市',
  3965. area: ['华龙区', '濮阳县', '南乐县', '台前县', '清丰县', '范县'] },
  3966. {
  3967. name: '许昌市',
  3968. area: ['魏都区', '禹州市', '长葛市', '许昌县', '鄢陵县', '襄城县'] },
  3969. {
  3970. name: '漯河市',
  3971. area: ['源汇区', '郾城区', '召陵区', '临颍县', '舞阳县'] },
  3972. {
  3973. name: '三门峡市',
  3974. area: ['湖滨区', '义马市', '灵宝市', '渑池县', '卢氏县', '陕县'] },
  3975. {
  3976. name: '南阳市',
  3977. area: ['卧龙区', '宛城区', '邓州市', '桐柏县', '方城县', '淅川县', '镇平县', '唐河县', '南召县', '内乡县', '新野县', '社旗县',
  3978. '西峡县'] },
  3979. {
  3980. name: '商丘市',
  3981. area: ['梁园区', '睢阳区', '永城市', '宁陵县', '虞城县', '民权县', '夏邑县', '柘城县', '睢县'] },
  3982. {
  3983. name: '信阳市',
  3984. area: ['浉河区', '平桥区', '潢川县', '淮滨县', '息县', '新县', '商城县', '固始县', '罗山县', '光山县'] },
  3985. {
  3986. name: '周口市',
  3987. area: ['川汇区', '项城市', '商水县', '淮阳县', '太康县', '鹿邑县', '西华县', '扶沟县', '沈丘县', '郸城县'] },
  3988. {
  3989. name: '驻马店市',
  3990. area: ['驿城区', '确山县', '新蔡县', '上蔡县', '西平县', '泌阳县', '平舆县', '汝南县', '遂平县', '正阳县'] },
  3991. {
  3992. name: '焦作市',
  3993. area: ['济源市'] }] },
  3994. {
  3995. name: '湖北省',
  3996. city: [{
  3997. name: '武汉市',
  3998. area: ['江岸区', '武昌区', '江汉区', '硚口区', '汉阳区', '青山区', '洪山区', '东西湖区', '汉南区', '蔡甸区', '江夏区', '黄陂区',
  3999. '新洲区'] },
  4000. {
  4001. name: '黄石市',
  4002. area: ['黄石港区', '西塞山区', '下陆区', '铁山区', '大冶市', '阳新县'] },
  4003. {
  4004. name: '十堰市',
  4005. area: ['张湾区', '茅箭区', '丹江口市', '郧县', '竹山县', '房县', '郧西县', '竹溪县'] },
  4006. {
  4007. name: '荆州市',
  4008. area: ['沙市区', '荆州区', '洪湖市', '石首市', '松滋市', '监利县', '公安县', '江陵县'] },
  4009. {
  4010. name: '宜昌市',
  4011. area: ['西陵区', '伍家岗区', '点军区', '猇亭区', '夷陵区', '宜都市', '当阳市', '枝江市', '秭归县', '远安县', '兴山县',
  4012. '五峰土家族自治县', '长阳土家族自治县'] },
  4013. {
  4014. name: '襄樊市',
  4015. area: ['襄城区', '樊城区', '襄阳区', '老河口市', '枣阳市', '宜城市', '南漳县', '谷城县', '保康县'] },
  4016. {
  4017. name: '鄂州市',
  4018. area: ['鄂城区', '华容区', '梁子湖区'] },
  4019. {
  4020. name: '荆门市',
  4021. area: ['东宝区', '掇刀区', '钟祥市', '京山县', '沙洋县'] },
  4022. {
  4023. name: '孝感市',
  4024. area: ['孝南区', '应城市', '安陆市', '汉川市', '云梦县', '大悟县', '孝昌县'] },
  4025. {
  4026. name: '黄冈市',
  4027. area: ['黄州区', '麻城市', '武穴市', '红安县', '罗田县', '浠水县', '蕲春县', '黄梅县', '英山县', '团风县'] },
  4028. {
  4029. name: '咸宁市',
  4030. area: ['咸安区', '赤壁市', '嘉鱼县', '通山县', '崇阳县', '通城县'] },
  4031. {
  4032. name: '随州市',
  4033. area: ['曾都区', '广水市'] },
  4034. {
  4035. name: '恩施土家族苗族自治州',
  4036. area: ['恩施市', '利川市', '建始县', '来凤县', '巴东县', '鹤峰县', '宣恩县', '咸丰县'] },
  4037. {
  4038. name: '仙桃市',
  4039. area: ['仙桃'] },
  4040. {
  4041. name: '天门市',
  4042. area: ['天门'] },
  4043. {
  4044. name: '潜江市',
  4045. area: ['潜江'] },
  4046. {
  4047. name: '神农架林区',
  4048. area: ['神农架林区'] }] },
  4049. {
  4050. name: '湖南省',
  4051. city: [{
  4052. name: '长沙市',
  4053. area: ['岳麓区', '芙蓉区', '天心区', '开福区', '雨花区', '浏阳市', '长沙县', '望城县', '宁乡县'] },
  4054. {
  4055. name: '株洲市',
  4056. area: ['天元区', '荷塘区', '芦淞区', '石峰区', '醴陵市', '株洲县', '炎陵县', '茶陵县', '攸县'] },
  4057. {
  4058. name: '湘潭市',
  4059. area: ['岳塘区', '雨湖区', '湘乡市', '韶山市', '湘潭县'] },
  4060. {
  4061. name: '衡阳市',
  4062. area: ['雁峰区', '珠晖区', '石鼓区', '蒸湘区', '南岳区', '耒阳市', '常宁市', '衡阳县', '衡东县', '衡山县', '衡南县', '祁东县'] },
  4063. {
  4064. name: '邵阳市',
  4065. area: ['双清区', '大祥区', '北塔区', '武冈市', '邵东县', '洞口县', '新邵县', '绥宁县', '新宁县', '邵阳县', '隆回县',
  4066. '城步苗族自治县'] },
  4067. {
  4068. name: '岳阳市',
  4069. area: ['岳阳楼区', '云溪区', '君山区', '临湘市', '汨罗市', '岳阳县', '湘阴县', '平江县', '华容县'] },
  4070. {
  4071. name: '常德市',
  4072. area: ['武陵区', '鼎城区', '津市市', '澧县', '临澧县', '桃源县', '汉寿县', '安乡县', '石门县'] },
  4073. {
  4074. name: '张家界市',
  4075. area: ['永定区', '武陵源区', '慈利县', '桑植县'] },
  4076. {
  4077. name: '益阳市',
  4078. area: ['赫山区', '资阳区', '沅江市', '桃江县', '南县', '安化县'] },
  4079. {
  4080. name: '郴州市',
  4081. area: ['北湖区', '苏仙区', '资兴市', '宜章县', '汝城县', '安仁县', '嘉禾县', '临武县', '桂东县', '永兴县', '桂阳县'] },
  4082. {
  4083. name: '永州市',
  4084. area: ['冷水滩区', '零陵区', '祁阳县', '蓝山县', '宁远县', '新田县', '东安县', '江永县', '道县', '双牌县', '江华瑶族自治县'] },
  4085. {
  4086. name: '怀化市',
  4087. area: [
  4088. '鹤城区',
  4089. '洪江市',
  4090. '会同县',
  4091. '沅陵县',
  4092. '辰溪县',
  4093. '溆浦县',
  4094. '中方县',
  4095. '新晃侗族自治县',
  4096. '芷江侗族自治县',
  4097. '通道侗族自治县',
  4098. '靖州苗族侗族自治县',
  4099. '麻阳苗族自治县'] },
  4100. {
  4101. name: '娄底市',
  4102. area: ['娄星区', '冷水江市', '涟源市', '新化县', '双峰县'] },
  4103. {
  4104. name: '湘西土家族苗族自治州',
  4105. area: ['吉首市', '古丈县', '龙山县', '永顺县', '凤凰县', '泸溪县', '保靖县', '花垣县'] }] },
  4106. {
  4107. name: '广东省',
  4108. city: [{
  4109. name: '广州市',
  4110. area: ['越秀区', '荔湾区', '海珠区', '天河区', '白云区', '黄埔区', '番禺区', '花都区', '南沙区', '萝岗区', '增城市', '从化市'] },
  4111. {
  4112. name: '深圳市',
  4113. area: ['福田区', '罗湖区', '南山区', '宝安区', '龙岗区', '盐田区'] },
  4114. {
  4115. name: '东莞市',
  4116. area: ['莞城', '常平', '塘厦', '塘厦', '塘厦'] },
  4117. {
  4118. name: '中山市',
  4119. area: ['中山'] },
  4120. {
  4121. name: '潮州市',
  4122. area: ['湘桥区', '潮安县', '饶平县'] },
  4123. {
  4124. name: '揭阳市',
  4125. area: ['榕城区', '揭东县', '揭西县', '惠来县', '普宁市'] },
  4126. {
  4127. name: '云浮市',
  4128. area: ['云城区', '新兴县', '郁南县', '云安县', '罗定市'] },
  4129. {
  4130. name: '珠海市',
  4131. area: ['香洲区', '斗门区', '金湾区'] },
  4132. {
  4133. name: '汕头市',
  4134. area: ['金平区', '濠江区', '龙湖区', '潮阳区', '潮南区', '澄海区', '南澳县'] },
  4135. {
  4136. name: '韶关市',
  4137. area: ['浈江区', '武江区', '曲江区', '乐昌市', '南雄市', '始兴县', '仁化县', '翁源县', '新丰县', '乳源瑶族自治县'] },
  4138. {
  4139. name: '佛山市',
  4140. area: ['禅城区', '南海区', '顺德区', '三水区', '高明区'] },
  4141. {
  4142. name: '江门市',
  4143. area: ['蓬江区', '江海区', '新会区', '恩平市', '台山市', '开平市', '鹤山市'] },
  4144. {
  4145. name: '湛江市',
  4146. area: ['赤坎区', '霞山区', '坡头区', '麻章区', '吴川市', '廉江市', '雷州市', '遂溪县', '徐闻县'] },
  4147. {
  4148. name: '茂名市',
  4149. area: ['茂南区', '茂港区', '化州市', '信宜市', '高州市', '电白县'] },
  4150. {
  4151. name: '肇庆市',
  4152. area: ['端州区', '鼎湖区', '高要市', '四会市', '广宁县', '怀集县', '封开县', '德庆县'] },
  4153. {
  4154. name: '惠州市',
  4155. area: ['惠城区', '惠阳区', '博罗县', '惠东县', '龙门县'] },
  4156. {
  4157. name: '梅州市',
  4158. area: ['梅江区', '兴宁市', '梅县', '大埔县', '丰顺县', '五华县', '平远县', '蕉岭县'] },
  4159. {
  4160. name: '汕尾市',
  4161. area: ['城区', '陆丰市', '海丰县', '陆河县'] },
  4162. {
  4163. name: '河源市',
  4164. area: ['源城区', '紫金县', '龙川县', '连平县', '和平县', '东源县'] },
  4165. {
  4166. name: '阳江市',
  4167. area: ['江城区', '阳春市', '阳西县', '阳东县'] },
  4168. {
  4169. name: '清远市',
  4170. area: ['清城区', '英德市', '连州市', '佛冈县', '阳山县', '清新县', '连山壮族瑶族自治县', '连南瑶族自治县'] }] },
  4171. {
  4172. name: '广西',
  4173. city: [{
  4174. name: '南宁市',
  4175. area: ['青秀区', '兴宁区', '西乡塘区', '良庆区', '江南区', '邕宁区', '武鸣县', '隆安县', '马山县', '上林县', '宾阳县', '横县'] },
  4176. {
  4177. name: '柳州市',
  4178. area: ['城中区', '鱼峰区', '柳北区', '柳南区', '柳江县', '柳城县', '鹿寨县', '融安县', '融水苗族自治县', '三江侗族自治县'] },
  4179. {
  4180. name: '桂林市',
  4181. area: [
  4182. '象山区',
  4183. '秀峰区',
  4184. '叠彩区',
  4185. '七星区',
  4186. '雁山区',
  4187. '阳朔县',
  4188. '临桂县',
  4189. '灵川县',
  4190. '全州县',
  4191. '平乐县',
  4192. '兴安县',
  4193. '灌阳县',
  4194. '荔浦县',
  4195. '资源县',
  4196. '永福县',
  4197. '龙胜各族自治县',
  4198. '恭城瑶族自治县'] },
  4199. {
  4200. name: '梧州市',
  4201. area: ['万秀区', '蝶山区', '长洲区', '岑溪市', '苍梧县', '藤县', '蒙山县'] },
  4202. {
  4203. name: '北海市',
  4204. area: ['海城区', '银海区', '铁山港区', '合浦县'] },
  4205. {
  4206. name: '防城港市',
  4207. area: ['港口区', '防城区', '东兴市', '上思县'] },
  4208. {
  4209. name: '钦州市',
  4210. area: ['钦南区', '钦北区', '灵山县', '浦北县'] },
  4211. {
  4212. name: '贵港市',
  4213. area: ['港北区', '港南区', '覃塘区', '桂平市', '平南县'] },
  4214. {
  4215. name: '玉林市',
  4216. area: ['玉州区', '北流市', '容县', '陆川县', '博白县', '兴业县'] },
  4217. {
  4218. name: '百色市',
  4219. area: ['右江区', '凌云县', '平果县', '西林县', '乐业县', '德保县', '田林县', '田阳县', '靖西县', '田东县', '那坡县',
  4220. '隆林各族自治县'] },
  4221. {
  4222. name: '贺州市',
  4223. area: ['八步区', '钟山县', '昭平县', '富川瑶族自治县'] },
  4224. {
  4225. name: '河池市',
  4226. area: ['金城江区', '宜州市', '天峨县', '凤山县', '南丹县', '东兰县', '都安瑶族自治县', '罗城仫佬族自治县', '巴马瑶族自治县',
  4227. '环江毛南族自治县', '大化瑶族自治县'] },
  4228. {
  4229. name: '来宾市',
  4230. area: ['兴宾区', '合山市', '象州县', '武宣县', '忻城县', '金秀瑶族自治县'] },
  4231. {
  4232. name: '崇左市',
  4233. area: ['江州区', '凭祥市', '宁明县', '扶绥县', '龙州县', '大新县', '天等县'] }] },
  4234. {
  4235. name: '海南省',
  4236. city: [{
  4237. name: '海口市',
  4238. area: ['龙华区', '秀英区', '琼山区', '美兰区'] },
  4239. {
  4240. name: '三亚市',
  4241. area: ['三亚市'] },
  4242. {
  4243. name: '五指山市',
  4244. area: ['五指山'] },
  4245. {
  4246. name: '琼海市',
  4247. area: ['琼海'] },
  4248. {
  4249. name: '儋州市',
  4250. area: ['儋州'] },
  4251. {
  4252. name: '文昌市',
  4253. area: ['文昌'] },
  4254. {
  4255. name: '万宁市',
  4256. area: ['万宁'] },
  4257. {
  4258. name: '东方市',
  4259. area: ['东方'] },
  4260. {
  4261. name: '澄迈县',
  4262. area: ['澄迈县'] },
  4263. {
  4264. name: '定安县',
  4265. area: ['定安县'] },
  4266. {
  4267. name: '屯昌县',
  4268. area: ['屯昌县'] },
  4269. {
  4270. name: '临高县',
  4271. area: ['临高县'] },
  4272. {
  4273. name: '白沙黎族自治县',
  4274. area: ['白沙黎族自治县'] },
  4275. {
  4276. name: '昌江黎族自治县',
  4277. area: ['昌江黎族自治县'] },
  4278. {
  4279. name: '乐东黎族自治县',
  4280. area: ['乐东黎族自治县'] },
  4281. {
  4282. name: '陵水黎族自治县',
  4283. area: ['陵水黎族自治县'] },
  4284. {
  4285. name: '保亭黎族苗族自治县',
  4286. area: ['保亭黎族苗族自治县'] },
  4287. {
  4288. name: '琼中黎族苗族自治县',
  4289. area: ['琼中黎族苗族自治县'] }] },
  4290. {
  4291. name: '重庆市',
  4292. city: [{
  4293. name: '重庆市',
  4294. area: [
  4295. '渝中区',
  4296. '大渡口区',
  4297. '江北区',
  4298. '南岸区',
  4299. '北碚区',
  4300. '渝北区',
  4301. '巴南区',
  4302. '长寿区',
  4303. '双桥区',
  4304. '沙坪坝区',
  4305. '万盛区',
  4306. '万州区',
  4307. '涪陵区',
  4308. '黔江区',
  4309. '永川区',
  4310. '合川区',
  4311. '江津区',
  4312. '九龙坡区',
  4313. '南川区',
  4314. '綦江县',
  4315. '潼南县',
  4316. '荣昌县',
  4317. '璧山县',
  4318. '大足县',
  4319. '铜梁县',
  4320. '梁平县',
  4321. '开县',
  4322. '忠县',
  4323. '城口县',
  4324. '垫江县',
  4325. '武隆县',
  4326. '丰都县',
  4327. '奉节县',
  4328. '云阳县',
  4329. '巫溪县',
  4330. '巫山县',
  4331. '石柱土家族自治县',
  4332. '秀山土家族苗族自治县',
  4333. '酉阳土家族苗族自治县',
  4334. '彭水苗族土家族自治县'] }] },
  4335. {
  4336. name: '四川省',
  4337. city: [{
  4338. name: '成都市',
  4339. area: [
  4340. '青羊区',
  4341. '锦江区',
  4342. '金牛区',
  4343. '武侯区',
  4344. '成华区',
  4345. '龙泉驿区',
  4346. '青白江区',
  4347. '新都区',
  4348. '温江区',
  4349. '都江堰市',
  4350. '彭州市',
  4351. '邛崃市',
  4352. '崇州市',
  4353. '金堂县',
  4354. '郫县',
  4355. '新津县',
  4356. '双流县',
  4357. '蒲江县',
  4358. '大邑县'] },
  4359. {
  4360. name: '自贡市',
  4361. area: ['大安区', '自流井区', '贡井区', '沿滩区', '荣县', '富顺县'] },
  4362. {
  4363. name: '攀枝花市',
  4364. area: ['仁和区', '米易县', '盐边县', '东区', '西区'] },
  4365. {
  4366. name: '泸州市',
  4367. area: ['江阳区', '纳溪区', '龙马潭区', '泸县', '合江县', '叙永县', '古蔺县'] },
  4368. {
  4369. name: '德阳市',
  4370. area: ['旌阳区', '广汉市', '什邡市', '绵竹市', '罗江县', '中江县'] },
  4371. {
  4372. name: '绵阳市',
  4373. area: ['涪城区', '游仙区', '江油市', '盐亭县', '三台县', '平武县', '安县', '梓潼县', '北川羌族自治县'] },
  4374. {
  4375. name: '广元市',
  4376. area: ['元坝区', '朝天区', '青川县', '旺苍县', '剑阁县', '苍溪县', '市中区'] },
  4377. {
  4378. name: '遂宁市',
  4379. area: ['船山区', '安居区', '射洪县', '蓬溪县', '大英县'] },
  4380. {
  4381. name: '内江市',
  4382. area: ['市中区', '东兴区', '资中县', '隆昌县', '威远县'] },
  4383. {
  4384. name: '乐山市',
  4385. area: ['市中区', '五通桥区', '沙湾区', '金口河区', '峨眉山市', '夹江县', '井研县', '犍为县', '沐川县', '马边彝族自治县',
  4386. '峨边彝族自治县'] },
  4387. {
  4388. name: '南充',
  4389. area: ['顺庆区', '高坪区', '嘉陵区', '阆中市', '营山县', '蓬安县', '仪陇县', '南部县', '西充县'] },
  4390. {
  4391. name: '眉山市',
  4392. area: ['东坡区', '仁寿县', '彭山县', '洪雅县', '丹棱县', '青神县'] },
  4393. {
  4394. name: '宜宾市',
  4395. area: ['翠屏区', '宜宾县', '兴文县', '南溪县', '珙县', '长宁县', '高县', '江安县', '筠连县', '屏山县'] },
  4396. {
  4397. name: '广安市',
  4398. area: ['广安区', '华蓥市', '岳池县', '邻水县', '武胜县'] },
  4399. {
  4400. name: '达州市',
  4401. area: ['通川区', '万源市', '达县', '渠县', '宣汉县', '开江县', '大竹县'] },
  4402. {
  4403. name: '雅安市',
  4404. area: ['雨城区', '芦山县', '石棉县', '名山县', '天全县', '荥经县', '宝兴县', '汉源县'] },
  4405. {
  4406. name: '巴中市',
  4407. area: ['巴州区', '南江县', '平昌县', '通江县'] },
  4408. {
  4409. name: '资阳市',
  4410. area: ['雁江区', '简阳市', '安岳县', '乐至县'] },
  4411. {
  4412. name: '阿坝藏族羌族自治州',
  4413. area: ['马尔康县', '九寨沟县', '红原县', '汶川县', '阿坝县', '理县', '若尔盖县', '小金县', '黑水县', '金川县', '松潘县', '壤塘县',
  4414. '茂县'] },
  4415. {
  4416. name: '甘孜藏族自治州',
  4417. area: [
  4418. '康定县',
  4419. '丹巴县',
  4420. '炉霍县',
  4421. '九龙县',
  4422. '甘孜县',
  4423. '雅江县',
  4424. '新龙县',
  4425. '道孚县',
  4426. '白玉县',
  4427. '理塘县',
  4428. '德格县',
  4429. '乡城县',
  4430. '石渠县',
  4431. '稻城县',
  4432. '色达县',
  4433. '巴塘县',
  4434. '泸定县',
  4435. '得荣县'] },
  4436. {
  4437. name: '凉山彝族自治州',
  4438. area: [
  4439. '西昌市',
  4440. '美姑县',
  4441. '昭觉县',
  4442. '金阳县',
  4443. '甘洛县',
  4444. '布拖县',
  4445. '雷波县',
  4446. '普格县',
  4447. '宁南县',
  4448. '喜德县',
  4449. '会东县',
  4450. '越西县',
  4451. '会理县',
  4452. '盐源县',
  4453. '德昌县',
  4454. '冕宁县',
  4455. '木里藏族自治县'] }] },
  4456. {
  4457. name: '贵州省',
  4458. city: [{
  4459. name: '贵阳市',
  4460. area: ['南明区', '云岩区', '花溪区', '乌当区', '白云区', '小河区', '清镇市', '开阳县', '修文县', '息烽县'] },
  4461. {
  4462. name: '六盘水市',
  4463. area: ['钟山区', '水城县', '盘县', '六枝特区'] },
  4464. {
  4465. name: '遵义市',
  4466. area: [
  4467. '红花岗区',
  4468. '汇川区',
  4469. '赤水市',
  4470. '仁怀市',
  4471. '遵义县',
  4472. '绥阳县',
  4473. '桐梓县',
  4474. '习水县',
  4475. '凤冈县',
  4476. '正安县',
  4477. '余庆县',
  4478. '湄潭县',
  4479. '道真仡佬族苗族自治县',
  4480. '务川仡佬族苗族自治县'] },
  4481. {
  4482. name: '安顺市',
  4483. area: ['西秀区', '普定县', '平坝县', '镇宁布依族苗族自治县', '紫云苗族布依族自治县', '关岭布依族苗族自治县'] },
  4484. {
  4485. name: '铜仁地区',
  4486. area: ['铜仁市', '德江县', '江口县', '思南县', '石阡县', '玉屏侗族自治县', '松桃苗族自治县', '印江土家族苗族自治县', '沿河土家族自治县',
  4487. '万山特区'] },
  4488. {
  4489. name: '毕节地区',
  4490. area: ['毕节市', '黔西县', '大方县', '织金县', '金沙县', '赫章县', '纳雍县', '威宁彝族回族苗族自治县'] },
  4491. {
  4492. name: '黔西南布依族苗族自治州',
  4493. area: ['兴义市', '望谟县', '兴仁县', '普安县', '册亨县', '晴隆县', '贞丰县', '安龙县'] },
  4494. {
  4495. name: '黔东南苗族侗族自治州',
  4496. area: ['凯里市', '施秉县', '从江县', '锦屏县', '镇远县', '麻江县', '台江县', '天柱县', '黄平县', '榕江县', '剑河县', '三穗县',
  4497. '雷山县', '黎平县', '岑巩县', '丹寨县'] },
  4498. {
  4499. name: '黔南布依族苗族自治州',
  4500. area: ['都匀市', '福泉市', '贵定县', '惠水县', '罗甸县', '瓮安县', '荔波县', '龙里县', '平塘县', '长顺县', '独山县',
  4501. '三都水族自治县'] }] },
  4502. {
  4503. name: '云南省',
  4504. city: [{
  4505. name: '昆明市',
  4506. area: [
  4507. '盘龙区',
  4508. '五华区',
  4509. '官渡区',
  4510. '西山区',
  4511. '东川区',
  4512. '安宁市',
  4513. '呈贡县',
  4514. '晋宁县',
  4515. '富民县',
  4516. '宜良县',
  4517. '嵩明县',
  4518. '石林彝族自治县',
  4519. '禄劝彝族苗族自治县',
  4520. '寻甸回族彝族自治县'] },
  4521. {
  4522. name: '曲靖市',
  4523. area: ['麒麟区', '宣威市', '马龙县', '沾益县', '富源县', '罗平县', '师宗县', '陆良县', '会泽县'] },
  4524. {
  4525. name: '玉溪市',
  4526. area: ['红塔区', '江川县', '澄江县', '通海县', '华宁县', '易门县', '峨山彝族自治县', '新平彝族傣族自治县', '元江哈尼族彝族傣族自治县'] },
  4527. {
  4528. name: '保山市',
  4529. area: ['隆阳区', '施甸县', '腾冲县', '龙陵县', '昌宁县'] },
  4530. {
  4531. name: '昭通市',
  4532. area: ['昭阳区', '鲁甸县', '巧家县', '盐津县', '大关县', '永善县', '绥江县', '镇雄县', '彝良县', '威信县', '水富县'] },
  4533. {
  4534. name: '丽江市',
  4535. area: ['古城区', '永胜县', '华坪县', '玉龙纳西族自治县', '宁蒗彝族自治县'] },
  4536. {
  4537. name: '普洱市',
  4538. area: [
  4539. '思茅区',
  4540. '普洱哈尼族彝族自治县',
  4541. '墨江哈尼族自治县',
  4542. '景东彝族自治县',
  4543. '景谷傣族彝族自治县',
  4544. '镇沅彝族哈尼族拉祜族自治县',
  4545. '江城哈尼族彝族自治县',
  4546. '孟连傣族拉祜族佤族自治县',
  4547. '澜沧拉祜族自治县',
  4548. '西盟佤族自治县'] },
  4549. {
  4550. name: '临沧市',
  4551. area: ['临翔区', '凤庆县', '云县', '永德县', '镇康县', '双江拉祜族佤族布朗族傣族自治县', '耿马傣族佤族自治县', '沧源佤族自治县'] },
  4552. {
  4553. name: '德宏傣族景颇族自治州',
  4554. area: ['潞西市', '瑞丽市', '梁河县', '盈江县', '陇川县'] },
  4555. {
  4556. name: '怒江傈僳族自治州',
  4557. area: ['泸水县', '福贡县', '贡山独龙族怒族自治县', '兰坪白族普米族自治县'] },
  4558. {
  4559. name: '迪庆藏族自治州',
  4560. area: ['香格里拉县', '德钦县', '维西傈僳族自治县'] },
  4561. {
  4562. name: '大理白族自治州',
  4563. area: ['大理市', '祥云县', '宾川县', '弥渡县', '永平县', '云龙县', '洱源县', '剑川县', '鹤庆县', '漾濞彝族自治县', '南涧彝族自治县',
  4564. '巍山彝族回族自治县'] },
  4565. {
  4566. name: '楚雄彝族自治州',
  4567. area: ['楚雄市', '双柏县', '牟定县', '南华县', '姚安县', '大姚县', '永仁县', '元谋县', '武定县', '禄丰县'] },
  4568. {
  4569. name: '红河哈尼族彝族自治州',
  4570. area: ['蒙自县', '个旧市', '开远市', '绿春县', '建水县', '石屏县', '弥勒县', '泸西县', '元阳县', '红河县', '金平苗族瑶族傣族自治县',
  4571. '河口瑶族自治县', '屏边苗族自治县'] },
  4572. {
  4573. name: '文山壮族苗族自治州',
  4574. area: ['文山县', '砚山县', '西畴县', '麻栗坡县', '马关县', '丘北县', '广南县', '富宁县'] },
  4575. {
  4576. name: '西双版纳傣族自治州',
  4577. area: ['景洪市', '勐海县', '勐腊县'] }] },
  4578. {
  4579. name: '西藏',
  4580. city: [{
  4581. name: '拉萨市',
  4582. area: ['城关区', '林周县', '当雄县', '尼木县', '曲水县', '堆龙德庆县', '达孜县', '墨竹工卡县'] },
  4583. {
  4584. name: '那曲地区',
  4585. area: ['那曲县', '嘉黎县', '比如县', '聂荣县', '安多县', '申扎县', '索县', '班戈县', '巴青县', '尼玛县'] },
  4586. {
  4587. name: '昌都地区',
  4588. area: ['昌都县', '江达县', '贡觉县', '类乌齐县', '丁青县', '察雅县', '八宿县', '左贡县', '芒康县', '洛隆县', '边坝县'] },
  4589. {
  4590. name: '林芝地区',
  4591. area: ['林芝县', '工布江达县', '米林县', '墨脱县', '波密县', '察隅县', '朗县'] },
  4592. {
  4593. name: '山南地区',
  4594. area: ['乃东县', '扎囊县', '贡嘎县', '桑日县', '琼结县', '曲松县', '措美县', '洛扎县', '加查县', '隆子县', '错那县', '浪卡子县'] },
  4595. {
  4596. name: '日喀则地区',
  4597. area: [
  4598. '日喀则市',
  4599. '南木林县',
  4600. '江孜县',
  4601. '定日县',
  4602. '萨迦县',
  4603. '拉孜县',
  4604. '昂仁县',
  4605. '谢通门县',
  4606. '白朗县',
  4607. '仁布县',
  4608. '康马县',
  4609. '定结县',
  4610. '仲巴县',
  4611. '亚东县',
  4612. '吉隆县',
  4613. '聂拉木县',
  4614. '萨嘎县',
  4615. '岗巴县'] },
  4616. {
  4617. name: '阿里地区',
  4618. area: ['噶尔县', '普兰县', '札达县', '日土县', '革吉县', '改则县', '措勤县'] }] },
  4619. {
  4620. name: '陕西省',
  4621. city: [{
  4622. name: '西安市',
  4623. area: ['莲湖区', '新城区', '碑林区', '雁塔区', '灞桥区', '未央区', '阎良区', '临潼区', '长安区', '高陵县', '蓝田县', '户县',
  4624. '周至县'] },
  4625. {
  4626. name: '铜川市',
  4627. area: ['耀州区', '王益区', '印台区', '宜君县'] },
  4628. {
  4629. name: '宝鸡市',
  4630. area: ['渭滨区', '金台区', '陈仓区', '岐山县', '凤翔县', '陇县', '太白县', '麟游县', '扶风县', '千阳县', '眉县', '凤县'] },
  4631. {
  4632. name: '咸阳市',
  4633. area: ['秦都区', '渭城区', '杨陵区', '兴平市', '礼泉县', '泾阳县', '永寿县', '三原县', '彬县', '旬邑县', '长武县', '乾县',
  4634. '武功县', '淳化县'] },
  4635. {
  4636. name: '渭南市',
  4637. area: ['临渭区', '韩城市', '华阴市', '蒲城县', '潼关县', '白水县', '澄城县', '华县', '合阳县', '富平县', '大荔县'] },
  4638. {
  4639. name: '延安市',
  4640. area: ['宝塔区', '安塞县', '洛川县', '子长县', '黄陵县', '延川县', '富县', '延长县', '甘泉县', '宜川县', '志丹县', '黄龙县',
  4641. '吴起县'] },
  4642. {
  4643. name: '汉中市',
  4644. area: ['汉台区', '留坝县', '镇巴县', '城固县', '南郑县', '洋县', '宁强县', '佛坪县', '勉县', '西乡县', '略阳县'] },
  4645. {
  4646. name: '榆林市',
  4647. area: ['榆阳区', '清涧县', '绥德县', '神木县', '佳县', '府谷县', '子洲县', '靖边县', '横山县', '米脂县', '吴堡县', '定边县'] },
  4648. {
  4649. name: '安康市',
  4650. area: ['汉滨区', '紫阳县', '岚皋县', '旬阳县', '镇坪县', '平利县', '石泉县', '宁陕县', '白河县', '汉阴县'] },
  4651. {
  4652. name: '商洛市',
  4653. area: ['商州区', '镇安县', '山阳县', '洛南县', '商南县', '丹凤县', '柞水县'] }] },
  4654. {
  4655. name: '甘肃省',
  4656. city: [{
  4657. name: '兰州市',
  4658. area: ['城关区', '七里河区', '西固区', '安宁区', '红古区', '永登县', '皋兰县', '榆中县'] },
  4659. {
  4660. name: '嘉峪关市',
  4661. area: ['嘉峪关市'] },
  4662. {
  4663. name: '金昌市',
  4664. area: ['金川区', '永昌县'] },
  4665. {
  4666. name: '白银市',
  4667. area: ['白银区', '平川区', '靖远县', '会宁县', '景泰县'] },
  4668. {
  4669. name: '天水市',
  4670. area: ['清水县', '秦安县', '甘谷县', '武山县', '张家川回族自治县', '北道区', '秦城区'] },
  4671. {
  4672. name: '武威市',
  4673. area: ['凉州区', '民勤县', '古浪县', '天祝藏族自治县'] },
  4674. {
  4675. name: '酒泉市',
  4676. area: ['肃州区', '玉门市', '敦煌市', '金塔县', '肃北蒙古族自治县', '阿克塞哈萨克族自治县', '安西县'] },
  4677. {
  4678. name: '张掖市',
  4679. area: ['甘州区', '民乐县', '临泽县', '高台县', '山丹县', '肃南裕固族自治县'] },
  4680. {
  4681. name: '庆阳市',
  4682. area: ['西峰区', '庆城县', '环县', '华池县', '合水县', '正宁县', '宁县', '镇原县'] },
  4683. {
  4684. name: '平凉市',
  4685. area: ['崆峒区', '泾川县', '灵台县', '崇信县', '华亭县', '庄浪县', '静宁县'] },
  4686. {
  4687. name: '定西市',
  4688. area: ['安定区', '通渭县', '临洮县', '漳县', '岷县', '渭源县', '陇西县'] },
  4689. {
  4690. name: '陇南市',
  4691. area: ['武都区', '成县', '宕昌县', '康县', '文县', '西和县', '礼县', '两当县', '徽县'] },
  4692. {
  4693. name: '临夏回族自治州',
  4694. area: ['临夏市', '临夏县', '康乐县', '永靖县', '广河县', '和政县', '东乡族自治县', '积石山保安族东乡族撒拉族自治县'] },
  4695. {
  4696. name: '甘南藏族自治州',
  4697. area: ['合作市', '临潭县', '卓尼县', '舟曲县', '迭部县', '玛曲县', '碌曲县', '夏河县'] }] },
  4698. {
  4699. name: '青海省',
  4700. city: [{
  4701. name: '西宁市',
  4702. area: ['城中区', '城东区', '城西区', '城北区', '湟源县', '湟中县', '大通回族土族自治县'] },
  4703. {
  4704. name: '海东地区',
  4705. area: ['平安县', '乐都县', '民和回族土族自治县', '互助土族自治县', '化隆回族自治县', '循化撒拉族自治县'] },
  4706. {
  4707. name: '海北藏族自治州',
  4708. area: ['海晏县', '祁连县', '刚察县', '门源回族自治县'] },
  4709. {
  4710. name: '海南藏族自治州',
  4711. area: ['共和县', '同德县', '贵德县', '兴海县', '贵南县'] },
  4712. {
  4713. name: '黄南藏族自治州',
  4714. area: ['同仁县', '尖扎县', '泽库县', '河南蒙古族自治县'] },
  4715. {
  4716. name: '果洛藏族自治州',
  4717. area: ['玛沁县', '班玛县', '甘德县', '达日县', '久治县', '玛多县'] },
  4718. {
  4719. name: '玉树藏族自治州',
  4720. area: ['玉树县', '杂多县', '称多县', '治多县', '囊谦县', '曲麻莱县'] },
  4721. {
  4722. name: '海西蒙古族藏族自治州',
  4723. area: ['德令哈市', '格尔木市', '乌兰县', '都兰县', '天峻县'] }] },
  4724. {
  4725. name: '宁夏',
  4726. city: [{
  4727. name: '银川市',
  4728. area: ['兴庆区', '西夏区', '金凤区', '灵武市', '永宁县', '贺兰县'] },
  4729. {
  4730. name: '石嘴山市',
  4731. area: ['大武口区', '惠农区', '平罗县'] },
  4732. {
  4733. name: '吴忠市',
  4734. area: ['利通区', '青铜峡市', '盐池县', '同心县'] },
  4735. {
  4736. name: '固原市',
  4737. area: ['原州区', '西吉县', '隆德县', '泾源县', '彭阳县'] },
  4738. {
  4739. name: '中卫市',
  4740. area: ['沙坡头区', '中宁县', '海原县'] }] },
  4741. {
  4742. name: '新疆',
  4743. city: [{
  4744. name: '乌鲁木齐市',
  4745. area: ['天山区', '沙依巴克区', '新市区', '水磨沟区', '头屯河区', '达坂城区', '东山区', '乌鲁木齐县'] },
  4746. {
  4747. name: '克拉玛依市',
  4748. area: ['克拉玛依区', '独山子区', '白碱滩区', '乌尔禾区'] },
  4749. {
  4750. name: '吐鲁番地区',
  4751. area: ['吐鲁番市', '托克逊县', '鄯善县'] },
  4752. {
  4753. name: '哈密地区',
  4754. area: ['哈密市', '伊吾县', '巴里坤哈萨克自治县'] },
  4755. {
  4756. name: '和田地区',
  4757. area: ['和田市', '和田县', '洛浦县', '民丰县', '皮山县', '策勒县', '于田县', '墨玉县'] },
  4758. {
  4759. name: '阿克苏地区',
  4760. area: ['阿克苏市', '温宿县', '沙雅县', '拜城县', '阿瓦提县', '库车县', '柯坪县', '新和县', '乌什县'] },
  4761. {
  4762. name: '喀什地区',
  4763. area: ['喀什市', '巴楚县', '泽普县', '伽师县', '叶城县', '岳普湖县', '疏勒县', '麦盖提县', '英吉沙县', '莎车县', '疏附县',
  4764. '塔什库尔干塔吉克自治县'] },
  4765. {
  4766. name: '克孜勒苏柯尔克孜自治州',
  4767. area: ['阿图什市', '阿合奇县', '乌恰县', '阿克陶县'] },
  4768. {
  4769. name: '巴音郭楞蒙古自治州',
  4770. area: ['库尔勒市', '和静县', '尉犁县', '和硕县', '且末县', '博湖县', '轮台县', '若羌县', '焉耆回族自治县'] },
  4771. {
  4772. name: '昌吉回族自治州',
  4773. area: ['昌吉市', '阜康市', '奇台县', '玛纳斯县', '吉木萨尔县', '呼图壁县', '木垒哈萨克自治县', '米泉市'] },
  4774. {
  4775. name: '博尔塔拉蒙古自治州',
  4776. area: ['博乐市', '精河县', '温泉县'] },
  4777. {
  4778. name: '石河子',
  4779. area: ['石河子'] },
  4780. {
  4781. name: '阿拉尔',
  4782. area: ['阿拉尔'] },
  4783. {
  4784. name: '图木舒克',
  4785. area: ['图木舒克'] },
  4786. {
  4787. name: '五家渠',
  4788. area: ['五家渠'] },
  4789. {
  4790. name: '伊犁哈萨克自治州',
  4791. area: ['伊宁市', '奎屯市', '伊宁县', '特克斯县', '尼勒克县', '昭苏县', '新源县', '霍城县', '巩留县', '察布查尔锡伯自治县', '塔城地区',
  4792. '阿勒泰地区'] }] },
  4793. {
  4794. name: '台湾省',
  4795. city: [{
  4796. name: '台北市',
  4797. area: ['内湖区', '南港区', '中正区', '万华区', '大同区', '中山区', '松山区', '大安区', '信义区', '文山区', '士林区', '北投区'] },
  4798. {
  4799. name: '新北市',
  4800. area: ['板桥区', '汐止区', '新店区'] },
  4801. {
  4802. name: '桃园市',
  4803. area: ['其他'] },
  4804. {
  4805. name: '台中市',
  4806. area: ['其他'] },
  4807. {
  4808. name: '台南市',
  4809. area: ['其他'] },
  4810. {
  4811. name: '高雄市',
  4812. area: ['其他'] }] },
  4813. {
  4814. name: '澳门',
  4815. city: [{
  4816. name: '澳门',
  4817. area: ['花地玛堂区', '圣安多尼堂区', '大堂区', '望德堂区', '风顺堂区', '嘉模堂区', '圣方济各堂区', '路凼'] }] },
  4818. {
  4819. name: '香港',
  4820. city: [{
  4821. name: '香港',
  4822. area: [
  4823. '深水埗区',
  4824. '油尖旺区',
  4825. '九龙城区',
  4826. '黄大仙区',
  4827. '观塘区',
  4828. '北区',
  4829. '大埔区',
  4830. '沙田区',
  4831. '西贡区',
  4832. '元朗区',
  4833. '屯门区',
  4834. '荃湾区',
  4835. '葵青区',
  4836. '离岛区',
  4837. '中西区',
  4838. '湾仔区',
  4839. '东区',
  4840. '南区'] }] }],
  4841. debug: true };exports.default = _default;
  4842. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  4843. /***/ }),
  4844. /***/ 18:
  4845. /*!************************************************************!*\
  4846. !*** E:/project/新耗材小程序/material_applet/common/computed.js ***!
  4847. \************************************************************/
  4848. /*! no static exports found */
  4849. /***/ (function(module, exports, __webpack_require__) {
  4850. "use strict";
  4851. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 4));
  4852. var _decimal = _interopRequireDefault(__webpack_require__(/*! decimal.js */ 19));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  4853. var toNumber = function toNumber(num) {
  4854. return new _decimal.default(num).toNumber();
  4855. };
  4856. var plus = function plus() {var n1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;var n2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  4857. var number1 = new _decimal.default(n1);
  4858. var number2 = new _decimal.default(n2);
  4859. var result = number1.add(number2);
  4860. result = result.toFixed(2, _decimal.default.ROUND_DOWN);
  4861. return toNumber(result);
  4862. };
  4863. var minus = function minus() {var n1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;var n2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  4864. var number1 = new _decimal.default(n1);
  4865. var number2 = new _decimal.default(n2);
  4866. var result = number1.minus(number2);
  4867. result = result.toFixed(2, _decimal.default.ROUND_DOWN);
  4868. return toNumber(result);
  4869. };
  4870. var multiply = function multiply() {var n1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;var n2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  4871. var number1 = new _decimal.default(n1);
  4872. var number2 = new _decimal.default(n2);
  4873. var result = number1.mul(number2);
  4874. result = result.toFixed(2, _decimal.default.ROUND_DOWN);
  4875. return toNumber(result);
  4876. };
  4877. var divide = function divide() {var n1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;var n2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  4878. var number1 = new _decimal.default(n1);
  4879. var number2 = new _decimal.default(n2);
  4880. var result = number1.div(number2);
  4881. result = result.toFixed(2, _decimal.default.ROUND_DOWN);
  4882. return toNumber(result);
  4883. };
  4884. _vue.default.prototype.$plus = plus;
  4885. _vue.default.prototype.$minus = minus;
  4886. _vue.default.prototype.$multiply = multiply;
  4887. _vue.default.prototype.$divide = divide;
  4888. /***/ }),
  4889. /***/ 19:
  4890. /*!****************************************************************************!*\
  4891. !*** E:/project/新耗材小程序/material_applet/node_modules/decimal.js/decimal.js ***!
  4892. \****************************************************************************/
  4893. /*! no static exports found */
  4894. /***/ (function(module, exports, __webpack_require__) {
  4895. var __WEBPACK_AMD_DEFINE_RESULT__;;(function (globalScope) {
  4896. 'use strict';
  4897. /*!
  4898. * decimal.js v10.4.3
  4899. * An arbitrary-precision Decimal type for JavaScript.
  4900. * https://github.com/MikeMcl/decimal.js
  4901. * Copyright (c) 2022 Michael Mclaughlin <M8ch88l@gmail.com>
  4902. * MIT Licence
  4903. */
  4904. // ----------------------------------- EDITABLE DEFAULTS ------------------------------------ //
  4905. // The maximum exponent magnitude.
  4906. // The limit on the value of `toExpNeg`, `toExpPos`, `minE` and `maxE`.
  4907. var EXP_LIMIT = 9e15, // 0 to 9e15
  4908. // The limit on the value of `precision`, and on the value of the first argument to
  4909. // `toDecimalPlaces`, `toExponential`, `toFixed`, `toPrecision` and `toSignificantDigits`.
  4910. MAX_DIGITS = 1e9, // 0 to 1e9
  4911. // Base conversion alphabet.
  4912. NUMERALS = '0123456789abcdef',
  4913. // The natural logarithm of 10 (1025 digits).
  4914. LN10 = '2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058',
  4915. // Pi (1025 digits).
  4916. PI = '3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789',
  4917. // The initial configuration properties of the Decimal constructor.
  4918. DEFAULTS = {
  4919. // These values must be integers within the stated ranges (inclusive).
  4920. // Most of these values can be changed at run-time using the `Decimal.config` method.
  4921. // The maximum number of significant digits of the result of a calculation or base conversion.
  4922. // E.g. `Decimal.config({ precision: 20 });`
  4923. precision: 20, // 1 to MAX_DIGITS
  4924. // The rounding mode used when rounding to `precision`.
  4925. //
  4926. // ROUND_UP 0 Away from zero.
  4927. // ROUND_DOWN 1 Towards zero.
  4928. // ROUND_CEIL 2 Towards +Infinity.
  4929. // ROUND_FLOOR 3 Towards -Infinity.
  4930. // ROUND_HALF_UP 4 Towards nearest neighbour. If equidistant, up.
  4931. // ROUND_HALF_DOWN 5 Towards nearest neighbour. If equidistant, down.
  4932. // ROUND_HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour.
  4933. // ROUND_HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity.
  4934. // ROUND_HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity.
  4935. //
  4936. // E.g.
  4937. // `Decimal.rounding = 4;`
  4938. // `Decimal.rounding = Decimal.ROUND_HALF_UP;`
  4939. rounding: 4, // 0 to 8
  4940. // The modulo mode used when calculating the modulus: a mod n.
  4941. // The quotient (q = a / n) is calculated according to the corresponding rounding mode.
  4942. // The remainder (r) is calculated as: r = a - n * q.
  4943. //
  4944. // UP 0 The remainder is positive if the dividend is negative, else is negative.
  4945. // DOWN 1 The remainder has the same sign as the dividend (JavaScript %).
  4946. // FLOOR 3 The remainder has the same sign as the divisor (Python %).
  4947. // HALF_EVEN 6 The IEEE 754 remainder function.
  4948. // EUCLID 9 Euclidian division. q = sign(n) * floor(a / abs(n)). Always positive.
  4949. //
  4950. // Truncated division (1), floored division (3), the IEEE 754 remainder (6), and Euclidian
  4951. // division (9) are commonly used for the modulus operation. The other rounding modes can also
  4952. // be used, but they may not give useful results.
  4953. modulo: 1, // 0 to 9
  4954. // The exponent value at and beneath which `toString` returns exponential notation.
  4955. // JavaScript numbers: -7
  4956. toExpNeg: -7, // 0 to -EXP_LIMIT
  4957. // The exponent value at and above which `toString` returns exponential notation.
  4958. // JavaScript numbers: 21
  4959. toExpPos: 21, // 0 to EXP_LIMIT
  4960. // The minimum exponent value, beneath which underflow to zero occurs.
  4961. // JavaScript numbers: -324 (5e-324)
  4962. minE: -EXP_LIMIT, // -1 to -EXP_LIMIT
  4963. // The maximum exponent value, above which overflow to Infinity occurs.
  4964. // JavaScript numbers: 308 (1.7976931348623157e+308)
  4965. maxE: EXP_LIMIT, // 1 to EXP_LIMIT
  4966. // Whether to use cryptographically-secure random number generation, if available.
  4967. crypto: false // true/false
  4968. },
  4969. // ----------------------------------- END OF EDITABLE DEFAULTS ------------------------------- //
  4970. Decimal,inexact,noConflict,quadrant,
  4971. external = true,
  4972. decimalError = '[DecimalError] ',
  4973. invalidArgument = decimalError + 'Invalid argument: ',
  4974. precisionLimitExceeded = decimalError + 'Precision limit exceeded',
  4975. cryptoUnavailable = decimalError + 'crypto unavailable',
  4976. tag = '[object Decimal]',
  4977. mathfloor = Math.floor,
  4978. mathpow = Math.pow,
  4979. isBinary = /^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,
  4980. isHex = /^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,
  4981. isOctal = /^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,
  4982. isDecimal = /^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,
  4983. BASE = 1e7,
  4984. LOG_BASE = 7,
  4985. MAX_SAFE_INTEGER = 9007199254740991,
  4986. LN10_PRECISION = LN10.length - 1,
  4987. PI_PRECISION = PI.length - 1,
  4988. // Decimal.prototype object
  4989. P = { toStringTag: tag };
  4990. // Decimal prototype methods
  4991. /*
  4992. * absoluteValue abs
  4993. * ceil
  4994. * clampedTo clamp
  4995. * comparedTo cmp
  4996. * cosine cos
  4997. * cubeRoot cbrt
  4998. * decimalPlaces dp
  4999. * dividedBy div
  5000. * dividedToIntegerBy divToInt
  5001. * equals eq
  5002. * floor
  5003. * greaterThan gt
  5004. * greaterThanOrEqualTo gte
  5005. * hyperbolicCosine cosh
  5006. * hyperbolicSine sinh
  5007. * hyperbolicTangent tanh
  5008. * inverseCosine acos
  5009. * inverseHyperbolicCosine acosh
  5010. * inverseHyperbolicSine asinh
  5011. * inverseHyperbolicTangent atanh
  5012. * inverseSine asin
  5013. * inverseTangent atan
  5014. * isFinite
  5015. * isInteger isInt
  5016. * isNaN
  5017. * isNegative isNeg
  5018. * isPositive isPos
  5019. * isZero
  5020. * lessThan lt
  5021. * lessThanOrEqualTo lte
  5022. * logarithm log
  5023. * [maximum] [max]
  5024. * [minimum] [min]
  5025. * minus sub
  5026. * modulo mod
  5027. * naturalExponential exp
  5028. * naturalLogarithm ln
  5029. * negated neg
  5030. * plus add
  5031. * precision sd
  5032. * round
  5033. * sine sin
  5034. * squareRoot sqrt
  5035. * tangent tan
  5036. * times mul
  5037. * toBinary
  5038. * toDecimalPlaces toDP
  5039. * toExponential
  5040. * toFixed
  5041. * toFraction
  5042. * toHexadecimal toHex
  5043. * toNearest
  5044. * toNumber
  5045. * toOctal
  5046. * toPower pow
  5047. * toPrecision
  5048. * toSignificantDigits toSD
  5049. * toString
  5050. * truncated trunc
  5051. * valueOf toJSON
  5052. */
  5053. /*
  5054. * Return a new Decimal whose value is the absolute value of this Decimal.
  5055. *
  5056. */
  5057. P.absoluteValue = P.abs = function () {
  5058. var x = new this.constructor(this);
  5059. if (x.s < 0) x.s = 1;
  5060. return finalise(x);
  5061. };
  5062. /*
  5063. * Return a new Decimal whose value is the value of this Decimal rounded to a whole number in the
  5064. * direction of positive Infinity.
  5065. *
  5066. */
  5067. P.ceil = function () {
  5068. return finalise(new this.constructor(this), this.e + 1, 2);
  5069. };
  5070. /*
  5071. * Return a new Decimal whose value is the value of this Decimal clamped to the range
  5072. * delineated by `min` and `max`.
  5073. *
  5074. * min {number|string|Decimal}
  5075. * max {number|string|Decimal}
  5076. *
  5077. */
  5078. P.clampedTo = P.clamp = function (min, max) {
  5079. var k,
  5080. x = this,
  5081. Ctor = x.constructor;
  5082. min = new Ctor(min);
  5083. max = new Ctor(max);
  5084. if (!min.s || !max.s) return new Ctor(NaN);
  5085. if (min.gt(max)) throw Error(invalidArgument + max);
  5086. k = x.cmp(min);
  5087. return k < 0 ? min : x.cmp(max) > 0 ? max : new Ctor(x);
  5088. };
  5089. /*
  5090. * Return
  5091. * 1 if the value of this Decimal is greater than the value of `y`,
  5092. * -1 if the value of this Decimal is less than the value of `y`,
  5093. * 0 if they have the same value,
  5094. * NaN if the value of either Decimal is NaN.
  5095. *
  5096. */
  5097. P.comparedTo = P.cmp = function (y) {
  5098. var i,j,xdL,ydL,
  5099. x = this,
  5100. xd = x.d,
  5101. yd = (y = new x.constructor(y)).d,
  5102. xs = x.s,
  5103. ys = y.s;
  5104. // Either NaN or ±Infinity?
  5105. if (!xd || !yd) {
  5106. return !xs || !ys ? NaN : xs !== ys ? xs : xd === yd ? 0 : !xd ^ xs < 0 ? 1 : -1;
  5107. }
  5108. // Either zero?
  5109. if (!xd[0] || !yd[0]) return xd[0] ? xs : yd[0] ? -ys : 0;
  5110. // Signs differ?
  5111. if (xs !== ys) return xs;
  5112. // Compare exponents.
  5113. if (x.e !== y.e) return x.e > y.e ^ xs < 0 ? 1 : -1;
  5114. xdL = xd.length;
  5115. ydL = yd.length;
  5116. // Compare digit by digit.
  5117. for (i = 0, j = xdL < ydL ? xdL : ydL; i < j; ++i) {
  5118. if (xd[i] !== yd[i]) return xd[i] > yd[i] ^ xs < 0 ? 1 : -1;
  5119. }
  5120. // Compare lengths.
  5121. return xdL === ydL ? 0 : xdL > ydL ^ xs < 0 ? 1 : -1;
  5122. };
  5123. /*
  5124. * Return a new Decimal whose value is the cosine of the value in radians of this Decimal.
  5125. *
  5126. * Domain: [-Infinity, Infinity]
  5127. * Range: [-1, 1]
  5128. *
  5129. * cos(0) = 1
  5130. * cos(-0) = 1
  5131. * cos(Infinity) = NaN
  5132. * cos(-Infinity) = NaN
  5133. * cos(NaN) = NaN
  5134. *
  5135. */
  5136. P.cosine = P.cos = function () {
  5137. var pr,rm,
  5138. x = this,
  5139. Ctor = x.constructor;
  5140. if (!x.d) return new Ctor(NaN);
  5141. // cos(0) = cos(-0) = 1
  5142. if (!x.d[0]) return new Ctor(1);
  5143. pr = Ctor.precision;
  5144. rm = Ctor.rounding;
  5145. Ctor.precision = pr + Math.max(x.e, x.sd()) + LOG_BASE;
  5146. Ctor.rounding = 1;
  5147. x = cosine(Ctor, toLessThanHalfPi(Ctor, x));
  5148. Ctor.precision = pr;
  5149. Ctor.rounding = rm;
  5150. return finalise(quadrant == 2 || quadrant == 3 ? x.neg() : x, pr, rm, true);
  5151. };
  5152. /*
  5153. *
  5154. * Return a new Decimal whose value is the cube root of the value of this Decimal, rounded to
  5155. * `precision` significant digits using rounding mode `rounding`.
  5156. *
  5157. * cbrt(0) = 0
  5158. * cbrt(-0) = -0
  5159. * cbrt(1) = 1
  5160. * cbrt(-1) = -1
  5161. * cbrt(N) = N
  5162. * cbrt(-I) = -I
  5163. * cbrt(I) = I
  5164. *
  5165. * Math.cbrt(x) = (x < 0 ? -Math.pow(-x, 1/3) : Math.pow(x, 1/3))
  5166. *
  5167. */
  5168. P.cubeRoot = P.cbrt = function () {
  5169. var e,m,n,r,rep,s,sd,t,t3,t3plusx,
  5170. x = this,
  5171. Ctor = x.constructor;
  5172. if (!x.isFinite() || x.isZero()) return new Ctor(x);
  5173. external = false;
  5174. // Initial estimate.
  5175. s = x.s * mathpow(x.s * x, 1 / 3);
  5176. // Math.cbrt underflow/overflow?
  5177. // Pass x to Math.pow as integer, then adjust the exponent of the result.
  5178. if (!s || Math.abs(s) == 1 / 0) {
  5179. n = digitsToString(x.d);
  5180. e = x.e;
  5181. // Adjust n exponent so it is a multiple of 3 away from x exponent.
  5182. if (s = (e - n.length + 1) % 3) n += s == 1 || s == -2 ? '0' : '00';
  5183. s = mathpow(n, 1 / 3);
  5184. // Rarely, e may be one less than the result exponent value.
  5185. e = mathfloor((e + 1) / 3) - (e % 3 == (e < 0 ? -1 : 2));
  5186. if (s == 1 / 0) {
  5187. n = '5e' + e;
  5188. } else {
  5189. n = s.toExponential();
  5190. n = n.slice(0, n.indexOf('e') + 1) + e;
  5191. }
  5192. r = new Ctor(n);
  5193. r.s = x.s;
  5194. } else {
  5195. r = new Ctor(s.toString());
  5196. }
  5197. sd = (e = Ctor.precision) + 3;
  5198. // Halley's method.
  5199. // TODO? Compare Newton's method.
  5200. for (;;) {
  5201. t = r;
  5202. t3 = t.times(t).times(t);
  5203. t3plusx = t3.plus(x);
  5204. r = divide(t3plusx.plus(x).times(t), t3plusx.plus(t3), sd + 2, 1);
  5205. // TODO? Replace with for-loop and checkRoundingDigits.
  5206. if (digitsToString(t.d).slice(0, sd) === (n = digitsToString(r.d)).slice(0, sd)) {
  5207. n = n.slice(sd - 3, sd + 1);
  5208. // The 4th rounding digit may be in error by -1 so if the 4 rounding digits are 9999 or 4999
  5209. // , i.e. approaching a rounding boundary, continue the iteration.
  5210. if (n == '9999' || !rep && n == '4999') {
  5211. // On the first iteration only, check to see if rounding up gives the exact result as the
  5212. // nines may infinitely repeat.
  5213. if (!rep) {
  5214. finalise(t, e + 1, 0);
  5215. if (t.times(t).times(t).eq(x)) {
  5216. r = t;
  5217. break;
  5218. }
  5219. }
  5220. sd += 4;
  5221. rep = 1;
  5222. } else {
  5223. // If the rounding digits are null, 0{0,4} or 50{0,3}, check for an exact result.
  5224. // If not, then there are further digits and m will be truthy.
  5225. if (!+n || !+n.slice(1) && n.charAt(0) == '5') {
  5226. // Truncate to the first rounding digit.
  5227. finalise(r, e + 1, 1);
  5228. m = !r.times(r).times(r).eq(x);
  5229. }
  5230. break;
  5231. }
  5232. }
  5233. }
  5234. external = true;
  5235. return finalise(r, e, Ctor.rounding, m);
  5236. };
  5237. /*
  5238. * Return the number of decimal places of the value of this Decimal.
  5239. *
  5240. */
  5241. P.decimalPlaces = P.dp = function () {
  5242. var w,
  5243. d = this.d,
  5244. n = NaN;
  5245. if (d) {
  5246. w = d.length - 1;
  5247. n = (w - mathfloor(this.e / LOG_BASE)) * LOG_BASE;
  5248. // Subtract the number of trailing zeros of the last word.
  5249. w = d[w];
  5250. if (w) for (; w % 10 == 0; w /= 10) {n--;}
  5251. if (n < 0) n = 0;
  5252. }
  5253. return n;
  5254. };
  5255. /*
  5256. * n / 0 = I
  5257. * n / N = N
  5258. * n / I = 0
  5259. * 0 / n = 0
  5260. * 0 / 0 = N
  5261. * 0 / N = N
  5262. * 0 / I = 0
  5263. * N / n = N
  5264. * N / 0 = N
  5265. * N / N = N
  5266. * N / I = N
  5267. * I / n = I
  5268. * I / 0 = I
  5269. * I / N = N
  5270. * I / I = N
  5271. *
  5272. * Return a new Decimal whose value is the value of this Decimal divided by `y`, rounded to
  5273. * `precision` significant digits using rounding mode `rounding`.
  5274. *
  5275. */
  5276. P.dividedBy = P.div = function (y) {
  5277. return divide(this, new this.constructor(y));
  5278. };
  5279. /*
  5280. * Return a new Decimal whose value is the integer part of dividing the value of this Decimal
  5281. * by the value of `y`, rounded to `precision` significant digits using rounding mode `rounding`.
  5282. *
  5283. */
  5284. P.dividedToIntegerBy = P.divToInt = function (y) {
  5285. var x = this,
  5286. Ctor = x.constructor;
  5287. return finalise(divide(x, new Ctor(y), 0, 1, 1), Ctor.precision, Ctor.rounding);
  5288. };
  5289. /*
  5290. * Return true if the value of this Decimal is equal to the value of `y`, otherwise return false.
  5291. *
  5292. */
  5293. P.equals = P.eq = function (y) {
  5294. return this.cmp(y) === 0;
  5295. };
  5296. /*
  5297. * Return a new Decimal whose value is the value of this Decimal rounded to a whole number in the
  5298. * direction of negative Infinity.
  5299. *
  5300. */
  5301. P.floor = function () {
  5302. return finalise(new this.constructor(this), this.e + 1, 3);
  5303. };
  5304. /*
  5305. * Return true if the value of this Decimal is greater than the value of `y`, otherwise return
  5306. * false.
  5307. *
  5308. */
  5309. P.greaterThan = P.gt = function (y) {
  5310. return this.cmp(y) > 0;
  5311. };
  5312. /*
  5313. * Return true if the value of this Decimal is greater than or equal to the value of `y`,
  5314. * otherwise return false.
  5315. *
  5316. */
  5317. P.greaterThanOrEqualTo = P.gte = function (y) {
  5318. var k = this.cmp(y);
  5319. return k == 1 || k === 0;
  5320. };
  5321. /*
  5322. * Return a new Decimal whose value is the hyperbolic cosine of the value in radians of this
  5323. * Decimal.
  5324. *
  5325. * Domain: [-Infinity, Infinity]
  5326. * Range: [1, Infinity]
  5327. *
  5328. * cosh(x) = 1 + x^2/2! + x^4/4! + x^6/6! + ...
  5329. *
  5330. * cosh(0) = 1
  5331. * cosh(-0) = 1
  5332. * cosh(Infinity) = Infinity
  5333. * cosh(-Infinity) = Infinity
  5334. * cosh(NaN) = NaN
  5335. *
  5336. * x time taken (ms) result
  5337. * 1000 9 9.8503555700852349694e+433
  5338. * 10000 25 4.4034091128314607936e+4342
  5339. * 100000 171 1.4033316802130615897e+43429
  5340. * 1000000 3817 1.5166076984010437725e+434294
  5341. * 10000000 abandoned after 2 minute wait
  5342. *
  5343. * TODO? Compare performance of cosh(x) = 0.5 * (exp(x) + exp(-x))
  5344. *
  5345. */
  5346. P.hyperbolicCosine = P.cosh = function () {
  5347. var k,n,pr,rm,len,
  5348. x = this,
  5349. Ctor = x.constructor,
  5350. one = new Ctor(1);
  5351. if (!x.isFinite()) return new Ctor(x.s ? 1 / 0 : NaN);
  5352. if (x.isZero()) return one;
  5353. pr = Ctor.precision;
  5354. rm = Ctor.rounding;
  5355. Ctor.precision = pr + Math.max(x.e, x.sd()) + 4;
  5356. Ctor.rounding = 1;
  5357. len = x.d.length;
  5358. // Argument reduction: cos(4x) = 1 - 8cos^2(x) + 8cos^4(x) + 1
  5359. // i.e. cos(x) = 1 - cos^2(x/4)(8 - 8cos^2(x/4))
  5360. // Estimate the optimum number of times to use the argument reduction.
  5361. // TODO? Estimation reused from cosine() and may not be optimal here.
  5362. if (len < 32) {
  5363. k = Math.ceil(len / 3);
  5364. n = (1 / tinyPow(4, k)).toString();
  5365. } else {
  5366. k = 16;
  5367. n = '2.3283064365386962890625e-10';
  5368. }
  5369. x = taylorSeries(Ctor, 1, x.times(n), new Ctor(1), true);
  5370. // Reverse argument reduction
  5371. var cosh2_x,
  5372. i = k,
  5373. d8 = new Ctor(8);
  5374. for (; i--;) {
  5375. cosh2_x = x.times(x);
  5376. x = one.minus(cosh2_x.times(d8.minus(cosh2_x.times(d8))));
  5377. }
  5378. return finalise(x, Ctor.precision = pr, Ctor.rounding = rm, true);
  5379. };
  5380. /*
  5381. * Return a new Decimal whose value is the hyperbolic sine of the value in radians of this
  5382. * Decimal.
  5383. *
  5384. * Domain: [-Infinity, Infinity]
  5385. * Range: [-Infinity, Infinity]
  5386. *
  5387. * sinh(x) = x + x^3/3! + x^5/5! + x^7/7! + ...
  5388. *
  5389. * sinh(0) = 0
  5390. * sinh(-0) = -0
  5391. * sinh(Infinity) = Infinity
  5392. * sinh(-Infinity) = -Infinity
  5393. * sinh(NaN) = NaN
  5394. *
  5395. * x time taken (ms)
  5396. * 10 2 ms
  5397. * 100 5 ms
  5398. * 1000 14 ms
  5399. * 10000 82 ms
  5400. * 100000 886 ms 1.4033316802130615897e+43429
  5401. * 200000 2613 ms
  5402. * 300000 5407 ms
  5403. * 400000 8824 ms
  5404. * 500000 13026 ms 8.7080643612718084129e+217146
  5405. * 1000000 48543 ms
  5406. *
  5407. * TODO? Compare performance of sinh(x) = 0.5 * (exp(x) - exp(-x))
  5408. *
  5409. */
  5410. P.hyperbolicSine = P.sinh = function () {
  5411. var k,pr,rm,len,
  5412. x = this,
  5413. Ctor = x.constructor;
  5414. if (!x.isFinite() || x.isZero()) return new Ctor(x);
  5415. pr = Ctor.precision;
  5416. rm = Ctor.rounding;
  5417. Ctor.precision = pr + Math.max(x.e, x.sd()) + 4;
  5418. Ctor.rounding = 1;
  5419. len = x.d.length;
  5420. if (len < 3) {
  5421. x = taylorSeries(Ctor, 2, x, x, true);
  5422. } else {
  5423. // Alternative argument reduction: sinh(3x) = sinh(x)(3 + 4sinh^2(x))
  5424. // i.e. sinh(x) = sinh(x/3)(3 + 4sinh^2(x/3))
  5425. // 3 multiplications and 1 addition
  5426. // Argument reduction: sinh(5x) = sinh(x)(5 + sinh^2(x)(20 + 16sinh^2(x)))
  5427. // i.e. sinh(x) = sinh(x/5)(5 + sinh^2(x/5)(20 + 16sinh^2(x/5)))
  5428. // 4 multiplications and 2 additions
  5429. // Estimate the optimum number of times to use the argument reduction.
  5430. k = 1.4 * Math.sqrt(len);
  5431. k = k > 16 ? 16 : k | 0;
  5432. x = x.times(1 / tinyPow(5, k));
  5433. x = taylorSeries(Ctor, 2, x, x, true);
  5434. // Reverse argument reduction
  5435. var sinh2_x,
  5436. d5 = new Ctor(5),
  5437. d16 = new Ctor(16),
  5438. d20 = new Ctor(20);
  5439. for (; k--;) {
  5440. sinh2_x = x.times(x);
  5441. x = x.times(d5.plus(sinh2_x.times(d16.times(sinh2_x).plus(d20))));
  5442. }
  5443. }
  5444. Ctor.precision = pr;
  5445. Ctor.rounding = rm;
  5446. return finalise(x, pr, rm, true);
  5447. };
  5448. /*
  5449. * Return a new Decimal whose value is the hyperbolic tangent of the value in radians of this
  5450. * Decimal.
  5451. *
  5452. * Domain: [-Infinity, Infinity]
  5453. * Range: [-1, 1]
  5454. *
  5455. * tanh(x) = sinh(x) / cosh(x)
  5456. *
  5457. * tanh(0) = 0
  5458. * tanh(-0) = -0
  5459. * tanh(Infinity) = 1
  5460. * tanh(-Infinity) = -1
  5461. * tanh(NaN) = NaN
  5462. *
  5463. */
  5464. P.hyperbolicTangent = P.tanh = function () {
  5465. var pr,rm,
  5466. x = this,
  5467. Ctor = x.constructor;
  5468. if (!x.isFinite()) return new Ctor(x.s);
  5469. if (x.isZero()) return new Ctor(x);
  5470. pr = Ctor.precision;
  5471. rm = Ctor.rounding;
  5472. Ctor.precision = pr + 7;
  5473. Ctor.rounding = 1;
  5474. return divide(x.sinh(), x.cosh(), Ctor.precision = pr, Ctor.rounding = rm);
  5475. };
  5476. /*
  5477. * Return a new Decimal whose value is the arccosine (inverse cosine) in radians of the value of
  5478. * this Decimal.
  5479. *
  5480. * Domain: [-1, 1]
  5481. * Range: [0, pi]
  5482. *
  5483. * acos(x) = pi/2 - asin(x)
  5484. *
  5485. * acos(0) = pi/2
  5486. * acos(-0) = pi/2
  5487. * acos(1) = 0
  5488. * acos(-1) = pi
  5489. * acos(1/2) = pi/3
  5490. * acos(-1/2) = 2*pi/3
  5491. * acos(|x| > 1) = NaN
  5492. * acos(NaN) = NaN
  5493. *
  5494. */
  5495. P.inverseCosine = P.acos = function () {
  5496. var halfPi,
  5497. x = this,
  5498. Ctor = x.constructor,
  5499. k = x.abs().cmp(1),
  5500. pr = Ctor.precision,
  5501. rm = Ctor.rounding;
  5502. if (k !== -1) {
  5503. return k === 0
  5504. // |x| is 1
  5505. ? x.isNeg() ? getPi(Ctor, pr, rm) : new Ctor(0)
  5506. // |x| > 1 or x is NaN
  5507. : new Ctor(NaN);
  5508. }
  5509. if (x.isZero()) return getPi(Ctor, pr + 4, rm).times(0.5);
  5510. // TODO? Special case acos(0.5) = pi/3 and acos(-0.5) = 2*pi/3
  5511. Ctor.precision = pr + 6;
  5512. Ctor.rounding = 1;
  5513. x = x.asin();
  5514. halfPi = getPi(Ctor, pr + 4, rm).times(0.5);
  5515. Ctor.precision = pr;
  5516. Ctor.rounding = rm;
  5517. return halfPi.minus(x);
  5518. };
  5519. /*
  5520. * Return a new Decimal whose value is the inverse of the hyperbolic cosine in radians of the
  5521. * value of this Decimal.
  5522. *
  5523. * Domain: [1, Infinity]
  5524. * Range: [0, Infinity]
  5525. *
  5526. * acosh(x) = ln(x + sqrt(x^2 - 1))
  5527. *
  5528. * acosh(x < 1) = NaN
  5529. * acosh(NaN) = NaN
  5530. * acosh(Infinity) = Infinity
  5531. * acosh(-Infinity) = NaN
  5532. * acosh(0) = NaN
  5533. * acosh(-0) = NaN
  5534. * acosh(1) = 0
  5535. * acosh(-1) = NaN
  5536. *
  5537. */
  5538. P.inverseHyperbolicCosine = P.acosh = function () {
  5539. var pr,rm,
  5540. x = this,
  5541. Ctor = x.constructor;
  5542. if (x.lte(1)) return new Ctor(x.eq(1) ? 0 : NaN);
  5543. if (!x.isFinite()) return new Ctor(x);
  5544. pr = Ctor.precision;
  5545. rm = Ctor.rounding;
  5546. Ctor.precision = pr + Math.max(Math.abs(x.e), x.sd()) + 4;
  5547. Ctor.rounding = 1;
  5548. external = false;
  5549. x = x.times(x).minus(1).sqrt().plus(x);
  5550. external = true;
  5551. Ctor.precision = pr;
  5552. Ctor.rounding = rm;
  5553. return x.ln();
  5554. };
  5555. /*
  5556. * Return a new Decimal whose value is the inverse of the hyperbolic sine in radians of the value
  5557. * of this Decimal.
  5558. *
  5559. * Domain: [-Infinity, Infinity]
  5560. * Range: [-Infinity, Infinity]
  5561. *
  5562. * asinh(x) = ln(x + sqrt(x^2 + 1))
  5563. *
  5564. * asinh(NaN) = NaN
  5565. * asinh(Infinity) = Infinity
  5566. * asinh(-Infinity) = -Infinity
  5567. * asinh(0) = 0
  5568. * asinh(-0) = -0
  5569. *
  5570. */
  5571. P.inverseHyperbolicSine = P.asinh = function () {
  5572. var pr,rm,
  5573. x = this,
  5574. Ctor = x.constructor;
  5575. if (!x.isFinite() || x.isZero()) return new Ctor(x);
  5576. pr = Ctor.precision;
  5577. rm = Ctor.rounding;
  5578. Ctor.precision = pr + 2 * Math.max(Math.abs(x.e), x.sd()) + 6;
  5579. Ctor.rounding = 1;
  5580. external = false;
  5581. x = x.times(x).plus(1).sqrt().plus(x);
  5582. external = true;
  5583. Ctor.precision = pr;
  5584. Ctor.rounding = rm;
  5585. return x.ln();
  5586. };
  5587. /*
  5588. * Return a new Decimal whose value is the inverse of the hyperbolic tangent in radians of the
  5589. * value of this Decimal.
  5590. *
  5591. * Domain: [-1, 1]
  5592. * Range: [-Infinity, Infinity]
  5593. *
  5594. * atanh(x) = 0.5 * ln((1 + x) / (1 - x))
  5595. *
  5596. * atanh(|x| > 1) = NaN
  5597. * atanh(NaN) = NaN
  5598. * atanh(Infinity) = NaN
  5599. * atanh(-Infinity) = NaN
  5600. * atanh(0) = 0
  5601. * atanh(-0) = -0
  5602. * atanh(1) = Infinity
  5603. * atanh(-1) = -Infinity
  5604. *
  5605. */
  5606. P.inverseHyperbolicTangent = P.atanh = function () {
  5607. var pr,rm,wpr,xsd,
  5608. x = this,
  5609. Ctor = x.constructor;
  5610. if (!x.isFinite()) return new Ctor(NaN);
  5611. if (x.e >= 0) return new Ctor(x.abs().eq(1) ? x.s / 0 : x.isZero() ? x : NaN);
  5612. pr = Ctor.precision;
  5613. rm = Ctor.rounding;
  5614. xsd = x.sd();
  5615. if (Math.max(xsd, pr) < 2 * -x.e - 1) return finalise(new Ctor(x), pr, rm, true);
  5616. Ctor.precision = wpr = xsd - x.e;
  5617. x = divide(x.plus(1), new Ctor(1).minus(x), wpr + pr, 1);
  5618. Ctor.precision = pr + 4;
  5619. Ctor.rounding = 1;
  5620. x = x.ln();
  5621. Ctor.precision = pr;
  5622. Ctor.rounding = rm;
  5623. return x.times(0.5);
  5624. };
  5625. /*
  5626. * Return a new Decimal whose value is the arcsine (inverse sine) in radians of the value of this
  5627. * Decimal.
  5628. *
  5629. * Domain: [-Infinity, Infinity]
  5630. * Range: [-pi/2, pi/2]
  5631. *
  5632. * asin(x) = 2*atan(x/(1 + sqrt(1 - x^2)))
  5633. *
  5634. * asin(0) = 0
  5635. * asin(-0) = -0
  5636. * asin(1/2) = pi/6
  5637. * asin(-1/2) = -pi/6
  5638. * asin(1) = pi/2
  5639. * asin(-1) = -pi/2
  5640. * asin(|x| > 1) = NaN
  5641. * asin(NaN) = NaN
  5642. *
  5643. * TODO? Compare performance of Taylor series.
  5644. *
  5645. */
  5646. P.inverseSine = P.asin = function () {
  5647. var halfPi,k,
  5648. pr,rm,
  5649. x = this,
  5650. Ctor = x.constructor;
  5651. if (x.isZero()) return new Ctor(x);
  5652. k = x.abs().cmp(1);
  5653. pr = Ctor.precision;
  5654. rm = Ctor.rounding;
  5655. if (k !== -1) {
  5656. // |x| is 1
  5657. if (k === 0) {
  5658. halfPi = getPi(Ctor, pr + 4, rm).times(0.5);
  5659. halfPi.s = x.s;
  5660. return halfPi;
  5661. }
  5662. // |x| > 1 or x is NaN
  5663. return new Ctor(NaN);
  5664. }
  5665. // TODO? Special case asin(1/2) = pi/6 and asin(-1/2) = -pi/6
  5666. Ctor.precision = pr + 6;
  5667. Ctor.rounding = 1;
  5668. x = x.div(new Ctor(1).minus(x.times(x)).sqrt().plus(1)).atan();
  5669. Ctor.precision = pr;
  5670. Ctor.rounding = rm;
  5671. return x.times(2);
  5672. };
  5673. /*
  5674. * Return a new Decimal whose value is the arctangent (inverse tangent) in radians of the value
  5675. * of this Decimal.
  5676. *
  5677. * Domain: [-Infinity, Infinity]
  5678. * Range: [-pi/2, pi/2]
  5679. *
  5680. * atan(x) = x - x^3/3 + x^5/5 - x^7/7 + ...
  5681. *
  5682. * atan(0) = 0
  5683. * atan(-0) = -0
  5684. * atan(1) = pi/4
  5685. * atan(-1) = -pi/4
  5686. * atan(Infinity) = pi/2
  5687. * atan(-Infinity) = -pi/2
  5688. * atan(NaN) = NaN
  5689. *
  5690. */
  5691. P.inverseTangent = P.atan = function () {
  5692. var i,j,k,n,px,t,r,wpr,x2,
  5693. x = this,
  5694. Ctor = x.constructor,
  5695. pr = Ctor.precision,
  5696. rm = Ctor.rounding;
  5697. if (!x.isFinite()) {
  5698. if (!x.s) return new Ctor(NaN);
  5699. if (pr + 4 <= PI_PRECISION) {
  5700. r = getPi(Ctor, pr + 4, rm).times(0.5);
  5701. r.s = x.s;
  5702. return r;
  5703. }
  5704. } else if (x.isZero()) {
  5705. return new Ctor(x);
  5706. } else if (x.abs().eq(1) && pr + 4 <= PI_PRECISION) {
  5707. r = getPi(Ctor, pr + 4, rm).times(0.25);
  5708. r.s = x.s;
  5709. return r;
  5710. }
  5711. Ctor.precision = wpr = pr + 10;
  5712. Ctor.rounding = 1;
  5713. // TODO? if (x >= 1 && pr <= PI_PRECISION) atan(x) = halfPi * x.s - atan(1 / x);
  5714. // Argument reduction
  5715. // Ensure |x| < 0.42
  5716. // atan(x) = 2 * atan(x / (1 + sqrt(1 + x^2)))
  5717. k = Math.min(28, wpr / LOG_BASE + 2 | 0);
  5718. for (i = k; i; --i) {x = x.div(x.times(x).plus(1).sqrt().plus(1));}
  5719. external = false;
  5720. j = Math.ceil(wpr / LOG_BASE);
  5721. n = 1;
  5722. x2 = x.times(x);
  5723. r = new Ctor(x);
  5724. px = x;
  5725. // atan(x) = x - x^3/3 + x^5/5 - x^7/7 + ...
  5726. for (; i !== -1;) {
  5727. px = px.times(x2);
  5728. t = r.minus(px.div(n += 2));
  5729. px = px.times(x2);
  5730. r = t.plus(px.div(n += 2));
  5731. if (r.d[j] !== void 0) for (i = j; r.d[i] === t.d[i] && i--;) {;}
  5732. }
  5733. if (k) r = r.times(2 << k - 1);
  5734. external = true;
  5735. return finalise(r, Ctor.precision = pr, Ctor.rounding = rm, true);
  5736. };
  5737. /*
  5738. * Return true if the value of this Decimal is a finite number, otherwise return false.
  5739. *
  5740. */
  5741. P.isFinite = function () {
  5742. return !!this.d;
  5743. };
  5744. /*
  5745. * Return true if the value of this Decimal is an integer, otherwise return false.
  5746. *
  5747. */
  5748. P.isInteger = P.isInt = function () {
  5749. return !!this.d && mathfloor(this.e / LOG_BASE) > this.d.length - 2;
  5750. };
  5751. /*
  5752. * Return true if the value of this Decimal is NaN, otherwise return false.
  5753. *
  5754. */
  5755. P.isNaN = function () {
  5756. return !this.s;
  5757. };
  5758. /*
  5759. * Return true if the value of this Decimal is negative, otherwise return false.
  5760. *
  5761. */
  5762. P.isNegative = P.isNeg = function () {
  5763. return this.s < 0;
  5764. };
  5765. /*
  5766. * Return true if the value of this Decimal is positive, otherwise return false.
  5767. *
  5768. */
  5769. P.isPositive = P.isPos = function () {
  5770. return this.s > 0;
  5771. };
  5772. /*
  5773. * Return true if the value of this Decimal is 0 or -0, otherwise return false.
  5774. *
  5775. */
  5776. P.isZero = function () {
  5777. return !!this.d && this.d[0] === 0;
  5778. };
  5779. /*
  5780. * Return true if the value of this Decimal is less than `y`, otherwise return false.
  5781. *
  5782. */
  5783. P.lessThan = P.lt = function (y) {
  5784. return this.cmp(y) < 0;
  5785. };
  5786. /*
  5787. * Return true if the value of this Decimal is less than or equal to `y`, otherwise return false.
  5788. *
  5789. */
  5790. P.lessThanOrEqualTo = P.lte = function (y) {
  5791. return this.cmp(y) < 1;
  5792. };
  5793. /*
  5794. * Return the logarithm of the value of this Decimal to the specified base, rounded to `precision`
  5795. * significant digits using rounding mode `rounding`.
  5796. *
  5797. * If no base is specified, return log[10](arg).
  5798. *
  5799. * log[base](arg) = ln(arg) / ln(base)
  5800. *
  5801. * The result will always be correctly rounded if the base of the log is 10, and 'almost always'
  5802. * otherwise:
  5803. *
  5804. * Depending on the rounding mode, the result may be incorrectly rounded if the first fifteen
  5805. * rounding digits are [49]99999999999999 or [50]00000000000000. In that case, the maximum error
  5806. * between the result and the correctly rounded result will be one ulp (unit in the last place).
  5807. *
  5808. * log[-b](a) = NaN
  5809. * log[0](a) = NaN
  5810. * log[1](a) = NaN
  5811. * log[NaN](a) = NaN
  5812. * log[Infinity](a) = NaN
  5813. * log[b](0) = -Infinity
  5814. * log[b](-0) = -Infinity
  5815. * log[b](-a) = NaN
  5816. * log[b](1) = 0
  5817. * log[b](Infinity) = Infinity
  5818. * log[b](NaN) = NaN
  5819. *
  5820. * [base] {number|string|Decimal} The base of the logarithm.
  5821. *
  5822. */
  5823. P.logarithm = P.log = function (base) {
  5824. var isBase10,d,denominator,k,inf,num,sd,r,
  5825. arg = this,
  5826. Ctor = arg.constructor,
  5827. pr = Ctor.precision,
  5828. rm = Ctor.rounding,
  5829. guard = 5;
  5830. // Default base is 10.
  5831. if (base == null) {
  5832. base = new Ctor(10);
  5833. isBase10 = true;
  5834. } else {
  5835. base = new Ctor(base);
  5836. d = base.d;
  5837. // Return NaN if base is negative, or non-finite, or is 0 or 1.
  5838. if (base.s < 0 || !d || !d[0] || base.eq(1)) return new Ctor(NaN);
  5839. isBase10 = base.eq(10);
  5840. }
  5841. d = arg.d;
  5842. // Is arg negative, non-finite, 0 or 1?
  5843. if (arg.s < 0 || !d || !d[0] || arg.eq(1)) {
  5844. return new Ctor(d && !d[0] ? -1 / 0 : arg.s != 1 ? NaN : d ? 0 : 1 / 0);
  5845. }
  5846. // The result will have a non-terminating decimal expansion if base is 10 and arg is not an
  5847. // integer power of 10.
  5848. if (isBase10) {
  5849. if (d.length > 1) {
  5850. inf = true;
  5851. } else {
  5852. for (k = d[0]; k % 10 === 0;) {k /= 10;}
  5853. inf = k !== 1;
  5854. }
  5855. }
  5856. external = false;
  5857. sd = pr + guard;
  5858. num = naturalLogarithm(arg, sd);
  5859. denominator = isBase10 ? getLn10(Ctor, sd + 10) : naturalLogarithm(base, sd);
  5860. // The result will have 5 rounding digits.
  5861. r = divide(num, denominator, sd, 1);
  5862. // If at a rounding boundary, i.e. the result's rounding digits are [49]9999 or [50]0000,
  5863. // calculate 10 further digits.
  5864. //
  5865. // If the result is known to have an infinite decimal expansion, repeat this until it is clear
  5866. // that the result is above or below the boundary. Otherwise, if after calculating the 10
  5867. // further digits, the last 14 are nines, round up and assume the result is exact.
  5868. // Also assume the result is exact if the last 14 are zero.
  5869. //
  5870. // Example of a result that will be incorrectly rounded:
  5871. // log[1048576](4503599627370502) = 2.60000000000000009610279511444746...
  5872. // The above result correctly rounded using ROUND_CEIL to 1 decimal place should be 2.7, but it
  5873. // will be given as 2.6 as there are 15 zeros immediately after the requested decimal place, so
  5874. // the exact result would be assumed to be 2.6, which rounded using ROUND_CEIL to 1 decimal
  5875. // place is still 2.6.
  5876. if (checkRoundingDigits(r.d, k = pr, rm)) {
  5877. do {
  5878. sd += 10;
  5879. num = naturalLogarithm(arg, sd);
  5880. denominator = isBase10 ? getLn10(Ctor, sd + 10) : naturalLogarithm(base, sd);
  5881. r = divide(num, denominator, sd, 1);
  5882. if (!inf) {
  5883. // Check for 14 nines from the 2nd rounding digit, as the first may be 4.
  5884. if (+digitsToString(r.d).slice(k + 1, k + 15) + 1 == 1e14) {
  5885. r = finalise(r, pr + 1, 0);
  5886. }
  5887. break;
  5888. }
  5889. } while (checkRoundingDigits(r.d, k += 10, rm));
  5890. }
  5891. external = true;
  5892. return finalise(r, pr, rm);
  5893. };
  5894. /*
  5895. * Return a new Decimal whose value is the maximum of the arguments and the value of this Decimal.
  5896. *
  5897. * arguments {number|string|Decimal}
  5898. *
  5899. P.max = function () {
  5900. Array.prototype.push.call(arguments, this);
  5901. return maxOrMin(this.constructor, arguments, 'lt');
  5902. };
  5903. */
  5904. /*
  5905. * Return a new Decimal whose value is the minimum of the arguments and the value of this Decimal.
  5906. *
  5907. * arguments {number|string|Decimal}
  5908. *
  5909. P.min = function () {
  5910. Array.prototype.push.call(arguments, this);
  5911. return maxOrMin(this.constructor, arguments, 'gt');
  5912. };
  5913. */
  5914. /*
  5915. * n - 0 = n
  5916. * n - N = N
  5917. * n - I = -I
  5918. * 0 - n = -n
  5919. * 0 - 0 = 0
  5920. * 0 - N = N
  5921. * 0 - I = -I
  5922. * N - n = N
  5923. * N - 0 = N
  5924. * N - N = N
  5925. * N - I = N
  5926. * I - n = I
  5927. * I - 0 = I
  5928. * I - N = N
  5929. * I - I = N
  5930. *
  5931. * Return a new Decimal whose value is the value of this Decimal minus `y`, rounded to `precision`
  5932. * significant digits using rounding mode `rounding`.
  5933. *
  5934. */
  5935. P.minus = P.sub = function (y) {
  5936. var d,e,i,j,k,len,pr,rm,xd,xe,xLTy,yd,
  5937. x = this,
  5938. Ctor = x.constructor;
  5939. y = new Ctor(y);
  5940. // If either is not finite...
  5941. if (!x.d || !y.d) {
  5942. // Return NaN if either is NaN.
  5943. if (!x.s || !y.s) y = new Ctor(NaN);
  5944. // Return y negated if x is finite and y is ±Infinity.
  5945. else if (x.d) y.s = -y.s;
  5946. // Return x if y is finite and x is ±Infinity.
  5947. // Return x if both are ±Infinity with different signs.
  5948. // Return NaN if both are ±Infinity with the same sign.
  5949. else y = new Ctor(y.d || x.s !== y.s ? x : NaN);
  5950. return y;
  5951. }
  5952. // If signs differ...
  5953. if (x.s != y.s) {
  5954. y.s = -y.s;
  5955. return x.plus(y);
  5956. }
  5957. xd = x.d;
  5958. yd = y.d;
  5959. pr = Ctor.precision;
  5960. rm = Ctor.rounding;
  5961. // If either is zero...
  5962. if (!xd[0] || !yd[0]) {
  5963. // Return y negated if x is zero and y is non-zero.
  5964. if (yd[0]) y.s = -y.s;
  5965. // Return x if y is zero and x is non-zero.
  5966. else if (xd[0]) y = new Ctor(x);
  5967. // Return zero if both are zero.
  5968. // From IEEE 754 (2008) 6.3: 0 - 0 = -0 - -0 = -0 when rounding to -Infinity.
  5969. else return new Ctor(rm === 3 ? -0 : 0);
  5970. return external ? finalise(y, pr, rm) : y;
  5971. }
  5972. // x and y are finite, non-zero numbers with the same sign.
  5973. // Calculate base 1e7 exponents.
  5974. e = mathfloor(y.e / LOG_BASE);
  5975. xe = mathfloor(x.e / LOG_BASE);
  5976. xd = xd.slice();
  5977. k = xe - e;
  5978. // If base 1e7 exponents differ...
  5979. if (k) {
  5980. xLTy = k < 0;
  5981. if (xLTy) {
  5982. d = xd;
  5983. k = -k;
  5984. len = yd.length;
  5985. } else {
  5986. d = yd;
  5987. e = xe;
  5988. len = xd.length;
  5989. }
  5990. // Numbers with massively different exponents would result in a very high number of
  5991. // zeros needing to be prepended, but this can be avoided while still ensuring correct
  5992. // rounding by limiting the number of zeros to `Math.ceil(pr / LOG_BASE) + 2`.
  5993. i = Math.max(Math.ceil(pr / LOG_BASE), len) + 2;
  5994. if (k > i) {
  5995. k = i;
  5996. d.length = 1;
  5997. }
  5998. // Prepend zeros to equalise exponents.
  5999. d.reverse();
  6000. for (i = k; i--;) {d.push(0);}
  6001. d.reverse();
  6002. // Base 1e7 exponents equal.
  6003. } else {
  6004. // Check digits to determine which is the bigger number.
  6005. i = xd.length;
  6006. len = yd.length;
  6007. xLTy = i < len;
  6008. if (xLTy) len = i;
  6009. for (i = 0; i < len; i++) {
  6010. if (xd[i] != yd[i]) {
  6011. xLTy = xd[i] < yd[i];
  6012. break;
  6013. }
  6014. }
  6015. k = 0;
  6016. }
  6017. if (xLTy) {
  6018. d = xd;
  6019. xd = yd;
  6020. yd = d;
  6021. y.s = -y.s;
  6022. }
  6023. len = xd.length;
  6024. // Append zeros to `xd` if shorter.
  6025. // Don't add zeros to `yd` if shorter as subtraction only needs to start at `yd` length.
  6026. for (i = yd.length - len; i > 0; --i) {xd[len++] = 0;}
  6027. // Subtract yd from xd.
  6028. for (i = yd.length; i > k;) {
  6029. if (xd[--i] < yd[i]) {
  6030. for (j = i; j && xd[--j] === 0;) {xd[j] = BASE - 1;}
  6031. --xd[j];
  6032. xd[i] += BASE;
  6033. }
  6034. xd[i] -= yd[i];
  6035. }
  6036. // Remove trailing zeros.
  6037. for (; xd[--len] === 0;) {xd.pop();}
  6038. // Remove leading zeros and adjust exponent accordingly.
  6039. for (; xd[0] === 0; xd.shift()) {--e;}
  6040. // Zero?
  6041. if (!xd[0]) return new Ctor(rm === 3 ? -0 : 0);
  6042. y.d = xd;
  6043. y.e = getBase10Exponent(xd, e);
  6044. return external ? finalise(y, pr, rm) : y;
  6045. };
  6046. /*
  6047. * n % 0 = N
  6048. * n % N = N
  6049. * n % I = n
  6050. * 0 % n = 0
  6051. * -0 % n = -0
  6052. * 0 % 0 = N
  6053. * 0 % N = N
  6054. * 0 % I = 0
  6055. * N % n = N
  6056. * N % 0 = N
  6057. * N % N = N
  6058. * N % I = N
  6059. * I % n = N
  6060. * I % 0 = N
  6061. * I % N = N
  6062. * I % I = N
  6063. *
  6064. * Return a new Decimal whose value is the value of this Decimal modulo `y`, rounded to
  6065. * `precision` significant digits using rounding mode `rounding`.
  6066. *
  6067. * The result depends on the modulo mode.
  6068. *
  6069. */
  6070. P.modulo = P.mod = function (y) {
  6071. var q,
  6072. x = this,
  6073. Ctor = x.constructor;
  6074. y = new Ctor(y);
  6075. // Return NaN if x is ±Infinity or NaN, or y is NaN or ±0.
  6076. if (!x.d || !y.s || y.d && !y.d[0]) return new Ctor(NaN);
  6077. // Return x if y is ±Infinity or x is ±0.
  6078. if (!y.d || x.d && !x.d[0]) {
  6079. return finalise(new Ctor(x), Ctor.precision, Ctor.rounding);
  6080. }
  6081. // Prevent rounding of intermediate calculations.
  6082. external = false;
  6083. if (Ctor.modulo == 9) {
  6084. // Euclidian division: q = sign(y) * floor(x / abs(y))
  6085. // result = x - q * y where 0 <= result < abs(y)
  6086. q = divide(x, y.abs(), 0, 3, 1);
  6087. q.s *= y.s;
  6088. } else {
  6089. q = divide(x, y, 0, Ctor.modulo, 1);
  6090. }
  6091. q = q.times(y);
  6092. external = true;
  6093. return x.minus(q);
  6094. };
  6095. /*
  6096. * Return a new Decimal whose value is the natural exponential of the value of this Decimal,
  6097. * i.e. the base e raised to the power the value of this Decimal, rounded to `precision`
  6098. * significant digits using rounding mode `rounding`.
  6099. *
  6100. */
  6101. P.naturalExponential = P.exp = function () {
  6102. return naturalExponential(this);
  6103. };
  6104. /*
  6105. * Return a new Decimal whose value is the natural logarithm of the value of this Decimal,
  6106. * rounded to `precision` significant digits using rounding mode `rounding`.
  6107. *
  6108. */
  6109. P.naturalLogarithm = P.ln = function () {
  6110. return naturalLogarithm(this);
  6111. };
  6112. /*
  6113. * Return a new Decimal whose value is the value of this Decimal negated, i.e. as if multiplied by
  6114. * -1.
  6115. *
  6116. */
  6117. P.negated = P.neg = function () {
  6118. var x = new this.constructor(this);
  6119. x.s = -x.s;
  6120. return finalise(x);
  6121. };
  6122. /*
  6123. * n + 0 = n
  6124. * n + N = N
  6125. * n + I = I
  6126. * 0 + n = n
  6127. * 0 + 0 = 0
  6128. * 0 + N = N
  6129. * 0 + I = I
  6130. * N + n = N
  6131. * N + 0 = N
  6132. * N + N = N
  6133. * N + I = N
  6134. * I + n = I
  6135. * I + 0 = I
  6136. * I + N = N
  6137. * I + I = I
  6138. *
  6139. * Return a new Decimal whose value is the value of this Decimal plus `y`, rounded to `precision`
  6140. * significant digits using rounding mode `rounding`.
  6141. *
  6142. */
  6143. P.plus = P.add = function (y) {
  6144. var carry,d,e,i,k,len,pr,rm,xd,yd,
  6145. x = this,
  6146. Ctor = x.constructor;
  6147. y = new Ctor(y);
  6148. // If either is not finite...
  6149. if (!x.d || !y.d) {
  6150. // Return NaN if either is NaN.
  6151. if (!x.s || !y.s) y = new Ctor(NaN);
  6152. // Return x if y is finite and x is ±Infinity.
  6153. // Return x if both are ±Infinity with the same sign.
  6154. // Return NaN if both are ±Infinity with different signs.
  6155. // Return y if x is finite and y is ±Infinity.
  6156. else if (!x.d) y = new Ctor(y.d || x.s === y.s ? x : NaN);
  6157. return y;
  6158. }
  6159. // If signs differ...
  6160. if (x.s != y.s) {
  6161. y.s = -y.s;
  6162. return x.minus(y);
  6163. }
  6164. xd = x.d;
  6165. yd = y.d;
  6166. pr = Ctor.precision;
  6167. rm = Ctor.rounding;
  6168. // If either is zero...
  6169. if (!xd[0] || !yd[0]) {
  6170. // Return x if y is zero.
  6171. // Return y if y is non-zero.
  6172. if (!yd[0]) y = new Ctor(x);
  6173. return external ? finalise(y, pr, rm) : y;
  6174. }
  6175. // x and y are finite, non-zero numbers with the same sign.
  6176. // Calculate base 1e7 exponents.
  6177. k = mathfloor(x.e / LOG_BASE);
  6178. e = mathfloor(y.e / LOG_BASE);
  6179. xd = xd.slice();
  6180. i = k - e;
  6181. // If base 1e7 exponents differ...
  6182. if (i) {
  6183. if (i < 0) {
  6184. d = xd;
  6185. i = -i;
  6186. len = yd.length;
  6187. } else {
  6188. d = yd;
  6189. e = k;
  6190. len = xd.length;
  6191. }
  6192. // Limit number of zeros prepended to max(ceil(pr / LOG_BASE), len) + 1.
  6193. k = Math.ceil(pr / LOG_BASE);
  6194. len = k > len ? k + 1 : len + 1;
  6195. if (i > len) {
  6196. i = len;
  6197. d.length = 1;
  6198. }
  6199. // Prepend zeros to equalise exponents. Note: Faster to use reverse then do unshifts.
  6200. d.reverse();
  6201. for (; i--;) {d.push(0);}
  6202. d.reverse();
  6203. }
  6204. len = xd.length;
  6205. i = yd.length;
  6206. // If yd is longer than xd, swap xd and yd so xd points to the longer array.
  6207. if (len - i < 0) {
  6208. i = len;
  6209. d = yd;
  6210. yd = xd;
  6211. xd = d;
  6212. }
  6213. // Only start adding at yd.length - 1 as the further digits of xd can be left as they are.
  6214. for (carry = 0; i;) {
  6215. carry = (xd[--i] = xd[i] + yd[i] + carry) / BASE | 0;
  6216. xd[i] %= BASE;
  6217. }
  6218. if (carry) {
  6219. xd.unshift(carry);
  6220. ++e;
  6221. }
  6222. // Remove trailing zeros.
  6223. // No need to check for zero, as +x + +y != 0 && -x + -y != 0
  6224. for (len = xd.length; xd[--len] == 0;) {xd.pop();}
  6225. y.d = xd;
  6226. y.e = getBase10Exponent(xd, e);
  6227. return external ? finalise(y, pr, rm) : y;
  6228. };
  6229. /*
  6230. * Return the number of significant digits of the value of this Decimal.
  6231. *
  6232. * [z] {boolean|number} Whether to count integer-part trailing zeros: true, false, 1 or 0.
  6233. *
  6234. */
  6235. P.precision = P.sd = function (z) {
  6236. var k,
  6237. x = this;
  6238. if (z !== void 0 && z !== !!z && z !== 1 && z !== 0) throw Error(invalidArgument + z);
  6239. if (x.d) {
  6240. k = getPrecision(x.d);
  6241. if (z && x.e + 1 > k) k = x.e + 1;
  6242. } else {
  6243. k = NaN;
  6244. }
  6245. return k;
  6246. };
  6247. /*
  6248. * Return a new Decimal whose value is the value of this Decimal rounded to a whole number using
  6249. * rounding mode `rounding`.
  6250. *
  6251. */
  6252. P.round = function () {
  6253. var x = this,
  6254. Ctor = x.constructor;
  6255. return finalise(new Ctor(x), x.e + 1, Ctor.rounding);
  6256. };
  6257. /*
  6258. * Return a new Decimal whose value is the sine of the value in radians of this Decimal.
  6259. *
  6260. * Domain: [-Infinity, Infinity]
  6261. * Range: [-1, 1]
  6262. *
  6263. * sin(x) = x - x^3/3! + x^5/5! - ...
  6264. *
  6265. * sin(0) = 0
  6266. * sin(-0) = -0
  6267. * sin(Infinity) = NaN
  6268. * sin(-Infinity) = NaN
  6269. * sin(NaN) = NaN
  6270. *
  6271. */
  6272. P.sine = P.sin = function () {
  6273. var pr,rm,
  6274. x = this,
  6275. Ctor = x.constructor;
  6276. if (!x.isFinite()) return new Ctor(NaN);
  6277. if (x.isZero()) return new Ctor(x);
  6278. pr = Ctor.precision;
  6279. rm = Ctor.rounding;
  6280. Ctor.precision = pr + Math.max(x.e, x.sd()) + LOG_BASE;
  6281. Ctor.rounding = 1;
  6282. x = sine(Ctor, toLessThanHalfPi(Ctor, x));
  6283. Ctor.precision = pr;
  6284. Ctor.rounding = rm;
  6285. return finalise(quadrant > 2 ? x.neg() : x, pr, rm, true);
  6286. };
  6287. /*
  6288. * Return a new Decimal whose value is the square root of this Decimal, rounded to `precision`
  6289. * significant digits using rounding mode `rounding`.
  6290. *
  6291. * sqrt(-n) = N
  6292. * sqrt(N) = N
  6293. * sqrt(-I) = N
  6294. * sqrt(I) = I
  6295. * sqrt(0) = 0
  6296. * sqrt(-0) = -0
  6297. *
  6298. */
  6299. P.squareRoot = P.sqrt = function () {
  6300. var m,n,sd,r,rep,t,
  6301. x = this,
  6302. d = x.d,
  6303. e = x.e,
  6304. s = x.s,
  6305. Ctor = x.constructor;
  6306. // Negative/NaN/Infinity/zero?
  6307. if (s !== 1 || !d || !d[0]) {
  6308. return new Ctor(!s || s < 0 && (!d || d[0]) ? NaN : d ? x : 1 / 0);
  6309. }
  6310. external = false;
  6311. // Initial estimate.
  6312. s = Math.sqrt(+x);
  6313. // Math.sqrt underflow/overflow?
  6314. // Pass x to Math.sqrt as integer, then adjust the exponent of the result.
  6315. if (s == 0 || s == 1 / 0) {
  6316. n = digitsToString(d);
  6317. if ((n.length + e) % 2 == 0) n += '0';
  6318. s = Math.sqrt(n);
  6319. e = mathfloor((e + 1) / 2) - (e < 0 || e % 2);
  6320. if (s == 1 / 0) {
  6321. n = '5e' + e;
  6322. } else {
  6323. n = s.toExponential();
  6324. n = n.slice(0, n.indexOf('e') + 1) + e;
  6325. }
  6326. r = new Ctor(n);
  6327. } else {
  6328. r = new Ctor(s.toString());
  6329. }
  6330. sd = (e = Ctor.precision) + 3;
  6331. // Newton-Raphson iteration.
  6332. for (;;) {
  6333. t = r;
  6334. r = t.plus(divide(x, t, sd + 2, 1)).times(0.5);
  6335. // TODO? Replace with for-loop and checkRoundingDigits.
  6336. if (digitsToString(t.d).slice(0, sd) === (n = digitsToString(r.d)).slice(0, sd)) {
  6337. n = n.slice(sd - 3, sd + 1);
  6338. // The 4th rounding digit may be in error by -1 so if the 4 rounding digits are 9999 or
  6339. // 4999, i.e. approaching a rounding boundary, continue the iteration.
  6340. if (n == '9999' || !rep && n == '4999') {
  6341. // On the first iteration only, check to see if rounding up gives the exact result as the
  6342. // nines may infinitely repeat.
  6343. if (!rep) {
  6344. finalise(t, e + 1, 0);
  6345. if (t.times(t).eq(x)) {
  6346. r = t;
  6347. break;
  6348. }
  6349. }
  6350. sd += 4;
  6351. rep = 1;
  6352. } else {
  6353. // If the rounding digits are null, 0{0,4} or 50{0,3}, check for an exact result.
  6354. // If not, then there are further digits and m will be truthy.
  6355. if (!+n || !+n.slice(1) && n.charAt(0) == '5') {
  6356. // Truncate to the first rounding digit.
  6357. finalise(r, e + 1, 1);
  6358. m = !r.times(r).eq(x);
  6359. }
  6360. break;
  6361. }
  6362. }
  6363. }
  6364. external = true;
  6365. return finalise(r, e, Ctor.rounding, m);
  6366. };
  6367. /*
  6368. * Return a new Decimal whose value is the tangent of the value in radians of this Decimal.
  6369. *
  6370. * Domain: [-Infinity, Infinity]
  6371. * Range: [-Infinity, Infinity]
  6372. *
  6373. * tan(0) = 0
  6374. * tan(-0) = -0
  6375. * tan(Infinity) = NaN
  6376. * tan(-Infinity) = NaN
  6377. * tan(NaN) = NaN
  6378. *
  6379. */
  6380. P.tangent = P.tan = function () {
  6381. var pr,rm,
  6382. x = this,
  6383. Ctor = x.constructor;
  6384. if (!x.isFinite()) return new Ctor(NaN);
  6385. if (x.isZero()) return new Ctor(x);
  6386. pr = Ctor.precision;
  6387. rm = Ctor.rounding;
  6388. Ctor.precision = pr + 10;
  6389. Ctor.rounding = 1;
  6390. x = x.sin();
  6391. x.s = 1;
  6392. x = divide(x, new Ctor(1).minus(x.times(x)).sqrt(), pr + 10, 0);
  6393. Ctor.precision = pr;
  6394. Ctor.rounding = rm;
  6395. return finalise(quadrant == 2 || quadrant == 4 ? x.neg() : x, pr, rm, true);
  6396. };
  6397. /*
  6398. * n * 0 = 0
  6399. * n * N = N
  6400. * n * I = I
  6401. * 0 * n = 0
  6402. * 0 * 0 = 0
  6403. * 0 * N = N
  6404. * 0 * I = N
  6405. * N * n = N
  6406. * N * 0 = N
  6407. * N * N = N
  6408. * N * I = N
  6409. * I * n = I
  6410. * I * 0 = N
  6411. * I * N = N
  6412. * I * I = I
  6413. *
  6414. * Return a new Decimal whose value is this Decimal times `y`, rounded to `precision` significant
  6415. * digits using rounding mode `rounding`.
  6416. *
  6417. */
  6418. P.times = P.mul = function (y) {
  6419. var carry,e,i,k,r,rL,t,xdL,ydL,
  6420. x = this,
  6421. Ctor = x.constructor,
  6422. xd = x.d,
  6423. yd = (y = new Ctor(y)).d;
  6424. y.s *= x.s;
  6425. // If either is NaN, ±Infinity or ±0...
  6426. if (!xd || !xd[0] || !yd || !yd[0]) {
  6427. return new Ctor(!y.s || xd && !xd[0] && !yd || yd && !yd[0] && !xd
  6428. // Return NaN if either is NaN.
  6429. // Return NaN if x is ±0 and y is ±Infinity, or y is ±0 and x is ±Infinity.
  6430. ? NaN
  6431. // Return ±Infinity if either is ±Infinity.
  6432. // Return ±0 if either is ±0.
  6433. : !xd || !yd ? y.s / 0 : y.s * 0);
  6434. }
  6435. e = mathfloor(x.e / LOG_BASE) + mathfloor(y.e / LOG_BASE);
  6436. xdL = xd.length;
  6437. ydL = yd.length;
  6438. // Ensure xd points to the longer array.
  6439. if (xdL < ydL) {
  6440. r = xd;
  6441. xd = yd;
  6442. yd = r;
  6443. rL = xdL;
  6444. xdL = ydL;
  6445. ydL = rL;
  6446. }
  6447. // Initialise the result array with zeros.
  6448. r = [];
  6449. rL = xdL + ydL;
  6450. for (i = rL; i--;) {r.push(0);}
  6451. // Multiply!
  6452. for (i = ydL; --i >= 0;) {
  6453. carry = 0;
  6454. for (k = xdL + i; k > i;) {
  6455. t = r[k] + yd[i] * xd[k - i - 1] + carry;
  6456. r[k--] = t % BASE | 0;
  6457. carry = t / BASE | 0;
  6458. }
  6459. r[k] = (r[k] + carry) % BASE | 0;
  6460. }
  6461. // Remove trailing zeros.
  6462. for (; !r[--rL];) {r.pop();}
  6463. if (carry) ++e;else
  6464. r.shift();
  6465. y.d = r;
  6466. y.e = getBase10Exponent(r, e);
  6467. return external ? finalise(y, Ctor.precision, Ctor.rounding) : y;
  6468. };
  6469. /*
  6470. * Return a string representing the value of this Decimal in base 2, round to `sd` significant
  6471. * digits using rounding mode `rm`.
  6472. *
  6473. * If the optional `sd` argument is present then return binary exponential notation.
  6474. *
  6475. * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.
  6476. * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
  6477. *
  6478. */
  6479. P.toBinary = function (sd, rm) {
  6480. return toStringBinary(this, 2, sd, rm);
  6481. };
  6482. /*
  6483. * Return a new Decimal whose value is the value of this Decimal rounded to a maximum of `dp`
  6484. * decimal places using rounding mode `rm` or `rounding` if `rm` is omitted.
  6485. *
  6486. * If `dp` is omitted, return a new Decimal whose value is the value of this Decimal.
  6487. *
  6488. * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.
  6489. * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
  6490. *
  6491. */
  6492. P.toDecimalPlaces = P.toDP = function (dp, rm) {
  6493. var x = this,
  6494. Ctor = x.constructor;
  6495. x = new Ctor(x);
  6496. if (dp === void 0) return x;
  6497. checkInt32(dp, 0, MAX_DIGITS);
  6498. if (rm === void 0) rm = Ctor.rounding;else
  6499. checkInt32(rm, 0, 8);
  6500. return finalise(x, dp + x.e + 1, rm);
  6501. };
  6502. /*
  6503. * Return a string representing the value of this Decimal in exponential notation rounded to
  6504. * `dp` fixed decimal places using rounding mode `rounding`.
  6505. *
  6506. * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.
  6507. * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
  6508. *
  6509. */
  6510. P.toExponential = function (dp, rm) {
  6511. var str,
  6512. x = this,
  6513. Ctor = x.constructor;
  6514. if (dp === void 0) {
  6515. str = finiteToString(x, true);
  6516. } else {
  6517. checkInt32(dp, 0, MAX_DIGITS);
  6518. if (rm === void 0) rm = Ctor.rounding;else
  6519. checkInt32(rm, 0, 8);
  6520. x = finalise(new Ctor(x), dp + 1, rm);
  6521. str = finiteToString(x, true, dp + 1);
  6522. }
  6523. return x.isNeg() && !x.isZero() ? '-' + str : str;
  6524. };
  6525. /*
  6526. * Return a string representing the value of this Decimal in normal (fixed-point) notation to
  6527. * `dp` fixed decimal places and rounded using rounding mode `rm` or `rounding` if `rm` is
  6528. * omitted.
  6529. *
  6530. * As with JavaScript numbers, (-0).toFixed(0) is '0', but e.g. (-0.00001).toFixed(0) is '-0'.
  6531. *
  6532. * [dp] {number} Decimal places. Integer, 0 to MAX_DIGITS inclusive.
  6533. * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
  6534. *
  6535. * (-0).toFixed(0) is '0', but (-0.1).toFixed(0) is '-0'.
  6536. * (-0).toFixed(1) is '0.0', but (-0.01).toFixed(1) is '-0.0'.
  6537. * (-0).toFixed(3) is '0.000'.
  6538. * (-0.5).toFixed(0) is '-0'.
  6539. *
  6540. */
  6541. P.toFixed = function (dp, rm) {
  6542. var str,y,
  6543. x = this,
  6544. Ctor = x.constructor;
  6545. if (dp === void 0) {
  6546. str = finiteToString(x);
  6547. } else {
  6548. checkInt32(dp, 0, MAX_DIGITS);
  6549. if (rm === void 0) rm = Ctor.rounding;else
  6550. checkInt32(rm, 0, 8);
  6551. y = finalise(new Ctor(x), dp + x.e + 1, rm);
  6552. str = finiteToString(y, false, dp + y.e + 1);
  6553. }
  6554. // To determine whether to add the minus sign look at the value before it was rounded,
  6555. // i.e. look at `x` rather than `y`.
  6556. return x.isNeg() && !x.isZero() ? '-' + str : str;
  6557. };
  6558. /*
  6559. * Return an array representing the value of this Decimal as a simple fraction with an integer
  6560. * numerator and an integer denominator.
  6561. *
  6562. * The denominator will be a positive non-zero value less than or equal to the specified maximum
  6563. * denominator. If a maximum denominator is not specified, the denominator will be the lowest
  6564. * value necessary to represent the number exactly.
  6565. *
  6566. * [maxD] {number|string|Decimal} Maximum denominator. Integer >= 1 and < Infinity.
  6567. *
  6568. */
  6569. P.toFraction = function (maxD) {
  6570. var d,d0,d1,d2,e,k,n,n0,n1,pr,q,r,
  6571. x = this,
  6572. xd = x.d,
  6573. Ctor = x.constructor;
  6574. if (!xd) return new Ctor(x);
  6575. n1 = d0 = new Ctor(1);
  6576. d1 = n0 = new Ctor(0);
  6577. d = new Ctor(d1);
  6578. e = d.e = getPrecision(xd) - x.e - 1;
  6579. k = e % LOG_BASE;
  6580. d.d[0] = mathpow(10, k < 0 ? LOG_BASE + k : k);
  6581. if (maxD == null) {
  6582. // d is 10**e, the minimum max-denominator needed.
  6583. maxD = e > 0 ? d : n1;
  6584. } else {
  6585. n = new Ctor(maxD);
  6586. if (!n.isInt() || n.lt(n1)) throw Error(invalidArgument + n);
  6587. maxD = n.gt(d) ? e > 0 ? d : n1 : n;
  6588. }
  6589. external = false;
  6590. n = new Ctor(digitsToString(xd));
  6591. pr = Ctor.precision;
  6592. Ctor.precision = e = xd.length * LOG_BASE * 2;
  6593. for (;;) {
  6594. q = divide(n, d, 0, 1, 1);
  6595. d2 = d0.plus(q.times(d1));
  6596. if (d2.cmp(maxD) == 1) break;
  6597. d0 = d1;
  6598. d1 = d2;
  6599. d2 = n1;
  6600. n1 = n0.plus(q.times(d2));
  6601. n0 = d2;
  6602. d2 = d;
  6603. d = n.minus(q.times(d2));
  6604. n = d2;
  6605. }
  6606. d2 = divide(maxD.minus(d0), d1, 0, 1, 1);
  6607. n0 = n0.plus(d2.times(n1));
  6608. d0 = d0.plus(d2.times(d1));
  6609. n0.s = n1.s = x.s;
  6610. // Determine which fraction is closer to x, n0/d0 or n1/d1?
  6611. r = divide(n1, d1, e, 1).minus(x).abs().cmp(divide(n0, d0, e, 1).minus(x).abs()) < 1 ?
  6612. [n1, d1] : [n0, d0];
  6613. Ctor.precision = pr;
  6614. external = true;
  6615. return r;
  6616. };
  6617. /*
  6618. * Return a string representing the value of this Decimal in base 16, round to `sd` significant
  6619. * digits using rounding mode `rm`.
  6620. *
  6621. * If the optional `sd` argument is present then return binary exponential notation.
  6622. *
  6623. * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.
  6624. * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
  6625. *
  6626. */
  6627. P.toHexadecimal = P.toHex = function (sd, rm) {
  6628. return toStringBinary(this, 16, sd, rm);
  6629. };
  6630. /*
  6631. * Returns a new Decimal whose value is the nearest multiple of `y` in the direction of rounding
  6632. * mode `rm`, or `Decimal.rounding` if `rm` is omitted, to the value of this Decimal.
  6633. *
  6634. * The return value will always have the same sign as this Decimal, unless either this Decimal
  6635. * or `y` is NaN, in which case the return value will be also be NaN.
  6636. *
  6637. * The return value is not affected by the value of `precision`.
  6638. *
  6639. * y {number|string|Decimal} The magnitude to round to a multiple of.
  6640. * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
  6641. *
  6642. * 'toNearest() rounding mode not an integer: {rm}'
  6643. * 'toNearest() rounding mode out of range: {rm}'
  6644. *
  6645. */
  6646. P.toNearest = function (y, rm) {
  6647. var x = this,
  6648. Ctor = x.constructor;
  6649. x = new Ctor(x);
  6650. if (y == null) {
  6651. // If x is not finite, return x.
  6652. if (!x.d) return x;
  6653. y = new Ctor(1);
  6654. rm = Ctor.rounding;
  6655. } else {
  6656. y = new Ctor(y);
  6657. if (rm === void 0) {
  6658. rm = Ctor.rounding;
  6659. } else {
  6660. checkInt32(rm, 0, 8);
  6661. }
  6662. // If x is not finite, return x if y is not NaN, else NaN.
  6663. if (!x.d) return y.s ? x : y;
  6664. // If y is not finite, return Infinity with the sign of x if y is Infinity, else NaN.
  6665. if (!y.d) {
  6666. if (y.s) y.s = x.s;
  6667. return y;
  6668. }
  6669. }
  6670. // If y is not zero, calculate the nearest multiple of y to x.
  6671. if (y.d[0]) {
  6672. external = false;
  6673. x = divide(x, y, 0, rm, 1).times(y);
  6674. external = true;
  6675. finalise(x);
  6676. // If y is zero, return zero with the sign of x.
  6677. } else {
  6678. y.s = x.s;
  6679. x = y;
  6680. }
  6681. return x;
  6682. };
  6683. /*
  6684. * Return the value of this Decimal converted to a number primitive.
  6685. * Zero keeps its sign.
  6686. *
  6687. */
  6688. P.toNumber = function () {
  6689. return +this;
  6690. };
  6691. /*
  6692. * Return a string representing the value of this Decimal in base 8, round to `sd` significant
  6693. * digits using rounding mode `rm`.
  6694. *
  6695. * If the optional `sd` argument is present then return binary exponential notation.
  6696. *
  6697. * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.
  6698. * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
  6699. *
  6700. */
  6701. P.toOctal = function (sd, rm) {
  6702. return toStringBinary(this, 8, sd, rm);
  6703. };
  6704. /*
  6705. * Return a new Decimal whose value is the value of this Decimal raised to the power `y`, rounded
  6706. * to `precision` significant digits using rounding mode `rounding`.
  6707. *
  6708. * ECMAScript compliant.
  6709. *
  6710. * pow(x, NaN) = NaN
  6711. * pow(x, ±0) = 1
  6712. * pow(NaN, non-zero) = NaN
  6713. * pow(abs(x) > 1, +Infinity) = +Infinity
  6714. * pow(abs(x) > 1, -Infinity) = +0
  6715. * pow(abs(x) == 1, ±Infinity) = NaN
  6716. * pow(abs(x) < 1, +Infinity) = +0
  6717. * pow(abs(x) < 1, -Infinity) = +Infinity
  6718. * pow(+Infinity, y > 0) = +Infinity
  6719. * pow(+Infinity, y < 0) = +0
  6720. * pow(-Infinity, odd integer > 0) = -Infinity
  6721. * pow(-Infinity, even integer > 0) = +Infinity
  6722. * pow(-Infinity, odd integer < 0) = -0
  6723. * pow(-Infinity, even integer < 0) = +0
  6724. * pow(+0, y > 0) = +0
  6725. * pow(+0, y < 0) = +Infinity
  6726. * pow(-0, odd integer > 0) = -0
  6727. * pow(-0, even integer > 0) = +0
  6728. * pow(-0, odd integer < 0) = -Infinity
  6729. * pow(-0, even integer < 0) = +Infinity
  6730. * pow(finite x < 0, finite non-integer) = NaN
  6731. *
  6732. * For non-integer or very large exponents pow(x, y) is calculated using
  6733. *
  6734. * x^y = exp(y*ln(x))
  6735. *
  6736. * Assuming the first 15 rounding digits are each equally likely to be any digit 0-9, the
  6737. * probability of an incorrectly rounded result
  6738. * P([49]9{14} | [50]0{14}) = 2 * 0.2 * 10^-14 = 4e-15 = 1/2.5e+14
  6739. * i.e. 1 in 250,000,000,000,000
  6740. *
  6741. * If a result is incorrectly rounded the maximum error will be 1 ulp (unit in last place).
  6742. *
  6743. * y {number|string|Decimal} The power to which to raise this Decimal.
  6744. *
  6745. */
  6746. P.toPower = P.pow = function (y) {
  6747. var e,k,pr,r,rm,s,
  6748. x = this,
  6749. Ctor = x.constructor,
  6750. yn = +(y = new Ctor(y));
  6751. // Either ±Infinity, NaN or ±0?
  6752. if (!x.d || !y.d || !x.d[0] || !y.d[0]) return new Ctor(mathpow(+x, yn));
  6753. x = new Ctor(x);
  6754. if (x.eq(1)) return x;
  6755. pr = Ctor.precision;
  6756. rm = Ctor.rounding;
  6757. if (y.eq(1)) return finalise(x, pr, rm);
  6758. // y exponent
  6759. e = mathfloor(y.e / LOG_BASE);
  6760. // If y is a small integer use the 'exponentiation by squaring' algorithm.
  6761. if (e >= y.d.length - 1 && (k = yn < 0 ? -yn : yn) <= MAX_SAFE_INTEGER) {
  6762. r = intPow(Ctor, x, k, pr);
  6763. return y.s < 0 ? new Ctor(1).div(r) : finalise(r, pr, rm);
  6764. }
  6765. s = x.s;
  6766. // if x is negative
  6767. if (s < 0) {
  6768. // if y is not an integer
  6769. if (e < y.d.length - 1) return new Ctor(NaN);
  6770. // Result is positive if x is negative and the last digit of integer y is even.
  6771. if ((y.d[e] & 1) == 0) s = 1;
  6772. // if x.eq(-1)
  6773. if (x.e == 0 && x.d[0] == 1 && x.d.length == 1) {
  6774. x.s = s;
  6775. return x;
  6776. }
  6777. }
  6778. // Estimate result exponent.
  6779. // x^y = 10^e, where e = y * log10(x)
  6780. // log10(x) = log10(x_significand) + x_exponent
  6781. // log10(x_significand) = ln(x_significand) / ln(10)
  6782. k = mathpow(+x, yn);
  6783. e = k == 0 || !isFinite(k) ?
  6784. mathfloor(yn * (Math.log('0.' + digitsToString(x.d)) / Math.LN10 + x.e + 1)) :
  6785. new Ctor(k + '').e;
  6786. // Exponent estimate may be incorrect e.g. x: 0.999999999999999999, y: 2.29, e: 0, r.e: -1.
  6787. // Overflow/underflow?
  6788. if (e > Ctor.maxE + 1 || e < Ctor.minE - 1) return new Ctor(e > 0 ? s / 0 : 0);
  6789. external = false;
  6790. Ctor.rounding = x.s = 1;
  6791. // Estimate the extra guard digits needed to ensure five correct rounding digits from
  6792. // naturalLogarithm(x). Example of failure without these extra digits (precision: 10):
  6793. // new Decimal(2.32456).pow('2087987436534566.46411')
  6794. // should be 1.162377823e+764914905173815, but is 1.162355823e+764914905173815
  6795. k = Math.min(12, (e + '').length);
  6796. // r = x^y = exp(y*ln(x))
  6797. r = naturalExponential(y.times(naturalLogarithm(x, pr + k)), pr);
  6798. // r may be Infinity, e.g. (0.9999999999999999).pow(-1e+40)
  6799. if (r.d) {
  6800. // Truncate to the required precision plus five rounding digits.
  6801. r = finalise(r, pr + 5, 1);
  6802. // If the rounding digits are [49]9999 or [50]0000 increase the precision by 10 and recalculate
  6803. // the result.
  6804. if (checkRoundingDigits(r.d, pr, rm)) {
  6805. e = pr + 10;
  6806. // Truncate to the increased precision plus five rounding digits.
  6807. r = finalise(naturalExponential(y.times(naturalLogarithm(x, e + k)), e), e + 5, 1);
  6808. // Check for 14 nines from the 2nd rounding digit (the first rounding digit may be 4 or 9).
  6809. if (+digitsToString(r.d).slice(pr + 1, pr + 15) + 1 == 1e14) {
  6810. r = finalise(r, pr + 1, 0);
  6811. }
  6812. }
  6813. }
  6814. r.s = s;
  6815. external = true;
  6816. Ctor.rounding = rm;
  6817. return finalise(r, pr, rm);
  6818. };
  6819. /*
  6820. * Return a string representing the value of this Decimal rounded to `sd` significant digits
  6821. * using rounding mode `rounding`.
  6822. *
  6823. * Return exponential notation if `sd` is less than the number of digits necessary to represent
  6824. * the integer part of the value in normal notation.
  6825. *
  6826. * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.
  6827. * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
  6828. *
  6829. */
  6830. P.toPrecision = function (sd, rm) {
  6831. var str,
  6832. x = this,
  6833. Ctor = x.constructor;
  6834. if (sd === void 0) {
  6835. str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos);
  6836. } else {
  6837. checkInt32(sd, 1, MAX_DIGITS);
  6838. if (rm === void 0) rm = Ctor.rounding;else
  6839. checkInt32(rm, 0, 8);
  6840. x = finalise(new Ctor(x), sd, rm);
  6841. str = finiteToString(x, sd <= x.e || x.e <= Ctor.toExpNeg, sd);
  6842. }
  6843. return x.isNeg() && !x.isZero() ? '-' + str : str;
  6844. };
  6845. /*
  6846. * Return a new Decimal whose value is the value of this Decimal rounded to a maximum of `sd`
  6847. * significant digits using rounding mode `rm`, or to `precision` and `rounding` respectively if
  6848. * omitted.
  6849. *
  6850. * [sd] {number} Significant digits. Integer, 1 to MAX_DIGITS inclusive.
  6851. * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
  6852. *
  6853. * 'toSD() digits out of range: {sd}'
  6854. * 'toSD() digits not an integer: {sd}'
  6855. * 'toSD() rounding mode not an integer: {rm}'
  6856. * 'toSD() rounding mode out of range: {rm}'
  6857. *
  6858. */
  6859. P.toSignificantDigits = P.toSD = function (sd, rm) {
  6860. var x = this,
  6861. Ctor = x.constructor;
  6862. if (sd === void 0) {
  6863. sd = Ctor.precision;
  6864. rm = Ctor.rounding;
  6865. } else {
  6866. checkInt32(sd, 1, MAX_DIGITS);
  6867. if (rm === void 0) rm = Ctor.rounding;else
  6868. checkInt32(rm, 0, 8);
  6869. }
  6870. return finalise(new Ctor(x), sd, rm);
  6871. };
  6872. /*
  6873. * Return a string representing the value of this Decimal.
  6874. *
  6875. * Return exponential notation if this Decimal has a positive exponent equal to or greater than
  6876. * `toExpPos`, or a negative exponent equal to or less than `toExpNeg`.
  6877. *
  6878. */
  6879. P.toString = function () {
  6880. var x = this,
  6881. Ctor = x.constructor,
  6882. str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos);
  6883. return x.isNeg() && !x.isZero() ? '-' + str : str;
  6884. };
  6885. /*
  6886. * Return a new Decimal whose value is the value of this Decimal truncated to a whole number.
  6887. *
  6888. */
  6889. P.truncated = P.trunc = function () {
  6890. return finalise(new this.constructor(this), this.e + 1, 1);
  6891. };
  6892. /*
  6893. * Return a string representing the value of this Decimal.
  6894. * Unlike `toString`, negative zero will include the minus sign.
  6895. *
  6896. */
  6897. P.valueOf = P.toJSON = function () {
  6898. var x = this,
  6899. Ctor = x.constructor,
  6900. str = finiteToString(x, x.e <= Ctor.toExpNeg || x.e >= Ctor.toExpPos);
  6901. return x.isNeg() ? '-' + str : str;
  6902. };
  6903. // Helper functions for Decimal.prototype (P) and/or Decimal methods, and their callers.
  6904. /*
  6905. * digitsToString P.cubeRoot, P.logarithm, P.squareRoot, P.toFraction, P.toPower,
  6906. * finiteToString, naturalExponential, naturalLogarithm
  6907. * checkInt32 P.toDecimalPlaces, P.toExponential, P.toFixed, P.toNearest,
  6908. * P.toPrecision, P.toSignificantDigits, toStringBinary, random
  6909. * checkRoundingDigits P.logarithm, P.toPower, naturalExponential, naturalLogarithm
  6910. * convertBase toStringBinary, parseOther
  6911. * cos P.cos
  6912. * divide P.atanh, P.cubeRoot, P.dividedBy, P.dividedToIntegerBy,
  6913. * P.logarithm, P.modulo, P.squareRoot, P.tan, P.tanh, P.toFraction,
  6914. * P.toNearest, toStringBinary, naturalExponential, naturalLogarithm,
  6915. * taylorSeries, atan2, parseOther
  6916. * finalise P.absoluteValue, P.atan, P.atanh, P.ceil, P.cos, P.cosh,
  6917. * P.cubeRoot, P.dividedToIntegerBy, P.floor, P.logarithm, P.minus,
  6918. * P.modulo, P.negated, P.plus, P.round, P.sin, P.sinh, P.squareRoot,
  6919. * P.tan, P.times, P.toDecimalPlaces, P.toExponential, P.toFixed,
  6920. * P.toNearest, P.toPower, P.toPrecision, P.toSignificantDigits,
  6921. * P.truncated, divide, getLn10, getPi, naturalExponential,
  6922. * naturalLogarithm, ceil, floor, round, trunc
  6923. * finiteToString P.toExponential, P.toFixed, P.toPrecision, P.toString, P.valueOf,
  6924. * toStringBinary
  6925. * getBase10Exponent P.minus, P.plus, P.times, parseOther
  6926. * getLn10 P.logarithm, naturalLogarithm
  6927. * getPi P.acos, P.asin, P.atan, toLessThanHalfPi, atan2
  6928. * getPrecision P.precision, P.toFraction
  6929. * getZeroString digitsToString, finiteToString
  6930. * intPow P.toPower, parseOther
  6931. * isOdd toLessThanHalfPi
  6932. * maxOrMin max, min
  6933. * naturalExponential P.naturalExponential, P.toPower
  6934. * naturalLogarithm P.acosh, P.asinh, P.atanh, P.logarithm, P.naturalLogarithm,
  6935. * P.toPower, naturalExponential
  6936. * nonFiniteToString finiteToString, toStringBinary
  6937. * parseDecimal Decimal
  6938. * parseOther Decimal
  6939. * sin P.sin
  6940. * taylorSeries P.cosh, P.sinh, cos, sin
  6941. * toLessThanHalfPi P.cos, P.sin
  6942. * toStringBinary P.toBinary, P.toHexadecimal, P.toOctal
  6943. * truncate intPow
  6944. *
  6945. * Throws: P.logarithm, P.precision, P.toFraction, checkInt32, getLn10, getPi,
  6946. * naturalLogarithm, config, parseOther, random, Decimal
  6947. */
  6948. function digitsToString(d) {
  6949. var i,k,ws,
  6950. indexOfLastWord = d.length - 1,
  6951. str = '',
  6952. w = d[0];
  6953. if (indexOfLastWord > 0) {
  6954. str += w;
  6955. for (i = 1; i < indexOfLastWord; i++) {
  6956. ws = d[i] + '';
  6957. k = LOG_BASE - ws.length;
  6958. if (k) str += getZeroString(k);
  6959. str += ws;
  6960. }
  6961. w = d[i];
  6962. ws = w + '';
  6963. k = LOG_BASE - ws.length;
  6964. if (k) str += getZeroString(k);
  6965. } else if (w === 0) {
  6966. return '0';
  6967. }
  6968. // Remove trailing zeros of last w.
  6969. for (; w % 10 === 0;) {w /= 10;}
  6970. return str + w;
  6971. }
  6972. function checkInt32(i, min, max) {
  6973. if (i !== ~~i || i < min || i > max) {
  6974. throw Error(invalidArgument + i);
  6975. }
  6976. }
  6977. /*
  6978. * Check 5 rounding digits if `repeating` is null, 4 otherwise.
  6979. * `repeating == null` if caller is `log` or `pow`,
  6980. * `repeating != null` if caller is `naturalLogarithm` or `naturalExponential`.
  6981. */
  6982. function checkRoundingDigits(d, i, rm, repeating) {
  6983. var di, k, r, rd;
  6984. // Get the length of the first word of the array d.
  6985. for (k = d[0]; k >= 10; k /= 10) {--i;}
  6986. // Is the rounding digit in the first word of d?
  6987. if (--i < 0) {
  6988. i += LOG_BASE;
  6989. di = 0;
  6990. } else {
  6991. di = Math.ceil((i + 1) / LOG_BASE);
  6992. i %= LOG_BASE;
  6993. }
  6994. // i is the index (0 - 6) of the rounding digit.
  6995. // E.g. if within the word 3487563 the first rounding digit is 5,
  6996. // then i = 4, k = 1000, rd = 3487563 % 1000 = 563
  6997. k = mathpow(10, LOG_BASE - i);
  6998. rd = d[di] % k | 0;
  6999. if (repeating == null) {
  7000. if (i < 3) {
  7001. if (i == 0) rd = rd / 100 | 0;else
  7002. if (i == 1) rd = rd / 10 | 0;
  7003. r = rm < 4 && rd == 99999 || rm > 3 && rd == 49999 || rd == 50000 || rd == 0;
  7004. } else {
  7005. r = (rm < 4 && rd + 1 == k || rm > 3 && rd + 1 == k / 2) &&
  7006. (d[di + 1] / k / 100 | 0) == mathpow(10, i - 2) - 1 ||
  7007. (rd == k / 2 || rd == 0) && (d[di + 1] / k / 100 | 0) == 0;
  7008. }
  7009. } else {
  7010. if (i < 4) {
  7011. if (i == 0) rd = rd / 1000 | 0;else
  7012. if (i == 1) rd = rd / 100 | 0;else
  7013. if (i == 2) rd = rd / 10 | 0;
  7014. r = (repeating || rm < 4) && rd == 9999 || !repeating && rm > 3 && rd == 4999;
  7015. } else {
  7016. r = ((repeating || rm < 4) && rd + 1 == k ||
  7017. !repeating && rm > 3 && rd + 1 == k / 2) &&
  7018. (d[di + 1] / k / 1000 | 0) == mathpow(10, i - 3) - 1;
  7019. }
  7020. }
  7021. return r;
  7022. }
  7023. // Convert string of `baseIn` to an array of numbers of `baseOut`.
  7024. // Eg. convertBase('255', 10, 16) returns [15, 15].
  7025. // Eg. convertBase('ff', 16, 10) returns [2, 5, 5].
  7026. function convertBase(str, baseIn, baseOut) {
  7027. var j,
  7028. arr = [0],
  7029. arrL,
  7030. i = 0,
  7031. strL = str.length;
  7032. for (; i < strL;) {
  7033. for (arrL = arr.length; arrL--;) {arr[arrL] *= baseIn;}
  7034. arr[0] += NUMERALS.indexOf(str.charAt(i++));
  7035. for (j = 0; j < arr.length; j++) {
  7036. if (arr[j] > baseOut - 1) {
  7037. if (arr[j + 1] === void 0) arr[j + 1] = 0;
  7038. arr[j + 1] += arr[j] / baseOut | 0;
  7039. arr[j] %= baseOut;
  7040. }
  7041. }
  7042. }
  7043. return arr.reverse();
  7044. }
  7045. /*
  7046. * cos(x) = 1 - x^2/2! + x^4/4! - ...
  7047. * |x| < pi/2
  7048. *
  7049. */
  7050. function cosine(Ctor, x) {
  7051. var k, len, y;
  7052. if (x.isZero()) return x;
  7053. // Argument reduction: cos(4x) = 8*(cos^4(x) - cos^2(x)) + 1
  7054. // i.e. cos(x) = 8*(cos^4(x/4) - cos^2(x/4)) + 1
  7055. // Estimate the optimum number of times to use the argument reduction.
  7056. len = x.d.length;
  7057. if (len < 32) {
  7058. k = Math.ceil(len / 3);
  7059. y = (1 / tinyPow(4, k)).toString();
  7060. } else {
  7061. k = 16;
  7062. y = '2.3283064365386962890625e-10';
  7063. }
  7064. Ctor.precision += k;
  7065. x = taylorSeries(Ctor, 1, x.times(y), new Ctor(1));
  7066. // Reverse argument reduction
  7067. for (var i = k; i--;) {
  7068. var cos2x = x.times(x);
  7069. x = cos2x.times(cos2x).minus(cos2x).times(8).plus(1);
  7070. }
  7071. Ctor.precision -= k;
  7072. return x;
  7073. }
  7074. /*
  7075. * Perform division in the specified base.
  7076. */
  7077. var divide = function () {
  7078. // Assumes non-zero x and k, and hence non-zero result.
  7079. function multiplyInteger(x, k, base) {
  7080. var temp,
  7081. carry = 0,
  7082. i = x.length;
  7083. for (x = x.slice(); i--;) {
  7084. temp = x[i] * k + carry;
  7085. x[i] = temp % base | 0;
  7086. carry = temp / base | 0;
  7087. }
  7088. if (carry) x.unshift(carry);
  7089. return x;
  7090. }
  7091. function compare(a, b, aL, bL) {
  7092. var i, r;
  7093. if (aL != bL) {
  7094. r = aL > bL ? 1 : -1;
  7095. } else {
  7096. for (i = r = 0; i < aL; i++) {
  7097. if (a[i] != b[i]) {
  7098. r = a[i] > b[i] ? 1 : -1;
  7099. break;
  7100. }
  7101. }
  7102. }
  7103. return r;
  7104. }
  7105. function subtract(a, b, aL, base) {
  7106. var i = 0;
  7107. // Subtract b from a.
  7108. for (; aL--;) {
  7109. a[aL] -= i;
  7110. i = a[aL] < b[aL] ? 1 : 0;
  7111. a[aL] = i * base + a[aL] - b[aL];
  7112. }
  7113. // Remove leading zeros.
  7114. for (; !a[0] && a.length > 1;) {a.shift();}
  7115. }
  7116. return function (x, y, pr, rm, dp, base) {
  7117. var cmp,e,i,k,logBase,more,prod,prodL,q,qd,rem,remL,rem0,sd,t,xi,xL,yd0,
  7118. yL,yz,
  7119. Ctor = x.constructor,
  7120. sign = x.s == y.s ? 1 : -1,
  7121. xd = x.d,
  7122. yd = y.d;
  7123. // Either NaN, Infinity or 0?
  7124. if (!xd || !xd[0] || !yd || !yd[0]) {
  7125. return new Ctor( // Return NaN if either NaN, or both Infinity or 0.
  7126. !x.s || !y.s || (xd ? yd && xd[0] == yd[0] : !yd) ? NaN :
  7127. // Return ±0 if x is 0 or y is ±Infinity, or return ±Infinity as y is 0.
  7128. xd && xd[0] == 0 || !yd ? sign * 0 : sign / 0);
  7129. }
  7130. if (base) {
  7131. logBase = 1;
  7132. e = x.e - y.e;
  7133. } else {
  7134. base = BASE;
  7135. logBase = LOG_BASE;
  7136. e = mathfloor(x.e / logBase) - mathfloor(y.e / logBase);
  7137. }
  7138. yL = yd.length;
  7139. xL = xd.length;
  7140. q = new Ctor(sign);
  7141. qd = q.d = [];
  7142. // Result exponent may be one less than e.
  7143. // The digit array of a Decimal from toStringBinary may have trailing zeros.
  7144. for (i = 0; yd[i] == (xd[i] || 0); i++) {;}
  7145. if (yd[i] > (xd[i] || 0)) e--;
  7146. if (pr == null) {
  7147. sd = pr = Ctor.precision;
  7148. rm = Ctor.rounding;
  7149. } else if (dp) {
  7150. sd = pr + (x.e - y.e) + 1;
  7151. } else {
  7152. sd = pr;
  7153. }
  7154. if (sd < 0) {
  7155. qd.push(1);
  7156. more = true;
  7157. } else {
  7158. // Convert precision in number of base 10 digits to base 1e7 digits.
  7159. sd = sd / logBase + 2 | 0;
  7160. i = 0;
  7161. // divisor < 1e7
  7162. if (yL == 1) {
  7163. k = 0;
  7164. yd = yd[0];
  7165. sd++;
  7166. // k is the carry.
  7167. for (; (i < xL || k) && sd--; i++) {
  7168. t = k * base + (xd[i] || 0);
  7169. qd[i] = t / yd | 0;
  7170. k = t % yd | 0;
  7171. }
  7172. more = k || i < xL;
  7173. // divisor >= 1e7
  7174. } else {
  7175. // Normalise xd and yd so highest order digit of yd is >= base/2
  7176. k = base / (yd[0] + 1) | 0;
  7177. if (k > 1) {
  7178. yd = multiplyInteger(yd, k, base);
  7179. xd = multiplyInteger(xd, k, base);
  7180. yL = yd.length;
  7181. xL = xd.length;
  7182. }
  7183. xi = yL;
  7184. rem = xd.slice(0, yL);
  7185. remL = rem.length;
  7186. // Add zeros to make remainder as long as divisor.
  7187. for (; remL < yL;) {rem[remL++] = 0;}
  7188. yz = yd.slice();
  7189. yz.unshift(0);
  7190. yd0 = yd[0];
  7191. if (yd[1] >= base / 2) ++yd0;
  7192. do {
  7193. k = 0;
  7194. // Compare divisor and remainder.
  7195. cmp = compare(yd, rem, yL, remL);
  7196. // If divisor < remainder.
  7197. if (cmp < 0) {
  7198. // Calculate trial digit, k.
  7199. rem0 = rem[0];
  7200. if (yL != remL) rem0 = rem0 * base + (rem[1] || 0);
  7201. // k will be how many times the divisor goes into the current remainder.
  7202. k = rem0 / yd0 | 0;
  7203. // Algorithm:
  7204. // 1. product = divisor * trial digit (k)
  7205. // 2. if product > remainder: product -= divisor, k--
  7206. // 3. remainder -= product
  7207. // 4. if product was < remainder at 2:
  7208. // 5. compare new remainder and divisor
  7209. // 6. If remainder > divisor: remainder -= divisor, k++
  7210. if (k > 1) {
  7211. if (k >= base) k = base - 1;
  7212. // product = divisor * trial digit.
  7213. prod = multiplyInteger(yd, k, base);
  7214. prodL = prod.length;
  7215. remL = rem.length;
  7216. // Compare product and remainder.
  7217. cmp = compare(prod, rem, prodL, remL);
  7218. // product > remainder.
  7219. if (cmp == 1) {
  7220. k--;
  7221. // Subtract divisor from product.
  7222. subtract(prod, yL < prodL ? yz : yd, prodL, base);
  7223. }
  7224. } else {
  7225. // cmp is -1.
  7226. // If k is 0, there is no need to compare yd and rem again below, so change cmp to 1
  7227. // to avoid it. If k is 1 there is a need to compare yd and rem again below.
  7228. if (k == 0) cmp = k = 1;
  7229. prod = yd.slice();
  7230. }
  7231. prodL = prod.length;
  7232. if (prodL < remL) prod.unshift(0);
  7233. // Subtract product from remainder.
  7234. subtract(rem, prod, remL, base);
  7235. // If product was < previous remainder.
  7236. if (cmp == -1) {
  7237. remL = rem.length;
  7238. // Compare divisor and new remainder.
  7239. cmp = compare(yd, rem, yL, remL);
  7240. // If divisor < new remainder, subtract divisor from remainder.
  7241. if (cmp < 1) {
  7242. k++;
  7243. // Subtract divisor from remainder.
  7244. subtract(rem, yL < remL ? yz : yd, remL, base);
  7245. }
  7246. }
  7247. remL = rem.length;
  7248. } else if (cmp === 0) {
  7249. k++;
  7250. rem = [0];
  7251. } // if cmp === 1, k will be 0
  7252. // Add the next digit, k, to the result array.
  7253. qd[i++] = k;
  7254. // Update the remainder.
  7255. if (cmp && rem[0]) {
  7256. rem[remL++] = xd[xi] || 0;
  7257. } else {
  7258. rem = [xd[xi]];
  7259. remL = 1;
  7260. }
  7261. } while ((xi++ < xL || rem[0] !== void 0) && sd--);
  7262. more = rem[0] !== void 0;
  7263. }
  7264. // Leading zero?
  7265. if (!qd[0]) qd.shift();
  7266. }
  7267. // logBase is 1 when divide is being used for base conversion.
  7268. if (logBase == 1) {
  7269. q.e = e;
  7270. inexact = more;
  7271. } else {
  7272. // To calculate q.e, first get the number of digits of qd[0].
  7273. for (i = 1, k = qd[0]; k >= 10; k /= 10) {i++;}
  7274. q.e = i + e * logBase - 1;
  7275. finalise(q, dp ? pr + q.e + 1 : pr, rm, more);
  7276. }
  7277. return q;
  7278. };
  7279. }();
  7280. /*
  7281. * Round `x` to `sd` significant digits using rounding mode `rm`.
  7282. * Check for over/under-flow.
  7283. */
  7284. function finalise(x, sd, rm, isTruncated) {
  7285. var digits,i,j,k,rd,roundUp,w,xd,xdi,
  7286. Ctor = x.constructor;
  7287. // Don't round if sd is null or undefined.
  7288. out: if (sd != null) {
  7289. xd = x.d;
  7290. // Infinity/NaN.
  7291. if (!xd) return x;
  7292. // rd: the rounding digit, i.e. the digit after the digit that may be rounded up.
  7293. // w: the word of xd containing rd, a base 1e7 number.
  7294. // xdi: the index of w within xd.
  7295. // digits: the number of digits of w.
  7296. // i: what would be the index of rd within w if all the numbers were 7 digits long (i.e. if
  7297. // they had leading zeros)
  7298. // j: if > 0, the actual index of rd within w (if < 0, rd is a leading zero).
  7299. // Get the length of the first word of the digits array xd.
  7300. for (digits = 1, k = xd[0]; k >= 10; k /= 10) {digits++;}
  7301. i = sd - digits;
  7302. // Is the rounding digit in the first word of xd?
  7303. if (i < 0) {
  7304. i += LOG_BASE;
  7305. j = sd;
  7306. w = xd[xdi = 0];
  7307. // Get the rounding digit at index j of w.
  7308. rd = w / mathpow(10, digits - j - 1) % 10 | 0;
  7309. } else {
  7310. xdi = Math.ceil((i + 1) / LOG_BASE);
  7311. k = xd.length;
  7312. if (xdi >= k) {
  7313. if (isTruncated) {
  7314. // Needed by `naturalExponential`, `naturalLogarithm` and `squareRoot`.
  7315. for (; k++ <= xdi;) {xd.push(0);}
  7316. w = rd = 0;
  7317. digits = 1;
  7318. i %= LOG_BASE;
  7319. j = i - LOG_BASE + 1;
  7320. } else {
  7321. break out;
  7322. }
  7323. } else {
  7324. w = k = xd[xdi];
  7325. // Get the number of digits of w.
  7326. for (digits = 1; k >= 10; k /= 10) {digits++;}
  7327. // Get the index of rd within w.
  7328. i %= LOG_BASE;
  7329. // Get the index of rd within w, adjusted for leading zeros.
  7330. // The number of leading zeros of w is given by LOG_BASE - digits.
  7331. j = i - LOG_BASE + digits;
  7332. // Get the rounding digit at index j of w.
  7333. rd = j < 0 ? 0 : w / mathpow(10, digits - j - 1) % 10 | 0;
  7334. }
  7335. }
  7336. // Are there any non-zero digits after the rounding digit?
  7337. isTruncated = isTruncated || sd < 0 ||
  7338. xd[xdi + 1] !== void 0 || (j < 0 ? w : w % mathpow(10, digits - j - 1));
  7339. // The expression `w % mathpow(10, digits - j - 1)` returns all the digits of w to the right
  7340. // of the digit at (left-to-right) index j, e.g. if w is 908714 and j is 2, the expression
  7341. // will give 714.
  7342. roundUp = rm < 4 ?
  7343. (rd || isTruncated) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) :
  7344. rd > 5 || rd == 5 && (rm == 4 || isTruncated || rm == 6 &&
  7345. // Check whether the digit to the left of the rounding digit is odd.
  7346. (i > 0 ? j > 0 ? w / mathpow(10, digits - j) : 0 : xd[xdi - 1]) % 10 & 1 ||
  7347. rm == (x.s < 0 ? 8 : 7));
  7348. if (sd < 1 || !xd[0]) {
  7349. xd.length = 0;
  7350. if (roundUp) {
  7351. // Convert sd to decimal places.
  7352. sd -= x.e + 1;
  7353. // 1, 0.1, 0.01, 0.001, 0.0001 etc.
  7354. xd[0] = mathpow(10, (LOG_BASE - sd % LOG_BASE) % LOG_BASE);
  7355. x.e = -sd || 0;
  7356. } else {
  7357. // Zero.
  7358. xd[0] = x.e = 0;
  7359. }
  7360. return x;
  7361. }
  7362. // Remove excess digits.
  7363. if (i == 0) {
  7364. xd.length = xdi;
  7365. k = 1;
  7366. xdi--;
  7367. } else {
  7368. xd.length = xdi + 1;
  7369. k = mathpow(10, LOG_BASE - i);
  7370. // E.g. 56700 becomes 56000 if 7 is the rounding digit.
  7371. // j > 0 means i > number of leading zeros of w.
  7372. xd[xdi] = j > 0 ? (w / mathpow(10, digits - j) % mathpow(10, j) | 0) * k : 0;
  7373. }
  7374. if (roundUp) {
  7375. for (;;) {
  7376. // Is the digit to be rounded up in the first word of xd?
  7377. if (xdi == 0) {
  7378. // i will be the length of xd[0] before k is added.
  7379. for (i = 1, j = xd[0]; j >= 10; j /= 10) {i++;}
  7380. j = xd[0] += k;
  7381. for (k = 1; j >= 10; j /= 10) {k++;}
  7382. // if i != k the length has increased.
  7383. if (i != k) {
  7384. x.e++;
  7385. if (xd[0] == BASE) xd[0] = 1;
  7386. }
  7387. break;
  7388. } else {
  7389. xd[xdi] += k;
  7390. if (xd[xdi] != BASE) break;
  7391. xd[xdi--] = 0;
  7392. k = 1;
  7393. }
  7394. }
  7395. }
  7396. // Remove trailing zeros.
  7397. for (i = xd.length; xd[--i] === 0;) {xd.pop();}
  7398. }
  7399. if (external) {
  7400. // Overflow?
  7401. if (x.e > Ctor.maxE) {
  7402. // Infinity.
  7403. x.d = null;
  7404. x.e = NaN;
  7405. // Underflow?
  7406. } else if (x.e < Ctor.minE) {
  7407. // Zero.
  7408. x.e = 0;
  7409. x.d = [0];
  7410. // Ctor.underflow = true;
  7411. } // else Ctor.underflow = false;
  7412. }
  7413. return x;
  7414. }
  7415. function finiteToString(x, isExp, sd) {
  7416. if (!x.isFinite()) return nonFiniteToString(x);
  7417. var k,
  7418. e = x.e,
  7419. str = digitsToString(x.d),
  7420. len = str.length;
  7421. if (isExp) {
  7422. if (sd && (k = sd - len) > 0) {
  7423. str = str.charAt(0) + '.' + str.slice(1) + getZeroString(k);
  7424. } else if (len > 1) {
  7425. str = str.charAt(0) + '.' + str.slice(1);
  7426. }
  7427. str = str + (x.e < 0 ? 'e' : 'e+') + x.e;
  7428. } else if (e < 0) {
  7429. str = '0.' + getZeroString(-e - 1) + str;
  7430. if (sd && (k = sd - len) > 0) str += getZeroString(k);
  7431. } else if (e >= len) {
  7432. str += getZeroString(e + 1 - len);
  7433. if (sd && (k = sd - e - 1) > 0) str = str + '.' + getZeroString(k);
  7434. } else {
  7435. if ((k = e + 1) < len) str = str.slice(0, k) + '.' + str.slice(k);
  7436. if (sd && (k = sd - len) > 0) {
  7437. if (e + 1 === len) str += '.';
  7438. str += getZeroString(k);
  7439. }
  7440. }
  7441. return str;
  7442. }
  7443. // Calculate the base 10 exponent from the base 1e7 exponent.
  7444. function getBase10Exponent(digits, e) {
  7445. var w = digits[0];
  7446. // Add the number of digits of the first word of the digits array.
  7447. for (e *= LOG_BASE; w >= 10; w /= 10) {e++;}
  7448. return e;
  7449. }
  7450. function getLn10(Ctor, sd, pr) {
  7451. if (sd > LN10_PRECISION) {
  7452. // Reset global state in case the exception is caught.
  7453. external = true;
  7454. if (pr) Ctor.precision = pr;
  7455. throw Error(precisionLimitExceeded);
  7456. }
  7457. return finalise(new Ctor(LN10), sd, 1, true);
  7458. }
  7459. function getPi(Ctor, sd, rm) {
  7460. if (sd > PI_PRECISION) throw Error(precisionLimitExceeded);
  7461. return finalise(new Ctor(PI), sd, rm, true);
  7462. }
  7463. function getPrecision(digits) {
  7464. var w = digits.length - 1,
  7465. len = w * LOG_BASE + 1;
  7466. w = digits[w];
  7467. // If non-zero...
  7468. if (w) {
  7469. // Subtract the number of trailing zeros of the last word.
  7470. for (; w % 10 == 0; w /= 10) {len--;}
  7471. // Add the number of digits of the first word.
  7472. for (w = digits[0]; w >= 10; w /= 10) {len++;}
  7473. }
  7474. return len;
  7475. }
  7476. function getZeroString(k) {
  7477. var zs = '';
  7478. for (; k--;) {zs += '0';}
  7479. return zs;
  7480. }
  7481. /*
  7482. * Return a new Decimal whose value is the value of Decimal `x` to the power `n`, where `n` is an
  7483. * integer of type number.
  7484. *
  7485. * Implements 'exponentiation by squaring'. Called by `pow` and `parseOther`.
  7486. *
  7487. */
  7488. function intPow(Ctor, x, n, pr) {
  7489. var isTruncated,
  7490. r = new Ctor(1),
  7491. // Max n of 9007199254740991 takes 53 loop iterations.
  7492. // Maximum digits array length; leaves [28, 34] guard digits.
  7493. k = Math.ceil(pr / LOG_BASE + 4);
  7494. external = false;
  7495. for (;;) {
  7496. if (n % 2) {
  7497. r = r.times(x);
  7498. if (truncate(r.d, k)) isTruncated = true;
  7499. }
  7500. n = mathfloor(n / 2);
  7501. if (n === 0) {
  7502. // To ensure correct rounding when r.d is truncated, increment the last word if it is zero.
  7503. n = r.d.length - 1;
  7504. if (isTruncated && r.d[n] === 0) ++r.d[n];
  7505. break;
  7506. }
  7507. x = x.times(x);
  7508. truncate(x.d, k);
  7509. }
  7510. external = true;
  7511. return r;
  7512. }
  7513. function isOdd(n) {
  7514. return n.d[n.d.length - 1] & 1;
  7515. }
  7516. /*
  7517. * Handle `max` and `min`. `ltgt` is 'lt' or 'gt'.
  7518. */
  7519. function maxOrMin(Ctor, args, ltgt) {
  7520. var y,
  7521. x = new Ctor(args[0]),
  7522. i = 0;
  7523. for (; ++i < args.length;) {
  7524. y = new Ctor(args[i]);
  7525. if (!y.s) {
  7526. x = y;
  7527. break;
  7528. } else if (x[ltgt](y)) {
  7529. x = y;
  7530. }
  7531. }
  7532. return x;
  7533. }
  7534. /*
  7535. * Return a new Decimal whose value is the natural exponential of `x` rounded to `sd` significant
  7536. * digits.
  7537. *
  7538. * Taylor/Maclaurin series.
  7539. *
  7540. * exp(x) = x^0/0! + x^1/1! + x^2/2! + x^3/3! + ...
  7541. *
  7542. * Argument reduction:
  7543. * Repeat x = x / 32, k += 5, until |x| < 0.1
  7544. * exp(x) = exp(x / 2^k)^(2^k)
  7545. *
  7546. * Previously, the argument was initially reduced by
  7547. * exp(x) = exp(r) * 10^k where r = x - k * ln10, k = floor(x / ln10)
  7548. * to first put r in the range [0, ln10], before dividing by 32 until |x| < 0.1, but this was
  7549. * found to be slower than just dividing repeatedly by 32 as above.
  7550. *
  7551. * Max integer argument: exp('20723265836946413') = 6.3e+9000000000000000
  7552. * Min integer argument: exp('-20723265836946411') = 1.2e-9000000000000000
  7553. * (Math object integer min/max: Math.exp(709) = 8.2e+307, Math.exp(-745) = 5e-324)
  7554. *
  7555. * exp(Infinity) = Infinity
  7556. * exp(-Infinity) = 0
  7557. * exp(NaN) = NaN
  7558. * exp(±0) = 1
  7559. *
  7560. * exp(x) is non-terminating for any finite, non-zero x.
  7561. *
  7562. * The result will always be correctly rounded.
  7563. *
  7564. */
  7565. function naturalExponential(x, sd) {
  7566. var denominator,guard,j,pow,sum,t,wpr,
  7567. rep = 0,
  7568. i = 0,
  7569. k = 0,
  7570. Ctor = x.constructor,
  7571. rm = Ctor.rounding,
  7572. pr = Ctor.precision;
  7573. // 0/NaN/Infinity?
  7574. if (!x.d || !x.d[0] || x.e > 17) {
  7575. return new Ctor(x.d ?
  7576. !x.d[0] ? 1 : x.s < 0 ? 0 : 1 / 0 :
  7577. x.s ? x.s < 0 ? 0 : x : 0 / 0);
  7578. }
  7579. if (sd == null) {
  7580. external = false;
  7581. wpr = pr;
  7582. } else {
  7583. wpr = sd;
  7584. }
  7585. t = new Ctor(0.03125);
  7586. // while abs(x) >= 0.1
  7587. while (x.e > -2) {
  7588. // x = x / 2^5
  7589. x = x.times(t);
  7590. k += 5;
  7591. }
  7592. // Use 2 * log10(2^k) + 5 (empirically derived) to estimate the increase in precision
  7593. // necessary to ensure the first 4 rounding digits are correct.
  7594. guard = Math.log(mathpow(2, k)) / Math.LN10 * 2 + 5 | 0;
  7595. wpr += guard;
  7596. denominator = pow = sum = new Ctor(1);
  7597. Ctor.precision = wpr;
  7598. for (;;) {
  7599. pow = finalise(pow.times(x), wpr, 1);
  7600. denominator = denominator.times(++i);
  7601. t = sum.plus(divide(pow, denominator, wpr, 1));
  7602. if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum.d).slice(0, wpr)) {
  7603. j = k;
  7604. while (j--) {sum = finalise(sum.times(sum), wpr, 1);}
  7605. // Check to see if the first 4 rounding digits are [49]999.
  7606. // If so, repeat the summation with a higher precision, otherwise
  7607. // e.g. with precision: 18, rounding: 1
  7608. // exp(18.404272462595034083567793919843761) = 98372560.1229999999 (should be 98372560.123)
  7609. // `wpr - guard` is the index of first rounding digit.
  7610. if (sd == null) {
  7611. if (rep < 3 && checkRoundingDigits(sum.d, wpr - guard, rm, rep)) {
  7612. Ctor.precision = wpr += 10;
  7613. denominator = pow = t = new Ctor(1);
  7614. i = 0;
  7615. rep++;
  7616. } else {
  7617. return finalise(sum, Ctor.precision = pr, rm, external = true);
  7618. }
  7619. } else {
  7620. Ctor.precision = pr;
  7621. return sum;
  7622. }
  7623. }
  7624. sum = t;
  7625. }
  7626. }
  7627. /*
  7628. * Return a new Decimal whose value is the natural logarithm of `x` rounded to `sd` significant
  7629. * digits.
  7630. *
  7631. * ln(-n) = NaN
  7632. * ln(0) = -Infinity
  7633. * ln(-0) = -Infinity
  7634. * ln(1) = 0
  7635. * ln(Infinity) = Infinity
  7636. * ln(-Infinity) = NaN
  7637. * ln(NaN) = NaN
  7638. *
  7639. * ln(n) (n != 1) is non-terminating.
  7640. *
  7641. */
  7642. function naturalLogarithm(y, sd) {
  7643. var c,c0,denominator,e,numerator,rep,sum,t,wpr,x1,x2,
  7644. n = 1,
  7645. guard = 10,
  7646. x = y,
  7647. xd = x.d,
  7648. Ctor = x.constructor,
  7649. rm = Ctor.rounding,
  7650. pr = Ctor.precision;
  7651. // Is x negative or Infinity, NaN, 0 or 1?
  7652. if (x.s < 0 || !xd || !xd[0] || !x.e && xd[0] == 1 && xd.length == 1) {
  7653. return new Ctor(xd && !xd[0] ? -1 / 0 : x.s != 1 ? NaN : xd ? 0 : x);
  7654. }
  7655. if (sd == null) {
  7656. external = false;
  7657. wpr = pr;
  7658. } else {
  7659. wpr = sd;
  7660. }
  7661. Ctor.precision = wpr += guard;
  7662. c = digitsToString(xd);
  7663. c0 = c.charAt(0);
  7664. if (Math.abs(e = x.e) < 1.5e15) {
  7665. // Argument reduction.
  7666. // The series converges faster the closer the argument is to 1, so using
  7667. // ln(a^b) = b * ln(a), ln(a) = ln(a^b) / b
  7668. // multiply the argument by itself until the leading digits of the significand are 7, 8, 9,
  7669. // 10, 11, 12 or 13, recording the number of multiplications so the sum of the series can
  7670. // later be divided by this number, then separate out the power of 10 using
  7671. // ln(a*10^b) = ln(a) + b*ln(10).
  7672. // max n is 21 (gives 0.9, 1.0 or 1.1) (9e15 / 21 = 4.2e14).
  7673. //while (c0 < 9 && c0 != 1 || c0 == 1 && c.charAt(1) > 1) {
  7674. // max n is 6 (gives 0.7 - 1.3)
  7675. while (c0 < 7 && c0 != 1 || c0 == 1 && c.charAt(1) > 3) {
  7676. x = x.times(y);
  7677. c = digitsToString(x.d);
  7678. c0 = c.charAt(0);
  7679. n++;
  7680. }
  7681. e = x.e;
  7682. if (c0 > 1) {
  7683. x = new Ctor('0.' + c);
  7684. e++;
  7685. } else {
  7686. x = new Ctor(c0 + '.' + c.slice(1));
  7687. }
  7688. } else {
  7689. // The argument reduction method above may result in overflow if the argument y is a massive
  7690. // number with exponent >= 1500000000000000 (9e15 / 6 = 1.5e15), so instead recall this
  7691. // function using ln(x*10^e) = ln(x) + e*ln(10).
  7692. t = getLn10(Ctor, wpr + 2, pr).times(e + '');
  7693. x = naturalLogarithm(new Ctor(c0 + '.' + c.slice(1)), wpr - guard).plus(t);
  7694. Ctor.precision = pr;
  7695. return sd == null ? finalise(x, pr, rm, external = true) : x;
  7696. }
  7697. // x1 is x reduced to a value near 1.
  7698. x1 = x;
  7699. // Taylor series.
  7700. // ln(y) = ln((1 + x)/(1 - x)) = 2(x + x^3/3 + x^5/5 + x^7/7 + ...)
  7701. // where x = (y - 1)/(y + 1) (|x| < 1)
  7702. sum = numerator = x = divide(x.minus(1), x.plus(1), wpr, 1);
  7703. x2 = finalise(x.times(x), wpr, 1);
  7704. denominator = 3;
  7705. for (;;) {
  7706. numerator = finalise(numerator.times(x2), wpr, 1);
  7707. t = sum.plus(divide(numerator, new Ctor(denominator), wpr, 1));
  7708. if (digitsToString(t.d).slice(0, wpr) === digitsToString(sum.d).slice(0, wpr)) {
  7709. sum = sum.times(2);
  7710. // Reverse the argument reduction. Check that e is not 0 because, besides preventing an
  7711. // unnecessary calculation, -0 + 0 = +0 and to ensure correct rounding -0 needs to stay -0.
  7712. if (e !== 0) sum = sum.plus(getLn10(Ctor, wpr + 2, pr).times(e + ''));
  7713. sum = divide(sum, new Ctor(n), wpr, 1);
  7714. // Is rm > 3 and the first 4 rounding digits 4999, or rm < 4 (or the summation has
  7715. // been repeated previously) and the first 4 rounding digits 9999?
  7716. // If so, restart the summation with a higher precision, otherwise
  7717. // e.g. with precision: 12, rounding: 1
  7718. // ln(135520028.6126091714265381533) = 18.7246299999 when it should be 18.72463.
  7719. // `wpr - guard` is the index of first rounding digit.
  7720. if (sd == null) {
  7721. if (checkRoundingDigits(sum.d, wpr - guard, rm, rep)) {
  7722. Ctor.precision = wpr += guard;
  7723. t = numerator = x = divide(x1.minus(1), x1.plus(1), wpr, 1);
  7724. x2 = finalise(x.times(x), wpr, 1);
  7725. denominator = rep = 1;
  7726. } else {
  7727. return finalise(sum, Ctor.precision = pr, rm, external = true);
  7728. }
  7729. } else {
  7730. Ctor.precision = pr;
  7731. return sum;
  7732. }
  7733. }
  7734. sum = t;
  7735. denominator += 2;
  7736. }
  7737. }
  7738. // ±Infinity, NaN.
  7739. function nonFiniteToString(x) {
  7740. // Unsigned.
  7741. return String(x.s * x.s / 0);
  7742. }
  7743. /*
  7744. * Parse the value of a new Decimal `x` from string `str`.
  7745. */
  7746. function parseDecimal(x, str) {
  7747. var e, i, len;
  7748. // Decimal point?
  7749. if ((e = str.indexOf('.')) > -1) str = str.replace('.', '');
  7750. // Exponential form?
  7751. if ((i = str.search(/e/i)) > 0) {
  7752. // Determine exponent.
  7753. if (e < 0) e = i;
  7754. e += +str.slice(i + 1);
  7755. str = str.substring(0, i);
  7756. } else if (e < 0) {
  7757. // Integer.
  7758. e = str.length;
  7759. }
  7760. // Determine leading zeros.
  7761. for (i = 0; str.charCodeAt(i) === 48; i++) {;}
  7762. // Determine trailing zeros.
  7763. for (len = str.length; str.charCodeAt(len - 1) === 48; --len) {;}
  7764. str = str.slice(i, len);
  7765. if (str) {
  7766. len -= i;
  7767. x.e = e = e - i - 1;
  7768. x.d = [];
  7769. // Transform base
  7770. // e is the base 10 exponent.
  7771. // i is where to slice str to get the first word of the digits array.
  7772. i = (e + 1) % LOG_BASE;
  7773. if (e < 0) i += LOG_BASE;
  7774. if (i < len) {
  7775. if (i) x.d.push(+str.slice(0, i));
  7776. for (len -= LOG_BASE; i < len;) {x.d.push(+str.slice(i, i += LOG_BASE));}
  7777. str = str.slice(i);
  7778. i = LOG_BASE - str.length;
  7779. } else {
  7780. i -= len;
  7781. }
  7782. for (; i--;) {str += '0';}
  7783. x.d.push(+str);
  7784. if (external) {
  7785. // Overflow?
  7786. if (x.e > x.constructor.maxE) {
  7787. // Infinity.
  7788. x.d = null;
  7789. x.e = NaN;
  7790. // Underflow?
  7791. } else if (x.e < x.constructor.minE) {
  7792. // Zero.
  7793. x.e = 0;
  7794. x.d = [0];
  7795. // x.constructor.underflow = true;
  7796. } // else x.constructor.underflow = false;
  7797. }
  7798. } else {
  7799. // Zero.
  7800. x.e = 0;
  7801. x.d = [0];
  7802. }
  7803. return x;
  7804. }
  7805. /*
  7806. * Parse the value of a new Decimal `x` from a string `str`, which is not a decimal value.
  7807. */
  7808. function parseOther(x, str) {
  7809. var base, Ctor, divisor, i, isFloat, len, p, xd, xe;
  7810. if (str.indexOf('_') > -1) {
  7811. str = str.replace(/(\d)_(?=\d)/g, '$1');
  7812. if (isDecimal.test(str)) return parseDecimal(x, str);
  7813. } else if (str === 'Infinity' || str === 'NaN') {
  7814. if (!+str) x.s = NaN;
  7815. x.e = NaN;
  7816. x.d = null;
  7817. return x;
  7818. }
  7819. if (isHex.test(str)) {
  7820. base = 16;
  7821. str = str.toLowerCase();
  7822. } else if (isBinary.test(str)) {
  7823. base = 2;
  7824. } else if (isOctal.test(str)) {
  7825. base = 8;
  7826. } else {
  7827. throw Error(invalidArgument + str);
  7828. }
  7829. // Is there a binary exponent part?
  7830. i = str.search(/p/i);
  7831. if (i > 0) {
  7832. p = +str.slice(i + 1);
  7833. str = str.substring(2, i);
  7834. } else {
  7835. str = str.slice(2);
  7836. }
  7837. // Convert `str` as an integer then divide the result by `base` raised to a power such that the
  7838. // fraction part will be restored.
  7839. i = str.indexOf('.');
  7840. isFloat = i >= 0;
  7841. Ctor = x.constructor;
  7842. if (isFloat) {
  7843. str = str.replace('.', '');
  7844. len = str.length;
  7845. i = len - i;
  7846. // log[10](16) = 1.2041... , log[10](88) = 1.9444....
  7847. divisor = intPow(Ctor, new Ctor(base), i, i * 2);
  7848. }
  7849. xd = convertBase(str, base, BASE);
  7850. xe = xd.length - 1;
  7851. // Remove trailing zeros.
  7852. for (i = xe; xd[i] === 0; --i) {xd.pop();}
  7853. if (i < 0) return new Ctor(x.s * 0);
  7854. x.e = getBase10Exponent(xd, xe);
  7855. x.d = xd;
  7856. external = false;
  7857. // At what precision to perform the division to ensure exact conversion?
  7858. // maxDecimalIntegerPartDigitCount = ceil(log[10](b) * otherBaseIntegerPartDigitCount)
  7859. // log[10](2) = 0.30103, log[10](8) = 0.90309, log[10](16) = 1.20412
  7860. // E.g. ceil(1.2 * 3) = 4, so up to 4 decimal digits are needed to represent 3 hex int digits.
  7861. // maxDecimalFractionPartDigitCount = {Hex:4|Oct:3|Bin:1} * otherBaseFractionPartDigitCount
  7862. // Therefore using 4 * the number of digits of str will always be enough.
  7863. if (isFloat) x = divide(x, divisor, len * 4);
  7864. // Multiply by the binary exponent part if present.
  7865. if (p) x = x.times(Math.abs(p) < 54 ? mathpow(2, p) : Decimal.pow(2, p));
  7866. external = true;
  7867. return x;
  7868. }
  7869. /*
  7870. * sin(x) = x - x^3/3! + x^5/5! - ...
  7871. * |x| < pi/2
  7872. *
  7873. */
  7874. function sine(Ctor, x) {
  7875. var k,
  7876. len = x.d.length;
  7877. if (len < 3) {
  7878. return x.isZero() ? x : taylorSeries(Ctor, 2, x, x);
  7879. }
  7880. // Argument reduction: sin(5x) = 16*sin^5(x) - 20*sin^3(x) + 5*sin(x)
  7881. // i.e. sin(x) = 16*sin^5(x/5) - 20*sin^3(x/5) + 5*sin(x/5)
  7882. // and sin(x) = sin(x/5)(5 + sin^2(x/5)(16sin^2(x/5) - 20))
  7883. // Estimate the optimum number of times to use the argument reduction.
  7884. k = 1.4 * Math.sqrt(len);
  7885. k = k > 16 ? 16 : k | 0;
  7886. x = x.times(1 / tinyPow(5, k));
  7887. x = taylorSeries(Ctor, 2, x, x);
  7888. // Reverse argument reduction
  7889. var sin2_x,
  7890. d5 = new Ctor(5),
  7891. d16 = new Ctor(16),
  7892. d20 = new Ctor(20);
  7893. for (; k--;) {
  7894. sin2_x = x.times(x);
  7895. x = x.times(d5.plus(sin2_x.times(d16.times(sin2_x).minus(d20))));
  7896. }
  7897. return x;
  7898. }
  7899. // Calculate Taylor series for `cos`, `cosh`, `sin` and `sinh`.
  7900. function taylorSeries(Ctor, n, x, y, isHyperbolic) {
  7901. var j,t,u,x2,
  7902. i = 1,
  7903. pr = Ctor.precision,
  7904. k = Math.ceil(pr / LOG_BASE);
  7905. external = false;
  7906. x2 = x.times(x);
  7907. u = new Ctor(y);
  7908. for (;;) {
  7909. t = divide(u.times(x2), new Ctor(n++ * n++), pr, 1);
  7910. u = isHyperbolic ? y.plus(t) : y.minus(t);
  7911. y = divide(t.times(x2), new Ctor(n++ * n++), pr, 1);
  7912. t = u.plus(y);
  7913. if (t.d[k] !== void 0) {
  7914. for (j = k; t.d[j] === u.d[j] && j--;) {;}
  7915. if (j == -1) break;
  7916. }
  7917. j = u;
  7918. u = y;
  7919. y = t;
  7920. t = j;
  7921. i++;
  7922. }
  7923. external = true;
  7924. t.d.length = k + 1;
  7925. return t;
  7926. }
  7927. // Exponent e must be positive and non-zero.
  7928. function tinyPow(b, e) {
  7929. var n = b;
  7930. while (--e) {n *= b;}
  7931. return n;
  7932. }
  7933. // Return the absolute value of `x` reduced to less than or equal to half pi.
  7934. function toLessThanHalfPi(Ctor, x) {
  7935. var t,
  7936. isNeg = x.s < 0,
  7937. pi = getPi(Ctor, Ctor.precision, 1),
  7938. halfPi = pi.times(0.5);
  7939. x = x.abs();
  7940. if (x.lte(halfPi)) {
  7941. quadrant = isNeg ? 4 : 1;
  7942. return x;
  7943. }
  7944. t = x.divToInt(pi);
  7945. if (t.isZero()) {
  7946. quadrant = isNeg ? 3 : 2;
  7947. } else {
  7948. x = x.minus(t.times(pi));
  7949. // 0 <= x < pi
  7950. if (x.lte(halfPi)) {
  7951. quadrant = isOdd(t) ? isNeg ? 2 : 3 : isNeg ? 4 : 1;
  7952. return x;
  7953. }
  7954. quadrant = isOdd(t) ? isNeg ? 1 : 4 : isNeg ? 3 : 2;
  7955. }
  7956. return x.minus(pi).abs();
  7957. }
  7958. /*
  7959. * Return the value of Decimal `x` as a string in base `baseOut`.
  7960. *
  7961. * If the optional `sd` argument is present include a binary exponent suffix.
  7962. */
  7963. function toStringBinary(x, baseOut, sd, rm) {
  7964. var base,e,i,k,len,roundUp,str,xd,y,
  7965. Ctor = x.constructor,
  7966. isExp = sd !== void 0;
  7967. if (isExp) {
  7968. checkInt32(sd, 1, MAX_DIGITS);
  7969. if (rm === void 0) rm = Ctor.rounding;else
  7970. checkInt32(rm, 0, 8);
  7971. } else {
  7972. sd = Ctor.precision;
  7973. rm = Ctor.rounding;
  7974. }
  7975. if (!x.isFinite()) {
  7976. str = nonFiniteToString(x);
  7977. } else {
  7978. str = finiteToString(x);
  7979. i = str.indexOf('.');
  7980. // Use exponential notation according to `toExpPos` and `toExpNeg`? No, but if required:
  7981. // maxBinaryExponent = floor((decimalExponent + 1) * log[2](10))
  7982. // minBinaryExponent = floor(decimalExponent * log[2](10))
  7983. // log[2](10) = 3.321928094887362347870319429489390175864
  7984. if (isExp) {
  7985. base = 2;
  7986. if (baseOut == 16) {
  7987. sd = sd * 4 - 3;
  7988. } else if (baseOut == 8) {
  7989. sd = sd * 3 - 2;
  7990. }
  7991. } else {
  7992. base = baseOut;
  7993. }
  7994. // Convert the number as an integer then divide the result by its base raised to a power such
  7995. // that the fraction part will be restored.
  7996. // Non-integer.
  7997. if (i >= 0) {
  7998. str = str.replace('.', '');
  7999. y = new Ctor(1);
  8000. y.e = str.length - i;
  8001. y.d = convertBase(finiteToString(y), 10, base);
  8002. y.e = y.d.length;
  8003. }
  8004. xd = convertBase(str, 10, base);
  8005. e = len = xd.length;
  8006. // Remove trailing zeros.
  8007. for (; xd[--len] == 0;) {xd.pop();}
  8008. if (!xd[0]) {
  8009. str = isExp ? '0p+0' : '0';
  8010. } else {
  8011. if (i < 0) {
  8012. e--;
  8013. } else {
  8014. x = new Ctor(x);
  8015. x.d = xd;
  8016. x.e = e;
  8017. x = divide(x, y, sd, rm, 0, base);
  8018. xd = x.d;
  8019. e = x.e;
  8020. roundUp = inexact;
  8021. }
  8022. // The rounding digit, i.e. the digit after the digit that may be rounded up.
  8023. i = xd[sd];
  8024. k = base / 2;
  8025. roundUp = roundUp || xd[sd + 1] !== void 0;
  8026. roundUp = rm < 4 ?
  8027. (i !== void 0 || roundUp) && (rm === 0 || rm === (x.s < 0 ? 3 : 2)) :
  8028. i > k || i === k && (rm === 4 || roundUp || rm === 6 && xd[sd - 1] & 1 ||
  8029. rm === (x.s < 0 ? 8 : 7));
  8030. xd.length = sd;
  8031. if (roundUp) {
  8032. // Rounding up may mean the previous digit has to be rounded up and so on.
  8033. for (; ++xd[--sd] > base - 1;) {
  8034. xd[sd] = 0;
  8035. if (!sd) {
  8036. ++e;
  8037. xd.unshift(1);
  8038. }
  8039. }
  8040. }
  8041. // Determine trailing zeros.
  8042. for (len = xd.length; !xd[len - 1]; --len) {;}
  8043. // E.g. [4, 11, 15] becomes 4bf.
  8044. for (i = 0, str = ''; i < len; i++) {str += NUMERALS.charAt(xd[i]);}
  8045. // Add binary exponent suffix?
  8046. if (isExp) {
  8047. if (len > 1) {
  8048. if (baseOut == 16 || baseOut == 8) {
  8049. i = baseOut == 16 ? 4 : 3;
  8050. for (--len; len % i; len++) {str += '0';}
  8051. xd = convertBase(str, base, baseOut);
  8052. for (len = xd.length; !xd[len - 1]; --len) {;}
  8053. // xd[0] will always be be 1
  8054. for (i = 1, str = '1.'; i < len; i++) {str += NUMERALS.charAt(xd[i]);}
  8055. } else {
  8056. str = str.charAt(0) + '.' + str.slice(1);
  8057. }
  8058. }
  8059. str = str + (e < 0 ? 'p' : 'p+') + e;
  8060. } else if (e < 0) {
  8061. for (; ++e;) {str = '0' + str;}
  8062. str = '0.' + str;
  8063. } else {
  8064. if (++e > len) for (e -= len; e--;) {str += '0';} else
  8065. if (e < len) str = str.slice(0, e) + '.' + str.slice(e);
  8066. }
  8067. }
  8068. str = (baseOut == 16 ? '0x' : baseOut == 2 ? '0b' : baseOut == 8 ? '0o' : '') + str;
  8069. }
  8070. return x.s < 0 ? '-' + str : str;
  8071. }
  8072. // Does not strip trailing zeros.
  8073. function truncate(arr, len) {
  8074. if (arr.length > len) {
  8075. arr.length = len;
  8076. return true;
  8077. }
  8078. }
  8079. // Decimal methods
  8080. /*
  8081. * abs
  8082. * acos
  8083. * acosh
  8084. * add
  8085. * asin
  8086. * asinh
  8087. * atan
  8088. * atanh
  8089. * atan2
  8090. * cbrt
  8091. * ceil
  8092. * clamp
  8093. * clone
  8094. * config
  8095. * cos
  8096. * cosh
  8097. * div
  8098. * exp
  8099. * floor
  8100. * hypot
  8101. * ln
  8102. * log
  8103. * log2
  8104. * log10
  8105. * max
  8106. * min
  8107. * mod
  8108. * mul
  8109. * pow
  8110. * random
  8111. * round
  8112. * set
  8113. * sign
  8114. * sin
  8115. * sinh
  8116. * sqrt
  8117. * sub
  8118. * sum
  8119. * tan
  8120. * tanh
  8121. * trunc
  8122. */
  8123. /*
  8124. * Return a new Decimal whose value is the absolute value of `x`.
  8125. *
  8126. * x {number|string|Decimal}
  8127. *
  8128. */
  8129. function abs(x) {
  8130. return new this(x).abs();
  8131. }
  8132. /*
  8133. * Return a new Decimal whose value is the arccosine in radians of `x`.
  8134. *
  8135. * x {number|string|Decimal}
  8136. *
  8137. */
  8138. function acos(x) {
  8139. return new this(x).acos();
  8140. }
  8141. /*
  8142. * Return a new Decimal whose value is the inverse of the hyperbolic cosine of `x`, rounded to
  8143. * `precision` significant digits using rounding mode `rounding`.
  8144. *
  8145. * x {number|string|Decimal} A value in radians.
  8146. *
  8147. */
  8148. function acosh(x) {
  8149. return new this(x).acosh();
  8150. }
  8151. /*
  8152. * Return a new Decimal whose value is the sum of `x` and `y`, rounded to `precision` significant
  8153. * digits using rounding mode `rounding`.
  8154. *
  8155. * x {number|string|Decimal}
  8156. * y {number|string|Decimal}
  8157. *
  8158. */
  8159. function add(x, y) {
  8160. return new this(x).plus(y);
  8161. }
  8162. /*
  8163. * Return a new Decimal whose value is the arcsine in radians of `x`, rounded to `precision`
  8164. * significant digits using rounding mode `rounding`.
  8165. *
  8166. * x {number|string|Decimal}
  8167. *
  8168. */
  8169. function asin(x) {
  8170. return new this(x).asin();
  8171. }
  8172. /*
  8173. * Return a new Decimal whose value is the inverse of the hyperbolic sine of `x`, rounded to
  8174. * `precision` significant digits using rounding mode `rounding`.
  8175. *
  8176. * x {number|string|Decimal} A value in radians.
  8177. *
  8178. */
  8179. function asinh(x) {
  8180. return new this(x).asinh();
  8181. }
  8182. /*
  8183. * Return a new Decimal whose value is the arctangent in radians of `x`, rounded to `precision`
  8184. * significant digits using rounding mode `rounding`.
  8185. *
  8186. * x {number|string|Decimal}
  8187. *
  8188. */
  8189. function atan(x) {
  8190. return new this(x).atan();
  8191. }
  8192. /*
  8193. * Return a new Decimal whose value is the inverse of the hyperbolic tangent of `x`, rounded to
  8194. * `precision` significant digits using rounding mode `rounding`.
  8195. *
  8196. * x {number|string|Decimal} A value in radians.
  8197. *
  8198. */
  8199. function atanh(x) {
  8200. return new this(x).atanh();
  8201. }
  8202. /*
  8203. * Return a new Decimal whose value is the arctangent in radians of `y/x` in the range -pi to pi
  8204. * (inclusive), rounded to `precision` significant digits using rounding mode `rounding`.
  8205. *
  8206. * Domain: [-Infinity, Infinity]
  8207. * Range: [-pi, pi]
  8208. *
  8209. * y {number|string|Decimal} The y-coordinate.
  8210. * x {number|string|Decimal} The x-coordinate.
  8211. *
  8212. * atan2(±0, -0) = ±pi
  8213. * atan2(±0, +0) = ±0
  8214. * atan2(±0, -x) = ±pi for x > 0
  8215. * atan2(±0, x) = ±0 for x > 0
  8216. * atan2(-y, ±0) = -pi/2 for y > 0
  8217. * atan2(y, ±0) = pi/2 for y > 0
  8218. * atan2(±y, -Infinity) = ±pi for finite y > 0
  8219. * atan2(±y, +Infinity) = ±0 for finite y > 0
  8220. * atan2(±Infinity, x) = ±pi/2 for finite x
  8221. * atan2(±Infinity, -Infinity) = ±3*pi/4
  8222. * atan2(±Infinity, +Infinity) = ±pi/4
  8223. * atan2(NaN, x) = NaN
  8224. * atan2(y, NaN) = NaN
  8225. *
  8226. */
  8227. function atan2(y, x) {
  8228. y = new this(y);
  8229. x = new this(x);
  8230. var r,
  8231. pr = this.precision,
  8232. rm = this.rounding,
  8233. wpr = pr + 4;
  8234. // Either NaN
  8235. if (!y.s || !x.s) {
  8236. r = new this(NaN);
  8237. // Both ±Infinity
  8238. } else if (!y.d && !x.d) {
  8239. r = getPi(this, wpr, 1).times(x.s > 0 ? 0.25 : 0.75);
  8240. r.s = y.s;
  8241. // x is ±Infinity or y is ±0
  8242. } else if (!x.d || y.isZero()) {
  8243. r = x.s < 0 ? getPi(this, pr, rm) : new this(0);
  8244. r.s = y.s;
  8245. // y is ±Infinity or x is ±0
  8246. } else if (!y.d || x.isZero()) {
  8247. r = getPi(this, wpr, 1).times(0.5);
  8248. r.s = y.s;
  8249. // Both non-zero and finite
  8250. } else if (x.s < 0) {
  8251. this.precision = wpr;
  8252. this.rounding = 1;
  8253. r = this.atan(divide(y, x, wpr, 1));
  8254. x = getPi(this, wpr, 1);
  8255. this.precision = pr;
  8256. this.rounding = rm;
  8257. r = y.s < 0 ? r.minus(x) : r.plus(x);
  8258. } else {
  8259. r = this.atan(divide(y, x, wpr, 1));
  8260. }
  8261. return r;
  8262. }
  8263. /*
  8264. * Return a new Decimal whose value is the cube root of `x`, rounded to `precision` significant
  8265. * digits using rounding mode `rounding`.
  8266. *
  8267. * x {number|string|Decimal}
  8268. *
  8269. */
  8270. function cbrt(x) {
  8271. return new this(x).cbrt();
  8272. }
  8273. /*
  8274. * Return a new Decimal whose value is `x` rounded to an integer using `ROUND_CEIL`.
  8275. *
  8276. * x {number|string|Decimal}
  8277. *
  8278. */
  8279. function ceil(x) {
  8280. return finalise(x = new this(x), x.e + 1, 2);
  8281. }
  8282. /*
  8283. * Return a new Decimal whose value is `x` clamped to the range delineated by `min` and `max`.
  8284. *
  8285. * x {number|string|Decimal}
  8286. * min {number|string|Decimal}
  8287. * max {number|string|Decimal}
  8288. *
  8289. */
  8290. function clamp(x, min, max) {
  8291. return new this(x).clamp(min, max);
  8292. }
  8293. /*
  8294. * Configure global settings for a Decimal constructor.
  8295. *
  8296. * `obj` is an object with one or more of the following properties,
  8297. *
  8298. * precision {number}
  8299. * rounding {number}
  8300. * toExpNeg {number}
  8301. * toExpPos {number}
  8302. * maxE {number}
  8303. * minE {number}
  8304. * modulo {number}
  8305. * crypto {boolean|number}
  8306. * defaults {true}
  8307. *
  8308. * E.g. Decimal.config({ precision: 20, rounding: 4 })
  8309. *
  8310. */
  8311. function config(obj) {
  8312. if (!obj || typeof obj !== 'object') throw Error(decimalError + 'Object expected');
  8313. var i,p,v,
  8314. useDefaults = obj.defaults === true,
  8315. ps = [
  8316. 'precision', 1, MAX_DIGITS,
  8317. 'rounding', 0, 8,
  8318. 'toExpNeg', -EXP_LIMIT, 0,
  8319. 'toExpPos', 0, EXP_LIMIT,
  8320. 'maxE', 0, EXP_LIMIT,
  8321. 'minE', -EXP_LIMIT, 0,
  8322. 'modulo', 0, 9];
  8323. for (i = 0; i < ps.length; i += 3) {
  8324. if (p = ps[i], useDefaults) this[p] = DEFAULTS[p];
  8325. if ((v = obj[p]) !== void 0) {
  8326. if (mathfloor(v) === v && v >= ps[i + 1] && v <= ps[i + 2]) this[p] = v;else
  8327. throw Error(invalidArgument + p + ': ' + v);
  8328. }
  8329. }
  8330. if (p = 'crypto', useDefaults) this[p] = DEFAULTS[p];
  8331. if ((v = obj[p]) !== void 0) {
  8332. if (v === true || v === false || v === 0 || v === 1) {
  8333. if (v) {
  8334. if (typeof crypto != 'undefined' && crypto && (
  8335. crypto.getRandomValues || crypto.randomBytes)) {
  8336. this[p] = true;
  8337. } else {
  8338. throw Error(cryptoUnavailable);
  8339. }
  8340. } else {
  8341. this[p] = false;
  8342. }
  8343. } else {
  8344. throw Error(invalidArgument + p + ': ' + v);
  8345. }
  8346. }
  8347. return this;
  8348. }
  8349. /*
  8350. * Return a new Decimal whose value is the cosine of `x`, rounded to `precision` significant
  8351. * digits using rounding mode `rounding`.
  8352. *
  8353. * x {number|string|Decimal} A value in radians.
  8354. *
  8355. */
  8356. function cos(x) {
  8357. return new this(x).cos();
  8358. }
  8359. /*
  8360. * Return a new Decimal whose value is the hyperbolic cosine of `x`, rounded to precision
  8361. * significant digits using rounding mode `rounding`.
  8362. *
  8363. * x {number|string|Decimal} A value in radians.
  8364. *
  8365. */
  8366. function cosh(x) {
  8367. return new this(x).cosh();
  8368. }
  8369. /*
  8370. * Create and return a Decimal constructor with the same configuration properties as this Decimal
  8371. * constructor.
  8372. *
  8373. */
  8374. function clone(obj) {
  8375. var i, p, ps;
  8376. /*
  8377. * The Decimal constructor and exported function.
  8378. * Return a new Decimal instance.
  8379. *
  8380. * v {number|string|Decimal} A numeric value.
  8381. *
  8382. */
  8383. function Decimal(v) {
  8384. var e,i,t,
  8385. x = this;
  8386. // Decimal called without new.
  8387. if (!(x instanceof Decimal)) return new Decimal(v);
  8388. // Retain a reference to this Decimal constructor, and shadow Decimal.prototype.constructor
  8389. // which points to Object.
  8390. x.constructor = Decimal;
  8391. // Duplicate.
  8392. if (isDecimalInstance(v)) {
  8393. x.s = v.s;
  8394. if (external) {
  8395. if (!v.d || v.e > Decimal.maxE) {
  8396. // Infinity.
  8397. x.e = NaN;
  8398. x.d = null;
  8399. } else if (v.e < Decimal.minE) {
  8400. // Zero.
  8401. x.e = 0;
  8402. x.d = [0];
  8403. } else {
  8404. x.e = v.e;
  8405. x.d = v.d.slice();
  8406. }
  8407. } else {
  8408. x.e = v.e;
  8409. x.d = v.d ? v.d.slice() : v.d;
  8410. }
  8411. return;
  8412. }
  8413. t = typeof v;
  8414. if (t === 'number') {
  8415. if (v === 0) {
  8416. x.s = 1 / v < 0 ? -1 : 1;
  8417. x.e = 0;
  8418. x.d = [0];
  8419. return;
  8420. }
  8421. if (v < 0) {
  8422. v = -v;
  8423. x.s = -1;
  8424. } else {
  8425. x.s = 1;
  8426. }
  8427. // Fast path for small integers.
  8428. if (v === ~~v && v < 1e7) {
  8429. for (e = 0, i = v; i >= 10; i /= 10) {e++;}
  8430. if (external) {
  8431. if (e > Decimal.maxE) {
  8432. x.e = NaN;
  8433. x.d = null;
  8434. } else if (e < Decimal.minE) {
  8435. x.e = 0;
  8436. x.d = [0];
  8437. } else {
  8438. x.e = e;
  8439. x.d = [v];
  8440. }
  8441. } else {
  8442. x.e = e;
  8443. x.d = [v];
  8444. }
  8445. return;
  8446. // Infinity, NaN.
  8447. } else if (v * 0 !== 0) {
  8448. if (!v) x.s = NaN;
  8449. x.e = NaN;
  8450. x.d = null;
  8451. return;
  8452. }
  8453. return parseDecimal(x, v.toString());
  8454. } else if (t !== 'string') {
  8455. throw Error(invalidArgument + v);
  8456. }
  8457. // Minus sign?
  8458. if ((i = v.charCodeAt(0)) === 45) {
  8459. v = v.slice(1);
  8460. x.s = -1;
  8461. } else {
  8462. // Plus sign?
  8463. if (i === 43) v = v.slice(1);
  8464. x.s = 1;
  8465. }
  8466. return isDecimal.test(v) ? parseDecimal(x, v) : parseOther(x, v);
  8467. }
  8468. Decimal.prototype = P;
  8469. Decimal.ROUND_UP = 0;
  8470. Decimal.ROUND_DOWN = 1;
  8471. Decimal.ROUND_CEIL = 2;
  8472. Decimal.ROUND_FLOOR = 3;
  8473. Decimal.ROUND_HALF_UP = 4;
  8474. Decimal.ROUND_HALF_DOWN = 5;
  8475. Decimal.ROUND_HALF_EVEN = 6;
  8476. Decimal.ROUND_HALF_CEIL = 7;
  8477. Decimal.ROUND_HALF_FLOOR = 8;
  8478. Decimal.EUCLID = 9;
  8479. Decimal.config = Decimal.set = config;
  8480. Decimal.clone = clone;
  8481. Decimal.isDecimal = isDecimalInstance;
  8482. Decimal.abs = abs;
  8483. Decimal.acos = acos;
  8484. Decimal.acosh = acosh; // ES6
  8485. Decimal.add = add;
  8486. Decimal.asin = asin;
  8487. Decimal.asinh = asinh; // ES6
  8488. Decimal.atan = atan;
  8489. Decimal.atanh = atanh; // ES6
  8490. Decimal.atan2 = atan2;
  8491. Decimal.cbrt = cbrt; // ES6
  8492. Decimal.ceil = ceil;
  8493. Decimal.clamp = clamp;
  8494. Decimal.cos = cos;
  8495. Decimal.cosh = cosh; // ES6
  8496. Decimal.div = div;
  8497. Decimal.exp = exp;
  8498. Decimal.floor = floor;
  8499. Decimal.hypot = hypot; // ES6
  8500. Decimal.ln = ln;
  8501. Decimal.log = log;
  8502. Decimal.log10 = log10; // ES6
  8503. Decimal.log2 = log2; // ES6
  8504. Decimal.max = max;
  8505. Decimal.min = min;
  8506. Decimal.mod = mod;
  8507. Decimal.mul = mul;
  8508. Decimal.pow = pow;
  8509. Decimal.random = random;
  8510. Decimal.round = round;
  8511. Decimal.sign = sign; // ES6
  8512. Decimal.sin = sin;
  8513. Decimal.sinh = sinh; // ES6
  8514. Decimal.sqrt = sqrt;
  8515. Decimal.sub = sub;
  8516. Decimal.sum = sum;
  8517. Decimal.tan = tan;
  8518. Decimal.tanh = tanh; // ES6
  8519. Decimal.trunc = trunc; // ES6
  8520. if (obj === void 0) obj = {};
  8521. if (obj) {
  8522. if (obj.defaults !== true) {
  8523. ps = ['precision', 'rounding', 'toExpNeg', 'toExpPos', 'maxE', 'minE', 'modulo', 'crypto'];
  8524. for (i = 0; i < ps.length;) {if (!obj.hasOwnProperty(p = ps[i++])) obj[p] = this[p];}
  8525. }
  8526. }
  8527. Decimal.config(obj);
  8528. return Decimal;
  8529. }
  8530. /*
  8531. * Return a new Decimal whose value is `x` divided by `y`, rounded to `precision` significant
  8532. * digits using rounding mode `rounding`.
  8533. *
  8534. * x {number|string|Decimal}
  8535. * y {number|string|Decimal}
  8536. *
  8537. */
  8538. function div(x, y) {
  8539. return new this(x).div(y);
  8540. }
  8541. /*
  8542. * Return a new Decimal whose value is the natural exponential of `x`, rounded to `precision`
  8543. * significant digits using rounding mode `rounding`.
  8544. *
  8545. * x {number|string|Decimal} The power to which to raise the base of the natural log.
  8546. *
  8547. */
  8548. function exp(x) {
  8549. return new this(x).exp();
  8550. }
  8551. /*
  8552. * Return a new Decimal whose value is `x` round to an integer using `ROUND_FLOOR`.
  8553. *
  8554. * x {number|string|Decimal}
  8555. *
  8556. */
  8557. function floor(x) {
  8558. return finalise(x = new this(x), x.e + 1, 3);
  8559. }
  8560. /*
  8561. * Return a new Decimal whose value is the square root of the sum of the squares of the arguments,
  8562. * rounded to `precision` significant digits using rounding mode `rounding`.
  8563. *
  8564. * hypot(a, b, ...) = sqrt(a^2 + b^2 + ...)
  8565. *
  8566. * arguments {number|string|Decimal}
  8567. *
  8568. */
  8569. function hypot() {
  8570. var i,n,
  8571. t = new this(0);
  8572. external = false;
  8573. for (i = 0; i < arguments.length;) {
  8574. n = new this(arguments[i++]);
  8575. if (!n.d) {
  8576. if (n.s) {
  8577. external = true;
  8578. return new this(1 / 0);
  8579. }
  8580. t = n;
  8581. } else if (t.d) {
  8582. t = t.plus(n.times(n));
  8583. }
  8584. }
  8585. external = true;
  8586. return t.sqrt();
  8587. }
  8588. /*
  8589. * Return true if object is a Decimal instance (where Decimal is any Decimal constructor),
  8590. * otherwise return false.
  8591. *
  8592. */
  8593. function isDecimalInstance(obj) {
  8594. return obj instanceof Decimal || obj && obj.toStringTag === tag || false;
  8595. }
  8596. /*
  8597. * Return a new Decimal whose value is the natural logarithm of `x`, rounded to `precision`
  8598. * significant digits using rounding mode `rounding`.
  8599. *
  8600. * x {number|string|Decimal}
  8601. *
  8602. */
  8603. function ln(x) {
  8604. return new this(x).ln();
  8605. }
  8606. /*
  8607. * Return a new Decimal whose value is the log of `x` to the base `y`, or to base 10 if no base
  8608. * is specified, rounded to `precision` significant digits using rounding mode `rounding`.
  8609. *
  8610. * log[y](x)
  8611. *
  8612. * x {number|string|Decimal} The argument of the logarithm.
  8613. * y {number|string|Decimal} The base of the logarithm.
  8614. *
  8615. */
  8616. function log(x, y) {
  8617. return new this(x).log(y);
  8618. }
  8619. /*
  8620. * Return a new Decimal whose value is the base 2 logarithm of `x`, rounded to `precision`
  8621. * significant digits using rounding mode `rounding`.
  8622. *
  8623. * x {number|string|Decimal}
  8624. *
  8625. */
  8626. function log2(x) {
  8627. return new this(x).log(2);
  8628. }
  8629. /*
  8630. * Return a new Decimal whose value is the base 10 logarithm of `x`, rounded to `precision`
  8631. * significant digits using rounding mode `rounding`.
  8632. *
  8633. * x {number|string|Decimal}
  8634. *
  8635. */
  8636. function log10(x) {
  8637. return new this(x).log(10);
  8638. }
  8639. /*
  8640. * Return a new Decimal whose value is the maximum of the arguments.
  8641. *
  8642. * arguments {number|string|Decimal}
  8643. *
  8644. */
  8645. function max() {
  8646. return maxOrMin(this, arguments, 'lt');
  8647. }
  8648. /*
  8649. * Return a new Decimal whose value is the minimum of the arguments.
  8650. *
  8651. * arguments {number|string|Decimal}
  8652. *
  8653. */
  8654. function min() {
  8655. return maxOrMin(this, arguments, 'gt');
  8656. }
  8657. /*
  8658. * Return a new Decimal whose value is `x` modulo `y`, rounded to `precision` significant digits
  8659. * using rounding mode `rounding`.
  8660. *
  8661. * x {number|string|Decimal}
  8662. * y {number|string|Decimal}
  8663. *
  8664. */
  8665. function mod(x, y) {
  8666. return new this(x).mod(y);
  8667. }
  8668. /*
  8669. * Return a new Decimal whose value is `x` multiplied by `y`, rounded to `precision` significant
  8670. * digits using rounding mode `rounding`.
  8671. *
  8672. * x {number|string|Decimal}
  8673. * y {number|string|Decimal}
  8674. *
  8675. */
  8676. function mul(x, y) {
  8677. return new this(x).mul(y);
  8678. }
  8679. /*
  8680. * Return a new Decimal whose value is `x` raised to the power `y`, rounded to precision
  8681. * significant digits using rounding mode `rounding`.
  8682. *
  8683. * x {number|string|Decimal} The base.
  8684. * y {number|string|Decimal} The exponent.
  8685. *
  8686. */
  8687. function pow(x, y) {
  8688. return new this(x).pow(y);
  8689. }
  8690. /*
  8691. * Returns a new Decimal with a random value equal to or greater than 0 and less than 1, and with
  8692. * `sd`, or `Decimal.precision` if `sd` is omitted, significant digits (or less if trailing zeros
  8693. * are produced).
  8694. *
  8695. * [sd] {number} Significant digits. Integer, 0 to MAX_DIGITS inclusive.
  8696. *
  8697. */
  8698. function random(sd) {
  8699. var d,e,k,n,
  8700. i = 0,
  8701. r = new this(1),
  8702. rd = [];
  8703. if (sd === void 0) sd = this.precision;else
  8704. checkInt32(sd, 1, MAX_DIGITS);
  8705. k = Math.ceil(sd / LOG_BASE);
  8706. if (!this.crypto) {
  8707. for (; i < k;) {rd[i++] = Math.random() * 1e7 | 0;}
  8708. // Browsers supporting crypto.getRandomValues.
  8709. } else if (crypto.getRandomValues) {
  8710. d = crypto.getRandomValues(new Uint32Array(k));
  8711. for (; i < k;) {
  8712. n = d[i];
  8713. // 0 <= n < 4294967296
  8714. // Probability n >= 4.29e9, is 4967296 / 4294967296 = 0.00116 (1 in 865).
  8715. if (n >= 4.29e9) {
  8716. d[i] = crypto.getRandomValues(new Uint32Array(1))[0];
  8717. } else {
  8718. // 0 <= n <= 4289999999
  8719. // 0 <= (n % 1e7) <= 9999999
  8720. rd[i++] = n % 1e7;
  8721. }
  8722. }
  8723. // Node.js supporting crypto.randomBytes.
  8724. } else if (crypto.randomBytes) {
  8725. // buffer
  8726. d = crypto.randomBytes(k *= 4);
  8727. for (; i < k;) {
  8728. // 0 <= n < 2147483648
  8729. n = d[i] + (d[i + 1] << 8) + (d[i + 2] << 16) + ((d[i + 3] & 0x7f) << 24);
  8730. // Probability n >= 2.14e9, is 7483648 / 2147483648 = 0.0035 (1 in 286).
  8731. if (n >= 2.14e9) {
  8732. crypto.randomBytes(4).copy(d, i);
  8733. } else {
  8734. // 0 <= n <= 2139999999
  8735. // 0 <= (n % 1e7) <= 9999999
  8736. rd.push(n % 1e7);
  8737. i += 4;
  8738. }
  8739. }
  8740. i = k / 4;
  8741. } else {
  8742. throw Error(cryptoUnavailable);
  8743. }
  8744. k = rd[--i];
  8745. sd %= LOG_BASE;
  8746. // Convert trailing digits to zeros according to sd.
  8747. if (k && sd) {
  8748. n = mathpow(10, LOG_BASE - sd);
  8749. rd[i] = (k / n | 0) * n;
  8750. }
  8751. // Remove trailing words which are zero.
  8752. for (; rd[i] === 0; i--) {rd.pop();}
  8753. // Zero?
  8754. if (i < 0) {
  8755. e = 0;
  8756. rd = [0];
  8757. } else {
  8758. e = -1;
  8759. // Remove leading words which are zero and adjust exponent accordingly.
  8760. for (; rd[0] === 0; e -= LOG_BASE) {rd.shift();}
  8761. // Count the digits of the first word of rd to determine leading zeros.
  8762. for (k = 1, n = rd[0]; n >= 10; n /= 10) {k++;}
  8763. // Adjust the exponent for leading zeros of the first word of rd.
  8764. if (k < LOG_BASE) e -= LOG_BASE - k;
  8765. }
  8766. r.e = e;
  8767. r.d = rd;
  8768. return r;
  8769. }
  8770. /*
  8771. * Return a new Decimal whose value is `x` rounded to an integer using rounding mode `rounding`.
  8772. *
  8773. * To emulate `Math.round`, set rounding to 7 (ROUND_HALF_CEIL).
  8774. *
  8775. * x {number|string|Decimal}
  8776. *
  8777. */
  8778. function round(x) {
  8779. return finalise(x = new this(x), x.e + 1, this.rounding);
  8780. }
  8781. /*
  8782. * Return
  8783. * 1 if x > 0,
  8784. * -1 if x < 0,
  8785. * 0 if x is 0,
  8786. * -0 if x is -0,
  8787. * NaN otherwise
  8788. *
  8789. * x {number|string|Decimal}
  8790. *
  8791. */
  8792. function sign(x) {
  8793. x = new this(x);
  8794. return x.d ? x.d[0] ? x.s : 0 * x.s : x.s || NaN;
  8795. }
  8796. /*
  8797. * Return a new Decimal whose value is the sine of `x`, rounded to `precision` significant digits
  8798. * using rounding mode `rounding`.
  8799. *
  8800. * x {number|string|Decimal} A value in radians.
  8801. *
  8802. */
  8803. function sin(x) {
  8804. return new this(x).sin();
  8805. }
  8806. /*
  8807. * Return a new Decimal whose value is the hyperbolic sine of `x`, rounded to `precision`
  8808. * significant digits using rounding mode `rounding`.
  8809. *
  8810. * x {number|string|Decimal} A value in radians.
  8811. *
  8812. */
  8813. function sinh(x) {
  8814. return new this(x).sinh();
  8815. }
  8816. /*
  8817. * Return a new Decimal whose value is the square root of `x`, rounded to `precision` significant
  8818. * digits using rounding mode `rounding`.
  8819. *
  8820. * x {number|string|Decimal}
  8821. *
  8822. */
  8823. function sqrt(x) {
  8824. return new this(x).sqrt();
  8825. }
  8826. /*
  8827. * Return a new Decimal whose value is `x` minus `y`, rounded to `precision` significant digits
  8828. * using rounding mode `rounding`.
  8829. *
  8830. * x {number|string|Decimal}
  8831. * y {number|string|Decimal}
  8832. *
  8833. */
  8834. function sub(x, y) {
  8835. return new this(x).sub(y);
  8836. }
  8837. /*
  8838. * Return a new Decimal whose value is the sum of the arguments, rounded to `precision`
  8839. * significant digits using rounding mode `rounding`.
  8840. *
  8841. * Only the result is rounded, not the intermediate calculations.
  8842. *
  8843. * arguments {number|string|Decimal}
  8844. *
  8845. */
  8846. function sum() {
  8847. var i = 0,
  8848. args = arguments,
  8849. x = new this(args[i]);
  8850. external = false;
  8851. for (; x.s && ++i < args.length;) {x = x.plus(args[i]);}
  8852. external = true;
  8853. return finalise(x, this.precision, this.rounding);
  8854. }
  8855. /*
  8856. * Return a new Decimal whose value is the tangent of `x`, rounded to `precision` significant
  8857. * digits using rounding mode `rounding`.
  8858. *
  8859. * x {number|string|Decimal} A value in radians.
  8860. *
  8861. */
  8862. function tan(x) {
  8863. return new this(x).tan();
  8864. }
  8865. /*
  8866. * Return a new Decimal whose value is the hyperbolic tangent of `x`, rounded to `precision`
  8867. * significant digits using rounding mode `rounding`.
  8868. *
  8869. * x {number|string|Decimal} A value in radians.
  8870. *
  8871. */
  8872. function tanh(x) {
  8873. return new this(x).tanh();
  8874. }
  8875. /*
  8876. * Return a new Decimal whose value is `x` truncated to an integer.
  8877. *
  8878. * x {number|string|Decimal}
  8879. *
  8880. */
  8881. function trunc(x) {
  8882. return finalise(x = new this(x), x.e + 1, 1);
  8883. }
  8884. // Create and configure initial Decimal constructor.
  8885. Decimal = clone(DEFAULTS);
  8886. Decimal.prototype.constructor = Decimal;
  8887. Decimal['default'] = Decimal.Decimal = Decimal;
  8888. // Create the internal constants from their string values.
  8889. LN10 = new Decimal(LN10);
  8890. PI = new Decimal(PI);
  8891. // Export.
  8892. // AMD.
  8893. if (true) {
  8894. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {
  8895. return Decimal;
  8896. }).call(exports, __webpack_require__, exports, module),
  8897. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  8898. // Node and other environments that support module.exports.
  8899. } else {}
  8900. })(this);
  8901. /***/ }),
  8902. /***/ 2:
  8903. /*!***********************************!*\
  8904. !*** (webpack)/buildin/global.js ***!
  8905. \***********************************/
  8906. /*! no static exports found */
  8907. /***/ (function(module, exports) {
  8908. var g;
  8909. // This works in non-strict mode
  8910. g = (function() {
  8911. return this;
  8912. })();
  8913. try {
  8914. // This works if eval is allowed (see CSP)
  8915. g = g || new Function("return this")();
  8916. } catch (e) {
  8917. // This works if the window reference is available
  8918. if (typeof window === "object") g = window;
  8919. }
  8920. // g can still be undefined, but nothing to do about it...
  8921. // We return undefined, instead of nothing here, so it's
  8922. // easier to handle this case. if(!global) { ...}
  8923. module.exports = g;
  8924. /***/ }),
  8925. /***/ 217:
  8926. /*!************************************************************************************************!*\
  8927. !*** E:/project/新耗材小程序/material_applet/uni_modules/uni-forms/components/uni-forms/validate.js ***!
  8928. \************************************************************************************************/
  8929. /*! no static exports found */
  8930. /***/ (function(module, exports, __webpack_require__) {
  8931. "use strict";
  8932. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _regenerator = _interopRequireDefault(__webpack_require__(/*! ./node_modules/@babel/runtime/regenerator */ 9));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function _inherits(subClass, superClass) {if (typeof superClass !== "function" && superClass !== null) {throw new TypeError("Super expression must either be null or a function");}subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });if (superClass) _setPrototypeOf(subClass, superClass);}function _setPrototypeOf(o, p) {_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {o.__proto__ = p;return o;};return _setPrototypeOf(o, p);}function _createSuper(Derived) {var hasNativeReflectConstruct = _isNativeReflectConstruct();return function _createSuperInternal() {var Super = _getPrototypeOf(Derived),result;if (hasNativeReflectConstruct) {var NewTarget = _getPrototypeOf(this).constructor;result = Reflect.construct(Super, arguments, NewTarget);} else {result = Super.apply(this, arguments);}return _possibleConstructorReturn(this, result);};}function _possibleConstructorReturn(self, call) {if (call && (typeof call === "object" || typeof call === "function")) {return call;}return _assertThisInitialized(self);}function _assertThisInitialized(self) {if (self === void 0) {throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct() {if (typeof Reflect === "undefined" || !Reflect.construct) return false;if (Reflect.construct.sham) return false;if (typeof Proxy === "function") return true;try {Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));return true;} catch (e) {return false;}}function _getPrototypeOf(o) {_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {return o.__proto__ || Object.getPrototypeOf(o);};return _getPrototypeOf(o);}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;}var pattern = {
  8933. email: /^\S+?@\S+?\.\S+?$/,
  8934. idcard: /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
  8935. url: new RegExp(
  8936. "^(?!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]*)?$",
  8937. 'i') };
  8938. var FORMAT_MAPPING = {
  8939. "int": 'integer',
  8940. "bool": 'boolean',
  8941. "double": 'number',
  8942. "long": 'number',
  8943. "password": 'string'
  8944. // "fileurls": 'array'
  8945. };
  8946. function formatMessage(args) {var resources = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
  8947. var defaultMessage = ['label'];
  8948. defaultMessage.forEach(function (item) {
  8949. if (args[item] === undefined) {
  8950. args[item] = '';
  8951. }
  8952. });
  8953. var str = resources;
  8954. for (var key in args) {
  8955. var reg = new RegExp('{' + key + '}');
  8956. str = str.replace(reg, args[key]);
  8957. }
  8958. return str;
  8959. }
  8960. function isEmptyValue(value, type) {
  8961. if (value === undefined || value === null) {
  8962. return true;
  8963. }
  8964. if (typeof value === 'string' && !value) {
  8965. return true;
  8966. }
  8967. if (Array.isArray(value) && !value.length) {
  8968. return true;
  8969. }
  8970. if (type === 'object' && !Object.keys(value).length) {
  8971. return true;
  8972. }
  8973. return false;
  8974. }
  8975. var types = {
  8976. integer: function integer(value) {
  8977. return types.number(value) && parseInt(value, 10) === value;
  8978. },
  8979. string: function string(value) {
  8980. return typeof value === 'string';
  8981. },
  8982. number: function number(value) {
  8983. if (isNaN(value)) {
  8984. return false;
  8985. }
  8986. return typeof value === 'number';
  8987. },
  8988. "boolean": function boolean(value) {
  8989. return typeof value === 'boolean';
  8990. },
  8991. "float": function float(value) {
  8992. return types.number(value) && !types.integer(value);
  8993. },
  8994. array: function array(value) {
  8995. return Array.isArray(value);
  8996. },
  8997. object: function object(value) {
  8998. return typeof value === 'object' && !types.array(value);
  8999. },
  9000. date: function date(value) {
  9001. return value instanceof Date;
  9002. },
  9003. timestamp: function timestamp(value) {
  9004. if (!this.integer(value) || Math.abs(value).toString().length > 16) {
  9005. return false;
  9006. }
  9007. return true;
  9008. },
  9009. file: function file(value) {
  9010. return typeof value.url === 'string';
  9011. },
  9012. email: function email(value) {
  9013. return typeof value === 'string' && !!value.match(pattern.email) && value.length < 255;
  9014. },
  9015. url: function url(value) {
  9016. return typeof value === 'string' && !!value.match(pattern.url);
  9017. },
  9018. pattern: function pattern(reg, value) {
  9019. try {
  9020. return new RegExp(reg).test(value);
  9021. } catch (e) {
  9022. return false;
  9023. }
  9024. },
  9025. method: function method(value) {
  9026. return typeof value === 'function';
  9027. },
  9028. idcard: function idcard(value) {
  9029. return typeof value === 'string' && !!value.match(pattern.idcard);
  9030. },
  9031. 'url-https': function urlHttps(value) {
  9032. return this.url(value) && value.startsWith('https://');
  9033. },
  9034. 'url-scheme': function urlScheme(value) {
  9035. return value.startsWith('://');
  9036. },
  9037. 'url-web': function urlWeb(value) {
  9038. return false;
  9039. } };var
  9040. RuleValidator = /*#__PURE__*/function () {
  9041. function RuleValidator(message) {_classCallCheck(this, RuleValidator);
  9042. this._message = message;
  9043. }_createClass(RuleValidator, [{ key: "validateRule", value: function () {var _validateRule = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee(
  9044. fieldKey, fieldValue, value, data, allData) {var result, rules, hasRequired, message, i, rule, vt, now, resultExpr;return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:
  9045. result = null;
  9046. rules = fieldValue.rules;
  9047. hasRequired = rules.findIndex(function (item) {
  9048. return item.required;
  9049. });if (!(
  9050. hasRequired < 0)) {_context.next = 8;break;}if (!(
  9051. value === null || value === undefined)) {_context.next = 6;break;}return _context.abrupt("return",
  9052. result);case 6:if (!(
  9053. typeof value === 'string' && !value.length)) {_context.next = 8;break;}return _context.abrupt("return",
  9054. result);case 8:
  9055. message = this._message;if (!(
  9056. rules === undefined)) {_context.next = 11;break;}return _context.abrupt("return",
  9057. message['default']);case 11:
  9058. i = 0;case 12:if (!(i < rules.length)) {_context.next = 35;break;}
  9059. rule = rules[i];
  9060. vt = this._getValidateType(rule);
  9061. Object.assign(rule, {
  9062. label: fieldValue.label || "[\"".concat(fieldKey, "\"]") });if (!
  9063. RuleValidatorHelper[vt]) {_context.next = 20;break;}
  9064. result = RuleValidatorHelper[vt](rule, value, message);if (!(
  9065. result != null)) {_context.next = 20;break;}return _context.abrupt("break", 35);case 20:if (!
  9066. rule.validateExpr) {_context.next = 26;break;}
  9067. now = Date.now();
  9068. resultExpr = rule.validateExpr(value, allData, now);if (!(
  9069. resultExpr === false)) {_context.next = 26;break;}
  9070. result = this._getMessage(rule, rule.errorMessage || this._message['default']);return _context.abrupt("break", 35);case 26:if (!
  9071. rule.validateFunction) {_context.next = 32;break;}_context.next = 29;return (
  9072. this.validateFunction(rule, value, data, allData, vt));case 29:result = _context.sent;if (!(
  9073. result !== null)) {_context.next = 32;break;}return _context.abrupt("break", 35);case 32:i++;_context.next = 12;break;case 35:
  9074. if (result !== null) {
  9075. result = message.TAG + result;
  9076. }return _context.abrupt("return",
  9077. result);case 37:case "end":return _context.stop();}}}, _callee, this);}));function validateRule(_x, _x2, _x3, _x4, _x5) {return _validateRule.apply(this, arguments);}return validateRule;}() }, { key: "validateFunction", value: function () {var _validateFunction = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee2(
  9078. rule, value, data, allData, vt) {var result, callbackMessage, res;return _regenerator.default.wrap(function _callee2$(_context2) {while (1) {switch (_context2.prev = _context2.next) {case 0:
  9079. result = null;_context2.prev = 1;
  9080. callbackMessage = null;_context2.next = 5;return (
  9081. rule.validateFunction(rule, value, allData || data, function (message) {
  9082. callbackMessage = message;
  9083. }));case 5:res = _context2.sent;
  9084. if (callbackMessage || typeof res === 'string' && res || res === false) {
  9085. result = this._getMessage(rule, callbackMessage || res, vt);
  9086. }_context2.next = 12;break;case 9:_context2.prev = 9;_context2.t0 = _context2["catch"](1);
  9087. result = this._getMessage(rule, _context2.t0.message, vt);case 12:return _context2.abrupt("return",
  9088. result);case 13:case "end":return _context2.stop();}}}, _callee2, this, [[1, 9]]);}));function validateFunction(_x6, _x7, _x8, _x9, _x10) {return _validateFunction.apply(this, arguments);}return validateFunction;}() }, { key: "_getMessage", value: function _getMessage(
  9089. rule, message, vt) {
  9090. return formatMessage(rule, message || rule.errorMessage || this._message[vt] || message['default']);
  9091. } }, { key: "_getValidateType", value: function _getValidateType(
  9092. rule) {
  9093. var result = '';
  9094. if (rule.required) {
  9095. result = 'required';
  9096. } else if (rule.format) {
  9097. result = 'format';
  9098. } else if (rule.arrayType) {
  9099. result = 'arrayTypeFormat';
  9100. } else if (rule.range) {
  9101. result = 'range';
  9102. } else if (rule.maximum !== undefined || rule.minimum !== undefined) {
  9103. result = 'rangeNumber';
  9104. } else if (rule.maxLength !== undefined || rule.minLength !== undefined) {
  9105. result = 'rangeLength';
  9106. } else if (rule.pattern) {
  9107. result = 'pattern';
  9108. } else if (rule.validateFunction) {
  9109. result = 'validateFunction';
  9110. }
  9111. return result;
  9112. } }]);return RuleValidator;}();
  9113. var RuleValidatorHelper = {
  9114. required: function required(rule, value, message) {
  9115. if (rule.required && isEmptyValue(value, rule.format || typeof value)) {
  9116. return formatMessage(rule, rule.errorMessage || message.required);
  9117. }
  9118. return null;
  9119. },
  9120. range: function range(rule, value, message) {var
  9121. range =
  9122. rule.range,errorMessage = rule.errorMessage;
  9123. var list = new Array(range.length);
  9124. for (var i = 0; i < range.length; i++) {
  9125. var item = range[i];
  9126. if (types.object(item) && item.value !== undefined) {
  9127. list[i] = item.value;
  9128. } else {
  9129. list[i] = item;
  9130. }
  9131. }
  9132. var result = false;
  9133. if (Array.isArray(value)) {
  9134. result = new Set(value.concat(list)).size === list.length;
  9135. } else {
  9136. if (list.indexOf(value) > -1) {
  9137. result = true;
  9138. }
  9139. }
  9140. if (!result) {
  9141. return formatMessage(rule, errorMessage || message['enum']);
  9142. }
  9143. return null;
  9144. },
  9145. rangeNumber: function rangeNumber(rule, value, message) {
  9146. if (!types.number(value)) {
  9147. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  9148. }var
  9149. minimum =
  9150. rule.minimum,maximum = rule.maximum,exclusiveMinimum = rule.exclusiveMinimum,exclusiveMaximum = rule.exclusiveMaximum;
  9151. var min = exclusiveMinimum ? value <= minimum : value < minimum;
  9152. var max = exclusiveMaximum ? value >= maximum : value > maximum;
  9153. if (minimum !== undefined && min) {
  9154. return formatMessage(rule, rule.errorMessage || message['number'][exclusiveMinimum ?
  9155. 'exclusiveMinimum' : 'minimum']);
  9156. } else if (maximum !== undefined && max) {
  9157. return formatMessage(rule, rule.errorMessage || message['number'][exclusiveMaximum ?
  9158. 'exclusiveMaximum' : 'maximum']);
  9159. } else if (minimum !== undefined && maximum !== undefined && (min || max)) {
  9160. return formatMessage(rule, rule.errorMessage || message['number'].range);
  9161. }
  9162. return null;
  9163. },
  9164. rangeLength: function rangeLength(rule, value, message) {
  9165. if (!types.string(value) && !types.array(value)) {
  9166. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  9167. }
  9168. var min = rule.minLength;
  9169. var max = rule.maxLength;
  9170. var val = value.length;
  9171. if (min !== undefined && val < min) {
  9172. return formatMessage(rule, rule.errorMessage || message['length'].minLength);
  9173. } else if (max !== undefined && val > max) {
  9174. return formatMessage(rule, rule.errorMessage || message['length'].maxLength);
  9175. } else if (min !== undefined && max !== undefined && (val < min || val > max)) {
  9176. return formatMessage(rule, rule.errorMessage || message['length'].range);
  9177. }
  9178. return null;
  9179. },
  9180. pattern: function pattern(rule, value, message) {
  9181. if (!types['pattern'](rule.pattern, value)) {
  9182. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  9183. }
  9184. return null;
  9185. },
  9186. format: function format(rule, value, message) {
  9187. var customTypes = Object.keys(types);
  9188. var format = FORMAT_MAPPING[rule.format] ? FORMAT_MAPPING[rule.format] : rule.format || rule.arrayType;
  9189. if (customTypes.indexOf(format) > -1) {
  9190. if (!types[format](value)) {
  9191. return formatMessage(rule, rule.errorMessage || message.typeError);
  9192. }
  9193. }
  9194. return null;
  9195. },
  9196. arrayTypeFormat: function arrayTypeFormat(rule, value, message) {
  9197. if (!Array.isArray(value)) {
  9198. return formatMessage(rule, rule.errorMessage || message.typeError);
  9199. }
  9200. for (var i = 0; i < value.length; i++) {
  9201. var element = value[i];
  9202. var formatResult = this.format(rule, element, message);
  9203. if (formatResult !== null) {
  9204. return formatResult;
  9205. }
  9206. }
  9207. return null;
  9208. } };var
  9209. SchemaValidator = /*#__PURE__*/function (_RuleValidator) {_inherits(SchemaValidator, _RuleValidator);var _super = _createSuper(SchemaValidator);
  9210. function SchemaValidator(schema, options) {var _this;_classCallCheck(this, SchemaValidator);
  9211. _this = _super.call(this, SchemaValidator.message);
  9212. _this._schema = schema;
  9213. _this._options = options || null;return _this;
  9214. }_createClass(SchemaValidator, [{ key: "updateSchema", value: function updateSchema(
  9215. schema) {
  9216. this._schema = schema;
  9217. } }, { key: "validate", value: function () {var _validate = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee3(
  9218. data, allData) {var result;return _regenerator.default.wrap(function _callee3$(_context3) {while (1) {switch (_context3.prev = _context3.next) {case 0:
  9219. result = this._checkFieldInSchema(data);if (
  9220. result) {_context3.next = 5;break;}_context3.next = 4;return (
  9221. this.invokeValidate(data, false, allData));case 4:result = _context3.sent;case 5:return _context3.abrupt("return",
  9222. result.length ? result[0] : null);case 6:case "end":return _context3.stop();}}}, _callee3, this);}));function validate(_x11, _x12) {return _validate.apply(this, arguments);}return validate;}() }, { key: "validateAll", value: function () {var _validateAll = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee4(
  9223. data, allData) {var result;return _regenerator.default.wrap(function _callee4$(_context4) {while (1) {switch (_context4.prev = _context4.next) {case 0:
  9224. result = this._checkFieldInSchema(data);if (
  9225. result) {_context4.next = 5;break;}_context4.next = 4;return (
  9226. this.invokeValidate(data, true, allData));case 4:result = _context4.sent;case 5:return _context4.abrupt("return",
  9227. result);case 6:case "end":return _context4.stop();}}}, _callee4, this);}));function validateAll(_x13, _x14) {return _validateAll.apply(this, arguments);}return validateAll;}() }, { key: "validateUpdate", value: function () {var _validateUpdate = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee5(
  9228. data, allData) {var result;return _regenerator.default.wrap(function _callee5$(_context5) {while (1) {switch (_context5.prev = _context5.next) {case 0:
  9229. result = this._checkFieldInSchema(data);if (
  9230. result) {_context5.next = 5;break;}_context5.next = 4;return (
  9231. this.invokeValidateUpdate(data, false, allData));case 4:result = _context5.sent;case 5:return _context5.abrupt("return",
  9232. result.length ? result[0] : null);case 6:case "end":return _context5.stop();}}}, _callee5, this);}));function validateUpdate(_x15, _x16) {return _validateUpdate.apply(this, arguments);}return validateUpdate;}() }, { key: "invokeValidate", value: function () {var _invokeValidate = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee6(
  9233. data, all, allData) {var result, schema, key, value, errorMessage;return _regenerator.default.wrap(function _callee6$(_context6) {while (1) {switch (_context6.prev = _context6.next) {case 0:
  9234. result = [];
  9235. schema = this._schema;_context6.t0 = _regenerator.default.keys(
  9236. schema);case 3:if ((_context6.t1 = _context6.t0()).done) {_context6.next = 15;break;}key = _context6.t1.value;
  9237. value = schema[key];_context6.next = 8;return (
  9238. this.validateRule(key, value, data[key], data, allData));case 8:errorMessage = _context6.sent;if (!(
  9239. errorMessage != null)) {_context6.next = 13;break;}
  9240. result.push({
  9241. key: key,
  9242. errorMessage: errorMessage });if (
  9243. all) {_context6.next = 13;break;}return _context6.abrupt("break", 15);case 13:_context6.next = 3;break;case 15:return _context6.abrupt("return",
  9244. result);case 16:case "end":return _context6.stop();}}}, _callee6, this);}));function invokeValidate(_x17, _x18, _x19) {return _invokeValidate.apply(this, arguments);}return invokeValidate;}() }, { key: "invokeValidateUpdate", value: function () {var _invokeValidateUpdate = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee7(
  9245. data, all, allData) {var result, key, errorMessage;return _regenerator.default.wrap(function _callee7$(_context7) {while (1) {switch (_context7.prev = _context7.next) {case 0:
  9246. result = [];_context7.t0 = _regenerator.default.keys(
  9247. data);case 2:if ((_context7.t1 = _context7.t0()).done) {_context7.next = 13;break;}key = _context7.t1.value;_context7.next = 6;return (
  9248. this.validateRule(key, this._schema[key], data[key], data, allData));case 6:errorMessage = _context7.sent;if (!(
  9249. errorMessage != null)) {_context7.next = 11;break;}
  9250. result.push({
  9251. key: key,
  9252. errorMessage: errorMessage });if (
  9253. all) {_context7.next = 11;break;}return _context7.abrupt("break", 13);case 11:_context7.next = 2;break;case 13:return _context7.abrupt("return",
  9254. result);case 14:case "end":return _context7.stop();}}}, _callee7, this);}));function invokeValidateUpdate(_x20, _x21, _x22) {return _invokeValidateUpdate.apply(this, arguments);}return invokeValidateUpdate;}() }, { key: "_checkFieldInSchema", value: function _checkFieldInSchema(
  9255. data) {
  9256. var keys = Object.keys(data);
  9257. var keys2 = Object.keys(this._schema);
  9258. if (new Set(keys.concat(keys2)).size === keys2.length) {
  9259. return '';
  9260. }
  9261. var noExistFields = keys.filter(function (key) {
  9262. return keys2.indexOf(key) < 0;
  9263. });
  9264. var errorMessage = formatMessage({
  9265. field: JSON.stringify(noExistFields) },
  9266. SchemaValidator.message.TAG + SchemaValidator.message['defaultInvalid']);
  9267. return [{
  9268. key: 'invalid',
  9269. errorMessage: errorMessage }];
  9270. } }]);return SchemaValidator;}(RuleValidator);
  9271. function Message() {
  9272. return {
  9273. TAG: "",
  9274. default: '验证错误',
  9275. defaultInvalid: '提交的字段{field}在数据库中并不存在',
  9276. validateFunction: '验证无效',
  9277. required: '{label}必填',
  9278. 'enum': '{label}超出范围',
  9279. timestamp: '{label}格式无效',
  9280. whitespace: '{label}不能为空',
  9281. typeError: '{label}类型无效',
  9282. date: {
  9283. format: '{label}日期{value}格式无效',
  9284. parse: '{label}日期无法解析,{value}无效',
  9285. invalid: '{label}日期{value}无效' },
  9286. length: {
  9287. minLength: '{label}长度不能少于{minLength}',
  9288. maxLength: '{label}长度不能超过{maxLength}',
  9289. range: '{label}必须介于{minLength}和{maxLength}之间' },
  9290. number: {
  9291. minimum: '{label}不能小于{minimum}',
  9292. maximum: '{label}不能大于{maximum}',
  9293. exclusiveMinimum: '{label}不能小于等于{minimum}',
  9294. exclusiveMaximum: '{label}不能大于等于{maximum}',
  9295. range: '{label}必须介于{minimum}and{maximum}之间' },
  9296. pattern: {
  9297. mismatch: '{label}格式不匹配' } };
  9298. }
  9299. SchemaValidator.message = new Message();var _default =
  9300. SchemaValidator;exports.default = _default;
  9301. /***/ }),
  9302. /***/ 218:
  9303. /*!*********************************************************************************************!*\
  9304. !*** E:/project/新耗材小程序/material_applet/uni_modules/uni-forms/components/uni-forms/utils.js ***!
  9305. \*********************************************************************************************/
  9306. /*! no static exports found */
  9307. /***/ (function(module, exports, __webpack_require__) {
  9308. "use strict";
  9309. Object.defineProperty(exports, "__esModule", { value: true });exports.isEqual = exports.type = exports.isRequiredField = exports.isBoolean = exports.isNumber = exports.objGet = exports.objSet = exports.name2arr = exports.rawData = exports.isRealName = exports.realName = exports.getDataValueType = exports.getDataValue = exports.setDataValue = exports.getValue = exports.typeFilter = exports.deepCopy = void 0; /**
  9310. * 简单处理对象拷贝
  9311. * @param {Obejct} 被拷贝对象
  9312. * @@return {Object} 拷贝对象
  9313. */
  9314. var deepCopy = function deepCopy(val) {
  9315. return JSON.parse(JSON.stringify(val));
  9316. };
  9317. /**
  9318. * 过滤数字类型
  9319. * @param {String} format 数字类型
  9320. * @@return {Boolean} 返回是否为数字类型
  9321. */exports.deepCopy = deepCopy;
  9322. var typeFilter = function typeFilter(format) {
  9323. return format === 'int' || format === 'double' || format === 'number' || format === 'timestamp';
  9324. };
  9325. /**
  9326. * 把 value 转换成指定的类型,用于处理初始值,原因是初始值需要入库不能为 undefined
  9327. * @param {String} key 字段名
  9328. * @param {any} value 字段值
  9329. * @param {Object} rules 表单校验规则
  9330. */exports.typeFilter = typeFilter;
  9331. var getValue = function getValue(key, value, rules) {
  9332. var isRuleNumType = rules.find(function (val) {return val.format && typeFilter(val.format);});
  9333. var isRuleBoolType = rules.find(function (val) {return val.format && val.format === 'boolean' || val.format === 'bool';});
  9334. // 输入类型为 number
  9335. if (!!isRuleNumType) {
  9336. if (!value && value !== 0) {
  9337. value = null;
  9338. } else {
  9339. value = isNumber(Number(value)) ? Number(value) : value;
  9340. }
  9341. }
  9342. // 输入类型为 boolean
  9343. if (!!isRuleBoolType) {
  9344. value = isBoolean(value) ? value : false;
  9345. }
  9346. return value;
  9347. };
  9348. /**
  9349. * 获取表单数据
  9350. * @param {String|Array} name 真实名称,需要使用 realName 获取
  9351. * @param {Object} data 原始数据
  9352. * @param {any} value 需要设置的值
  9353. */exports.getValue = getValue;
  9354. var setDataValue = function setDataValue(field, formdata, value) {
  9355. formdata[field] = value;
  9356. return value || '';
  9357. };
  9358. /**
  9359. * 获取表单数据
  9360. * @param {String|Array} field 真实名称,需要使用 realName 获取
  9361. * @param {Object} data 原始数据
  9362. */exports.setDataValue = setDataValue;
  9363. var getDataValue = function getDataValue(field, data) {
  9364. return objGet(data, field);
  9365. };
  9366. /**
  9367. * 获取表单类型
  9368. * @param {String|Array} field 真实名称,需要使用 realName 获取
  9369. */exports.getDataValue = getDataValue;
  9370. var getDataValueType = function getDataValueType(field, data) {
  9371. var value = getDataValue(field, data);
  9372. return {
  9373. type: type(value),
  9374. value: value };
  9375. };
  9376. /**
  9377. * 获取表单可用的真实name
  9378. * @param {String|Array} name 表单name
  9379. * @@return {String} 表单可用的真实name
  9380. */exports.getDataValueType = getDataValueType;
  9381. var realName = function realName(name) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  9382. var base_name = _basePath(name);
  9383. if (typeof base_name === 'object' && Array.isArray(base_name) && base_name.length > 1) {
  9384. var realname = base_name.reduce(function (a, b) {return a += "#".concat(b);}, '_formdata_');
  9385. return realname;
  9386. }
  9387. return base_name[0] || name;
  9388. };
  9389. /**
  9390. * 判断是否表单可用的真实name
  9391. * @param {String|Array} name 表单name
  9392. * @@return {String} 表单可用的真实name
  9393. */exports.realName = realName;
  9394. var isRealName = function isRealName(name) {
  9395. var reg = /^_formdata_#*/;
  9396. return reg.test(name);
  9397. };
  9398. /**
  9399. * 获取表单数据的原始格式
  9400. * @@return {Object|Array} object 需要解析的数据
  9401. */exports.isRealName = isRealName;
  9402. var rawData = function rawData() {var object = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};var name = arguments.length > 1 ? arguments[1] : undefined;
  9403. var newData = JSON.parse(JSON.stringify(object));
  9404. var formData = {};
  9405. for (var i in newData) {
  9406. var path = name2arr(i);
  9407. objSet(formData, path, newData[i]);
  9408. }
  9409. return formData;
  9410. };
  9411. /**
  9412. * 真实name还原为 array
  9413. * @param {*} name
  9414. */exports.rawData = rawData;
  9415. var name2arr = function name2arr(name) {
  9416. var field = name.replace('_formdata_#', '');
  9417. field = field.split('#').map(function (v) {return isNumber(v) ? Number(v) : v;});
  9418. return field;
  9419. };
  9420. /**
  9421. * 对象中设置值
  9422. * @param {Object|Array} object 源数据
  9423. * @param {String| Array} path 'a.b.c' 或 ['a',0,'b','c']
  9424. * @param {String} value 需要设置的值
  9425. */exports.name2arr = name2arr;
  9426. var objSet = function objSet(object, path, value) {
  9427. if (typeof object !== 'object') return object;
  9428. _basePath(path).reduce(function (o, k, i, _) {
  9429. if (i === _.length - 1) {
  9430. // 若遍历结束直接赋值
  9431. o[k] = value;
  9432. return null;
  9433. } else if (k in o) {
  9434. // 若存在对应路径,则返回找到的对象,进行下一次遍历
  9435. return o[k];
  9436. } else {
  9437. // 若不存在对应路径,则创建对应对象,若下一路径是数字,新对象赋值为空数组,否则赋值为空对象
  9438. o[k] = /^[0-9]{1,}$/.test(_[i + 1]) ? [] : {};
  9439. return o[k];
  9440. }
  9441. }, object);
  9442. // 返回object
  9443. return object;
  9444. };
  9445. // 处理 path, path有三种形式:'a[0].b.c'、'a.0.b.c' 和 ['a','0','b','c'],需要统一处理成数组,便于后续使用
  9446. exports.objSet = objSet;function _basePath(path) {
  9447. // 若是数组,则直接返回
  9448. if (Array.isArray(path)) return path;
  9449. // 若有 '[',']',则替换成将 '[' 替换成 '.',去掉 ']'
  9450. return path.replace(/\[/g, '.').replace(/\]/g, '').split('.');
  9451. }
  9452. /**
  9453. * 从对象中获取值
  9454. * @param {Object|Array} object 源数据
  9455. * @param {String| Array} path 'a.b.c' 或 ['a',0,'b','c']
  9456. * @param {String} defaultVal 如果无法从调用链中获取值的默认值
  9457. */
  9458. var objGet = function objGet(object, path) {var defaultVal = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'undefined';
  9459. // 先将path处理成统一格式
  9460. var newPath = _basePath(path);
  9461. // 递归处理,返回最后结果
  9462. var val = newPath.reduce(function (o, k) {
  9463. return (o || {})[k];
  9464. }, object);
  9465. return !val || val !== undefined ? val : defaultVal;
  9466. };
  9467. /**
  9468. * 是否为 number 类型
  9469. * @param {any} num 需要判断的值
  9470. * @return {Boolean} 是否为 number
  9471. */exports.objGet = objGet;
  9472. var isNumber = function isNumber(num) {
  9473. return !isNaN(Number(num));
  9474. };
  9475. /**
  9476. * 是否为 boolean 类型
  9477. * @param {any} bool 需要判断的值
  9478. * @return {Boolean} 是否为 boolean
  9479. */exports.isNumber = isNumber;
  9480. var isBoolean = function isBoolean(bool) {
  9481. return typeof bool === 'boolean';
  9482. };
  9483. /**
  9484. * 是否有必填字段
  9485. * @param {Object} rules 规则
  9486. * @return {Boolean} 是否有必填字段
  9487. */exports.isBoolean = isBoolean;
  9488. var isRequiredField = function isRequiredField(rules) {
  9489. var isNoField = false;
  9490. for (var i = 0; i < rules.length; i++) {
  9491. var ruleData = rules[i];
  9492. if (ruleData.required) {
  9493. isNoField = true;
  9494. break;
  9495. }
  9496. }
  9497. return isNoField;
  9498. };
  9499. /**
  9500. * 获取数据类型
  9501. * @param {Any} obj 需要获取数据类型的值
  9502. */exports.isRequiredField = isRequiredField;
  9503. var type = function type(obj) {
  9504. var class2type = {};
  9505. // 生成class2type映射
  9506. "Boolean Number String Function Array Date RegExp Object Error".split(" ").map(function (item, index) {
  9507. class2type["[object " + item + "]"] = item.toLowerCase();
  9508. });
  9509. if (obj == null) {
  9510. return obj + "";
  9511. }
  9512. return typeof obj === "object" || typeof obj === "function" ?
  9513. class2type[Object.prototype.toString.call(obj)] || "object" :
  9514. typeof obj;
  9515. };
  9516. /**
  9517. * 判断两个值是否相等
  9518. * @param {any} a 值
  9519. * @param {any} b 值
  9520. * @return {Boolean} 是否相等
  9521. */exports.type = type;
  9522. var isEqual = function isEqual(a, b) {
  9523. //如果a和b本来就全等
  9524. if (a === b) {
  9525. //判断是否为0和-0
  9526. return a !== 0 || 1 / a === 1 / b;
  9527. }
  9528. //判断是否为null和undefined
  9529. if (a == null || b == null) {
  9530. return a === b;
  9531. }
  9532. //接下来判断a和b的数据类型
  9533. var classNameA = toString.call(a),
  9534. classNameB = toString.call(b);
  9535. //如果数据类型不相等,则返回false
  9536. if (classNameA !== classNameB) {
  9537. return false;
  9538. }
  9539. //如果数据类型相等,再根据不同数据类型分别判断
  9540. switch (classNameA) {
  9541. case '[object RegExp]':
  9542. case '[object String]':
  9543. //进行字符串转换比较
  9544. return '' + a === '' + b;
  9545. case '[object Number]':
  9546. //进行数字转换比较,判断是否为NaN
  9547. if (+a !== +a) {
  9548. return +b !== +b;
  9549. }
  9550. //判断是否为0或-0
  9551. return +a === 0 ? 1 / +a === 1 / b : +a === +b;
  9552. case '[object Date]':
  9553. case '[object Boolean]':
  9554. return +a === +b;}
  9555. //如果是对象类型
  9556. if (classNameA == '[object Object]') {
  9557. //获取a和b的属性长度
  9558. var propsA = Object.getOwnPropertyNames(a),
  9559. propsB = Object.getOwnPropertyNames(b);
  9560. if (propsA.length != propsB.length) {
  9561. return false;
  9562. }
  9563. for (var i = 0; i < propsA.length; i++) {
  9564. var propName = propsA[i];
  9565. //如果对应属性对应值不相等,则返回false
  9566. if (a[propName] !== b[propName]) {
  9567. return false;
  9568. }
  9569. }
  9570. return true;
  9571. }
  9572. //如果是数组类型
  9573. if (classNameA == '[object Array]') {
  9574. if (a.toString() == b.toString()) {
  9575. return true;
  9576. }
  9577. return false;
  9578. }
  9579. };exports.isEqual = isEqual;
  9580. /***/ }),
  9581. /***/ 240:
  9582. /*!************************************************************************************!*\
  9583. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js ***!
  9584. \************************************************************************************/
  9585. /*! no static exports found */
  9586. /***/ (function(module, exports, __webpack_require__) {
  9587. "use strict";
  9588. /* WEBPACK VAR INJECTION */(function(global, uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _regenerator = _interopRequireDefault(__webpack_require__(/*! ./node_modules/@babel/runtime/regenerator */ 9));var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 3);var _pages = _interopRequireDefault(__webpack_require__(/*! @/pages.json */ 241));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 _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 _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 _createForOfIteratorHelper(o, allowArrayLike) {var it;if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {if (it) o = it;var i = 0;var F = function F() {};return { s: F, n: function n() {if (i >= o.length) return { done: true };return { done: false, value: o[i++] };}, e: function e(_e32) {throw _e32;}, f: F };}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var normalCompletion = true,didErr = false,err;return { s: function s() {it = o[Symbol.iterator]();}, n: function n() {var step = it.next();normalCompletion = step.done;return step;}, e: function e(_e33) {didErr = true;err = _e33;}, f: function f() {try {if (!normalCompletion && it.return != null) it.return();} finally {if (didErr) throw err;}} };}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 _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;}function 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;}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _inherits(subClass, superClass) {if (typeof superClass !== "function" && superClass !== null) {throw new TypeError("Super expression must either be null or a function");}subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });if (superClass) _setPrototypeOf(subClass, superClass);}function _createSuper(Derived) {var hasNativeReflectConstruct = _isNativeReflectConstruct();return function _createSuperInternal() {var Super = _getPrototypeOf(Derived),result;if (hasNativeReflectConstruct) {var NewTarget = _getPrototypeOf(this).constructor;result = Reflect.construct(Super, arguments, NewTarget);} else {result = Super.apply(this, arguments);}return _possibleConstructorReturn(this, result);};}function _possibleConstructorReturn(self, call) {if (call && (typeof call === "object" || typeof call === "function")) {return call;}return _assertThisInitialized(self);}function _assertThisInitialized(self) {if (self === void 0) {throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _wrapNativeSuper(Class) {var _cache = typeof Map === "function" ? new Map() : undefined;_wrapNativeSuper = function _wrapNativeSuper(Class) {if (Class === null || !_isNativeFunction(Class)) return Class;if (typeof Class !== "function") {throw new TypeError("Super expression must either be null or a function");}if (typeof _cache !== "undefined") {if (_cache.has(Class)) return _cache.get(Class);_cache.set(Class, Wrapper);}function Wrapper() {return _construct(Class, arguments, _getPrototypeOf(this).constructor);}Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } });return _setPrototypeOf(Wrapper, Class);};return _wrapNativeSuper(Class);}function _construct(Parent, args, Class) {if (_isNativeReflectConstruct()) {_construct = Reflect.construct;} else {_construct = function _construct(Parent, args, Class) {var a = [null];a.push.apply(a, args);var Constructor = Function.bind.apply(Parent, a);var instance = new Constructor();if (Class) _setPrototypeOf(instance, Class.prototype);return instance;};}return _construct.apply(null, arguments);}function _isNativeReflectConstruct() {if (typeof Reflect === "undefined" || !Reflect.construct) return false;if (Reflect.construct.sham) return false;if (typeof Proxy === "function") return true;try {Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));return true;} catch (e) {return false;}}function _isNativeFunction(fn) {return Function.toString.call(fn).indexOf("[native code]") !== -1;}function _setPrototypeOf(o, p) {_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {o.__proto__ = p;return o;};return _setPrototypeOf(o, p);}function _getPrototypeOf(o) {_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {return o.__proto__ || Object.getPrototypeOf(o);};return _getPrototypeOf(o);}"undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self && self;function n(e) {return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;}function s(e, t, n) {return e(n = { path: t, exports: {}, require: function require(e, t) {return function () {throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");}(null == t && n.path);} }, n.exports), n.exports;}var o = s(function (e, t) {var n;e.exports = (n = n || function (e, t) {var n = Object.create || function () {function e() {}return function (t) {var n;return e.prototype = t, n = new e(), e.prototype = null, n;};}(),s = {},o = s.lib = {},r = o.Base = { extend: function extend(e) {var t = n(this);return e && t.mixIn(e), t.hasOwnProperty("init") && this.init !== t.init || (t.init = function () {t.$super.init.apply(this, arguments);}), t.init.prototype = t, t.$super = this, t;}, create: function create() {var e = this.extend();return e.init.apply(e, arguments), e;}, init: function init() {}, mixIn: function mixIn(e) {for (var t in e) {e.hasOwnProperty(t) && (this[t] = e[t]);}e.hasOwnProperty("toString") && (this.toString = e.toString);}, clone: function clone() {return this.init.prototype.extend(this);} },i = o.WordArray = r.extend({ init: function init(e, n) {e = this.words = e || [], this.sigBytes = n != t ? n : 4 * e.length;}, toString: function toString(e) {return (e || c).stringify(this);}, concat: function concat(e) {var t = this.words,n = e.words,s = this.sigBytes,o = e.sigBytes;if (this.clamp(), s % 4) for (var r = 0; r < o; r++) {var i = n[r >>> 2] >>> 24 - r % 4 * 8 & 255;t[s + r >>> 2] |= i << 24 - (s + r) % 4 * 8;} else for (r = 0; r < o; r += 4) {t[s + r >>> 2] = n[r >>> 2];}return this.sigBytes += o, this;}, clamp: function clamp() {var t = this.words,n = this.sigBytes;t[n >>> 2] &= 4294967295 << 32 - n % 4 * 8, t.length = e.ceil(n / 4);}, clone: function clone() {var e = r.clone.call(this);return e.words = this.words.slice(0), e;}, random: function random(t) {for (var n, s = [], o = function o(t) {t = t;var n = 987654321,s = 4294967295;return function () {var o = ((n = 36969 * (65535 & n) + (n >> 16) & s) << 16) + (t = 18e3 * (65535 & t) + (t >> 16) & s) & s;return o /= 4294967296, (o += .5) * (e.random() > .5 ? 1 : -1);};}, r = 0; r < t; r += 4) {var a = o(4294967296 * (n || e.random()));n = 987654071 * a(), s.push(4294967296 * a() | 0);}return new i.init(s, t);} }),a = s.enc = {},c = a.Hex = { stringify: function stringify(e) {for (var t = e.words, n = e.sigBytes, s = [], o = 0; o < n; o++) {var r = t[o >>> 2] >>> 24 - o % 4 * 8 & 255;s.push((r >>> 4).toString(16)), s.push((15 & r).toString(16));}return s.join("");}, parse: function parse(e) {for (var t = e.length, n = [], s = 0; s < t; s += 2) {n[s >>> 3] |= parseInt(e.substr(s, 2), 16) << 24 - s % 8 * 4;}return new i.init(n, t / 2);} },u = a.Latin1 = { stringify: function stringify(e) {for (var t = e.words, n = e.sigBytes, s = [], o = 0; o < n; o++) {var r = t[o >>> 2] >>> 24 - o % 4 * 8 & 255;s.push(String.fromCharCode(r));}return s.join("");}, parse: function parse(e) {for (var t = e.length, n = [], s = 0; s < t; s++) {n[s >>> 2] |= (255 & e.charCodeAt(s)) << 24 - s % 4 * 8;}return new i.init(n, t);} },l = a.Utf8 = { stringify: function stringify(e) {try {return decodeURIComponent(escape(u.stringify(e)));} catch (e) {throw new Error("Malformed UTF-8 data");}}, parse: function parse(e) {return u.parse(unescape(encodeURIComponent(e)));} },h = o.BufferedBlockAlgorithm = r.extend({ reset: function reset() {this._data = new i.init(), this._nDataBytes = 0;}, _append: function _append(e) {"string" == typeof e && (e = l.parse(e)), this._data.concat(e), this._nDataBytes += e.sigBytes;}, _process: function _process(t) {var n = this._data,s = n.words,o = n.sigBytes,r = this.blockSize,a = o / (4 * r),c = (a = t ? e.ceil(a) : e.max((0 | a) - this._minBufferSize, 0)) * r,u = e.min(4 * c, o);if (c) {for (var l = 0; l < c; l += r) {this._doProcessBlock(s, l);}var h = s.splice(0, c);n.sigBytes -= u;}return new i.init(h, u);}, clone: function clone() {var e = r.clone.call(this);return e._data = this._data.clone(), e;}, _minBufferSize: 0 });o.Hasher = h.extend({ cfg: r.extend(), init: function init(e) {this.cfg = this.cfg.extend(e), this.reset();}, reset: function reset() {h.reset.call(this), this._doReset();}, update: function update(e) {return this._append(e), this._process(), this;}, finalize: function finalize(e) {return e && this._append(e), this._doFinalize();}, blockSize: 16, _createHelper: function _createHelper(e) {return function (t, n) {return new e.init(n).finalize(t);};}, _createHmacHelper: function _createHmacHelper(e) {return function (t, n) {return new d.HMAC.init(e, n).finalize(t);};} });var d = s.algo = {};return s;}(Math), n);}),r = (s(function (e, t) {var n;e.exports = (n = o, function (e) {var t = n,s = t.lib,o = s.WordArray,r = s.Hasher,i = t.algo,a = [];!function () {for (var t = 0; t < 64; t++) {a[t] = 4294967296 * e.abs(e.sin(t + 1)) | 0;}}();var c = i.MD5 = r.extend({ _doReset: function _doReset() {this._hash = new o.init([1732584193, 4023233417, 2562383102, 271733878]);}, _doProcessBlock: function _doProcessBlock(e, t) {for (var n = 0; n < 16; n++) {var s = t + n,o = e[s];e[s] = 16711935 & (o << 8 | o >>> 24) | 4278255360 & (o << 24 | o >>> 8);}var r = this._hash.words,i = e[t + 0],c = e[t + 1],f = e[t + 2],g = e[t + 3],p = e[t + 4],m = e[t + 5],y = e[t + 6],_ = e[t + 7],w = e[t + 8],k = e[t + 9],v = e[t + 10],T = e[t + 11],S = e[t + 12],P = e[t + 13],A = e[t + 14],I = e[t + 15],b = r[0],O = r[1],C = r[2],E = r[3];b = u(b, O, C, E, i, 7, a[0]), E = u(E, b, O, C, c, 12, a[1]), C = u(C, E, b, O, f, 17, a[2]), O = u(O, C, E, b, g, 22, a[3]), b = u(b, O, C, E, p, 7, a[4]), E = u(E, b, O, C, m, 12, a[5]), C = u(C, E, b, O, y, 17, a[6]), O = u(O, C, E, b, _, 22, a[7]), b = u(b, O, C, E, w, 7, a[8]), E = u(E, b, O, C, k, 12, a[9]), C = u(C, E, b, O, v, 17, a[10]), O = u(O, C, E, b, T, 22, a[11]), b = u(b, O, C, E, S, 7, a[12]), E = u(E, b, O, C, P, 12, a[13]), C = u(C, E, b, O, A, 17, a[14]), b = l(b, O = u(O, C, E, b, I, 22, a[15]), C, E, c, 5, a[16]), E = l(E, b, O, C, y, 9, a[17]), C = l(C, E, b, O, T, 14, a[18]), O = l(O, C, E, b, i, 20, a[19]), b = l(b, O, C, E, m, 5, a[20]), E = l(E, b, O, C, v, 9, a[21]), C = l(C, E, b, O, I, 14, a[22]), O = l(O, C, E, b, p, 20, a[23]), b = l(b, O, C, E, k, 5, a[24]), E = l(E, b, O, C, A, 9, a[25]), C = l(C, E, b, O, g, 14, a[26]), O = l(O, C, E, b, w, 20, a[27]), b = l(b, O, C, E, P, 5, a[28]), E = l(E, b, O, C, f, 9, a[29]), C = l(C, E, b, O, _, 14, a[30]), b = h(b, O = l(O, C, E, b, S, 20, a[31]), C, E, m, 4, a[32]), E = h(E, b, O, C, w, 11, a[33]), C = h(C, E, b, O, T, 16, a[34]), O = h(O, C, E, b, A, 23, a[35]), b = h(b, O, C, E, c, 4, a[36]), E = h(E, b, O, C, p, 11, a[37]), C = h(C, E, b, O, _, 16, a[38]), O = h(O, C, E, b, v, 23, a[39]), b = h(b, O, C, E, P, 4, a[40]), E = h(E, b, O, C, i, 11, a[41]), C = h(C, E, b, O, g, 16, a[42]), O = h(O, C, E, b, y, 23, a[43]), b = h(b, O, C, E, k, 4, a[44]), E = h(E, b, O, C, S, 11, a[45]), C = h(C, E, b, O, I, 16, a[46]), b = d(b, O = h(O, C, E, b, f, 23, a[47]), C, E, i, 6, a[48]), E = d(E, b, O, C, _, 10, a[49]), C = d(C, E, b, O, A, 15, a[50]), O = d(O, C, E, b, m, 21, a[51]), b = d(b, O, C, E, S, 6, a[52]), E = d(E, b, O, C, g, 10, a[53]), C = d(C, E, b, O, v, 15, a[54]), O = d(O, C, E, b, c, 21, a[55]), b = d(b, O, C, E, w, 6, a[56]), E = d(E, b, O, C, I, 10, a[57]), C = d(C, E, b, O, y, 15, a[58]), O = d(O, C, E, b, P, 21, a[59]), b = d(b, O, C, E, p, 6, a[60]), E = d(E, b, O, C, T, 10, a[61]), C = d(C, E, b, O, f, 15, a[62]), O = d(O, C, E, b, k, 21, a[63]), r[0] = r[0] + b | 0, r[1] = r[1] + O | 0, r[2] = r[2] + C | 0, r[3] = r[3] + E | 0;}, _doFinalize: function _doFinalize() {var t = this._data,n = t.words,s = 8 * this._nDataBytes,o = 8 * t.sigBytes;n[o >>> 5] |= 128 << 24 - o % 32;var r = e.floor(s / 4294967296),i = s;n[15 + (o + 64 >>> 9 << 4)] = 16711935 & (r << 8 | r >>> 24) | 4278255360 & (r << 24 | r >>> 8), n[14 + (o + 64 >>> 9 << 4)] = 16711935 & (i << 8 | i >>> 24) | 4278255360 & (i << 24 | i >>> 8), t.sigBytes = 4 * (n.length + 1), this._process();for (var a = this._hash, c = a.words, u = 0; u < 4; u++) {var l = c[u];c[u] = 16711935 & (l << 8 | l >>> 24) | 4278255360 & (l << 24 | l >>> 8);}return a;}, clone: function clone() {var e = r.clone.call(this);return e._hash = this._hash.clone(), e;} });function u(e, t, n, s, o, r, i) {var a = e + (t & n | ~t & s) + o + i;return (a << r | a >>> 32 - r) + t;}function l(e, t, n, s, o, r, i) {var a = e + (t & s | n & ~s) + o + i;return (a << r | a >>> 32 - r) + t;}function h(e, t, n, s, o, r, i) {var a = e + (t ^ n ^ s) + o + i;return (a << r | a >>> 32 - r) + t;}function d(e, t, n, s, o, r, i) {var a = e + (n ^ (t | ~s)) + o + i;return (a << r | a >>> 32 - r) + t;}t.MD5 = r._createHelper(c), t.HmacMD5 = r._createHmacHelper(c);}(Math), n.MD5);}), s(function (e, t) {var n, s, r;e.exports = (s = (n = o).lib.Base, r = n.enc.Utf8, void (n.algo.HMAC = s.extend({ init: function init(e, t) {e = this._hasher = new e.init(), "string" == typeof t && (t = r.parse(t));var n = e.blockSize,s = 4 * n;t.sigBytes > s && (t = e.finalize(t)), t.clamp();for (var o = this._oKey = t.clone(), i = this._iKey = t.clone(), a = o.words, c = i.words, u = 0; u < n; u++) {a[u] ^= 1549556828, c[u] ^= 909522486;}o.sigBytes = i.sigBytes = s, this.reset();}, reset: function reset() {var e = this._hasher;e.reset(), e.update(this._iKey);}, update: function update(e) {return this._hasher.update(e), this;}, finalize: function finalize(e) {var t = this._hasher,n = t.finalize(e);return t.reset(), t.finalize(this._oKey.clone().concat(n));} })));}), s(function (e, t) {e.exports = o.HmacMD5;}));var i = "FUNCTION",a = "OBJECT",c = "CLIENT_DB";function u(e) {return Object.prototype.toString.call(e).slice(8, -1).toLowerCase();}function l(e) {return "object" === u(e);}function h(e) {return e && "string" == typeof e ? JSON.parse(e) : e;}var d = "development" === "development",f = "mp-weixin";var g;switch (f) {case "h5":g = "web";break;case "app-plus":g = "app";break;default:g = f;}var p = h(undefined),m = h([]) || [],y = true;var _ = "";try {{var _e2 = __webpack_require__(/*! uni-stat-config */ 242).default || __webpack_require__(/*! uni-stat-config */ 242);_ = _e2.appid;}} catch (e) {}var w = {};function k(e) {var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var n, s;return n = w, s = e, Object.prototype.hasOwnProperty.call(n, s) || (w[e] = t), w[e];}"app" === g && (w = uni._globalUniCloudObj ? uni._globalUniCloudObj : uni._globalUniCloudObj = {});var v = ["invoke", "success", "fail", "complete"],T = k("_globalUniCloudInterceptor");function S(e, t) {T[e] || (T[e] = {}), l(t) && Object.keys(t).forEach(function (n) {v.indexOf(n) > -1 && function (e, t, n) {var s = T[e][t];s || (s = T[e][t] = []), -1 === s.indexOf(n) && "function" == typeof n && s.push(n);}(e, n, t[n]);});}function P(e, t) {T[e] || (T[e] = {}), l(t) ? Object.keys(t).forEach(function (n) {v.indexOf(n) > -1 && function (e, t, n) {var s = T[e][t];if (!s) return;var o = s.indexOf(n);o > -1 && s.splice(o, 1);}(e, n, t[n]);}) : delete T[e];}function A(e, t) {return e && 0 !== e.length ? e.reduce(function (e, n) {return e.then(function () {return n(t);});}, Promise.resolve()) : Promise.resolve();}function I(e, t) {return T[e] && T[e][t] || [];}function b(e) {S("callObject", e);}var O = k("_globalUniCloudListener"),C = "response",E = "needLogin",R = "refreshToken",U = "clientdb",x = "cloudfunction",L = "cloudobject";function D(e) {return O[e] || (O[e] = []), O[e];}function N(e, t) {var n = D(e);n.includes(t) || n.push(t);}function q(e, t) {var n = D(e),s = n.indexOf(t);-1 !== s && n.splice(s, 1);}function F(e, t) {var n = D(e);for (var _e3 = 0; _e3 < n.length; _e3++) {(0, n[_e3])(t);}}var M = !1;var j = new Promise(function (e) {M && e(), function t() {if ("function" == typeof getCurrentPages) {var _t2 = getCurrentPages();_t2 && _t2[0] && (M = !0, e());}M || setTimeout(function () {t();}, 30);}();});function $() {return j;}function K(e, t) {return t ? function (n) {var _this = this;var s = !1;if ("callFunction" === t) {var _e4 = n && n.type || i;s = _e4 !== i;}var o = "callFunction" === t && !s;var r;r = this.isReady ? Promise.resolve() : this.initUniCloud, n = n || {};var a = r.then(function () {return s ? Promise.resolve() : A(I(t, "invoke"), n);}).then(function () {return e.call(_this, n);}).then(function (e) {return s ? Promise.resolve(e) : A(I(t, "success"), e).then(function () {return A(I(t, "complete"), e);}).then(function () {return o && F(C, { type: x, content: e }), Promise.resolve(e);});}, function (e) {return s ? Promise.reject(e) : A(I(t, "fail"), e).then(function () {return A(I(t, "complete"), e);}).then(function () {return F(C, { type: x, content: e }), Promise.reject(e);});});if (!(n.success || n.fail || n.complete)) return a;a.then(function (e) {n.success && n.success(e), n.complete && n.complete(e), o && F(C, { type: x, content: e });}, function (e) {n.fail && n.fail(e), n.complete && n.complete(e), o && F(C, { type: x, content: e });});} : function (t) {if (!((t = t || {}).success || t.fail || t.complete)) return e.call(this, t);e.call(this, t).then(function (e) {t.success && t.success(e), t.complete && t.complete(e);}, function (e) {t.fail && t.fail(e), t.complete && t.complete(e);});};}var B = /*#__PURE__*/function (_Error) {_inherits(B, _Error);var _super = _createSuper(B);function B(e) {var _this2;_classCallCheck(this, B);_this2 = _super.call(this, e.message), _this2.errMsg = e.message || "", _this2.errCode = _this2.code = e.code || "SYSTEM_ERROR", _this2.requestId = e.requestId;return _this2;}return B;}( /*#__PURE__*/_wrapNativeSuper(Error));function H() {var e, t;try {if (uni.getLaunchOptionsSync) {if (uni.getLaunchOptionsSync.toString().indexOf("not yet implemented") > -1) return;var _uni$getLaunchOptions = uni.getLaunchOptionsSync(),_n = _uni$getLaunchOptions.scene,_s = _uni$getLaunchOptions.channel;e = _s, t = _n;}} catch (e) {}return { channel: e, scene: t };}var W;function z() {var e = uni.getLocale && uni.getLocale() || "en";if (W) return _objectSpread(_objectSpread({}, W), {}, { locale: e, LOCALE: e });var t = uni.getSystemInfoSync(),n = t.deviceId,s = t.osName,o = t.uniPlatform,r = t.appId,i = ["pixelRatio", "brand", "model", "system", "language", "version", "platform", "host", "SDKVersion", "swanNativeVersion", "app", "AppPlatform", "fontSizeSetting"];for (var _e5 = 0; _e5 < i.length; _e5++) {delete t[i[_e5]];}return W = _objectSpread(_objectSpread({ PLATFORM: o, OS: s, APPID: r, DEVICEID: n }, H()), t), _objectSpread(_objectSpread({}, W), {}, { locale: e, LOCALE: e });}var J = { sign: function sign(e, t) {var n = "";return Object.keys(e).sort().forEach(function (t) {e[t] && (n = n + "&" + t + "=" + e[t]);}), n = n.slice(1), r(n, t).toString();}, wrappedRequest: function wrappedRequest(e, t) {return new Promise(function (n, s) {t(Object.assign(e, { complete: function complete(e) {e || (e = {}), d && "web" === g && e.errMsg && 0 === e.errMsg.indexOf("request:fail") && console.warn("发布H5,需要在uniCloud后台操作,绑定安全域名,否则会因为跨域问题而无法访问。教程参考:https://uniapp.dcloud.io/uniCloud/quickstart?id=useinh5");var t = e.data && e.data.header && e.data.header["x-serverless-request-id"] || e.header && e.header["request-id"];if (!e.statusCode || e.statusCode >= 400) return s(new B({ code: "SYS_ERR", message: e.errMsg || "request:fail", requestId: t }));var o = e.data;if (o.error) return s(new B({ code: o.error.code, message: o.error.message, requestId: t }));o.result = o.data, o.requestId = t, delete o.data, n(o);} }));});} };var V = { request: function request(e) {return uni.request(e);}, uploadFile: function uploadFile(e) {return uni.uploadFile(e);}, setStorageSync: function setStorageSync(e, t) {return uni.setStorageSync(e, t);}, getStorageSync: function getStorageSync(e) {return uni.getStorageSync(e);}, removeStorageSync: function removeStorageSync(e) {return uni.removeStorageSync(e);}, clearStorageSync: function clearStorageSync() {return uni.clearStorageSync();} },Y = { "uniCloud.init.paramRequired": "{param} required", "uniCloud.uploadFile.fileError": "filePath should be instance of File" };var _e6 = (0, _uniI18n.initVueI18n)({ "zh-Hans": { "uniCloud.init.paramRequired": "缺少参数:{param}", "uniCloud.uploadFile.fileError": "filePath应为File对象" }, "zh-Hant": { "uniCloud.init.paramRequired": "缺少参数:{param}", "uniCloud.uploadFile.fileError": "filePath应为File对象" }, en: Y, fr: { "uniCloud.init.paramRequired": "{param} required", "uniCloud.uploadFile.fileError": "filePath should be instance of File" }, es: { "uniCloud.init.paramRequired": "{param} required", "uniCloud.uploadFile.fileError": "filePath should be instance of File" }, ja: Y }, "zh-Hans"),X = _e6.t;var G = /*#__PURE__*/function () {function G(e) {_classCallCheck(this, G);["spaceId", "clientSecret"].forEach(function (t) {if (!Object.prototype.hasOwnProperty.call(e, t)) throw new Error(X("uniCloud.init.paramRequired", { param: t }));}), this.config = Object.assign({}, { endpoint: "https://api.bspapp.com" }, e), this.config.provider = "aliyun", this.config.requestUrl = this.config.endpoint + "/client", this.config.envType = this.config.envType || "public", this.config.accessTokenKey = "access_token_" + this.config.spaceId, this.adapter = V, this._getAccessTokenPromise = null, this._getAccessTokenPromiseStatus = null;}_createClass(G, [{ key: "setAccessToken", value: function setAccessToken(e) {this.accessToken = e;} }, { key: "requestWrapped", value: function requestWrapped(e) {return J.wrappedRequest(e, this.adapter.request);} }, { key: "requestAuth", value: function requestAuth(e) {return this.requestWrapped(e);} }, { key: "request", value: function request(e, t) {var _this3 = this;return Promise.resolve().then(function () {return _this3.hasAccessToken ? t ? _this3.requestWrapped(e) : _this3.requestWrapped(e).catch(function (t) {return new Promise(function (e, n) {!t || "GATEWAY_INVALID_TOKEN" !== t.code && "InvalidParameter.InvalidToken" !== t.code ? n(t) : e();}).then(function () {return _this3.getAccessToken();}).then(function () {var t = _this3.rebuildRequest(e);return _this3.request(t, !0);});}) : _this3.getAccessToken().then(function () {var t = _this3.rebuildRequest(e);return _this3.request(t, !0);});});} }, { key: "rebuildRequest", value: function rebuildRequest(e) {var t = Object.assign({}, e);return t.data.token = this.accessToken, t.header["x-basement-token"] = this.accessToken, t.header["x-serverless-sign"] = J.sign(t.data, this.config.clientSecret), t;} }, { key: "setupRequest", value: function setupRequest(e, t) {var n = Object.assign({}, e, { spaceId: this.config.spaceId, timestamp: Date.now() }),s = { "Content-Type": "application/json" };return "auth" !== t && (n.token = this.accessToken, s["x-basement-token"] = this.accessToken), s["x-serverless-sign"] = J.sign(n, this.config.clientSecret), { url: this.config.requestUrl, method: "POST", data: n, dataType: "json", header: s };} }, { key: "getAccessToken", value: function getAccessToken() {var _this4 = this;if ("pending" === this._getAccessTokenPromiseStatus) return this._getAccessTokenPromise;this._getAccessTokenPromiseStatus = "pending";return this._getAccessTokenPromise = this.requestAuth(this.setupRequest({ method: "serverless.auth.user.anonymousAuthorize", params: "{}" }, "auth")).then(function (e) {return new Promise(function (t, n) {e.result && e.result.accessToken ? (_this4.setAccessToken(e.result.accessToken), _this4._getAccessTokenPromiseStatus = "fulfilled", t(_this4.accessToken)) : (_this4._getAccessTokenPromiseStatus = "rejected", n(new B({ code: "AUTH_FAILED", message: "获取accessToken失败" })));});}, function (e) {return _this4._getAccessTokenPromiseStatus = "rejected", Promise.reject(e);}), this._getAccessTokenPromise;} }, { key: "authorize", value: function authorize() {this.getAccessToken();} }, { key: "callFunction", value: function callFunction(e) {var t = { method: "serverless.function.runtime.invoke", params: JSON.stringify({ functionTarget: e.name, functionArgs: e.data || {} }) };return this.request(this.setupRequest(t));} }, { key: "getOSSUploadOptionsFromPath", value: function getOSSUploadOptionsFromPath(e) {var t = { method: "serverless.file.resource.generateProximalSign", params: JSON.stringify(e) };return this.request(this.setupRequest(t));} }, { key: "uploadFileToOSS", value: function uploadFileToOSS(_ref) {var _this5 = this;var e = _ref.url,t = _ref.formData,n = _ref.name,s = _ref.filePath,o = _ref.fileType,r = _ref.onUploadProgress;return new Promise(function (i, a) {var c = _this5.adapter.uploadFile({ url: e, formData: t, name: n, filePath: s, fileType: o, header: { "X-OSS-server-side-encrpytion": "AES256" }, success: function success(e) {e && e.statusCode < 400 ? i(e) : a(new B({ code: "UPLOAD_FAILED", message: "文件上传失败" }));}, fail: function fail(e) {a(new B({ code: e.code || "UPLOAD_FAILED", message: e.message || e.errMsg || "文件上传失败" }));} });"function" == typeof r && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (e) {r({ loaded: e.totalBytesSent, total: e.totalBytesExpectedToSend });});});} }, { key: "reportOSSUpload", value: function reportOSSUpload(e) {var t = { method: "serverless.file.resource.report", params: JSON.stringify(e) };return this.request(this.setupRequest(t));} }, { key: "uploadFile", value: function uploadFile(_ref2) {var _this6 = this;var e = _ref2.filePath,t = _ref2.cloudPath,_ref2$fileType = _ref2.fileType,n = _ref2$fileType === void 0 ? "image" : _ref2$fileType,s = _ref2.onUploadProgress,o = _ref2.config;if ("string" !== u(t)) throw new B({ code: "INVALID_PARAM", message: "cloudPath必须为字符串类型" });if (!(t = t.trim())) throw new B({ code: "CLOUDPATH_REQUIRED", message: "cloudPath不可为空" });if (/:\/\//.test(t)) throw new B({ code: "INVALID_PARAM", message: "cloudPath不合法" });var r = o && o.envType || this.config.envType;var i, a;return this.getOSSUploadOptionsFromPath({ env: r, filename: t }).then(function (t) {var o = t.result;i = o.id, a = "https://" + o.cdnDomain + "/" + o.ossPath;var r = { url: "https://" + o.host, formData: { "Cache-Control": "max-age=2592000", "Content-Disposition": "attachment", OSSAccessKeyId: o.accessKeyId, Signature: o.signature, host: o.host, id: i, key: o.ossPath, policy: o.policy, success_action_status: 200 }, fileName: "file", name: "file", filePath: e, fileType: n };return _this6.uploadFileToOSS(Object.assign({}, r, { onUploadProgress: s }));}).then(function () {return _this6.reportOSSUpload({ id: i });}).then(function (t) {return new Promise(function (n, s) {t.success ? n({ success: !0, filePath: e, fileID: a }) : s(new B({ code: "UPLOAD_FAILED", message: "文件上传失败" }));});});} }, { key: "deleteFile", value: function deleteFile(_ref3) {var e = _ref3.fileList;var t = { method: "serverless.file.resource.delete", params: JSON.stringify({ id: e[0] }) };return this.request(this.setupRequest(t));} }, { key: "getTempFileURL", value: function getTempFileURL() {var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},e = _ref4.fileList;return new Promise(function (t, n) {Array.isArray(e) && 0 !== e.length || n(new B({ code: "INVALID_PARAM", message: "fileList的元素必须是非空的字符串" })), t({ fileList: e.map(function (e) {return { fileID: e, tempFileURL: e };}) });});} }, { key: "hasAccessToken", get: function get() {return !!this.accessToken;} }]);return G;}();var Q = { init: function init(e) {var t = new G(e),n = { signInAnonymously: function signInAnonymously() {return t.authorize();}, getLoginState: function getLoginState() {return Promise.resolve(!1);} };return t.auth = function () {return n;}, t.customAuth = t.auth, t;} };var Z = "undefined" != typeof location && "http:" === location.protocol ? "http:" : "https:";var ee;!function (e) {e.local = "local", e.none = "none", e.session = "session";}(ee || (ee = {}));var te = function te() {};var ne = function ne() {var e;if (!Promise) {e = function e() {}, e.promise = {};var _t3 = function _t3() {throw new B({ message: 'Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.' });};return Object.defineProperty(e.promise, "then", { get: _t3 }), Object.defineProperty(e.promise, "catch", { get: _t3 }), e;}var t = new Promise(function (t, n) {e = function e(_e7, s) {return _e7 ? n(_e7) : t(s);};});return e.promise = t, e;};function se(e) {return void 0 === e;}function oe(e) {return "[object Null]" === Object.prototype.toString.call(e);}var re;function ie(e) {var t = (n = e, "[object Array]" === Object.prototype.toString.call(n) ? e : [e]);var n;var _iterator = _createForOfIteratorHelper(t),_step;try {for (_iterator.s(); !(_step = _iterator.n()).done;) {var _e8 = _step.value;var _t4 = _e8.isMatch,_n2 = _e8.genAdapter,_s2 = _e8.runtime;if (_t4()) return { adapter: _n2(), runtime: _s2 };}} catch (err) {_iterator.e(err);} finally {_iterator.f();}}!function (e) {e.WEB = "web", e.WX_MP = "wx_mp";}(re || (re = {}));var ae = { adapter: null, runtime: void 0 },ce = ["anonymousUuidKey"];var ue = /*#__PURE__*/function (_te) {_inherits(ue, _te);var _super2 = _createSuper(ue);function ue() {var _this7;_classCallCheck(this, ue);_this7 = _super2.call(this), ae.adapter.root.tcbObject || (ae.adapter.root.tcbObject = {});return _this7;}_createClass(ue, [{ key: "setItem", value: function setItem(e, t) {ae.adapter.root.tcbObject[e] = t;} }, { key: "getItem", value: function getItem(e) {return ae.adapter.root.tcbObject[e];} }, { key: "removeItem", value: function removeItem(e) {delete ae.adapter.root.tcbObject[e];} }, { key: "clear", value: function clear() {delete ae.adapter.root.tcbObject;} }]);return ue;}(te);function le(e, t) {switch (e) {case "local":return t.localStorage || new ue();case "none":return new ue();default:return t.sessionStorage || new ue();}}var he = /*#__PURE__*/function () {function he(e) {_classCallCheck(this, he);if (!this._storage) {this._persistence = ae.adapter.primaryStorage || e.persistence, this._storage = le(this._persistence, ae.adapter);var _t5 = "access_token_".concat(e.env),_n3 = "access_token_expire_".concat(e.env),_s3 = "refresh_token_".concat(e.env),_o = "anonymous_uuid_".concat(e.env),_r = "login_type_".concat(e.env),_i = "user_info_".concat(e.env);this.keys = { accessTokenKey: _t5, accessTokenExpireKey: _n3, refreshTokenKey: _s3, anonymousUuidKey: _o, loginTypeKey: _r, userInfoKey: _i };}}_createClass(he, [{ key: "updatePersistence", value: function updatePersistence(e) {if (e === this._persistence) return;var t = "local" === this._persistence;this._persistence = e;var n = le(e, ae.adapter);for (var _e9 in this.keys) {var _s4 = this.keys[_e9];if (t && ce.includes(_e9)) continue;var _o2 = this._storage.getItem(_s4);se(_o2) || oe(_o2) || (n.setItem(_s4, _o2), this._storage.removeItem(_s4));}this._storage = n;} }, { key: "setStore", value: function setStore(e, t, n) {if (!this._storage) return;var s = { version: n || "localCachev1", content: t },o = JSON.stringify(s);try {this._storage.setItem(e, o);} catch (e) {throw e;}} }, { key: "getStore", value: function getStore(e, t) {try {if (!this._storage) return;} catch (e) {return "";}t = t || "localCachev1";var n = this._storage.getItem(e);if (!n) return "";if (n.indexOf(t) >= 0) {return JSON.parse(n).content;}return "";} }, { key: "removeStore", value: function removeStore(e) {this._storage.removeItem(e);} }]);return he;}();var de = {},fe = {};function ge(e) {return de[e];}var pe = function pe(e, t) {_classCallCheck(this, pe);this.data = t || null, this.name = e;};var me = /*#__PURE__*/function (_pe) {_inherits(me, _pe);var _super3 = _createSuper(me);function me(e, t) {var _this8;_classCallCheck(this, me);_this8 = _super3.call(this, "error", { error: e, data: t }), _this8.error = e;return _this8;}return me;}(pe);var ye = new ( /*#__PURE__*/function () {function _class() {_classCallCheck(this, _class);this._listeners = {};}_createClass(_class, [{ key: "on", value: function on(e, t) {return function (e, t, n) {n[e] = n[e] || [], n[e].push(t);}(e, t, this._listeners), this;} }, { key: "off", value: function off(e, t) {return function (e, t, n) {if (n && n[e]) {var _s5 = n[e].indexOf(t);-1 !== _s5 && n[e].splice(_s5, 1);}}(e, t, this._listeners), this;} }, { key: "fire", value: function fire(e, t) {if (e instanceof me) return console.error(e.error), this;var n = "string" == typeof e ? new pe(e, t || {}) : e;var s = n.name;if (this._listens(s)) {n.target = this;var _e10 = this._listeners[s] ? _toConsumableArray(this._listeners[s]) : [];var _iterator2 = _createForOfIteratorHelper(_e10),_step2;try {for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {var _t6 = _step2.value;_t6.call(this, n);}} catch (err) {_iterator2.e(err);} finally {_iterator2.f();}}return this;} }, { key: "_listens", value: function _listens(e) {return this._listeners[e] && this._listeners[e].length > 0;} }]);return _class;}())();function _e(e, t) {ye.on(e, t);}function we(e) {var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};ye.fire(e, t);}function ke(e, t) {ye.off(e, t);}var ve = "loginStateChanged",Te = "loginStateExpire",Se = "loginTypeChanged",Pe = "anonymousConverted",Ae = "refreshAccessToken";var Ie;!function (e) {e.ANONYMOUS = "ANONYMOUS", e.WECHAT = "WECHAT", e.WECHAT_PUBLIC = "WECHAT-PUBLIC", e.WECHAT_OPEN = "WECHAT-OPEN", e.CUSTOM = "CUSTOM", e.EMAIL = "EMAIL", e.USERNAME = "USERNAME", e.NULL = "NULL";}(Ie || (Ie = {}));var be = ["auth.getJwt", "auth.logout", "auth.signInWithTicket", "auth.signInAnonymously", "auth.signIn", "auth.fetchAccessTokenWithRefreshToken", "auth.signUpWithEmailAndPassword", "auth.activateEndUserMail", "auth.sendPasswordResetEmail", "auth.resetPasswordWithToken", "auth.isUsernameRegistered"],Oe = { "X-SDK-Version": "1.3.5" };function Ce(e, t, n) {var s = e[t];e[t] = function (t) {var o = {},r = {};n.forEach(function (n) {var _n$call = n.call(e, t),s = _n$call.data,i = _n$call.headers;Object.assign(o, s), Object.assign(r, i);});var i = t.data;return i && function () {var e;if (e = i, "[object FormData]" !== Object.prototype.toString.call(e)) t.data = _objectSpread(_objectSpread({}, i), o);else for (var _e11 in o) {i.append(_e11, o[_e11]);}}(), t.headers = _objectSpread(_objectSpread({}, t.headers || {}), r), s.call(e, t);};}function Ee() {var e = Math.random().toString(16).slice(2);return { data: { seqId: e }, headers: _objectSpread(_objectSpread({}, Oe), {}, { "x-seqid": e }) };}var Re = /*#__PURE__*/function () {function Re() {var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};_classCallCheck(this, Re);var t;this.config = e, this._reqClass = new ae.adapter.reqClass({ timeout: this.config.timeout, timeoutMsg: "\u8BF7\u6C42\u5728".concat(this.config.timeout / 1e3, "s\u5185\u672A\u5B8C\u6210\uFF0C\u5DF2\u4E2D\u65AD"), restrictedMethods: ["post"] }), this._cache = ge(this.config.env), this._localCache = (t = this.config.env, fe[t]), Ce(this._reqClass, "post", [Ee]), Ce(this._reqClass, "upload", [Ee]), Ce(this._reqClass, "download", [Ee]);}_createClass(Re, [{ key: "post", value: function () {var _post = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee(e) {return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:_context.next = 2;return this._reqClass.post(e);case 2:return _context.abrupt("return", _context.sent);case 3:case "end":return _context.stop();}}}, _callee, this);}));function post(_x) {return _post.apply(this, arguments);}return post;}() }, { key: "upload", value: function () {var _upload = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee2(e) {return _regenerator.default.wrap(function _callee2$(_context2) {while (1) {switch (_context2.prev = _context2.next) {case 0:_context2.next = 2;return this._reqClass.upload(e);case 2:return _context2.abrupt("return", _context2.sent);case 3:case "end":return _context2.stop();}}}, _callee2, this);}));function upload(_x2) {return _upload.apply(this, arguments);}return upload;}() }, { key: "download", value: function () {var _download = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee3(e) {return _regenerator.default.wrap(function _callee3$(_context3) {while (1) {switch (_context3.prev = _context3.next) {case 0:_context3.next = 2;return this._reqClass.download(e);case 2:return _context3.abrupt("return", _context3.sent);case 3:case "end":return _context3.stop();}}}, _callee3, this);}));function download(_x3) {return _download.apply(this, arguments);}return download;}() }, { key: "refreshAccessToken", value: function () {var _refreshAccessToken2 = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee4() {var e, t;return _regenerator.default.wrap(function _callee4$(_context4) {while (1) {switch (_context4.prev = _context4.next) {case 0:this._refreshAccessTokenPromise || (this._refreshAccessTokenPromise = this._refreshAccessToken());_context4.prev = 1;_context4.next = 4;return this._refreshAccessTokenPromise;case 4:e = _context4.sent;_context4.next = 10;break;case 7:_context4.prev = 7;_context4.t0 = _context4["catch"](1);t = _context4.t0;case 10:if (!(this._refreshAccessTokenPromise = null, this._shouldRefreshAccessTokenHook = null, t)) {_context4.next = 12;break;}throw t;case 12:return _context4.abrupt("return", e);case 13:case "end":return _context4.stop();}}}, _callee4, this, [[1, 7]]);}));function refreshAccessToken() {return _refreshAccessToken2.apply(this, arguments);}return refreshAccessToken;}() }, { key: "_refreshAccessToken", value: function () {var _refreshAccessToken3 = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee5() {var _this$_cache$keys, e, t, n, s, o, r, i, a, _e12, _e13, _t7, _s6;return _regenerator.default.wrap(function _callee5$(_context5) {while (1) {switch (_context5.prev = _context5.next) {case 0:_this$_cache$keys = this._cache.keys, e = _this$_cache$keys.accessTokenKey, t = _this$_cache$keys.accessTokenExpireKey, n = _this$_cache$keys.refreshTokenKey, s = _this$_cache$keys.loginTypeKey, o = _this$_cache$keys.anonymousUuidKey;this._cache.removeStore(e), this._cache.removeStore(t);r = this._cache.getStore(n);if (r) {_context5.next = 5;break;}throw new B({ message: "未登录CloudBase" });case 5:i = { refresh_token: r };_context5.next = 8;return this.request("auth.fetchAccessTokenWithRefreshToken", i);case 8:a = _context5.sent;if (!a.data.code) {_context5.next = 21;break;}_e12 = a.data.code;if (!("SIGN_PARAM_INVALID" === _e12 || "REFRESH_TOKEN_EXPIRED" === _e12 || "INVALID_REFRESH_TOKEN" === _e12)) {_context5.next = 20;break;}if (!(this._cache.getStore(s) === Ie.ANONYMOUS && "INVALID_REFRESH_TOKEN" === _e12)) {_context5.next = 19;break;}_e13 = this._cache.getStore(o);_t7 = this._cache.getStore(n);_context5.next = 17;return this.send("auth.signInAnonymously", { anonymous_uuid: _e13, refresh_token: _t7 });case 17:_s6 = _context5.sent;return _context5.abrupt("return", (this.setRefreshToken(_s6.refresh_token), this._refreshAccessToken()));case 19:we(Te), this._cache.removeStore(n);case 20:throw new B({ code: a.data.code, message: "\u5237\u65B0access token\u5931\u8D25\uFF1A".concat(a.data.code) });case 21:if (!a.data.access_token) {_context5.next = 23;break;}return _context5.abrupt("return", (we(Ae), this._cache.setStore(e, a.data.access_token), this._cache.setStore(t, a.data.access_token_expire + Date.now()), { accessToken: a.data.access_token, accessTokenExpire: a.data.access_token_expire }));case 23:a.data.refresh_token && (this._cache.removeStore(n), this._cache.setStore(n, a.data.refresh_token), this._refreshAccessToken());case 24:case "end":return _context5.stop();}}}, _callee5, this);}));function _refreshAccessToken() {return _refreshAccessToken3.apply(this, arguments);}return _refreshAccessToken;}() }, { key: "getAccessToken", value: function () {var _getAccessToken = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee6() {var _this$_cache$keys2, e, t, n, s, o, r;return _regenerator.default.wrap(function _callee6$(_context6) {while (1) {switch (_context6.prev = _context6.next) {case 0:_this$_cache$keys2 = this._cache.keys, e = _this$_cache$keys2.accessTokenKey, t = _this$_cache$keys2.accessTokenExpireKey, n = _this$_cache$keys2.refreshTokenKey;if (this._cache.getStore(n)) {_context6.next = 3;break;}throw new B({ message: "refresh token不存在,登录状态异常" });case 3:s = this._cache.getStore(e), o = this._cache.getStore(t), r = !0;_context6.t0 = this._shouldRefreshAccessTokenHook;if (!_context6.t0) {_context6.next = 9;break;}_context6.next = 8;return this._shouldRefreshAccessTokenHook(s, o);case 8:_context6.t0 = !_context6.sent;case 9:_context6.t1 = _context6.t0;if (!_context6.t1) {_context6.next = 12;break;}r = !1;case 12:return _context6.abrupt("return", (!s || !o || o < Date.now()) && r ? this.refreshAccessToken() : { accessToken: s, accessTokenExpire: o });case 13:case "end":return _context6.stop();}}}, _callee6, this);}));function getAccessToken() {return _getAccessToken.apply(this, arguments);}return getAccessToken;}() }, { key: "request", value: function () {var _request = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee7(e, t, n) {var s, o, r, _e14, i, _e15, _e16, a, c, u, l, h, d, f, g, p;return _regenerator.default.wrap(function _callee7$(_context7) {while (1) {switch (_context7.prev = _context7.next) {case 0:s = "x-tcb-trace_".concat(this.config.env);o = "application/x-www-form-urlencoded";r = _objectSpread({ action: e, env: this.config.env, dataVersion: "2019-08-16" }, t);if (!(-1 === be.indexOf(e))) {_context7.next = 10;break;}_e14 = this._cache.keys.refreshTokenKey;_context7.t0 = this._cache.getStore(_e14);if (!_context7.t0) {_context7.next = 10;break;}_context7.next = 9;return this.getAccessToken();case 9:r.access_token = _context7.sent.accessToken;case 10:if ("storage.uploadFile" === e) {i = new FormData();for (_e15 in i) {i.hasOwnProperty(_e15) && void 0 !== i[_e15] && i.append(_e15, r[_e15]);}o = "multipart/form-data";} else {o = "application/json", i = {};for (_e16 in r) {void 0 !== r[_e16] && (i[_e16] = r[_e16]);}}a = { headers: { "content-type": o } };n && n.onUploadProgress && (a.onUploadProgress = n.onUploadProgress);c = this._localCache.getStore(s);c && (a.headers["X-TCB-Trace"] = c);u = t.parse, l = t.inQuery, h = t.search;d = { env: this.config.env };u && (d.parse = !0), l && (d = _objectSpread(_objectSpread({}, l), d));f = function (e, t) {var n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};var s = /\?/.test(t);var o = "";for (var _e17 in n) {"" === o ? !s && (t += "?") : o += "&", o += "".concat(_e17, "=").concat(encodeURIComponent(n[_e17]));}return /^http(s)?\:\/\//.test(t += o) ? t : "".concat(e).concat(t);}(Z, "//tcb-api.tencentcloudapi.com/web", d);h && (f += h);_context7.next = 22;return this.post(_objectSpread({ url: f, data: i }, a));case 22:g = _context7.sent;p = g.header && g.header["x-tcb-trace"];if (!(p && this._localCache.setStore(s, p), 200 !== Number(g.status) && 200 !== Number(g.statusCode) || !g.data)) {_context7.next = 26;break;}throw new B({ code: "NETWORK_ERROR", message: "network request error" });case 26:return _context7.abrupt("return", g);case 27:case "end":return _context7.stop();}}}, _callee7, this);}));function request(_x4, _x5, _x6) {return _request.apply(this, arguments);}return request;}() }, { key: "send", value: function () {var _send = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee8(e) {var t,n,_n4,_args8 = arguments;return _regenerator.default.wrap(function _callee8$(_context8) {while (1) {switch (_context8.prev = _context8.next) {case 0:t = _args8.length > 1 && _args8[1] !== undefined ? _args8[1] : {};_context8.next = 3;return this.request(e, t, { onUploadProgress: t.onUploadProgress });case 3:n = _context8.sent;if (!("ACCESS_TOKEN_EXPIRED" === n.data.code && -1 === be.indexOf(e))) {_context8.next = 13;break;}_context8.next = 7;return this.refreshAccessToken();case 7:_context8.next = 9;return this.request(e, t, { onUploadProgress: t.onUploadProgress });case 9:_n4 = _context8.sent;if (!_n4.data.code) {_context8.next = 12;break;}throw new B({ code: _n4.data.code, message: _n4.data.message });case 12:return _context8.abrupt("return", _n4.data);case 13:if (!n.data.code) {_context8.next = 15;break;}throw new B({ code: n.data.code, message: n.data.message });case 15:return _context8.abrupt("return", n.data);case 16:case "end":return _context8.stop();}}}, _callee8, this);}));function send(_x7) {return _send.apply(this, arguments);}return send;}() }, { key: "setRefreshToken", value: function setRefreshToken(e) {var _this$_cache$keys3 = this._cache.keys,t = _this$_cache$keys3.accessTokenKey,n = _this$_cache$keys3.accessTokenExpireKey,s = _this$_cache$keys3.refreshTokenKey;this._cache.removeStore(t), this._cache.removeStore(n), this._cache.setStore(s, e);} }]);return Re;}();var Ue = {};function xe(e) {return Ue[e];}var Le = /*#__PURE__*/function () {function Le(e) {_classCallCheck(this, Le);this.config = e, this._cache = ge(e.env), this._request = xe(e.env);}_createClass(Le, [{ key: "setRefreshToken", value: function setRefreshToken(e) {var _this$_cache$keys4 = this._cache.keys,t = _this$_cache$keys4.accessTokenKey,n = _this$_cache$keys4.accessTokenExpireKey,s = _this$_cache$keys4.refreshTokenKey;this._cache.removeStore(t), this._cache.removeStore(n), this._cache.setStore(s, e);} }, { key: "setAccessToken", value: function setAccessToken(e, t) {var _this$_cache$keys5 = this._cache.keys,n = _this$_cache$keys5.accessTokenKey,s = _this$_cache$keys5.accessTokenExpireKey;this._cache.setStore(n, e), this._cache.setStore(s, t);} }, { key: "refreshUserInfo", value: function () {var _refreshUserInfo = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee9() {var _yield$this$_request$, e;return _regenerator.default.wrap(function _callee9$(_context9) {while (1) {switch (_context9.prev = _context9.next) {case 0:_context9.next = 2;return this._request.send("auth.getUserInfo", {});case 2:_yield$this$_request$ = _context9.sent;e = _yield$this$_request$.data;return _context9.abrupt("return", (this.setLocalUserInfo(e), e));case 5:case "end":return _context9.stop();}}}, _callee9, this);}));function refreshUserInfo() {return _refreshUserInfo.apply(this, arguments);}return refreshUserInfo;}() }, { key: "setLocalUserInfo", value: function setLocalUserInfo(e) {var t = this._cache.keys.userInfoKey;this._cache.setStore(t, e);} }]);return Le;}();var De = /*#__PURE__*/function () {function De(e) {_classCallCheck(this, De);if (!e) throw new B({ code: "PARAM_ERROR", message: "envId is not defined" });this._envId = e, this._cache = ge(this._envId), this._request = xe(this._envId), this.setUserInfo();}_createClass(De, [{ key: "linkWithTicket", value: function linkWithTicket(e) {if ("string" != typeof e) throw new B({ code: "PARAM_ERROR", message: "ticket must be string" });return this._request.send("auth.linkWithTicket", { ticket: e });} }, { key: "linkWithRedirect", value: function linkWithRedirect(e) {e.signInWithRedirect();} }, { key: "updatePassword", value: function updatePassword(e, t) {return this._request.send("auth.updatePassword", { oldPassword: t, newPassword: e });} }, { key: "updateEmail", value: function updateEmail(e) {return this._request.send("auth.updateEmail", { newEmail: e });} }, { key: "updateUsername", value: function updateUsername(e) {if ("string" != typeof e) throw new B({ code: "PARAM_ERROR", message: "username must be a string" });return this._request.send("auth.updateUsername", { username: e });} }, { key: "getLinkedUidList", value: function () {var _getLinkedUidList = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee10() {var _yield$this$_request$2, e, t, n;return _regenerator.default.wrap(function _callee10$(_context10) {while (1) {switch (_context10.prev = _context10.next) {case 0:_context10.next = 2;return this._request.send("auth.getLinkedUidList", {});case 2:_yield$this$_request$2 = _context10.sent;e = _yield$this$_request$2.data;t = !1;n = e.users;return _context10.abrupt("return", (n.forEach(function (e) {e.wxOpenId && e.wxPublicId && (t = !0);}), { users: n, hasPrimaryUid: t }));case 7:case "end":return _context10.stop();}}}, _callee10, this);}));function getLinkedUidList() {return _getLinkedUidList.apply(this, arguments);}return getLinkedUidList;}() }, { key: "setPrimaryUid", value: function setPrimaryUid(e) {return this._request.send("auth.setPrimaryUid", { uid: e });} }, { key: "unlink", value: function unlink(e) {return this._request.send("auth.unlink", { platform: e });} }, { key: "update", value: function () {var _update = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee11(e) {var t, n, s, o, r, i, _yield$this$_request$3, a;return _regenerator.default.wrap(function _callee11$(_context11) {while (1) {switch (_context11.prev = _context11.next) {case 0:t = e.nickName;n = e.gender;s = e.avatarUrl;o = e.province;r = e.country;i = e.city;_context11.next = 8;return this._request.send("auth.updateUserInfo", { nickName: t, gender: n, avatarUrl: s, province: o, country: r, city: i });case 8:_yield$this$_request$3 = _context11.sent;a = _yield$this$_request$3.data;this.setLocalUserInfo(a);case 11:case "end":return _context11.stop();}}}, _callee11, this);}));function update(_x8) {return _update.apply(this, arguments);}return update;}() }, { key: "refresh", value: function () {var _refresh = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee12() {var _yield$this$_request$4, e;return _regenerator.default.wrap(function _callee12$(_context12) {while (1) {switch (_context12.prev = _context12.next) {case 0:_context12.next = 2;return this._request.send("auth.getUserInfo", {});case 2:_yield$this$_request$4 = _context12.sent;e = _yield$this$_request$4.data;return _context12.abrupt("return", (this.setLocalUserInfo(e), e));case 5:case "end":return _context12.stop();}}}, _callee12, this);}));function refresh() {return _refresh.apply(this, arguments);}return refresh;}() }, { key: "setUserInfo", value: function setUserInfo() {var _this9 = this;var e = this._cache.keys.userInfoKey,t = this._cache.getStore(e);["uid", "loginType", "openid", "wxOpenId", "wxPublicId", "unionId", "qqMiniOpenId", "email", "hasPassword", "customUserId", "nickName", "gender", "avatarUrl"].forEach(function (e) {_this9[e] = t[e];}), this.location = { country: t.country, province: t.province, city: t.city };} }, { key: "setLocalUserInfo", value: function setLocalUserInfo(e) {var t = this._cache.keys.userInfoKey;this._cache.setStore(t, e), this.setUserInfo();} }]);return De;}();var Ne = /*#__PURE__*/function () {function Ne(e) {_classCallCheck(this, Ne);if (!e) throw new B({ code: "PARAM_ERROR", message: "envId is not defined" });this._cache = ge(e);var _this$_cache$keys6 = this._cache.keys,t = _this$_cache$keys6.refreshTokenKey,n = _this$_cache$keys6.accessTokenKey,s = _this$_cache$keys6.accessTokenExpireKey,o = this._cache.getStore(t),r = this._cache.getStore(n),i = this._cache.getStore(s);this.credential = { refreshToken: o, accessToken: r, accessTokenExpire: i }, this.user = new De(e);}_createClass(Ne, [{ key: "isAnonymousAuth", get: function get() {return this.loginType === Ie.ANONYMOUS;} }, { key: "isCustomAuth", get: function get() {return this.loginType === Ie.CUSTOM;} }, { key: "isWeixinAuth", get: function get() {return this.loginType === Ie.WECHAT || this.loginType === Ie.WECHAT_OPEN || this.loginType === Ie.WECHAT_PUBLIC;} }, { key: "loginType", get: function get() {return this._cache.getStore(this._cache.keys.loginTypeKey);} }]);return Ne;}();var qe = /*#__PURE__*/function (_Le) {_inherits(qe, _Le);var _super4 = _createSuper(qe);function qe() {_classCallCheck(this, qe);return _super4.apply(this, arguments);}_createClass(qe, [{ key: "signIn", value: function () {var _signIn = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee13() {var _this$_cache$keys7, e, t, n, s, o, _e18;return _regenerator.default.wrap(function _callee13$(_context13) {while (1) {switch (_context13.prev = _context13.next) {case 0:this._cache.updatePersistence("local");_this$_cache$keys7 = this._cache.keys;e = _this$_cache$keys7.anonymousUuidKey;t = _this$_cache$keys7.refreshTokenKey;n = this._cache.getStore(e) || void 0;s = this._cache.getStore(t) || void 0;_context13.next = 8;return this._request.send("auth.signInAnonymously", { anonymous_uuid: n, refresh_token: s });case 8:o = _context13.sent;if (!(o.uuid && o.refresh_token)) {_context13.next = 20;break;}this._setAnonymousUUID(o.uuid);this.setRefreshToken(o.refresh_token);_context13.next = 14;return this._request.refreshAccessToken();case 14:we(ve);we(Se, { env: this.config.env, loginType: Ie.ANONYMOUS, persistence: "local" });_e18 = new Ne(this.config.env);_context13.next = 19;return _e18.user.refresh();case 19:return _context13.abrupt("return", _e18);case 20:throw new B({ message: "匿名登录失败" });case 21:case "end":return _context13.stop();}}}, _callee13, this);}));function signIn() {return _signIn.apply(this, arguments);}return signIn;}() }, { key: "linkAndRetrieveDataWithTicket", value: function () {var _linkAndRetrieveDataWithTicket = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee14(e) {var _this$_cache$keys8, t, n, s, o, r;return _regenerator.default.wrap(function _callee14$(_context14) {while (1) {switch (_context14.prev = _context14.next) {case 0:_this$_cache$keys8 = this._cache.keys;t = _this$_cache$keys8.anonymousUuidKey;n = _this$_cache$keys8.refreshTokenKey;s = this._cache.getStore(t);o = this._cache.getStore(n);_context14.next = 7;return this._request.send("auth.linkAndRetrieveDataWithTicket", { anonymous_uuid: s, refresh_token: o, ticket: e });case 7:r = _context14.sent;if (!r.refresh_token) {_context14.next = 16;break;}this._clearAnonymousUUID();this.setRefreshToken(r.refresh_token);_context14.next = 13;return this._request.refreshAccessToken();case 13:we(Pe, { env: this.config.env });we(Se, { loginType: Ie.CUSTOM, persistence: "local" });return _context14.abrupt("return", { credential: { refreshToken: r.refresh_token } });case 16:throw new B({ message: "匿名转化失败" });case 17:case "end":return _context14.stop();}}}, _callee14, this);}));function linkAndRetrieveDataWithTicket(_x9) {return _linkAndRetrieveDataWithTicket.apply(this, arguments);}return linkAndRetrieveDataWithTicket;}() }, { key: "_setAnonymousUUID", value: function _setAnonymousUUID(e) {var _this$_cache$keys9 = this._cache.keys,t = _this$_cache$keys9.anonymousUuidKey,n = _this$_cache$keys9.loginTypeKey;this._cache.removeStore(t), this._cache.setStore(t, e), this._cache.setStore(n, Ie.ANONYMOUS);} }, { key: "_clearAnonymousUUID", value: function _clearAnonymousUUID() {this._cache.removeStore(this._cache.keys.anonymousUuidKey);} }]);return qe;}(Le);var Fe = /*#__PURE__*/function (_Le2) {_inherits(Fe, _Le2);var _super5 = _createSuper(Fe);function Fe() {_classCallCheck(this, Fe);return _super5.apply(this, arguments);}_createClass(Fe, [{ key: "signIn", value: function () {var _signIn2 = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee15(e) {var t, n;return _regenerator.default.wrap(function _callee15$(_context15) {while (1) {switch (_context15.prev = _context15.next) {case 0:if (!("string" != typeof e)) {_context15.next = 2;break;}throw new B({ param: "PARAM_ERROR", message: "ticket must be a string" });case 2:t = this._cache.keys.refreshTokenKey;_context15.next = 5;return this._request.send("auth.signInWithTicket", { ticket: e, refresh_token: this._cache.getStore(t) || "" });case 5:n = _context15.sent;if (!n.refresh_token) {_context15.next = 15;break;}this.setRefreshToken(n.refresh_token);_context15.next = 10;return this._request.refreshAccessToken();case 10:we(ve);we(Se, { env: this.config.env, loginType: Ie.CUSTOM, persistence: this.config.persistence });_context15.next = 14;return this.refreshUserInfo();case 14:return _context15.abrupt("return", new Ne(this.config.env));case 15:throw new B({ message: "自定义登录失败" });case 16:case "end":return _context15.stop();}}}, _callee15, this);}));function signIn(_x10) {return _signIn2.apply(this, arguments);}return signIn;}() }]);return Fe;}(Le);var Me = /*#__PURE__*/function (_Le3) {_inherits(Me, _Le3);var _super6 = _createSuper(Me);function Me() {_classCallCheck(this, Me);return _super6.apply(this, arguments);}_createClass(Me, [{ key: "signIn", value: function () {var _signIn3 = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee16(e, t) {var n, s, o, r, i;return _regenerator.default.wrap(function _callee16$(_context16) {while (1) {switch (_context16.prev = _context16.next) {case 0:if (!("string" != typeof e)) {_context16.next = 2;break;}throw new B({ code: "PARAM_ERROR", message: "email must be a string" });case 2:n = this._cache.keys.refreshTokenKey;_context16.next = 5;return this._request.send("auth.signIn", { loginType: "EMAIL", email: e, password: t, refresh_token: this._cache.getStore(n) || "" });case 5:s = _context16.sent;o = s.refresh_token;r = s.access_token;i = s.access_token_expire;if (!o) {_context16.next = 22;break;}this.setRefreshToken(o);if (!(r && i)) {_context16.next = 15;break;}this.setAccessToken(r, i);_context16.next = 17;break;case 15:_context16.next = 17;return this._request.refreshAccessToken();case 17:_context16.next = 19;return this.refreshUserInfo();case 19:we(ve);we(Se, { env: this.config.env, loginType: Ie.EMAIL, persistence: this.config.persistence });return _context16.abrupt("return", new Ne(this.config.env));case 22:throw s.code ? new B({ code: s.code, message: "\u90AE\u7BB1\u767B\u5F55\u5931\u8D25: ".concat(s.message) }) : new B({ message: "邮箱登录失败" });case 23:case "end":return _context16.stop();}}}, _callee16, this);}));function signIn(_x11, _x12) {return _signIn3.apply(this, arguments);}return signIn;}() }, { key: "activate", value: function () {var _activate = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee17(e) {return _regenerator.default.wrap(function _callee17$(_context17) {while (1) {switch (_context17.prev = _context17.next) {case 0:return _context17.abrupt("return", this._request.send("auth.activateEndUserMail", { token: e }));case 1:case "end":return _context17.stop();}}}, _callee17, this);}));function activate(_x13) {return _activate.apply(this, arguments);}return activate;}() }, { key: "resetPasswordWithToken", value: function () {var _resetPasswordWithToken = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee18(e, t) {return _regenerator.default.wrap(function _callee18$(_context18) {while (1) {switch (_context18.prev = _context18.next) {case 0:return _context18.abrupt("return", this._request.send("auth.resetPasswordWithToken", { token: e, newPassword: t }));case 1:case "end":return _context18.stop();}}}, _callee18, this);}));function resetPasswordWithToken(_x14, _x15) {return _resetPasswordWithToken.apply(this, arguments);}return resetPasswordWithToken;}() }]);return Me;}(Le);var je = /*#__PURE__*/function (_Le4) {_inherits(je, _Le4);var _super7 = _createSuper(je);function je() {_classCallCheck(this, je);return _super7.apply(this, arguments);}_createClass(je, [{ key: "signIn", value: function () {var _signIn4 = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee19(e, t) {var n, s, o, r, i;return _regenerator.default.wrap(function _callee19$(_context19) {while (1) {switch (_context19.prev = _context19.next) {case 0:if (!("string" != typeof e)) {_context19.next = 2;break;}throw new B({ code: "PARAM_ERROR", message: "username must be a string" });case 2:"string" != typeof t && (t = "", console.warn("password is empty"));n = this._cache.keys.refreshTokenKey;_context19.next = 6;return this._request.send("auth.signIn", { loginType: Ie.USERNAME, username: e, password: t, refresh_token: this._cache.getStore(n) || "" });case 6:s = _context19.sent;o = s.refresh_token;r = s.access_token_expire;i = s.access_token;if (!o) {_context19.next = 23;break;}this.setRefreshToken(o);if (!(i && r)) {_context19.next = 16;break;}this.setAccessToken(i, r);_context19.next = 18;break;case 16:_context19.next = 18;return this._request.refreshAccessToken();case 18:_context19.next = 20;return this.refreshUserInfo();case 20:we(ve);we(Se, { env: this.config.env, loginType: Ie.USERNAME, persistence: this.config.persistence });return _context19.abrupt("return", new Ne(this.config.env));case 23:throw s.code ? new B({ code: s.code, message: "\u7528\u6237\u540D\u5BC6\u7801\u767B\u5F55\u5931\u8D25: ".concat(s.message) }) : new B({ message: "用户名密码登录失败" });case 24:case "end":return _context19.stop();}}}, _callee19, this);}));function signIn(_x16, _x17) {return _signIn4.apply(this, arguments);}return signIn;}() }]);return je;}(Le);var $e = /*#__PURE__*/function () {function $e(e) {_classCallCheck(this, $e);this.config = e, this._cache = ge(e.env), this._request = xe(e.env), this._onAnonymousConverted = this._onAnonymousConverted.bind(this), this._onLoginTypeChanged = this._onLoginTypeChanged.bind(this), _e(Se, this._onLoginTypeChanged);}_createClass($e, [{ key: "anonymousAuthProvider", value: function anonymousAuthProvider() {return new qe(this.config);} }, { key: "customAuthProvider", value: function customAuthProvider() {return new Fe(this.config);} }, { key: "emailAuthProvider", value: function emailAuthProvider() {return new Me(this.config);} }, { key: "usernameAuthProvider", value: function usernameAuthProvider() {return new je(this.config);} }, { key: "signInAnonymously", value: function () {var _signInAnonymously = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee20() {return _regenerator.default.wrap(function _callee20$(_context20) {while (1) {switch (_context20.prev = _context20.next) {case 0:return _context20.abrupt("return", new qe(this.config).signIn());case 1:case "end":return _context20.stop();}}}, _callee20, this);}));function signInAnonymously() {return _signInAnonymously.apply(this, arguments);}return signInAnonymously;}() }, { key: "signInWithEmailAndPassword", value: function () {var _signInWithEmailAndPassword = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee21(e, t) {return _regenerator.default.wrap(function _callee21$(_context21) {while (1) {switch (_context21.prev = _context21.next) {case 0:return _context21.abrupt("return", new Me(this.config).signIn(e, t));case 1:case "end":return _context21.stop();}}}, _callee21, this);}));function signInWithEmailAndPassword(_x18, _x19) {return _signInWithEmailAndPassword.apply(this, arguments);}return signInWithEmailAndPassword;}() }, { key: "signInWithUsernameAndPassword", value: function signInWithUsernameAndPassword(e, t) {return new je(this.config).signIn(e, t);} }, { key: "linkAndRetrieveDataWithTicket", value: function () {var _linkAndRetrieveDataWithTicket2 = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee22(e) {return _regenerator.default.wrap(function _callee22$(_context22) {while (1) {switch (_context22.prev = _context22.next) {case 0:this._anonymousAuthProvider || (this._anonymousAuthProvider = new qe(this.config)), _e(Pe, this._onAnonymousConverted);_context22.next = 3;return this._anonymousAuthProvider.linkAndRetrieveDataWithTicket(e);case 3:return _context22.abrupt("return", _context22.sent);case 4:case "end":return _context22.stop();}}}, _callee22, this);}));function linkAndRetrieveDataWithTicket(_x20) {return _linkAndRetrieveDataWithTicket2.apply(this, arguments);}return linkAndRetrieveDataWithTicket;}() }, { key: "signOut", value: function () {var _signOut = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee23() {var _this$_cache$keys10, e, t, n, s, o;return _regenerator.default.wrap(function _callee23$(_context23) {while (1) {switch (_context23.prev = _context23.next) {case 0:if (!(this.loginType === Ie.ANONYMOUS)) {_context23.next = 2;break;}throw new B({ message: "匿名用户不支持登出操作" });case 2:_this$_cache$keys10 = this._cache.keys, e = _this$_cache$keys10.refreshTokenKey, t = _this$_cache$keys10.accessTokenKey, n = _this$_cache$keys10.accessTokenExpireKey, s = this._cache.getStore(e);if (s) {_context23.next = 5;break;}return _context23.abrupt("return");case 5:_context23.next = 7;return this._request.send("auth.logout", { refresh_token: s });case 7:o = _context23.sent;return _context23.abrupt("return", (this._cache.removeStore(e), this._cache.removeStore(t), this._cache.removeStore(n), we(ve), we(Se, { env: this.config.env, loginType: Ie.NULL, persistence: this.config.persistence }), o));case 9:case "end":return _context23.stop();}}}, _callee23, this);}));function signOut() {return _signOut.apply(this, arguments);}return signOut;}() }, { key: "signUpWithEmailAndPassword", value: function () {var _signUpWithEmailAndPassword = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee24(e, t) {return _regenerator.default.wrap(function _callee24$(_context24) {while (1) {switch (_context24.prev = _context24.next) {case 0:return _context24.abrupt("return", this._request.send("auth.signUpWithEmailAndPassword", { email: e, password: t }));case 1:case "end":return _context24.stop();}}}, _callee24, this);}));function signUpWithEmailAndPassword(_x21, _x22) {return _signUpWithEmailAndPassword.apply(this, arguments);}return signUpWithEmailAndPassword;}() }, { key: "sendPasswordResetEmail", value: function () {var _sendPasswordResetEmail = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee25(e) {return _regenerator.default.wrap(function _callee25$(_context25) {while (1) {switch (_context25.prev = _context25.next) {case 0:return _context25.abrupt("return", this._request.send("auth.sendPasswordResetEmail", { email: e }));case 1:case "end":return _context25.stop();}}}, _callee25, this);}));function sendPasswordResetEmail(_x23) {return _sendPasswordResetEmail.apply(this, arguments);}return sendPasswordResetEmail;}() }, { key: "onLoginStateChanged", value: function onLoginStateChanged(e) {var _this10 = this;_e(ve, function () {var t = _this10.hasLoginState();e.call(_this10, t);});var t = this.hasLoginState();e.call(this, t);} }, { key: "onLoginStateExpired", value: function onLoginStateExpired(e) {_e(Te, e.bind(this));} }, { key: "onAccessTokenRefreshed", value: function onAccessTokenRefreshed(e) {_e(Ae, e.bind(this));} }, { key: "onAnonymousConverted", value: function onAnonymousConverted(e) {_e(Pe, e.bind(this));} }, { key: "onLoginTypeChanged", value: function onLoginTypeChanged(e) {var _this11 = this;_e(Se, function () {var t = _this11.hasLoginState();e.call(_this11, t);});} }, { key: "getAccessToken", value: function () {var _getAccessToken2 = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee26() {return _regenerator.default.wrap(function _callee26$(_context26) {while (1) {switch (_context26.prev = _context26.next) {case 0:_context26.next = 2;return this._request.getAccessToken();case 2:_context26.t0 = _context26.sent.accessToken;_context26.t1 = this.config.env;return _context26.abrupt("return", { accessToken: _context26.t0, env: _context26.t1 });case 5:case "end":return _context26.stop();}}}, _callee26, this);}));function getAccessToken() {return _getAccessToken2.apply(this, arguments);}return getAccessToken;}() }, { key: "hasLoginState", value: function hasLoginState() {var e = this._cache.keys.refreshTokenKey;return this._cache.getStore(e) ? new Ne(this.config.env) : null;} }, { key: "isUsernameRegistered", value: function () {var _isUsernameRegistered = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee27(e) {var _yield$this$_request$5, t;return _regenerator.default.wrap(function _callee27$(_context27) {while (1) {switch (_context27.prev = _context27.next) {case 0:if (!("string" != typeof e)) {_context27.next = 2;break;}throw new B({ code: "PARAM_ERROR", message: "username must be a string" });case 2:_context27.next = 4;return this._request.send("auth.isUsernameRegistered", { username: e });case 4:_yield$this$_request$5 = _context27.sent;t = _yield$this$_request$5.data;return _context27.abrupt("return", t && t.isRegistered);case 7:case "end":return _context27.stop();}}}, _callee27, this);}));function isUsernameRegistered(_x24) {return _isUsernameRegistered.apply(this, arguments);}return isUsernameRegistered;}() }, { key: "getLoginState", value: function getLoginState() {return Promise.resolve(this.hasLoginState());} }, { key: "signInWithTicket", value: function () {var _signInWithTicket = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee28(e) {return _regenerator.default.wrap(function _callee28$(_context28) {while (1) {switch (_context28.prev = _context28.next) {case 0:return _context28.abrupt("return", new Fe(this.config).signIn(e));case 1:case "end":return _context28.stop();}}}, _callee28, this);}));function signInWithTicket(_x25) {return _signInWithTicket.apply(this, arguments);}return signInWithTicket;}() }, { key: "shouldRefreshAccessToken", value: function shouldRefreshAccessToken(e) {this._request._shouldRefreshAccessTokenHook = e.bind(this);} }, { key: "getUserInfo", value: function getUserInfo() {return this._request.send("auth.getUserInfo", {}).then(function (e) {return e.code ? e : _objectSpread(_objectSpread({}, e.data), {}, { requestId: e.seqId });});} }, { key: "getAuthHeader", value: function getAuthHeader() {var _this$_cache$keys11 = this._cache.keys,e = _this$_cache$keys11.refreshTokenKey,t = _this$_cache$keys11.accessTokenKey,n = this._cache.getStore(e);return { "x-cloudbase-credentials": this._cache.getStore(t) + "/@@/" + n };} }, { key: "_onAnonymousConverted", value: function _onAnonymousConverted(e) {var t = e.data.env;t === this.config.env && this._cache.updatePersistence(this.config.persistence);} }, { key: "_onLoginTypeChanged", value: function _onLoginTypeChanged(e) {var _e$data = e.data,t = _e$data.loginType,n = _e$data.persistence,s = _e$data.env;s === this.config.env && (this._cache.updatePersistence(n), this._cache.setStore(this._cache.keys.loginTypeKey, t));} }, { key: "currentUser", get: function get() {var e = this.hasLoginState();return e && e.user || null;} }, { key: "loginType", get: function get() {return this._cache.getStore(this._cache.keys.loginTypeKey);} }]);return $e;}();var Ke = function Ke(e, t) {t = t || ne();var n = xe(this.config.env),s = e.cloudPath,o = e.filePath,r = e.onUploadProgress,_e$fileType = e.fileType,i = _e$fileType === void 0 ? "image" : _e$fileType;return n.send("storage.getUploadMetadata", { path: s }).then(function (e) {var _e$data2 = e.data,a = _e$data2.url,c = _e$data2.authorization,u = _e$data2.token,l = _e$data2.fileId,h = _e$data2.cosFileId,d = e.requestId,f = { key: s, signature: c, "x-cos-meta-fileid": h, success_action_status: "201", "x-cos-security-token": u };n.upload({ url: a, data: f, file: o, name: s, fileType: i, onUploadProgress: r }).then(function (e) {201 === e.statusCode ? t(null, { fileID: l, requestId: d }) : t(new B({ code: "STORAGE_REQUEST_FAIL", message: "STORAGE_REQUEST_FAIL: ".concat(e.data) }));}).catch(function (e) {t(e);});}).catch(function (e) {t(e);}), t.promise;},Be = function Be(e, t) {t = t || ne();var n = xe(this.config.env),s = e.cloudPath;return n.send("storage.getUploadMetadata", { path: s }).then(function (e) {t(null, e);}).catch(function (e) {t(e);}), t.promise;},He = function He(_ref5, t) {var e = _ref5.fileList;if (t = t || ne(), !e || !Array.isArray(e)) return { code: "INVALID_PARAM", message: "fileList必须是非空的数组" };var _iterator3 = _createForOfIteratorHelper(e),_step3;try {for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {var _t8 = _step3.value;if (!_t8 || "string" != typeof _t8) return { code: "INVALID_PARAM", message: "fileList的元素必须是非空的字符串" };}} catch (err) {_iterator3.e(err);} finally {_iterator3.f();}var n = { fileid_list: e };return xe(this.config.env).send("storage.batchDeleteFile", n).then(function (e) {e.code ? t(null, e) : t(null, { fileList: e.data.delete_list, requestId: e.requestId });}).catch(function (e) {t(e);}), t.promise;},We = function We(_ref6, t) {var e = _ref6.fileList;t = t || ne(), e && Array.isArray(e) || t(null, { code: "INVALID_PARAM", message: "fileList必须是非空的数组" });var n = [];var _iterator4 = _createForOfIteratorHelper(e),_step4;try {for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {var _s7 = _step4.value;"object" == typeof _s7 ? (_s7.hasOwnProperty("fileID") && _s7.hasOwnProperty("maxAge") || t(null, { code: "INVALID_PARAM", message: "fileList的元素必须是包含fileID和maxAge的对象" }), n.push({ fileid: _s7.fileID, max_age: _s7.maxAge })) : "string" == typeof _s7 ? n.push({ fileid: _s7 }) : t(null, { code: "INVALID_PARAM", message: "fileList的元素必须是字符串" });}} catch (err) {_iterator4.e(err);} finally {_iterator4.f();}var s = { file_list: n };return xe(this.config.env).send("storage.batchGetDownloadUrl", s).then(function (e) {e.code ? t(null, e) : t(null, { fileList: e.data.download_list, requestId: e.requestId });}).catch(function (e) {t(e);}), t.promise;},ze = /*#__PURE__*/function () {var _ref8 = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee29(_ref7, t) {var e, n, s, o;return _regenerator.default.wrap(function _callee29$(_context29) {while (1) {switch (_context29.prev = _context29.next) {case 0:e = _ref7.fileID;_context29.next = 3;return We.call(this, { fileList: [{ fileID: e, maxAge: 600 }] });case 3:n = _context29.sent.fileList[0];if (!("SUCCESS" !== n.code)) {_context29.next = 6;break;}return _context29.abrupt("return", t ? t(n) : new Promise(function (e) {e(n);}));case 6:s = xe(this.config.env);o = n.download_url;if (!(o = encodeURI(o), !t)) {_context29.next = 10;break;}return _context29.abrupt("return", s.download({ url: o }));case 10:_context29.t0 = t;_context29.next = 13;return s.download({ url: o });case 13:_context29.t1 = _context29.sent;(0, _context29.t0)(_context29.t1);case 15:case "end":return _context29.stop();}}}, _callee29, this);}));return function ze(_x26, _x27) {return _ref8.apply(this, arguments);};}(),Je = function Je(_ref9, r) {var e = _ref9.name,t = _ref9.data,n = _ref9.query,s = _ref9.parse,o = _ref9.search;var i = r || ne();var a;try {a = t ? JSON.stringify(t) : "";} catch (e) {return Promise.reject(e);}if (!e) return Promise.reject(new B({ code: "PARAM_ERROR", message: "函数名不能为空" }));var c = { inQuery: n, parse: s, search: o, function_name: e, request_data: a };return xe(this.config.env).send("functions.invokeFunction", c).then(function (e) {if (e.code) i(null, e);else {var _t9 = e.data.response_data;if (s) i(null, { result: _t9, requestId: e.requestId });else try {_t9 = JSON.parse(e.data.response_data), i(null, { result: _t9, requestId: e.requestId });} catch (e) {i(new B({ message: "response data must be json" }));}}return i.promise;}).catch(function (e) {i(e);}), i.promise;},Ve = { timeout: 15e3, persistence: "session" },Ye = {};var Xe = /*#__PURE__*/function () {function Xe(e) {_classCallCheck(this, Xe);this.config = e || this.config, this.authObj = void 0;}_createClass(Xe, [{ key: "init", value: function init(e) {switch (ae.adapter || (this.requestClient = new ae.adapter.reqClass({ timeout: e.timeout || 5e3, timeoutMsg: "\u8BF7\u6C42\u5728".concat((e.timeout || 5e3) / 1e3, "s\u5185\u672A\u5B8C\u6210\uFF0C\u5DF2\u4E2D\u65AD") })), this.config = _objectSpread(_objectSpread({}, Ve), e), !0) {case this.config.timeout > 6e5:console.warn("timeout大于可配置上限[10分钟],已重置为上限数值"), this.config.timeout = 6e5;break;case this.config.timeout < 100:console.warn("timeout小于可配置下限[100ms],已重置为下限数值"), this.config.timeout = 100;}return new Xe(this.config);} }, { key: "auth", value: function auth() {var _ref10 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},e = _ref10.persistence;if (this.authObj) return this.authObj;var t = e || ae.adapter.primaryStorage || Ve.persistence;var n;return t !== this.config.persistence && (this.config.persistence = t), function (e) {var t = e.env;de[t] = new he(e), fe[t] = new he(_objectSpread(_objectSpread({}, e), {}, { persistence: "local" }));}(this.config), n = this.config, Ue[n.env] = new Re(n), this.authObj = new $e(this.config), this.authObj;} }, { key: "on", value: function on(e, t) {return _e.apply(this, [e, t]);} }, { key: "off", value: function off(e, t) {return ke.apply(this, [e, t]);} }, { key: "callFunction", value: function callFunction(e, t) {return Je.apply(this, [e, t]);} }, { key: "deleteFile", value: function deleteFile(e, t) {return He.apply(this, [e, t]);} }, { key: "getTempFileURL", value: function getTempFileURL(e, t) {return We.apply(this, [e, t]);} }, { key: "downloadFile", value: function downloadFile(e, t) {return ze.apply(this, [e, t]);} }, { key: "uploadFile", value: function uploadFile(e, t) {return Ke.apply(this, [e, t]);} }, { key: "getUploadMetadata", value: function getUploadMetadata(e, t) {return Be.apply(this, [e, t]);} }, { key: "registerExtension", value: function registerExtension(e) {Ye[e.name] = e;} }, { key: "invokeExtension", value: function () {var _invokeExtension = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee30(e, t) {var n;return _regenerator.default.wrap(function _callee30$(_context30) {while (1) {switch (_context30.prev = _context30.next) {case 0:n = Ye[e];if (n) {_context30.next = 3;break;}throw new B({ message: "\u6269\u5C55".concat(e, " \u5FC5\u987B\u5148\u6CE8\u518C") });case 3:_context30.next = 5;return n.invoke(t, this);case 5:return _context30.abrupt("return", _context30.sent);case 6:case "end":return _context30.stop();}}}, _callee30, this);}));function invokeExtension(_x28, _x29) {return _invokeExtension.apply(this, arguments);}return invokeExtension;}() }, { key: "useAdapters", value: function useAdapters(e) {var _ref11 = ie(e) || {},t = _ref11.adapter,n = _ref11.runtime;t && (ae.adapter = t), n && (ae.runtime = n);} }]);return Xe;}();var Ge = new Xe();function Qe(e, t, n) {void 0 === n && (n = {});var s = /\?/.test(t),o = "";for (var r in n) {"" === o ? !s && (t += "?") : o += "&", o += r + "=" + encodeURIComponent(n[r]);}return /^http(s)?:\/\//.test(t += o) ? t : "" + e + t;}var Ze = /*#__PURE__*/function () {function Ze() {_classCallCheck(this, Ze);}_createClass(Ze, [{ key: "post", value: function post(e) {var t = e.url,n = e.data,s = e.headers;return new Promise(function (e, o) {V.request({ url: Qe("https:", t), data: n, method: "POST", header: s, success: function success(t) {e(t);}, fail: function fail(e) {o(e);} });});} }, { key: "upload", value: function upload(e) {return new Promise(function (t, n) {var s = e.url,o = e.file,r = e.data,i = e.headers,a = e.fileType,c = V.uploadFile({ url: Qe("https:", s), name: "file", formData: Object.assign({}, r), filePath: o, fileType: a, header: i, success: function success(e) {var n = { statusCode: e.statusCode, data: e.data || {} };200 === e.statusCode && r.success_action_status && (n.statusCode = parseInt(r.success_action_status, 10)), t(n);}, fail: function fail(e) {n(new Error(e.errMsg || "uploadFile:fail"));} });"function" == typeof e.onUploadProgress && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (t) {e.onUploadProgress({ loaded: t.totalBytesSent, total: t.totalBytesExpectedToSend });});});} }]);return Ze;}();var et = { setItem: function setItem(e, t) {V.setStorageSync(e, t);}, getItem: function getItem(e) {return V.getStorageSync(e);}, removeItem: function removeItem(e) {V.removeStorageSync(e);}, clear: function clear() {V.clearStorageSync();} };var tt = { genAdapter: function genAdapter() {return { root: {}, reqClass: Ze, localStorage: et, primaryStorage: "local" };}, isMatch: function isMatch() {return !0;}, runtime: "uni_app" };Ge.useAdapters(tt);var nt = Ge,st = nt.init;nt.init = function (e) {e.env = e.spaceId;var t = st.call(this, e);t.config.provider = "tencent", t.config.spaceId = e.spaceId;var n = t.auth;return t.auth = function (e) {var t = n.call(this, e);return ["linkAndRetrieveDataWithTicket", "signInAnonymously", "signOut", "getAccessToken", "getLoginState", "signInWithTicket", "getUserInfo"].forEach(function (e) {t[e] = K(t[e]).bind(t);}), t;}, t.customAuth = t.auth, t;};var ot = nt;function rt() {return { token: V.getStorageSync("uni_id_token") || V.getStorageSync("uniIdToken"), tokenExpired: V.getStorageSync("uni_id_token_expired") };}function it() {var _ref12 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},e = _ref12.token,t = _ref12.tokenExpired;e && V.setStorageSync("uni_id_token", e), t && V.setStorageSync("uni_id_token_expired", t);}function at() {if (!d || "web" !== g) return;uni.getStorageSync("__LAST_DCLOUD_APPID") !== _ && (uni.setStorageSync("__LAST_DCLOUD_APPID", _), console.warn("检测到当前项目与上次运行到此端口的项目不一致,自动清理uni-id保存的token信息(仅开发调试时生效)"), V.removeStorageSync("uni_id_token"), V.removeStorageSync("uniIdToken"), V.removeStorageSync("uni_id_token_expired"));}var ct = /*#__PURE__*/function (_G) {_inherits(ct, _G);var _super8 = _createSuper(ct);function ct() {_classCallCheck(this, ct);return _super8.apply(this, arguments);}_createClass(ct, [{ key: "getAccessToken", value: function getAccessToken() {var _this12 = this;return new Promise(function (e, t) {var n = "Anonymous_Access_token";_this12.setAccessToken(n), e(n);});} }, { key: "setupRequest", value: function setupRequest(e, t) {var n = Object.assign({}, e, { spaceId: this.config.spaceId, timestamp: Date.now() }),s = { "Content-Type": "application/json" };"auth" !== t && (n.token = this.accessToken, s["x-basement-token"] = this.accessToken), s["x-serverless-sign"] = J.sign(n, this.config.clientSecret);var o = z();s["x-client-info"] = encodeURIComponent(JSON.stringify(o));var _rt = rt(),r = _rt.token;return s["x-client-token"] = r, { url: this.config.requestUrl, method: "POST", data: n, dataType: "json", header: JSON.parse(JSON.stringify(s)) };} }, { key: "uploadFileToOSS", value: function uploadFileToOSS(_ref13) {var _this13 = this;var e = _ref13.url,t = _ref13.formData,n = _ref13.name,s = _ref13.filePath,o = _ref13.fileType,r = _ref13.onUploadProgress;return new Promise(function (i, a) {var c = _this13.adapter.uploadFile({ url: e, formData: t, name: n, filePath: s, fileType: o, success: function success(e) {e && e.statusCode < 400 ? i(e) : a(new B({ code: "UPLOAD_FAILED", message: "文件上传失败" }));}, fail: function fail(e) {a(new B({ code: e.code || "UPLOAD_FAILED", message: e.message || e.errMsg || "文件上传失败" }));} });"function" == typeof r && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (e) {r({ loaded: e.totalBytesSent, total: e.totalBytesExpectedToSend });});});} }, { key: "uploadFile", value: function uploadFile(_ref14) {var _this14 = this;var e = _ref14.filePath,t = _ref14.cloudPath,_ref14$fileType = _ref14.fileType,n = _ref14$fileType === void 0 ? "image" : _ref14$fileType,s = _ref14.onUploadProgress;if (!t) throw new B({ code: "CLOUDPATH_REQUIRED", message: "cloudPath不可为空" });var o;return this.getOSSUploadOptionsFromPath({ cloudPath: t }).then(function (t) {var _t$result = t.result,r = _t$result.url,i = _t$result.formData,a = _t$result.name;o = t.result.fileUrl;var c = { url: r, formData: i, name: a, filePath: e, fileType: n };return _this14.uploadFileToOSS(Object.assign({}, c, { onUploadProgress: s }));}).then(function () {return _this14.reportOSSUpload({ cloudPath: t });}).then(function (t) {return new Promise(function (n, s) {t.success ? n({ success: !0, filePath: e, fileID: o }) : s(new B({ code: "UPLOAD_FAILED", message: "文件上传失败" }));});});} }, { key: "deleteFile", value: function deleteFile(_ref15) {var e = _ref15.fileList;var t = { method: "serverless.file.resource.delete", params: JSON.stringify({ fileList: e }) };return this.request(this.setupRequest(t));} }, { key: "getTempFileURL", value: function getTempFileURL() {var _ref16 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},e = _ref16.fileList;var t = { method: "serverless.file.resource.getTempFileURL", params: JSON.stringify({ fileList: e }) };return this.request(this.setupRequest(t));} }]);return ct;}(G);var ut = { init: function init(e) {var t = new ct(e),n = { signInAnonymously: function signInAnonymously() {return t.authorize();}, getLoginState: function getLoginState() {return Promise.resolve(!1);} };return t.auth = function () {return n;}, t.customAuth = t.auth, t;} };function lt(_ref17) {var e = _ref17.data;var t;t = z();var n = JSON.parse(JSON.stringify(e || {}));if (Object.assign(n, { clientInfo: t }), !n.uniIdToken) {var _rt2 = rt(),_e19 = _rt2.token;_e19 && (n.uniIdToken = _e19);}return n;}function ht() {var _this15 = this;var _ref18 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},e = _ref18.name,t = _ref18.data;var _this$__dev__ = this.__dev__,n = _this$__dev__.localAddress,s = _this$__dev__.localPort,o = { aliyun: "aliyun", tencent: "tcb" }[this.config.provider],r = this.config.spaceId,i = "http://".concat(n, ":").concat(s, "/system/check-function"),a = "http://".concat(n, ":").concat(s, "/cloudfunctions/").concat(e);return new Promise(function (t, n) {V.request({ method: "POST", url: i, data: { name: e, platform: g, provider: o, spaceId: r }, timeout: 3e3, success: function success(e) {t(e);}, fail: function fail() {t({ data: { code: "NETWORK_ERROR", message: "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下,自动切换为已部署的云函数。" } });} });}).then(function () {var _ref19 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},e = _ref19.data;var _ref20 = e || {},t = _ref20.code,n = _ref20.message;return { code: 0 === t ? 0 : t || "SYS_ERR", message: n || "SYS_ERR" };}).then(function (_ref21) {var n = _ref21.code,s = _ref21.message;if (0 !== n) {switch (n) {case "MODULE_ENCRYPTED":console.error("\u6B64\u4E91\u51FD\u6570\uFF08".concat(e, "\uFF09\u4F9D\u8D56\u52A0\u5BC6\u516C\u5171\u6A21\u5757\u4E0D\u53EF\u672C\u5730\u8C03\u8BD5\uFF0C\u81EA\u52A8\u5207\u6362\u4E3A\u4E91\u7AEF\u5DF2\u90E8\u7F72\u7684\u4E91\u51FD\u6570"));break;case "FUNCTION_ENCRYPTED":console.error("\u6B64\u4E91\u51FD\u6570\uFF08".concat(e, "\uFF09\u5DF2\u52A0\u5BC6\u4E0D\u53EF\u672C\u5730\u8C03\u8BD5\uFF0C\u81EA\u52A8\u5207\u6362\u4E3A\u4E91\u7AEF\u5DF2\u90E8\u7F72\u7684\u4E91\u51FD\u6570"));break;case "ACTION_ENCRYPTED":console.error(s || "需要访问加密的uni-clientDB-action,自动切换为云端环境");break;case "NETWORK_ERROR":{var _e20 = "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下";throw console.error(_e20), new Error(_e20);}case "SWITCH_TO_CLOUD":break;default:{var _e21 = "\u68C0\u6D4B\u672C\u5730\u8C03\u8BD5\u670D\u52A1\u51FA\u73B0\u9519\u8BEF\uFF1A".concat(s, "\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC\u73AF\u5883\u6216\u91CD\u542F\u5BA2\u6237\u7AEF\u518D\u8BD5");throw console.error(_e21), new Error(_e21);}}return _this15._callCloudFunction({ name: e, data: t });}return new Promise(function (e, n) {var s = lt.call(_this15, { data: t });V.request({ method: "POST", url: a, data: { provider: o, platform: g, param: s }, success: function success() {var _ref22 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},t = _ref22.statusCode,s = _ref22.data;return !t || t >= 400 ? n(new B({ code: s.code || "SYS_ERR", message: s.message || "request:fail" })) : e({ result: s });}, fail: function fail(e) {n(new B({ code: e.code || e.errCode || "SYS_ERR", message: e.message || e.errMsg || "request:fail" }));} });});});}var dt = [{ rule: /fc_function_not_found|FUNCTION_NOT_FOUND/, content: ",云函数[{functionName}]在云端不存在,请检查此云函数名称是否正确以及该云函数是否已上传到服务空间", mode: "append" }];var ft = /[\\^$.*+?()[\]{}|]/g,gt = RegExp(ft.source);function pt(e, t, n) {return e.replace(new RegExp((s = t) && gt.test(s) ? s.replace(ft, "\\$&") : s, "g"), n);var s;}function mt(_ref23) {var e = _ref23.functionName,t = _ref23.result,n = _ref23.logPvd;if (this.__dev__.debugLog && t && t.requestId) {var _s8 = JSON.stringify({ spaceId: this.config.spaceId, functionName: e, requestId: t.requestId });console.log("[".concat(n, "-request]").concat(_s8, "[/").concat(n, "-request]"));}}function yt(e) {var t = e.callFunction,n = function n(_n5) {var _this16 = this;var s = _n5.name;_n5.data = lt.call(e, { data: _n5.data });var o = { aliyun: "aliyun", tencent: "tcb", tcb: "tcb" }[this.config.provider];return t.call(this, _n5).then(function (e) {return e.errCode = 0, mt.call(_this16, { functionName: s, result: e, logPvd: o }), Promise.resolve(e);}, function (e) {return mt.call(_this16, { functionName: s, result: e, logPvd: o }), e && e.message && (e.message = function () {var _ref24 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},_ref24$message = _ref24.message,e = _ref24$message === void 0 ? "" : _ref24$message,_ref24$extraInfo = _ref24.extraInfo,t = _ref24$extraInfo === void 0 ? {} : _ref24$extraInfo,_ref24$formatter = _ref24.formatter,n = _ref24$formatter === void 0 ? [] : _ref24$formatter;for (var _s9 = 0; _s9 < n.length; _s9++) {var _n$_s = n[_s9],_o3 = _n$_s.rule,_r2 = _n$_s.content,i = _n$_s.mode,_a = e.match(_o3);if (!_a) continue;var _c = _r2;for (var _e22 = 1; _e22 < _a.length; _e22++) {_c = pt(_c, "{$".concat(_e22, "}"), _a[_e22]);}for (var _e23 in t) {_c = pt(_c, "{".concat(_e23, "}"), t[_e23]);}return "replace" === i ? _c : e + _c;}return e;}({ message: "[".concat(_n5.name, "]: ").concat(e.message), formatter: dt, extraInfo: { functionName: s } })), Promise.reject(e);});};e.callFunction = function (t) {var s;d && e.__dev__.debugInfo && !e.__dev__.debugInfo.forceRemote && m ? (e._callCloudFunction || (e._callCloudFunction = n, e._callLocalFunction = ht), s = ht) : s = n;var o = s.call(this, t);return Object.defineProperty(o, "result", { get: function get() {return console.warn("当前返回结果为Promise类型,不可直接访问其result属性,详情请参考:https://uniapp.dcloud.net.cn/uniCloud/faq?id=promise"), {};} }), o;};}var _t = Symbol("CLIENT_DB_INTERNAL");function wt(e, t) {return e.then = "DoNotReturnProxyWithAFunctionNamedThen", e._internalType = _t, e.__ob__ = void 0, new Proxy(e, { get: function get(e, n, s) {if ("_uniClient" === n) return null;if (n in e || "string" != typeof n) {var _t10 = e[n];return "function" == typeof _t10 ? _t10.bind(e) : _t10;}return t.get(e, n, s);} });}function kt(e) {return { on: function on(t, n) {e[t] = e[t] || [], e[t].indexOf(n) > -1 || e[t].push(n);}, off: function off(t, n) {e[t] = e[t] || [];var s = e[t].indexOf(n);-1 !== s && e[t].splice(s, 1);} };}var vt = ["db.Geo", "db.command", "command.aggregate"];function Tt(e, t) {return vt.indexOf("".concat(e, ".").concat(t)) > -1;}function St(e) {switch (u(e)) {case "array":return e.map(function (e) {return St(e);});case "object":return e._internalType === _t || Object.keys(e).forEach(function (t) {e[t] = St(e[t]);}), e;case "regexp":return { $regexp: { source: e.source, flags: e.flags } };case "date":return { $date: e.toISOString() };default:return e;}}function Pt(e) {return e && e.content && e.content.$method;}var At = /*#__PURE__*/function () {function At(e, t, n) {_classCallCheck(this, At);this.content = e, this.prevStage = t || null, this.udb = null, this._database = n;}_createClass(At, [{ key: "toJSON", value: function toJSON() {var e = this;var t = [e.content];for (; e.prevStage;) {e = e.prevStage, t.push(e.content);}return { $db: t.reverse().map(function (e) {return { $method: e.$method, $param: St(e.$param) };}) };} }, { key: "getAction", value: function getAction() {var e = this.toJSON().$db.find(function (e) {return "action" === e.$method;});return e && e.$param && e.$param[0];} }, { key: "getCommand", value: function getCommand() {return { $db: this.toJSON().$db.filter(function (e) {return "action" !== e.$method;}) };} }, { key: "get", value: function get() {return this._send("get", Array.from(arguments));} }, { key: "add", value: function add() {return this._send("add", Array.from(arguments));} }, { key: "update", value: function update() {return this._send("update", Array.from(arguments));} }, { key: "end", value: function end() {return this._send("end", Array.from(arguments));} }, { key: "_send", value: function _send(e, t) {var n = this.getAction(),s = this.getCommand();if (s.$db.push({ $method: e, $param: St(t) }), d) {var _e24 = s.$db.find(function (e) {return "collection" === e.$method;}),_t11 = _e24 && _e24.$param;_t11 && 1 === _t11.length && "string" == typeof _e24.$param[0] && _e24.$param[0].indexOf(",") > -1 && console.warn("检测到使用JQL语法联表查询时,未使用getTemp先过滤主表数据,在主表数据量大的情况下可能会查询缓慢。\n- 如何优化请参考此文档:https://uniapp.dcloud.net.cn/uniCloud/jql?id=lookup-with-temp \n- 如果主表数据量很小请忽略此信息,项目发行时不会出现此提示。");}return this._database._callCloudFunction({ action: n, command: s });} }, { key: "isAggregate", get: function get() {var e = this;for (; e;) {var t = Pt(e),_n6 = Pt(e.prevStage);if ("aggregate" === t && "collection" === _n6 || "pipeline" === t) return !0;e = e.prevStage;}return !1;} }, { key: "isCommand", get: function get() {var e = this;for (; e;) {if ("command" === Pt(e)) return !0;e = e.prevStage;}return !1;} }, { key: "isAggregateCommand", get: function get() {var e = this;for (; e;) {var t = Pt(e),_n7 = Pt(e.prevStage);if ("aggregate" === t && "command" === _n7) return !0;e = e.prevStage;}return !1;} }, { key: "count", get: function get() {if (!this.isAggregate) return function () {return this._send("count", Array.from(arguments));};var e = this;return function () {return It({ $method: "count", $param: St(Array.from(arguments)) }, e, this._database);};} }, { key: "remove", get: function get() {if (!this.isCommand) return function () {return this._send("remove", Array.from(arguments));};var e = this;return function () {return It({ $method: "remove", $param: St(Array.from(arguments)) }, e, this._database);};} }, { key: "set", get: function get() {if (!this.isCommand) return function () {throw new Error("JQL禁止使用set方法");};var e = this;return function () {return It({ $method: "set", $param: St(Array.from(arguments)) }, e, this._database);};} }]);return At;}();function It(e, t, n) {return wt(new At(e, t, n), { get: function get(e, t) {var s = "db";return e && e.content && (s = e.content.$method), Tt(s, t) ? It({ $method: t }, e, n) : function () {return It({ $method: t, $param: St(Array.from(arguments)) }, e, n);};} });}function bt(_ref25) {var e = _ref25.path,t = _ref25.method;return /*#__PURE__*/function () {function _class2() {_classCallCheck(this, _class2);this.param = Array.from(arguments);}_createClass(_class2, [{ key: "toJSON", value: function toJSON() {return { $newDb: [].concat(_toConsumableArray(e.map(function (e) {return { $method: e };})), [{ $method: t, $param: this.param }]) };} }]);return _class2;}();}var Ot = /*#__PURE__*/function (_ref26) {_inherits(Ot, _ref26);var _super9 = _createSuper(Ot);function Ot() {_classCallCheck(this, Ot);return _super9.apply(this, arguments);}_createClass(Ot, [{ key: "_callCloudFunction", value: function _callCloudFunction(_ref27) {var _this17 = this;var e = _ref27.action,t = _ref27.command,n = _ref27.multiCommand,s = _ref27.queryList;function o(e, t) {if (n && s) for (var _n8 = 0; _n8 < s.length; _n8++) {var _o4 = s[_n8];_o4.udb && "function" == typeof _o4.udb.setResult && (t ? _o4.udb.setResult(t) : _o4.udb.setResult(e.result.dataList[_n8]));}}var r = this;function i(e) {return r._callback("error", [e]), A(I("database", "fail"), e).then(function () {return A(I("database", "complete"), e);}).then(function () {return o(null, e), F(C, { type: U, content: e }), Promise.reject(e);});}var a = A(I("database", "invoke")),u = this._uniClient;return a.then(function () {return u.callFunction({ name: "DCloud-clientDB", type: c, data: { action: e, command: t, multiCommand: n } });}).then(function (e) {var _e$result = e.result,t = _e$result.code,n = _e$result.message,s = _e$result.token,r = _e$result.tokenExpired,_e$result$systemInfo = _e$result.systemInfo,a = _e$result$systemInfo === void 0 ? [] : _e$result$systemInfo;if (a) for (var _e25 = 0; _e25 < a.length; _e25++) {var _a$_e = a[_e25],_t12 = _a$_e.level,_n9 = _a$_e.message,_s10 = _a$_e.detail,_o5 = console["app" === g && "warn" === _t12 ? "error" : _t12] || console.log;var _r3 = "[System Info]" + _n9;_s10 && (_r3 = "".concat(_r3, "\n\u8BE6\u7EC6\u4FE1\u606F\uFF1A").concat(_s10)), _o5(_r3);}if (t) {return i(new B({ code: t, message: n, requestId: e.requestId }));}e.result.errCode = e.result.code, e.result.errMsg = e.result.message, s && r && (it({ token: s, tokenExpired: r }), _this17._callbackAuth("refreshToken", [{ token: s, tokenExpired: r }]), _this17._callback("refreshToken", [{ token: s, tokenExpired: r }]), F(R, { token: s, tokenExpired: r }));var c = [{ prop: "affectedDocs", tips: "affectedDocs不再推荐使用,请使用inserted/deleted/updated/data.length替代" }, { prop: "code", tips: "code不再推荐使用,请使用errCode替代" }, { prop: "message", tips: "message不再推荐使用,请使用errMsg替代" }];var _loop = function _loop(_t13) {var _c$_t = c[_t13],n = _c$_t.prop,s = _c$_t.tips;if (n in e.result) {var _t14 = e.result[n];Object.defineProperty(e.result, n, { get: function get() {return console.warn(s), _t14;} });}};for (var _t13 = 0; _t13 < c.length; _t13++) {_loop(_t13);}return function (e) {return A(I("database", "success"), e).then(function () {return A(I("database", "complete"), e);}).then(function () {return o(e, null), F(C, { type: U, content: e }), Promise.resolve(e);});}(e);}, function (e) {/fc_function_not_found|FUNCTION_NOT_FOUND/g.test(e.message) && console.warn("clientDB未初始化,请在web控制台保存一次schema以开启clientDB");return i(new B({ code: e.code || "SYSTEM_ERROR", message: e.message, requestId: e.requestId }));});} }]);return Ot;}( /*#__PURE__*/function () {function _class3() {var _ref28 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},_ref28$uniClient = _ref28.uniClient,e = _ref28$uniClient === void 0 ? {} : _ref28$uniClient;_classCallCheck(this, _class3);this._uniClient = e, this._authCallBacks = {}, this._dbCallBacks = {}, e.isDefault && (this._dbCallBacks = k("_globalUniCloudDatabaseCallback")), this.auth = kt(this._authCallBacks), Object.assign(this, kt(this._dbCallBacks)), this.env = wt({}, { get: function get(e, t) {return { $env: t };} }), this.Geo = wt({}, { get: function get(e, t) {return bt({ path: ["Geo"], method: t });} }), this.serverDate = bt({ path: [], method: "serverDate" }), this.RegExp = bt({ path: [], method: "RegExp" });}_createClass(_class3, [{ key: "getCloudEnv", value: function getCloudEnv(e) {if ("string" != typeof e || !e.trim()) throw new Error("getCloudEnv参数错误");return { $env: e.replace("$cloudEnv_", "") };} }, { key: "_callback", value: function _callback(e, t) {var n = this._dbCallBacks;n[e] && n[e].forEach(function (e) {e.apply(void 0, _toConsumableArray(t));});} }, { key: "_callbackAuth", value: function _callbackAuth(e, t) {var n = this._authCallBacks;n[e] && n[e].forEach(function (e) {e.apply(void 0, _toConsumableArray(t));});} }, { key: "multiSend", value: function multiSend() {var e = Array.from(arguments),t = e.map(function (e) {var t = e.getAction(),n = e.getCommand();if ("getTemp" !== n.$db[n.$db.length - 1].$method) throw new Error("multiSend只支持子命令内使用getTemp");return { action: t, command: n };});return this._callCloudFunction({ multiCommand: t, queryList: e });} }]);return _class3;}());function Ct(e) {e.database = function (t) {if (t && Object.keys(t).length > 0) return e.init(t).database();if (this._database) return this._database;var n = function (e) {var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};return wt(new e(t), { get: function get(e, t) {return Tt("db", t) ? It({ $method: t }, null, e) : function () {return It({ $method: t, $param: St(Array.from(arguments)) }, null, e);};} });}(Ot, { uniClient: e });return this._database = n, n;};}var Et = "token无效,跳转登录页面",Rt = "token过期,跳转登录页面",Ut = { TOKEN_INVALID_TOKEN_EXPIRED: Rt, TOKEN_INVALID_INVALID_CLIENTID: Et, TOKEN_INVALID: Et, TOKEN_INVALID_WRONG_TOKEN: Et, TOKEN_INVALID_ANONYMOUS_USER: Et },xt = { "uni-id-token-expired": Rt, "uni-id-check-token-failed": Et, "uni-id-token-not-exist": Et, "uni-id-check-device-feature-failed": Et };function Lt(e, t) {var n = "";return n = e ? "".concat(e, "/").concat(t) : t, n.replace(/^\//, "");}function Dt() {var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";var n = [],s = [];return e.forEach(function (e) {!0 === e.needLogin ? n.push(Lt(t, e.path)) : !1 === e.needLogin && s.push(Lt(t, e.path));}), { needLoginPage: n, notNeedLoginPage: s };}function Nt(e) {return e.split("?")[0].replace(/^\//, "");}function qt() {return function (e) {var t = e && e.$page && e.$page.fullPath || "";return t ? ("/" !== t.charAt(0) && (t = "/" + t), t) : t;}(function () {var e = getCurrentPages();return e[e.length - 1];}());}function Ft() {return Nt(qt());}function Mt() {var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};if (!e) return !1;if (!(t && t.list && t.list.length)) return !1;var n = t.list,s = Nt(e);return n.some(function (e) {return e.pagePath === s;});}var jt = !!_pages.default.uniIdRouter;var _ref29 = function () {var _ref30 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _pages.default,_ref30$pages = _ref30.pages,e = _ref30$pages === void 0 ? [] : _ref30$pages,_ref30$subPackages = _ref30.subPackages,n = _ref30$subPackages === void 0 ? [] : _ref30$subPackages,_ref30$uniIdRouter = _ref30.uniIdRouter,s = _ref30$uniIdRouter === void 0 ? {} : _ref30$uniIdRouter,_ref30$tabBar = _ref30.tabBar,o = _ref30$tabBar === void 0 ? {} : _ref30$tabBar;var r = s.loginPage,_s$needLogin = s.needLogin,i = _s$needLogin === void 0 ? [] : _s$needLogin,_s$resToLogin = s.resToLogin,a = _s$resToLogin === void 0 ? !0 : _s$resToLogin,_Dt = Dt(e),c = _Dt.needLoginPage,u = _Dt.notNeedLoginPage,_ref31 = function () {var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];var t = [],n = [];return e.forEach(function (e) {var s = e.root,_e$pages = e.pages,o = _e$pages === void 0 ? [] : _e$pages,_Dt2 = Dt(o, s),r = _Dt2.needLoginPage,i = _Dt2.notNeedLoginPage;t.push.apply(t, _toConsumableArray(r)), n.push.apply(n, _toConsumableArray(i));}), { needLoginPage: t, notNeedLoginPage: n };}(n),l = _ref31.needLoginPage,h = _ref31.notNeedLoginPage;return { loginPage: r, routerNeedLogin: i, resToLogin: a, needLoginPage: [].concat(_toConsumableArray(c), _toConsumableArray(l)), notNeedLoginPage: [].concat(_toConsumableArray(u), _toConsumableArray(h)), loginPageInTabBar: Mt(r, o) };}(),$t = _ref29.loginPage,Kt = _ref29.routerNeedLogin,Bt = _ref29.resToLogin,Ht = _ref29.needLoginPage,Wt = _ref29.notNeedLoginPage,zt = _ref29.loginPageInTabBar;if (Ht.indexOf($t) > -1) throw new Error("Login page [".concat($t, "] should not be \"needLogin\", please check your pages.json"));function Jt(e) {var t = Nt(function (e) {var t = Ft(),n = e.charAt(0),s = e.split("?")[0];if ("/" === n) return s;var o = s.replace(/^\//, "").split("/"),r = t.split("/");r.pop();for (var _e26 = 0; _e26 < o.length; _e26++) {var _t15 = o[_e26];".." === _t15 ? r.pop() : "." !== _t15 && r.push(_t15);}return "" === r[0] && r.shift(), r.join("/");}(e));return !(Wt.indexOf(t) > -1) && (Ht.indexOf(t) > -1 || Kt.some(function (t) {return function (e, t) {return new RegExp(t).test(e);}(e, t);}));}function Vt(_ref32) {var e = _ref32.redirect;var t = Nt(e),n = Nt($t);return Ft() !== n && t !== n;}function Yt() {var _ref33 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},e = _ref33.api,t = _ref33.redirect;if (!t || !Vt({ redirect: t })) return;var n = function (e, t) {return "/" !== e.charAt(0) && (e = "/" + e), t ? e.indexOf("?") > -1 ? e + "&uniIdRedirectUrl=".concat(encodeURIComponent(t)) : e + "?uniIdRedirectUrl=".concat(encodeURIComponent(t)) : e;}($t, t);zt ? "navigateTo" !== e && "redirectTo" !== e || (e = "switchTab") : "switchTab" === e && (e = "navigateTo"), setTimeout(function () {uni[e]({ url: n });});}function Xt() {var _ref34 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},e = _ref34.url;var t = { abortLoginPageJump: !1, autoToLoginPage: !1 },n = function () {var _rt3 = rt(),e = _rt3.token,t = _rt3.tokenExpired;var n;if (e) {if (t < Date.now()) {var _e27 = "uni-id-token-expired";n = { errCode: _e27, errMsg: xt[_e27] };}} else {var _e28 = "uni-id-check-token-failed";n = { errCode: _e28, errMsg: xt[_e28] };}return n;}();if (Jt(e) && n) {n.uniIdRedirectUrl = e;if (D(E).length > 0) return setTimeout(function () {F(E, n);}, 0), t.abortLoginPageJump = !0, t;t.autoToLoginPage = !0;}return t;}function Gt() {!function () {var e = qt(),_Xt = Xt({ url: e }),t = _Xt.abortLoginPageJump,n = _Xt.autoToLoginPage;t || n && Yt({ api: "redirectTo", redirect: e });}();var e = ["navigateTo", "redirectTo", "reLaunch", "switchTab"];var _loop2 = function _loop2(_t16) {var n = e[_t16];uni.addInterceptor(n, { invoke: function invoke(e) {var _Xt2 = Xt({ url: e.url }),t = _Xt2.abortLoginPageJump,s = _Xt2.autoToLoginPage;return t ? e : s ? (Yt({ api: n, redirect: e.url }), !1) : e;} });};for (var _t16 = 0; _t16 < e.length; _t16++) {_loop2(_t16);}}function Qt() {this.onResponse(function (e) {var t = e.type,n = e.content;var s = !1;switch (t) {case "cloudobject":s = function (e) {var t = e.errCode;return t in xt;}(n);break;case "clientdb":s = function (e) {var t = e.errCode;return t in Ut;}(n);}s && function () {var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};var t = D(E);$().then(function () {var n = qt();if (n && Vt({ redirect: n })) return t.length > 0 ? F(E, Object.assign({ uniIdRedirectUrl: n }, e)) : void ($t && Yt({ api: "navigateTo", redirect: n }));});}(n);});}function Zt(e) {!function (e) {e.onResponse = function (e) {N(C, e);}, e.offResponse = function (e) {q(C, e);};}(e), function (e) {e.onNeedLogin = function (e) {N(E, e);}, e.offNeedLogin = function (e) {q(E, e);}, jt && (k("uni-cloud-status").needLoginInit || (k("uni-cloud-status").needLoginInit = !0, $().then(function () {Gt.call(e);}), Bt && Qt.call(e)));}(e), function (e) {e.onRefreshToken = function (e) {N(R, e);}, e.offRefreshToken = function (e) {q(R, e);};}(e);}var en;var tn = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",nn = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;function sn() {var e = rt().token || "",t = e.split(".");if (!e || 3 !== t.length) return { uid: null, role: [], permission: [], tokenExpired: 0 };var n;try {n = JSON.parse((s = t[1], decodeURIComponent(en(s).split("").map(function (e) {return "%" + ("00" + e.charCodeAt(0).toString(16)).slice(-2);}).join(""))));} catch (e) {throw new Error("获取当前用户信息出错,详细错误信息为:" + e.message);}var s;return n.tokenExpired = 1e3 * n.exp, delete n.exp, delete n.iat, n;}en = "function" != typeof atob ? function (e) {if (e = String(e).replace(/[\t\n\f\r ]+/g, ""), !nn.test(e)) throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");var t;e += "==".slice(2 - (3 & e.length));for (var n, s, o = "", r = 0; r < e.length;) {t = tn.indexOf(e.charAt(r++)) << 18 | tn.indexOf(e.charAt(r++)) << 12 | (n = tn.indexOf(e.charAt(r++))) << 6 | (s = tn.indexOf(e.charAt(r++))), o += 64 === n ? String.fromCharCode(t >> 16 & 255) : 64 === s ? String.fromCharCode(t >> 16 & 255, t >> 8 & 255) : String.fromCharCode(t >> 16 & 255, t >> 8 & 255, 255 & t);}return o;} : atob;var on = s(function (e, t) {Object.defineProperty(t, "__esModule", { value: !0 });var n = "chooseAndUploadFile:ok",s = "chooseAndUploadFile:fail";function o(e, t) {return e.tempFiles.forEach(function (e, n) {e.name || (e.name = e.path.substring(e.path.lastIndexOf("/") + 1)), t && (e.fileType = t), e.cloudPath = Date.now() + "_" + n + e.name.substring(e.name.lastIndexOf("."));}), e.tempFilePaths || (e.tempFilePaths = e.tempFiles.map(function (e) {return e.path;})), e;}function r(e, t, _ref35) {var s = _ref35.onChooseFile,o = _ref35.onUploadProgress;return t.then(function (e) {if (s) {var _t17 = s(e);if (void 0 !== _t17) return Promise.resolve(_t17).then(function (t) {return void 0 === t ? e : t;});}return e;}).then(function (t) {return !1 === t ? { errMsg: n, tempFilePaths: [], tempFiles: [] } : function (e, t) {var s = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 5;var o = arguments.length > 3 ? arguments[3] : undefined;(t = Object.assign({}, t)).errMsg = n;var r = t.tempFiles,i = r.length;var a = 0;return new Promise(function (n) {for (; a < s;) {c();}function c() {var s = a++;if (s >= i) return void (!r.find(function (e) {return !e.url && !e.errMsg;}) && n(t));var u = r[s];e.uploadFile({ filePath: u.path, cloudPath: u.cloudPath, fileType: u.fileType, onUploadProgress: function onUploadProgress(e) {e.index = s, e.tempFile = u, e.tempFilePath = u.path, o && o(e);} }).then(function (e) {u.url = e.fileID, s < i && c();}).catch(function (e) {u.errMsg = e.errMsg || e.message, s < i && c();});}});}(e, t, 5, o);});}t.initChooseAndUploadFile = function (e) {return function () {var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { type: "all" };return "image" === t.type ? r(e, function (e) {var t = e.count,n = e.sizeType,_e$sourceType = e.sourceType,r = _e$sourceType === void 0 ? ["album", "camera"] : _e$sourceType,i = e.extension;return new Promise(function (e, a) {uni.chooseImage({ count: t, sizeType: n, sourceType: r, extension: i, success: function success(t) {e(o(t, "image"));}, fail: function fail(e) {a({ errMsg: e.errMsg.replace("chooseImage:fail", s) });} });});}(t), t) : "video" === t.type ? r(e, function (e) {var t = e.camera,n = e.compressed,r = e.maxDuration,_e$sourceType2 = e.sourceType,i = _e$sourceType2 === void 0 ? ["album", "camera"] : _e$sourceType2,a = e.extension;return new Promise(function (e, c) {uni.chooseVideo({ camera: t, compressed: n, maxDuration: r, sourceType: i, extension: a, success: function success(t) {var n = t.tempFilePath,s = t.duration,r = t.size,i = t.height,a = t.width;e(o({ errMsg: "chooseVideo:ok", tempFilePaths: [n], tempFiles: [{ name: t.tempFile && t.tempFile.name || "", path: n, size: r, type: t.tempFile && t.tempFile.type || "", width: a, height: i, duration: s, fileType: "video", cloudPath: "" }] }, "video"));}, fail: function fail(e) {c({ errMsg: e.errMsg.replace("chooseVideo:fail", s) });} });});}(t), t) : r(e, function (e) {var t = e.count,n = e.extension;return new Promise(function (e, r) {var i = uni.chooseFile;if ("undefined" != typeof wx && "function" == typeof wx.chooseMessageFile && (i = wx.chooseMessageFile), "function" != typeof i) return r({ errMsg: s + " 请指定 type 类型,该平台仅支持选择 image 或 video。" });i({ type: "all", count: t, extension: n, success: function success(t) {e(o(t));}, fail: function fail(e) {r({ errMsg: e.errMsg.replace("chooseFile:fail", s) });} });});}(t), t);};};}),rn = n(on);var an = "manual";function cn(e) {return { props: { localdata: { type: Array, default: function _default() {return [];} }, options: { type: [Object, Array], default: function _default() {return {};} }, spaceInfo: { type: Object, default: function _default() {return {};} }, collection: { type: [String, Array], default: "" }, action: { type: String, default: "" }, field: { type: String, default: "" }, orderby: { type: String, default: "" }, where: { type: [String, Object], default: "" }, pageData: { type: String, default: "add" }, pageCurrent: { type: Number, default: 1 }, pageSize: { type: Number, default: 20 }, getcount: { type: [Boolean, String], default: !1 }, gettree: { type: [Boolean, String], default: !1 }, gettreepath: { type: [Boolean, String], default: !1 }, startwith: { type: String, default: "" }, limitlevel: { type: Number, default: 10 }, groupby: { type: String, default: "" }, groupField: { type: String, default: "" }, distinct: { type: [Boolean, String], default: !1 }, foreignKey: { type: String, default: "" }, loadtime: { type: String, default: "auto" }, manual: { type: Boolean, default: !1 } }, data: function data() {return { mixinDatacomLoading: !1, mixinDatacomHasMore: !1, mixinDatacomResData: [], mixinDatacomErrorMessage: "", mixinDatacomPage: {} };}, created: function created() {var _this18 = this;this.mixinDatacomPage = { current: this.pageCurrent, size: this.pageSize, count: 0 }, this.$watch(function () {var e = [];return ["pageCurrent", "pageSize", "localdata", "collection", "action", "field", "orderby", "where", "getont", "getcount", "gettree", "groupby", "groupField", "distinct"].forEach(function (t) {e.push(_this18[t]);}), e;}, function (e, t) {if (_this18.loadtime === an) return;var n = !1;var s = [];for (var _o6 = 2; _o6 < e.length; _o6++) {e[_o6] !== t[_o6] && (s.push(e[_o6]), n = !0);}e[0] !== t[0] && (_this18.mixinDatacomPage.current = _this18.pageCurrent), _this18.mixinDatacomPage.size = _this18.pageSize, _this18.onMixinDatacomPropsChange(n, s);});}, methods: { onMixinDatacomPropsChange: function onMixinDatacomPropsChange(e, t) {}, mixinDatacomEasyGet: function mixinDatacomEasyGet() {var _this19 = this;var _ref36 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},_ref36$getone = _ref36.getone,e = _ref36$getone === void 0 ? !1 : _ref36$getone,t = _ref36.success,n = _ref36.fail;this.mixinDatacomLoading || (this.mixinDatacomLoading = !0, this.mixinDatacomErrorMessage = "", this.mixinDatacomGet().then(function (n) {_this19.mixinDatacomLoading = !1;var _n$result = n.result,s = _n$result.data,o = _n$result.count;_this19.getcount && (_this19.mixinDatacomPage.count = o), _this19.mixinDatacomHasMore = s.length < _this19.pageSize;var r = e ? s.length ? s[0] : void 0 : s;_this19.mixinDatacomResData = r, t && t(r);}).catch(function (e) {_this19.mixinDatacomLoading = !1, _this19.mixinDatacomErrorMessage = e, n && n(e);}));}, mixinDatacomGet: function mixinDatacomGet() {var _n10;var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};var n = e.database(this.spaceInfo);var s = t.action || this.action;s && (n = n.action(s));var o = t.collection || this.collection;n = Array.isArray(o) ? (_n10 = n).collection.apply(_n10, _toConsumableArray(o)) : n.collection(o);var r = t.where || this.where;r && Object.keys(r).length && (n = n.where(r));var i = t.field || this.field;i && (n = n.field(i));var a = t.foreignKey || this.foreignKey;a && (n = n.foreignKey(a));var c = t.groupby || this.groupby;c && (n = n.groupBy(c));var u = t.groupField || this.groupField;u && (n = n.groupField(u));!0 === (void 0 !== t.distinct ? t.distinct : this.distinct) && (n = n.distinct());var l = t.orderby || this.orderby;l && (n = n.orderBy(l));var h = void 0 !== t.pageCurrent ? t.pageCurrent : this.mixinDatacomPage.current,d = void 0 !== t.pageSize ? t.pageSize : this.mixinDatacomPage.size,f = void 0 !== t.getcount ? t.getcount : this.getcount,g = void 0 !== t.gettree ? t.gettree : this.gettree,p = void 0 !== t.gettreepath ? t.gettreepath : this.gettreepath,m = { getCount: f },y = { limitLevel: void 0 !== t.limitlevel ? t.limitlevel : this.limitlevel, startWith: void 0 !== t.startwith ? t.startwith : this.startwith };return g && (m.getTree = y), p && (m.getTreePath = y), n = n.skip(d * (h - 1)).limit(d).get(m), n;} } };}function un(e) {return function (t) {var n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};n = function (e) {var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};return e.customUI = t.customUI || e.customUI, Object.assign(e.loadingOptions, t.loadingOptions), Object.assign(e.errorOptions, t.errorOptions), "object" == typeof t.secretMethods && (e.secretMethods = t.secretMethods), e;}({ customUI: !1, loadingOptions: { title: "加载中...", mask: !0 }, errorOptions: { type: "modal", retry: !1 } }, n);var _n11 = n,s = _n11.customUI,o = _n11.loadingOptions,r = _n11.errorOptions,i = !s;return new Proxy({}, { get: function get(s, c) {return function () {var _ref37 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},e = _ref37.fn,t = _ref37.interceptorName,n = _ref37.getCallbackArgs;return /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee31() {var _len,s,_key,o,r,i,_args31 = arguments;return _regenerator.default.wrap(function _callee31$(_context31) {while (1) {switch (_context31.prev = _context31.next) {case 0:for (_len = _args31.length, s = new Array(_len), _key = 0; _key < _len; _key++) {s[_key] = _args31[_key];}o = n ? n({ params: s }) : {};_context31.prev = 2;_context31.next = 5;return A(I(t, "invoke"), _objectSpread({}, o));case 5:_context31.next = 7;return e.apply(void 0, s);case 7:r = _context31.sent;_context31.next = 10;return A(I(t, "success"), _objectSpread(_objectSpread({}, o), {}, { result: r }));case 10:return _context31.abrupt("return", r);case 13:_context31.prev = 13;_context31.t0 = _context31["catch"](2);i = _context31.t0;_context31.next = 18;return A(I(t, "fail"), _objectSpread(_objectSpread({}, o), {}, { error: i }));case 18:throw i;case 19:_context31.prev = 19;_context31.next = 22;return A(I(t, "complete"), i ? _objectSpread(_objectSpread({}, o), {}, { error: i }) : _objectSpread(_objectSpread({}, o), {}, { result: r }));case 22:return _context31.finish(19);case 23:case "end":return _context31.stop();}}}, _callee31, null, [[2, 13, 19, 23]]);}));}({ fn: function () {var _s11 = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee33() {var l,_len2,u,_key2,h,_ref39,d,f,g,_yield,_e30,_e29,_args33 = arguments;return _regenerator.default.wrap(function _callee33$(_context33) {while (1) {switch (_context33.prev = _context33.next) {case 0:i && uni.showLoading({ title: o.title, mask: o.mask });for (_len2 = _args33.length, u = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {u[_key2] = _args33[_key2];}h = { name: t, type: a, data: { method: c, params: u } };"object" == typeof n.secretMethods && function (e, t) {var n = t.data.method,s = e.secretMethods[n];s && (t.secret = s);}(n, h);_context33.prev = 4;_context33.next = 7;return e.callFunction(h);case 7:l = _context33.sent;_context33.next = 13;break;case 10:_context33.prev = 10;_context33.t0 = _context33["catch"](4);l = { result: _context33.t0 };case 13:_ref39 = l.result || {}, d = _ref39.errCode, f = _ref39.errMsg, g = _ref39.newToken;if (!(i && uni.hideLoading(), g && g.token && g.tokenExpired && (it(g), F(R, _objectSpread({}, g))), d)) {_context33.next = 30;break;}if (!i) {_context33.next = 28;break;}if (!("toast" === r.type)) {_context33.next = 20;break;}uni.showToast({ title: f, icon: "none" });_context33.next = 28;break;case 20:if (!("modal" !== r.type)) {_context33.next = 22;break;}throw new Error("Invalid errorOptions.type: ".concat(r.type));case 22:_context33.next = 24;return _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee32() {var _ref41,e,t,n,s,o,_args32 = arguments;return _regenerator.default.wrap(function _callee32$(_context32) {while (1) {switch (_context32.prev = _context32.next) {case 0:_ref41 = _args32.length > 0 && _args32[0] !== undefined ? _args32[0] : {}, e = _ref41.title, t = _ref41.content, n = _ref41.showCancel, s = _ref41.cancelText, o = _ref41.confirmText;return _context32.abrupt("return", new Promise(function (r, i) {uni.showModal({ title: e, content: t, showCancel: n, cancelText: s, confirmText: o, success: function success(e) {r(e);}, fail: function fail() {r({ confirm: !1, cancel: !0 });} });}));case 2:case "end":return _context32.stop();}}}, _callee32);}))({ title: "提示", content: f, showCancel: r.retry, cancelText: "取消", confirmText: r.retry ? "重试" : "确定" });case 24:_yield = _context33.sent;_e30 = _yield.confirm;if (!(r.retry && _e30)) {_context33.next = 28;break;}return _context33.abrupt("return", s.apply(void 0, u));case 28:_e29 = new B({ code: d, message: f, requestId: l.requestId });throw _e29.detail = l.result, F(C, { type: L, content: _e29 }), _e29;case 30:return _context33.abrupt("return", (F(C, { type: L, content: l.result }), l.result));case 31:case "end":return _context33.stop();}}}, _callee33, null, [[4, 10]]);}));function s() {return _s11.apply(this, arguments);}return s;}(), interceptorName: "callObject", getCallbackArgs: function getCallbackArgs() {var _ref42 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},e = _ref42.params;return { objectName: t, methodName: c, params: e };} });} });};}function ln(_x30, _x31) {return _ln.apply(this, arguments);}function _ln() {_ln = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee35(e, t) {var n, _e34, s;return _regenerator.default.wrap(function _callee35$(_context35) {while (1) {switch (_context35.prev = _context35.next) {case 0:n = "http://".concat(e, ":").concat(t, "/system/ping");_context35.prev = 1;_context35.next = 4;return s = { url: n, timeout: 500 }, new Promise(function (e, t) {V.request(_objectSpread(_objectSpread({}, s), {}, { success: function success(t) {e(t);}, fail: function fail(e) {t(e);} }));});case 4:_e34 = _context35.sent;return _context35.abrupt("return", !(!_e34.data || 0 !== _e34.data.code));case 8:_context35.prev = 8;_context35.t0 = _context35["catch"](1);return _context35.abrupt("return", !1);case 11:case "end":return _context35.stop();}}}, _callee35, null, [[1, 8]]);}));return _ln.apply(this, arguments);}function hn(e) {if (e.initUniCloudStatus && "rejected" !== e.initUniCloudStatus) return;var t = Promise.resolve();var n;n = 1, t = new Promise(function (e, t) {setTimeout(function () {e();}, n);}), e.isReady = !1, e.isDefault = !1;var s = e.auth();e.initUniCloudStatus = "pending", e.initUniCloud = t.then(function () {return s.getLoginState();}).then(function (e) {return e ? Promise.resolve() : s.signInAnonymously();}).then(function () {if (!d) return Promise.resolve();if ("app" === g) {var _uni$getSystemInfoSyn = uni.getSystemInfoSync(),_e31 = _uni$getSystemInfoSyn.osName,_t18 = _uni$getSystemInfoSyn.osVersion;"ios" === _e31 && function (e) {if (!e || "string" != typeof e) return 0;var t = e.match(/^(\d+)./);return t && t[1] ? parseInt(t[1]) : 0;}(_t18) >= 14 && console.warn("iOS 14及以上版本连接uniCloud本地调试服务需要允许客户端查找并连接到本地网络上的设备(仅开发模式生效,发行模式会连接uniCloud云端服务)");}if (d && e.__dev__.debugInfo) {var _e$__dev__$debugInfo = e.__dev__.debugInfo,_t19 = _e$__dev__$debugInfo.address,_n12 = _e$__dev__$debugInfo.servePort;return function () {var _ref43 = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee34(e, t) {var n, _s12, _o7;return _regenerator.default.wrap(function _callee34$(_context34) {while (1) {switch (_context34.prev = _context34.next) {case 0:_s12 = 0;case 1:if (!(_s12 < e.length)) {_context34.next = 11;break;}_o7 = e[_s12];_context34.next = 5;return ln(_o7, t);case 5:if (!_context34.sent) {_context34.next = 8;break;}n = _o7;return _context34.abrupt("break", 11);case 8:_s12++;_context34.next = 1;break;case 11:return _context34.abrupt("return", { address: n, port: t });case 12:case "end":return _context34.stop();}}}, _callee34);}));return function (_x32, _x33) {return _ref43.apply(this, arguments);};}()(_t19, _n12);}}).then(function () {var _ref44 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},t = _ref44.address,n = _ref44.port;if (!d) return Promise.resolve();var s = console["app" === g ? "error" : "warn"];if (t) e.__dev__.localAddress = t, e.__dev__.localPort = n;else if (e.__dev__.debugInfo) {var _t20 = "";"remote" === e.__dev__.debugInfo.initialLaunchType ? (e.__dev__.debugInfo.forceRemote = !0, _t20 = "当前客户端和HBuilderX不在同一局域网下(或其他网络原因无法连接HBuilderX),uniCloud本地调试服务不对当前客户端生效。\n- 如果不使用uniCloud本地调试服务,请直接忽略此信息。\n- 如需使用uniCloud本地调试服务,请将客户端与主机连接到同一局域网下并重新运行到客户端。\n- 如果在HBuilderX开启的状态下切换过网络环境,请重启HBuilderX后再试\n- 检查系统防火墙是否拦截了HBuilderX自带的nodejs") : _t20 = "无法连接uniCloud本地调试服务,请检查当前客户端是否与主机在同一局域网下。\n- 如需使用uniCloud本地调试服务,请将客户端与主机连接到同一局域网下并重新运行到客户端。\n- 如果在HBuilderX开启的状态下切换过网络环境,请重启HBuilderX后再试\n- 检查系统防火墙是否拦截了HBuilderX自带的nodejs", "web" === g && (_t20 += "\n- 部分浏览器开启节流模式之后访问本地地址受限,请检查是否启用了节流模式"), 0 === g.indexOf("mp-") && (_t20 += "\n- 小程序中如何使用uniCloud,请参考:https://uniapp.dcloud.net.cn/uniCloud/publish.html#useinmp"), s(_t20);}}).then(function () {at(), e.isReady = !0, e.initUniCloudStatus = "fulfilled";}).catch(function (t) {console.error(t), e.initUniCloudStatus = "rejected";});}var dn = { tcb: ot, tencent: ot, aliyun: Q, private: ut };var fn = new ( /*#__PURE__*/function () {function _class4() {_classCallCheck(this, _class4);}_createClass(_class4, [{ key: "init", value: function init(e) {var t = {};var n = dn[e.provider];if (!n) throw new Error("未提供正确的provider参数");t = n.init(e), t.__dev__ = {}, t.__dev__.debugLog = d && ("web" === g && navigator.userAgent.indexOf("HBuilderX") > 0 || "app" === g);var s = p;d && s && !s.code && (t.__dev__.debugInfo = s), hn(t), t.reInit = function () {hn(this);}, yt(t), function (e) {var t = e.uploadFile;e.uploadFile = function (e) {return t.call(this, e);};}(t), Ct(t), function (e) {e.getCurrentUserInfo = sn, e.chooseAndUploadFile = rn.initChooseAndUploadFile(e), Object.assign(e, { get mixinDatacom() {return cn(e);} }), e.importObject = un(e);}(t);return ["callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "chooseAndUploadFile"].forEach(function (e) {if (!t[e]) return;var n = t[e];t[e] = function () {return t.reInit(), n.apply(t, Array.from(arguments));}, t[e] = K(t[e], e).bind(t);}), t.init = this.init, t;} }]);return _class4;}())();(function () {var e = m;var t = {};if (e && 1 === e.length) t = e[0], fn = fn.init(t), fn.isDefault = !0;else {var _t21 = ["auth", "callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "database", "getCurrentUSerInfo", "importObject"];var _n13;_n13 = e && e.length > 0 ? "应用有多个服务空间,请通过uniCloud.init方法指定要使用的服务空间" : y ? "应用未关联服务空间,请在uniCloud目录右键关联服务空间" : "uni-app cli项目内使用uniCloud需要使用HBuilderX的运行菜单运行项目,且需要在uniCloud目录关联服务空间", _t21.forEach(function (e) {fn[e] = function () {return console.error(_n13), Promise.reject(new B({ code: "SYS_ERR", message: _n13 }));};});}Object.assign(fn, { get mixinDatacom() {return cn(fn);} }), Zt(fn), fn.addInterceptor = S, fn.removeInterceptor = P, fn.interceptObject = b, d && "web" === g && (window.uniCloud = fn);})();var gn = fn;exports.default = gn;
  9589. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 2), __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  9590. /***/ }),
  9591. /***/ 241:
  9592. /*!*********************************************************************************!*\
  9593. !*** E:/project/新耗材小程序/material_applet/pages.json?{"type":"origin-pages-json"} ***!
  9594. \*********************************************************************************/
  9595. /*! no static exports found */
  9596. /***/ (function(module, exports, __webpack_require__) {
  9597. "use strict";
  9598. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = { "pages": [{ "path": "pages/index/index", "style": { "navigationBarTitleText": "系统页" } }, { "path": "pages/login/index", "style": { "navigationBarTitleText": "登录" } }, { "path": "pages/register/index", "style": { "navigationBarTitleText": "注册" } }, { "path": "pages/home/index", "style": { "navigationBarTitleText": "首页", "enablePullDownRefresh": true } }, { "path": "pages/good/index", "style": { "navigationBarTitleText": "所有商品", "enablePullDownRefresh": true } }, { "path": "pages/procure/index", "style": { "navigationBarTitleText": "采购" } }, { "path": "pages/market/index", "style": { "navigationBarTitleText": "购物车" } }, { "path": "pages/my/index", "style": { "navigationBarTitleText": "我的" } }], "subPackages": [{ "root": "pagesMy", "pages": [{ "path": "order/index", "style": { "navigationBarTitleText": "订单", "enablePullDownRefresh": true } }, { "path": "repair/index", "style": { "navigationBarTitleText": "维修", "enablePullDownRefresh": true } }, { "path": "account/index", "style": { "navigationBarTitleText": "账号设置", "enablePullDownRefresh": true } }, { "path": "account/info", "style": { "navigationBarTitleText": "账号详情" } }, { "path": "account/update", "style": { "navigationBarTitleText": "修改密码" } }, { "path": "user/index", "style": { "navigationBarTitleText": "用户管理", "enablePullDownRefresh": true } }, { "path": "buyExamine/index", "style": { "navigationBarTitleText": "采购审核", "enablePullDownRefresh": true } }, { "path": "collectionExamin/index", "style": { "navigationBarTitleText": "回款审核", "enablePullDownRefresh": true } }, { "path": "maintenance/index", "style": { "navigationBarTitleText": "维修", "enablePullDownRefresh": true } }, { "path": "record/index", "style": { "navigationBarTitleText": "回款记录", "enablePullDownRefresh": true } }, { "path": "goods/index", "style": { "navigationBarTitleText": "商品管理", "enablePullDownRefresh": true } }, { "path": "goods/add", "style": { "navigationBarTitleText": "新增商品" } }, { "path": "spec/index", "style": { "navigationBarTitleText": "商品规格", "enablePullDownRefresh": true } }, { "path": "spec/add", "style": { "navigationBarTitleText": "新增规格" } }, { "path": "shop/index", "style": { "navigationBarTitleText": "采购清单", "enablePullDownRefresh": true } }] }, { "root": "pagesGoods", "pages": [{ "path": "index/index", "style": { "navigationBarTitleText": "商品详情" } }] }], "globalStyle": { "pageOrientation": "portrait", "navigationBarTitleText": "耗材小程序", "navigationBarTextStyle": "white", "navigationBarBackgroundColor": "#007AFF", "backgroundColor": "#F8F8F8", "backgroundColorTop": "#F4F5F6", "backgroundColorBottom": "#F4F5F6" }, "tabBar": { "color": "#7A7E83", "selectedColor": "#007AFF", "borderStyle": "black", "backgroundColor": "#F8F8F8", "list": [{ "pagePath": "pages/home/index", "iconPath": "static/home.png", "selectedIconPath": "static/homeHL.png", "text": "首页" }, { "pagePath": "pages/good/index", "iconPath": "static/good.png", "selectedIconPath": "static/goodHL.png", "text": "全部商品" }, { "pagePath": "pages/market/index", "iconPath": "static/shop.png", "selectedIconPath": "static/shopHL.png", "text": "购物车" }, { "pagePath": "pages/my/index", "iconPath": "static/my.png", "selectedIconPath": "static/myHL.png", "text": "我的" }] }, "condition": { "current": 0, "list": [{ "name": "系统首页", "path": "pages/index/index", "query": "" }] } };exports.default = _default;
  9599. /***/ }),
  9600. /***/ 242:
  9601. /*!********************************************************************!*\
  9602. !*** E:/project/新耗材小程序/material_applet/pages.json?{"type":"stat"} ***!
  9603. \********************************************************************/
  9604. /*! no static exports found */
  9605. /***/ (function(module, exports, __webpack_require__) {
  9606. "use strict";
  9607. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = { "appid": "__UNI__617FB52" };exports.default = _default;
  9608. /***/ }),
  9609. /***/ 257:
  9610. /*!************************************************************************************************************!*\
  9611. !*** E:/project/新耗材小程序/material_applet/uni_modules/uni-search-bar/components/uni-search-bar/i18n/index.js ***!
  9612. \************************************************************************************************************/
  9613. /*! no static exports found */
  9614. /***/ (function(module, exports, __webpack_require__) {
  9615. "use strict";
  9616. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _en = _interopRequireDefault(__webpack_require__(/*! ./en.json */ 258));
  9617. var _zhHans = _interopRequireDefault(__webpack_require__(/*! ./zh-Hans.json */ 259));
  9618. var _zhHant = _interopRequireDefault(__webpack_require__(/*! ./zh-Hant.json */ 260));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}var _default =
  9619. {
  9620. en: _en.default,
  9621. 'zh-Hans': _zhHans.default,
  9622. 'zh-Hant': _zhHant.default };exports.default = _default;
  9623. /***/ }),
  9624. /***/ 258:
  9625. /*!***********************************************************************************************************!*\
  9626. !*** E:/project/新耗材小程序/material_applet/uni_modules/uni-search-bar/components/uni-search-bar/i18n/en.json ***!
  9627. \***********************************************************************************************************/
  9628. /*! exports provided: uni-search-bar.cancel, uni-search-bar.placeholder, default */
  9629. /***/ (function(module) {
  9630. module.exports = JSON.parse("{\"uni-search-bar.cancel\":\"cancel\",\"uni-search-bar.placeholder\":\"Search enter content\"}");
  9631. /***/ }),
  9632. /***/ 259:
  9633. /*!****************************************************************************************************************!*\
  9634. !*** E:/project/新耗材小程序/material_applet/uni_modules/uni-search-bar/components/uni-search-bar/i18n/zh-Hans.json ***!
  9635. \****************************************************************************************************************/
  9636. /*! exports provided: uni-search-bar.cancel, uni-search-bar.placeholder, default */
  9637. /***/ (function(module) {
  9638. module.exports = JSON.parse("{\"uni-search-bar.cancel\":\"cancel\",\"uni-search-bar.placeholder\":\"请输入搜索内容\"}");
  9639. /***/ }),
  9640. /***/ 260:
  9641. /*!****************************************************************************************************************!*\
  9642. !*** E:/project/新耗材小程序/material_applet/uni_modules/uni-search-bar/components/uni-search-bar/i18n/zh-Hant.json ***!
  9643. \****************************************************************************************************************/
  9644. /*! exports provided: uni-search-bar.cancel, uni-search-bar.placeholder, default */
  9645. /***/ (function(module) {
  9646. module.exports = JSON.parse("{\"uni-search-bar.cancel\":\"cancel\",\"uni-search-bar.placeholder\":\"請輸入搜索內容\"}");
  9647. /***/ }),
  9648. /***/ 3:
  9649. /*!*************************************************************!*\
  9650. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  9651. \*************************************************************/
  9652. /*! no static exports found */
  9653. /***/ (function(module, exports, __webpack_require__) {
  9654. "use strict";
  9655. /* 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;
  9656. var isObject = function isObject(val) {return val !== null && typeof val === 'object';};
  9657. var defaultDelimiters = ['{', '}'];var
  9658. BaseFormatter = /*#__PURE__*/function () {
  9659. function BaseFormatter() {_classCallCheck(this, BaseFormatter);
  9660. this._caches = Object.create(null);
  9661. }_createClass(BaseFormatter, [{ key: "interpolate", value: function interpolate(
  9662. message, values) {var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  9663. if (!values) {
  9664. return [message];
  9665. }
  9666. var tokens = this._caches[message];
  9667. if (!tokens) {
  9668. tokens = parse(message, delimiters);
  9669. this._caches[message] = tokens;
  9670. }
  9671. return compile(tokens, values);
  9672. } }]);return BaseFormatter;}();exports.Formatter = BaseFormatter;
  9673. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  9674. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  9675. function parse(format, _ref) {var _ref2 = _slicedToArray(_ref, 2),startDelimiter = _ref2[0],endDelimiter = _ref2[1];
  9676. var tokens = [];
  9677. var position = 0;
  9678. var text = '';
  9679. while (position < format.length) {
  9680. var char = format[position++];
  9681. if (char === startDelimiter) {
  9682. if (text) {
  9683. tokens.push({ type: 'text', value: text });
  9684. }
  9685. text = '';
  9686. var sub = '';
  9687. char = format[position++];
  9688. while (char !== undefined && char !== endDelimiter) {
  9689. sub += char;
  9690. char = format[position++];
  9691. }
  9692. var isClosed = char === endDelimiter;
  9693. var type = RE_TOKEN_LIST_VALUE.test(sub) ?
  9694. 'list' :
  9695. isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ?
  9696. 'named' :
  9697. 'unknown';
  9698. tokens.push({ value: sub, type: type });
  9699. }
  9700. // else if (char === '%') {
  9701. // // when found rails i18n syntax, skip text capture
  9702. // if (format[position] !== '{') {
  9703. // text += char
  9704. // }
  9705. // }
  9706. else {
  9707. text += char;
  9708. }
  9709. }
  9710. text && tokens.push({ type: 'text', value: text });
  9711. return tokens;
  9712. }
  9713. function compile(tokens, values) {
  9714. var compiled = [];
  9715. var index = 0;
  9716. var mode = isArray(values) ?
  9717. 'list' :
  9718. isObject(values) ?
  9719. 'named' :
  9720. 'unknown';
  9721. if (mode === 'unknown') {
  9722. return compiled;
  9723. }
  9724. while (index < tokens.length) {
  9725. var token = tokens[index];
  9726. switch (token.type) {
  9727. case 'text':
  9728. compiled.push(token.value);
  9729. break;
  9730. case 'list':
  9731. compiled.push(values[parseInt(token.value, 10)]);
  9732. break;
  9733. case 'named':
  9734. if (mode === 'named') {
  9735. compiled.push(values[token.value]);
  9736. } else
  9737. {
  9738. if (true) {
  9739. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  9740. }
  9741. }
  9742. break;
  9743. case 'unknown':
  9744. if (true) {
  9745. console.warn("Detect 'unknown' type of token!");
  9746. }
  9747. break;}
  9748. index++;
  9749. }
  9750. return compiled;
  9751. }
  9752. var LOCALE_ZH_HANS = 'zh-Hans';exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  9753. var LOCALE_ZH_HANT = 'zh-Hant';exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  9754. var LOCALE_EN = 'en';exports.LOCALE_EN = LOCALE_EN;
  9755. var LOCALE_FR = 'fr';exports.LOCALE_FR = LOCALE_FR;
  9756. var LOCALE_ES = 'es';exports.LOCALE_ES = LOCALE_ES;
  9757. var hasOwnProperty = Object.prototype.hasOwnProperty;
  9758. var hasOwn = function hasOwn(val, key) {return hasOwnProperty.call(val, key);};
  9759. var defaultFormatter = new BaseFormatter();
  9760. function include(str, parts) {
  9761. return !!parts.find(function (part) {return str.indexOf(part) !== -1;});
  9762. }
  9763. function startsWith(str, parts) {
  9764. return parts.find(function (part) {return str.indexOf(part) === 0;});
  9765. }
  9766. function normalizeLocale(locale, messages) {
  9767. if (!locale) {
  9768. return;
  9769. }
  9770. locale = locale.trim().replace(/_/g, '-');
  9771. if (messages && messages[locale]) {
  9772. return locale;
  9773. }
  9774. locale = locale.toLowerCase();
  9775. if (locale.indexOf('zh') === 0) {
  9776. if (locale.indexOf('-hans') > -1) {
  9777. return LOCALE_ZH_HANS;
  9778. }
  9779. if (locale.indexOf('-hant') > -1) {
  9780. return LOCALE_ZH_HANT;
  9781. }
  9782. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  9783. return LOCALE_ZH_HANT;
  9784. }
  9785. return LOCALE_ZH_HANS;
  9786. }
  9787. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  9788. if (lang) {
  9789. return lang;
  9790. }
  9791. }var
  9792. I18n = /*#__PURE__*/function () {
  9793. function I18n(_ref3) {var locale = _ref3.locale,fallbackLocale = _ref3.fallbackLocale,messages = _ref3.messages,watcher = _ref3.watcher,formater = _ref3.formater;_classCallCheck(this, I18n);
  9794. this.locale = LOCALE_EN;
  9795. this.fallbackLocale = LOCALE_EN;
  9796. this.message = {};
  9797. this.messages = {};
  9798. this.watchers = [];
  9799. if (fallbackLocale) {
  9800. this.fallbackLocale = fallbackLocale;
  9801. }
  9802. this.formater = formater || defaultFormatter;
  9803. this.messages = messages || {};
  9804. this.setLocale(locale || LOCALE_EN);
  9805. if (watcher) {
  9806. this.watchLocale(watcher);
  9807. }
  9808. }_createClass(I18n, [{ key: "setLocale", value: function setLocale(
  9809. locale) {var _this = this;
  9810. var oldLocale = this.locale;
  9811. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  9812. if (!this.messages[this.locale]) {
  9813. // 可能初始化时不存在
  9814. this.messages[this.locale] = {};
  9815. }
  9816. this.message = this.messages[this.locale];
  9817. // 仅发生变化时,通知
  9818. if (oldLocale !== this.locale) {
  9819. this.watchers.forEach(function (watcher) {
  9820. watcher(_this.locale, oldLocale);
  9821. });
  9822. }
  9823. } }, { key: "getLocale", value: function getLocale()
  9824. {
  9825. return this.locale;
  9826. } }, { key: "watchLocale", value: function watchLocale(
  9827. fn) {var _this2 = this;
  9828. var index = this.watchers.push(fn) - 1;
  9829. return function () {
  9830. _this2.watchers.splice(index, 1);
  9831. };
  9832. } }, { key: "add", value: function add(
  9833. locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  9834. var curMessages = this.messages[locale];
  9835. if (curMessages) {
  9836. if (override) {
  9837. Object.assign(curMessages, message);
  9838. } else
  9839. {
  9840. Object.keys(message).forEach(function (key) {
  9841. if (!hasOwn(curMessages, key)) {
  9842. curMessages[key] = message[key];
  9843. }
  9844. });
  9845. }
  9846. } else
  9847. {
  9848. this.messages[locale] = message;
  9849. }
  9850. } }, { key: "f", value: function f(
  9851. message, values, delimiters) {
  9852. return this.formater.interpolate(message, values, delimiters).join('');
  9853. } }, { key: "t", value: function t(
  9854. key, locale, values) {
  9855. var message = this.message;
  9856. if (typeof locale === 'string') {
  9857. locale = normalizeLocale(locale, this.messages);
  9858. locale && (message = this.messages[locale]);
  9859. } else
  9860. {
  9861. values = locale;
  9862. }
  9863. if (!hasOwn(message, key)) {
  9864. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  9865. return key;
  9866. }
  9867. return this.formater.interpolate(message[key], values).join('');
  9868. } }]);return I18n;}();exports.I18n = I18n;
  9869. function watchAppLocale(appVm, i18n) {
  9870. // 需要保证 watch 的触发在组件渲染之前
  9871. if (appVm.$watchLocale) {
  9872. // vue2
  9873. appVm.$watchLocale(function (newLocale) {
  9874. i18n.setLocale(newLocale);
  9875. });
  9876. } else
  9877. {
  9878. appVm.$watch(function () {return appVm.$locale;}, function (newLocale) {
  9879. i18n.setLocale(newLocale);
  9880. });
  9881. }
  9882. }
  9883. function getDefaultLocale() {
  9884. if (typeof uni !== 'undefined' && uni.getLocale) {
  9885. return uni.getLocale();
  9886. }
  9887. // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
  9888. if (typeof global !== 'undefined' && global.getLocale) {
  9889. return global.getLocale();
  9890. }
  9891. return LOCALE_EN;
  9892. }
  9893. 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;
  9894. // 兼容旧版本入参
  9895. if (typeof locale !== 'string') {var _ref4 =
  9896. [
  9897. messages,
  9898. locale];locale = _ref4[0];messages = _ref4[1];
  9899. }
  9900. if (typeof locale !== 'string') {
  9901. // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
  9902. locale = getDefaultLocale();
  9903. }
  9904. if (typeof fallbackLocale !== 'string') {
  9905. fallbackLocale =
  9906. typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale ||
  9907. LOCALE_EN;
  9908. }
  9909. var i18n = new I18n({
  9910. locale: locale,
  9911. fallbackLocale: fallbackLocale,
  9912. messages: messages,
  9913. watcher: watcher });
  9914. var _t = function t(key, values) {
  9915. if (typeof getApp !== 'function') {
  9916. // app view
  9917. /* eslint-disable no-func-assign */
  9918. _t = function t(key, values) {
  9919. return i18n.t(key, values);
  9920. };
  9921. } else
  9922. {
  9923. var isWatchedAppLocale = false;
  9924. _t = function t(key, values) {
  9925. var appVm = getApp().$vm;
  9926. // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
  9927. // options: {
  9928. // type: Array,
  9929. // default () {
  9930. // return [{
  9931. // icon: 'shop',
  9932. // text: t("uni-goods-nav.options.shop"),
  9933. // }, {
  9934. // icon: 'cart',
  9935. // text: t("uni-goods-nav.options.cart")
  9936. // }]
  9937. // }
  9938. // },
  9939. if (appVm) {
  9940. // 触发响应式
  9941. appVm.$locale;
  9942. if (!isWatchedAppLocale) {
  9943. isWatchedAppLocale = true;
  9944. watchAppLocale(appVm, i18n);
  9945. }
  9946. }
  9947. return i18n.t(key, values);
  9948. };
  9949. }
  9950. return _t(key, values);
  9951. };
  9952. return {
  9953. i18n: i18n,
  9954. f: function f(message, values, delimiters) {
  9955. return i18n.f(message, values, delimiters);
  9956. },
  9957. t: function t(key, values) {
  9958. return _t(key, values);
  9959. },
  9960. add: function add(locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  9961. return i18n.add(locale, message, override);
  9962. },
  9963. watch: function watch(fn) {
  9964. return i18n.watchLocale(fn);
  9965. },
  9966. getLocale: function getLocale() {
  9967. return i18n.getLocale();
  9968. },
  9969. setLocale: function setLocale(newLocale) {
  9970. return i18n.setLocale(newLocale);
  9971. } };
  9972. }
  9973. var isString = function isString(val) {return typeof val === 'string';};exports.isString = isString;
  9974. var formater;
  9975. function hasI18nJson(jsonObj, delimiters) {
  9976. if (!formater) {
  9977. formater = new BaseFormatter();
  9978. }
  9979. return walkJsonObj(jsonObj, function (jsonObj, key) {
  9980. var value = jsonObj[key];
  9981. if (isString(value)) {
  9982. if (isI18nStr(value, delimiters)) {
  9983. return true;
  9984. }
  9985. } else
  9986. {
  9987. return hasI18nJson(value, delimiters);
  9988. }
  9989. });
  9990. }
  9991. function parseI18nJson(jsonObj, values, delimiters) {
  9992. if (!formater) {
  9993. formater = new BaseFormatter();
  9994. }
  9995. walkJsonObj(jsonObj, function (jsonObj, key) {
  9996. var value = jsonObj[key];
  9997. if (isString(value)) {
  9998. if (isI18nStr(value, delimiters)) {
  9999. jsonObj[key] = compileStr(value, values, delimiters);
  10000. }
  10001. } else
  10002. {
  10003. parseI18nJson(value, values, delimiters);
  10004. }
  10005. });
  10006. return jsonObj;
  10007. }
  10008. function compileI18nJsonStr(jsonStr, _ref5) {var locale = _ref5.locale,locales = _ref5.locales,delimiters = _ref5.delimiters;
  10009. if (!isI18nStr(jsonStr, delimiters)) {
  10010. return jsonStr;
  10011. }
  10012. if (!formater) {
  10013. formater = new BaseFormatter();
  10014. }
  10015. var localeValues = [];
  10016. Object.keys(locales).forEach(function (name) {
  10017. if (name !== locale) {
  10018. localeValues.push({
  10019. locale: name,
  10020. values: locales[name] });
  10021. }
  10022. });
  10023. localeValues.unshift({ locale: locale, values: locales[locale] });
  10024. try {
  10025. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  10026. }
  10027. catch (e) {}
  10028. return jsonStr;
  10029. }
  10030. function isI18nStr(value, delimiters) {
  10031. return value.indexOf(delimiters[0]) > -1;
  10032. }
  10033. function compileStr(value, values, delimiters) {
  10034. return formater.interpolate(value, values, delimiters).join('');
  10035. }
  10036. function compileValue(jsonObj, key, localeValues, delimiters) {
  10037. var value = jsonObj[key];
  10038. if (isString(value)) {
  10039. // 存在国际化
  10040. if (isI18nStr(value, delimiters)) {
  10041. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  10042. if (localeValues.length > 1) {
  10043. // 格式化国际化语言
  10044. var valueLocales = jsonObj[key + 'Locales'] = {};
  10045. localeValues.forEach(function (localValue) {
  10046. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  10047. });
  10048. }
  10049. }
  10050. } else
  10051. {
  10052. compileJsonObj(value, localeValues, delimiters);
  10053. }
  10054. }
  10055. function compileJsonObj(jsonObj, localeValues, delimiters) {
  10056. walkJsonObj(jsonObj, function (jsonObj, key) {
  10057. compileValue(jsonObj, key, localeValues, delimiters);
  10058. });
  10059. return jsonObj;
  10060. }
  10061. function walkJsonObj(jsonObj, walk) {
  10062. if (isArray(jsonObj)) {
  10063. for (var i = 0; i < jsonObj.length; i++) {
  10064. if (walk(jsonObj, i)) {
  10065. return true;
  10066. }
  10067. }
  10068. } else
  10069. if (isObject(jsonObj)) {
  10070. for (var key in jsonObj) {
  10071. if (walk(jsonObj, key)) {
  10072. return true;
  10073. }
  10074. }
  10075. }
  10076. return false;
  10077. }
  10078. function resolveLocale(locales) {
  10079. return function (locale) {
  10080. if (!locale) {
  10081. return locale;
  10082. }
  10083. locale = normalizeLocale(locale) || locale;
  10084. return resolveLocaleChain(locale).find(function (locale) {return locales.indexOf(locale) > -1;});
  10085. };
  10086. }
  10087. function resolveLocaleChain(locale) {
  10088. var chain = [];
  10089. var tokens = locale.split('-');
  10090. while (tokens.length) {
  10091. chain.push(tokens.join('-'));
  10092. tokens.pop();
  10093. }
  10094. return chain;
  10095. }
  10096. /* 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)))
  10097. /***/ }),
  10098. /***/ 303:
  10099. /*!**********************************************************************************************************!*\
  10100. !*** E:/project/新耗材小程序/material_applet/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/index.js ***!
  10101. \**********************************************************************************************************/
  10102. /*! no static exports found */
  10103. /***/ (function(module, exports, __webpack_require__) {
  10104. "use strict";
  10105. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _en = _interopRequireDefault(__webpack_require__(/*! ./en.json */ 304));
  10106. var _zhHans = _interopRequireDefault(__webpack_require__(/*! ./zh-Hans.json */ 305));
  10107. var _zhHant = _interopRequireDefault(__webpack_require__(/*! ./zh-Hant.json */ 306));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}var _default =
  10108. {
  10109. en: _en.default,
  10110. 'zh-Hans': _zhHans.default,
  10111. 'zh-Hant': _zhHant.default };exports.default = _default;
  10112. /***/ }),
  10113. /***/ 304:
  10114. /*!*********************************************************************************************************!*\
  10115. !*** E:/project/新耗材小程序/material_applet/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/en.json ***!
  10116. \*********************************************************************************************************/
  10117. /*! exports provided: uni-goods-nav.options.shop, uni-goods-nav.options.cart, uni-goods-nav.buttonGroup.addToCart, uni-goods-nav.buttonGroup.buyNow, default */
  10118. /***/ (function(module) {
  10119. module.exports = JSON.parse("{\"uni-goods-nav.options.shop\":\"shop\",\"uni-goods-nav.options.cart\":\"cart\",\"uni-goods-nav.buttonGroup.addToCart\":\"add to cart\",\"uni-goods-nav.buttonGroup.buyNow\":\"buy now\"}");
  10120. /***/ }),
  10121. /***/ 305:
  10122. /*!**************************************************************************************************************!*\
  10123. !*** E:/project/新耗材小程序/material_applet/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/zh-Hans.json ***!
  10124. \**************************************************************************************************************/
  10125. /*! exports provided: uni-goods-nav.options.shop, uni-goods-nav.options.cart, uni-goods-nav.buttonGroup.addToCart, uni-goods-nav.buttonGroup.buyNow, default */
  10126. /***/ (function(module) {
  10127. module.exports = JSON.parse("{\"uni-goods-nav.options.shop\":\"店铺\",\"uni-goods-nav.options.cart\":\"购物车\",\"uni-goods-nav.buttonGroup.addToCart\":\"加入购物车\",\"uni-goods-nav.buttonGroup.buyNow\":\"立即购买\"}");
  10128. /***/ }),
  10129. /***/ 306:
  10130. /*!**************************************************************************************************************!*\
  10131. !*** E:/project/新耗材小程序/material_applet/uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/zh-Hant.json ***!
  10132. \**************************************************************************************************************/
  10133. /*! exports provided: uni-goods-nav.options.shop, uni-goods-nav.options.cart, uni-goods-nav.buttonGroup.addToCart, uni-goods-nav.buttonGroup.buyNow, default */
  10134. /***/ (function(module) {
  10135. module.exports = JSON.parse("{\"uni-goods-nav.options.shop\":\"店鋪\",\"uni-goods-nav.options.cart\":\"購物車\",\"uni-goods-nav.buttonGroup.addToCart\":\"加入購物車\",\"uni-goods-nav.buttonGroup.buyNow\":\"立即購買\"}");
  10136. /***/ }),
  10137. /***/ 321:
  10138. /*!*********************************************************************************************!*\
  10139. !*** E:/project/新耗材小程序/material_applet/uni_modules/uni-icons/components/uni-icons/icons.js ***!
  10140. \*********************************************************************************************/
  10141. /*! no static exports found */
  10142. /***/ (function(module, exports, __webpack_require__) {
  10143. "use strict";
  10144. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = {
  10145. "id": "2852637",
  10146. "name": "uniui图标库",
  10147. "font_family": "uniicons",
  10148. "css_prefix_text": "uniui-",
  10149. "description": "",
  10150. "glyphs": [
  10151. {
  10152. "icon_id": "25027049",
  10153. "name": "yanse",
  10154. "font_class": "color",
  10155. "unicode": "e6cf",
  10156. "unicode_decimal": 59087 },
  10157. {
  10158. "icon_id": "25027048",
  10159. "name": "wallet",
  10160. "font_class": "wallet",
  10161. "unicode": "e6b1",
  10162. "unicode_decimal": 59057 },
  10163. {
  10164. "icon_id": "25015720",
  10165. "name": "settings-filled",
  10166. "font_class": "settings-filled",
  10167. "unicode": "e6ce",
  10168. "unicode_decimal": 59086 },
  10169. {
  10170. "icon_id": "25015434",
  10171. "name": "shimingrenzheng-filled",
  10172. "font_class": "auth-filled",
  10173. "unicode": "e6cc",
  10174. "unicode_decimal": 59084 },
  10175. {
  10176. "icon_id": "24934246",
  10177. "name": "shop-filled",
  10178. "font_class": "shop-filled",
  10179. "unicode": "e6cd",
  10180. "unicode_decimal": 59085 },
  10181. {
  10182. "icon_id": "24934159",
  10183. "name": "staff-filled-01",
  10184. "font_class": "staff-filled",
  10185. "unicode": "e6cb",
  10186. "unicode_decimal": 59083 },
  10187. {
  10188. "icon_id": "24932461",
  10189. "name": "VIP-filled",
  10190. "font_class": "vip-filled",
  10191. "unicode": "e6c6",
  10192. "unicode_decimal": 59078 },
  10193. {
  10194. "icon_id": "24932462",
  10195. "name": "plus_circle_fill",
  10196. "font_class": "plus-filled",
  10197. "unicode": "e6c7",
  10198. "unicode_decimal": 59079 },
  10199. {
  10200. "icon_id": "24932463",
  10201. "name": "folder_add-filled",
  10202. "font_class": "folder-add-filled",
  10203. "unicode": "e6c8",
  10204. "unicode_decimal": 59080 },
  10205. {
  10206. "icon_id": "24932464",
  10207. "name": "yanse-filled",
  10208. "font_class": "color-filled",
  10209. "unicode": "e6c9",
  10210. "unicode_decimal": 59081 },
  10211. {
  10212. "icon_id": "24932465",
  10213. "name": "tune-filled",
  10214. "font_class": "tune-filled",
  10215. "unicode": "e6ca",
  10216. "unicode_decimal": 59082 },
  10217. {
  10218. "icon_id": "24932455",
  10219. "name": "a-rilidaka-filled",
  10220. "font_class": "calendar-filled",
  10221. "unicode": "e6c0",
  10222. "unicode_decimal": 59072 },
  10223. {
  10224. "icon_id": "24932456",
  10225. "name": "notification-filled",
  10226. "font_class": "notification-filled",
  10227. "unicode": "e6c1",
  10228. "unicode_decimal": 59073 },
  10229. {
  10230. "icon_id": "24932457",
  10231. "name": "wallet-filled",
  10232. "font_class": "wallet-filled",
  10233. "unicode": "e6c2",
  10234. "unicode_decimal": 59074 },
  10235. {
  10236. "icon_id": "24932458",
  10237. "name": "paihangbang-filled",
  10238. "font_class": "medal-filled",
  10239. "unicode": "e6c3",
  10240. "unicode_decimal": 59075 },
  10241. {
  10242. "icon_id": "24932459",
  10243. "name": "gift-filled",
  10244. "font_class": "gift-filled",
  10245. "unicode": "e6c4",
  10246. "unicode_decimal": 59076 },
  10247. {
  10248. "icon_id": "24932460",
  10249. "name": "fire-filled",
  10250. "font_class": "fire-filled",
  10251. "unicode": "e6c5",
  10252. "unicode_decimal": 59077 },
  10253. {
  10254. "icon_id": "24928001",
  10255. "name": "refreshempty",
  10256. "font_class": "refreshempty",
  10257. "unicode": "e6bf",
  10258. "unicode_decimal": 59071 },
  10259. {
  10260. "icon_id": "24926853",
  10261. "name": "location-ellipse",
  10262. "font_class": "location-filled",
  10263. "unicode": "e6af",
  10264. "unicode_decimal": 59055 },
  10265. {
  10266. "icon_id": "24926735",
  10267. "name": "person-filled",
  10268. "font_class": "person-filled",
  10269. "unicode": "e69d",
  10270. "unicode_decimal": 59037 },
  10271. {
  10272. "icon_id": "24926703",
  10273. "name": "personadd-filled",
  10274. "font_class": "personadd-filled",
  10275. "unicode": "e698",
  10276. "unicode_decimal": 59032 },
  10277. {
  10278. "icon_id": "24923351",
  10279. "name": "back",
  10280. "font_class": "back",
  10281. "unicode": "e6b9",
  10282. "unicode_decimal": 59065 },
  10283. {
  10284. "icon_id": "24923352",
  10285. "name": "forward",
  10286. "font_class": "forward",
  10287. "unicode": "e6ba",
  10288. "unicode_decimal": 59066 },
  10289. {
  10290. "icon_id": "24923353",
  10291. "name": "arrowthinright",
  10292. "font_class": "arrow-right",
  10293. "unicode": "e6bb",
  10294. "unicode_decimal": 59067 },
  10295. {
  10296. "icon_id": "24923353",
  10297. "name": "arrowthinright",
  10298. "font_class": "arrowthinright",
  10299. "unicode": "e6bb",
  10300. "unicode_decimal": 59067 },
  10301. {
  10302. "icon_id": "24923354",
  10303. "name": "arrowthinleft",
  10304. "font_class": "arrow-left",
  10305. "unicode": "e6bc",
  10306. "unicode_decimal": 59068 },
  10307. {
  10308. "icon_id": "24923354",
  10309. "name": "arrowthinleft",
  10310. "font_class": "arrowthinleft",
  10311. "unicode": "e6bc",
  10312. "unicode_decimal": 59068 },
  10313. {
  10314. "icon_id": "24923355",
  10315. "name": "arrowthinup",
  10316. "font_class": "arrow-up",
  10317. "unicode": "e6bd",
  10318. "unicode_decimal": 59069 },
  10319. {
  10320. "icon_id": "24923355",
  10321. "name": "arrowthinup",
  10322. "font_class": "arrowthinup",
  10323. "unicode": "e6bd",
  10324. "unicode_decimal": 59069 },
  10325. {
  10326. "icon_id": "24923356",
  10327. "name": "arrowthindown",
  10328. "font_class": "arrow-down",
  10329. "unicode": "e6be",
  10330. "unicode_decimal": 59070 },
  10331. {
  10332. "icon_id": "24923356",
  10333. "name": "arrowthindown",
  10334. "font_class": "arrowthindown",
  10335. "unicode": "e6be",
  10336. "unicode_decimal": 59070 },
  10337. {
  10338. "icon_id": "24923349",
  10339. "name": "arrowdown",
  10340. "font_class": "bottom",
  10341. "unicode": "e6b8",
  10342. "unicode_decimal": 59064 },
  10343. {
  10344. "icon_id": "24923349",
  10345. "name": "arrowdown",
  10346. "font_class": "arrowdown",
  10347. "unicode": "e6b8",
  10348. "unicode_decimal": 59064 },
  10349. {
  10350. "icon_id": "24923346",
  10351. "name": "arrowright",
  10352. "font_class": "right",
  10353. "unicode": "e6b5",
  10354. "unicode_decimal": 59061 },
  10355. {
  10356. "icon_id": "24923346",
  10357. "name": "arrowright",
  10358. "font_class": "arrowright",
  10359. "unicode": "e6b5",
  10360. "unicode_decimal": 59061 },
  10361. {
  10362. "icon_id": "24923347",
  10363. "name": "arrowup",
  10364. "font_class": "top",
  10365. "unicode": "e6b6",
  10366. "unicode_decimal": 59062 },
  10367. {
  10368. "icon_id": "24923347",
  10369. "name": "arrowup",
  10370. "font_class": "arrowup",
  10371. "unicode": "e6b6",
  10372. "unicode_decimal": 59062 },
  10373. {
  10374. "icon_id": "24923348",
  10375. "name": "arrowleft",
  10376. "font_class": "left",
  10377. "unicode": "e6b7",
  10378. "unicode_decimal": 59063 },
  10379. {
  10380. "icon_id": "24923348",
  10381. "name": "arrowleft",
  10382. "font_class": "arrowleft",
  10383. "unicode": "e6b7",
  10384. "unicode_decimal": 59063 },
  10385. {
  10386. "icon_id": "24923334",
  10387. "name": "eye",
  10388. "font_class": "eye",
  10389. "unicode": "e651",
  10390. "unicode_decimal": 58961 },
  10391. {
  10392. "icon_id": "24923335",
  10393. "name": "eye-filled",
  10394. "font_class": "eye-filled",
  10395. "unicode": "e66a",
  10396. "unicode_decimal": 58986 },
  10397. {
  10398. "icon_id": "24923336",
  10399. "name": "eye-slash",
  10400. "font_class": "eye-slash",
  10401. "unicode": "e6b3",
  10402. "unicode_decimal": 59059 },
  10403. {
  10404. "icon_id": "24923337",
  10405. "name": "eye-slash-filled",
  10406. "font_class": "eye-slash-filled",
  10407. "unicode": "e6b4",
  10408. "unicode_decimal": 59060 },
  10409. {
  10410. "icon_id": "24923305",
  10411. "name": "info-filled",
  10412. "font_class": "info-filled",
  10413. "unicode": "e649",
  10414. "unicode_decimal": 58953 },
  10415. {
  10416. "icon_id": "24923299",
  10417. "name": "reload-01",
  10418. "font_class": "reload",
  10419. "unicode": "e6b2",
  10420. "unicode_decimal": 59058 },
  10421. {
  10422. "icon_id": "24923195",
  10423. "name": "mic_slash_fill",
  10424. "font_class": "micoff-filled",
  10425. "unicode": "e6b0",
  10426. "unicode_decimal": 59056 },
  10427. {
  10428. "icon_id": "24923165",
  10429. "name": "map-pin-ellipse",
  10430. "font_class": "map-pin-ellipse",
  10431. "unicode": "e6ac",
  10432. "unicode_decimal": 59052 },
  10433. {
  10434. "icon_id": "24923166",
  10435. "name": "map-pin",
  10436. "font_class": "map-pin",
  10437. "unicode": "e6ad",
  10438. "unicode_decimal": 59053 },
  10439. {
  10440. "icon_id": "24923167",
  10441. "name": "location",
  10442. "font_class": "location",
  10443. "unicode": "e6ae",
  10444. "unicode_decimal": 59054 },
  10445. {
  10446. "icon_id": "24923064",
  10447. "name": "starhalf",
  10448. "font_class": "starhalf",
  10449. "unicode": "e683",
  10450. "unicode_decimal": 59011 },
  10451. {
  10452. "icon_id": "24923065",
  10453. "name": "star",
  10454. "font_class": "star",
  10455. "unicode": "e688",
  10456. "unicode_decimal": 59016 },
  10457. {
  10458. "icon_id": "24923066",
  10459. "name": "star-filled",
  10460. "font_class": "star-filled",
  10461. "unicode": "e68f",
  10462. "unicode_decimal": 59023 },
  10463. {
  10464. "icon_id": "24899646",
  10465. "name": "a-rilidaka",
  10466. "font_class": "calendar",
  10467. "unicode": "e6a0",
  10468. "unicode_decimal": 59040 },
  10469. {
  10470. "icon_id": "24899647",
  10471. "name": "fire",
  10472. "font_class": "fire",
  10473. "unicode": "e6a1",
  10474. "unicode_decimal": 59041 },
  10475. {
  10476. "icon_id": "24899648",
  10477. "name": "paihangbang",
  10478. "font_class": "medal",
  10479. "unicode": "e6a2",
  10480. "unicode_decimal": 59042 },
  10481. {
  10482. "icon_id": "24899649",
  10483. "name": "font",
  10484. "font_class": "font",
  10485. "unicode": "e6a3",
  10486. "unicode_decimal": 59043 },
  10487. {
  10488. "icon_id": "24899650",
  10489. "name": "gift",
  10490. "font_class": "gift",
  10491. "unicode": "e6a4",
  10492. "unicode_decimal": 59044 },
  10493. {
  10494. "icon_id": "24899651",
  10495. "name": "link",
  10496. "font_class": "link",
  10497. "unicode": "e6a5",
  10498. "unicode_decimal": 59045 },
  10499. {
  10500. "icon_id": "24899652",
  10501. "name": "notification",
  10502. "font_class": "notification",
  10503. "unicode": "e6a6",
  10504. "unicode_decimal": 59046 },
  10505. {
  10506. "icon_id": "24899653",
  10507. "name": "staff",
  10508. "font_class": "staff",
  10509. "unicode": "e6a7",
  10510. "unicode_decimal": 59047 },
  10511. {
  10512. "icon_id": "24899654",
  10513. "name": "VIP",
  10514. "font_class": "vip",
  10515. "unicode": "e6a8",
  10516. "unicode_decimal": 59048 },
  10517. {
  10518. "icon_id": "24899655",
  10519. "name": "folder_add",
  10520. "font_class": "folder-add",
  10521. "unicode": "e6a9",
  10522. "unicode_decimal": 59049 },
  10523. {
  10524. "icon_id": "24899656",
  10525. "name": "tune",
  10526. "font_class": "tune",
  10527. "unicode": "e6aa",
  10528. "unicode_decimal": 59050 },
  10529. {
  10530. "icon_id": "24899657",
  10531. "name": "shimingrenzheng",
  10532. "font_class": "auth",
  10533. "unicode": "e6ab",
  10534. "unicode_decimal": 59051 },
  10535. {
  10536. "icon_id": "24899565",
  10537. "name": "person",
  10538. "font_class": "person",
  10539. "unicode": "e699",
  10540. "unicode_decimal": 59033 },
  10541. {
  10542. "icon_id": "24899566",
  10543. "name": "email-filled",
  10544. "font_class": "email-filled",
  10545. "unicode": "e69a",
  10546. "unicode_decimal": 59034 },
  10547. {
  10548. "icon_id": "24899567",
  10549. "name": "phone-filled",
  10550. "font_class": "phone-filled",
  10551. "unicode": "e69b",
  10552. "unicode_decimal": 59035 },
  10553. {
  10554. "icon_id": "24899568",
  10555. "name": "phone",
  10556. "font_class": "phone",
  10557. "unicode": "e69c",
  10558. "unicode_decimal": 59036 },
  10559. {
  10560. "icon_id": "24899570",
  10561. "name": "email",
  10562. "font_class": "email",
  10563. "unicode": "e69e",
  10564. "unicode_decimal": 59038 },
  10565. {
  10566. "icon_id": "24899571",
  10567. "name": "personadd",
  10568. "font_class": "personadd",
  10569. "unicode": "e69f",
  10570. "unicode_decimal": 59039 },
  10571. {
  10572. "icon_id": "24899558",
  10573. "name": "chatboxes-filled",
  10574. "font_class": "chatboxes-filled",
  10575. "unicode": "e692",
  10576. "unicode_decimal": 59026 },
  10577. {
  10578. "icon_id": "24899559",
  10579. "name": "contact",
  10580. "font_class": "contact",
  10581. "unicode": "e693",
  10582. "unicode_decimal": 59027 },
  10583. {
  10584. "icon_id": "24899560",
  10585. "name": "chatbubble-filled",
  10586. "font_class": "chatbubble-filled",
  10587. "unicode": "e694",
  10588. "unicode_decimal": 59028 },
  10589. {
  10590. "icon_id": "24899561",
  10591. "name": "contact-filled",
  10592. "font_class": "contact-filled",
  10593. "unicode": "e695",
  10594. "unicode_decimal": 59029 },
  10595. {
  10596. "icon_id": "24899562",
  10597. "name": "chatboxes",
  10598. "font_class": "chatboxes",
  10599. "unicode": "e696",
  10600. "unicode_decimal": 59030 },
  10601. {
  10602. "icon_id": "24899563",
  10603. "name": "chatbubble",
  10604. "font_class": "chatbubble",
  10605. "unicode": "e697",
  10606. "unicode_decimal": 59031 },
  10607. {
  10608. "icon_id": "24881290",
  10609. "name": "upload-filled",
  10610. "font_class": "upload-filled",
  10611. "unicode": "e68e",
  10612. "unicode_decimal": 59022 },
  10613. {
  10614. "icon_id": "24881292",
  10615. "name": "upload",
  10616. "font_class": "upload",
  10617. "unicode": "e690",
  10618. "unicode_decimal": 59024 },
  10619. {
  10620. "icon_id": "24881293",
  10621. "name": "weixin",
  10622. "font_class": "weixin",
  10623. "unicode": "e691",
  10624. "unicode_decimal": 59025 },
  10625. {
  10626. "icon_id": "24881274",
  10627. "name": "compose",
  10628. "font_class": "compose",
  10629. "unicode": "e67f",
  10630. "unicode_decimal": 59007 },
  10631. {
  10632. "icon_id": "24881275",
  10633. "name": "qq",
  10634. "font_class": "qq",
  10635. "unicode": "e680",
  10636. "unicode_decimal": 59008 },
  10637. {
  10638. "icon_id": "24881276",
  10639. "name": "download-filled",
  10640. "font_class": "download-filled",
  10641. "unicode": "e681",
  10642. "unicode_decimal": 59009 },
  10643. {
  10644. "icon_id": "24881277",
  10645. "name": "pengyouquan",
  10646. "font_class": "pyq",
  10647. "unicode": "e682",
  10648. "unicode_decimal": 59010 },
  10649. {
  10650. "icon_id": "24881279",
  10651. "name": "sound",
  10652. "font_class": "sound",
  10653. "unicode": "e684",
  10654. "unicode_decimal": 59012 },
  10655. {
  10656. "icon_id": "24881280",
  10657. "name": "trash-filled",
  10658. "font_class": "trash-filled",
  10659. "unicode": "e685",
  10660. "unicode_decimal": 59013 },
  10661. {
  10662. "icon_id": "24881281",
  10663. "name": "sound-filled",
  10664. "font_class": "sound-filled",
  10665. "unicode": "e686",
  10666. "unicode_decimal": 59014 },
  10667. {
  10668. "icon_id": "24881282",
  10669. "name": "trash",
  10670. "font_class": "trash",
  10671. "unicode": "e687",
  10672. "unicode_decimal": 59015 },
  10673. {
  10674. "icon_id": "24881284",
  10675. "name": "videocam-filled",
  10676. "font_class": "videocam-filled",
  10677. "unicode": "e689",
  10678. "unicode_decimal": 59017 },
  10679. {
  10680. "icon_id": "24881285",
  10681. "name": "spinner-cycle",
  10682. "font_class": "spinner-cycle",
  10683. "unicode": "e68a",
  10684. "unicode_decimal": 59018 },
  10685. {
  10686. "icon_id": "24881286",
  10687. "name": "weibo",
  10688. "font_class": "weibo",
  10689. "unicode": "e68b",
  10690. "unicode_decimal": 59019 },
  10691. {
  10692. "icon_id": "24881288",
  10693. "name": "videocam",
  10694. "font_class": "videocam",
  10695. "unicode": "e68c",
  10696. "unicode_decimal": 59020 },
  10697. {
  10698. "icon_id": "24881289",
  10699. "name": "download",
  10700. "font_class": "download",
  10701. "unicode": "e68d",
  10702. "unicode_decimal": 59021 },
  10703. {
  10704. "icon_id": "24879601",
  10705. "name": "help",
  10706. "font_class": "help",
  10707. "unicode": "e679",
  10708. "unicode_decimal": 59001 },
  10709. {
  10710. "icon_id": "24879602",
  10711. "name": "navigate-filled",
  10712. "font_class": "navigate-filled",
  10713. "unicode": "e67a",
  10714. "unicode_decimal": 59002 },
  10715. {
  10716. "icon_id": "24879603",
  10717. "name": "plusempty",
  10718. "font_class": "plusempty",
  10719. "unicode": "e67b",
  10720. "unicode_decimal": 59003 },
  10721. {
  10722. "icon_id": "24879604",
  10723. "name": "smallcircle",
  10724. "font_class": "smallcircle",
  10725. "unicode": "e67c",
  10726. "unicode_decimal": 59004 },
  10727. {
  10728. "icon_id": "24879605",
  10729. "name": "minus-filled",
  10730. "font_class": "minus-filled",
  10731. "unicode": "e67d",
  10732. "unicode_decimal": 59005 },
  10733. {
  10734. "icon_id": "24879606",
  10735. "name": "micoff",
  10736. "font_class": "micoff",
  10737. "unicode": "e67e",
  10738. "unicode_decimal": 59006 },
  10739. {
  10740. "icon_id": "24879588",
  10741. "name": "closeempty",
  10742. "font_class": "closeempty",
  10743. "unicode": "e66c",
  10744. "unicode_decimal": 58988 },
  10745. {
  10746. "icon_id": "24879589",
  10747. "name": "clear",
  10748. "font_class": "clear",
  10749. "unicode": "e66d",
  10750. "unicode_decimal": 58989 },
  10751. {
  10752. "icon_id": "24879590",
  10753. "name": "navigate",
  10754. "font_class": "navigate",
  10755. "unicode": "e66e",
  10756. "unicode_decimal": 58990 },
  10757. {
  10758. "icon_id": "24879591",
  10759. "name": "minus",
  10760. "font_class": "minus",
  10761. "unicode": "e66f",
  10762. "unicode_decimal": 58991 },
  10763. {
  10764. "icon_id": "24879592",
  10765. "name": "image",
  10766. "font_class": "image",
  10767. "unicode": "e670",
  10768. "unicode_decimal": 58992 },
  10769. {
  10770. "icon_id": "24879593",
  10771. "name": "mic",
  10772. "font_class": "mic",
  10773. "unicode": "e671",
  10774. "unicode_decimal": 58993 },
  10775. {
  10776. "icon_id": "24879594",
  10777. "name": "paperplane",
  10778. "font_class": "paperplane",
  10779. "unicode": "e672",
  10780. "unicode_decimal": 58994 },
  10781. {
  10782. "icon_id": "24879595",
  10783. "name": "close",
  10784. "font_class": "close",
  10785. "unicode": "e673",
  10786. "unicode_decimal": 58995 },
  10787. {
  10788. "icon_id": "24879596",
  10789. "name": "help-filled",
  10790. "font_class": "help-filled",
  10791. "unicode": "e674",
  10792. "unicode_decimal": 58996 },
  10793. {
  10794. "icon_id": "24879597",
  10795. "name": "plus-filled",
  10796. "font_class": "paperplane-filled",
  10797. "unicode": "e675",
  10798. "unicode_decimal": 58997 },
  10799. {
  10800. "icon_id": "24879598",
  10801. "name": "plus",
  10802. "font_class": "plus",
  10803. "unicode": "e676",
  10804. "unicode_decimal": 58998 },
  10805. {
  10806. "icon_id": "24879599",
  10807. "name": "mic-filled",
  10808. "font_class": "mic-filled",
  10809. "unicode": "e677",
  10810. "unicode_decimal": 58999 },
  10811. {
  10812. "icon_id": "24879600",
  10813. "name": "image-filled",
  10814. "font_class": "image-filled",
  10815. "unicode": "e678",
  10816. "unicode_decimal": 59000 },
  10817. {
  10818. "icon_id": "24855900",
  10819. "name": "locked-filled",
  10820. "font_class": "locked-filled",
  10821. "unicode": "e668",
  10822. "unicode_decimal": 58984 },
  10823. {
  10824. "icon_id": "24855901",
  10825. "name": "info",
  10826. "font_class": "info",
  10827. "unicode": "e669",
  10828. "unicode_decimal": 58985 },
  10829. {
  10830. "icon_id": "24855903",
  10831. "name": "locked",
  10832. "font_class": "locked",
  10833. "unicode": "e66b",
  10834. "unicode_decimal": 58987 },
  10835. {
  10836. "icon_id": "24855884",
  10837. "name": "camera-filled",
  10838. "font_class": "camera-filled",
  10839. "unicode": "e658",
  10840. "unicode_decimal": 58968 },
  10841. {
  10842. "icon_id": "24855885",
  10843. "name": "chat-filled",
  10844. "font_class": "chat-filled",
  10845. "unicode": "e659",
  10846. "unicode_decimal": 58969 },
  10847. {
  10848. "icon_id": "24855886",
  10849. "name": "camera",
  10850. "font_class": "camera",
  10851. "unicode": "e65a",
  10852. "unicode_decimal": 58970 },
  10853. {
  10854. "icon_id": "24855887",
  10855. "name": "circle",
  10856. "font_class": "circle",
  10857. "unicode": "e65b",
  10858. "unicode_decimal": 58971 },
  10859. {
  10860. "icon_id": "24855888",
  10861. "name": "checkmarkempty",
  10862. "font_class": "checkmarkempty",
  10863. "unicode": "e65c",
  10864. "unicode_decimal": 58972 },
  10865. {
  10866. "icon_id": "24855889",
  10867. "name": "chat",
  10868. "font_class": "chat",
  10869. "unicode": "e65d",
  10870. "unicode_decimal": 58973 },
  10871. {
  10872. "icon_id": "24855890",
  10873. "name": "circle-filled",
  10874. "font_class": "circle-filled",
  10875. "unicode": "e65e",
  10876. "unicode_decimal": 58974 },
  10877. {
  10878. "icon_id": "24855891",
  10879. "name": "flag",
  10880. "font_class": "flag",
  10881. "unicode": "e65f",
  10882. "unicode_decimal": 58975 },
  10883. {
  10884. "icon_id": "24855892",
  10885. "name": "flag-filled",
  10886. "font_class": "flag-filled",
  10887. "unicode": "e660",
  10888. "unicode_decimal": 58976 },
  10889. {
  10890. "icon_id": "24855893",
  10891. "name": "gear-filled",
  10892. "font_class": "gear-filled",
  10893. "unicode": "e661",
  10894. "unicode_decimal": 58977 },
  10895. {
  10896. "icon_id": "24855894",
  10897. "name": "home",
  10898. "font_class": "home",
  10899. "unicode": "e662",
  10900. "unicode_decimal": 58978 },
  10901. {
  10902. "icon_id": "24855895",
  10903. "name": "home-filled",
  10904. "font_class": "home-filled",
  10905. "unicode": "e663",
  10906. "unicode_decimal": 58979 },
  10907. {
  10908. "icon_id": "24855896",
  10909. "name": "gear",
  10910. "font_class": "gear",
  10911. "unicode": "e664",
  10912. "unicode_decimal": 58980 },
  10913. {
  10914. "icon_id": "24855897",
  10915. "name": "smallcircle-filled",
  10916. "font_class": "smallcircle-filled",
  10917. "unicode": "e665",
  10918. "unicode_decimal": 58981 },
  10919. {
  10920. "icon_id": "24855898",
  10921. "name": "map-filled",
  10922. "font_class": "map-filled",
  10923. "unicode": "e666",
  10924. "unicode_decimal": 58982 },
  10925. {
  10926. "icon_id": "24855899",
  10927. "name": "map",
  10928. "font_class": "map",
  10929. "unicode": "e667",
  10930. "unicode_decimal": 58983 },
  10931. {
  10932. "icon_id": "24855825",
  10933. "name": "refresh-filled",
  10934. "font_class": "refresh-filled",
  10935. "unicode": "e656",
  10936. "unicode_decimal": 58966 },
  10937. {
  10938. "icon_id": "24855826",
  10939. "name": "refresh",
  10940. "font_class": "refresh",
  10941. "unicode": "e657",
  10942. "unicode_decimal": 58967 },
  10943. {
  10944. "icon_id": "24855808",
  10945. "name": "cloud-upload",
  10946. "font_class": "cloud-upload",
  10947. "unicode": "e645",
  10948. "unicode_decimal": 58949 },
  10949. {
  10950. "icon_id": "24855809",
  10951. "name": "cloud-download-filled",
  10952. "font_class": "cloud-download-filled",
  10953. "unicode": "e646",
  10954. "unicode_decimal": 58950 },
  10955. {
  10956. "icon_id": "24855810",
  10957. "name": "cloud-download",
  10958. "font_class": "cloud-download",
  10959. "unicode": "e647",
  10960. "unicode_decimal": 58951 },
  10961. {
  10962. "icon_id": "24855811",
  10963. "name": "cloud-upload-filled",
  10964. "font_class": "cloud-upload-filled",
  10965. "unicode": "e648",
  10966. "unicode_decimal": 58952 },
  10967. {
  10968. "icon_id": "24855813",
  10969. "name": "redo",
  10970. "font_class": "redo",
  10971. "unicode": "e64a",
  10972. "unicode_decimal": 58954 },
  10973. {
  10974. "icon_id": "24855814",
  10975. "name": "images-filled",
  10976. "font_class": "images-filled",
  10977. "unicode": "e64b",
  10978. "unicode_decimal": 58955 },
  10979. {
  10980. "icon_id": "24855815",
  10981. "name": "undo-filled",
  10982. "font_class": "undo-filled",
  10983. "unicode": "e64c",
  10984. "unicode_decimal": 58956 },
  10985. {
  10986. "icon_id": "24855816",
  10987. "name": "more",
  10988. "font_class": "more",
  10989. "unicode": "e64d",
  10990. "unicode_decimal": 58957 },
  10991. {
  10992. "icon_id": "24855817",
  10993. "name": "more-filled",
  10994. "font_class": "more-filled",
  10995. "unicode": "e64e",
  10996. "unicode_decimal": 58958 },
  10997. {
  10998. "icon_id": "24855818",
  10999. "name": "undo",
  11000. "font_class": "undo",
  11001. "unicode": "e64f",
  11002. "unicode_decimal": 58959 },
  11003. {
  11004. "icon_id": "24855819",
  11005. "name": "images",
  11006. "font_class": "images",
  11007. "unicode": "e650",
  11008. "unicode_decimal": 58960 },
  11009. {
  11010. "icon_id": "24855821",
  11011. "name": "paperclip",
  11012. "font_class": "paperclip",
  11013. "unicode": "e652",
  11014. "unicode_decimal": 58962 },
  11015. {
  11016. "icon_id": "24855822",
  11017. "name": "settings",
  11018. "font_class": "settings",
  11019. "unicode": "e653",
  11020. "unicode_decimal": 58963 },
  11021. {
  11022. "icon_id": "24855823",
  11023. "name": "search",
  11024. "font_class": "search",
  11025. "unicode": "e654",
  11026. "unicode_decimal": 58964 },
  11027. {
  11028. "icon_id": "24855824",
  11029. "name": "redo-filled",
  11030. "font_class": "redo-filled",
  11031. "unicode": "e655",
  11032. "unicode_decimal": 58965 },
  11033. {
  11034. "icon_id": "24841702",
  11035. "name": "list",
  11036. "font_class": "list",
  11037. "unicode": "e644",
  11038. "unicode_decimal": 58948 },
  11039. {
  11040. "icon_id": "24841489",
  11041. "name": "mail-open-filled",
  11042. "font_class": "mail-open-filled",
  11043. "unicode": "e63a",
  11044. "unicode_decimal": 58938 },
  11045. {
  11046. "icon_id": "24841491",
  11047. "name": "hand-thumbsdown-filled",
  11048. "font_class": "hand-down-filled",
  11049. "unicode": "e63c",
  11050. "unicode_decimal": 58940 },
  11051. {
  11052. "icon_id": "24841492",
  11053. "name": "hand-thumbsdown",
  11054. "font_class": "hand-down",
  11055. "unicode": "e63d",
  11056. "unicode_decimal": 58941 },
  11057. {
  11058. "icon_id": "24841493",
  11059. "name": "hand-thumbsup-filled",
  11060. "font_class": "hand-up-filled",
  11061. "unicode": "e63e",
  11062. "unicode_decimal": 58942 },
  11063. {
  11064. "icon_id": "24841494",
  11065. "name": "hand-thumbsup",
  11066. "font_class": "hand-up",
  11067. "unicode": "e63f",
  11068. "unicode_decimal": 58943 },
  11069. {
  11070. "icon_id": "24841496",
  11071. "name": "heart-filled",
  11072. "font_class": "heart-filled",
  11073. "unicode": "e641",
  11074. "unicode_decimal": 58945 },
  11075. {
  11076. "icon_id": "24841498",
  11077. "name": "mail-open",
  11078. "font_class": "mail-open",
  11079. "unicode": "e643",
  11080. "unicode_decimal": 58947 },
  11081. {
  11082. "icon_id": "24841488",
  11083. "name": "heart",
  11084. "font_class": "heart",
  11085. "unicode": "e639",
  11086. "unicode_decimal": 58937 },
  11087. {
  11088. "icon_id": "24839963",
  11089. "name": "loop",
  11090. "font_class": "loop",
  11091. "unicode": "e633",
  11092. "unicode_decimal": 58931 },
  11093. {
  11094. "icon_id": "24839866",
  11095. "name": "pulldown",
  11096. "font_class": "pulldown",
  11097. "unicode": "e632",
  11098. "unicode_decimal": 58930 },
  11099. {
  11100. "icon_id": "24813798",
  11101. "name": "scan",
  11102. "font_class": "scan",
  11103. "unicode": "e62a",
  11104. "unicode_decimal": 58922 },
  11105. {
  11106. "icon_id": "24813786",
  11107. "name": "bars",
  11108. "font_class": "bars",
  11109. "unicode": "e627",
  11110. "unicode_decimal": 58919 },
  11111. {
  11112. "icon_id": "24813788",
  11113. "name": "cart-filled",
  11114. "font_class": "cart-filled",
  11115. "unicode": "e629",
  11116. "unicode_decimal": 58921 },
  11117. {
  11118. "icon_id": "24813790",
  11119. "name": "checkbox",
  11120. "font_class": "checkbox",
  11121. "unicode": "e62b",
  11122. "unicode_decimal": 58923 },
  11123. {
  11124. "icon_id": "24813791",
  11125. "name": "checkbox-filled",
  11126. "font_class": "checkbox-filled",
  11127. "unicode": "e62c",
  11128. "unicode_decimal": 58924 },
  11129. {
  11130. "icon_id": "24813794",
  11131. "name": "shop",
  11132. "font_class": "shop",
  11133. "unicode": "e62f",
  11134. "unicode_decimal": 58927 },
  11135. {
  11136. "icon_id": "24813795",
  11137. "name": "headphones",
  11138. "font_class": "headphones",
  11139. "unicode": "e630",
  11140. "unicode_decimal": 58928 },
  11141. {
  11142. "icon_id": "24813796",
  11143. "name": "cart",
  11144. "font_class": "cart",
  11145. "unicode": "e631",
  11146. "unicode_decimal": 58929 }] };exports.default = _default;
  11147. /***/ }),
  11148. /***/ 329:
  11149. /*!**********************************************************************************************************!*\
  11150. !*** E:/project/新耗材小程序/material_applet/uni_modules/uni-load-more/components/uni-load-more/i18n/index.js ***!
  11151. \**********************************************************************************************************/
  11152. /*! no static exports found */
  11153. /***/ (function(module, exports, __webpack_require__) {
  11154. "use strict";
  11155. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _en = _interopRequireDefault(__webpack_require__(/*! ./en.json */ 330));
  11156. var _zhHans = _interopRequireDefault(__webpack_require__(/*! ./zh-Hans.json */ 331));
  11157. var _zhHant = _interopRequireDefault(__webpack_require__(/*! ./zh-Hant.json */ 332));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}var _default =
  11158. {
  11159. en: _en.default,
  11160. 'zh-Hans': _zhHans.default,
  11161. 'zh-Hant': _zhHant.default };exports.default = _default;
  11162. /***/ }),
  11163. /***/ 330:
  11164. /*!*********************************************************************************************************!*\
  11165. !*** E:/project/新耗材小程序/material_applet/uni_modules/uni-load-more/components/uni-load-more/i18n/en.json ***!
  11166. \*********************************************************************************************************/
  11167. /*! exports provided: uni-load-more.contentdown, uni-load-more.contentrefresh, uni-load-more.contentnomore, default */
  11168. /***/ (function(module) {
  11169. module.exports = JSON.parse("{\"uni-load-more.contentdown\":\"Pull up to show more\",\"uni-load-more.contentrefresh\":\"loading...\",\"uni-load-more.contentnomore\":\"No more data\"}");
  11170. /***/ }),
  11171. /***/ 331:
  11172. /*!**************************************************************************************************************!*\
  11173. !*** E:/project/新耗材小程序/material_applet/uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hans.json ***!
  11174. \**************************************************************************************************************/
  11175. /*! exports provided: uni-load-more.contentdown, uni-load-more.contentrefresh, uni-load-more.contentnomore, default */
  11176. /***/ (function(module) {
  11177. module.exports = JSON.parse("{\"uni-load-more.contentdown\":\"上拉显示更多\",\"uni-load-more.contentrefresh\":\"正在加载...\",\"uni-load-more.contentnomore\":\"没有更多数据了\"}");
  11178. /***/ }),
  11179. /***/ 332:
  11180. /*!**************************************************************************************************************!*\
  11181. !*** E:/project/新耗材小程序/material_applet/uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hant.json ***!
  11182. \**************************************************************************************************************/
  11183. /*! exports provided: uni-load-more.contentdown, uni-load-more.contentrefresh, uni-load-more.contentnomore, default */
  11184. /***/ (function(module) {
  11185. module.exports = JSON.parse("{\"uni-load-more.contentdown\":\"上拉顯示更多\",\"uni-load-more.contentrefresh\":\"正在加載...\",\"uni-load-more.contentnomore\":\"沒有更多數據了\"}");
  11186. /***/ }),
  11187. /***/ 340:
  11188. /*!*****************************************************************************************************************!*\
  11189. !*** E:/project/新耗材小程序/material_applet/uni_modules/uni-transition/components/uni-transition/createAnimation.js ***!
  11190. \*****************************************************************************************************************/
  11191. /*! no static exports found */
  11192. /***/ (function(module, exports, __webpack_require__) {
  11193. "use strict";
  11194. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.createAnimation = createAnimation;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;}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;} // const defaultOption = {
  11195. // duration: 300,
  11196. // timingFunction: 'linear',
  11197. // delay: 0,
  11198. // transformOrigin: '50% 50% 0'
  11199. // }
  11200. var
  11201. MPAnimation = /*#__PURE__*/function () {
  11202. function MPAnimation(options, _this) {_classCallCheck(this, MPAnimation);
  11203. this.options = options;
  11204. // 在iOS10+QQ小程序平台下,传给原生的对象一定是个普通对象而不是Proxy对象,否则会报parameter should be Object instead of ProxyObject的错误
  11205. this.animation = uni.createAnimation(_objectSpread({},
  11206. options));
  11207. this.currentStepAnimates = {};
  11208. this.next = 0;
  11209. this.$ = _this;
  11210. }_createClass(MPAnimation, [{ key: "_nvuePushAnimates", value: function _nvuePushAnimates(
  11211. type, args) {
  11212. var aniObj = this.currentStepAnimates[this.next];
  11213. var styles = {};
  11214. if (!aniObj) {
  11215. styles = {
  11216. styles: {},
  11217. config: {} };
  11218. } else {
  11219. styles = aniObj;
  11220. }
  11221. if (animateTypes1.includes(type)) {
  11222. if (!styles.styles.transform) {
  11223. styles.styles.transform = '';
  11224. }
  11225. var unit = '';
  11226. if (type === 'rotate') {
  11227. unit = 'deg';
  11228. }
  11229. styles.styles.transform += "".concat(type, "(").concat(args + unit, ") ");
  11230. } else {
  11231. styles.styles[type] = "".concat(args);
  11232. }
  11233. this.currentStepAnimates[this.next] = styles;
  11234. } }, { key: "_animateRun", value: function _animateRun()
  11235. {var styles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  11236. var ref = this.$.$refs['ani'].ref;
  11237. if (!ref) return;
  11238. return new Promise(function (resolve, reject) {
  11239. nvueAnimation.transition(ref, _objectSpread({
  11240. styles: styles },
  11241. config),
  11242. function (res) {
  11243. resolve();
  11244. });
  11245. });
  11246. } }, { key: "_nvueNextAnimate", value: function _nvueNextAnimate(
  11247. animates) {var _this2 = this;var step = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;var fn = arguments.length > 2 ? arguments[2] : undefined;
  11248. var obj = animates[step];
  11249. if (obj) {var
  11250. styles =
  11251. obj.styles,config = obj.config;
  11252. this._animateRun(styles, config).then(function () {
  11253. step += 1;
  11254. _this2._nvueNextAnimate(animates, step, fn);
  11255. });
  11256. } else {
  11257. this.currentStepAnimates = {};
  11258. typeof fn === 'function' && fn();
  11259. this.isEnd = true;
  11260. }
  11261. } }, { key: "step", value: function step()
  11262. {var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  11263. this.animation.step(config);
  11264. return this;
  11265. } }, { key: "run", value: function run(
  11266. fn) {
  11267. this.$.animationData = this.animation.export();
  11268. this.$.timer = setTimeout(function () {
  11269. typeof fn === 'function' && fn();
  11270. }, this.$.durationTime);
  11271. } }]);return MPAnimation;}();
  11272. var animateTypes1 = ['matrix', 'matrix3d', 'rotate', 'rotate3d', 'rotateX', 'rotateY', 'rotateZ', 'scale', 'scale3d',
  11273. 'scaleX', 'scaleY', 'scaleZ', 'skew', 'skewX', 'skewY', 'translate', 'translate3d', 'translateX', 'translateY',
  11274. 'translateZ'];
  11275. var animateTypes2 = ['opacity', 'backgroundColor'];
  11276. var animateTypes3 = ['width', 'height', 'left', 'right', 'top', 'bottom'];
  11277. animateTypes1.concat(animateTypes2, animateTypes3).forEach(function (type) {
  11278. MPAnimation.prototype[type] = function () {var _this$animation;
  11279. (_this$animation = this.animation)[type].apply(_this$animation, arguments);
  11280. return this;
  11281. };
  11282. });
  11283. function createAnimation(option, _this) {
  11284. if (!_this) return;
  11285. clearTimeout(_this.timer);
  11286. return new MPAnimation(option, _this);
  11287. }
  11288. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  11289. /***/ }),
  11290. /***/ 4:
  11291. /*!******************************************************************************************!*\
  11292. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  11293. \******************************************************************************************/
  11294. /*! exports provided: default */
  11295. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11296. "use strict";
  11297. __webpack_require__.r(__webpack_exports__);
  11298. /* WEBPACK VAR INJECTION */(function(global) {/*!
  11299. * Vue.js v2.6.11
  11300. * (c) 2014-2022 Evan You
  11301. * Released under the MIT License.
  11302. */
  11303. /* */
  11304. var emptyObject = Object.freeze({});
  11305. // These helpers produce better VM code in JS engines due to their
  11306. // explicitness and function inlining.
  11307. function isUndef (v) {
  11308. return v === undefined || v === null
  11309. }
  11310. function isDef (v) {
  11311. return v !== undefined && v !== null
  11312. }
  11313. function isTrue (v) {
  11314. return v === true
  11315. }
  11316. function isFalse (v) {
  11317. return v === false
  11318. }
  11319. /**
  11320. * Check if value is primitive.
  11321. */
  11322. function isPrimitive (value) {
  11323. return (
  11324. typeof value === 'string' ||
  11325. typeof value === 'number' ||
  11326. // $flow-disable-line
  11327. typeof value === 'symbol' ||
  11328. typeof value === 'boolean'
  11329. )
  11330. }
  11331. /**
  11332. * Quick object check - this is primarily used to tell
  11333. * Objects from primitive values when we know the value
  11334. * is a JSON-compliant type.
  11335. */
  11336. function isObject (obj) {
  11337. return obj !== null && typeof obj === 'object'
  11338. }
  11339. /**
  11340. * Get the raw type string of a value, e.g., [object Object].
  11341. */
  11342. var _toString = Object.prototype.toString;
  11343. function toRawType (value) {
  11344. return _toString.call(value).slice(8, -1)
  11345. }
  11346. /**
  11347. * Strict object type check. Only returns true
  11348. * for plain JavaScript objects.
  11349. */
  11350. function isPlainObject (obj) {
  11351. return _toString.call(obj) === '[object Object]'
  11352. }
  11353. function isRegExp (v) {
  11354. return _toString.call(v) === '[object RegExp]'
  11355. }
  11356. /**
  11357. * Check if val is a valid array index.
  11358. */
  11359. function isValidArrayIndex (val) {
  11360. var n = parseFloat(String(val));
  11361. return n >= 0 && Math.floor(n) === n && isFinite(val)
  11362. }
  11363. function isPromise (val) {
  11364. return (
  11365. isDef(val) &&
  11366. typeof val.then === 'function' &&
  11367. typeof val.catch === 'function'
  11368. )
  11369. }
  11370. /**
  11371. * Convert a value to a string that is actually rendered.
  11372. */
  11373. function toString (val) {
  11374. return val == null
  11375. ? ''
  11376. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  11377. ? JSON.stringify(val, null, 2)
  11378. : String(val)
  11379. }
  11380. /**
  11381. * Convert an input value to a number for persistence.
  11382. * If the conversion fails, return original string.
  11383. */
  11384. function toNumber (val) {
  11385. var n = parseFloat(val);
  11386. return isNaN(n) ? val : n
  11387. }
  11388. /**
  11389. * Make a map and return a function for checking if a key
  11390. * is in that map.
  11391. */
  11392. function makeMap (
  11393. str,
  11394. expectsLowerCase
  11395. ) {
  11396. var map = Object.create(null);
  11397. var list = str.split(',');
  11398. for (var i = 0; i < list.length; i++) {
  11399. map[list[i]] = true;
  11400. }
  11401. return expectsLowerCase
  11402. ? function (val) { return map[val.toLowerCase()]; }
  11403. : function (val) { return map[val]; }
  11404. }
  11405. /**
  11406. * Check if a tag is a built-in tag.
  11407. */
  11408. var isBuiltInTag = makeMap('slot,component', true);
  11409. /**
  11410. * Check if an attribute is a reserved attribute.
  11411. */
  11412. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  11413. /**
  11414. * Remove an item from an array.
  11415. */
  11416. function remove (arr, item) {
  11417. if (arr.length) {
  11418. var index = arr.indexOf(item);
  11419. if (index > -1) {
  11420. return arr.splice(index, 1)
  11421. }
  11422. }
  11423. }
  11424. /**
  11425. * Check whether an object has the property.
  11426. */
  11427. var hasOwnProperty = Object.prototype.hasOwnProperty;
  11428. function hasOwn (obj, key) {
  11429. return hasOwnProperty.call(obj, key)
  11430. }
  11431. /**
  11432. * Create a cached version of a pure function.
  11433. */
  11434. function cached (fn) {
  11435. var cache = Object.create(null);
  11436. return (function cachedFn (str) {
  11437. var hit = cache[str];
  11438. return hit || (cache[str] = fn(str))
  11439. })
  11440. }
  11441. /**
  11442. * Camelize a hyphen-delimited string.
  11443. */
  11444. var camelizeRE = /-(\w)/g;
  11445. var camelize = cached(function (str) {
  11446. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  11447. });
  11448. /**
  11449. * Capitalize a string.
  11450. */
  11451. var capitalize = cached(function (str) {
  11452. return str.charAt(0).toUpperCase() + str.slice(1)
  11453. });
  11454. /**
  11455. * Hyphenate a camelCase string.
  11456. */
  11457. var hyphenateRE = /\B([A-Z])/g;
  11458. var hyphenate = cached(function (str) {
  11459. return str.replace(hyphenateRE, '-$1').toLowerCase()
  11460. });
  11461. /**
  11462. * Simple bind polyfill for environments that do not support it,
  11463. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  11464. * since native bind is now performant enough in most browsers.
  11465. * But removing it would mean breaking code that was able to run in
  11466. * PhantomJS 1.x, so this must be kept for backward compatibility.
  11467. */
  11468. /* istanbul ignore next */
  11469. function polyfillBind (fn, ctx) {
  11470. function boundFn (a) {
  11471. var l = arguments.length;
  11472. return l
  11473. ? l > 1
  11474. ? fn.apply(ctx, arguments)
  11475. : fn.call(ctx, a)
  11476. : fn.call(ctx)
  11477. }
  11478. boundFn._length = fn.length;
  11479. return boundFn
  11480. }
  11481. function nativeBind (fn, ctx) {
  11482. return fn.bind(ctx)
  11483. }
  11484. var bind = Function.prototype.bind
  11485. ? nativeBind
  11486. : polyfillBind;
  11487. /**
  11488. * Convert an Array-like object to a real Array.
  11489. */
  11490. function toArray (list, start) {
  11491. start = start || 0;
  11492. var i = list.length - start;
  11493. var ret = new Array(i);
  11494. while (i--) {
  11495. ret[i] = list[i + start];
  11496. }
  11497. return ret
  11498. }
  11499. /**
  11500. * Mix properties into target object.
  11501. */
  11502. function extend (to, _from) {
  11503. for (var key in _from) {
  11504. to[key] = _from[key];
  11505. }
  11506. return to
  11507. }
  11508. /**
  11509. * Merge an Array of Objects into a single Object.
  11510. */
  11511. function toObject (arr) {
  11512. var res = {};
  11513. for (var i = 0; i < arr.length; i++) {
  11514. if (arr[i]) {
  11515. extend(res, arr[i]);
  11516. }
  11517. }
  11518. return res
  11519. }
  11520. /* eslint-disable no-unused-vars */
  11521. /**
  11522. * Perform no operation.
  11523. * Stubbing args to make Flow happy without leaving useless transpiled code
  11524. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  11525. */
  11526. function noop (a, b, c) {}
  11527. /**
  11528. * Always return false.
  11529. */
  11530. var no = function (a, b, c) { return false; };
  11531. /* eslint-enable no-unused-vars */
  11532. /**
  11533. * Return the same value.
  11534. */
  11535. var identity = function (_) { return _; };
  11536. /**
  11537. * Check if two values are loosely equal - that is,
  11538. * if they are plain objects, do they have the same shape?
  11539. */
  11540. function looseEqual (a, b) {
  11541. if (a === b) { return true }
  11542. var isObjectA = isObject(a);
  11543. var isObjectB = isObject(b);
  11544. if (isObjectA && isObjectB) {
  11545. try {
  11546. var isArrayA = Array.isArray(a);
  11547. var isArrayB = Array.isArray(b);
  11548. if (isArrayA && isArrayB) {
  11549. return a.length === b.length && a.every(function (e, i) {
  11550. return looseEqual(e, b[i])
  11551. })
  11552. } else if (a instanceof Date && b instanceof Date) {
  11553. return a.getTime() === b.getTime()
  11554. } else if (!isArrayA && !isArrayB) {
  11555. var keysA = Object.keys(a);
  11556. var keysB = Object.keys(b);
  11557. return keysA.length === keysB.length && keysA.every(function (key) {
  11558. return looseEqual(a[key], b[key])
  11559. })
  11560. } else {
  11561. /* istanbul ignore next */
  11562. return false
  11563. }
  11564. } catch (e) {
  11565. /* istanbul ignore next */
  11566. return false
  11567. }
  11568. } else if (!isObjectA && !isObjectB) {
  11569. return String(a) === String(b)
  11570. } else {
  11571. return false
  11572. }
  11573. }
  11574. /**
  11575. * Return the first index at which a loosely equal value can be
  11576. * found in the array (if value is a plain object, the array must
  11577. * contain an object of the same shape), or -1 if it is not present.
  11578. */
  11579. function looseIndexOf (arr, val) {
  11580. for (var i = 0; i < arr.length; i++) {
  11581. if (looseEqual(arr[i], val)) { return i }
  11582. }
  11583. return -1
  11584. }
  11585. /**
  11586. * Ensure a function is called only once.
  11587. */
  11588. function once (fn) {
  11589. var called = false;
  11590. return function () {
  11591. if (!called) {
  11592. called = true;
  11593. fn.apply(this, arguments);
  11594. }
  11595. }
  11596. }
  11597. var ASSET_TYPES = [
  11598. 'component',
  11599. 'directive',
  11600. 'filter'
  11601. ];
  11602. var LIFECYCLE_HOOKS = [
  11603. 'beforeCreate',
  11604. 'created',
  11605. 'beforeMount',
  11606. 'mounted',
  11607. 'beforeUpdate',
  11608. 'updated',
  11609. 'beforeDestroy',
  11610. 'destroyed',
  11611. 'activated',
  11612. 'deactivated',
  11613. 'errorCaptured',
  11614. 'serverPrefetch'
  11615. ];
  11616. /* */
  11617. var config = ({
  11618. /**
  11619. * Option merge strategies (used in core/util/options)
  11620. */
  11621. // $flow-disable-line
  11622. optionMergeStrategies: Object.create(null),
  11623. /**
  11624. * Whether to suppress warnings.
  11625. */
  11626. silent: false,
  11627. /**
  11628. * Show production mode tip message on boot?
  11629. */
  11630. productionTip: "development" !== 'production',
  11631. /**
  11632. * Whether to enable devtools
  11633. */
  11634. devtools: "development" !== 'production',
  11635. /**
  11636. * Whether to record perf
  11637. */
  11638. performance: false,
  11639. /**
  11640. * Error handler for watcher errors
  11641. */
  11642. errorHandler: null,
  11643. /**
  11644. * Warn handler for watcher warns
  11645. */
  11646. warnHandler: null,
  11647. /**
  11648. * Ignore certain custom elements
  11649. */
  11650. ignoredElements: [],
  11651. /**
  11652. * Custom user key aliases for v-on
  11653. */
  11654. // $flow-disable-line
  11655. keyCodes: Object.create(null),
  11656. /**
  11657. * Check if a tag is reserved so that it cannot be registered as a
  11658. * component. This is platform-dependent and may be overwritten.
  11659. */
  11660. isReservedTag: no,
  11661. /**
  11662. * Check if an attribute is reserved so that it cannot be used as a component
  11663. * prop. This is platform-dependent and may be overwritten.
  11664. */
  11665. isReservedAttr: no,
  11666. /**
  11667. * Check if a tag is an unknown element.
  11668. * Platform-dependent.
  11669. */
  11670. isUnknownElement: no,
  11671. /**
  11672. * Get the namespace of an element
  11673. */
  11674. getTagNamespace: noop,
  11675. /**
  11676. * Parse the real tag name for the specific platform.
  11677. */
  11678. parsePlatformTagName: identity,
  11679. /**
  11680. * Check if an attribute must be bound using property, e.g. value
  11681. * Platform-dependent.
  11682. */
  11683. mustUseProp: no,
  11684. /**
  11685. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  11686. * This will significantly reduce performance if set to false.
  11687. */
  11688. async: true,
  11689. /**
  11690. * Exposed for legacy reasons
  11691. */
  11692. _lifecycleHooks: LIFECYCLE_HOOKS
  11693. });
  11694. /* */
  11695. /**
  11696. * unicode letters used for parsing html tags, component names and property paths.
  11697. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  11698. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  11699. */
  11700. 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/;
  11701. /**
  11702. * Check if a string starts with $ or _
  11703. */
  11704. function isReserved (str) {
  11705. var c = (str + '').charCodeAt(0);
  11706. return c === 0x24 || c === 0x5F
  11707. }
  11708. /**
  11709. * Define a property.
  11710. */
  11711. function def (obj, key, val, enumerable) {
  11712. Object.defineProperty(obj, key, {
  11713. value: val,
  11714. enumerable: !!enumerable,
  11715. writable: true,
  11716. configurable: true
  11717. });
  11718. }
  11719. /**
  11720. * Parse simple path.
  11721. */
  11722. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  11723. function parsePath (path) {
  11724. if (bailRE.test(path)) {
  11725. return
  11726. }
  11727. var segments = path.split('.');
  11728. return function (obj) {
  11729. for (var i = 0; i < segments.length; i++) {
  11730. if (!obj) { return }
  11731. obj = obj[segments[i]];
  11732. }
  11733. return obj
  11734. }
  11735. }
  11736. /* */
  11737. // can we use __proto__?
  11738. var hasProto = '__proto__' in {};
  11739. // Browser environment sniffing
  11740. var inBrowser = typeof window !== 'undefined';
  11741. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  11742. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  11743. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  11744. var isIE = UA && /msie|trident/.test(UA);
  11745. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  11746. var isEdge = UA && UA.indexOf('edge/') > 0;
  11747. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  11748. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  11749. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  11750. var isPhantomJS = UA && /phantomjs/.test(UA);
  11751. var isFF = UA && UA.match(/firefox\/(\d+)/);
  11752. // Firefox has a "watch" function on Object.prototype...
  11753. var nativeWatch = ({}).watch;
  11754. if (inBrowser) {
  11755. try {
  11756. var opts = {};
  11757. Object.defineProperty(opts, 'passive', ({
  11758. get: function get () {
  11759. }
  11760. })); // https://github.com/facebook/flow/issues/285
  11761. window.addEventListener('test-passive', null, opts);
  11762. } catch (e) {}
  11763. }
  11764. // this needs to be lazy-evaled because vue may be required before
  11765. // vue-server-renderer can set VUE_ENV
  11766. var _isServer;
  11767. var isServerRendering = function () {
  11768. if (_isServer === undefined) {
  11769. /* istanbul ignore if */
  11770. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  11771. // detect presence of vue-server-renderer and avoid
  11772. // Webpack shimming the process
  11773. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  11774. } else {
  11775. _isServer = false;
  11776. }
  11777. }
  11778. return _isServer
  11779. };
  11780. // detect devtools
  11781. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  11782. /* istanbul ignore next */
  11783. function isNative (Ctor) {
  11784. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  11785. }
  11786. var hasSymbol =
  11787. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  11788. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  11789. var _Set;
  11790. /* istanbul ignore if */ // $flow-disable-line
  11791. if (typeof Set !== 'undefined' && isNative(Set)) {
  11792. // use native Set when available.
  11793. _Set = Set;
  11794. } else {
  11795. // a non-standard Set polyfill that only works with primitive keys.
  11796. _Set = /*@__PURE__*/(function () {
  11797. function Set () {
  11798. this.set = Object.create(null);
  11799. }
  11800. Set.prototype.has = function has (key) {
  11801. return this.set[key] === true
  11802. };
  11803. Set.prototype.add = function add (key) {
  11804. this.set[key] = true;
  11805. };
  11806. Set.prototype.clear = function clear () {
  11807. this.set = Object.create(null);
  11808. };
  11809. return Set;
  11810. }());
  11811. }
  11812. /* */
  11813. var warn = noop;
  11814. var tip = noop;
  11815. var generateComponentTrace = (noop); // work around flow check
  11816. var formatComponentName = (noop);
  11817. if (true) {
  11818. var hasConsole = typeof console !== 'undefined';
  11819. var classifyRE = /(?:^|[-_])(\w)/g;
  11820. var classify = function (str) { return str
  11821. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  11822. .replace(/[-_]/g, ''); };
  11823. warn = function (msg, vm) {
  11824. var trace = vm ? generateComponentTrace(vm) : '';
  11825. if (config.warnHandler) {
  11826. config.warnHandler.call(null, msg, vm, trace);
  11827. } else if (hasConsole && (!config.silent)) {
  11828. console.error(("[Vue warn]: " + msg + trace));
  11829. }
  11830. };
  11831. tip = function (msg, vm) {
  11832. if (hasConsole && (!config.silent)) {
  11833. console.warn("[Vue tip]: " + msg + (
  11834. vm ? generateComponentTrace(vm) : ''
  11835. ));
  11836. }
  11837. };
  11838. formatComponentName = function (vm, includeFile) {
  11839. if (vm.$root === vm) {
  11840. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  11841. return ('') + vm.$options.__file
  11842. }
  11843. return '<Root>'
  11844. }
  11845. var options = typeof vm === 'function' && vm.cid != null
  11846. ? vm.options
  11847. : vm._isVue
  11848. ? vm.$options || vm.constructor.options
  11849. : vm;
  11850. var name = options.name || options._componentTag;
  11851. var file = options.__file;
  11852. if (!name && file) {
  11853. var match = file.match(/([^/\\]+)\.vue$/);
  11854. name = match && match[1];
  11855. }
  11856. return (
  11857. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  11858. (file && includeFile !== false ? (" at " + file) : '')
  11859. )
  11860. };
  11861. var repeat = function (str, n) {
  11862. var res = '';
  11863. while (n) {
  11864. if (n % 2 === 1) { res += str; }
  11865. if (n > 1) { str += str; }
  11866. n >>= 1;
  11867. }
  11868. return res
  11869. };
  11870. generateComponentTrace = function (vm) {
  11871. if (vm._isVue && vm.$parent) {
  11872. var tree = [];
  11873. var currentRecursiveSequence = 0;
  11874. while (vm && vm.$options.name !== 'PageBody') {
  11875. if (tree.length > 0) {
  11876. var last = tree[tree.length - 1];
  11877. if (last.constructor === vm.constructor) {
  11878. currentRecursiveSequence++;
  11879. vm = vm.$parent;
  11880. continue
  11881. } else if (currentRecursiveSequence > 0) {
  11882. tree[tree.length - 1] = [last, currentRecursiveSequence];
  11883. currentRecursiveSequence = 0;
  11884. }
  11885. }
  11886. !vm.$options.isReserved && tree.push(vm);
  11887. vm = vm.$parent;
  11888. }
  11889. return '\n\nfound in\n\n' + tree
  11890. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  11891. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  11892. : formatComponentName(vm))); })
  11893. .join('\n')
  11894. } else {
  11895. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  11896. }
  11897. };
  11898. }
  11899. /* */
  11900. var uid = 0;
  11901. /**
  11902. * A dep is an observable that can have multiple
  11903. * directives subscribing to it.
  11904. */
  11905. var Dep = function Dep () {
  11906. this.id = uid++;
  11907. this.subs = [];
  11908. };
  11909. Dep.prototype.addSub = function addSub (sub) {
  11910. this.subs.push(sub);
  11911. };
  11912. Dep.prototype.removeSub = function removeSub (sub) {
  11913. remove(this.subs, sub);
  11914. };
  11915. Dep.prototype.depend = function depend () {
  11916. if (Dep.SharedObject.target) {
  11917. Dep.SharedObject.target.addDep(this);
  11918. }
  11919. };
  11920. Dep.prototype.notify = function notify () {
  11921. // stabilize the subscriber list first
  11922. var subs = this.subs.slice();
  11923. if ( true && !config.async) {
  11924. // subs aren't sorted in scheduler if not running async
  11925. // we need to sort them now to make sure they fire in correct
  11926. // order
  11927. subs.sort(function (a, b) { return a.id - b.id; });
  11928. }
  11929. for (var i = 0, l = subs.length; i < l; i++) {
  11930. subs[i].update();
  11931. }
  11932. };
  11933. // The current target watcher being evaluated.
  11934. // This is globally unique because only one watcher
  11935. // can be evaluated at a time.
  11936. // fixed by xxxxxx (nvue shared vuex)
  11937. /* eslint-disable no-undef */
  11938. Dep.SharedObject = {};
  11939. Dep.SharedObject.target = null;
  11940. Dep.SharedObject.targetStack = [];
  11941. function pushTarget (target) {
  11942. Dep.SharedObject.targetStack.push(target);
  11943. Dep.SharedObject.target = target;
  11944. Dep.target = target;
  11945. }
  11946. function popTarget () {
  11947. Dep.SharedObject.targetStack.pop();
  11948. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  11949. Dep.target = Dep.SharedObject.target;
  11950. }
  11951. /* */
  11952. var VNode = function VNode (
  11953. tag,
  11954. data,
  11955. children,
  11956. text,
  11957. elm,
  11958. context,
  11959. componentOptions,
  11960. asyncFactory
  11961. ) {
  11962. this.tag = tag;
  11963. this.data = data;
  11964. this.children = children;
  11965. this.text = text;
  11966. this.elm = elm;
  11967. this.ns = undefined;
  11968. this.context = context;
  11969. this.fnContext = undefined;
  11970. this.fnOptions = undefined;
  11971. this.fnScopeId = undefined;
  11972. this.key = data && data.key;
  11973. this.componentOptions = componentOptions;
  11974. this.componentInstance = undefined;
  11975. this.parent = undefined;
  11976. this.raw = false;
  11977. this.isStatic = false;
  11978. this.isRootInsert = true;
  11979. this.isComment = false;
  11980. this.isCloned = false;
  11981. this.isOnce = false;
  11982. this.asyncFactory = asyncFactory;
  11983. this.asyncMeta = undefined;
  11984. this.isAsyncPlaceholder = false;
  11985. };
  11986. var prototypeAccessors = { child: { configurable: true } };
  11987. // DEPRECATED: alias for componentInstance for backwards compat.
  11988. /* istanbul ignore next */
  11989. prototypeAccessors.child.get = function () {
  11990. return this.componentInstance
  11991. };
  11992. Object.defineProperties( VNode.prototype, prototypeAccessors );
  11993. var createEmptyVNode = function (text) {
  11994. if ( text === void 0 ) text = '';
  11995. var node = new VNode();
  11996. node.text = text;
  11997. node.isComment = true;
  11998. return node
  11999. };
  12000. function createTextVNode (val) {
  12001. return new VNode(undefined, undefined, undefined, String(val))
  12002. }
  12003. // optimized shallow clone
  12004. // used for static nodes and slot nodes because they may be reused across
  12005. // multiple renders, cloning them avoids errors when DOM manipulations rely
  12006. // on their elm reference.
  12007. function cloneVNode (vnode) {
  12008. var cloned = new VNode(
  12009. vnode.tag,
  12010. vnode.data,
  12011. // #7975
  12012. // clone children array to avoid mutating original in case of cloning
  12013. // a child.
  12014. vnode.children && vnode.children.slice(),
  12015. vnode.text,
  12016. vnode.elm,
  12017. vnode.context,
  12018. vnode.componentOptions,
  12019. vnode.asyncFactory
  12020. );
  12021. cloned.ns = vnode.ns;
  12022. cloned.isStatic = vnode.isStatic;
  12023. cloned.key = vnode.key;
  12024. cloned.isComment = vnode.isComment;
  12025. cloned.fnContext = vnode.fnContext;
  12026. cloned.fnOptions = vnode.fnOptions;
  12027. cloned.fnScopeId = vnode.fnScopeId;
  12028. cloned.asyncMeta = vnode.asyncMeta;
  12029. cloned.isCloned = true;
  12030. return cloned
  12031. }
  12032. /*
  12033. * not type checking this file because flow doesn't play well with
  12034. * dynamically accessing methods on Array prototype
  12035. */
  12036. var arrayProto = Array.prototype;
  12037. var arrayMethods = Object.create(arrayProto);
  12038. var methodsToPatch = [
  12039. 'push',
  12040. 'pop',
  12041. 'shift',
  12042. 'unshift',
  12043. 'splice',
  12044. 'sort',
  12045. 'reverse'
  12046. ];
  12047. /**
  12048. * Intercept mutating methods and emit events
  12049. */
  12050. methodsToPatch.forEach(function (method) {
  12051. // cache original method
  12052. var original = arrayProto[method];
  12053. def(arrayMethods, method, function mutator () {
  12054. var args = [], len = arguments.length;
  12055. while ( len-- ) args[ len ] = arguments[ len ];
  12056. var result = original.apply(this, args);
  12057. var ob = this.__ob__;
  12058. var inserted;
  12059. switch (method) {
  12060. case 'push':
  12061. case 'unshift':
  12062. inserted = args;
  12063. break
  12064. case 'splice':
  12065. inserted = args.slice(2);
  12066. break
  12067. }
  12068. if (inserted) { ob.observeArray(inserted); }
  12069. // notify change
  12070. ob.dep.notify();
  12071. return result
  12072. });
  12073. });
  12074. /* */
  12075. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  12076. /**
  12077. * In some cases we may want to disable observation inside a component's
  12078. * update computation.
  12079. */
  12080. var shouldObserve = true;
  12081. function toggleObserving (value) {
  12082. shouldObserve = value;
  12083. }
  12084. /**
  12085. * Observer class that is attached to each observed
  12086. * object. Once attached, the observer converts the target
  12087. * object's property keys into getter/setters that
  12088. * collect dependencies and dispatch updates.
  12089. */
  12090. var Observer = function Observer (value) {
  12091. this.value = value;
  12092. this.dep = new Dep();
  12093. this.vmCount = 0;
  12094. def(value, '__ob__', this);
  12095. if (Array.isArray(value)) {
  12096. if (hasProto) {
  12097. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  12098. if(value.push !== value.__proto__.push){
  12099. copyAugment(value, arrayMethods, arrayKeys);
  12100. } else {
  12101. protoAugment(value, arrayMethods);
  12102. }
  12103. }
  12104. } else {
  12105. copyAugment(value, arrayMethods, arrayKeys);
  12106. }
  12107. this.observeArray(value);
  12108. } else {
  12109. this.walk(value);
  12110. }
  12111. };
  12112. /**
  12113. * Walk through all properties and convert them into
  12114. * getter/setters. This method should only be called when
  12115. * value type is Object.
  12116. */
  12117. Observer.prototype.walk = function walk (obj) {
  12118. var keys = Object.keys(obj);
  12119. for (var i = 0; i < keys.length; i++) {
  12120. defineReactive$$1(obj, keys[i]);
  12121. }
  12122. };
  12123. /**
  12124. * Observe a list of Array items.
  12125. */
  12126. Observer.prototype.observeArray = function observeArray (items) {
  12127. for (var i = 0, l = items.length; i < l; i++) {
  12128. observe(items[i]);
  12129. }
  12130. };
  12131. // helpers
  12132. /**
  12133. * Augment a target Object or Array by intercepting
  12134. * the prototype chain using __proto__
  12135. */
  12136. function protoAugment (target, src) {
  12137. /* eslint-disable no-proto */
  12138. target.__proto__ = src;
  12139. /* eslint-enable no-proto */
  12140. }
  12141. /**
  12142. * Augment a target Object or Array by defining
  12143. * hidden properties.
  12144. */
  12145. /* istanbul ignore next */
  12146. function copyAugment (target, src, keys) {
  12147. for (var i = 0, l = keys.length; i < l; i++) {
  12148. var key = keys[i];
  12149. def(target, key, src[key]);
  12150. }
  12151. }
  12152. /**
  12153. * Attempt to create an observer instance for a value,
  12154. * returns the new observer if successfully observed,
  12155. * or the existing observer if the value already has one.
  12156. */
  12157. function observe (value, asRootData) {
  12158. if (!isObject(value) || value instanceof VNode) {
  12159. return
  12160. }
  12161. var ob;
  12162. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  12163. ob = value.__ob__;
  12164. } else if (
  12165. shouldObserve &&
  12166. !isServerRendering() &&
  12167. (Array.isArray(value) || isPlainObject(value)) &&
  12168. Object.isExtensible(value) &&
  12169. !value._isVue
  12170. ) {
  12171. ob = new Observer(value);
  12172. }
  12173. if (asRootData && ob) {
  12174. ob.vmCount++;
  12175. }
  12176. return ob
  12177. }
  12178. /**
  12179. * Define a reactive property on an Object.
  12180. */
  12181. function defineReactive$$1 (
  12182. obj,
  12183. key,
  12184. val,
  12185. customSetter,
  12186. shallow
  12187. ) {
  12188. var dep = new Dep();
  12189. var property = Object.getOwnPropertyDescriptor(obj, key);
  12190. if (property && property.configurable === false) {
  12191. return
  12192. }
  12193. // cater for pre-defined getter/setters
  12194. var getter = property && property.get;
  12195. var setter = property && property.set;
  12196. if ((!getter || setter) && arguments.length === 2) {
  12197. val = obj[key];
  12198. }
  12199. var childOb = !shallow && observe(val);
  12200. Object.defineProperty(obj, key, {
  12201. enumerable: true,
  12202. configurable: true,
  12203. get: function reactiveGetter () {
  12204. var value = getter ? getter.call(obj) : val;
  12205. if (Dep.SharedObject.target) { // fixed by xxxxxx
  12206. dep.depend();
  12207. if (childOb) {
  12208. childOb.dep.depend();
  12209. if (Array.isArray(value)) {
  12210. dependArray(value);
  12211. }
  12212. }
  12213. }
  12214. return value
  12215. },
  12216. set: function reactiveSetter (newVal) {
  12217. var value = getter ? getter.call(obj) : val;
  12218. /* eslint-disable no-self-compare */
  12219. if (newVal === value || (newVal !== newVal && value !== value)) {
  12220. return
  12221. }
  12222. /* eslint-enable no-self-compare */
  12223. if ( true && customSetter) {
  12224. customSetter();
  12225. }
  12226. // #7981: for accessor properties without setter
  12227. if (getter && !setter) { return }
  12228. if (setter) {
  12229. setter.call(obj, newVal);
  12230. } else {
  12231. val = newVal;
  12232. }
  12233. childOb = !shallow && observe(newVal);
  12234. dep.notify();
  12235. }
  12236. });
  12237. }
  12238. /**
  12239. * Set a property on an object. Adds the new property and
  12240. * triggers change notification if the property doesn't
  12241. * already exist.
  12242. */
  12243. function set (target, key, val) {
  12244. if ( true &&
  12245. (isUndef(target) || isPrimitive(target))
  12246. ) {
  12247. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  12248. }
  12249. if (Array.isArray(target) && isValidArrayIndex(key)) {
  12250. target.length = Math.max(target.length, key);
  12251. target.splice(key, 1, val);
  12252. return val
  12253. }
  12254. if (key in target && !(key in Object.prototype)) {
  12255. target[key] = val;
  12256. return val
  12257. }
  12258. var ob = (target).__ob__;
  12259. if (target._isVue || (ob && ob.vmCount)) {
  12260. true && warn(
  12261. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  12262. 'at runtime - declare it upfront in the data option.'
  12263. );
  12264. return val
  12265. }
  12266. if (!ob) {
  12267. target[key] = val;
  12268. return val
  12269. }
  12270. defineReactive$$1(ob.value, key, val);
  12271. ob.dep.notify();
  12272. return val
  12273. }
  12274. /**
  12275. * Delete a property and trigger change if necessary.
  12276. */
  12277. function del (target, key) {
  12278. if ( true &&
  12279. (isUndef(target) || isPrimitive(target))
  12280. ) {
  12281. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  12282. }
  12283. if (Array.isArray(target) && isValidArrayIndex(key)) {
  12284. target.splice(key, 1);
  12285. return
  12286. }
  12287. var ob = (target).__ob__;
  12288. if (target._isVue || (ob && ob.vmCount)) {
  12289. true && warn(
  12290. 'Avoid deleting properties on a Vue instance or its root $data ' +
  12291. '- just set it to null.'
  12292. );
  12293. return
  12294. }
  12295. if (!hasOwn(target, key)) {
  12296. return
  12297. }
  12298. delete target[key];
  12299. if (!ob) {
  12300. return
  12301. }
  12302. ob.dep.notify();
  12303. }
  12304. /**
  12305. * Collect dependencies on array elements when the array is touched, since
  12306. * we cannot intercept array element access like property getters.
  12307. */
  12308. function dependArray (value) {
  12309. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  12310. e = value[i];
  12311. e && e.__ob__ && e.__ob__.dep.depend();
  12312. if (Array.isArray(e)) {
  12313. dependArray(e);
  12314. }
  12315. }
  12316. }
  12317. /* */
  12318. /**
  12319. * Option overwriting strategies are functions that handle
  12320. * how to merge a parent option value and a child option
  12321. * value into the final value.
  12322. */
  12323. var strats = config.optionMergeStrategies;
  12324. /**
  12325. * Options with restrictions
  12326. */
  12327. if (true) {
  12328. strats.el = strats.propsData = function (parent, child, vm, key) {
  12329. if (!vm) {
  12330. warn(
  12331. "option \"" + key + "\" can only be used during instance " +
  12332. 'creation with the `new` keyword.'
  12333. );
  12334. }
  12335. return defaultStrat(parent, child)
  12336. };
  12337. }
  12338. /**
  12339. * Helper that recursively merges two data objects together.
  12340. */
  12341. function mergeData (to, from) {
  12342. if (!from) { return to }
  12343. var key, toVal, fromVal;
  12344. var keys = hasSymbol
  12345. ? Reflect.ownKeys(from)
  12346. : Object.keys(from);
  12347. for (var i = 0; i < keys.length; i++) {
  12348. key = keys[i];
  12349. // in case the object is already observed...
  12350. if (key === '__ob__') { continue }
  12351. toVal = to[key];
  12352. fromVal = from[key];
  12353. if (!hasOwn(to, key)) {
  12354. set(to, key, fromVal);
  12355. } else if (
  12356. toVal !== fromVal &&
  12357. isPlainObject(toVal) &&
  12358. isPlainObject(fromVal)
  12359. ) {
  12360. mergeData(toVal, fromVal);
  12361. }
  12362. }
  12363. return to
  12364. }
  12365. /**
  12366. * Data
  12367. */
  12368. function mergeDataOrFn (
  12369. parentVal,
  12370. childVal,
  12371. vm
  12372. ) {
  12373. if (!vm) {
  12374. // in a Vue.extend merge, both should be functions
  12375. if (!childVal) {
  12376. return parentVal
  12377. }
  12378. if (!parentVal) {
  12379. return childVal
  12380. }
  12381. // when parentVal & childVal are both present,
  12382. // we need to return a function that returns the
  12383. // merged result of both functions... no need to
  12384. // check if parentVal is a function here because
  12385. // it has to be a function to pass previous merges.
  12386. return function mergedDataFn () {
  12387. return mergeData(
  12388. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  12389. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  12390. )
  12391. }
  12392. } else {
  12393. return function mergedInstanceDataFn () {
  12394. // instance merge
  12395. var instanceData = typeof childVal === 'function'
  12396. ? childVal.call(vm, vm)
  12397. : childVal;
  12398. var defaultData = typeof parentVal === 'function'
  12399. ? parentVal.call(vm, vm)
  12400. : parentVal;
  12401. if (instanceData) {
  12402. return mergeData(instanceData, defaultData)
  12403. } else {
  12404. return defaultData
  12405. }
  12406. }
  12407. }
  12408. }
  12409. strats.data = function (
  12410. parentVal,
  12411. childVal,
  12412. vm
  12413. ) {
  12414. if (!vm) {
  12415. if (childVal && typeof childVal !== 'function') {
  12416. true && warn(
  12417. 'The "data" option should be a function ' +
  12418. 'that returns a per-instance value in component ' +
  12419. 'definitions.',
  12420. vm
  12421. );
  12422. return parentVal
  12423. }
  12424. return mergeDataOrFn(parentVal, childVal)
  12425. }
  12426. return mergeDataOrFn(parentVal, childVal, vm)
  12427. };
  12428. /**
  12429. * Hooks and props are merged as arrays.
  12430. */
  12431. function mergeHook (
  12432. parentVal,
  12433. childVal
  12434. ) {
  12435. var res = childVal
  12436. ? parentVal
  12437. ? parentVal.concat(childVal)
  12438. : Array.isArray(childVal)
  12439. ? childVal
  12440. : [childVal]
  12441. : parentVal;
  12442. return res
  12443. ? dedupeHooks(res)
  12444. : res
  12445. }
  12446. function dedupeHooks (hooks) {
  12447. var res = [];
  12448. for (var i = 0; i < hooks.length; i++) {
  12449. if (res.indexOf(hooks[i]) === -1) {
  12450. res.push(hooks[i]);
  12451. }
  12452. }
  12453. return res
  12454. }
  12455. LIFECYCLE_HOOKS.forEach(function (hook) {
  12456. strats[hook] = mergeHook;
  12457. });
  12458. /**
  12459. * Assets
  12460. *
  12461. * When a vm is present (instance creation), we need to do
  12462. * a three-way merge between constructor options, instance
  12463. * options and parent options.
  12464. */
  12465. function mergeAssets (
  12466. parentVal,
  12467. childVal,
  12468. vm,
  12469. key
  12470. ) {
  12471. var res = Object.create(parentVal || null);
  12472. if (childVal) {
  12473. true && assertObjectType(key, childVal, vm);
  12474. return extend(res, childVal)
  12475. } else {
  12476. return res
  12477. }
  12478. }
  12479. ASSET_TYPES.forEach(function (type) {
  12480. strats[type + 's'] = mergeAssets;
  12481. });
  12482. /**
  12483. * Watchers.
  12484. *
  12485. * Watchers hashes should not overwrite one
  12486. * another, so we merge them as arrays.
  12487. */
  12488. strats.watch = function (
  12489. parentVal,
  12490. childVal,
  12491. vm,
  12492. key
  12493. ) {
  12494. // work around Firefox's Object.prototype.watch...
  12495. if (parentVal === nativeWatch) { parentVal = undefined; }
  12496. if (childVal === nativeWatch) { childVal = undefined; }
  12497. /* istanbul ignore if */
  12498. if (!childVal) { return Object.create(parentVal || null) }
  12499. if (true) {
  12500. assertObjectType(key, childVal, vm);
  12501. }
  12502. if (!parentVal) { return childVal }
  12503. var ret = {};
  12504. extend(ret, parentVal);
  12505. for (var key$1 in childVal) {
  12506. var parent = ret[key$1];
  12507. var child = childVal[key$1];
  12508. if (parent && !Array.isArray(parent)) {
  12509. parent = [parent];
  12510. }
  12511. ret[key$1] = parent
  12512. ? parent.concat(child)
  12513. : Array.isArray(child) ? child : [child];
  12514. }
  12515. return ret
  12516. };
  12517. /**
  12518. * Other object hashes.
  12519. */
  12520. strats.props =
  12521. strats.methods =
  12522. strats.inject =
  12523. strats.computed = function (
  12524. parentVal,
  12525. childVal,
  12526. vm,
  12527. key
  12528. ) {
  12529. if (childVal && "development" !== 'production') {
  12530. assertObjectType(key, childVal, vm);
  12531. }
  12532. if (!parentVal) { return childVal }
  12533. var ret = Object.create(null);
  12534. extend(ret, parentVal);
  12535. if (childVal) { extend(ret, childVal); }
  12536. return ret
  12537. };
  12538. strats.provide = mergeDataOrFn;
  12539. /**
  12540. * Default strategy.
  12541. */
  12542. var defaultStrat = function (parentVal, childVal) {
  12543. return childVal === undefined
  12544. ? parentVal
  12545. : childVal
  12546. };
  12547. /**
  12548. * Validate component names
  12549. */
  12550. function checkComponents (options) {
  12551. for (var key in options.components) {
  12552. validateComponentName(key);
  12553. }
  12554. }
  12555. function validateComponentName (name) {
  12556. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  12557. warn(
  12558. 'Invalid component name: "' + name + '". Component names ' +
  12559. 'should conform to valid custom element name in html5 specification.'
  12560. );
  12561. }
  12562. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  12563. warn(
  12564. 'Do not use built-in or reserved HTML elements as component ' +
  12565. 'id: ' + name
  12566. );
  12567. }
  12568. }
  12569. /**
  12570. * Ensure all props option syntax are normalized into the
  12571. * Object-based format.
  12572. */
  12573. function normalizeProps (options, vm) {
  12574. var props = options.props;
  12575. if (!props) { return }
  12576. var res = {};
  12577. var i, val, name;
  12578. if (Array.isArray(props)) {
  12579. i = props.length;
  12580. while (i--) {
  12581. val = props[i];
  12582. if (typeof val === 'string') {
  12583. name = camelize(val);
  12584. res[name] = { type: null };
  12585. } else if (true) {
  12586. warn('props must be strings when using array syntax.');
  12587. }
  12588. }
  12589. } else if (isPlainObject(props)) {
  12590. for (var key in props) {
  12591. val = props[key];
  12592. name = camelize(key);
  12593. res[name] = isPlainObject(val)
  12594. ? val
  12595. : { type: val };
  12596. }
  12597. } else if (true) {
  12598. warn(
  12599. "Invalid value for option \"props\": expected an Array or an Object, " +
  12600. "but got " + (toRawType(props)) + ".",
  12601. vm
  12602. );
  12603. }
  12604. options.props = res;
  12605. }
  12606. /**
  12607. * Normalize all injections into Object-based format
  12608. */
  12609. function normalizeInject (options, vm) {
  12610. var inject = options.inject;
  12611. if (!inject) { return }
  12612. var normalized = options.inject = {};
  12613. if (Array.isArray(inject)) {
  12614. for (var i = 0; i < inject.length; i++) {
  12615. normalized[inject[i]] = { from: inject[i] };
  12616. }
  12617. } else if (isPlainObject(inject)) {
  12618. for (var key in inject) {
  12619. var val = inject[key];
  12620. normalized[key] = isPlainObject(val)
  12621. ? extend({ from: key }, val)
  12622. : { from: val };
  12623. }
  12624. } else if (true) {
  12625. warn(
  12626. "Invalid value for option \"inject\": expected an Array or an Object, " +
  12627. "but got " + (toRawType(inject)) + ".",
  12628. vm
  12629. );
  12630. }
  12631. }
  12632. /**
  12633. * Normalize raw function directives into object format.
  12634. */
  12635. function normalizeDirectives (options) {
  12636. var dirs = options.directives;
  12637. if (dirs) {
  12638. for (var key in dirs) {
  12639. var def$$1 = dirs[key];
  12640. if (typeof def$$1 === 'function') {
  12641. dirs[key] = { bind: def$$1, update: def$$1 };
  12642. }
  12643. }
  12644. }
  12645. }
  12646. function assertObjectType (name, value, vm) {
  12647. if (!isPlainObject(value)) {
  12648. warn(
  12649. "Invalid value for option \"" + name + "\": expected an Object, " +
  12650. "but got " + (toRawType(value)) + ".",
  12651. vm
  12652. );
  12653. }
  12654. }
  12655. /**
  12656. * Merge two option objects into a new one.
  12657. * Core utility used in both instantiation and inheritance.
  12658. */
  12659. function mergeOptions (
  12660. parent,
  12661. child,
  12662. vm
  12663. ) {
  12664. if (true) {
  12665. checkComponents(child);
  12666. }
  12667. if (typeof child === 'function') {
  12668. child = child.options;
  12669. }
  12670. normalizeProps(child, vm);
  12671. normalizeInject(child, vm);
  12672. normalizeDirectives(child);
  12673. // Apply extends and mixins on the child options,
  12674. // but only if it is a raw options object that isn't
  12675. // the result of another mergeOptions call.
  12676. // Only merged options has the _base property.
  12677. if (!child._base) {
  12678. if (child.extends) {
  12679. parent = mergeOptions(parent, child.extends, vm);
  12680. }
  12681. if (child.mixins) {
  12682. for (var i = 0, l = child.mixins.length; i < l; i++) {
  12683. parent = mergeOptions(parent, child.mixins[i], vm);
  12684. }
  12685. }
  12686. }
  12687. var options = {};
  12688. var key;
  12689. for (key in parent) {
  12690. mergeField(key);
  12691. }
  12692. for (key in child) {
  12693. if (!hasOwn(parent, key)) {
  12694. mergeField(key);
  12695. }
  12696. }
  12697. function mergeField (key) {
  12698. var strat = strats[key] || defaultStrat;
  12699. options[key] = strat(parent[key], child[key], vm, key);
  12700. }
  12701. return options
  12702. }
  12703. /**
  12704. * Resolve an asset.
  12705. * This function is used because child instances need access
  12706. * to assets defined in its ancestor chain.
  12707. */
  12708. function resolveAsset (
  12709. options,
  12710. type,
  12711. id,
  12712. warnMissing
  12713. ) {
  12714. /* istanbul ignore if */
  12715. if (typeof id !== 'string') {
  12716. return
  12717. }
  12718. var assets = options[type];
  12719. // check local registration variations first
  12720. if (hasOwn(assets, id)) { return assets[id] }
  12721. var camelizedId = camelize(id);
  12722. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  12723. var PascalCaseId = capitalize(camelizedId);
  12724. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  12725. // fallback to prototype chain
  12726. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  12727. if ( true && warnMissing && !res) {
  12728. warn(
  12729. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  12730. options
  12731. );
  12732. }
  12733. return res
  12734. }
  12735. /* */
  12736. function validateProp (
  12737. key,
  12738. propOptions,
  12739. propsData,
  12740. vm
  12741. ) {
  12742. var prop = propOptions[key];
  12743. var absent = !hasOwn(propsData, key);
  12744. var value = propsData[key];
  12745. // boolean casting
  12746. var booleanIndex = getTypeIndex(Boolean, prop.type);
  12747. if (booleanIndex > -1) {
  12748. if (absent && !hasOwn(prop, 'default')) {
  12749. value = false;
  12750. } else if (value === '' || value === hyphenate(key)) {
  12751. // only cast empty string / same name to boolean if
  12752. // boolean has higher priority
  12753. var stringIndex = getTypeIndex(String, prop.type);
  12754. if (stringIndex < 0 || booleanIndex < stringIndex) {
  12755. value = true;
  12756. }
  12757. }
  12758. }
  12759. // check default value
  12760. if (value === undefined) {
  12761. value = getPropDefaultValue(vm, prop, key);
  12762. // since the default value is a fresh copy,
  12763. // make sure to observe it.
  12764. var prevShouldObserve = shouldObserve;
  12765. toggleObserving(true);
  12766. observe(value);
  12767. toggleObserving(prevShouldObserve);
  12768. }
  12769. if (
  12770. true
  12771. ) {
  12772. assertProp(prop, key, value, vm, absent);
  12773. }
  12774. return value
  12775. }
  12776. /**
  12777. * Get the default value of a prop.
  12778. */
  12779. function getPropDefaultValue (vm, prop, key) {
  12780. // no default, return undefined
  12781. if (!hasOwn(prop, 'default')) {
  12782. return undefined
  12783. }
  12784. var def = prop.default;
  12785. // warn against non-factory defaults for Object & Array
  12786. if ( true && isObject(def)) {
  12787. warn(
  12788. 'Invalid default value for prop "' + key + '": ' +
  12789. 'Props with type Object/Array must use a factory function ' +
  12790. 'to return the default value.',
  12791. vm
  12792. );
  12793. }
  12794. // the raw prop value was also undefined from previous render,
  12795. // return previous default value to avoid unnecessary watcher trigger
  12796. if (vm && vm.$options.propsData &&
  12797. vm.$options.propsData[key] === undefined &&
  12798. vm._props[key] !== undefined
  12799. ) {
  12800. return vm._props[key]
  12801. }
  12802. // call factory function for non-Function types
  12803. // a value is Function if its prototype is function even across different execution context
  12804. return typeof def === 'function' && getType(prop.type) !== 'Function'
  12805. ? def.call(vm)
  12806. : def
  12807. }
  12808. /**
  12809. * Assert whether a prop is valid.
  12810. */
  12811. function assertProp (
  12812. prop,
  12813. name,
  12814. value,
  12815. vm,
  12816. absent
  12817. ) {
  12818. if (prop.required && absent) {
  12819. warn(
  12820. 'Missing required prop: "' + name + '"',
  12821. vm
  12822. );
  12823. return
  12824. }
  12825. if (value == null && !prop.required) {
  12826. return
  12827. }
  12828. var type = prop.type;
  12829. var valid = !type || type === true;
  12830. var expectedTypes = [];
  12831. if (type) {
  12832. if (!Array.isArray(type)) {
  12833. type = [type];
  12834. }
  12835. for (var i = 0; i < type.length && !valid; i++) {
  12836. var assertedType = assertType(value, type[i]);
  12837. expectedTypes.push(assertedType.expectedType || '');
  12838. valid = assertedType.valid;
  12839. }
  12840. }
  12841. if (!valid) {
  12842. warn(
  12843. getInvalidTypeMessage(name, value, expectedTypes),
  12844. vm
  12845. );
  12846. return
  12847. }
  12848. var validator = prop.validator;
  12849. if (validator) {
  12850. if (!validator(value)) {
  12851. warn(
  12852. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  12853. vm
  12854. );
  12855. }
  12856. }
  12857. }
  12858. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  12859. function assertType (value, type) {
  12860. var valid;
  12861. var expectedType = getType(type);
  12862. if (simpleCheckRE.test(expectedType)) {
  12863. var t = typeof value;
  12864. valid = t === expectedType.toLowerCase();
  12865. // for primitive wrapper objects
  12866. if (!valid && t === 'object') {
  12867. valid = value instanceof type;
  12868. }
  12869. } else if (expectedType === 'Object') {
  12870. valid = isPlainObject(value);
  12871. } else if (expectedType === 'Array') {
  12872. valid = Array.isArray(value);
  12873. } else {
  12874. valid = value instanceof type;
  12875. }
  12876. return {
  12877. valid: valid,
  12878. expectedType: expectedType
  12879. }
  12880. }
  12881. /**
  12882. * Use function string name to check built-in types,
  12883. * because a simple equality check will fail when running
  12884. * across different vms / iframes.
  12885. */
  12886. function getType (fn) {
  12887. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  12888. return match ? match[1] : ''
  12889. }
  12890. function isSameType (a, b) {
  12891. return getType(a) === getType(b)
  12892. }
  12893. function getTypeIndex (type, expectedTypes) {
  12894. if (!Array.isArray(expectedTypes)) {
  12895. return isSameType(expectedTypes, type) ? 0 : -1
  12896. }
  12897. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  12898. if (isSameType(expectedTypes[i], type)) {
  12899. return i
  12900. }
  12901. }
  12902. return -1
  12903. }
  12904. function getInvalidTypeMessage (name, value, expectedTypes) {
  12905. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  12906. " Expected " + (expectedTypes.map(capitalize).join(', '));
  12907. var expectedType = expectedTypes[0];
  12908. var receivedType = toRawType(value);
  12909. var expectedValue = styleValue(value, expectedType);
  12910. var receivedValue = styleValue(value, receivedType);
  12911. // check if we need to specify expected value
  12912. if (expectedTypes.length === 1 &&
  12913. isExplicable(expectedType) &&
  12914. !isBoolean(expectedType, receivedType)) {
  12915. message += " with value " + expectedValue;
  12916. }
  12917. message += ", got " + receivedType + " ";
  12918. // check if we need to specify received value
  12919. if (isExplicable(receivedType)) {
  12920. message += "with value " + receivedValue + ".";
  12921. }
  12922. return message
  12923. }
  12924. function styleValue (value, type) {
  12925. if (type === 'String') {
  12926. return ("\"" + value + "\"")
  12927. } else if (type === 'Number') {
  12928. return ("" + (Number(value)))
  12929. } else {
  12930. return ("" + value)
  12931. }
  12932. }
  12933. function isExplicable (value) {
  12934. var explicitTypes = ['string', 'number', 'boolean'];
  12935. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  12936. }
  12937. function isBoolean () {
  12938. var args = [], len = arguments.length;
  12939. while ( len-- ) args[ len ] = arguments[ len ];
  12940. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  12941. }
  12942. /* */
  12943. function handleError (err, vm, info) {
  12944. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  12945. // See: https://github.com/vuejs/vuex/issues/1505
  12946. pushTarget();
  12947. try {
  12948. if (vm) {
  12949. var cur = vm;
  12950. while ((cur = cur.$parent)) {
  12951. var hooks = cur.$options.errorCaptured;
  12952. if (hooks) {
  12953. for (var i = 0; i < hooks.length; i++) {
  12954. try {
  12955. var capture = hooks[i].call(cur, err, vm, info) === false;
  12956. if (capture) { return }
  12957. } catch (e) {
  12958. globalHandleError(e, cur, 'errorCaptured hook');
  12959. }
  12960. }
  12961. }
  12962. }
  12963. }
  12964. globalHandleError(err, vm, info);
  12965. } finally {
  12966. popTarget();
  12967. }
  12968. }
  12969. function invokeWithErrorHandling (
  12970. handler,
  12971. context,
  12972. args,
  12973. vm,
  12974. info
  12975. ) {
  12976. var res;
  12977. try {
  12978. res = args ? handler.apply(context, args) : handler.call(context);
  12979. if (res && !res._isVue && isPromise(res) && !res._handled) {
  12980. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  12981. // issue #9511
  12982. // avoid catch triggering multiple times when nested calls
  12983. res._handled = true;
  12984. }
  12985. } catch (e) {
  12986. handleError(e, vm, info);
  12987. }
  12988. return res
  12989. }
  12990. function globalHandleError (err, vm, info) {
  12991. if (config.errorHandler) {
  12992. try {
  12993. return config.errorHandler.call(null, err, vm, info)
  12994. } catch (e) {
  12995. // if the user intentionally throws the original error in the handler,
  12996. // do not log it twice
  12997. if (e !== err) {
  12998. logError(e, null, 'config.errorHandler');
  12999. }
  13000. }
  13001. }
  13002. logError(err, vm, info);
  13003. }
  13004. function logError (err, vm, info) {
  13005. if (true) {
  13006. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  13007. }
  13008. /* istanbul ignore else */
  13009. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  13010. console.error(err);
  13011. } else {
  13012. throw err
  13013. }
  13014. }
  13015. /* */
  13016. var callbacks = [];
  13017. var pending = false;
  13018. function flushCallbacks () {
  13019. pending = false;
  13020. var copies = callbacks.slice(0);
  13021. callbacks.length = 0;
  13022. for (var i = 0; i < copies.length; i++) {
  13023. copies[i]();
  13024. }
  13025. }
  13026. // Here we have async deferring wrappers using microtasks.
  13027. // In 2.5 we used (macro) tasks (in combination with microtasks).
  13028. // However, it has subtle problems when state is changed right before repaint
  13029. // (e.g. #6813, out-in transitions).
  13030. // Also, using (macro) tasks in event handler would cause some weird behaviors
  13031. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  13032. // So we now use microtasks everywhere, again.
  13033. // A major drawback of this tradeoff is that there are some scenarios
  13034. // where microtasks have too high a priority and fire in between supposedly
  13035. // sequential events (e.g. #4521, #6690, which have workarounds)
  13036. // or even between bubbling of the same event (#6566).
  13037. var timerFunc;
  13038. // The nextTick behavior leverages the microtask queue, which can be accessed
  13039. // via either native Promise.then or MutationObserver.
  13040. // MutationObserver has wider support, however it is seriously bugged in
  13041. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  13042. // completely stops working after triggering a few times... so, if native
  13043. // Promise is available, we will use it:
  13044. /* istanbul ignore next, $flow-disable-line */
  13045. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  13046. var p = Promise.resolve();
  13047. timerFunc = function () {
  13048. p.then(flushCallbacks);
  13049. // In problematic UIWebViews, Promise.then doesn't completely break, but
  13050. // it can get stuck in a weird state where callbacks are pushed into the
  13051. // microtask queue but the queue isn't being flushed, until the browser
  13052. // needs to do some other work, e.g. handle a timer. Therefore we can
  13053. // "force" the microtask queue to be flushed by adding an empty timer.
  13054. if (isIOS) { setTimeout(noop); }
  13055. };
  13056. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  13057. isNative(MutationObserver) ||
  13058. // PhantomJS and iOS 7.x
  13059. MutationObserver.toString() === '[object MutationObserverConstructor]'
  13060. )) {
  13061. // Use MutationObserver where native Promise is not available,
  13062. // e.g. PhantomJS, iOS7, Android 4.4
  13063. // (#6466 MutationObserver is unreliable in IE11)
  13064. var counter = 1;
  13065. var observer = new MutationObserver(flushCallbacks);
  13066. var textNode = document.createTextNode(String(counter));
  13067. observer.observe(textNode, {
  13068. characterData: true
  13069. });
  13070. timerFunc = function () {
  13071. counter = (counter + 1) % 2;
  13072. textNode.data = String(counter);
  13073. };
  13074. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  13075. // Fallback to setImmediate.
  13076. // Technically it leverages the (macro) task queue,
  13077. // but it is still a better choice than setTimeout.
  13078. timerFunc = function () {
  13079. setImmediate(flushCallbacks);
  13080. };
  13081. } else {
  13082. // Fallback to setTimeout.
  13083. timerFunc = function () {
  13084. setTimeout(flushCallbacks, 0);
  13085. };
  13086. }
  13087. function nextTick (cb, ctx) {
  13088. var _resolve;
  13089. callbacks.push(function () {
  13090. if (cb) {
  13091. try {
  13092. cb.call(ctx);
  13093. } catch (e) {
  13094. handleError(e, ctx, 'nextTick');
  13095. }
  13096. } else if (_resolve) {
  13097. _resolve(ctx);
  13098. }
  13099. });
  13100. if (!pending) {
  13101. pending = true;
  13102. timerFunc();
  13103. }
  13104. // $flow-disable-line
  13105. if (!cb && typeof Promise !== 'undefined') {
  13106. return new Promise(function (resolve) {
  13107. _resolve = resolve;
  13108. })
  13109. }
  13110. }
  13111. /* */
  13112. /* not type checking this file because flow doesn't play well with Proxy */
  13113. var initProxy;
  13114. if (true) {
  13115. var allowedGlobals = makeMap(
  13116. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  13117. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  13118. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  13119. 'require' // for Webpack/Browserify
  13120. );
  13121. var warnNonPresent = function (target, key) {
  13122. warn(
  13123. "Property or method \"" + key + "\" is not defined on the instance but " +
  13124. 'referenced during render. Make sure that this property is reactive, ' +
  13125. 'either in the data option, or for class-based components, by ' +
  13126. 'initializing the property. ' +
  13127. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  13128. target
  13129. );
  13130. };
  13131. var warnReservedPrefix = function (target, key) {
  13132. warn(
  13133. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  13134. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  13135. 'prevent conflicts with Vue internals. ' +
  13136. 'See: https://vuejs.org/v2/api/#data',
  13137. target
  13138. );
  13139. };
  13140. var hasProxy =
  13141. typeof Proxy !== 'undefined' && isNative(Proxy);
  13142. if (hasProxy) {
  13143. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  13144. config.keyCodes = new Proxy(config.keyCodes, {
  13145. set: function set (target, key, value) {
  13146. if (isBuiltInModifier(key)) {
  13147. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  13148. return false
  13149. } else {
  13150. target[key] = value;
  13151. return true
  13152. }
  13153. }
  13154. });
  13155. }
  13156. var hasHandler = {
  13157. has: function has (target, key) {
  13158. var has = key in target;
  13159. var isAllowed = allowedGlobals(key) ||
  13160. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  13161. if (!has && !isAllowed) {
  13162. if (key in target.$data) { warnReservedPrefix(target, key); }
  13163. else { warnNonPresent(target, key); }
  13164. }
  13165. return has || !isAllowed
  13166. }
  13167. };
  13168. var getHandler = {
  13169. get: function get (target, key) {
  13170. if (typeof key === 'string' && !(key in target)) {
  13171. if (key in target.$data) { warnReservedPrefix(target, key); }
  13172. else { warnNonPresent(target, key); }
  13173. }
  13174. return target[key]
  13175. }
  13176. };
  13177. initProxy = function initProxy (vm) {
  13178. if (hasProxy) {
  13179. // determine which proxy handler to use
  13180. var options = vm.$options;
  13181. var handlers = options.render && options.render._withStripped
  13182. ? getHandler
  13183. : hasHandler;
  13184. vm._renderProxy = new Proxy(vm, handlers);
  13185. } else {
  13186. vm._renderProxy = vm;
  13187. }
  13188. };
  13189. }
  13190. /* */
  13191. var seenObjects = new _Set();
  13192. /**
  13193. * Recursively traverse an object to evoke all converted
  13194. * getters, so that every nested property inside the object
  13195. * is collected as a "deep" dependency.
  13196. */
  13197. function traverse (val) {
  13198. _traverse(val, seenObjects);
  13199. seenObjects.clear();
  13200. }
  13201. function _traverse (val, seen) {
  13202. var i, keys;
  13203. var isA = Array.isArray(val);
  13204. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  13205. return
  13206. }
  13207. if (val.__ob__) {
  13208. var depId = val.__ob__.dep.id;
  13209. if (seen.has(depId)) {
  13210. return
  13211. }
  13212. seen.add(depId);
  13213. }
  13214. if (isA) {
  13215. i = val.length;
  13216. while (i--) { _traverse(val[i], seen); }
  13217. } else {
  13218. keys = Object.keys(val);
  13219. i = keys.length;
  13220. while (i--) { _traverse(val[keys[i]], seen); }
  13221. }
  13222. }
  13223. var mark;
  13224. var measure;
  13225. if (true) {
  13226. var perf = inBrowser && window.performance;
  13227. /* istanbul ignore if */
  13228. if (
  13229. perf &&
  13230. perf.mark &&
  13231. perf.measure &&
  13232. perf.clearMarks &&
  13233. perf.clearMeasures
  13234. ) {
  13235. mark = function (tag) { return perf.mark(tag); };
  13236. measure = function (name, startTag, endTag) {
  13237. perf.measure(name, startTag, endTag);
  13238. perf.clearMarks(startTag);
  13239. perf.clearMarks(endTag);
  13240. // perf.clearMeasures(name)
  13241. };
  13242. }
  13243. }
  13244. /* */
  13245. var normalizeEvent = cached(function (name) {
  13246. var passive = name.charAt(0) === '&';
  13247. name = passive ? name.slice(1) : name;
  13248. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  13249. name = once$$1 ? name.slice(1) : name;
  13250. var capture = name.charAt(0) === '!';
  13251. name = capture ? name.slice(1) : name;
  13252. return {
  13253. name: name,
  13254. once: once$$1,
  13255. capture: capture,
  13256. passive: passive
  13257. }
  13258. });
  13259. function createFnInvoker (fns, vm) {
  13260. function invoker () {
  13261. var arguments$1 = arguments;
  13262. var fns = invoker.fns;
  13263. if (Array.isArray(fns)) {
  13264. var cloned = fns.slice();
  13265. for (var i = 0; i < cloned.length; i++) {
  13266. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  13267. }
  13268. } else {
  13269. // return handler return value for single handlers
  13270. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  13271. }
  13272. }
  13273. invoker.fns = fns;
  13274. return invoker
  13275. }
  13276. function updateListeners (
  13277. on,
  13278. oldOn,
  13279. add,
  13280. remove$$1,
  13281. createOnceHandler,
  13282. vm
  13283. ) {
  13284. var name, def$$1, cur, old, event;
  13285. for (name in on) {
  13286. def$$1 = cur = on[name];
  13287. old = oldOn[name];
  13288. event = normalizeEvent(name);
  13289. if (isUndef(cur)) {
  13290. true && warn(
  13291. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  13292. vm
  13293. );
  13294. } else if (isUndef(old)) {
  13295. if (isUndef(cur.fns)) {
  13296. cur = on[name] = createFnInvoker(cur, vm);
  13297. }
  13298. if (isTrue(event.once)) {
  13299. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  13300. }
  13301. add(event.name, cur, event.capture, event.passive, event.params);
  13302. } else if (cur !== old) {
  13303. old.fns = cur;
  13304. on[name] = old;
  13305. }
  13306. }
  13307. for (name in oldOn) {
  13308. if (isUndef(on[name])) {
  13309. event = normalizeEvent(name);
  13310. remove$$1(event.name, oldOn[name], event.capture);
  13311. }
  13312. }
  13313. }
  13314. /* */
  13315. /* */
  13316. // fixed by xxxxxx (mp properties)
  13317. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  13318. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  13319. if (isUndef(propOptions)) {
  13320. return res
  13321. }
  13322. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  13323. var attrs = data.attrs;
  13324. var props = data.props;
  13325. if (isDef(attrs) || isDef(props)) {
  13326. for (var key in propOptions) {
  13327. var altKey = hyphenate(key);
  13328. var result = checkProp(res, props, key, altKey, true) ||
  13329. checkProp(res, attrs, key, altKey, false);
  13330. // externalClass
  13331. if (
  13332. result &&
  13333. res[key] &&
  13334. externalClasses.indexOf(altKey) !== -1 &&
  13335. context[camelize(res[key])]
  13336. ) {
  13337. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  13338. res[key] = context[camelize(res[key])];
  13339. }
  13340. }
  13341. }
  13342. return res
  13343. }
  13344. function extractPropsFromVNodeData (
  13345. data,
  13346. Ctor,
  13347. tag,
  13348. context// fixed by xxxxxx
  13349. ) {
  13350. // we are only extracting raw values here.
  13351. // validation and default values are handled in the child
  13352. // component itself.
  13353. var propOptions = Ctor.options.props;
  13354. if (isUndef(propOptions)) {
  13355. // fixed by xxxxxx
  13356. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  13357. }
  13358. var res = {};
  13359. var attrs = data.attrs;
  13360. var props = data.props;
  13361. if (isDef(attrs) || isDef(props)) {
  13362. for (var key in propOptions) {
  13363. var altKey = hyphenate(key);
  13364. if (true) {
  13365. var keyInLowerCase = key.toLowerCase();
  13366. if (
  13367. key !== keyInLowerCase &&
  13368. attrs && hasOwn(attrs, keyInLowerCase)
  13369. ) {
  13370. tip(
  13371. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  13372. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  13373. " \"" + key + "\". " +
  13374. "Note that HTML attributes are case-insensitive and camelCased " +
  13375. "props need to use their kebab-case equivalents when using in-DOM " +
  13376. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  13377. );
  13378. }
  13379. }
  13380. checkProp(res, props, key, altKey, true) ||
  13381. checkProp(res, attrs, key, altKey, false);
  13382. }
  13383. }
  13384. // fixed by xxxxxx
  13385. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  13386. }
  13387. function checkProp (
  13388. res,
  13389. hash,
  13390. key,
  13391. altKey,
  13392. preserve
  13393. ) {
  13394. if (isDef(hash)) {
  13395. if (hasOwn(hash, key)) {
  13396. res[key] = hash[key];
  13397. if (!preserve) {
  13398. delete hash[key];
  13399. }
  13400. return true
  13401. } else if (hasOwn(hash, altKey)) {
  13402. res[key] = hash[altKey];
  13403. if (!preserve) {
  13404. delete hash[altKey];
  13405. }
  13406. return true
  13407. }
  13408. }
  13409. return false
  13410. }
  13411. /* */
  13412. // The template compiler attempts to minimize the need for normalization by
  13413. // statically analyzing the template at compile time.
  13414. //
  13415. // For plain HTML markup, normalization can be completely skipped because the
  13416. // generated render function is guaranteed to return Array<VNode>. There are
  13417. // two cases where extra normalization is needed:
  13418. // 1. When the children contains components - because a functional component
  13419. // may return an Array instead of a single root. In this case, just a simple
  13420. // normalization is needed - if any child is an Array, we flatten the whole
  13421. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  13422. // because functional components already normalize their own children.
  13423. function simpleNormalizeChildren (children) {
  13424. for (var i = 0; i < children.length; i++) {
  13425. if (Array.isArray(children[i])) {
  13426. return Array.prototype.concat.apply([], children)
  13427. }
  13428. }
  13429. return children
  13430. }
  13431. // 2. When the children contains constructs that always generated nested Arrays,
  13432. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  13433. // with hand-written render functions / JSX. In such cases a full normalization
  13434. // is needed to cater to all possible types of children values.
  13435. function normalizeChildren (children) {
  13436. return isPrimitive(children)
  13437. ? [createTextVNode(children)]
  13438. : Array.isArray(children)
  13439. ? normalizeArrayChildren(children)
  13440. : undefined
  13441. }
  13442. function isTextNode (node) {
  13443. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  13444. }
  13445. function normalizeArrayChildren (children, nestedIndex) {
  13446. var res = [];
  13447. var i, c, lastIndex, last;
  13448. for (i = 0; i < children.length; i++) {
  13449. c = children[i];
  13450. if (isUndef(c) || typeof c === 'boolean') { continue }
  13451. lastIndex = res.length - 1;
  13452. last = res[lastIndex];
  13453. // nested
  13454. if (Array.isArray(c)) {
  13455. if (c.length > 0) {
  13456. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  13457. // merge adjacent text nodes
  13458. if (isTextNode(c[0]) && isTextNode(last)) {
  13459. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  13460. c.shift();
  13461. }
  13462. res.push.apply(res, c);
  13463. }
  13464. } else if (isPrimitive(c)) {
  13465. if (isTextNode(last)) {
  13466. // merge adjacent text nodes
  13467. // this is necessary for SSR hydration because text nodes are
  13468. // essentially merged when rendered to HTML strings
  13469. res[lastIndex] = createTextVNode(last.text + c);
  13470. } else if (c !== '') {
  13471. // convert primitive to vnode
  13472. res.push(createTextVNode(c));
  13473. }
  13474. } else {
  13475. if (isTextNode(c) && isTextNode(last)) {
  13476. // merge adjacent text nodes
  13477. res[lastIndex] = createTextVNode(last.text + c.text);
  13478. } else {
  13479. // default key for nested array children (likely generated by v-for)
  13480. if (isTrue(children._isVList) &&
  13481. isDef(c.tag) &&
  13482. isUndef(c.key) &&
  13483. isDef(nestedIndex)) {
  13484. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  13485. }
  13486. res.push(c);
  13487. }
  13488. }
  13489. }
  13490. return res
  13491. }
  13492. /* */
  13493. function initProvide (vm) {
  13494. var provide = vm.$options.provide;
  13495. if (provide) {
  13496. vm._provided = typeof provide === 'function'
  13497. ? provide.call(vm)
  13498. : provide;
  13499. }
  13500. }
  13501. function initInjections (vm) {
  13502. var result = resolveInject(vm.$options.inject, vm);
  13503. if (result) {
  13504. toggleObserving(false);
  13505. Object.keys(result).forEach(function (key) {
  13506. /* istanbul ignore else */
  13507. if (true) {
  13508. defineReactive$$1(vm, key, result[key], function () {
  13509. warn(
  13510. "Avoid mutating an injected value directly since the changes will be " +
  13511. "overwritten whenever the provided component re-renders. " +
  13512. "injection being mutated: \"" + key + "\"",
  13513. vm
  13514. );
  13515. });
  13516. } else {}
  13517. });
  13518. toggleObserving(true);
  13519. }
  13520. }
  13521. function resolveInject (inject, vm) {
  13522. if (inject) {
  13523. // inject is :any because flow is not smart enough to figure out cached
  13524. var result = Object.create(null);
  13525. var keys = hasSymbol
  13526. ? Reflect.ownKeys(inject)
  13527. : Object.keys(inject);
  13528. for (var i = 0; i < keys.length; i++) {
  13529. var key = keys[i];
  13530. // #6574 in case the inject object is observed...
  13531. if (key === '__ob__') { continue }
  13532. var provideKey = inject[key].from;
  13533. var source = vm;
  13534. while (source) {
  13535. if (source._provided && hasOwn(source._provided, provideKey)) {
  13536. result[key] = source._provided[provideKey];
  13537. break
  13538. }
  13539. source = source.$parent;
  13540. }
  13541. if (!source) {
  13542. if ('default' in inject[key]) {
  13543. var provideDefault = inject[key].default;
  13544. result[key] = typeof provideDefault === 'function'
  13545. ? provideDefault.call(vm)
  13546. : provideDefault;
  13547. } else if (true) {
  13548. warn(("Injection \"" + key + "\" not found"), vm);
  13549. }
  13550. }
  13551. }
  13552. return result
  13553. }
  13554. }
  13555. /* */
  13556. /**
  13557. * Runtime helper for resolving raw children VNodes into a slot object.
  13558. */
  13559. function resolveSlots (
  13560. children,
  13561. context
  13562. ) {
  13563. if (!children || !children.length) {
  13564. return {}
  13565. }
  13566. var slots = {};
  13567. for (var i = 0, l = children.length; i < l; i++) {
  13568. var child = children[i];
  13569. var data = child.data;
  13570. // remove slot attribute if the node is resolved as a Vue slot node
  13571. if (data && data.attrs && data.attrs.slot) {
  13572. delete data.attrs.slot;
  13573. }
  13574. // named slots should only be respected if the vnode was rendered in the
  13575. // same context.
  13576. if ((child.context === context || child.fnContext === context) &&
  13577. data && data.slot != null
  13578. ) {
  13579. var name = data.slot;
  13580. var slot = (slots[name] || (slots[name] = []));
  13581. if (child.tag === 'template') {
  13582. slot.push.apply(slot, child.children || []);
  13583. } else {
  13584. slot.push(child);
  13585. }
  13586. } else {
  13587. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  13588. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  13589. (slots['page'] || (slots['page'] = [])).push(child);
  13590. }else{
  13591. (slots.default || (slots.default = [])).push(child);
  13592. }
  13593. }
  13594. }
  13595. // ignore slots that contains only whitespace
  13596. for (var name$1 in slots) {
  13597. if (slots[name$1].every(isWhitespace)) {
  13598. delete slots[name$1];
  13599. }
  13600. }
  13601. return slots
  13602. }
  13603. function isWhitespace (node) {
  13604. return (node.isComment && !node.asyncFactory) || node.text === ' '
  13605. }
  13606. /* */
  13607. function normalizeScopedSlots (
  13608. slots,
  13609. normalSlots,
  13610. prevSlots
  13611. ) {
  13612. var res;
  13613. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  13614. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  13615. var key = slots && slots.$key;
  13616. if (!slots) {
  13617. res = {};
  13618. } else if (slots._normalized) {
  13619. // fast path 1: child component re-render only, parent did not change
  13620. return slots._normalized
  13621. } else if (
  13622. isStable &&
  13623. prevSlots &&
  13624. prevSlots !== emptyObject &&
  13625. key === prevSlots.$key &&
  13626. !hasNormalSlots &&
  13627. !prevSlots.$hasNormal
  13628. ) {
  13629. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  13630. // only need to normalize once
  13631. return prevSlots
  13632. } else {
  13633. res = {};
  13634. for (var key$1 in slots) {
  13635. if (slots[key$1] && key$1[0] !== '$') {
  13636. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  13637. }
  13638. }
  13639. }
  13640. // expose normal slots on scopedSlots
  13641. for (var key$2 in normalSlots) {
  13642. if (!(key$2 in res)) {
  13643. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  13644. }
  13645. }
  13646. // avoriaz seems to mock a non-extensible $scopedSlots object
  13647. // and when that is passed down this would cause an error
  13648. if (slots && Object.isExtensible(slots)) {
  13649. (slots)._normalized = res;
  13650. }
  13651. def(res, '$stable', isStable);
  13652. def(res, '$key', key);
  13653. def(res, '$hasNormal', hasNormalSlots);
  13654. return res
  13655. }
  13656. function normalizeScopedSlot(normalSlots, key, fn) {
  13657. var normalized = function () {
  13658. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  13659. res = res && typeof res === 'object' && !Array.isArray(res)
  13660. ? [res] // single vnode
  13661. : normalizeChildren(res);
  13662. return res && (
  13663. res.length === 0 ||
  13664. (res.length === 1 && res[0].isComment) // #9658
  13665. ) ? undefined
  13666. : res
  13667. };
  13668. // this is a slot using the new v-slot syntax without scope. although it is
  13669. // compiled as a scoped slot, render fn users would expect it to be present
  13670. // on this.$slots because the usage is semantically a normal slot.
  13671. if (fn.proxy) {
  13672. Object.defineProperty(normalSlots, key, {
  13673. get: normalized,
  13674. enumerable: true,
  13675. configurable: true
  13676. });
  13677. }
  13678. return normalized
  13679. }
  13680. function proxyNormalSlot(slots, key) {
  13681. return function () { return slots[key]; }
  13682. }
  13683. /* */
  13684. /**
  13685. * Runtime helper for rendering v-for lists.
  13686. */
  13687. function renderList (
  13688. val,
  13689. render
  13690. ) {
  13691. var ret, i, l, keys, key;
  13692. if (Array.isArray(val) || typeof val === 'string') {
  13693. ret = new Array(val.length);
  13694. for (i = 0, l = val.length; i < l; i++) {
  13695. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  13696. }
  13697. } else if (typeof val === 'number') {
  13698. ret = new Array(val);
  13699. for (i = 0; i < val; i++) {
  13700. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  13701. }
  13702. } else if (isObject(val)) {
  13703. if (hasSymbol && val[Symbol.iterator]) {
  13704. ret = [];
  13705. var iterator = val[Symbol.iterator]();
  13706. var result = iterator.next();
  13707. while (!result.done) {
  13708. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  13709. result = iterator.next();
  13710. }
  13711. } else {
  13712. keys = Object.keys(val);
  13713. ret = new Array(keys.length);
  13714. for (i = 0, l = keys.length; i < l; i++) {
  13715. key = keys[i];
  13716. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  13717. }
  13718. }
  13719. }
  13720. if (!isDef(ret)) {
  13721. ret = [];
  13722. }
  13723. (ret)._isVList = true;
  13724. return ret
  13725. }
  13726. /* */
  13727. /**
  13728. * Runtime helper for rendering <slot>
  13729. */
  13730. function renderSlot (
  13731. name,
  13732. fallback,
  13733. props,
  13734. bindObject
  13735. ) {
  13736. var scopedSlotFn = this.$scopedSlots[name];
  13737. var nodes;
  13738. if (scopedSlotFn) { // scoped slot
  13739. props = props || {};
  13740. if (bindObject) {
  13741. if ( true && !isObject(bindObject)) {
  13742. warn(
  13743. 'slot v-bind without argument expects an Object',
  13744. this
  13745. );
  13746. }
  13747. props = extend(extend({}, bindObject), props);
  13748. }
  13749. // fixed by xxxxxx app-plus scopedSlot
  13750. nodes = scopedSlotFn(props, this, props._i) || fallback;
  13751. } else {
  13752. nodes = this.$slots[name] || fallback;
  13753. }
  13754. var target = props && props.slot;
  13755. if (target) {
  13756. return this.$createElement('template', { slot: target }, nodes)
  13757. } else {
  13758. return nodes
  13759. }
  13760. }
  13761. /* */
  13762. /**
  13763. * Runtime helper for resolving filters
  13764. */
  13765. function resolveFilter (id) {
  13766. return resolveAsset(this.$options, 'filters', id, true) || identity
  13767. }
  13768. /* */
  13769. function isKeyNotMatch (expect, actual) {
  13770. if (Array.isArray(expect)) {
  13771. return expect.indexOf(actual) === -1
  13772. } else {
  13773. return expect !== actual
  13774. }
  13775. }
  13776. /**
  13777. * Runtime helper for checking keyCodes from config.
  13778. * exposed as Vue.prototype._k
  13779. * passing in eventKeyName as last argument separately for backwards compat
  13780. */
  13781. function checkKeyCodes (
  13782. eventKeyCode,
  13783. key,
  13784. builtInKeyCode,
  13785. eventKeyName,
  13786. builtInKeyName
  13787. ) {
  13788. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  13789. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  13790. return isKeyNotMatch(builtInKeyName, eventKeyName)
  13791. } else if (mappedKeyCode) {
  13792. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  13793. } else if (eventKeyName) {
  13794. return hyphenate(eventKeyName) !== key
  13795. }
  13796. }
  13797. /* */
  13798. /**
  13799. * Runtime helper for merging v-bind="object" into a VNode's data.
  13800. */
  13801. function bindObjectProps (
  13802. data,
  13803. tag,
  13804. value,
  13805. asProp,
  13806. isSync
  13807. ) {
  13808. if (value) {
  13809. if (!isObject(value)) {
  13810. true && warn(
  13811. 'v-bind without argument expects an Object or Array value',
  13812. this
  13813. );
  13814. } else {
  13815. if (Array.isArray(value)) {
  13816. value = toObject(value);
  13817. }
  13818. var hash;
  13819. var loop = function ( key ) {
  13820. if (
  13821. key === 'class' ||
  13822. key === 'style' ||
  13823. isReservedAttribute(key)
  13824. ) {
  13825. hash = data;
  13826. } else {
  13827. var type = data.attrs && data.attrs.type;
  13828. hash = asProp || config.mustUseProp(tag, type, key)
  13829. ? data.domProps || (data.domProps = {})
  13830. : data.attrs || (data.attrs = {});
  13831. }
  13832. var camelizedKey = camelize(key);
  13833. var hyphenatedKey = hyphenate(key);
  13834. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  13835. hash[key] = value[key];
  13836. if (isSync) {
  13837. var on = data.on || (data.on = {});
  13838. on[("update:" + key)] = function ($event) {
  13839. value[key] = $event;
  13840. };
  13841. }
  13842. }
  13843. };
  13844. for (var key in value) loop( key );
  13845. }
  13846. }
  13847. return data
  13848. }
  13849. /* */
  13850. /**
  13851. * Runtime helper for rendering static trees.
  13852. */
  13853. function renderStatic (
  13854. index,
  13855. isInFor
  13856. ) {
  13857. var cached = this._staticTrees || (this._staticTrees = []);
  13858. var tree = cached[index];
  13859. // if has already-rendered static tree and not inside v-for,
  13860. // we can reuse the same tree.
  13861. if (tree && !isInFor) {
  13862. return tree
  13863. }
  13864. // otherwise, render a fresh tree.
  13865. tree = cached[index] = this.$options.staticRenderFns[index].call(
  13866. this._renderProxy,
  13867. null,
  13868. this // for render fns generated for functional component templates
  13869. );
  13870. markStatic(tree, ("__static__" + index), false);
  13871. return tree
  13872. }
  13873. /**
  13874. * Runtime helper for v-once.
  13875. * Effectively it means marking the node as static with a unique key.
  13876. */
  13877. function markOnce (
  13878. tree,
  13879. index,
  13880. key
  13881. ) {
  13882. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  13883. return tree
  13884. }
  13885. function markStatic (
  13886. tree,
  13887. key,
  13888. isOnce
  13889. ) {
  13890. if (Array.isArray(tree)) {
  13891. for (var i = 0; i < tree.length; i++) {
  13892. if (tree[i] && typeof tree[i] !== 'string') {
  13893. markStaticNode(tree[i], (key + "_" + i), isOnce);
  13894. }
  13895. }
  13896. } else {
  13897. markStaticNode(tree, key, isOnce);
  13898. }
  13899. }
  13900. function markStaticNode (node, key, isOnce) {
  13901. node.isStatic = true;
  13902. node.key = key;
  13903. node.isOnce = isOnce;
  13904. }
  13905. /* */
  13906. function bindObjectListeners (data, value) {
  13907. if (value) {
  13908. if (!isPlainObject(value)) {
  13909. true && warn(
  13910. 'v-on without argument expects an Object value',
  13911. this
  13912. );
  13913. } else {
  13914. var on = data.on = data.on ? extend({}, data.on) : {};
  13915. for (var key in value) {
  13916. var existing = on[key];
  13917. var ours = value[key];
  13918. on[key] = existing ? [].concat(existing, ours) : ours;
  13919. }
  13920. }
  13921. }
  13922. return data
  13923. }
  13924. /* */
  13925. function resolveScopedSlots (
  13926. fns, // see flow/vnode
  13927. res,
  13928. // the following are added in 2.6
  13929. hasDynamicKeys,
  13930. contentHashKey
  13931. ) {
  13932. res = res || { $stable: !hasDynamicKeys };
  13933. for (var i = 0; i < fns.length; i++) {
  13934. var slot = fns[i];
  13935. if (Array.isArray(slot)) {
  13936. resolveScopedSlots(slot, res, hasDynamicKeys);
  13937. } else if (slot) {
  13938. // marker for reverse proxying v-slot without scope on this.$slots
  13939. if (slot.proxy) {
  13940. slot.fn.proxy = true;
  13941. }
  13942. res[slot.key] = slot.fn;
  13943. }
  13944. }
  13945. if (contentHashKey) {
  13946. (res).$key = contentHashKey;
  13947. }
  13948. return res
  13949. }
  13950. /* */
  13951. function bindDynamicKeys (baseObj, values) {
  13952. for (var i = 0; i < values.length; i += 2) {
  13953. var key = values[i];
  13954. if (typeof key === 'string' && key) {
  13955. baseObj[values[i]] = values[i + 1];
  13956. } else if ( true && key !== '' && key !== null) {
  13957. // null is a special value for explicitly removing a binding
  13958. warn(
  13959. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  13960. this
  13961. );
  13962. }
  13963. }
  13964. return baseObj
  13965. }
  13966. // helper to dynamically append modifier runtime markers to event names.
  13967. // ensure only append when value is already string, otherwise it will be cast
  13968. // to string and cause the type check to miss.
  13969. function prependModifier (value, symbol) {
  13970. return typeof value === 'string' ? symbol + value : value
  13971. }
  13972. /* */
  13973. function installRenderHelpers (target) {
  13974. target._o = markOnce;
  13975. target._n = toNumber;
  13976. target._s = toString;
  13977. target._l = renderList;
  13978. target._t = renderSlot;
  13979. target._q = looseEqual;
  13980. target._i = looseIndexOf;
  13981. target._m = renderStatic;
  13982. target._f = resolveFilter;
  13983. target._k = checkKeyCodes;
  13984. target._b = bindObjectProps;
  13985. target._v = createTextVNode;
  13986. target._e = createEmptyVNode;
  13987. target._u = resolveScopedSlots;
  13988. target._g = bindObjectListeners;
  13989. target._d = bindDynamicKeys;
  13990. target._p = prependModifier;
  13991. }
  13992. /* */
  13993. function FunctionalRenderContext (
  13994. data,
  13995. props,
  13996. children,
  13997. parent,
  13998. Ctor
  13999. ) {
  14000. var this$1 = this;
  14001. var options = Ctor.options;
  14002. // ensure the createElement function in functional components
  14003. // gets a unique context - this is necessary for correct named slot check
  14004. var contextVm;
  14005. if (hasOwn(parent, '_uid')) {
  14006. contextVm = Object.create(parent);
  14007. // $flow-disable-line
  14008. contextVm._original = parent;
  14009. } else {
  14010. // the context vm passed in is a functional context as well.
  14011. // in this case we want to make sure we are able to get a hold to the
  14012. // real context instance.
  14013. contextVm = parent;
  14014. // $flow-disable-line
  14015. parent = parent._original;
  14016. }
  14017. var isCompiled = isTrue(options._compiled);
  14018. var needNormalization = !isCompiled;
  14019. this.data = data;
  14020. this.props = props;
  14021. this.children = children;
  14022. this.parent = parent;
  14023. this.listeners = data.on || emptyObject;
  14024. this.injections = resolveInject(options.inject, parent);
  14025. this.slots = function () {
  14026. if (!this$1.$slots) {
  14027. normalizeScopedSlots(
  14028. data.scopedSlots,
  14029. this$1.$slots = resolveSlots(children, parent)
  14030. );
  14031. }
  14032. return this$1.$slots
  14033. };
  14034. Object.defineProperty(this, 'scopedSlots', ({
  14035. enumerable: true,
  14036. get: function get () {
  14037. return normalizeScopedSlots(data.scopedSlots, this.slots())
  14038. }
  14039. }));
  14040. // support for compiled functional template
  14041. if (isCompiled) {
  14042. // exposing $options for renderStatic()
  14043. this.$options = options;
  14044. // pre-resolve slots for renderSlot()
  14045. this.$slots = this.slots();
  14046. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  14047. }
  14048. if (options._scopeId) {
  14049. this._c = function (a, b, c, d) {
  14050. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  14051. if (vnode && !Array.isArray(vnode)) {
  14052. vnode.fnScopeId = options._scopeId;
  14053. vnode.fnContext = parent;
  14054. }
  14055. return vnode
  14056. };
  14057. } else {
  14058. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  14059. }
  14060. }
  14061. installRenderHelpers(FunctionalRenderContext.prototype);
  14062. function createFunctionalComponent (
  14063. Ctor,
  14064. propsData,
  14065. data,
  14066. contextVm,
  14067. children
  14068. ) {
  14069. var options = Ctor.options;
  14070. var props = {};
  14071. var propOptions = options.props;
  14072. if (isDef(propOptions)) {
  14073. for (var key in propOptions) {
  14074. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  14075. }
  14076. } else {
  14077. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  14078. if (isDef(data.props)) { mergeProps(props, data.props); }
  14079. }
  14080. var renderContext = new FunctionalRenderContext(
  14081. data,
  14082. props,
  14083. children,
  14084. contextVm,
  14085. Ctor
  14086. );
  14087. var vnode = options.render.call(null, renderContext._c, renderContext);
  14088. if (vnode instanceof VNode) {
  14089. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  14090. } else if (Array.isArray(vnode)) {
  14091. var vnodes = normalizeChildren(vnode) || [];
  14092. var res = new Array(vnodes.length);
  14093. for (var i = 0; i < vnodes.length; i++) {
  14094. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  14095. }
  14096. return res
  14097. }
  14098. }
  14099. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  14100. // #7817 clone node before setting fnContext, otherwise if the node is reused
  14101. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  14102. // that should not be matched to match.
  14103. var clone = cloneVNode(vnode);
  14104. clone.fnContext = contextVm;
  14105. clone.fnOptions = options;
  14106. if (true) {
  14107. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  14108. }
  14109. if (data.slot) {
  14110. (clone.data || (clone.data = {})).slot = data.slot;
  14111. }
  14112. return clone
  14113. }
  14114. function mergeProps (to, from) {
  14115. for (var key in from) {
  14116. to[camelize(key)] = from[key];
  14117. }
  14118. }
  14119. /* */
  14120. /* */
  14121. /* */
  14122. /* */
  14123. // inline hooks to be invoked on component VNodes during patch
  14124. var componentVNodeHooks = {
  14125. init: function init (vnode, hydrating) {
  14126. if (
  14127. vnode.componentInstance &&
  14128. !vnode.componentInstance._isDestroyed &&
  14129. vnode.data.keepAlive
  14130. ) {
  14131. // kept-alive components, treat as a patch
  14132. var mountedNode = vnode; // work around flow
  14133. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  14134. } else {
  14135. var child = vnode.componentInstance = createComponentInstanceForVnode(
  14136. vnode,
  14137. activeInstance
  14138. );
  14139. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  14140. }
  14141. },
  14142. prepatch: function prepatch (oldVnode, vnode) {
  14143. var options = vnode.componentOptions;
  14144. var child = vnode.componentInstance = oldVnode.componentInstance;
  14145. updateChildComponent(
  14146. child,
  14147. options.propsData, // updated props
  14148. options.listeners, // updated listeners
  14149. vnode, // new parent vnode
  14150. options.children // new children
  14151. );
  14152. },
  14153. insert: function insert (vnode) {
  14154. var context = vnode.context;
  14155. var componentInstance = vnode.componentInstance;
  14156. if (!componentInstance._isMounted) {
  14157. callHook(componentInstance, 'onServiceCreated');
  14158. callHook(componentInstance, 'onServiceAttached');
  14159. componentInstance._isMounted = true;
  14160. callHook(componentInstance, 'mounted');
  14161. }
  14162. if (vnode.data.keepAlive) {
  14163. if (context._isMounted) {
  14164. // vue-router#1212
  14165. // During updates, a kept-alive component's child components may
  14166. // change, so directly walking the tree here may call activated hooks
  14167. // on incorrect children. Instead we push them into a queue which will
  14168. // be processed after the whole patch process ended.
  14169. queueActivatedComponent(componentInstance);
  14170. } else {
  14171. activateChildComponent(componentInstance, true /* direct */);
  14172. }
  14173. }
  14174. },
  14175. destroy: function destroy (vnode) {
  14176. var componentInstance = vnode.componentInstance;
  14177. if (!componentInstance._isDestroyed) {
  14178. if (!vnode.data.keepAlive) {
  14179. componentInstance.$destroy();
  14180. } else {
  14181. deactivateChildComponent(componentInstance, true /* direct */);
  14182. }
  14183. }
  14184. }
  14185. };
  14186. var hooksToMerge = Object.keys(componentVNodeHooks);
  14187. function createComponent (
  14188. Ctor,
  14189. data,
  14190. context,
  14191. children,
  14192. tag
  14193. ) {
  14194. if (isUndef(Ctor)) {
  14195. return
  14196. }
  14197. var baseCtor = context.$options._base;
  14198. // plain options object: turn it into a constructor
  14199. if (isObject(Ctor)) {
  14200. Ctor = baseCtor.extend(Ctor);
  14201. }
  14202. // if at this stage it's not a constructor or an async component factory,
  14203. // reject.
  14204. if (typeof Ctor !== 'function') {
  14205. if (true) {
  14206. warn(("Invalid Component definition: " + (String(Ctor))), context);
  14207. }
  14208. return
  14209. }
  14210. // async component
  14211. var asyncFactory;
  14212. if (isUndef(Ctor.cid)) {
  14213. asyncFactory = Ctor;
  14214. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  14215. if (Ctor === undefined) {
  14216. // return a placeholder node for async component, which is rendered
  14217. // as a comment node but preserves all the raw information for the node.
  14218. // the information will be used for async server-rendering and hydration.
  14219. return createAsyncPlaceholder(
  14220. asyncFactory,
  14221. data,
  14222. context,
  14223. children,
  14224. tag
  14225. )
  14226. }
  14227. }
  14228. data = data || {};
  14229. // resolve constructor options in case global mixins are applied after
  14230. // component constructor creation
  14231. resolveConstructorOptions(Ctor);
  14232. // transform component v-model data into props & events
  14233. if (isDef(data.model)) {
  14234. transformModel(Ctor.options, data);
  14235. }
  14236. // extract props
  14237. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  14238. // functional component
  14239. if (isTrue(Ctor.options.functional)) {
  14240. return createFunctionalComponent(Ctor, propsData, data, context, children)
  14241. }
  14242. // extract listeners, since these needs to be treated as
  14243. // child component listeners instead of DOM listeners
  14244. var listeners = data.on;
  14245. // replace with listeners with .native modifier
  14246. // so it gets processed during parent component patch.
  14247. data.on = data.nativeOn;
  14248. if (isTrue(Ctor.options.abstract)) {
  14249. // abstract components do not keep anything
  14250. // other than props & listeners & slot
  14251. // work around flow
  14252. var slot = data.slot;
  14253. data = {};
  14254. if (slot) {
  14255. data.slot = slot;
  14256. }
  14257. }
  14258. // install component management hooks onto the placeholder node
  14259. installComponentHooks(data);
  14260. // return a placeholder vnode
  14261. var name = Ctor.options.name || tag;
  14262. var vnode = new VNode(
  14263. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  14264. data, undefined, undefined, undefined, context,
  14265. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  14266. asyncFactory
  14267. );
  14268. return vnode
  14269. }
  14270. function createComponentInstanceForVnode (
  14271. vnode, // we know it's MountedComponentVNode but flow doesn't
  14272. parent // activeInstance in lifecycle state
  14273. ) {
  14274. var options = {
  14275. _isComponent: true,
  14276. _parentVnode: vnode,
  14277. parent: parent
  14278. };
  14279. // check inline-template render functions
  14280. var inlineTemplate = vnode.data.inlineTemplate;
  14281. if (isDef(inlineTemplate)) {
  14282. options.render = inlineTemplate.render;
  14283. options.staticRenderFns = inlineTemplate.staticRenderFns;
  14284. }
  14285. return new vnode.componentOptions.Ctor(options)
  14286. }
  14287. function installComponentHooks (data) {
  14288. var hooks = data.hook || (data.hook = {});
  14289. for (var i = 0; i < hooksToMerge.length; i++) {
  14290. var key = hooksToMerge[i];
  14291. var existing = hooks[key];
  14292. var toMerge = componentVNodeHooks[key];
  14293. if (existing !== toMerge && !(existing && existing._merged)) {
  14294. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  14295. }
  14296. }
  14297. }
  14298. function mergeHook$1 (f1, f2) {
  14299. var merged = function (a, b) {
  14300. // flow complains about extra args which is why we use any
  14301. f1(a, b);
  14302. f2(a, b);
  14303. };
  14304. merged._merged = true;
  14305. return merged
  14306. }
  14307. // transform component v-model info (value and callback) into
  14308. // prop and event handler respectively.
  14309. function transformModel (options, data) {
  14310. var prop = (options.model && options.model.prop) || 'value';
  14311. var event = (options.model && options.model.event) || 'input'
  14312. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  14313. var on = data.on || (data.on = {});
  14314. var existing = on[event];
  14315. var callback = data.model.callback;
  14316. if (isDef(existing)) {
  14317. if (
  14318. Array.isArray(existing)
  14319. ? existing.indexOf(callback) === -1
  14320. : existing !== callback
  14321. ) {
  14322. on[event] = [callback].concat(existing);
  14323. }
  14324. } else {
  14325. on[event] = callback;
  14326. }
  14327. }
  14328. /* */
  14329. var SIMPLE_NORMALIZE = 1;
  14330. var ALWAYS_NORMALIZE = 2;
  14331. // wrapper function for providing a more flexible interface
  14332. // without getting yelled at by flow
  14333. function createElement (
  14334. context,
  14335. tag,
  14336. data,
  14337. children,
  14338. normalizationType,
  14339. alwaysNormalize
  14340. ) {
  14341. if (Array.isArray(data) || isPrimitive(data)) {
  14342. normalizationType = children;
  14343. children = data;
  14344. data = undefined;
  14345. }
  14346. if (isTrue(alwaysNormalize)) {
  14347. normalizationType = ALWAYS_NORMALIZE;
  14348. }
  14349. return _createElement(context, tag, data, children, normalizationType)
  14350. }
  14351. function _createElement (
  14352. context,
  14353. tag,
  14354. data,
  14355. children,
  14356. normalizationType
  14357. ) {
  14358. if (isDef(data) && isDef((data).__ob__)) {
  14359. true && warn(
  14360. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  14361. 'Always create fresh vnode data objects in each render!',
  14362. context
  14363. );
  14364. return createEmptyVNode()
  14365. }
  14366. // object syntax in v-bind
  14367. if (isDef(data) && isDef(data.is)) {
  14368. tag = data.is;
  14369. }
  14370. if (!tag) {
  14371. // in case of component :is set to falsy value
  14372. return createEmptyVNode()
  14373. }
  14374. // warn against non-primitive key
  14375. if ( true &&
  14376. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  14377. ) {
  14378. {
  14379. warn(
  14380. 'Avoid using non-primitive value as key, ' +
  14381. 'use string/number value instead.',
  14382. context
  14383. );
  14384. }
  14385. }
  14386. // support single function children as default scoped slot
  14387. if (Array.isArray(children) &&
  14388. typeof children[0] === 'function'
  14389. ) {
  14390. data = data || {};
  14391. data.scopedSlots = { default: children[0] };
  14392. children.length = 0;
  14393. }
  14394. if (normalizationType === ALWAYS_NORMALIZE) {
  14395. children = normalizeChildren(children);
  14396. } else if (normalizationType === SIMPLE_NORMALIZE) {
  14397. children = simpleNormalizeChildren(children);
  14398. }
  14399. var vnode, ns;
  14400. if (typeof tag === 'string') {
  14401. var Ctor;
  14402. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  14403. if (config.isReservedTag(tag)) {
  14404. // platform built-in elements
  14405. if ( true && isDef(data) && isDef(data.nativeOn)) {
  14406. warn(
  14407. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  14408. context
  14409. );
  14410. }
  14411. vnode = new VNode(
  14412. config.parsePlatformTagName(tag), data, children,
  14413. undefined, undefined, context
  14414. );
  14415. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  14416. // component
  14417. vnode = createComponent(Ctor, data, context, children, tag);
  14418. } else {
  14419. // unknown or unlisted namespaced elements
  14420. // check at runtime because it may get assigned a namespace when its
  14421. // parent normalizes children
  14422. vnode = new VNode(
  14423. tag, data, children,
  14424. undefined, undefined, context
  14425. );
  14426. }
  14427. } else {
  14428. // direct component options / constructor
  14429. vnode = createComponent(tag, data, context, children);
  14430. }
  14431. if (Array.isArray(vnode)) {
  14432. return vnode
  14433. } else if (isDef(vnode)) {
  14434. if (isDef(ns)) { applyNS(vnode, ns); }
  14435. if (isDef(data)) { registerDeepBindings(data); }
  14436. return vnode
  14437. } else {
  14438. return createEmptyVNode()
  14439. }
  14440. }
  14441. function applyNS (vnode, ns, force) {
  14442. vnode.ns = ns;
  14443. if (vnode.tag === 'foreignObject') {
  14444. // use default namespace inside foreignObject
  14445. ns = undefined;
  14446. force = true;
  14447. }
  14448. if (isDef(vnode.children)) {
  14449. for (var i = 0, l = vnode.children.length; i < l; i++) {
  14450. var child = vnode.children[i];
  14451. if (isDef(child.tag) && (
  14452. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  14453. applyNS(child, ns, force);
  14454. }
  14455. }
  14456. }
  14457. }
  14458. // ref #5318
  14459. // necessary to ensure parent re-render when deep bindings like :style and
  14460. // :class are used on slot nodes
  14461. function registerDeepBindings (data) {
  14462. if (isObject(data.style)) {
  14463. traverse(data.style);
  14464. }
  14465. if (isObject(data.class)) {
  14466. traverse(data.class);
  14467. }
  14468. }
  14469. /* */
  14470. function initRender (vm) {
  14471. vm._vnode = null; // the root of the child tree
  14472. vm._staticTrees = null; // v-once cached trees
  14473. var options = vm.$options;
  14474. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  14475. var renderContext = parentVnode && parentVnode.context;
  14476. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  14477. vm.$scopedSlots = emptyObject;
  14478. // bind the createElement fn to this instance
  14479. // so that we get proper render context inside it.
  14480. // args order: tag, data, children, normalizationType, alwaysNormalize
  14481. // internal version is used by render functions compiled from templates
  14482. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  14483. // normalization is always applied for the public version, used in
  14484. // user-written render functions.
  14485. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  14486. // $attrs & $listeners are exposed for easier HOC creation.
  14487. // they need to be reactive so that HOCs using them are always updated
  14488. var parentData = parentVnode && parentVnode.data;
  14489. /* istanbul ignore else */
  14490. if (true) {
  14491. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  14492. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  14493. }, true);
  14494. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  14495. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  14496. }, true);
  14497. } else {}
  14498. }
  14499. var currentRenderingInstance = null;
  14500. function renderMixin (Vue) {
  14501. // install runtime convenience helpers
  14502. installRenderHelpers(Vue.prototype);
  14503. Vue.prototype.$nextTick = function (fn) {
  14504. return nextTick(fn, this)
  14505. };
  14506. Vue.prototype._render = function () {
  14507. var vm = this;
  14508. var ref = vm.$options;
  14509. var render = ref.render;
  14510. var _parentVnode = ref._parentVnode;
  14511. if (_parentVnode) {
  14512. vm.$scopedSlots = normalizeScopedSlots(
  14513. _parentVnode.data.scopedSlots,
  14514. vm.$slots,
  14515. vm.$scopedSlots
  14516. );
  14517. }
  14518. // set parent vnode. this allows render functions to have access
  14519. // to the data on the placeholder node.
  14520. vm.$vnode = _parentVnode;
  14521. // render self
  14522. var vnode;
  14523. try {
  14524. // There's no need to maintain a stack because all render fns are called
  14525. // separately from one another. Nested component's render fns are called
  14526. // when parent component is patched.
  14527. currentRenderingInstance = vm;
  14528. vnode = render.call(vm._renderProxy, vm.$createElement);
  14529. } catch (e) {
  14530. handleError(e, vm, "render");
  14531. // return error render result,
  14532. // or previous vnode to prevent render error causing blank component
  14533. /* istanbul ignore else */
  14534. if ( true && vm.$options.renderError) {
  14535. try {
  14536. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  14537. } catch (e) {
  14538. handleError(e, vm, "renderError");
  14539. vnode = vm._vnode;
  14540. }
  14541. } else {
  14542. vnode = vm._vnode;
  14543. }
  14544. } finally {
  14545. currentRenderingInstance = null;
  14546. }
  14547. // if the returned array contains only a single node, allow it
  14548. if (Array.isArray(vnode) && vnode.length === 1) {
  14549. vnode = vnode[0];
  14550. }
  14551. // return empty vnode in case the render function errored out
  14552. if (!(vnode instanceof VNode)) {
  14553. if ( true && Array.isArray(vnode)) {
  14554. warn(
  14555. 'Multiple root nodes returned from render function. Render function ' +
  14556. 'should return a single root node.',
  14557. vm
  14558. );
  14559. }
  14560. vnode = createEmptyVNode();
  14561. }
  14562. // set parent
  14563. vnode.parent = _parentVnode;
  14564. return vnode
  14565. };
  14566. }
  14567. /* */
  14568. function ensureCtor (comp, base) {
  14569. if (
  14570. comp.__esModule ||
  14571. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  14572. ) {
  14573. comp = comp.default;
  14574. }
  14575. return isObject(comp)
  14576. ? base.extend(comp)
  14577. : comp
  14578. }
  14579. function createAsyncPlaceholder (
  14580. factory,
  14581. data,
  14582. context,
  14583. children,
  14584. tag
  14585. ) {
  14586. var node = createEmptyVNode();
  14587. node.asyncFactory = factory;
  14588. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  14589. return node
  14590. }
  14591. function resolveAsyncComponent (
  14592. factory,
  14593. baseCtor
  14594. ) {
  14595. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  14596. return factory.errorComp
  14597. }
  14598. if (isDef(factory.resolved)) {
  14599. return factory.resolved
  14600. }
  14601. var owner = currentRenderingInstance;
  14602. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  14603. // already pending
  14604. factory.owners.push(owner);
  14605. }
  14606. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  14607. return factory.loadingComp
  14608. }
  14609. if (owner && !isDef(factory.owners)) {
  14610. var owners = factory.owners = [owner];
  14611. var sync = true;
  14612. var timerLoading = null;
  14613. var timerTimeout = null
  14614. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  14615. var forceRender = function (renderCompleted) {
  14616. for (var i = 0, l = owners.length; i < l; i++) {
  14617. (owners[i]).$forceUpdate();
  14618. }
  14619. if (renderCompleted) {
  14620. owners.length = 0;
  14621. if (timerLoading !== null) {
  14622. clearTimeout(timerLoading);
  14623. timerLoading = null;
  14624. }
  14625. if (timerTimeout !== null) {
  14626. clearTimeout(timerTimeout);
  14627. timerTimeout = null;
  14628. }
  14629. }
  14630. };
  14631. var resolve = once(function (res) {
  14632. // cache resolved
  14633. factory.resolved = ensureCtor(res, baseCtor);
  14634. // invoke callbacks only if this is not a synchronous resolve
  14635. // (async resolves are shimmed as synchronous during SSR)
  14636. if (!sync) {
  14637. forceRender(true);
  14638. } else {
  14639. owners.length = 0;
  14640. }
  14641. });
  14642. var reject = once(function (reason) {
  14643. true && warn(
  14644. "Failed to resolve async component: " + (String(factory)) +
  14645. (reason ? ("\nReason: " + reason) : '')
  14646. );
  14647. if (isDef(factory.errorComp)) {
  14648. factory.error = true;
  14649. forceRender(true);
  14650. }
  14651. });
  14652. var res = factory(resolve, reject);
  14653. if (isObject(res)) {
  14654. if (isPromise(res)) {
  14655. // () => Promise
  14656. if (isUndef(factory.resolved)) {
  14657. res.then(resolve, reject);
  14658. }
  14659. } else if (isPromise(res.component)) {
  14660. res.component.then(resolve, reject);
  14661. if (isDef(res.error)) {
  14662. factory.errorComp = ensureCtor(res.error, baseCtor);
  14663. }
  14664. if (isDef(res.loading)) {
  14665. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  14666. if (res.delay === 0) {
  14667. factory.loading = true;
  14668. } else {
  14669. timerLoading = setTimeout(function () {
  14670. timerLoading = null;
  14671. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  14672. factory.loading = true;
  14673. forceRender(false);
  14674. }
  14675. }, res.delay || 200);
  14676. }
  14677. }
  14678. if (isDef(res.timeout)) {
  14679. timerTimeout = setTimeout(function () {
  14680. timerTimeout = null;
  14681. if (isUndef(factory.resolved)) {
  14682. reject(
  14683. true
  14684. ? ("timeout (" + (res.timeout) + "ms)")
  14685. : undefined
  14686. );
  14687. }
  14688. }, res.timeout);
  14689. }
  14690. }
  14691. }
  14692. sync = false;
  14693. // return in case resolved synchronously
  14694. return factory.loading
  14695. ? factory.loadingComp
  14696. : factory.resolved
  14697. }
  14698. }
  14699. /* */
  14700. function isAsyncPlaceholder (node) {
  14701. return node.isComment && node.asyncFactory
  14702. }
  14703. /* */
  14704. function getFirstComponentChild (children) {
  14705. if (Array.isArray(children)) {
  14706. for (var i = 0; i < children.length; i++) {
  14707. var c = children[i];
  14708. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  14709. return c
  14710. }
  14711. }
  14712. }
  14713. }
  14714. /* */
  14715. /* */
  14716. function initEvents (vm) {
  14717. vm._events = Object.create(null);
  14718. vm._hasHookEvent = false;
  14719. // init parent attached events
  14720. var listeners = vm.$options._parentListeners;
  14721. if (listeners) {
  14722. updateComponentListeners(vm, listeners);
  14723. }
  14724. }
  14725. var target;
  14726. function add (event, fn) {
  14727. target.$on(event, fn);
  14728. }
  14729. function remove$1 (event, fn) {
  14730. target.$off(event, fn);
  14731. }
  14732. function createOnceHandler (event, fn) {
  14733. var _target = target;
  14734. return function onceHandler () {
  14735. var res = fn.apply(null, arguments);
  14736. if (res !== null) {
  14737. _target.$off(event, onceHandler);
  14738. }
  14739. }
  14740. }
  14741. function updateComponentListeners (
  14742. vm,
  14743. listeners,
  14744. oldListeners
  14745. ) {
  14746. target = vm;
  14747. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  14748. target = undefined;
  14749. }
  14750. function eventsMixin (Vue) {
  14751. var hookRE = /^hook:/;
  14752. Vue.prototype.$on = function (event, fn) {
  14753. var vm = this;
  14754. if (Array.isArray(event)) {
  14755. for (var i = 0, l = event.length; i < l; i++) {
  14756. vm.$on(event[i], fn);
  14757. }
  14758. } else {
  14759. (vm._events[event] || (vm._events[event] = [])).push(fn);
  14760. // optimize hook:event cost by using a boolean flag marked at registration
  14761. // instead of a hash lookup
  14762. if (hookRE.test(event)) {
  14763. vm._hasHookEvent = true;
  14764. }
  14765. }
  14766. return vm
  14767. };
  14768. Vue.prototype.$once = function (event, fn) {
  14769. var vm = this;
  14770. function on () {
  14771. vm.$off(event, on);
  14772. fn.apply(vm, arguments);
  14773. }
  14774. on.fn = fn;
  14775. vm.$on(event, on);
  14776. return vm
  14777. };
  14778. Vue.prototype.$off = function (event, fn) {
  14779. var vm = this;
  14780. // all
  14781. if (!arguments.length) {
  14782. vm._events = Object.create(null);
  14783. return vm
  14784. }
  14785. // array of events
  14786. if (Array.isArray(event)) {
  14787. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  14788. vm.$off(event[i$1], fn);
  14789. }
  14790. return vm
  14791. }
  14792. // specific event
  14793. var cbs = vm._events[event];
  14794. if (!cbs) {
  14795. return vm
  14796. }
  14797. if (!fn) {
  14798. vm._events[event] = null;
  14799. return vm
  14800. }
  14801. // specific handler
  14802. var cb;
  14803. var i = cbs.length;
  14804. while (i--) {
  14805. cb = cbs[i];
  14806. if (cb === fn || cb.fn === fn) {
  14807. cbs.splice(i, 1);
  14808. break
  14809. }
  14810. }
  14811. return vm
  14812. };
  14813. Vue.prototype.$emit = function (event) {
  14814. var vm = this;
  14815. if (true) {
  14816. var lowerCaseEvent = event.toLowerCase();
  14817. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  14818. tip(
  14819. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  14820. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  14821. "Note that HTML attributes are case-insensitive and you cannot use " +
  14822. "v-on to listen to camelCase events when using in-DOM templates. " +
  14823. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  14824. );
  14825. }
  14826. }
  14827. var cbs = vm._events[event];
  14828. if (cbs) {
  14829. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  14830. var args = toArray(arguments, 1);
  14831. var info = "event handler for \"" + event + "\"";
  14832. for (var i = 0, l = cbs.length; i < l; i++) {
  14833. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  14834. }
  14835. }
  14836. return vm
  14837. };
  14838. }
  14839. /* */
  14840. var activeInstance = null;
  14841. var isUpdatingChildComponent = false;
  14842. function setActiveInstance(vm) {
  14843. var prevActiveInstance = activeInstance;
  14844. activeInstance = vm;
  14845. return function () {
  14846. activeInstance = prevActiveInstance;
  14847. }
  14848. }
  14849. function initLifecycle (vm) {
  14850. var options = vm.$options;
  14851. // locate first non-abstract parent
  14852. var parent = options.parent;
  14853. if (parent && !options.abstract) {
  14854. while (parent.$options.abstract && parent.$parent) {
  14855. parent = parent.$parent;
  14856. }
  14857. parent.$children.push(vm);
  14858. }
  14859. vm.$parent = parent;
  14860. vm.$root = parent ? parent.$root : vm;
  14861. vm.$children = [];
  14862. vm.$refs = {};
  14863. vm._watcher = null;
  14864. vm._inactive = null;
  14865. vm._directInactive = false;
  14866. vm._isMounted = false;
  14867. vm._isDestroyed = false;
  14868. vm._isBeingDestroyed = false;
  14869. }
  14870. function lifecycleMixin (Vue) {
  14871. Vue.prototype._update = function (vnode, hydrating) {
  14872. var vm = this;
  14873. var prevEl = vm.$el;
  14874. var prevVnode = vm._vnode;
  14875. var restoreActiveInstance = setActiveInstance(vm);
  14876. vm._vnode = vnode;
  14877. // Vue.prototype.__patch__ is injected in entry points
  14878. // based on the rendering backend used.
  14879. if (!prevVnode) {
  14880. // initial render
  14881. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  14882. } else {
  14883. // updates
  14884. vm.$el = vm.__patch__(prevVnode, vnode);
  14885. }
  14886. restoreActiveInstance();
  14887. // update __vue__ reference
  14888. if (prevEl) {
  14889. prevEl.__vue__ = null;
  14890. }
  14891. if (vm.$el) {
  14892. vm.$el.__vue__ = vm;
  14893. }
  14894. // if parent is an HOC, update its $el as well
  14895. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  14896. vm.$parent.$el = vm.$el;
  14897. }
  14898. // updated hook is called by the scheduler to ensure that children are
  14899. // updated in a parent's updated hook.
  14900. };
  14901. Vue.prototype.$forceUpdate = function () {
  14902. var vm = this;
  14903. if (vm._watcher) {
  14904. vm._watcher.update();
  14905. }
  14906. };
  14907. Vue.prototype.$destroy = function () {
  14908. var vm = this;
  14909. if (vm._isBeingDestroyed) {
  14910. return
  14911. }
  14912. callHook(vm, 'beforeDestroy');
  14913. vm._isBeingDestroyed = true;
  14914. // remove self from parent
  14915. var parent = vm.$parent;
  14916. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  14917. remove(parent.$children, vm);
  14918. }
  14919. // teardown watchers
  14920. if (vm._watcher) {
  14921. vm._watcher.teardown();
  14922. }
  14923. var i = vm._watchers.length;
  14924. while (i--) {
  14925. vm._watchers[i].teardown();
  14926. }
  14927. // remove reference from data ob
  14928. // frozen object may not have observer.
  14929. if (vm._data.__ob__) {
  14930. vm._data.__ob__.vmCount--;
  14931. }
  14932. // call the last hook...
  14933. vm._isDestroyed = true;
  14934. // invoke destroy hooks on current rendered tree
  14935. vm.__patch__(vm._vnode, null);
  14936. // fire destroyed hook
  14937. callHook(vm, 'destroyed');
  14938. // turn off all instance listeners.
  14939. vm.$off();
  14940. // remove __vue__ reference
  14941. if (vm.$el) {
  14942. vm.$el.__vue__ = null;
  14943. }
  14944. // release circular reference (#6759)
  14945. if (vm.$vnode) {
  14946. vm.$vnode.parent = null;
  14947. }
  14948. };
  14949. }
  14950. function updateChildComponent (
  14951. vm,
  14952. propsData,
  14953. listeners,
  14954. parentVnode,
  14955. renderChildren
  14956. ) {
  14957. if (true) {
  14958. isUpdatingChildComponent = true;
  14959. }
  14960. // determine whether component has slot children
  14961. // we need to do this before overwriting $options._renderChildren.
  14962. // check if there are dynamic scopedSlots (hand-written or compiled but with
  14963. // dynamic slot names). Static scoped slots compiled from template has the
  14964. // "$stable" marker.
  14965. var newScopedSlots = parentVnode.data.scopedSlots;
  14966. var oldScopedSlots = vm.$scopedSlots;
  14967. var hasDynamicScopedSlot = !!(
  14968. (newScopedSlots && !newScopedSlots.$stable) ||
  14969. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  14970. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  14971. );
  14972. // Any static slot children from the parent may have changed during parent's
  14973. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  14974. // update is necessary to ensure correctness.
  14975. var needsForceUpdate = !!(
  14976. renderChildren || // has new static slots
  14977. vm.$options._renderChildren || // has old static slots
  14978. hasDynamicScopedSlot
  14979. );
  14980. vm.$options._parentVnode = parentVnode;
  14981. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  14982. if (vm._vnode) { // update child tree's parent
  14983. vm._vnode.parent = parentVnode;
  14984. }
  14985. vm.$options._renderChildren = renderChildren;
  14986. // update $attrs and $listeners hash
  14987. // these are also reactive so they may trigger child update if the child
  14988. // used them during render
  14989. vm.$attrs = parentVnode.data.attrs || emptyObject;
  14990. vm.$listeners = listeners || emptyObject;
  14991. // update props
  14992. if (propsData && vm.$options.props) {
  14993. toggleObserving(false);
  14994. var props = vm._props;
  14995. var propKeys = vm.$options._propKeys || [];
  14996. for (var i = 0; i < propKeys.length; i++) {
  14997. var key = propKeys[i];
  14998. var propOptions = vm.$options.props; // wtf flow?
  14999. props[key] = validateProp(key, propOptions, propsData, vm);
  15000. }
  15001. toggleObserving(true);
  15002. // keep a copy of raw propsData
  15003. vm.$options.propsData = propsData;
  15004. }
  15005. // fixed by xxxxxx update properties(mp runtime)
  15006. vm._$updateProperties && vm._$updateProperties(vm);
  15007. // update listeners
  15008. listeners = listeners || emptyObject;
  15009. var oldListeners = vm.$options._parentListeners;
  15010. vm.$options._parentListeners = listeners;
  15011. updateComponentListeners(vm, listeners, oldListeners);
  15012. // resolve slots + force update if has children
  15013. if (needsForceUpdate) {
  15014. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  15015. vm.$forceUpdate();
  15016. }
  15017. if (true) {
  15018. isUpdatingChildComponent = false;
  15019. }
  15020. }
  15021. function isInInactiveTree (vm) {
  15022. while (vm && (vm = vm.$parent)) {
  15023. if (vm._inactive) { return true }
  15024. }
  15025. return false
  15026. }
  15027. function activateChildComponent (vm, direct) {
  15028. if (direct) {
  15029. vm._directInactive = false;
  15030. if (isInInactiveTree(vm)) {
  15031. return
  15032. }
  15033. } else if (vm._directInactive) {
  15034. return
  15035. }
  15036. if (vm._inactive || vm._inactive === null) {
  15037. vm._inactive = false;
  15038. for (var i = 0; i < vm.$children.length; i++) {
  15039. activateChildComponent(vm.$children[i]);
  15040. }
  15041. callHook(vm, 'activated');
  15042. }
  15043. }
  15044. function deactivateChildComponent (vm, direct) {
  15045. if (direct) {
  15046. vm._directInactive = true;
  15047. if (isInInactiveTree(vm)) {
  15048. return
  15049. }
  15050. }
  15051. if (!vm._inactive) {
  15052. vm._inactive = true;
  15053. for (var i = 0; i < vm.$children.length; i++) {
  15054. deactivateChildComponent(vm.$children[i]);
  15055. }
  15056. callHook(vm, 'deactivated');
  15057. }
  15058. }
  15059. function callHook (vm, hook) {
  15060. // #7573 disable dep collection when invoking lifecycle hooks
  15061. pushTarget();
  15062. var handlers = vm.$options[hook];
  15063. var info = hook + " hook";
  15064. if (handlers) {
  15065. for (var i = 0, j = handlers.length; i < j; i++) {
  15066. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  15067. }
  15068. }
  15069. if (vm._hasHookEvent) {
  15070. vm.$emit('hook:' + hook);
  15071. }
  15072. popTarget();
  15073. }
  15074. /* */
  15075. var MAX_UPDATE_COUNT = 100;
  15076. var queue = [];
  15077. var activatedChildren = [];
  15078. var has = {};
  15079. var circular = {};
  15080. var waiting = false;
  15081. var flushing = false;
  15082. var index = 0;
  15083. /**
  15084. * Reset the scheduler's state.
  15085. */
  15086. function resetSchedulerState () {
  15087. index = queue.length = activatedChildren.length = 0;
  15088. has = {};
  15089. if (true) {
  15090. circular = {};
  15091. }
  15092. waiting = flushing = false;
  15093. }
  15094. // Async edge case #6566 requires saving the timestamp when event listeners are
  15095. // attached. However, calling performance.now() has a perf overhead especially
  15096. // if the page has thousands of event listeners. Instead, we take a timestamp
  15097. // every time the scheduler flushes and use that for all event listeners
  15098. // attached during that flush.
  15099. var currentFlushTimestamp = 0;
  15100. // Async edge case fix requires storing an event listener's attach timestamp.
  15101. var getNow = Date.now;
  15102. // Determine what event timestamp the browser is using. Annoyingly, the
  15103. // timestamp can either be hi-res (relative to page load) or low-res
  15104. // (relative to UNIX epoch), so in order to compare time we have to use the
  15105. // same timestamp type when saving the flush timestamp.
  15106. // All IE versions use low-res event timestamps, and have problematic clock
  15107. // implementations (#9632)
  15108. if (inBrowser && !isIE) {
  15109. var performance = window.performance;
  15110. if (
  15111. performance &&
  15112. typeof performance.now === 'function' &&
  15113. getNow() > document.createEvent('Event').timeStamp
  15114. ) {
  15115. // if the event timestamp, although evaluated AFTER the Date.now(), is
  15116. // smaller than it, it means the event is using a hi-res timestamp,
  15117. // and we need to use the hi-res version for event listener timestamps as
  15118. // well.
  15119. getNow = function () { return performance.now(); };
  15120. }
  15121. }
  15122. /**
  15123. * Flush both queues and run the watchers.
  15124. */
  15125. function flushSchedulerQueue () {
  15126. currentFlushTimestamp = getNow();
  15127. flushing = true;
  15128. var watcher, id;
  15129. // Sort queue before flush.
  15130. // This ensures that:
  15131. // 1. Components are updated from parent to child. (because parent is always
  15132. // created before the child)
  15133. // 2. A component's user watchers are run before its render watcher (because
  15134. // user watchers are created before the render watcher)
  15135. // 3. If a component is destroyed during a parent component's watcher run,
  15136. // its watchers can be skipped.
  15137. queue.sort(function (a, b) { return a.id - b.id; });
  15138. // do not cache length because more watchers might be pushed
  15139. // as we run existing watchers
  15140. for (index = 0; index < queue.length; index++) {
  15141. watcher = queue[index];
  15142. if (watcher.before) {
  15143. watcher.before();
  15144. }
  15145. id = watcher.id;
  15146. has[id] = null;
  15147. watcher.run();
  15148. // in dev build, check and stop circular updates.
  15149. if ( true && has[id] != null) {
  15150. circular[id] = (circular[id] || 0) + 1;
  15151. if (circular[id] > MAX_UPDATE_COUNT) {
  15152. warn(
  15153. 'You may have an infinite update loop ' + (
  15154. watcher.user
  15155. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  15156. : "in a component render function."
  15157. ),
  15158. watcher.vm
  15159. );
  15160. break
  15161. }
  15162. }
  15163. }
  15164. // keep copies of post queues before resetting state
  15165. var activatedQueue = activatedChildren.slice();
  15166. var updatedQueue = queue.slice();
  15167. resetSchedulerState();
  15168. // call component updated and activated hooks
  15169. callActivatedHooks(activatedQueue);
  15170. callUpdatedHooks(updatedQueue);
  15171. // devtool hook
  15172. /* istanbul ignore if */
  15173. if (devtools && config.devtools) {
  15174. devtools.emit('flush');
  15175. }
  15176. }
  15177. function callUpdatedHooks (queue) {
  15178. var i = queue.length;
  15179. while (i--) {
  15180. var watcher = queue[i];
  15181. var vm = watcher.vm;
  15182. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  15183. callHook(vm, 'updated');
  15184. }
  15185. }
  15186. }
  15187. /**
  15188. * Queue a kept-alive component that was activated during patch.
  15189. * The queue will be processed after the entire tree has been patched.
  15190. */
  15191. function queueActivatedComponent (vm) {
  15192. // setting _inactive to false here so that a render function can
  15193. // rely on checking whether it's in an inactive tree (e.g. router-view)
  15194. vm._inactive = false;
  15195. activatedChildren.push(vm);
  15196. }
  15197. function callActivatedHooks (queue) {
  15198. for (var i = 0; i < queue.length; i++) {
  15199. queue[i]._inactive = true;
  15200. activateChildComponent(queue[i], true /* true */);
  15201. }
  15202. }
  15203. /**
  15204. * Push a watcher into the watcher queue.
  15205. * Jobs with duplicate IDs will be skipped unless it's
  15206. * pushed when the queue is being flushed.
  15207. */
  15208. function queueWatcher (watcher) {
  15209. var id = watcher.id;
  15210. if (has[id] == null) {
  15211. has[id] = true;
  15212. if (!flushing) {
  15213. queue.push(watcher);
  15214. } else {
  15215. // if already flushing, splice the watcher based on its id
  15216. // if already past its id, it will be run next immediately.
  15217. var i = queue.length - 1;
  15218. while (i > index && queue[i].id > watcher.id) {
  15219. i--;
  15220. }
  15221. queue.splice(i + 1, 0, watcher);
  15222. }
  15223. // queue the flush
  15224. if (!waiting) {
  15225. waiting = true;
  15226. if ( true && !config.async) {
  15227. flushSchedulerQueue();
  15228. return
  15229. }
  15230. nextTick(flushSchedulerQueue);
  15231. }
  15232. }
  15233. }
  15234. /* */
  15235. var uid$2 = 0;
  15236. /**
  15237. * A watcher parses an expression, collects dependencies,
  15238. * and fires callback when the expression value changes.
  15239. * This is used for both the $watch() api and directives.
  15240. */
  15241. var Watcher = function Watcher (
  15242. vm,
  15243. expOrFn,
  15244. cb,
  15245. options,
  15246. isRenderWatcher
  15247. ) {
  15248. this.vm = vm;
  15249. if (isRenderWatcher) {
  15250. vm._watcher = this;
  15251. }
  15252. vm._watchers.push(this);
  15253. // options
  15254. if (options) {
  15255. this.deep = !!options.deep;
  15256. this.user = !!options.user;
  15257. this.lazy = !!options.lazy;
  15258. this.sync = !!options.sync;
  15259. this.before = options.before;
  15260. } else {
  15261. this.deep = this.user = this.lazy = this.sync = false;
  15262. }
  15263. this.cb = cb;
  15264. this.id = ++uid$2; // uid for batching
  15265. this.active = true;
  15266. this.dirty = this.lazy; // for lazy watchers
  15267. this.deps = [];
  15268. this.newDeps = [];
  15269. this.depIds = new _Set();
  15270. this.newDepIds = new _Set();
  15271. this.expression = true
  15272. ? expOrFn.toString()
  15273. : undefined;
  15274. // parse expression for getter
  15275. if (typeof expOrFn === 'function') {
  15276. this.getter = expOrFn;
  15277. } else {
  15278. this.getter = parsePath(expOrFn);
  15279. if (!this.getter) {
  15280. this.getter = noop;
  15281. true && warn(
  15282. "Failed watching path: \"" + expOrFn + "\" " +
  15283. 'Watcher only accepts simple dot-delimited paths. ' +
  15284. 'For full control, use a function instead.',
  15285. vm
  15286. );
  15287. }
  15288. }
  15289. this.value = this.lazy
  15290. ? undefined
  15291. : this.get();
  15292. };
  15293. /**
  15294. * Evaluate the getter, and re-collect dependencies.
  15295. */
  15296. Watcher.prototype.get = function get () {
  15297. pushTarget(this);
  15298. var value;
  15299. var vm = this.vm;
  15300. try {
  15301. value = this.getter.call(vm, vm);
  15302. } catch (e) {
  15303. if (this.user) {
  15304. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  15305. } else {
  15306. throw e
  15307. }
  15308. } finally {
  15309. // "touch" every property so they are all tracked as
  15310. // dependencies for deep watching
  15311. if (this.deep) {
  15312. traverse(value);
  15313. }
  15314. popTarget();
  15315. this.cleanupDeps();
  15316. }
  15317. return value
  15318. };
  15319. /**
  15320. * Add a dependency to this directive.
  15321. */
  15322. Watcher.prototype.addDep = function addDep (dep) {
  15323. var id = dep.id;
  15324. if (!this.newDepIds.has(id)) {
  15325. this.newDepIds.add(id);
  15326. this.newDeps.push(dep);
  15327. if (!this.depIds.has(id)) {
  15328. dep.addSub(this);
  15329. }
  15330. }
  15331. };
  15332. /**
  15333. * Clean up for dependency collection.
  15334. */
  15335. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  15336. var i = this.deps.length;
  15337. while (i--) {
  15338. var dep = this.deps[i];
  15339. if (!this.newDepIds.has(dep.id)) {
  15340. dep.removeSub(this);
  15341. }
  15342. }
  15343. var tmp = this.depIds;
  15344. this.depIds = this.newDepIds;
  15345. this.newDepIds = tmp;
  15346. this.newDepIds.clear();
  15347. tmp = this.deps;
  15348. this.deps = this.newDeps;
  15349. this.newDeps = tmp;
  15350. this.newDeps.length = 0;
  15351. };
  15352. /**
  15353. * Subscriber interface.
  15354. * Will be called when a dependency changes.
  15355. */
  15356. Watcher.prototype.update = function update () {
  15357. /* istanbul ignore else */
  15358. if (this.lazy) {
  15359. this.dirty = true;
  15360. } else if (this.sync) {
  15361. this.run();
  15362. } else {
  15363. queueWatcher(this);
  15364. }
  15365. };
  15366. /**
  15367. * Scheduler job interface.
  15368. * Will be called by the scheduler.
  15369. */
  15370. Watcher.prototype.run = function run () {
  15371. if (this.active) {
  15372. var value = this.get();
  15373. if (
  15374. value !== this.value ||
  15375. // Deep watchers and watchers on Object/Arrays should fire even
  15376. // when the value is the same, because the value may
  15377. // have mutated.
  15378. isObject(value) ||
  15379. this.deep
  15380. ) {
  15381. // set new value
  15382. var oldValue = this.value;
  15383. this.value = value;
  15384. if (this.user) {
  15385. try {
  15386. this.cb.call(this.vm, value, oldValue);
  15387. } catch (e) {
  15388. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  15389. }
  15390. } else {
  15391. this.cb.call(this.vm, value, oldValue);
  15392. }
  15393. }
  15394. }
  15395. };
  15396. /**
  15397. * Evaluate the value of the watcher.
  15398. * This only gets called for lazy watchers.
  15399. */
  15400. Watcher.prototype.evaluate = function evaluate () {
  15401. this.value = this.get();
  15402. this.dirty = false;
  15403. };
  15404. /**
  15405. * Depend on all deps collected by this watcher.
  15406. */
  15407. Watcher.prototype.depend = function depend () {
  15408. var i = this.deps.length;
  15409. while (i--) {
  15410. this.deps[i].depend();
  15411. }
  15412. };
  15413. /**
  15414. * Remove self from all dependencies' subscriber list.
  15415. */
  15416. Watcher.prototype.teardown = function teardown () {
  15417. if (this.active) {
  15418. // remove self from vm's watcher list
  15419. // this is a somewhat expensive operation so we skip it
  15420. // if the vm is being destroyed.
  15421. if (!this.vm._isBeingDestroyed) {
  15422. remove(this.vm._watchers, this);
  15423. }
  15424. var i = this.deps.length;
  15425. while (i--) {
  15426. this.deps[i].removeSub(this);
  15427. }
  15428. this.active = false;
  15429. }
  15430. };
  15431. /* */
  15432. var sharedPropertyDefinition = {
  15433. enumerable: true,
  15434. configurable: true,
  15435. get: noop,
  15436. set: noop
  15437. };
  15438. function proxy (target, sourceKey, key) {
  15439. sharedPropertyDefinition.get = function proxyGetter () {
  15440. return this[sourceKey][key]
  15441. };
  15442. sharedPropertyDefinition.set = function proxySetter (val) {
  15443. this[sourceKey][key] = val;
  15444. };
  15445. Object.defineProperty(target, key, sharedPropertyDefinition);
  15446. }
  15447. function initState (vm) {
  15448. vm._watchers = [];
  15449. var opts = vm.$options;
  15450. if (opts.props) { initProps(vm, opts.props); }
  15451. if (opts.methods) { initMethods(vm, opts.methods); }
  15452. if (opts.data) {
  15453. initData(vm);
  15454. } else {
  15455. observe(vm._data = {}, true /* asRootData */);
  15456. }
  15457. if (opts.computed) { initComputed(vm, opts.computed); }
  15458. if (opts.watch && opts.watch !== nativeWatch) {
  15459. initWatch(vm, opts.watch);
  15460. }
  15461. }
  15462. function initProps (vm, propsOptions) {
  15463. var propsData = vm.$options.propsData || {};
  15464. var props = vm._props = {};
  15465. // cache prop keys so that future props updates can iterate using Array
  15466. // instead of dynamic object key enumeration.
  15467. var keys = vm.$options._propKeys = [];
  15468. var isRoot = !vm.$parent;
  15469. // root instance props should be converted
  15470. if (!isRoot) {
  15471. toggleObserving(false);
  15472. }
  15473. var loop = function ( key ) {
  15474. keys.push(key);
  15475. var value = validateProp(key, propsOptions, propsData, vm);
  15476. /* istanbul ignore else */
  15477. if (true) {
  15478. var hyphenatedKey = hyphenate(key);
  15479. if (isReservedAttribute(hyphenatedKey) ||
  15480. config.isReservedAttr(hyphenatedKey)) {
  15481. warn(
  15482. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  15483. vm
  15484. );
  15485. }
  15486. defineReactive$$1(props, key, value, function () {
  15487. if (!isRoot && !isUpdatingChildComponent) {
  15488. {
  15489. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou' || vm.mpHost === 'mp-xhs'){//百度、快手、小红书 observer 在 setData callback 之后触发,直接忽略该 warn
  15490. return
  15491. }
  15492. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  15493. if(
  15494. key === 'value' &&
  15495. Array.isArray(vm.$options.behaviors) &&
  15496. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  15497. ){
  15498. return
  15499. }
  15500. if(vm._getFormData){
  15501. return
  15502. }
  15503. var $parent = vm.$parent;
  15504. while($parent){
  15505. if($parent.__next_tick_pending){
  15506. return
  15507. }
  15508. $parent = $parent.$parent;
  15509. }
  15510. }
  15511. warn(
  15512. "Avoid mutating a prop directly since the value will be " +
  15513. "overwritten whenever the parent component re-renders. " +
  15514. "Instead, use a data or computed property based on the prop's " +
  15515. "value. Prop being mutated: \"" + key + "\"",
  15516. vm
  15517. );
  15518. }
  15519. });
  15520. } else {}
  15521. // static props are already proxied on the component's prototype
  15522. // during Vue.extend(). We only need to proxy props defined at
  15523. // instantiation here.
  15524. if (!(key in vm)) {
  15525. proxy(vm, "_props", key);
  15526. }
  15527. };
  15528. for (var key in propsOptions) loop( key );
  15529. toggleObserving(true);
  15530. }
  15531. function initData (vm) {
  15532. var data = vm.$options.data;
  15533. data = vm._data = typeof data === 'function'
  15534. ? getData(data, vm)
  15535. : data || {};
  15536. if (!isPlainObject(data)) {
  15537. data = {};
  15538. true && warn(
  15539. 'data functions should return an object:\n' +
  15540. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  15541. vm
  15542. );
  15543. }
  15544. // proxy data on instance
  15545. var keys = Object.keys(data);
  15546. var props = vm.$options.props;
  15547. var methods = vm.$options.methods;
  15548. var i = keys.length;
  15549. while (i--) {
  15550. var key = keys[i];
  15551. if (true) {
  15552. if (methods && hasOwn(methods, key)) {
  15553. warn(
  15554. ("Method \"" + key + "\" has already been defined as a data property."),
  15555. vm
  15556. );
  15557. }
  15558. }
  15559. if (props && hasOwn(props, key)) {
  15560. true && warn(
  15561. "The data property \"" + key + "\" is already declared as a prop. " +
  15562. "Use prop default value instead.",
  15563. vm
  15564. );
  15565. } else if (!isReserved(key)) {
  15566. proxy(vm, "_data", key);
  15567. }
  15568. }
  15569. // observe data
  15570. observe(data, true /* asRootData */);
  15571. }
  15572. function getData (data, vm) {
  15573. // #7573 disable dep collection when invoking data getters
  15574. pushTarget();
  15575. try {
  15576. return data.call(vm, vm)
  15577. } catch (e) {
  15578. handleError(e, vm, "data()");
  15579. return {}
  15580. } finally {
  15581. popTarget();
  15582. }
  15583. }
  15584. var computedWatcherOptions = { lazy: true };
  15585. function initComputed (vm, computed) {
  15586. // $flow-disable-line
  15587. var watchers = vm._computedWatchers = Object.create(null);
  15588. // computed properties are just getters during SSR
  15589. var isSSR = isServerRendering();
  15590. for (var key in computed) {
  15591. var userDef = computed[key];
  15592. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  15593. if ( true && getter == null) {
  15594. warn(
  15595. ("Getter is missing for computed property \"" + key + "\"."),
  15596. vm
  15597. );
  15598. }
  15599. if (!isSSR) {
  15600. // create internal watcher for the computed property.
  15601. watchers[key] = new Watcher(
  15602. vm,
  15603. getter || noop,
  15604. noop,
  15605. computedWatcherOptions
  15606. );
  15607. }
  15608. // component-defined computed properties are already defined on the
  15609. // component prototype. We only need to define computed properties defined
  15610. // at instantiation here.
  15611. if (!(key in vm)) {
  15612. defineComputed(vm, key, userDef);
  15613. } else if (true) {
  15614. if (key in vm.$data) {
  15615. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  15616. } else if (vm.$options.props && key in vm.$options.props) {
  15617. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  15618. }
  15619. }
  15620. }
  15621. }
  15622. function defineComputed (
  15623. target,
  15624. key,
  15625. userDef
  15626. ) {
  15627. var shouldCache = !isServerRendering();
  15628. if (typeof userDef === 'function') {
  15629. sharedPropertyDefinition.get = shouldCache
  15630. ? createComputedGetter(key)
  15631. : createGetterInvoker(userDef);
  15632. sharedPropertyDefinition.set = noop;
  15633. } else {
  15634. sharedPropertyDefinition.get = userDef.get
  15635. ? shouldCache && userDef.cache !== false
  15636. ? createComputedGetter(key)
  15637. : createGetterInvoker(userDef.get)
  15638. : noop;
  15639. sharedPropertyDefinition.set = userDef.set || noop;
  15640. }
  15641. if ( true &&
  15642. sharedPropertyDefinition.set === noop) {
  15643. sharedPropertyDefinition.set = function () {
  15644. warn(
  15645. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  15646. this
  15647. );
  15648. };
  15649. }
  15650. Object.defineProperty(target, key, sharedPropertyDefinition);
  15651. }
  15652. function createComputedGetter (key) {
  15653. return function computedGetter () {
  15654. var watcher = this._computedWatchers && this._computedWatchers[key];
  15655. if (watcher) {
  15656. if (watcher.dirty) {
  15657. watcher.evaluate();
  15658. }
  15659. if (Dep.SharedObject.target) {// fixed by xxxxxx
  15660. watcher.depend();
  15661. }
  15662. return watcher.value
  15663. }
  15664. }
  15665. }
  15666. function createGetterInvoker(fn) {
  15667. return function computedGetter () {
  15668. return fn.call(this, this)
  15669. }
  15670. }
  15671. function initMethods (vm, methods) {
  15672. var props = vm.$options.props;
  15673. for (var key in methods) {
  15674. if (true) {
  15675. if (typeof methods[key] !== 'function') {
  15676. warn(
  15677. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  15678. "Did you reference the function correctly?",
  15679. vm
  15680. );
  15681. }
  15682. if (props && hasOwn(props, key)) {
  15683. warn(
  15684. ("Method \"" + key + "\" has already been defined as a prop."),
  15685. vm
  15686. );
  15687. }
  15688. if ((key in vm) && isReserved(key)) {
  15689. warn(
  15690. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  15691. "Avoid defining component methods that start with _ or $."
  15692. );
  15693. }
  15694. }
  15695. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  15696. }
  15697. }
  15698. function initWatch (vm, watch) {
  15699. for (var key in watch) {
  15700. var handler = watch[key];
  15701. if (Array.isArray(handler)) {
  15702. for (var i = 0; i < handler.length; i++) {
  15703. createWatcher(vm, key, handler[i]);
  15704. }
  15705. } else {
  15706. createWatcher(vm, key, handler);
  15707. }
  15708. }
  15709. }
  15710. function createWatcher (
  15711. vm,
  15712. expOrFn,
  15713. handler,
  15714. options
  15715. ) {
  15716. if (isPlainObject(handler)) {
  15717. options = handler;
  15718. handler = handler.handler;
  15719. }
  15720. if (typeof handler === 'string') {
  15721. handler = vm[handler];
  15722. }
  15723. return vm.$watch(expOrFn, handler, options)
  15724. }
  15725. function stateMixin (Vue) {
  15726. // flow somehow has problems with directly declared definition object
  15727. // when using Object.defineProperty, so we have to procedurally build up
  15728. // the object here.
  15729. var dataDef = {};
  15730. dataDef.get = function () { return this._data };
  15731. var propsDef = {};
  15732. propsDef.get = function () { return this._props };
  15733. if (true) {
  15734. dataDef.set = function () {
  15735. warn(
  15736. 'Avoid replacing instance root $data. ' +
  15737. 'Use nested data properties instead.',
  15738. this
  15739. );
  15740. };
  15741. propsDef.set = function () {
  15742. warn("$props is readonly.", this);
  15743. };
  15744. }
  15745. Object.defineProperty(Vue.prototype, '$data', dataDef);
  15746. Object.defineProperty(Vue.prototype, '$props', propsDef);
  15747. Vue.prototype.$set = set;
  15748. Vue.prototype.$delete = del;
  15749. Vue.prototype.$watch = function (
  15750. expOrFn,
  15751. cb,
  15752. options
  15753. ) {
  15754. var vm = this;
  15755. if (isPlainObject(cb)) {
  15756. return createWatcher(vm, expOrFn, cb, options)
  15757. }
  15758. options = options || {};
  15759. options.user = true;
  15760. var watcher = new Watcher(vm, expOrFn, cb, options);
  15761. if (options.immediate) {
  15762. try {
  15763. cb.call(vm, watcher.value);
  15764. } catch (error) {
  15765. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  15766. }
  15767. }
  15768. return function unwatchFn () {
  15769. watcher.teardown();
  15770. }
  15771. };
  15772. }
  15773. /* */
  15774. var uid$3 = 0;
  15775. function initMixin (Vue) {
  15776. Vue.prototype._init = function (options) {
  15777. var vm = this;
  15778. // a uid
  15779. vm._uid = uid$3++;
  15780. var startTag, endTag;
  15781. /* istanbul ignore if */
  15782. if ( true && config.performance && mark) {
  15783. startTag = "vue-perf-start:" + (vm._uid);
  15784. endTag = "vue-perf-end:" + (vm._uid);
  15785. mark(startTag);
  15786. }
  15787. // a flag to avoid this being observed
  15788. vm._isVue = true;
  15789. // merge options
  15790. if (options && options._isComponent) {
  15791. // optimize internal component instantiation
  15792. // since dynamic options merging is pretty slow, and none of the
  15793. // internal component options needs special treatment.
  15794. initInternalComponent(vm, options);
  15795. } else {
  15796. vm.$options = mergeOptions(
  15797. resolveConstructorOptions(vm.constructor),
  15798. options || {},
  15799. vm
  15800. );
  15801. }
  15802. /* istanbul ignore else */
  15803. if (true) {
  15804. initProxy(vm);
  15805. } else {}
  15806. // expose real self
  15807. vm._self = vm;
  15808. initLifecycle(vm);
  15809. initEvents(vm);
  15810. initRender(vm);
  15811. callHook(vm, 'beforeCreate');
  15812. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  15813. initState(vm);
  15814. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  15815. !vm._$fallback && callHook(vm, 'created');
  15816. /* istanbul ignore if */
  15817. if ( true && config.performance && mark) {
  15818. vm._name = formatComponentName(vm, false);
  15819. mark(endTag);
  15820. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  15821. }
  15822. if (vm.$options.el) {
  15823. vm.$mount(vm.$options.el);
  15824. }
  15825. };
  15826. }
  15827. function initInternalComponent (vm, options) {
  15828. var opts = vm.$options = Object.create(vm.constructor.options);
  15829. // doing this because it's faster than dynamic enumeration.
  15830. var parentVnode = options._parentVnode;
  15831. opts.parent = options.parent;
  15832. opts._parentVnode = parentVnode;
  15833. var vnodeComponentOptions = parentVnode.componentOptions;
  15834. opts.propsData = vnodeComponentOptions.propsData;
  15835. opts._parentListeners = vnodeComponentOptions.listeners;
  15836. opts._renderChildren = vnodeComponentOptions.children;
  15837. opts._componentTag = vnodeComponentOptions.tag;
  15838. if (options.render) {
  15839. opts.render = options.render;
  15840. opts.staticRenderFns = options.staticRenderFns;
  15841. }
  15842. }
  15843. function resolveConstructorOptions (Ctor) {
  15844. var options = Ctor.options;
  15845. if (Ctor.super) {
  15846. var superOptions = resolveConstructorOptions(Ctor.super);
  15847. var cachedSuperOptions = Ctor.superOptions;
  15848. if (superOptions !== cachedSuperOptions) {
  15849. // super option changed,
  15850. // need to resolve new options.
  15851. Ctor.superOptions = superOptions;
  15852. // check if there are any late-modified/attached options (#4976)
  15853. var modifiedOptions = resolveModifiedOptions(Ctor);
  15854. // update base extend options
  15855. if (modifiedOptions) {
  15856. extend(Ctor.extendOptions, modifiedOptions);
  15857. }
  15858. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  15859. if (options.name) {
  15860. options.components[options.name] = Ctor;
  15861. }
  15862. }
  15863. }
  15864. return options
  15865. }
  15866. function resolveModifiedOptions (Ctor) {
  15867. var modified;
  15868. var latest = Ctor.options;
  15869. var sealed = Ctor.sealedOptions;
  15870. for (var key in latest) {
  15871. if (latest[key] !== sealed[key]) {
  15872. if (!modified) { modified = {}; }
  15873. modified[key] = latest[key];
  15874. }
  15875. }
  15876. return modified
  15877. }
  15878. function Vue (options) {
  15879. if ( true &&
  15880. !(this instanceof Vue)
  15881. ) {
  15882. warn('Vue is a constructor and should be called with the `new` keyword');
  15883. }
  15884. this._init(options);
  15885. }
  15886. initMixin(Vue);
  15887. stateMixin(Vue);
  15888. eventsMixin(Vue);
  15889. lifecycleMixin(Vue);
  15890. renderMixin(Vue);
  15891. /* */
  15892. function initUse (Vue) {
  15893. Vue.use = function (plugin) {
  15894. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  15895. if (installedPlugins.indexOf(plugin) > -1) {
  15896. return this
  15897. }
  15898. // additional parameters
  15899. var args = toArray(arguments, 1);
  15900. args.unshift(this);
  15901. if (typeof plugin.install === 'function') {
  15902. plugin.install.apply(plugin, args);
  15903. } else if (typeof plugin === 'function') {
  15904. plugin.apply(null, args);
  15905. }
  15906. installedPlugins.push(plugin);
  15907. return this
  15908. };
  15909. }
  15910. /* */
  15911. function initMixin$1 (Vue) {
  15912. Vue.mixin = function (mixin) {
  15913. this.options = mergeOptions(this.options, mixin);
  15914. return this
  15915. };
  15916. }
  15917. /* */
  15918. function initExtend (Vue) {
  15919. /**
  15920. * Each instance constructor, including Vue, has a unique
  15921. * cid. This enables us to create wrapped "child
  15922. * constructors" for prototypal inheritance and cache them.
  15923. */
  15924. Vue.cid = 0;
  15925. var cid = 1;
  15926. /**
  15927. * Class inheritance
  15928. */
  15929. Vue.extend = function (extendOptions) {
  15930. extendOptions = extendOptions || {};
  15931. var Super = this;
  15932. var SuperId = Super.cid;
  15933. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  15934. if (cachedCtors[SuperId]) {
  15935. return cachedCtors[SuperId]
  15936. }
  15937. var name = extendOptions.name || Super.options.name;
  15938. if ( true && name) {
  15939. validateComponentName(name);
  15940. }
  15941. var Sub = function VueComponent (options) {
  15942. this._init(options);
  15943. };
  15944. Sub.prototype = Object.create(Super.prototype);
  15945. Sub.prototype.constructor = Sub;
  15946. Sub.cid = cid++;
  15947. Sub.options = mergeOptions(
  15948. Super.options,
  15949. extendOptions
  15950. );
  15951. Sub['super'] = Super;
  15952. // For props and computed properties, we define the proxy getters on
  15953. // the Vue instances at extension time, on the extended prototype. This
  15954. // avoids Object.defineProperty calls for each instance created.
  15955. if (Sub.options.props) {
  15956. initProps$1(Sub);
  15957. }
  15958. if (Sub.options.computed) {
  15959. initComputed$1(Sub);
  15960. }
  15961. // allow further extension/mixin/plugin usage
  15962. Sub.extend = Super.extend;
  15963. Sub.mixin = Super.mixin;
  15964. Sub.use = Super.use;
  15965. // create asset registers, so extended classes
  15966. // can have their private assets too.
  15967. ASSET_TYPES.forEach(function (type) {
  15968. Sub[type] = Super[type];
  15969. });
  15970. // enable recursive self-lookup
  15971. if (name) {
  15972. Sub.options.components[name] = Sub;
  15973. }
  15974. // keep a reference to the super options at extension time.
  15975. // later at instantiation we can check if Super's options have
  15976. // been updated.
  15977. Sub.superOptions = Super.options;
  15978. Sub.extendOptions = extendOptions;
  15979. Sub.sealedOptions = extend({}, Sub.options);
  15980. // cache constructor
  15981. cachedCtors[SuperId] = Sub;
  15982. return Sub
  15983. };
  15984. }
  15985. function initProps$1 (Comp) {
  15986. var props = Comp.options.props;
  15987. for (var key in props) {
  15988. proxy(Comp.prototype, "_props", key);
  15989. }
  15990. }
  15991. function initComputed$1 (Comp) {
  15992. var computed = Comp.options.computed;
  15993. for (var key in computed) {
  15994. defineComputed(Comp.prototype, key, computed[key]);
  15995. }
  15996. }
  15997. /* */
  15998. function initAssetRegisters (Vue) {
  15999. /**
  16000. * Create asset registration methods.
  16001. */
  16002. ASSET_TYPES.forEach(function (type) {
  16003. Vue[type] = function (
  16004. id,
  16005. definition
  16006. ) {
  16007. if (!definition) {
  16008. return this.options[type + 's'][id]
  16009. } else {
  16010. /* istanbul ignore if */
  16011. if ( true && type === 'component') {
  16012. validateComponentName(id);
  16013. }
  16014. if (type === 'component' && isPlainObject(definition)) {
  16015. definition.name = definition.name || id;
  16016. definition = this.options._base.extend(definition);
  16017. }
  16018. if (type === 'directive' && typeof definition === 'function') {
  16019. definition = { bind: definition, update: definition };
  16020. }
  16021. this.options[type + 's'][id] = definition;
  16022. return definition
  16023. }
  16024. };
  16025. });
  16026. }
  16027. /* */
  16028. function getComponentName (opts) {
  16029. return opts && (opts.Ctor.options.name || opts.tag)
  16030. }
  16031. function matches (pattern, name) {
  16032. if (Array.isArray(pattern)) {
  16033. return pattern.indexOf(name) > -1
  16034. } else if (typeof pattern === 'string') {
  16035. return pattern.split(',').indexOf(name) > -1
  16036. } else if (isRegExp(pattern)) {
  16037. return pattern.test(name)
  16038. }
  16039. /* istanbul ignore next */
  16040. return false
  16041. }
  16042. function pruneCache (keepAliveInstance, filter) {
  16043. var cache = keepAliveInstance.cache;
  16044. var keys = keepAliveInstance.keys;
  16045. var _vnode = keepAliveInstance._vnode;
  16046. for (var key in cache) {
  16047. var cachedNode = cache[key];
  16048. if (cachedNode) {
  16049. var name = getComponentName(cachedNode.componentOptions);
  16050. if (name && !filter(name)) {
  16051. pruneCacheEntry(cache, key, keys, _vnode);
  16052. }
  16053. }
  16054. }
  16055. }
  16056. function pruneCacheEntry (
  16057. cache,
  16058. key,
  16059. keys,
  16060. current
  16061. ) {
  16062. var cached$$1 = cache[key];
  16063. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  16064. cached$$1.componentInstance.$destroy();
  16065. }
  16066. cache[key] = null;
  16067. remove(keys, key);
  16068. }
  16069. var patternTypes = [String, RegExp, Array];
  16070. var KeepAlive = {
  16071. name: 'keep-alive',
  16072. abstract: true,
  16073. props: {
  16074. include: patternTypes,
  16075. exclude: patternTypes,
  16076. max: [String, Number]
  16077. },
  16078. created: function created () {
  16079. this.cache = Object.create(null);
  16080. this.keys = [];
  16081. },
  16082. destroyed: function destroyed () {
  16083. for (var key in this.cache) {
  16084. pruneCacheEntry(this.cache, key, this.keys);
  16085. }
  16086. },
  16087. mounted: function mounted () {
  16088. var this$1 = this;
  16089. this.$watch('include', function (val) {
  16090. pruneCache(this$1, function (name) { return matches(val, name); });
  16091. });
  16092. this.$watch('exclude', function (val) {
  16093. pruneCache(this$1, function (name) { return !matches(val, name); });
  16094. });
  16095. },
  16096. render: function render () {
  16097. var slot = this.$slots.default;
  16098. var vnode = getFirstComponentChild(slot);
  16099. var componentOptions = vnode && vnode.componentOptions;
  16100. if (componentOptions) {
  16101. // check pattern
  16102. var name = getComponentName(componentOptions);
  16103. var ref = this;
  16104. var include = ref.include;
  16105. var exclude = ref.exclude;
  16106. if (
  16107. // not included
  16108. (include && (!name || !matches(include, name))) ||
  16109. // excluded
  16110. (exclude && name && matches(exclude, name))
  16111. ) {
  16112. return vnode
  16113. }
  16114. var ref$1 = this;
  16115. var cache = ref$1.cache;
  16116. var keys = ref$1.keys;
  16117. var key = vnode.key == null
  16118. // same constructor may get registered as different local components
  16119. // so cid alone is not enough (#3269)
  16120. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  16121. : vnode.key;
  16122. if (cache[key]) {
  16123. vnode.componentInstance = cache[key].componentInstance;
  16124. // make current key freshest
  16125. remove(keys, key);
  16126. keys.push(key);
  16127. } else {
  16128. cache[key] = vnode;
  16129. keys.push(key);
  16130. // prune oldest entry
  16131. if (this.max && keys.length > parseInt(this.max)) {
  16132. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  16133. }
  16134. }
  16135. vnode.data.keepAlive = true;
  16136. }
  16137. return vnode || (slot && slot[0])
  16138. }
  16139. };
  16140. var builtInComponents = {
  16141. KeepAlive: KeepAlive
  16142. };
  16143. /* */
  16144. function initGlobalAPI (Vue) {
  16145. // config
  16146. var configDef = {};
  16147. configDef.get = function () { return config; };
  16148. if (true) {
  16149. configDef.set = function () {
  16150. warn(
  16151. 'Do not replace the Vue.config object, set individual fields instead.'
  16152. );
  16153. };
  16154. }
  16155. Object.defineProperty(Vue, 'config', configDef);
  16156. // exposed util methods.
  16157. // NOTE: these are not considered part of the public API - avoid relying on
  16158. // them unless you are aware of the risk.
  16159. Vue.util = {
  16160. warn: warn,
  16161. extend: extend,
  16162. mergeOptions: mergeOptions,
  16163. defineReactive: defineReactive$$1
  16164. };
  16165. Vue.set = set;
  16166. Vue.delete = del;
  16167. Vue.nextTick = nextTick;
  16168. // 2.6 explicit observable API
  16169. Vue.observable = function (obj) {
  16170. observe(obj);
  16171. return obj
  16172. };
  16173. Vue.options = Object.create(null);
  16174. ASSET_TYPES.forEach(function (type) {
  16175. Vue.options[type + 's'] = Object.create(null);
  16176. });
  16177. // this is used to identify the "base" constructor to extend all plain-object
  16178. // components with in Weex's multi-instance scenarios.
  16179. Vue.options._base = Vue;
  16180. extend(Vue.options.components, builtInComponents);
  16181. initUse(Vue);
  16182. initMixin$1(Vue);
  16183. initExtend(Vue);
  16184. initAssetRegisters(Vue);
  16185. }
  16186. initGlobalAPI(Vue);
  16187. Object.defineProperty(Vue.prototype, '$isServer', {
  16188. get: isServerRendering
  16189. });
  16190. Object.defineProperty(Vue.prototype, '$ssrContext', {
  16191. get: function get () {
  16192. /* istanbul ignore next */
  16193. return this.$vnode && this.$vnode.ssrContext
  16194. }
  16195. });
  16196. // expose FunctionalRenderContext for ssr runtime helper installation
  16197. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  16198. value: FunctionalRenderContext
  16199. });
  16200. Vue.version = '2.6.11';
  16201. /**
  16202. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  16203. */
  16204. var ARRAYTYPE = '[object Array]';
  16205. var OBJECTTYPE = '[object Object]';
  16206. // const FUNCTIONTYPE = '[object Function]'
  16207. function diff(current, pre) {
  16208. var result = {};
  16209. syncKeys(current, pre);
  16210. _diff(current, pre, '', result);
  16211. return result
  16212. }
  16213. function syncKeys(current, pre) {
  16214. if (current === pre) { return }
  16215. var rootCurrentType = type(current);
  16216. var rootPreType = type(pre);
  16217. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  16218. if(Object.keys(current).length >= Object.keys(pre).length){
  16219. for (var key in pre) {
  16220. var currentValue = current[key];
  16221. if (currentValue === undefined) {
  16222. current[key] = null;
  16223. } else {
  16224. syncKeys(currentValue, pre[key]);
  16225. }
  16226. }
  16227. }
  16228. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  16229. if (current.length >= pre.length) {
  16230. pre.forEach(function (item, index) {
  16231. syncKeys(current[index], item);
  16232. });
  16233. }
  16234. }
  16235. }
  16236. function _diff(current, pre, path, result) {
  16237. if (current === pre) { return }
  16238. var rootCurrentType = type(current);
  16239. var rootPreType = type(pre);
  16240. if (rootCurrentType == OBJECTTYPE) {
  16241. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  16242. setResult(result, path, current);
  16243. } else {
  16244. var loop = function ( key ) {
  16245. var currentValue = current[key];
  16246. var preValue = pre[key];
  16247. var currentType = type(currentValue);
  16248. var preType = type(preValue);
  16249. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  16250. if (currentValue !== pre[key]) {
  16251. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  16252. }
  16253. } else if (currentType == ARRAYTYPE) {
  16254. if (preType != ARRAYTYPE) {
  16255. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  16256. } else {
  16257. if (currentValue.length < preValue.length) {
  16258. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  16259. } else {
  16260. currentValue.forEach(function (item, index) {
  16261. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  16262. });
  16263. }
  16264. }
  16265. } else if (currentType == OBJECTTYPE) {
  16266. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  16267. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  16268. } else {
  16269. for (var subKey in currentValue) {
  16270. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  16271. }
  16272. }
  16273. }
  16274. };
  16275. for (var key in current) loop( key );
  16276. }
  16277. } else if (rootCurrentType == ARRAYTYPE) {
  16278. if (rootPreType != ARRAYTYPE) {
  16279. setResult(result, path, current);
  16280. } else {
  16281. if (current.length < pre.length) {
  16282. setResult(result, path, current);
  16283. } else {
  16284. current.forEach(function (item, index) {
  16285. _diff(item, pre[index], path + '[' + index + ']', result);
  16286. });
  16287. }
  16288. }
  16289. } else {
  16290. setResult(result, path, current);
  16291. }
  16292. }
  16293. function setResult(result, k, v) {
  16294. // if (type(v) != FUNCTIONTYPE) {
  16295. result[k] = v;
  16296. // }
  16297. }
  16298. function type(obj) {
  16299. return Object.prototype.toString.call(obj)
  16300. }
  16301. /* */
  16302. function flushCallbacks$1(vm) {
  16303. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  16304. if (Object({"NODE_ENV":"development","VUE_APP_NAME":"test","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  16305. var mpInstance = vm.$scope;
  16306. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  16307. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  16308. }
  16309. var copies = vm.__next_tick_callbacks.slice(0);
  16310. vm.__next_tick_callbacks.length = 0;
  16311. for (var i = 0; i < copies.length; i++) {
  16312. copies[i]();
  16313. }
  16314. }
  16315. }
  16316. function hasRenderWatcher(vm) {
  16317. return queue.find(function (watcher) { return vm._watcher === watcher; })
  16318. }
  16319. function nextTick$1(vm, cb) {
  16320. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  16321. //2.nextTick 之前存在 render watcher
  16322. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  16323. if(Object({"NODE_ENV":"development","VUE_APP_NAME":"test","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  16324. var mpInstance = vm.$scope;
  16325. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  16326. ']:nextVueTick');
  16327. }
  16328. return nextTick(cb, vm)
  16329. }else{
  16330. if(Object({"NODE_ENV":"development","VUE_APP_NAME":"test","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  16331. var mpInstance$1 = vm.$scope;
  16332. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  16333. ']:nextMPTick');
  16334. }
  16335. }
  16336. var _resolve;
  16337. if (!vm.__next_tick_callbacks) {
  16338. vm.__next_tick_callbacks = [];
  16339. }
  16340. vm.__next_tick_callbacks.push(function () {
  16341. if (cb) {
  16342. try {
  16343. cb.call(vm);
  16344. } catch (e) {
  16345. handleError(e, vm, 'nextTick');
  16346. }
  16347. } else if (_resolve) {
  16348. _resolve(vm);
  16349. }
  16350. });
  16351. // $flow-disable-line
  16352. if (!cb && typeof Promise !== 'undefined') {
  16353. return new Promise(function (resolve) {
  16354. _resolve = resolve;
  16355. })
  16356. }
  16357. }
  16358. /* */
  16359. function cloneWithData(vm) {
  16360. // 确保当前 vm 所有数据被同步
  16361. var ret = Object.create(null);
  16362. var dataKeys = [].concat(
  16363. Object.keys(vm._data || {}),
  16364. Object.keys(vm._computedWatchers || {}));
  16365. dataKeys.reduce(function(ret, key) {
  16366. ret[key] = vm[key];
  16367. return ret
  16368. }, ret);
  16369. // vue-composition-api
  16370. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  16371. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  16372. if (rawBindings) {
  16373. Object.keys(rawBindings).forEach(function (key) {
  16374. ret[key] = vm[key];
  16375. });
  16376. }
  16377. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  16378. Object.assign(ret, vm.$mp.data || {});
  16379. if (
  16380. Array.isArray(vm.$options.behaviors) &&
  16381. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  16382. ) { //form-field
  16383. ret['name'] = vm.name;
  16384. ret['value'] = vm.value;
  16385. }
  16386. return JSON.parse(JSON.stringify(ret))
  16387. }
  16388. var patch = function(oldVnode, vnode) {
  16389. var this$1 = this;
  16390. if (vnode === null) { //destroy
  16391. return
  16392. }
  16393. if (this.mpType === 'page' || this.mpType === 'component') {
  16394. var mpInstance = this.$scope;
  16395. var data = Object.create(null);
  16396. try {
  16397. data = cloneWithData(this);
  16398. } catch (err) {
  16399. console.error(err);
  16400. }
  16401. data.__webviewId__ = mpInstance.data.__webviewId__;
  16402. var mpData = Object.create(null);
  16403. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  16404. mpData[key] = mpInstance.data[key];
  16405. });
  16406. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  16407. if (Object.keys(diffData).length) {
  16408. if (Object({"NODE_ENV":"development","VUE_APP_NAME":"test","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  16409. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  16410. ']差量更新',
  16411. JSON.stringify(diffData));
  16412. }
  16413. this.__next_tick_pending = true;
  16414. mpInstance.setData(diffData, function () {
  16415. this$1.__next_tick_pending = false;
  16416. flushCallbacks$1(this$1);
  16417. });
  16418. } else {
  16419. flushCallbacks$1(this);
  16420. }
  16421. }
  16422. };
  16423. /* */
  16424. function createEmptyRender() {
  16425. }
  16426. function mountComponent$1(
  16427. vm,
  16428. el,
  16429. hydrating
  16430. ) {
  16431. if (!vm.mpType) {//main.js 中的 new Vue
  16432. return vm
  16433. }
  16434. if (vm.mpType === 'app') {
  16435. vm.$options.render = createEmptyRender;
  16436. }
  16437. if (!vm.$options.render) {
  16438. vm.$options.render = createEmptyRender;
  16439. if (true) {
  16440. /* istanbul ignore if */
  16441. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  16442. vm.$options.el || el) {
  16443. warn(
  16444. 'You are using the runtime-only build of Vue where the template ' +
  16445. 'compiler is not available. Either pre-compile the templates into ' +
  16446. 'render functions, or use the compiler-included build.',
  16447. vm
  16448. );
  16449. } else {
  16450. warn(
  16451. 'Failed to mount component: template or render function not defined.',
  16452. vm
  16453. );
  16454. }
  16455. }
  16456. }
  16457. !vm._$fallback && callHook(vm, 'beforeMount');
  16458. var updateComponent = function () {
  16459. vm._update(vm._render(), hydrating);
  16460. };
  16461. // we set this to vm._watcher inside the watcher's constructor
  16462. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  16463. // component's mounted hook), which relies on vm._watcher being already defined
  16464. new Watcher(vm, updateComponent, noop, {
  16465. before: function before() {
  16466. if (vm._isMounted && !vm._isDestroyed) {
  16467. callHook(vm, 'beforeUpdate');
  16468. }
  16469. }
  16470. }, true /* isRenderWatcher */);
  16471. hydrating = false;
  16472. return vm
  16473. }
  16474. /* */
  16475. function renderClass (
  16476. staticClass,
  16477. dynamicClass
  16478. ) {
  16479. if (isDef(staticClass) || isDef(dynamicClass)) {
  16480. return concat(staticClass, stringifyClass(dynamicClass))
  16481. }
  16482. /* istanbul ignore next */
  16483. return ''
  16484. }
  16485. function concat (a, b) {
  16486. return a ? b ? (a + ' ' + b) : a : (b || '')
  16487. }
  16488. function stringifyClass (value) {
  16489. if (Array.isArray(value)) {
  16490. return stringifyArray(value)
  16491. }
  16492. if (isObject(value)) {
  16493. return stringifyObject(value)
  16494. }
  16495. if (typeof value === 'string') {
  16496. return value
  16497. }
  16498. /* istanbul ignore next */
  16499. return ''
  16500. }
  16501. function stringifyArray (value) {
  16502. var res = '';
  16503. var stringified;
  16504. for (var i = 0, l = value.length; i < l; i++) {
  16505. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  16506. if (res) { res += ' '; }
  16507. res += stringified;
  16508. }
  16509. }
  16510. return res
  16511. }
  16512. function stringifyObject (value) {
  16513. var res = '';
  16514. for (var key in value) {
  16515. if (value[key]) {
  16516. if (res) { res += ' '; }
  16517. res += key;
  16518. }
  16519. }
  16520. return res
  16521. }
  16522. /* */
  16523. var parseStyleText = cached(function (cssText) {
  16524. var res = {};
  16525. var listDelimiter = /;(?![^(]*\))/g;
  16526. var propertyDelimiter = /:(.+)/;
  16527. cssText.split(listDelimiter).forEach(function (item) {
  16528. if (item) {
  16529. var tmp = item.split(propertyDelimiter);
  16530. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  16531. }
  16532. });
  16533. return res
  16534. });
  16535. // normalize possible array / string values into Object
  16536. function normalizeStyleBinding (bindingStyle) {
  16537. if (Array.isArray(bindingStyle)) {
  16538. return toObject(bindingStyle)
  16539. }
  16540. if (typeof bindingStyle === 'string') {
  16541. return parseStyleText(bindingStyle)
  16542. }
  16543. return bindingStyle
  16544. }
  16545. /* */
  16546. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  16547. function getTarget(obj, path) {
  16548. var parts = path.split('.');
  16549. var key = parts[0];
  16550. if (key.indexOf('__$n') === 0) { //number index
  16551. key = parseInt(key.replace('__$n', ''));
  16552. }
  16553. if (parts.length === 1) {
  16554. return obj[key]
  16555. }
  16556. return getTarget(obj[key], parts.slice(1).join('.'))
  16557. }
  16558. function internalMixin(Vue) {
  16559. Vue.config.errorHandler = function(err, vm, info) {
  16560. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  16561. console.error(err);
  16562. /* eslint-disable no-undef */
  16563. var app = typeof getApp === 'function' && getApp();
  16564. if (app && app.onError) {
  16565. app.onError(err);
  16566. }
  16567. };
  16568. var oldEmit = Vue.prototype.$emit;
  16569. Vue.prototype.$emit = function(event) {
  16570. if (this.$scope && event) {
  16571. var triggerEvent = this.$scope['_triggerEvent'] || this.$scope['triggerEvent'];
  16572. if (triggerEvent) {
  16573. triggerEvent.call(this.$scope, event, {
  16574. __args__: toArray(arguments, 1)
  16575. });
  16576. }
  16577. }
  16578. return oldEmit.apply(this, arguments)
  16579. };
  16580. Vue.prototype.$nextTick = function(fn) {
  16581. return nextTick$1(this, fn)
  16582. };
  16583. MP_METHODS.forEach(function (method) {
  16584. Vue.prototype[method] = function(args) {
  16585. if (this.$scope && this.$scope[method]) {
  16586. return this.$scope[method](args)
  16587. }
  16588. // mp-alipay
  16589. if (typeof my === 'undefined') {
  16590. return
  16591. }
  16592. if (method === 'createSelectorQuery') {
  16593. /* eslint-disable no-undef */
  16594. return my.createSelectorQuery(args)
  16595. } else if (method === 'createIntersectionObserver') {
  16596. /* eslint-disable no-undef */
  16597. return my.createIntersectionObserver(args)
  16598. }
  16599. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  16600. };
  16601. });
  16602. Vue.prototype.__init_provide = initProvide;
  16603. Vue.prototype.__init_injections = initInjections;
  16604. Vue.prototype.__call_hook = function(hook, args) {
  16605. var vm = this;
  16606. // #7573 disable dep collection when invoking lifecycle hooks
  16607. pushTarget();
  16608. var handlers = vm.$options[hook];
  16609. var info = hook + " hook";
  16610. var ret;
  16611. if (handlers) {
  16612. for (var i = 0, j = handlers.length; i < j; i++) {
  16613. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  16614. }
  16615. }
  16616. if (vm._hasHookEvent) {
  16617. vm.$emit('hook:' + hook, args);
  16618. }
  16619. popTarget();
  16620. return ret
  16621. };
  16622. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  16623. if (Array.isArray(modifiers)) {
  16624. if (modifiers.indexOf('trim') !== -1) {
  16625. value = value.trim();
  16626. }
  16627. if (modifiers.indexOf('number') !== -1) {
  16628. value = this._n(value);
  16629. }
  16630. }
  16631. if (!target) {
  16632. target = this;
  16633. }
  16634. // 解决动态属性添加
  16635. Vue.set(target, key, value);
  16636. };
  16637. Vue.prototype.__set_sync = function(target, key, value) {
  16638. if (!target) {
  16639. target = this;
  16640. }
  16641. // 解决动态属性添加
  16642. Vue.set(target, key, value);
  16643. };
  16644. Vue.prototype.__get_orig = function(item) {
  16645. if (isPlainObject(item)) {
  16646. return item['$orig'] || item
  16647. }
  16648. return item
  16649. };
  16650. Vue.prototype.__get_value = function(dataPath, target) {
  16651. return getTarget(target || this, dataPath)
  16652. };
  16653. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  16654. return renderClass(staticClass, dynamicClass)
  16655. };
  16656. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  16657. if (!dynamicStyle && !staticStyle) {
  16658. return ''
  16659. }
  16660. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  16661. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  16662. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  16663. };
  16664. Vue.prototype.__map = function(val, iteratee) {
  16665. //TODO 暂不考虑 string
  16666. var ret, i, l, keys, key;
  16667. if (Array.isArray(val)) {
  16668. ret = new Array(val.length);
  16669. for (i = 0, l = val.length; i < l; i++) {
  16670. ret[i] = iteratee(val[i], i);
  16671. }
  16672. return ret
  16673. } else if (isObject(val)) {
  16674. keys = Object.keys(val);
  16675. ret = Object.create(null);
  16676. for (i = 0, l = keys.length; i < l; i++) {
  16677. key = keys[i];
  16678. ret[key] = iteratee(val[key], key, i);
  16679. }
  16680. return ret
  16681. } else if (typeof val === 'number') {
  16682. ret = new Array(val);
  16683. for (i = 0, l = val; i < l; i++) {
  16684. // 第一个参数暂时仍和小程序一致
  16685. ret[i] = iteratee(i, i);
  16686. }
  16687. return ret
  16688. }
  16689. return []
  16690. };
  16691. }
  16692. /* */
  16693. var LIFECYCLE_HOOKS$1 = [
  16694. //App
  16695. 'onLaunch',
  16696. 'onShow',
  16697. 'onHide',
  16698. 'onUniNViewMessage',
  16699. 'onPageNotFound',
  16700. 'onThemeChange',
  16701. 'onError',
  16702. 'onUnhandledRejection',
  16703. //Page
  16704. 'onInit',
  16705. 'onLoad',
  16706. // 'onShow',
  16707. 'onReady',
  16708. // 'onHide',
  16709. 'onUnload',
  16710. 'onPullDownRefresh',
  16711. 'onReachBottom',
  16712. 'onTabItemTap',
  16713. 'onAddToFavorites',
  16714. 'onShareTimeline',
  16715. 'onShareAppMessage',
  16716. 'onResize',
  16717. 'onPageScroll',
  16718. 'onNavigationBarButtonTap',
  16719. 'onBackPress',
  16720. 'onNavigationBarSearchInputChanged',
  16721. 'onNavigationBarSearchInputConfirmed',
  16722. 'onNavigationBarSearchInputClicked',
  16723. //Component
  16724. // 'onReady', // 兼容旧版本,应该移除该事件
  16725. 'onPageShow',
  16726. 'onPageHide',
  16727. 'onPageResize',
  16728. 'onUploadDouyinVideo'
  16729. ];
  16730. function lifecycleMixin$1(Vue) {
  16731. //fixed vue-class-component
  16732. var oldExtend = Vue.extend;
  16733. Vue.extend = function(extendOptions) {
  16734. extendOptions = extendOptions || {};
  16735. var methods = extendOptions.methods;
  16736. if (methods) {
  16737. Object.keys(methods).forEach(function (methodName) {
  16738. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  16739. extendOptions[methodName] = methods[methodName];
  16740. delete methods[methodName];
  16741. }
  16742. });
  16743. }
  16744. return oldExtend.call(this, extendOptions)
  16745. };
  16746. var strategies = Vue.config.optionMergeStrategies;
  16747. var mergeHook = strategies.created;
  16748. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  16749. strategies[hook] = mergeHook;
  16750. });
  16751. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  16752. }
  16753. /* */
  16754. // install platform patch function
  16755. Vue.prototype.__patch__ = patch;
  16756. // public mount method
  16757. Vue.prototype.$mount = function(
  16758. el ,
  16759. hydrating
  16760. ) {
  16761. return mountComponent$1(this, el, hydrating)
  16762. };
  16763. lifecycleMixin$1(Vue);
  16764. internalMixin(Vue);
  16765. /* */
  16766. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  16767. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 2)))
  16768. /***/ }),
  16769. /***/ 5:
  16770. /*!****************************************************!*\
  16771. !*** E:/project/新耗材小程序/material_applet/pages.json ***!
  16772. \****************************************************/
  16773. /*! no static exports found */
  16774. /***/ (function(module, exports) {
  16775. /***/ }),
  16776. /***/ 9:
  16777. /*!**********************************************************!*\
  16778. !*** ./node_modules/@babel/runtime/regenerator/index.js ***!
  16779. \**********************************************************/
  16780. /*! no static exports found */
  16781. /***/ (function(module, exports, __webpack_require__) {
  16782. module.exports = __webpack_require__(/*! regenerator-runtime */ 10);
  16783. /***/ })
  16784. }]);
  16785. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map