vendor.js 733 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],{
  2. /***/ 1:
  3. /*!*********************************************************!*\
  4. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js ***!
  5. \*********************************************************/
  6. /*! no static exports found */
  7. /***/ (function(module, exports, __webpack_require__) {
  8. "use strict";
  9. Object.defineProperty(exports, "__esModule", {
  10. value: true
  11. });
  12. exports.default = void 0;
  13. var objectKeys = ['qy', 'env', 'error', 'version', 'lanDebug', 'cloud', 'serviceMarket', 'router', 'worklet', '__webpack_require_UNI_MP_PLUGIN__'];
  14. var singlePageDisableKey = ['lanDebug', 'router', 'worklet'];
  15. var target = typeof globalThis !== 'undefined' ? globalThis : function () {
  16. return this;
  17. }();
  18. var key = ['w', 'x'].join('');
  19. var oldWx = target[key];
  20. var launchOption = oldWx.getLaunchOptionsSync ? oldWx.getLaunchOptionsSync() : null;
  21. function isWxKey(key) {
  22. if (launchOption && launchOption.scene === 1154 && singlePageDisableKey.includes(key)) {
  23. return false;
  24. }
  25. return objectKeys.indexOf(key) > -1 || typeof oldWx[key] === 'function';
  26. }
  27. function initWx() {
  28. var newWx = {};
  29. for (var _key in oldWx) {
  30. if (isWxKey(_key)) {
  31. // TODO wrapper function
  32. newWx[_key] = oldWx[_key];
  33. }
  34. }
  35. return newWx;
  36. }
  37. target[key] = initWx();
  38. var _default = target[key];
  39. exports.default = _default;
  40. /***/ }),
  41. /***/ 10:
  42. /*!****************************************************************!*\
  43. !*** ./node_modules/@babel/runtime/helpers/nonIterableRest.js ***!
  44. \****************************************************************/
  45. /*! no static exports found */
  46. /***/ (function(module, exports) {
  47. function _nonIterableRest() {
  48. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  49. }
  50. module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
  51. /***/ }),
  52. /***/ 107:
  53. /*!*********************************************************************!*\
  54. !*** E:/work/Project_newGit/hptwxMiniProgram/api/aqpt/checklist.js ***!
  55. \*********************************************************************/
  56. /*! no static exports found */
  57. /***/ (function(module, exports, __webpack_require__) {
  58. "use strict";
  59. Object.defineProperty(exports, "__esModule", {
  60. value: true
  61. });
  62. exports.batchSatisfactionChecklist = batchSatisfactionChecklist;
  63. exports.getSatisfactionChecklist = getSatisfactionChecklist;
  64. var _request = __webpack_require__(/*! @/utils/request.js */ 41);
  65. /**
  66. * 获取评分清单视图
  67. * @param data
  68. *
  69. * @returns
  70. */
  71. function getSatisfactionChecklist(checklistId) {
  72. return (0, _request.request)({
  73. url: "/checklist/view/".concat(checklistId),
  74. method: 'GET'
  75. });
  76. }
  77. // 2. 一次批量提交
  78. function batchSatisfactionChecklist(data) {
  79. return (0, _request.request)({
  80. url: "/checklist/score/record/batch",
  81. method: 'POST',
  82. data: data
  83. });
  84. }
  85. /***/ }),
  86. /***/ 11:
  87. /*!***************************************************************!*\
  88. !*** ./node_modules/@babel/runtime/helpers/defineProperty.js ***!
  89. \***************************************************************/
  90. /*! no static exports found */
  91. /***/ (function(module, exports, __webpack_require__) {
  92. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
  93. function _defineProperty(obj, key, value) {
  94. key = toPropertyKey(key);
  95. if (key in obj) {
  96. Object.defineProperty(obj, key, {
  97. value: value,
  98. enumerable: true,
  99. configurable: true,
  100. writable: true
  101. });
  102. } else {
  103. obj[key] = value;
  104. }
  105. return obj;
  106. }
  107. module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
  108. /***/ }),
  109. /***/ 12:
  110. /*!**************************************************************!*\
  111. !*** ./node_modules/@babel/runtime/helpers/toPropertyKey.js ***!
  112. \**************************************************************/
  113. /*! no static exports found */
  114. /***/ (function(module, exports, __webpack_require__) {
  115. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  116. var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ 14);
  117. function _toPropertyKey(arg) {
  118. var key = toPrimitive(arg, "string");
  119. return _typeof(key) === "symbol" ? key : String(key);
  120. }
  121. module.exports = _toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
  122. /***/ }),
  123. /***/ 122:
  124. /*!**********************************************************************!*\
  125. !*** E:/work/Project_newGit/hptwxMiniProgram/api/system/groupApi.js ***!
  126. \**********************************************************************/
  127. /*! no static exports found */
  128. /***/ (function(module, exports, __webpack_require__) {
  129. "use strict";
  130. Object.defineProperty(exports, "__esModule", {
  131. value: true
  132. });
  133. exports.createGroup = createGroup;
  134. exports.deleteGroupById = deleteGroupById;
  135. exports.getGroupById = getGroupById;
  136. exports.getGroupByList = getGroupByList;
  137. exports.getGroupView = getGroupView;
  138. exports.updateGroup = updateGroup;
  139. var _request = __webpack_require__(/*! @/utils/request.js */ 41);
  140. /**
  141. * 获取部门列表
  142. * @returns
  143. */
  144. function getGroupByList() {
  145. return (0, _request.request)({
  146. url: '/group',
  147. method: 'GET'
  148. });
  149. }
  150. /**
  151. * 根据ID获取
  152. * @returns
  153. * @param groupId
  154. */
  155. function getGroupById(groupId) {
  156. return (0, _request.request)({
  157. url: "/group/".concat(groupId),
  158. method: 'GET'
  159. });
  160. }
  161. /**
  162. * 添加部门
  163. * @param data
  164. * @returns
  165. */
  166. function createGroup(data) {
  167. return (0, _request.request)({
  168. url: "/group/add",
  169. method: 'POST',
  170. data: data
  171. });
  172. }
  173. /**
  174. * 更新部门
  175. * @param data
  176. * @returns
  177. */
  178. function updateGroup(data) {
  179. return (0, _request.request)({
  180. url: "/group/update",
  181. method: 'PUT',
  182. data: data
  183. });
  184. }
  185. /**
  186. * 删除部门
  187. * @returns
  188. * @param groupId
  189. */
  190. function deleteGroupById(groupId) {
  191. return (0, _request.request)({
  192. url: "/group/".concat(groupId),
  193. method: 'DELETE'
  194. });
  195. }
  196. /**
  197. * 获取部门列表
  198. * @returns
  199. */
  200. function getGroupView() {
  201. return (0, _request.request)({
  202. url: '/group/view',
  203. method: 'GET'
  204. });
  205. }
  206. /***/ }),
  207. /***/ 123:
  208. /*!*************************************************************!*\
  209. !*** E:/work/Project_newGit/hptwxMiniProgram/api/danger.js ***!
  210. \*************************************************************/
  211. /*! no static exports found */
  212. /***/ (function(module, exports, __webpack_require__) {
  213. "use strict";
  214. Object.defineProperty(exports, "__esModule", {
  215. value: true
  216. });
  217. exports.getDangerCatByList = getDangerCatByList;
  218. var _request = __webpack_require__(/*! @/utils/request.js */ 41);
  219. /**
  220. * 列表查询Danger Category
  221. * @returns
  222. */
  223. function getDangerCatByList() {
  224. return (0, _request.request)({
  225. url: '/danger/cat',
  226. method: 'GET'
  227. });
  228. }
  229. /***/ }),
  230. /***/ 124:
  231. /*!****************************************************************!*\
  232. !*** E:/work/Project_newGit/hptwxMiniProgram/api/riskPiont.js ***!
  233. \****************************************************************/
  234. /*! no static exports found */
  235. /***/ (function(module, exports, __webpack_require__) {
  236. "use strict";
  237. Object.defineProperty(exports, "__esModule", {
  238. value: true
  239. });
  240. exports.getRiskPointByList = getRiskPointByList;
  241. var _request = __webpack_require__(/*! @/utils/request.js */ 41);
  242. /**
  243. * 列表查询
  244. * @returns
  245. */
  246. function getRiskPointByList(data) {
  247. return (0, _request.request)({
  248. url: '/riskPoint',
  249. method: 'GET',
  250. params: data
  251. });
  252. }
  253. /***/ }),
  254. /***/ 125:
  255. /*!*******************************************************************!*\
  256. !*** E:/work/Project_newGit/hptwxMiniProgram/api/system/wfApi.js ***!
  257. \*******************************************************************/
  258. /*! no static exports found */
  259. /***/ (function(module, exports, __webpack_require__) {
  260. "use strict";
  261. Object.defineProperty(exports, "__esModule", {
  262. value: true
  263. });
  264. exports.cancelWorkflow = cancelWorkflow;
  265. exports.getWorkflowById = getWorkflowById;
  266. exports.getWorkflowById2 = getWorkflowById2;
  267. exports.getWorkflowById3 = getWorkflowById3;
  268. exports.getWorkflowDetailsById = getWorkflowDetailsById;
  269. exports.getWorkflowRecordById = getWorkflowRecordById;
  270. exports.handleWorkflow = handleWorkflow;
  271. exports.startWorkflow = startWorkflow;
  272. var _request = __webpack_require__(/*! @/utils/request.js */ 41);
  273. /**
  274. * 启动Workflow
  275. * @param wfDefId
  276. * @returns
  277. */
  278. function startWorkflow(wfDefId) {
  279. return (0, _request.request)({
  280. url: "/wf/start/".concat(wfDefId),
  281. method: 'GET'
  282. });
  283. }
  284. function getWorkflowById(wfInsId) {
  285. return (0, _request.request)({
  286. url: "/wf/getIns/".concat(wfInsId),
  287. method: 'GET'
  288. });
  289. }
  290. function getWorkflowById2(wfInsId, activityInsId) {
  291. return (0, _request.request)({
  292. url: "/wf/getIns/".concat(wfInsId, "/").concat(activityInsId),
  293. method: 'GET'
  294. });
  295. }
  296. function getWorkflowById3(wfInsId, activityInsId, actionInsId) {
  297. return (0, _request.request)({
  298. url: "/wf/getIns/".concat(wfInsId, "/").concat(activityInsId, "/").concat(actionInsId),
  299. method: 'GET'
  300. });
  301. }
  302. function getWorkflowDetailsById(wfInsId) {
  303. return (0, _request.request)({
  304. url: "/wf/details/".concat(wfInsId),
  305. method: 'GET'
  306. });
  307. }
  308. function getWorkflowRecordById(wfInsId) {
  309. return (0, _request.request)({
  310. url: "/wf/record/".concat(wfInsId),
  311. method: 'GET'
  312. });
  313. }
  314. /**
  315. * 处理
  316. * @param data
  317. * @returns
  318. */
  319. function handleWorkflow(data) {
  320. return (0, _request.request)({
  321. url: "/wf/handle",
  322. method: 'POST',
  323. data: data
  324. });
  325. }
  326. /**
  327. * 撤消
  328. * @param wfInsId
  329. * @returns
  330. */
  331. function cancelWorkflow(wfInsId) {
  332. return (0, _request.request)({
  333. url: "/wf/cancel/".concat(wfInsId),
  334. method: 'GET'
  335. });
  336. }
  337. /***/ }),
  338. /***/ 126:
  339. /*!***********************************************************************!*\
  340. !*** E:/work/Project_newGit/hptwxMiniProgram/api/system/dangerApi.js ***!
  341. \***********************************************************************/
  342. /*! no static exports found */
  343. /***/ (function(module, exports, __webpack_require__) {
  344. "use strict";
  345. Object.defineProperty(exports, "__esModule", {
  346. value: true
  347. });
  348. exports.deleteDangerById = deleteDangerById;
  349. exports.getDangerById = getDangerById;
  350. exports.getDangerByList = getDangerByList;
  351. exports.getDangerByPage = getDangerByPage;
  352. exports.handleDanger = handleDanger;
  353. var _request = __webpack_require__(/*! @/utils/request.js */ 41);
  354. /**
  355. * 获取Danger列表
  356. * @param data
  357. * @returns
  358. */
  359. function getDangerByList(data) {
  360. return (0, _request.request)({
  361. url: '/danger',
  362. method: 'GET',
  363. params: data
  364. });
  365. }
  366. /**
  367. * 获取Danger分页
  368. * @param data
  369. * @returns
  370. */
  371. function getDangerByPage(data) {
  372. return (0, _request.request)({
  373. url: '/danger/page',
  374. method: 'GET',
  375. params: data
  376. });
  377. }
  378. /**
  379. * 根据Id获取Danger
  380. * @param dangerId
  381. * @returns
  382. */
  383. function getDangerById(dangerId) {
  384. return (0, _request.request)({
  385. url: "/danger/".concat(dangerId),
  386. method: 'GET'
  387. });
  388. }
  389. /**
  390. * 删除Danger
  391. * @param dangerId
  392. * @returns
  393. */
  394. function deleteDangerById(dangerId) {
  395. return (0, _request.request)({
  396. url: "/danger/".concat(dangerId),
  397. method: 'DELETE'
  398. });
  399. }
  400. /**
  401. * 处理Danger
  402. * @param data
  403. * @returns
  404. */
  405. function handleDanger(data) {
  406. return (0, _request.request)({
  407. url: "/danger/handle",
  408. method: 'POST',
  409. data: data
  410. });
  411. }
  412. /***/ }),
  413. /***/ 127:
  414. /*!********************************************************************!*\
  415. !*** E:/work/Project_newGit/hptwxMiniProgram/api/system/upload.js ***!
  416. \********************************************************************/
  417. /*! no static exports found */
  418. /***/ (function(module, exports, __webpack_require__) {
  419. "use strict";
  420. /* WEBPACK VAR INJECTION */(function(uni) {
  421. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  422. Object.defineProperty(exports, "__esModule", {
  423. value: true
  424. });
  425. exports.upload = void 0;
  426. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  427. var _auth = __webpack_require__(/*! @/utils/auth.js */ 46);
  428. var _index = _interopRequireDefault(__webpack_require__(/*! @/config/index.js */ 45));
  429. var baseUrl = true ? _index.default.base.dev : undefined;
  430. var upload = function upload(_ref) {
  431. var formData = _ref.formData,
  432. filePath = _ref.filePath,
  433. callback = _ref.callback;
  434. uni.showLoading({
  435. mask: true,
  436. title: "上传中"
  437. });
  438. return new Promise(function (resolve, reject) {
  439. var _header;
  440. var uploadTask = uni.uploadFile({
  441. url: baseUrl + '/upload/file',
  442. filePath: filePath,
  443. header: (_header = {}, (0, _defineProperty2.default)(_header, _index.default.TokenKey, (0, _auth.getToken)()), (0, _defineProperty2.default)(_header, "AppID", _index.default.appID), (0, _defineProperty2.default)(_header, "AppKey", _index.default.appKey), (0, _defineProperty2.default)(_header, "AppSecret", _index.default.appSecret), _header),
  444. name: 'file',
  445. formData: formData,
  446. success: function success(uploadFileRes) {
  447. uni.hideLoading();
  448. resolve(uploadFileRes.data);
  449. },
  450. fail: function fail(_ref2) {
  451. var errMsg = _ref2.errMsg;
  452. uni.hideLoading({
  453. mask: true,
  454. title: "上传失败"
  455. });
  456. reject(errMsg);
  457. }
  458. });
  459. if (callback) {
  460. callback(uploadTask);
  461. }
  462. });
  463. };
  464. exports.upload = upload;
  465. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  466. /***/ }),
  467. /***/ 13:
  468. /*!*******************************************************!*\
  469. !*** ./node_modules/@babel/runtime/helpers/typeof.js ***!
  470. \*******************************************************/
  471. /*! no static exports found */
  472. /***/ (function(module, exports) {
  473. function _typeof(obj) {
  474. "@babel/helpers - typeof";
  475. return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
  476. return typeof obj;
  477. } : function (obj) {
  478. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  479. }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
  480. }
  481. module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
  482. /***/ }),
  483. /***/ 14:
  484. /*!************************************************************!*\
  485. !*** ./node_modules/@babel/runtime/helpers/toPrimitive.js ***!
  486. \************************************************************/
  487. /*! no static exports found */
  488. /***/ (function(module, exports, __webpack_require__) {
  489. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  490. function _toPrimitive(input, hint) {
  491. if (_typeof(input) !== "object" || input === null) return input;
  492. var prim = input[Symbol.toPrimitive];
  493. if (prim !== undefined) {
  494. var res = prim.call(input, hint || "default");
  495. if (_typeof(res) !== "object") return res;
  496. throw new TypeError("@@toPrimitive must return a primitive value.");
  497. }
  498. return (hint === "string" ? String : Number)(input);
  499. }
  500. module.exports = _toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
  501. /***/ }),
  502. /***/ 15:
  503. /*!**********************************************************!*\
  504. !*** ./node_modules/@babel/runtime/helpers/construct.js ***!
  505. \**********************************************************/
  506. /*! no static exports found */
  507. /***/ (function(module, exports, __webpack_require__) {
  508. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  509. var isNativeReflectConstruct = __webpack_require__(/*! ./isNativeReflectConstruct.js */ 17);
  510. function _construct(Parent, args, Class) {
  511. if (isNativeReflectConstruct()) {
  512. module.exports = _construct = Reflect.construct.bind(), module.exports.__esModule = true, module.exports["default"] = module.exports;
  513. } else {
  514. module.exports = _construct = function _construct(Parent, args, Class) {
  515. var a = [null];
  516. a.push.apply(a, args);
  517. var Constructor = Function.bind.apply(Parent, a);
  518. var instance = new Constructor();
  519. if (Class) setPrototypeOf(instance, Class.prototype);
  520. return instance;
  521. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  522. }
  523. return _construct.apply(null, arguments);
  524. }
  525. module.exports = _construct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  526. /***/ }),
  527. /***/ 16:
  528. /*!***************************************************************!*\
  529. !*** ./node_modules/@babel/runtime/helpers/setPrototypeOf.js ***!
  530. \***************************************************************/
  531. /*! no static exports found */
  532. /***/ (function(module, exports) {
  533. function _setPrototypeOf(o, p) {
  534. module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
  535. o.__proto__ = p;
  536. return o;
  537. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  538. return _setPrototypeOf(o, p);
  539. }
  540. module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
  541. /***/ }),
  542. /***/ 17:
  543. /*!*************************************************************************!*\
  544. !*** ./node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js ***!
  545. \*************************************************************************/
  546. /*! no static exports found */
  547. /***/ (function(module, exports) {
  548. function _isNativeReflectConstruct() {
  549. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  550. if (Reflect.construct.sham) return false;
  551. if (typeof Proxy === "function") return true;
  552. try {
  553. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  554. return true;
  555. } catch (e) {
  556. return false;
  557. }
  558. }
  559. module.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports["default"] = module.exports;
  560. /***/ }),
  561. /***/ 171:
  562. /*!******************************************************************************************************!*\
  563. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-forms/components/uni-forms/validate.js ***!
  564. \******************************************************************************************************/
  565. /*! no static exports found */
  566. /***/ (function(module, exports, __webpack_require__) {
  567. "use strict";
  568. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  569. Object.defineProperty(exports, "__esModule", {
  570. value: true
  571. });
  572. exports.default = void 0;
  573. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 42));
  574. var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ 172));
  575. var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ 173));
  576. var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ 175));
  577. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 44));
  578. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  579. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  580. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  581. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
  582. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  583. var pattern = {
  584. email: /^\S+?@\S+?\.\S+?$/,
  585. 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]$/,
  586. url: new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$", 'i')
  587. };
  588. var FORMAT_MAPPING = {
  589. "int": 'integer',
  590. "bool": 'boolean',
  591. "double": 'number',
  592. "long": 'number',
  593. "password": 'string'
  594. // "fileurls": 'array'
  595. };
  596. function formatMessage(args) {
  597. var resources = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
  598. var defaultMessage = ['label'];
  599. defaultMessage.forEach(function (item) {
  600. if (args[item] === undefined) {
  601. args[item] = '';
  602. }
  603. });
  604. var str = resources;
  605. for (var key in args) {
  606. var reg = new RegExp('{' + key + '}');
  607. str = str.replace(reg, args[key]);
  608. }
  609. return str;
  610. }
  611. function isEmptyValue(value, type) {
  612. if (value === undefined || value === null) {
  613. return true;
  614. }
  615. if (typeof value === 'string' && !value) {
  616. return true;
  617. }
  618. if (Array.isArray(value) && !value.length) {
  619. return true;
  620. }
  621. if (type === 'object' && !Object.keys(value).length) {
  622. return true;
  623. }
  624. return false;
  625. }
  626. var types = {
  627. integer: function integer(value) {
  628. return types.number(value) && parseInt(value, 10) === value;
  629. },
  630. string: function string(value) {
  631. return typeof value === 'string';
  632. },
  633. number: function number(value) {
  634. if (isNaN(value)) {
  635. return false;
  636. }
  637. return typeof value === 'number';
  638. },
  639. "boolean": function boolean(value) {
  640. return typeof value === 'boolean';
  641. },
  642. "float": function float(value) {
  643. return types.number(value) && !types.integer(value);
  644. },
  645. array: function array(value) {
  646. return Array.isArray(value);
  647. },
  648. object: function object(value) {
  649. return (0, _typeof2.default)(value) === 'object' && !types.array(value);
  650. },
  651. date: function date(value) {
  652. return value instanceof Date;
  653. },
  654. timestamp: function timestamp(value) {
  655. if (!this.integer(value) || Math.abs(value).toString().length > 16) {
  656. return false;
  657. }
  658. return true;
  659. },
  660. file: function file(value) {
  661. return typeof value.url === 'string';
  662. },
  663. email: function email(value) {
  664. return typeof value === 'string' && !!value.match(pattern.email) && value.length < 255;
  665. },
  666. url: function url(value) {
  667. return typeof value === 'string' && !!value.match(pattern.url);
  668. },
  669. pattern: function pattern(reg, value) {
  670. try {
  671. return new RegExp(reg).test(value);
  672. } catch (e) {
  673. return false;
  674. }
  675. },
  676. method: function method(value) {
  677. return typeof value === 'function';
  678. },
  679. idcard: function idcard(value) {
  680. return typeof value === 'string' && !!value.match(pattern.idcard);
  681. },
  682. 'url-https': function urlHttps(value) {
  683. return this.url(value) && value.startsWith('https://');
  684. },
  685. 'url-scheme': function urlScheme(value) {
  686. return value.startsWith('://');
  687. },
  688. 'url-web': function urlWeb(value) {
  689. return false;
  690. }
  691. };
  692. var RuleValidator = /*#__PURE__*/function () {
  693. function RuleValidator(message) {
  694. (0, _classCallCheck2.default)(this, RuleValidator);
  695. this._message = message;
  696. }
  697. (0, _createClass2.default)(RuleValidator, [{
  698. key: "validateRule",
  699. value: function () {
  700. var _validateRule = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(fieldKey, fieldValue, value, data, allData) {
  701. var result, rules, hasRequired, message, i, rule, vt, now, resultExpr;
  702. return _regenerator.default.wrap(function _callee$(_context) {
  703. while (1) {
  704. switch (_context.prev = _context.next) {
  705. case 0:
  706. result = null;
  707. rules = fieldValue.rules;
  708. hasRequired = rules.findIndex(function (item) {
  709. return item.required;
  710. });
  711. if (!(hasRequired < 0)) {
  712. _context.next = 8;
  713. break;
  714. }
  715. if (!(value === null || value === undefined)) {
  716. _context.next = 6;
  717. break;
  718. }
  719. return _context.abrupt("return", result);
  720. case 6:
  721. if (!(typeof value === 'string' && !value.length)) {
  722. _context.next = 8;
  723. break;
  724. }
  725. return _context.abrupt("return", result);
  726. case 8:
  727. message = this._message;
  728. if (!(rules === undefined)) {
  729. _context.next = 11;
  730. break;
  731. }
  732. return _context.abrupt("return", message['default']);
  733. case 11:
  734. i = 0;
  735. case 12:
  736. if (!(i < rules.length)) {
  737. _context.next = 35;
  738. break;
  739. }
  740. rule = rules[i];
  741. vt = this._getValidateType(rule);
  742. Object.assign(rule, {
  743. label: fieldValue.label || "[\"".concat(fieldKey, "\"]")
  744. });
  745. if (!RuleValidatorHelper[vt]) {
  746. _context.next = 20;
  747. break;
  748. }
  749. result = RuleValidatorHelper[vt](rule, value, message);
  750. if (!(result != null)) {
  751. _context.next = 20;
  752. break;
  753. }
  754. return _context.abrupt("break", 35);
  755. case 20:
  756. if (!rule.validateExpr) {
  757. _context.next = 26;
  758. break;
  759. }
  760. now = Date.now();
  761. resultExpr = rule.validateExpr(value, allData, now);
  762. if (!(resultExpr === false)) {
  763. _context.next = 26;
  764. break;
  765. }
  766. result = this._getMessage(rule, rule.errorMessage || this._message['default']);
  767. return _context.abrupt("break", 35);
  768. case 26:
  769. if (!rule.validateFunction) {
  770. _context.next = 32;
  771. break;
  772. }
  773. _context.next = 29;
  774. return this.validateFunction(rule, value, data, allData, vt);
  775. case 29:
  776. result = _context.sent;
  777. if (!(result !== null)) {
  778. _context.next = 32;
  779. break;
  780. }
  781. return _context.abrupt("break", 35);
  782. case 32:
  783. i++;
  784. _context.next = 12;
  785. break;
  786. case 35:
  787. if (result !== null) {
  788. result = message.TAG + result;
  789. }
  790. return _context.abrupt("return", result);
  791. case 37:
  792. case "end":
  793. return _context.stop();
  794. }
  795. }
  796. }, _callee, this);
  797. }));
  798. function validateRule(_x, _x2, _x3, _x4, _x5) {
  799. return _validateRule.apply(this, arguments);
  800. }
  801. return validateRule;
  802. }()
  803. }, {
  804. key: "validateFunction",
  805. value: function () {
  806. var _validateFunction = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(rule, value, data, allData, vt) {
  807. var result, callbackMessage, res;
  808. return _regenerator.default.wrap(function _callee2$(_context2) {
  809. while (1) {
  810. switch (_context2.prev = _context2.next) {
  811. case 0:
  812. result = null;
  813. _context2.prev = 1;
  814. callbackMessage = null;
  815. _context2.next = 5;
  816. return rule.validateFunction(rule, value, allData || data, function (message) {
  817. callbackMessage = message;
  818. });
  819. case 5:
  820. res = _context2.sent;
  821. if (callbackMessage || typeof res === 'string' && res || res === false) {
  822. result = this._getMessage(rule, callbackMessage || res, vt);
  823. }
  824. _context2.next = 12;
  825. break;
  826. case 9:
  827. _context2.prev = 9;
  828. _context2.t0 = _context2["catch"](1);
  829. result = this._getMessage(rule, _context2.t0.message, vt);
  830. case 12:
  831. return _context2.abrupt("return", result);
  832. case 13:
  833. case "end":
  834. return _context2.stop();
  835. }
  836. }
  837. }, _callee2, this, [[1, 9]]);
  838. }));
  839. function validateFunction(_x6, _x7, _x8, _x9, _x10) {
  840. return _validateFunction.apply(this, arguments);
  841. }
  842. return validateFunction;
  843. }()
  844. }, {
  845. key: "_getMessage",
  846. value: function _getMessage(rule, message, vt) {
  847. return formatMessage(rule, message || rule.errorMessage || this._message[vt] || message['default']);
  848. }
  849. }, {
  850. key: "_getValidateType",
  851. value: function _getValidateType(rule) {
  852. var result = '';
  853. if (rule.required) {
  854. result = 'required';
  855. } else if (rule.format) {
  856. result = 'format';
  857. } else if (rule.arrayType) {
  858. result = 'arrayTypeFormat';
  859. } else if (rule.range) {
  860. result = 'range';
  861. } else if (rule.maximum !== undefined || rule.minimum !== undefined) {
  862. result = 'rangeNumber';
  863. } else if (rule.maxLength !== undefined || rule.minLength !== undefined) {
  864. result = 'rangeLength';
  865. } else if (rule.pattern) {
  866. result = 'pattern';
  867. } else if (rule.validateFunction) {
  868. result = 'validateFunction';
  869. }
  870. return result;
  871. }
  872. }]);
  873. return RuleValidator;
  874. }();
  875. var RuleValidatorHelper = {
  876. required: function required(rule, value, message) {
  877. if (rule.required && isEmptyValue(value, rule.format || (0, _typeof2.default)(value))) {
  878. return formatMessage(rule, rule.errorMessage || message.required);
  879. }
  880. return null;
  881. },
  882. range: function range(rule, value, message) {
  883. var range = rule.range,
  884. errorMessage = rule.errorMessage;
  885. var list = new Array(range.length);
  886. for (var i = 0; i < range.length; i++) {
  887. var item = range[i];
  888. if (types.object(item) && item.value !== undefined) {
  889. list[i] = item.value;
  890. } else {
  891. list[i] = item;
  892. }
  893. }
  894. var result = false;
  895. if (Array.isArray(value)) {
  896. result = new Set(value.concat(list)).size === list.length;
  897. } else {
  898. if (list.indexOf(value) > -1) {
  899. result = true;
  900. }
  901. }
  902. if (!result) {
  903. return formatMessage(rule, errorMessage || message['enum']);
  904. }
  905. return null;
  906. },
  907. rangeNumber: function rangeNumber(rule, value, message) {
  908. if (!types.number(value)) {
  909. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  910. }
  911. var minimum = rule.minimum,
  912. maximum = rule.maximum,
  913. exclusiveMinimum = rule.exclusiveMinimum,
  914. exclusiveMaximum = rule.exclusiveMaximum;
  915. var min = exclusiveMinimum ? value <= minimum : value < minimum;
  916. var max = exclusiveMaximum ? value >= maximum : value > maximum;
  917. if (minimum !== undefined && min) {
  918. return formatMessage(rule, rule.errorMessage || message['number'][exclusiveMinimum ? 'exclusiveMinimum' : 'minimum']);
  919. } else if (maximum !== undefined && max) {
  920. return formatMessage(rule, rule.errorMessage || message['number'][exclusiveMaximum ? 'exclusiveMaximum' : 'maximum']);
  921. } else if (minimum !== undefined && maximum !== undefined && (min || max)) {
  922. return formatMessage(rule, rule.errorMessage || message['number'].range);
  923. }
  924. return null;
  925. },
  926. rangeLength: function rangeLength(rule, value, message) {
  927. if (!types.string(value) && !types.array(value)) {
  928. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  929. }
  930. var min = rule.minLength;
  931. var max = rule.maxLength;
  932. var val = value.length;
  933. if (min !== undefined && val < min) {
  934. return formatMessage(rule, rule.errorMessage || message['length'].minLength);
  935. } else if (max !== undefined && val > max) {
  936. return formatMessage(rule, rule.errorMessage || message['length'].maxLength);
  937. } else if (min !== undefined && max !== undefined && (val < min || val > max)) {
  938. return formatMessage(rule, rule.errorMessage || message['length'].range);
  939. }
  940. return null;
  941. },
  942. pattern: function pattern(rule, value, message) {
  943. if (!types['pattern'](rule.pattern, value)) {
  944. return formatMessage(rule, rule.errorMessage || message.pattern.mismatch);
  945. }
  946. return null;
  947. },
  948. format: function format(rule, value, message) {
  949. var customTypes = Object.keys(types);
  950. var format = FORMAT_MAPPING[rule.format] ? FORMAT_MAPPING[rule.format] : rule.format || rule.arrayType;
  951. if (customTypes.indexOf(format) > -1) {
  952. if (!types[format](value)) {
  953. return formatMessage(rule, rule.errorMessage || message.typeError);
  954. }
  955. }
  956. return null;
  957. },
  958. arrayTypeFormat: function arrayTypeFormat(rule, value, message) {
  959. if (!Array.isArray(value)) {
  960. return formatMessage(rule, rule.errorMessage || message.typeError);
  961. }
  962. for (var i = 0; i < value.length; i++) {
  963. var element = value[i];
  964. var formatResult = this.format(rule, element, message);
  965. if (formatResult !== null) {
  966. return formatResult;
  967. }
  968. }
  969. return null;
  970. }
  971. };
  972. var SchemaValidator = /*#__PURE__*/function (_RuleValidator) {
  973. (0, _inherits2.default)(SchemaValidator, _RuleValidator);
  974. var _super = _createSuper(SchemaValidator);
  975. function SchemaValidator(schema, options) {
  976. var _this;
  977. (0, _classCallCheck2.default)(this, SchemaValidator);
  978. _this = _super.call(this, SchemaValidator.message);
  979. _this._schema = schema;
  980. _this._options = options || null;
  981. return _this;
  982. }
  983. (0, _createClass2.default)(SchemaValidator, [{
  984. key: "updateSchema",
  985. value: function updateSchema(schema) {
  986. this._schema = schema;
  987. }
  988. }, {
  989. key: "validate",
  990. value: function () {
  991. var _validate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(data, allData) {
  992. var result;
  993. return _regenerator.default.wrap(function _callee3$(_context3) {
  994. while (1) {
  995. switch (_context3.prev = _context3.next) {
  996. case 0:
  997. result = this._checkFieldInSchema(data);
  998. if (result) {
  999. _context3.next = 5;
  1000. break;
  1001. }
  1002. _context3.next = 4;
  1003. return this.invokeValidate(data, false, allData);
  1004. case 4:
  1005. result = _context3.sent;
  1006. case 5:
  1007. return _context3.abrupt("return", result.length ? result[0] : null);
  1008. case 6:
  1009. case "end":
  1010. return _context3.stop();
  1011. }
  1012. }
  1013. }, _callee3, this);
  1014. }));
  1015. function validate(_x11, _x12) {
  1016. return _validate.apply(this, arguments);
  1017. }
  1018. return validate;
  1019. }()
  1020. }, {
  1021. key: "validateAll",
  1022. value: function () {
  1023. var _validateAll = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(data, allData) {
  1024. var result;
  1025. return _regenerator.default.wrap(function _callee4$(_context4) {
  1026. while (1) {
  1027. switch (_context4.prev = _context4.next) {
  1028. case 0:
  1029. result = this._checkFieldInSchema(data);
  1030. if (result) {
  1031. _context4.next = 5;
  1032. break;
  1033. }
  1034. _context4.next = 4;
  1035. return this.invokeValidate(data, true, allData);
  1036. case 4:
  1037. result = _context4.sent;
  1038. case 5:
  1039. return _context4.abrupt("return", result);
  1040. case 6:
  1041. case "end":
  1042. return _context4.stop();
  1043. }
  1044. }
  1045. }, _callee4, this);
  1046. }));
  1047. function validateAll(_x13, _x14) {
  1048. return _validateAll.apply(this, arguments);
  1049. }
  1050. return validateAll;
  1051. }()
  1052. }, {
  1053. key: "validateUpdate",
  1054. value: function () {
  1055. var _validateUpdate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(data, allData) {
  1056. var result;
  1057. return _regenerator.default.wrap(function _callee5$(_context5) {
  1058. while (1) {
  1059. switch (_context5.prev = _context5.next) {
  1060. case 0:
  1061. result = this._checkFieldInSchema(data);
  1062. if (result) {
  1063. _context5.next = 5;
  1064. break;
  1065. }
  1066. _context5.next = 4;
  1067. return this.invokeValidateUpdate(data, false, allData);
  1068. case 4:
  1069. result = _context5.sent;
  1070. case 5:
  1071. return _context5.abrupt("return", result.length ? result[0] : null);
  1072. case 6:
  1073. case "end":
  1074. return _context5.stop();
  1075. }
  1076. }
  1077. }, _callee5, this);
  1078. }));
  1079. function validateUpdate(_x15, _x16) {
  1080. return _validateUpdate.apply(this, arguments);
  1081. }
  1082. return validateUpdate;
  1083. }()
  1084. }, {
  1085. key: "invokeValidate",
  1086. value: function () {
  1087. var _invokeValidate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(data, all, allData) {
  1088. var result, schema, key, value, errorMessage;
  1089. return _regenerator.default.wrap(function _callee6$(_context6) {
  1090. while (1) {
  1091. switch (_context6.prev = _context6.next) {
  1092. case 0:
  1093. result = [];
  1094. schema = this._schema;
  1095. _context6.t0 = _regenerator.default.keys(schema);
  1096. case 3:
  1097. if ((_context6.t1 = _context6.t0()).done) {
  1098. _context6.next = 15;
  1099. break;
  1100. }
  1101. key = _context6.t1.value;
  1102. value = schema[key];
  1103. _context6.next = 8;
  1104. return this.validateRule(key, value, data[key], data, allData);
  1105. case 8:
  1106. errorMessage = _context6.sent;
  1107. if (!(errorMessage != null)) {
  1108. _context6.next = 13;
  1109. break;
  1110. }
  1111. result.push({
  1112. key: key,
  1113. errorMessage: errorMessage
  1114. });
  1115. if (all) {
  1116. _context6.next = 13;
  1117. break;
  1118. }
  1119. return _context6.abrupt("break", 15);
  1120. case 13:
  1121. _context6.next = 3;
  1122. break;
  1123. case 15:
  1124. return _context6.abrupt("return", result);
  1125. case 16:
  1126. case "end":
  1127. return _context6.stop();
  1128. }
  1129. }
  1130. }, _callee6, this);
  1131. }));
  1132. function invokeValidate(_x17, _x18, _x19) {
  1133. return _invokeValidate.apply(this, arguments);
  1134. }
  1135. return invokeValidate;
  1136. }()
  1137. }, {
  1138. key: "invokeValidateUpdate",
  1139. value: function () {
  1140. var _invokeValidateUpdate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(data, all, allData) {
  1141. var result, key, errorMessage;
  1142. return _regenerator.default.wrap(function _callee7$(_context7) {
  1143. while (1) {
  1144. switch (_context7.prev = _context7.next) {
  1145. case 0:
  1146. result = [];
  1147. _context7.t0 = _regenerator.default.keys(data);
  1148. case 2:
  1149. if ((_context7.t1 = _context7.t0()).done) {
  1150. _context7.next = 13;
  1151. break;
  1152. }
  1153. key = _context7.t1.value;
  1154. _context7.next = 6;
  1155. return this.validateRule(key, this._schema[key], data[key], data, allData);
  1156. case 6:
  1157. errorMessage = _context7.sent;
  1158. if (!(errorMessage != null)) {
  1159. _context7.next = 11;
  1160. break;
  1161. }
  1162. result.push({
  1163. key: key,
  1164. errorMessage: errorMessage
  1165. });
  1166. if (all) {
  1167. _context7.next = 11;
  1168. break;
  1169. }
  1170. return _context7.abrupt("break", 13);
  1171. case 11:
  1172. _context7.next = 2;
  1173. break;
  1174. case 13:
  1175. return _context7.abrupt("return", result);
  1176. case 14:
  1177. case "end":
  1178. return _context7.stop();
  1179. }
  1180. }
  1181. }, _callee7, this);
  1182. }));
  1183. function invokeValidateUpdate(_x20, _x21, _x22) {
  1184. return _invokeValidateUpdate.apply(this, arguments);
  1185. }
  1186. return invokeValidateUpdate;
  1187. }()
  1188. }, {
  1189. key: "_checkFieldInSchema",
  1190. value: function _checkFieldInSchema(data) {
  1191. var keys = Object.keys(data);
  1192. var keys2 = Object.keys(this._schema);
  1193. if (new Set(keys.concat(keys2)).size === keys2.length) {
  1194. return '';
  1195. }
  1196. var noExistFields = keys.filter(function (key) {
  1197. return keys2.indexOf(key) < 0;
  1198. });
  1199. var errorMessage = formatMessage({
  1200. field: JSON.stringify(noExistFields)
  1201. }, SchemaValidator.message.TAG + SchemaValidator.message['defaultInvalid']);
  1202. return [{
  1203. key: 'invalid',
  1204. errorMessage: errorMessage
  1205. }];
  1206. }
  1207. }]);
  1208. return SchemaValidator;
  1209. }(RuleValidator);
  1210. function Message() {
  1211. return {
  1212. TAG: "",
  1213. default: '验证错误',
  1214. defaultInvalid: '提交的字段{field}在数据库中并不存在',
  1215. validateFunction: '验证无效',
  1216. required: '{label}必填',
  1217. 'enum': '{label}超出范围',
  1218. timestamp: '{label}格式无效',
  1219. whitespace: '{label}不能为空',
  1220. typeError: '{label}类型无效',
  1221. date: {
  1222. format: '{label}日期{value}格式无效',
  1223. parse: '{label}日期无法解析,{value}无效',
  1224. invalid: '{label}日期{value}无效'
  1225. },
  1226. length: {
  1227. minLength: '{label}长度不能少于{minLength}',
  1228. maxLength: '{label}长度不能超过{maxLength}',
  1229. range: '{label}必须介于{minLength}和{maxLength}之间'
  1230. },
  1231. number: {
  1232. minimum: '{label}不能小于{minimum}',
  1233. maximum: '{label}不能大于{maximum}',
  1234. exclusiveMinimum: '{label}不能小于等于{minimum}',
  1235. exclusiveMaximum: '{label}不能大于等于{maximum}',
  1236. range: '{label}必须介于{minimum}and{maximum}之间'
  1237. },
  1238. pattern: {
  1239. mismatch: '{label}格式不匹配'
  1240. }
  1241. };
  1242. }
  1243. SchemaValidator.message = new Message();
  1244. var _default = SchemaValidator;
  1245. exports.default = _default;
  1246. /***/ }),
  1247. /***/ 172:
  1248. /*!*********************************************************!*\
  1249. !*** ./node_modules/@babel/runtime/helpers/inherits.js ***!
  1250. \*********************************************************/
  1251. /*! no static exports found */
  1252. /***/ (function(module, exports, __webpack_require__) {
  1253. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  1254. function _inherits(subClass, superClass) {
  1255. if (typeof superClass !== "function" && superClass !== null) {
  1256. throw new TypeError("Super expression must either be null or a function");
  1257. }
  1258. subClass.prototype = Object.create(superClass && superClass.prototype, {
  1259. constructor: {
  1260. value: subClass,
  1261. writable: true,
  1262. configurable: true
  1263. }
  1264. });
  1265. Object.defineProperty(subClass, "prototype", {
  1266. writable: false
  1267. });
  1268. if (superClass) setPrototypeOf(subClass, superClass);
  1269. }
  1270. module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1271. /***/ }),
  1272. /***/ 173:
  1273. /*!**************************************************************************!*\
  1274. !*** ./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js ***!
  1275. \**************************************************************************/
  1276. /*! no static exports found */
  1277. /***/ (function(module, exports, __webpack_require__) {
  1278. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  1279. var assertThisInitialized = __webpack_require__(/*! ./assertThisInitialized.js */ 174);
  1280. function _possibleConstructorReturn(self, call) {
  1281. if (call && (_typeof(call) === "object" || typeof call === "function")) {
  1282. return call;
  1283. } else if (call !== void 0) {
  1284. throw new TypeError("Derived constructors may only return object or undefined");
  1285. }
  1286. return assertThisInitialized(self);
  1287. }
  1288. module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1289. /***/ }),
  1290. /***/ 174:
  1291. /*!**********************************************************************!*\
  1292. !*** ./node_modules/@babel/runtime/helpers/assertThisInitialized.js ***!
  1293. \**********************************************************************/
  1294. /*! no static exports found */
  1295. /***/ (function(module, exports) {
  1296. function _assertThisInitialized(self) {
  1297. if (self === void 0) {
  1298. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  1299. }
  1300. return self;
  1301. }
  1302. module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1303. /***/ }),
  1304. /***/ 175:
  1305. /*!***************************************************************!*\
  1306. !*** ./node_modules/@babel/runtime/helpers/getPrototypeOf.js ***!
  1307. \***************************************************************/
  1308. /*! no static exports found */
  1309. /***/ (function(module, exports) {
  1310. function _getPrototypeOf(o) {
  1311. module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
  1312. return o.__proto__ || Object.getPrototypeOf(o);
  1313. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1314. return _getPrototypeOf(o);
  1315. }
  1316. module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1317. /***/ }),
  1318. /***/ 176:
  1319. /*!***************************************************************************************************!*\
  1320. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-forms/components/uni-forms/utils.js ***!
  1321. \***************************************************************************************************/
  1322. /*! no static exports found */
  1323. /***/ (function(module, exports, __webpack_require__) {
  1324. "use strict";
  1325. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  1326. Object.defineProperty(exports, "__esModule", {
  1327. value: true
  1328. });
  1329. exports.typeFilter = exports.type = exports.setDataValue = exports.realName = exports.rawData = exports.objSet = exports.objGet = exports.name2arr = exports.isRequiredField = exports.isRealName = exports.isNumber = exports.isEqual = exports.isBoolean = exports.getValue = exports.getDataValueType = exports.getDataValue = exports.deepCopy = void 0;
  1330. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  1331. /**
  1332. * 简单处理对象拷贝
  1333. * @param {Obejct} 被拷贝对象
  1334. * @@return {Object} 拷贝对象
  1335. */
  1336. var deepCopy = function deepCopy(val) {
  1337. return JSON.parse(JSON.stringify(val));
  1338. };
  1339. /**
  1340. * 过滤数字类型
  1341. * @param {String} format 数字类型
  1342. * @@return {Boolean} 返回是否为数字类型
  1343. */
  1344. exports.deepCopy = deepCopy;
  1345. var typeFilter = function typeFilter(format) {
  1346. return format === 'int' || format === 'double' || format === 'number' || format === 'timestamp';
  1347. };
  1348. /**
  1349. * 把 value 转换成指定的类型,用于处理初始值,原因是初始值需要入库不能为 undefined
  1350. * @param {String} key 字段名
  1351. * @param {any} value 字段值
  1352. * @param {Object} rules 表单校验规则
  1353. */
  1354. exports.typeFilter = typeFilter;
  1355. var getValue = function getValue(key, value, rules) {
  1356. var isRuleNumType = rules.find(function (val) {
  1357. return val.format && typeFilter(val.format);
  1358. });
  1359. var isRuleBoolType = rules.find(function (val) {
  1360. return val.format && val.format === 'boolean' || val.format === 'bool';
  1361. });
  1362. // 输入类型为 number
  1363. if (!!isRuleNumType) {
  1364. if (!value && value !== 0) {
  1365. value = null;
  1366. } else {
  1367. value = isNumber(Number(value)) ? Number(value) : value;
  1368. }
  1369. }
  1370. // 输入类型为 boolean
  1371. if (!!isRuleBoolType) {
  1372. value = isBoolean(value) ? value : false;
  1373. }
  1374. return value;
  1375. };
  1376. /**
  1377. * 获取表单数据
  1378. * @param {String|Array} name 真实名称,需要使用 realName 获取
  1379. * @param {Object} data 原始数据
  1380. * @param {any} value 需要设置的值
  1381. */
  1382. exports.getValue = getValue;
  1383. var setDataValue = function setDataValue(field, formdata, value) {
  1384. formdata[field] = value;
  1385. return value || '';
  1386. };
  1387. /**
  1388. * 获取表单数据
  1389. * @param {String|Array} field 真实名称,需要使用 realName 获取
  1390. * @param {Object} data 原始数据
  1391. */
  1392. exports.setDataValue = setDataValue;
  1393. var getDataValue = function getDataValue(field, data) {
  1394. return objGet(data, field);
  1395. };
  1396. /**
  1397. * 获取表单类型
  1398. * @param {String|Array} field 真实名称,需要使用 realName 获取
  1399. */
  1400. exports.getDataValue = getDataValue;
  1401. var getDataValueType = function getDataValueType(field, data) {
  1402. var value = getDataValue(field, data);
  1403. return {
  1404. type: type(value),
  1405. value: value
  1406. };
  1407. };
  1408. /**
  1409. * 获取表单可用的真实name
  1410. * @param {String|Array} name 表单name
  1411. * @@return {String} 表单可用的真实name
  1412. */
  1413. exports.getDataValueType = getDataValueType;
  1414. var realName = function realName(name) {
  1415. var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  1416. var base_name = _basePath(name);
  1417. if ((0, _typeof2.default)(base_name) === 'object' && Array.isArray(base_name) && base_name.length > 1) {
  1418. var realname = base_name.reduce(function (a, b) {
  1419. return a += "#".concat(b);
  1420. }, '_formdata_');
  1421. return realname;
  1422. }
  1423. return base_name[0] || name;
  1424. };
  1425. /**
  1426. * 判断是否表单可用的真实name
  1427. * @param {String|Array} name 表单name
  1428. * @@return {String} 表单可用的真实name
  1429. */
  1430. exports.realName = realName;
  1431. var isRealName = function isRealName(name) {
  1432. var reg = /^_formdata_#*/;
  1433. return reg.test(name);
  1434. };
  1435. /**
  1436. * 获取表单数据的原始格式
  1437. * @@return {Object|Array} object 需要解析的数据
  1438. */
  1439. exports.isRealName = isRealName;
  1440. var rawData = function rawData() {
  1441. var object = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  1442. var name = arguments.length > 1 ? arguments[1] : undefined;
  1443. var newData = JSON.parse(JSON.stringify(object));
  1444. var formData = {};
  1445. for (var i in newData) {
  1446. var path = name2arr(i);
  1447. objSet(formData, path, newData[i]);
  1448. }
  1449. return formData;
  1450. };
  1451. /**
  1452. * 真实name还原为 array
  1453. * @param {*} name
  1454. */
  1455. exports.rawData = rawData;
  1456. var name2arr = function name2arr(name) {
  1457. var field = name.replace('_formdata_#', '');
  1458. field = field.split('#').map(function (v) {
  1459. return isNumber(v) ? Number(v) : v;
  1460. });
  1461. return field;
  1462. };
  1463. /**
  1464. * 对象中设置值
  1465. * @param {Object|Array} object 源数据
  1466. * @param {String| Array} path 'a.b.c' 或 ['a',0,'b','c']
  1467. * @param {String} value 需要设置的值
  1468. */
  1469. exports.name2arr = name2arr;
  1470. var objSet = function objSet(object, path, value) {
  1471. if ((0, _typeof2.default)(object) !== 'object') return object;
  1472. _basePath(path).reduce(function (o, k, i, _) {
  1473. if (i === _.length - 1) {
  1474. // 若遍历结束直接赋值
  1475. o[k] = value;
  1476. return null;
  1477. } else if (k in o) {
  1478. // 若存在对应路径,则返回找到的对象,进行下一次遍历
  1479. return o[k];
  1480. } else {
  1481. // 若不存在对应路径,则创建对应对象,若下一路径是数字,新对象赋值为空数组,否则赋值为空对象
  1482. o[k] = /^[0-9]{1,}$/.test(_[i + 1]) ? [] : {};
  1483. return o[k];
  1484. }
  1485. }, object);
  1486. // 返回object
  1487. return object;
  1488. };
  1489. // 处理 path, path有三种形式:'a[0].b.c'、'a.0.b.c' 和 ['a','0','b','c'],需要统一处理成数组,便于后续使用
  1490. exports.objSet = objSet;
  1491. function _basePath(path) {
  1492. // 若是数组,则直接返回
  1493. if (Array.isArray(path)) return path;
  1494. // 若有 '[',']',则替换成将 '[' 替换成 '.',去掉 ']'
  1495. return path.replace(/\[/g, '.').replace(/\]/g, '').split('.');
  1496. }
  1497. /**
  1498. * 从对象中获取值
  1499. * @param {Object|Array} object 源数据
  1500. * @param {String| Array} path 'a.b.c' 或 ['a',0,'b','c']
  1501. * @param {String} defaultVal 如果无法从调用链中获取值的默认值
  1502. */
  1503. var objGet = function objGet(object, path) {
  1504. var defaultVal = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'undefined';
  1505. // 先将path处理成统一格式
  1506. var newPath = _basePath(path);
  1507. // 递归处理,返回最后结果
  1508. var val = newPath.reduce(function (o, k) {
  1509. return (o || {})[k];
  1510. }, object);
  1511. return !val || val !== undefined ? val : defaultVal;
  1512. };
  1513. /**
  1514. * 是否为 number 类型
  1515. * @param {any} num 需要判断的值
  1516. * @return {Boolean} 是否为 number
  1517. */
  1518. exports.objGet = objGet;
  1519. var isNumber = function isNumber(num) {
  1520. return !isNaN(Number(num));
  1521. };
  1522. /**
  1523. * 是否为 boolean 类型
  1524. * @param {any} bool 需要判断的值
  1525. * @return {Boolean} 是否为 boolean
  1526. */
  1527. exports.isNumber = isNumber;
  1528. var isBoolean = function isBoolean(bool) {
  1529. return typeof bool === 'boolean';
  1530. };
  1531. /**
  1532. * 是否有必填字段
  1533. * @param {Object} rules 规则
  1534. * @return {Boolean} 是否有必填字段
  1535. */
  1536. exports.isBoolean = isBoolean;
  1537. var isRequiredField = function isRequiredField(rules) {
  1538. var isNoField = false;
  1539. for (var i = 0; i < rules.length; i++) {
  1540. var ruleData = rules[i];
  1541. if (ruleData.required) {
  1542. isNoField = true;
  1543. break;
  1544. }
  1545. }
  1546. return isNoField;
  1547. };
  1548. /**
  1549. * 获取数据类型
  1550. * @param {Any} obj 需要获取数据类型的值
  1551. */
  1552. exports.isRequiredField = isRequiredField;
  1553. var type = function type(obj) {
  1554. var class2type = {};
  1555. // 生成class2type映射
  1556. "Boolean Number String Function Array Date RegExp Object Error".split(" ").map(function (item, index) {
  1557. class2type["[object " + item + "]"] = item.toLowerCase();
  1558. });
  1559. if (obj == null) {
  1560. return obj + "";
  1561. }
  1562. return (0, _typeof2.default)(obj) === "object" || typeof obj === "function" ? class2type[Object.prototype.toString.call(obj)] || "object" : (0, _typeof2.default)(obj);
  1563. };
  1564. /**
  1565. * 判断两个值是否相等
  1566. * @param {any} a 值
  1567. * @param {any} b 值
  1568. * @return {Boolean} 是否相等
  1569. */
  1570. exports.type = type;
  1571. var isEqual = function isEqual(a, b) {
  1572. //如果a和b本来就全等
  1573. if (a === b) {
  1574. //判断是否为0和-0
  1575. return a !== 0 || 1 / a === 1 / b;
  1576. }
  1577. //判断是否为null和undefined
  1578. if (a == null || b == null) {
  1579. return a === b;
  1580. }
  1581. //接下来判断a和b的数据类型
  1582. var classNameA = toString.call(a),
  1583. classNameB = toString.call(b);
  1584. //如果数据类型不相等,则返回false
  1585. if (classNameA !== classNameB) {
  1586. return false;
  1587. }
  1588. //如果数据类型相等,再根据不同数据类型分别判断
  1589. switch (classNameA) {
  1590. case '[object RegExp]':
  1591. case '[object String]':
  1592. //进行字符串转换比较
  1593. return '' + a === '' + b;
  1594. case '[object Number]':
  1595. //进行数字转换比较,判断是否为NaN
  1596. if (+a !== +a) {
  1597. return +b !== +b;
  1598. }
  1599. //判断是否为0或-0
  1600. return +a === 0 ? 1 / +a === 1 / b : +a === +b;
  1601. case '[object Date]':
  1602. case '[object Boolean]':
  1603. return +a === +b;
  1604. }
  1605. //如果是对象类型
  1606. if (classNameA == '[object Object]') {
  1607. //获取a和b的属性长度
  1608. var propsA = Object.getOwnPropertyNames(a),
  1609. propsB = Object.getOwnPropertyNames(b);
  1610. if (propsA.length != propsB.length) {
  1611. return false;
  1612. }
  1613. for (var i = 0; i < propsA.length; i++) {
  1614. var propName = propsA[i];
  1615. //如果对应属性对应值不相等,则返回false
  1616. if (a[propName] !== b[propName]) {
  1617. return false;
  1618. }
  1619. }
  1620. return true;
  1621. }
  1622. //如果是数组类型
  1623. if (classNameA == '[object Array]') {
  1624. if (a.toString() == b.toString()) {
  1625. return true;
  1626. }
  1627. return false;
  1628. }
  1629. };
  1630. exports.isEqual = isEqual;
  1631. /***/ }),
  1632. /***/ 18:
  1633. /*!******************************************************************!*\
  1634. !*** ./node_modules/@babel/runtime/helpers/toConsumableArray.js ***!
  1635. \******************************************************************/
  1636. /*! no static exports found */
  1637. /***/ (function(module, exports, __webpack_require__) {
  1638. var arrayWithoutHoles = __webpack_require__(/*! ./arrayWithoutHoles.js */ 19);
  1639. var iterableToArray = __webpack_require__(/*! ./iterableToArray.js */ 20);
  1640. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  1641. var nonIterableSpread = __webpack_require__(/*! ./nonIterableSpread.js */ 21);
  1642. function _toConsumableArray(arr) {
  1643. return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
  1644. }
  1645. module.exports = _toConsumableArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1646. /***/ }),
  1647. /***/ 19:
  1648. /*!******************************************************************!*\
  1649. !*** ./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js ***!
  1650. \******************************************************************/
  1651. /*! no static exports found */
  1652. /***/ (function(module, exports, __webpack_require__) {
  1653. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  1654. function _arrayWithoutHoles(arr) {
  1655. if (Array.isArray(arr)) return arrayLikeToArray(arr);
  1656. }
  1657. module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  1658. /***/ }),
  1659. /***/ 2:
  1660. /*!************************************************************!*\
  1661. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  1662. \************************************************************/
  1663. /*! no static exports found */
  1664. /***/ (function(module, exports, __webpack_require__) {
  1665. "use strict";
  1666. /* WEBPACK VAR INJECTION */(function(wx, global) {
  1667. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  1668. Object.defineProperty(exports, "__esModule", {
  1669. value: true
  1670. });
  1671. exports.createApp = createApp;
  1672. exports.createComponent = createComponent;
  1673. exports.createPage = createPage;
  1674. exports.createPlugin = createPlugin;
  1675. exports.createSubpackageApp = createSubpackageApp;
  1676. exports.default = void 0;
  1677. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  1678. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  1679. var _construct2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/construct */ 15));
  1680. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
  1681. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  1682. var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 22);
  1683. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 25));
  1684. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
  1685. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
  1686. var realAtob;
  1687. var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  1688. var b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  1689. if (typeof atob !== 'function') {
  1690. realAtob = function realAtob(str) {
  1691. str = String(str).replace(/[\t\n\f\r ]+/g, '');
  1692. if (!b64re.test(str)) {
  1693. throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  1694. }
  1695. // Adding the padding if missing, for semplicity
  1696. str += '=='.slice(2 - (str.length & 3));
  1697. var bitmap;
  1698. var result = '';
  1699. var r1;
  1700. var r2;
  1701. var i = 0;
  1702. for (; i < str.length;) {
  1703. bitmap = b64.indexOf(str.charAt(i++)) << 18 | b64.indexOf(str.charAt(i++)) << 12 | (r1 = b64.indexOf(str.charAt(i++))) << 6 | (r2 = b64.indexOf(str.charAt(i++)));
  1704. result += r1 === 64 ? String.fromCharCode(bitmap >> 16 & 255) : r2 === 64 ? String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255) : String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255);
  1705. }
  1706. return result;
  1707. };
  1708. } else {
  1709. // 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法
  1710. realAtob = atob;
  1711. }
  1712. function b64DecodeUnicode(str) {
  1713. return decodeURIComponent(realAtob(str).split('').map(function (c) {
  1714. return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
  1715. }).join(''));
  1716. }
  1717. function getCurrentUserInfo() {
  1718. var token = wx.getStorageSync('uni_id_token') || '';
  1719. var tokenArr = token.split('.');
  1720. if (!token || tokenArr.length !== 3) {
  1721. return {
  1722. uid: null,
  1723. role: [],
  1724. permission: [],
  1725. tokenExpired: 0
  1726. };
  1727. }
  1728. var userInfo;
  1729. try {
  1730. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  1731. } catch (error) {
  1732. throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message);
  1733. }
  1734. userInfo.tokenExpired = userInfo.exp * 1000;
  1735. delete userInfo.exp;
  1736. delete userInfo.iat;
  1737. return userInfo;
  1738. }
  1739. function uniIdMixin(Vue) {
  1740. Vue.prototype.uniIDHasRole = function (roleId) {
  1741. var _getCurrentUserInfo = getCurrentUserInfo(),
  1742. role = _getCurrentUserInfo.role;
  1743. return role.indexOf(roleId) > -1;
  1744. };
  1745. Vue.prototype.uniIDHasPermission = function (permissionId) {
  1746. var _getCurrentUserInfo2 = getCurrentUserInfo(),
  1747. permission = _getCurrentUserInfo2.permission;
  1748. return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1;
  1749. };
  1750. Vue.prototype.uniIDTokenValid = function () {
  1751. var _getCurrentUserInfo3 = getCurrentUserInfo(),
  1752. tokenExpired = _getCurrentUserInfo3.tokenExpired;
  1753. return tokenExpired > Date.now();
  1754. };
  1755. }
  1756. var _toString = Object.prototype.toString;
  1757. var hasOwnProperty = Object.prototype.hasOwnProperty;
  1758. function isFn(fn) {
  1759. return typeof fn === 'function';
  1760. }
  1761. function isStr(str) {
  1762. return typeof str === 'string';
  1763. }
  1764. function isObject(obj) {
  1765. return obj !== null && (0, _typeof2.default)(obj) === 'object';
  1766. }
  1767. function isPlainObject(obj) {
  1768. return _toString.call(obj) === '[object Object]';
  1769. }
  1770. function hasOwn(obj, key) {
  1771. return hasOwnProperty.call(obj, key);
  1772. }
  1773. function noop() {}
  1774. /**
  1775. * Create a cached version of a pure function.
  1776. */
  1777. function cached(fn) {
  1778. var cache = Object.create(null);
  1779. return function cachedFn(str) {
  1780. var hit = cache[str];
  1781. return hit || (cache[str] = fn(str));
  1782. };
  1783. }
  1784. /**
  1785. * Camelize a hyphen-delimited string.
  1786. */
  1787. var camelizeRE = /-(\w)/g;
  1788. var camelize = cached(function (str) {
  1789. return str.replace(camelizeRE, function (_, c) {
  1790. return c ? c.toUpperCase() : '';
  1791. });
  1792. });
  1793. function sortObject(obj) {
  1794. var sortObj = {};
  1795. if (isPlainObject(obj)) {
  1796. Object.keys(obj).sort().forEach(function (key) {
  1797. sortObj[key] = obj[key];
  1798. });
  1799. }
  1800. return !Object.keys(sortObj) ? obj : sortObj;
  1801. }
  1802. var HOOKS = ['invoke', 'success', 'fail', 'complete', 'returnValue'];
  1803. var globalInterceptors = {};
  1804. var scopedInterceptors = {};
  1805. function mergeHook(parentVal, childVal) {
  1806. var res = childVal ? parentVal ? parentVal.concat(childVal) : Array.isArray(childVal) ? childVal : [childVal] : parentVal;
  1807. return res ? dedupeHooks(res) : res;
  1808. }
  1809. function dedupeHooks(hooks) {
  1810. var res = [];
  1811. for (var i = 0; i < hooks.length; i++) {
  1812. if (res.indexOf(hooks[i]) === -1) {
  1813. res.push(hooks[i]);
  1814. }
  1815. }
  1816. return res;
  1817. }
  1818. function removeHook(hooks, hook) {
  1819. var index = hooks.indexOf(hook);
  1820. if (index !== -1) {
  1821. hooks.splice(index, 1);
  1822. }
  1823. }
  1824. function mergeInterceptorHook(interceptor, option) {
  1825. Object.keys(option).forEach(function (hook) {
  1826. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  1827. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  1828. }
  1829. });
  1830. }
  1831. function removeInterceptorHook(interceptor, option) {
  1832. if (!interceptor || !option) {
  1833. return;
  1834. }
  1835. Object.keys(option).forEach(function (hook) {
  1836. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  1837. removeHook(interceptor[hook], option[hook]);
  1838. }
  1839. });
  1840. }
  1841. function addInterceptor(method, option) {
  1842. if (typeof method === 'string' && isPlainObject(option)) {
  1843. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  1844. } else if (isPlainObject(method)) {
  1845. mergeInterceptorHook(globalInterceptors, method);
  1846. }
  1847. }
  1848. function removeInterceptor(method, option) {
  1849. if (typeof method === 'string') {
  1850. if (isPlainObject(option)) {
  1851. removeInterceptorHook(scopedInterceptors[method], option);
  1852. } else {
  1853. delete scopedInterceptors[method];
  1854. }
  1855. } else if (isPlainObject(method)) {
  1856. removeInterceptorHook(globalInterceptors, method);
  1857. }
  1858. }
  1859. function wrapperHook(hook, params) {
  1860. return function (data) {
  1861. return hook(data, params) || data;
  1862. };
  1863. }
  1864. function isPromise(obj) {
  1865. return !!obj && ((0, _typeof2.default)(obj) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  1866. }
  1867. function queue(hooks, data, params) {
  1868. var promise = false;
  1869. for (var i = 0; i < hooks.length; i++) {
  1870. var hook = hooks[i];
  1871. if (promise) {
  1872. promise = Promise.resolve(wrapperHook(hook, params));
  1873. } else {
  1874. var res = hook(data, params);
  1875. if (isPromise(res)) {
  1876. promise = Promise.resolve(res);
  1877. }
  1878. if (res === false) {
  1879. return {
  1880. then: function then() {}
  1881. };
  1882. }
  1883. }
  1884. }
  1885. return promise || {
  1886. then: function then(callback) {
  1887. return callback(data);
  1888. }
  1889. };
  1890. }
  1891. function wrapperOptions(interceptor) {
  1892. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  1893. ['success', 'fail', 'complete'].forEach(function (name) {
  1894. if (Array.isArray(interceptor[name])) {
  1895. var oldCallback = options[name];
  1896. options[name] = function callbackInterceptor(res) {
  1897. queue(interceptor[name], res, options).then(function (res) {
  1898. /* eslint-disable no-mixed-operators */
  1899. return isFn(oldCallback) && oldCallback(res) || res;
  1900. });
  1901. };
  1902. }
  1903. });
  1904. return options;
  1905. }
  1906. function wrapperReturnValue(method, returnValue) {
  1907. var returnValueHooks = [];
  1908. if (Array.isArray(globalInterceptors.returnValue)) {
  1909. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(globalInterceptors.returnValue));
  1910. }
  1911. var interceptor = scopedInterceptors[method];
  1912. if (interceptor && Array.isArray(interceptor.returnValue)) {
  1913. returnValueHooks.push.apply(returnValueHooks, (0, _toConsumableArray2.default)(interceptor.returnValue));
  1914. }
  1915. returnValueHooks.forEach(function (hook) {
  1916. returnValue = hook(returnValue) || returnValue;
  1917. });
  1918. return returnValue;
  1919. }
  1920. function getApiInterceptorHooks(method) {
  1921. var interceptor = Object.create(null);
  1922. Object.keys(globalInterceptors).forEach(function (hook) {
  1923. if (hook !== 'returnValue') {
  1924. interceptor[hook] = globalInterceptors[hook].slice();
  1925. }
  1926. });
  1927. var scopedInterceptor = scopedInterceptors[method];
  1928. if (scopedInterceptor) {
  1929. Object.keys(scopedInterceptor).forEach(function (hook) {
  1930. if (hook !== 'returnValue') {
  1931. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  1932. }
  1933. });
  1934. }
  1935. return interceptor;
  1936. }
  1937. function invokeApi(method, api, options) {
  1938. for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
  1939. params[_key - 3] = arguments[_key];
  1940. }
  1941. var interceptor = getApiInterceptorHooks(method);
  1942. if (interceptor && Object.keys(interceptor).length) {
  1943. if (Array.isArray(interceptor.invoke)) {
  1944. var res = queue(interceptor.invoke, options);
  1945. return res.then(function (options) {
  1946. // 重新访问 getApiInterceptorHooks, 允许 invoke 中再次调用 addInterceptor,removeInterceptor
  1947. return api.apply(void 0, [wrapperOptions(getApiInterceptorHooks(method), options)].concat(params));
  1948. });
  1949. } else {
  1950. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  1951. }
  1952. }
  1953. return api.apply(void 0, [options].concat(params));
  1954. }
  1955. var promiseInterceptor = {
  1956. returnValue: function returnValue(res) {
  1957. if (!isPromise(res)) {
  1958. return res;
  1959. }
  1960. return new Promise(function (resolve, reject) {
  1961. res.then(function (res) {
  1962. if (res[0]) {
  1963. reject(res[0]);
  1964. } else {
  1965. resolve(res[1]);
  1966. }
  1967. });
  1968. });
  1969. }
  1970. };
  1971. var SYNC_API_RE = /^\$|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback|getWindowInfo|getDeviceInfo|getAppBaseInfo|getSystemSetting|getAppAuthorizeSetting|initUTS|requireUTS|registerUTS/;
  1972. var CONTEXT_API_RE = /^create|Manager$/;
  1973. // Context例外情况
  1974. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  1975. // 同步例外情况
  1976. var ASYNC_API = ['createBLEConnection', 'createPushMessage'];
  1977. var CALLBACK_API_RE = /^on|^off/;
  1978. function isContextApi(name) {
  1979. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  1980. }
  1981. function isSyncApi(name) {
  1982. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  1983. }
  1984. function isCallbackApi(name) {
  1985. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  1986. }
  1987. function handlePromise(promise) {
  1988. return promise.then(function (data) {
  1989. return [null, data];
  1990. }).catch(function (err) {
  1991. return [err];
  1992. });
  1993. }
  1994. function shouldPromise(name) {
  1995. if (isContextApi(name) || isSyncApi(name) || isCallbackApi(name)) {
  1996. return false;
  1997. }
  1998. return true;
  1999. }
  2000. /* eslint-disable no-extend-native */
  2001. if (!Promise.prototype.finally) {
  2002. Promise.prototype.finally = function (callback) {
  2003. var promise = this.constructor;
  2004. return this.then(function (value) {
  2005. return promise.resolve(callback()).then(function () {
  2006. return value;
  2007. });
  2008. }, function (reason) {
  2009. return promise.resolve(callback()).then(function () {
  2010. throw reason;
  2011. });
  2012. });
  2013. };
  2014. }
  2015. function promisify(name, api) {
  2016. if (!shouldPromise(name) || !isFn(api)) {
  2017. return api;
  2018. }
  2019. return function promiseApi() {
  2020. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  2021. for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  2022. params[_key2 - 1] = arguments[_key2];
  2023. }
  2024. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  2025. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  2026. }
  2027. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  2028. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  2029. success: resolve,
  2030. fail: reject
  2031. })].concat(params));
  2032. })));
  2033. };
  2034. }
  2035. var EPS = 1e-4;
  2036. var BASE_DEVICE_WIDTH = 750;
  2037. var isIOS = false;
  2038. var deviceWidth = 0;
  2039. var deviceDPR = 0;
  2040. function checkDeviceWidth() {
  2041. var _wx$getSystemInfoSync = wx.getSystemInfoSync(),
  2042. platform = _wx$getSystemInfoSync.platform,
  2043. pixelRatio = _wx$getSystemInfoSync.pixelRatio,
  2044. windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  2045. deviceWidth = windowWidth;
  2046. deviceDPR = pixelRatio;
  2047. isIOS = platform === 'ios';
  2048. }
  2049. function upx2px(number, newDeviceWidth) {
  2050. if (deviceWidth === 0) {
  2051. checkDeviceWidth();
  2052. }
  2053. number = Number(number);
  2054. if (number === 0) {
  2055. return 0;
  2056. }
  2057. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  2058. if (result < 0) {
  2059. result = -result;
  2060. }
  2061. result = Math.floor(result + EPS);
  2062. if (result === 0) {
  2063. if (deviceDPR === 1 || !isIOS) {
  2064. result = 1;
  2065. } else {
  2066. result = 0.5;
  2067. }
  2068. }
  2069. return number < 0 ? -result : result;
  2070. }
  2071. var LOCALE_ZH_HANS = 'zh-Hans';
  2072. var LOCALE_ZH_HANT = 'zh-Hant';
  2073. var LOCALE_EN = 'en';
  2074. var LOCALE_FR = 'fr';
  2075. var LOCALE_ES = 'es';
  2076. var messages = {};
  2077. var locale;
  2078. {
  2079. locale = normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  2080. }
  2081. function initI18nMessages() {
  2082. if (!isEnableLocale()) {
  2083. return;
  2084. }
  2085. var localeKeys = Object.keys(__uniConfig.locales);
  2086. if (localeKeys.length) {
  2087. localeKeys.forEach(function (locale) {
  2088. var curMessages = messages[locale];
  2089. var userMessages = __uniConfig.locales[locale];
  2090. if (curMessages) {
  2091. Object.assign(curMessages, userMessages);
  2092. } else {
  2093. messages[locale] = userMessages;
  2094. }
  2095. });
  2096. }
  2097. }
  2098. initI18nMessages();
  2099. var i18n = (0, _uniI18n.initVueI18n)(locale, {});
  2100. var t = i18n.t;
  2101. var i18nMixin = i18n.mixin = {
  2102. beforeCreate: function beforeCreate() {
  2103. var _this = this;
  2104. var unwatch = i18n.i18n.watchLocale(function () {
  2105. _this.$forceUpdate();
  2106. });
  2107. this.$once('hook:beforeDestroy', function () {
  2108. unwatch();
  2109. });
  2110. },
  2111. methods: {
  2112. $$t: function $$t(key, values) {
  2113. return t(key, values);
  2114. }
  2115. }
  2116. };
  2117. var setLocale = i18n.setLocale;
  2118. var getLocale = i18n.getLocale;
  2119. function initAppLocale(Vue, appVm, locale) {
  2120. var state = Vue.observable({
  2121. locale: locale || i18n.getLocale()
  2122. });
  2123. var localeWatchers = [];
  2124. appVm.$watchLocale = function (fn) {
  2125. localeWatchers.push(fn);
  2126. };
  2127. Object.defineProperty(appVm, '$locale', {
  2128. get: function get() {
  2129. return state.locale;
  2130. },
  2131. set: function set(v) {
  2132. state.locale = v;
  2133. localeWatchers.forEach(function (watch) {
  2134. return watch(v);
  2135. });
  2136. }
  2137. });
  2138. }
  2139. function isEnableLocale() {
  2140. return typeof __uniConfig !== 'undefined' && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length;
  2141. }
  2142. function include(str, parts) {
  2143. return !!parts.find(function (part) {
  2144. return str.indexOf(part) !== -1;
  2145. });
  2146. }
  2147. function startsWith(str, parts) {
  2148. return parts.find(function (part) {
  2149. return str.indexOf(part) === 0;
  2150. });
  2151. }
  2152. function normalizeLocale(locale, messages) {
  2153. if (!locale) {
  2154. return;
  2155. }
  2156. locale = locale.trim().replace(/_/g, '-');
  2157. if (messages && messages[locale]) {
  2158. return locale;
  2159. }
  2160. locale = locale.toLowerCase();
  2161. if (locale === 'chinese') {
  2162. // 支付宝
  2163. return LOCALE_ZH_HANS;
  2164. }
  2165. if (locale.indexOf('zh') === 0) {
  2166. if (locale.indexOf('-hans') > -1) {
  2167. return LOCALE_ZH_HANS;
  2168. }
  2169. if (locale.indexOf('-hant') > -1) {
  2170. return LOCALE_ZH_HANT;
  2171. }
  2172. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  2173. return LOCALE_ZH_HANT;
  2174. }
  2175. return LOCALE_ZH_HANS;
  2176. }
  2177. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  2178. if (lang) {
  2179. return lang;
  2180. }
  2181. }
  2182. // export function initI18n() {
  2183. // const localeKeys = Object.keys(__uniConfig.locales || {})
  2184. // if (localeKeys.length) {
  2185. // localeKeys.forEach((locale) =>
  2186. // i18n.add(locale, __uniConfig.locales[locale])
  2187. // )
  2188. // }
  2189. // }
  2190. function getLocale$1() {
  2191. // 优先使用 $locale
  2192. if (isFn(getApp)) {
  2193. var app = getApp({
  2194. allowDefault: true
  2195. });
  2196. if (app && app.$vm) {
  2197. return app.$vm.$locale;
  2198. }
  2199. }
  2200. return normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;
  2201. }
  2202. function setLocale$1(locale) {
  2203. var app = isFn(getApp) ? getApp() : false;
  2204. if (!app) {
  2205. return false;
  2206. }
  2207. var oldLocale = app.$vm.$locale;
  2208. if (oldLocale !== locale) {
  2209. app.$vm.$locale = locale;
  2210. onLocaleChangeCallbacks.forEach(function (fn) {
  2211. return fn({
  2212. locale: locale
  2213. });
  2214. });
  2215. return true;
  2216. }
  2217. return false;
  2218. }
  2219. var onLocaleChangeCallbacks = [];
  2220. function onLocaleChange(fn) {
  2221. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  2222. onLocaleChangeCallbacks.push(fn);
  2223. }
  2224. }
  2225. if (typeof global !== 'undefined') {
  2226. global.getLocale = getLocale$1;
  2227. }
  2228. var interceptors = {
  2229. promiseInterceptor: promiseInterceptor
  2230. };
  2231. var baseApi = /*#__PURE__*/Object.freeze({
  2232. __proto__: null,
  2233. upx2px: upx2px,
  2234. getLocale: getLocale$1,
  2235. setLocale: setLocale$1,
  2236. onLocaleChange: onLocaleChange,
  2237. addInterceptor: addInterceptor,
  2238. removeInterceptor: removeInterceptor,
  2239. interceptors: interceptors
  2240. });
  2241. function findExistsPageIndex(url) {
  2242. var pages = getCurrentPages();
  2243. var len = pages.length;
  2244. while (len--) {
  2245. var page = pages[len];
  2246. if (page.$page && page.$page.fullPath === url) {
  2247. return len;
  2248. }
  2249. }
  2250. return -1;
  2251. }
  2252. var redirectTo = {
  2253. name: function name(fromArgs) {
  2254. if (fromArgs.exists === 'back' && fromArgs.delta) {
  2255. return 'navigateBack';
  2256. }
  2257. return 'redirectTo';
  2258. },
  2259. args: function args(fromArgs) {
  2260. if (fromArgs.exists === 'back' && fromArgs.url) {
  2261. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  2262. if (existsPageIndex !== -1) {
  2263. var delta = getCurrentPages().length - 1 - existsPageIndex;
  2264. if (delta > 0) {
  2265. fromArgs.delta = delta;
  2266. }
  2267. }
  2268. }
  2269. }
  2270. };
  2271. var previewImage = {
  2272. args: function args(fromArgs) {
  2273. var currentIndex = parseInt(fromArgs.current);
  2274. if (isNaN(currentIndex)) {
  2275. return;
  2276. }
  2277. var urls = fromArgs.urls;
  2278. if (!Array.isArray(urls)) {
  2279. return;
  2280. }
  2281. var len = urls.length;
  2282. if (!len) {
  2283. return;
  2284. }
  2285. if (currentIndex < 0) {
  2286. currentIndex = 0;
  2287. } else if (currentIndex >= len) {
  2288. currentIndex = len - 1;
  2289. }
  2290. if (currentIndex > 0) {
  2291. fromArgs.current = urls[currentIndex];
  2292. fromArgs.urls = urls.filter(function (item, index) {
  2293. return index < currentIndex ? item !== urls[currentIndex] : true;
  2294. });
  2295. } else {
  2296. fromArgs.current = urls[0];
  2297. }
  2298. return {
  2299. indicator: false,
  2300. loop: false
  2301. };
  2302. }
  2303. };
  2304. var UUID_KEY = '__DC_STAT_UUID';
  2305. var deviceId;
  2306. function useDeviceId(result) {
  2307. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  2308. if (!deviceId) {
  2309. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  2310. wx.setStorage({
  2311. key: UUID_KEY,
  2312. data: deviceId
  2313. });
  2314. }
  2315. result.deviceId = deviceId;
  2316. }
  2317. function addSafeAreaInsets(result) {
  2318. if (result.safeArea) {
  2319. var safeArea = result.safeArea;
  2320. result.safeAreaInsets = {
  2321. top: safeArea.top,
  2322. left: safeArea.left,
  2323. right: result.windowWidth - safeArea.right,
  2324. bottom: result.screenHeight - safeArea.bottom
  2325. };
  2326. }
  2327. }
  2328. function populateParameters(result) {
  2329. var _result$brand = result.brand,
  2330. brand = _result$brand === void 0 ? '' : _result$brand,
  2331. _result$model = result.model,
  2332. model = _result$model === void 0 ? '' : _result$model,
  2333. _result$system = result.system,
  2334. system = _result$system === void 0 ? '' : _result$system,
  2335. _result$language = result.language,
  2336. language = _result$language === void 0 ? '' : _result$language,
  2337. theme = result.theme,
  2338. version = result.version,
  2339. platform = result.platform,
  2340. fontSizeSetting = result.fontSizeSetting,
  2341. SDKVersion = result.SDKVersion,
  2342. pixelRatio = result.pixelRatio,
  2343. deviceOrientation = result.deviceOrientation;
  2344. // const isQuickApp = "mp-weixin".indexOf('quickapp-webview') !== -1
  2345. var extraParam = {};
  2346. // osName osVersion
  2347. var osName = '';
  2348. var osVersion = '';
  2349. {
  2350. osName = system.split(' ')[0] || '';
  2351. osVersion = system.split(' ')[1] || '';
  2352. }
  2353. var hostVersion = version;
  2354. // deviceType
  2355. var deviceType = getGetDeviceType(result, model);
  2356. // deviceModel
  2357. var deviceBrand = getDeviceBrand(brand);
  2358. // hostName
  2359. var _hostName = getHostName(result);
  2360. // deviceOrientation
  2361. var _deviceOrientation = deviceOrientation; // 仅 微信 百度 支持
  2362. // devicePixelRatio
  2363. var _devicePixelRatio = pixelRatio;
  2364. // SDKVersion
  2365. var _SDKVersion = SDKVersion;
  2366. // hostLanguage
  2367. var hostLanguage = language.replace(/_/g, '-');
  2368. // wx.getAccountInfoSync
  2369. var parameters = {
  2370. appId: "__UNI__2E20170",
  2371. appName: "hptwxMiniProgram",
  2372. appVersion: "1.0.0",
  2373. appVersionCode: "100",
  2374. appLanguage: getAppLanguage(hostLanguage),
  2375. uniCompileVersion: "3.8.7",
  2376. uniRuntimeVersion: "3.8.7",
  2377. uniPlatform: undefined || "mp-weixin",
  2378. deviceBrand: deviceBrand,
  2379. deviceModel: model,
  2380. deviceType: deviceType,
  2381. devicePixelRatio: _devicePixelRatio,
  2382. deviceOrientation: _deviceOrientation,
  2383. osName: osName.toLocaleLowerCase(),
  2384. osVersion: osVersion,
  2385. hostTheme: theme,
  2386. hostVersion: hostVersion,
  2387. hostLanguage: hostLanguage,
  2388. hostName: _hostName,
  2389. hostSDKVersion: _SDKVersion,
  2390. hostFontSizeSetting: fontSizeSetting,
  2391. windowTop: 0,
  2392. windowBottom: 0,
  2393. // TODO
  2394. osLanguage: undefined,
  2395. osTheme: undefined,
  2396. ua: undefined,
  2397. hostPackageName: undefined,
  2398. browserName: undefined,
  2399. browserVersion: undefined
  2400. };
  2401. Object.assign(result, parameters, extraParam);
  2402. }
  2403. function getGetDeviceType(result, model) {
  2404. var deviceType = result.deviceType || 'phone';
  2405. {
  2406. var deviceTypeMaps = {
  2407. ipad: 'pad',
  2408. windows: 'pc',
  2409. mac: 'pc'
  2410. };
  2411. var deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
  2412. var _model = model.toLocaleLowerCase();
  2413. for (var index = 0; index < deviceTypeMapsKeys.length; index++) {
  2414. var _m = deviceTypeMapsKeys[index];
  2415. if (_model.indexOf(_m) !== -1) {
  2416. deviceType = deviceTypeMaps[_m];
  2417. break;
  2418. }
  2419. }
  2420. }
  2421. return deviceType;
  2422. }
  2423. function getDeviceBrand(brand) {
  2424. var deviceBrand = brand;
  2425. if (deviceBrand) {
  2426. deviceBrand = brand.toLocaleLowerCase();
  2427. }
  2428. return deviceBrand;
  2429. }
  2430. function getAppLanguage(defaultLanguage) {
  2431. return getLocale$1 ? getLocale$1() : defaultLanguage;
  2432. }
  2433. function getHostName(result) {
  2434. var _platform = 'WeChat';
  2435. var _hostName = result.hostName || _platform; // mp-jd
  2436. {
  2437. if (result.environment) {
  2438. _hostName = result.environment;
  2439. } else if (result.host && result.host.env) {
  2440. _hostName = result.host.env;
  2441. }
  2442. }
  2443. return _hostName;
  2444. }
  2445. var getSystemInfo = {
  2446. returnValue: function returnValue(result) {
  2447. useDeviceId(result);
  2448. addSafeAreaInsets(result);
  2449. populateParameters(result);
  2450. }
  2451. };
  2452. var showActionSheet = {
  2453. args: function args(fromArgs) {
  2454. if ((0, _typeof2.default)(fromArgs) === 'object') {
  2455. fromArgs.alertText = fromArgs.title;
  2456. }
  2457. }
  2458. };
  2459. var getAppBaseInfo = {
  2460. returnValue: function returnValue(result) {
  2461. var _result = result,
  2462. version = _result.version,
  2463. language = _result.language,
  2464. SDKVersion = _result.SDKVersion,
  2465. theme = _result.theme;
  2466. var _hostName = getHostName(result);
  2467. var hostLanguage = language.replace('_', '-');
  2468. result = sortObject(Object.assign(result, {
  2469. appId: "__UNI__2E20170",
  2470. appName: "hptwxMiniProgram",
  2471. appVersion: "1.0.0",
  2472. appVersionCode: "100",
  2473. appLanguage: getAppLanguage(hostLanguage),
  2474. hostVersion: version,
  2475. hostLanguage: hostLanguage,
  2476. hostName: _hostName,
  2477. hostSDKVersion: SDKVersion,
  2478. hostTheme: theme
  2479. }));
  2480. }
  2481. };
  2482. var getDeviceInfo = {
  2483. returnValue: function returnValue(result) {
  2484. var _result2 = result,
  2485. brand = _result2.brand,
  2486. model = _result2.model;
  2487. var deviceType = getGetDeviceType(result, model);
  2488. var deviceBrand = getDeviceBrand(brand);
  2489. useDeviceId(result);
  2490. result = sortObject(Object.assign(result, {
  2491. deviceType: deviceType,
  2492. deviceBrand: deviceBrand,
  2493. deviceModel: model
  2494. }));
  2495. }
  2496. };
  2497. var getWindowInfo = {
  2498. returnValue: function returnValue(result) {
  2499. addSafeAreaInsets(result);
  2500. result = sortObject(Object.assign(result, {
  2501. windowTop: 0,
  2502. windowBottom: 0
  2503. }));
  2504. }
  2505. };
  2506. var getAppAuthorizeSetting = {
  2507. returnValue: function returnValue(result) {
  2508. var locationReducedAccuracy = result.locationReducedAccuracy;
  2509. result.locationAccuracy = 'unsupported';
  2510. if (locationReducedAccuracy === true) {
  2511. result.locationAccuracy = 'reduced';
  2512. } else if (locationReducedAccuracy === false) {
  2513. result.locationAccuracy = 'full';
  2514. }
  2515. }
  2516. };
  2517. // import navigateTo from 'uni-helpers/navigate-to'
  2518. var compressImage = {
  2519. args: function args(fromArgs) {
  2520. // https://developers.weixin.qq.com/community/develop/doc/000c08940c865011298e0a43256800?highLine=compressHeight
  2521. if (fromArgs.compressedHeight && !fromArgs.compressHeight) {
  2522. fromArgs.compressHeight = fromArgs.compressedHeight;
  2523. }
  2524. if (fromArgs.compressedWidth && !fromArgs.compressWidth) {
  2525. fromArgs.compressWidth = fromArgs.compressedWidth;
  2526. }
  2527. }
  2528. };
  2529. var protocols = {
  2530. redirectTo: redirectTo,
  2531. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  2532. previewImage: previewImage,
  2533. getSystemInfo: getSystemInfo,
  2534. getSystemInfoSync: getSystemInfo,
  2535. showActionSheet: showActionSheet,
  2536. getAppBaseInfo: getAppBaseInfo,
  2537. getDeviceInfo: getDeviceInfo,
  2538. getWindowInfo: getWindowInfo,
  2539. getAppAuthorizeSetting: getAppAuthorizeSetting,
  2540. compressImage: compressImage
  2541. };
  2542. var todos = ['vibrate', 'preloadPage', 'unPreloadPage', 'loadSubPackage'];
  2543. var canIUses = [];
  2544. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  2545. function processCallback(methodName, method, returnValue) {
  2546. return function (res) {
  2547. return method(processReturnValue(methodName, res, returnValue));
  2548. };
  2549. }
  2550. function processArgs(methodName, fromArgs) {
  2551. var argsOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  2552. var returnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  2553. var keepFromArgs = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  2554. if (isPlainObject(fromArgs)) {
  2555. // 一般 api 的参数解析
  2556. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  2557. if (isFn(argsOption)) {
  2558. argsOption = argsOption(fromArgs, toArgs) || {};
  2559. }
  2560. for (var key in fromArgs) {
  2561. if (hasOwn(argsOption, key)) {
  2562. var keyOption = argsOption[key];
  2563. if (isFn(keyOption)) {
  2564. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  2565. }
  2566. if (!keyOption) {
  2567. // 不支持的参数
  2568. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  2569. } else if (isStr(keyOption)) {
  2570. // 重写参数 key
  2571. toArgs[keyOption] = fromArgs[key];
  2572. } else if (isPlainObject(keyOption)) {
  2573. // {name:newName,value:value}可重新指定参数 key:value
  2574. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  2575. }
  2576. } else if (CALLBACKS.indexOf(key) !== -1) {
  2577. if (isFn(fromArgs[key])) {
  2578. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  2579. }
  2580. } else {
  2581. if (!keepFromArgs) {
  2582. toArgs[key] = fromArgs[key];
  2583. }
  2584. }
  2585. }
  2586. return toArgs;
  2587. } else if (isFn(fromArgs)) {
  2588. fromArgs = processCallback(methodName, fromArgs, returnValue);
  2589. }
  2590. return fromArgs;
  2591. }
  2592. function processReturnValue(methodName, res, returnValue) {
  2593. var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  2594. if (isFn(protocols.returnValue)) {
  2595. // 处理通用 returnValue
  2596. res = protocols.returnValue(methodName, res);
  2597. }
  2598. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  2599. }
  2600. function wrapper(methodName, method) {
  2601. if (hasOwn(protocols, methodName)) {
  2602. var protocol = protocols[methodName];
  2603. if (!protocol) {
  2604. // 暂不支持的 api
  2605. return function () {
  2606. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  2607. };
  2608. }
  2609. return function (arg1, arg2) {
  2610. // 目前 api 最多两个参数
  2611. var options = protocol;
  2612. if (isFn(protocol)) {
  2613. options = protocol(arg1);
  2614. }
  2615. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  2616. var args = [arg1];
  2617. if (typeof arg2 !== 'undefined') {
  2618. args.push(arg2);
  2619. }
  2620. if (isFn(options.name)) {
  2621. methodName = options.name(arg1);
  2622. } else if (isStr(options.name)) {
  2623. methodName = options.name;
  2624. }
  2625. var returnValue = wx[methodName].apply(wx, args);
  2626. if (isSyncApi(methodName)) {
  2627. // 同步 api
  2628. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  2629. }
  2630. return returnValue;
  2631. };
  2632. }
  2633. return method;
  2634. }
  2635. var todoApis = Object.create(null);
  2636. var TODOS = ['onTabBarMidButtonTap', 'subscribePush', 'unsubscribePush', 'onPush', 'offPush', 'share'];
  2637. function createTodoApi(name) {
  2638. return function todoApi(_ref) {
  2639. var fail = _ref.fail,
  2640. complete = _ref.complete;
  2641. var res = {
  2642. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported")
  2643. };
  2644. isFn(fail) && fail(res);
  2645. isFn(complete) && complete(res);
  2646. };
  2647. }
  2648. TODOS.forEach(function (name) {
  2649. todoApis[name] = createTodoApi(name);
  2650. });
  2651. var providers = {
  2652. oauth: ['weixin'],
  2653. share: ['weixin'],
  2654. payment: ['wxpay'],
  2655. push: ['weixin']
  2656. };
  2657. function getProvider(_ref2) {
  2658. var service = _ref2.service,
  2659. success = _ref2.success,
  2660. fail = _ref2.fail,
  2661. complete = _ref2.complete;
  2662. var res = false;
  2663. if (providers[service]) {
  2664. res = {
  2665. errMsg: 'getProvider:ok',
  2666. service: service,
  2667. provider: providers[service]
  2668. };
  2669. isFn(success) && success(res);
  2670. } else {
  2671. res = {
  2672. errMsg: 'getProvider:fail service not found'
  2673. };
  2674. isFn(fail) && fail(res);
  2675. }
  2676. isFn(complete) && complete(res);
  2677. }
  2678. var extraApi = /*#__PURE__*/Object.freeze({
  2679. __proto__: null,
  2680. getProvider: getProvider
  2681. });
  2682. var getEmitter = function () {
  2683. var Emitter;
  2684. return function getUniEmitter() {
  2685. if (!Emitter) {
  2686. Emitter = new _vue.default();
  2687. }
  2688. return Emitter;
  2689. };
  2690. }();
  2691. function apply(ctx, method, args) {
  2692. return ctx[method].apply(ctx, args);
  2693. }
  2694. function $on() {
  2695. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  2696. }
  2697. function $off() {
  2698. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  2699. }
  2700. function $once() {
  2701. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  2702. }
  2703. function $emit() {
  2704. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  2705. }
  2706. var eventApi = /*#__PURE__*/Object.freeze({
  2707. __proto__: null,
  2708. $on: $on,
  2709. $off: $off,
  2710. $once: $once,
  2711. $emit: $emit
  2712. });
  2713. /**
  2714. * 框架内 try-catch
  2715. */
  2716. /**
  2717. * 开发者 try-catch
  2718. */
  2719. function tryCatch(fn) {
  2720. return function () {
  2721. try {
  2722. return fn.apply(fn, arguments);
  2723. } catch (e) {
  2724. // TODO
  2725. console.error(e);
  2726. }
  2727. };
  2728. }
  2729. function getApiCallbacks(params) {
  2730. var apiCallbacks = {};
  2731. for (var name in params) {
  2732. var param = params[name];
  2733. if (isFn(param)) {
  2734. apiCallbacks[name] = tryCatch(param);
  2735. delete params[name];
  2736. }
  2737. }
  2738. return apiCallbacks;
  2739. }
  2740. var cid;
  2741. var cidErrMsg;
  2742. var enabled;
  2743. function normalizePushMessage(message) {
  2744. try {
  2745. return JSON.parse(message);
  2746. } catch (e) {}
  2747. return message;
  2748. }
  2749. function invokePushCallback(args) {
  2750. if (args.type === 'enabled') {
  2751. enabled = true;
  2752. } else if (args.type === 'clientId') {
  2753. cid = args.cid;
  2754. cidErrMsg = args.errMsg;
  2755. invokeGetPushCidCallbacks(cid, args.errMsg);
  2756. } else if (args.type === 'pushMsg') {
  2757. var message = {
  2758. type: 'receive',
  2759. data: normalizePushMessage(args.message)
  2760. };
  2761. for (var i = 0; i < onPushMessageCallbacks.length; i++) {
  2762. var callback = onPushMessageCallbacks[i];
  2763. callback(message);
  2764. // 该消息已被阻止
  2765. if (message.stopped) {
  2766. break;
  2767. }
  2768. }
  2769. } else if (args.type === 'click') {
  2770. onPushMessageCallbacks.forEach(function (callback) {
  2771. callback({
  2772. type: 'click',
  2773. data: normalizePushMessage(args.message)
  2774. });
  2775. });
  2776. }
  2777. }
  2778. var getPushCidCallbacks = [];
  2779. function invokeGetPushCidCallbacks(cid, errMsg) {
  2780. getPushCidCallbacks.forEach(function (callback) {
  2781. callback(cid, errMsg);
  2782. });
  2783. getPushCidCallbacks.length = 0;
  2784. }
  2785. function getPushClientId(args) {
  2786. if (!isPlainObject(args)) {
  2787. args = {};
  2788. }
  2789. var _getApiCallbacks = getApiCallbacks(args),
  2790. success = _getApiCallbacks.success,
  2791. fail = _getApiCallbacks.fail,
  2792. complete = _getApiCallbacks.complete;
  2793. var hasSuccess = isFn(success);
  2794. var hasFail = isFn(fail);
  2795. var hasComplete = isFn(complete);
  2796. Promise.resolve().then(function () {
  2797. if (typeof enabled === 'undefined') {
  2798. enabled = false;
  2799. cid = '';
  2800. cidErrMsg = 'uniPush is not enabled';
  2801. }
  2802. getPushCidCallbacks.push(function (cid, errMsg) {
  2803. var res;
  2804. if (cid) {
  2805. res = {
  2806. errMsg: 'getPushClientId:ok',
  2807. cid: cid
  2808. };
  2809. hasSuccess && success(res);
  2810. } else {
  2811. res = {
  2812. errMsg: 'getPushClientId:fail' + (errMsg ? ' ' + errMsg : '')
  2813. };
  2814. hasFail && fail(res);
  2815. }
  2816. hasComplete && complete(res);
  2817. });
  2818. if (typeof cid !== 'undefined') {
  2819. invokeGetPushCidCallbacks(cid, cidErrMsg);
  2820. }
  2821. });
  2822. }
  2823. var onPushMessageCallbacks = [];
  2824. // 不使用 defineOnApi 实现,是因为 defineOnApi 依赖 UniServiceJSBridge ,该对象目前在小程序上未提供,故简单实现
  2825. var onPushMessage = function onPushMessage(fn) {
  2826. if (onPushMessageCallbacks.indexOf(fn) === -1) {
  2827. onPushMessageCallbacks.push(fn);
  2828. }
  2829. };
  2830. var offPushMessage = function offPushMessage(fn) {
  2831. if (!fn) {
  2832. onPushMessageCallbacks.length = 0;
  2833. } else {
  2834. var index = onPushMessageCallbacks.indexOf(fn);
  2835. if (index > -1) {
  2836. onPushMessageCallbacks.splice(index, 1);
  2837. }
  2838. }
  2839. };
  2840. var baseInfo = wx.getAppBaseInfo && wx.getAppBaseInfo();
  2841. if (!baseInfo) {
  2842. baseInfo = wx.getSystemInfoSync();
  2843. }
  2844. var host = baseInfo ? baseInfo.host : null;
  2845. var shareVideoMessage = host && host.env === 'SAAASDK' ? wx.miniapp.shareVideoMessage : wx.shareVideoMessage;
  2846. var api = /*#__PURE__*/Object.freeze({
  2847. __proto__: null,
  2848. shareVideoMessage: shareVideoMessage,
  2849. getPushClientId: getPushClientId,
  2850. onPushMessage: onPushMessage,
  2851. offPushMessage: offPushMessage,
  2852. invokePushCallback: invokePushCallback
  2853. });
  2854. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  2855. function findVmByVueId(vm, vuePid) {
  2856. var $children = vm.$children;
  2857. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  2858. for (var i = $children.length - 1; i >= 0; i--) {
  2859. var childVm = $children[i];
  2860. if (childVm.$scope._$vueId === vuePid) {
  2861. return childVm;
  2862. }
  2863. }
  2864. // 反向递归查找
  2865. var parentVm;
  2866. for (var _i = $children.length - 1; _i >= 0; _i--) {
  2867. parentVm = findVmByVueId($children[_i], vuePid);
  2868. if (parentVm) {
  2869. return parentVm;
  2870. }
  2871. }
  2872. }
  2873. function initBehavior(options) {
  2874. return Behavior(options);
  2875. }
  2876. function isPage() {
  2877. return !!this.route;
  2878. }
  2879. function initRelation(detail) {
  2880. this.triggerEvent('__l', detail);
  2881. }
  2882. function selectAllComponents(mpInstance, selector, $refs) {
  2883. var components = mpInstance.selectAllComponents(selector) || [];
  2884. components.forEach(function (component) {
  2885. var ref = component.dataset.ref;
  2886. $refs[ref] = component.$vm || toSkip(component);
  2887. {
  2888. if (component.dataset.vueGeneric === 'scoped') {
  2889. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  2890. selectAllComponents(scopedComponent, selector, $refs);
  2891. });
  2892. }
  2893. }
  2894. });
  2895. }
  2896. function syncRefs(refs, newRefs) {
  2897. var oldKeys = (0, _construct2.default)(Set, (0, _toConsumableArray2.default)(Object.keys(refs)));
  2898. var newKeys = Object.keys(newRefs);
  2899. newKeys.forEach(function (key) {
  2900. var oldValue = refs[key];
  2901. var newValue = newRefs[key];
  2902. if (Array.isArray(oldValue) && Array.isArray(newValue) && oldValue.length === newValue.length && newValue.every(function (value) {
  2903. return oldValue.includes(value);
  2904. })) {
  2905. return;
  2906. }
  2907. refs[key] = newValue;
  2908. oldKeys.delete(key);
  2909. });
  2910. oldKeys.forEach(function (key) {
  2911. delete refs[key];
  2912. });
  2913. return refs;
  2914. }
  2915. function initRefs(vm) {
  2916. var mpInstance = vm.$scope;
  2917. var refs = {};
  2918. Object.defineProperty(vm, '$refs', {
  2919. get: function get() {
  2920. var $refs = {};
  2921. selectAllComponents(mpInstance, '.vue-ref', $refs);
  2922. // TODO 暂不考虑 for 中的 scoped
  2923. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for') || [];
  2924. forComponents.forEach(function (component) {
  2925. var ref = component.dataset.ref;
  2926. if (!$refs[ref]) {
  2927. $refs[ref] = [];
  2928. }
  2929. $refs[ref].push(component.$vm || toSkip(component));
  2930. });
  2931. return syncRefs(refs, $refs);
  2932. }
  2933. });
  2934. }
  2935. function handleLink(event) {
  2936. var _ref3 = event.detail || event.value,
  2937. vuePid = _ref3.vuePid,
  2938. vueOptions = _ref3.vueOptions; // detail 是微信,value 是百度(dipatch)
  2939. var parentVm;
  2940. if (vuePid) {
  2941. parentVm = findVmByVueId(this.$vm, vuePid);
  2942. }
  2943. if (!parentVm) {
  2944. parentVm = this.$vm;
  2945. }
  2946. vueOptions.parent = parentVm;
  2947. }
  2948. function markMPComponent(component) {
  2949. // 在 Vue 中标记为小程序组件
  2950. var IS_MP = '__v_isMPComponent';
  2951. Object.defineProperty(component, IS_MP, {
  2952. configurable: true,
  2953. enumerable: false,
  2954. value: true
  2955. });
  2956. return component;
  2957. }
  2958. function toSkip(obj) {
  2959. var OB = '__ob__';
  2960. var SKIP = '__v_skip';
  2961. if (isObject(obj) && Object.isExtensible(obj)) {
  2962. // 避免被 @vue/composition-api 观测
  2963. Object.defineProperty(obj, OB, {
  2964. configurable: true,
  2965. enumerable: false,
  2966. value: (0, _defineProperty2.default)({}, SKIP, true)
  2967. });
  2968. }
  2969. return obj;
  2970. }
  2971. var WORKLET_RE = /_(.*)_worklet_factory_/;
  2972. function initWorkletMethods(mpMethods, vueMethods) {
  2973. if (vueMethods) {
  2974. Object.keys(vueMethods).forEach(function (name) {
  2975. var matches = name.match(WORKLET_RE);
  2976. if (matches) {
  2977. var workletName = matches[1];
  2978. mpMethods[name] = vueMethods[name];
  2979. mpMethods[workletName] = vueMethods[workletName];
  2980. }
  2981. });
  2982. }
  2983. }
  2984. var MPPage = Page;
  2985. var MPComponent = Component;
  2986. var customizeRE = /:/g;
  2987. var customize = cached(function (str) {
  2988. return camelize(str.replace(customizeRE, '-'));
  2989. });
  2990. function initTriggerEvent(mpInstance) {
  2991. var oldTriggerEvent = mpInstance.triggerEvent;
  2992. var newTriggerEvent = function newTriggerEvent(event) {
  2993. for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
  2994. args[_key3 - 1] = arguments[_key3];
  2995. }
  2996. // 事件名统一转驼峰格式,仅处理:当前组件为 vue 组件、当前组件为 vue 组件子组件
  2997. if (this.$vm || this.dataset && this.dataset.comType) {
  2998. event = customize(event);
  2999. } else {
  3000. // 针对微信/QQ小程序单独补充驼峰格式事件,以兼容历史项目
  3001. var newEvent = customize(event);
  3002. if (newEvent !== event) {
  3003. oldTriggerEvent.apply(this, [newEvent].concat(args));
  3004. }
  3005. }
  3006. return oldTriggerEvent.apply(this, [event].concat(args));
  3007. };
  3008. try {
  3009. // 京东小程序 triggerEvent 为只读
  3010. mpInstance.triggerEvent = newTriggerEvent;
  3011. } catch (error) {
  3012. mpInstance._triggerEvent = newTriggerEvent;
  3013. }
  3014. }
  3015. function initHook(name, options, isComponent) {
  3016. var oldHook = options[name];
  3017. options[name] = function () {
  3018. markMPComponent(this);
  3019. initTriggerEvent(this);
  3020. if (oldHook) {
  3021. for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  3022. args[_key4] = arguments[_key4];
  3023. }
  3024. return oldHook.apply(this, args);
  3025. }
  3026. };
  3027. }
  3028. if (!MPPage.__$wrappered) {
  3029. MPPage.__$wrappered = true;
  3030. Page = function Page() {
  3031. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  3032. initHook('onLoad', options);
  3033. return MPPage(options);
  3034. };
  3035. Page.after = MPPage.after;
  3036. Component = function Component() {
  3037. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  3038. initHook('created', options);
  3039. return MPComponent(options);
  3040. };
  3041. }
  3042. var PAGE_EVENT_HOOKS = ['onPullDownRefresh', 'onReachBottom', 'onAddToFavorites', 'onShareTimeline', 'onShareAppMessage', 'onPageScroll', 'onResize', 'onTabItemTap'];
  3043. function initMocks(vm, mocks) {
  3044. var mpInstance = vm.$mp[vm.mpType];
  3045. mocks.forEach(function (mock) {
  3046. if (hasOwn(mpInstance, mock)) {
  3047. vm[mock] = mpInstance[mock];
  3048. }
  3049. });
  3050. }
  3051. function hasHook(hook, vueOptions) {
  3052. if (!vueOptions) {
  3053. return true;
  3054. }
  3055. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  3056. return true;
  3057. }
  3058. vueOptions = vueOptions.default || vueOptions;
  3059. if (isFn(vueOptions)) {
  3060. if (isFn(vueOptions.extendOptions[hook])) {
  3061. return true;
  3062. }
  3063. if (vueOptions.super && vueOptions.super.options && Array.isArray(vueOptions.super.options[hook])) {
  3064. return true;
  3065. }
  3066. return false;
  3067. }
  3068. if (isFn(vueOptions[hook]) || Array.isArray(vueOptions[hook])) {
  3069. return true;
  3070. }
  3071. var mixins = vueOptions.mixins;
  3072. if (Array.isArray(mixins)) {
  3073. return !!mixins.find(function (mixin) {
  3074. return hasHook(hook, mixin);
  3075. });
  3076. }
  3077. }
  3078. function initHooks(mpOptions, hooks, vueOptions) {
  3079. hooks.forEach(function (hook) {
  3080. if (hasHook(hook, vueOptions)) {
  3081. mpOptions[hook] = function (args) {
  3082. return this.$vm && this.$vm.__call_hook(hook, args);
  3083. };
  3084. }
  3085. });
  3086. }
  3087. function initUnknownHooks(mpOptions, vueOptions) {
  3088. var excludes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  3089. findHooks(vueOptions).forEach(function (hook) {
  3090. return initHook$1(mpOptions, hook, excludes);
  3091. });
  3092. }
  3093. function findHooks(vueOptions) {
  3094. var hooks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  3095. if (vueOptions) {
  3096. Object.keys(vueOptions).forEach(function (name) {
  3097. if (name.indexOf('on') === 0 && isFn(vueOptions[name])) {
  3098. hooks.push(name);
  3099. }
  3100. });
  3101. }
  3102. return hooks;
  3103. }
  3104. function initHook$1(mpOptions, hook, excludes) {
  3105. if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {
  3106. mpOptions[hook] = function (args) {
  3107. return this.$vm && this.$vm.__call_hook(hook, args);
  3108. };
  3109. }
  3110. }
  3111. function initVueComponent(Vue, vueOptions) {
  3112. vueOptions = vueOptions.default || vueOptions;
  3113. var VueComponent;
  3114. if (isFn(vueOptions)) {
  3115. VueComponent = vueOptions;
  3116. } else {
  3117. VueComponent = Vue.extend(vueOptions);
  3118. }
  3119. vueOptions = VueComponent.options;
  3120. return [VueComponent, vueOptions];
  3121. }
  3122. function initSlots(vm, vueSlots) {
  3123. if (Array.isArray(vueSlots) && vueSlots.length) {
  3124. var $slots = Object.create(null);
  3125. vueSlots.forEach(function (slotName) {
  3126. $slots[slotName] = true;
  3127. });
  3128. vm.$scopedSlots = vm.$slots = $slots;
  3129. }
  3130. }
  3131. function initVueIds(vueIds, mpInstance) {
  3132. vueIds = (vueIds || '').split(',');
  3133. var len = vueIds.length;
  3134. if (len === 1) {
  3135. mpInstance._$vueId = vueIds[0];
  3136. } else if (len === 2) {
  3137. mpInstance._$vueId = vueIds[0];
  3138. mpInstance._$vuePid = vueIds[1];
  3139. }
  3140. }
  3141. function initData(vueOptions, context) {
  3142. var data = vueOptions.data || {};
  3143. var methods = vueOptions.methods || {};
  3144. if (typeof data === 'function') {
  3145. try {
  3146. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  3147. } catch (e) {
  3148. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"hptwxMiniProgram","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  3149. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  3150. }
  3151. }
  3152. } else {
  3153. try {
  3154. // 对 data 格式化
  3155. data = JSON.parse(JSON.stringify(data));
  3156. } catch (e) {}
  3157. }
  3158. if (!isPlainObject(data)) {
  3159. data = {};
  3160. }
  3161. Object.keys(methods).forEach(function (methodName) {
  3162. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  3163. data[methodName] = methods[methodName];
  3164. }
  3165. });
  3166. return data;
  3167. }
  3168. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  3169. function createObserver(name) {
  3170. return function observer(newVal, oldVal) {
  3171. if (this.$vm) {
  3172. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  3173. }
  3174. };
  3175. }
  3176. function initBehaviors(vueOptions, initBehavior) {
  3177. var vueBehaviors = vueOptions.behaviors;
  3178. var vueExtends = vueOptions.extends;
  3179. var vueMixins = vueOptions.mixins;
  3180. var vueProps = vueOptions.props;
  3181. if (!vueProps) {
  3182. vueOptions.props = vueProps = [];
  3183. }
  3184. var behaviors = [];
  3185. if (Array.isArray(vueBehaviors)) {
  3186. vueBehaviors.forEach(function (behavior) {
  3187. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  3188. if (behavior === 'uni://form-field') {
  3189. if (Array.isArray(vueProps)) {
  3190. vueProps.push('name');
  3191. vueProps.push('value');
  3192. } else {
  3193. vueProps.name = {
  3194. type: String,
  3195. default: ''
  3196. };
  3197. vueProps.value = {
  3198. type: [String, Number, Boolean, Array, Object, Date],
  3199. default: ''
  3200. };
  3201. }
  3202. }
  3203. });
  3204. }
  3205. if (isPlainObject(vueExtends) && vueExtends.props) {
  3206. behaviors.push(initBehavior({
  3207. properties: initProperties(vueExtends.props, true)
  3208. }));
  3209. }
  3210. if (Array.isArray(vueMixins)) {
  3211. vueMixins.forEach(function (vueMixin) {
  3212. if (isPlainObject(vueMixin) && vueMixin.props) {
  3213. behaviors.push(initBehavior({
  3214. properties: initProperties(vueMixin.props, true)
  3215. }));
  3216. }
  3217. });
  3218. }
  3219. return behaviors;
  3220. }
  3221. function parsePropType(key, type, defaultValue, file) {
  3222. // [String]=>String
  3223. if (Array.isArray(type) && type.length === 1) {
  3224. return type[0];
  3225. }
  3226. return type;
  3227. }
  3228. function initProperties(props) {
  3229. var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  3230. var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  3231. var options = arguments.length > 3 ? arguments[3] : undefined;
  3232. var properties = {};
  3233. if (!isBehavior) {
  3234. properties.vueId = {
  3235. type: String,
  3236. value: ''
  3237. };
  3238. {
  3239. if (options.virtualHost) {
  3240. properties.virtualHostStyle = {
  3241. type: null,
  3242. value: ''
  3243. };
  3244. properties.virtualHostClass = {
  3245. type: null,
  3246. value: ''
  3247. };
  3248. }
  3249. }
  3250. // scopedSlotsCompiler auto
  3251. properties.scopedSlotsCompiler = {
  3252. type: String,
  3253. value: ''
  3254. };
  3255. properties.vueSlots = {
  3256. // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  3257. type: null,
  3258. value: [],
  3259. observer: function observer(newVal, oldVal) {
  3260. var $slots = Object.create(null);
  3261. newVal.forEach(function (slotName) {
  3262. $slots[slotName] = true;
  3263. });
  3264. this.setData({
  3265. $slots: $slots
  3266. });
  3267. }
  3268. };
  3269. }
  3270. if (Array.isArray(props)) {
  3271. // ['title']
  3272. props.forEach(function (key) {
  3273. properties[key] = {
  3274. type: null,
  3275. observer: createObserver(key)
  3276. };
  3277. });
  3278. } else if (isPlainObject(props)) {
  3279. // {title:{type:String,default:''},content:String}
  3280. Object.keys(props).forEach(function (key) {
  3281. var opts = props[key];
  3282. if (isPlainObject(opts)) {
  3283. // title:{type:String,default:''}
  3284. var value = opts.default;
  3285. if (isFn(value)) {
  3286. value = value();
  3287. }
  3288. opts.type = parsePropType(key, opts.type);
  3289. properties[key] = {
  3290. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  3291. value: value,
  3292. observer: createObserver(key)
  3293. };
  3294. } else {
  3295. // content:String
  3296. var type = parsePropType(key, opts);
  3297. properties[key] = {
  3298. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  3299. observer: createObserver(key)
  3300. };
  3301. }
  3302. });
  3303. }
  3304. return properties;
  3305. }
  3306. function wrapper$1(event) {
  3307. // TODO 又得兼容 mpvue 的 mp 对象
  3308. try {
  3309. event.mp = JSON.parse(JSON.stringify(event));
  3310. } catch (e) {}
  3311. event.stopPropagation = noop;
  3312. event.preventDefault = noop;
  3313. event.target = event.target || {};
  3314. if (!hasOwn(event, 'detail')) {
  3315. event.detail = {};
  3316. }
  3317. if (hasOwn(event, 'markerId')) {
  3318. event.detail = (0, _typeof2.default)(event.detail) === 'object' ? event.detail : {};
  3319. event.detail.markerId = event.markerId;
  3320. }
  3321. if (isPlainObject(event.detail)) {
  3322. event.target = Object.assign({}, event.target, event.detail);
  3323. }
  3324. return event;
  3325. }
  3326. function getExtraValue(vm, dataPathsArray) {
  3327. var context = vm;
  3328. dataPathsArray.forEach(function (dataPathArray) {
  3329. var dataPath = dataPathArray[0];
  3330. var value = dataPathArray[2];
  3331. if (dataPath || typeof value !== 'undefined') {
  3332. // ['','',index,'disable']
  3333. var propPath = dataPathArray[1];
  3334. var valuePath = dataPathArray[3];
  3335. var vFor;
  3336. if (Number.isInteger(dataPath)) {
  3337. vFor = dataPath;
  3338. } else if (!dataPath) {
  3339. vFor = context;
  3340. } else if (typeof dataPath === 'string' && dataPath) {
  3341. if (dataPath.indexOf('#s#') === 0) {
  3342. vFor = dataPath.substr(3);
  3343. } else {
  3344. vFor = vm.__get_value(dataPath, context);
  3345. }
  3346. }
  3347. if (Number.isInteger(vFor)) {
  3348. context = value;
  3349. } else if (!propPath) {
  3350. context = vFor[value];
  3351. } else {
  3352. if (Array.isArray(vFor)) {
  3353. context = vFor.find(function (vForItem) {
  3354. return vm.__get_value(propPath, vForItem) === value;
  3355. });
  3356. } else if (isPlainObject(vFor)) {
  3357. context = Object.keys(vFor).find(function (vForKey) {
  3358. return vm.__get_value(propPath, vFor[vForKey]) === value;
  3359. });
  3360. } else {
  3361. console.error('v-for 暂不支持循环数据:', vFor);
  3362. }
  3363. }
  3364. if (valuePath) {
  3365. context = vm.__get_value(valuePath, context);
  3366. }
  3367. }
  3368. });
  3369. return context;
  3370. }
  3371. function processEventExtra(vm, extra, event, __args__) {
  3372. var extraObj = {};
  3373. if (Array.isArray(extra) && extra.length) {
  3374. /**
  3375. *[
  3376. * ['data.items', 'data.id', item.data.id],
  3377. * ['metas', 'id', meta.id]
  3378. *],
  3379. *[
  3380. * ['data.items', 'data.id', item.data.id],
  3381. * ['metas', 'id', meta.id]
  3382. *],
  3383. *'test'
  3384. */
  3385. extra.forEach(function (dataPath, index) {
  3386. if (typeof dataPath === 'string') {
  3387. if (!dataPath) {
  3388. // model,prop.sync
  3389. extraObj['$' + index] = vm;
  3390. } else {
  3391. if (dataPath === '$event') {
  3392. // $event
  3393. extraObj['$' + index] = event;
  3394. } else if (dataPath === 'arguments') {
  3395. extraObj['$' + index] = event.detail ? event.detail.__args__ || __args__ : __args__;
  3396. } else if (dataPath.indexOf('$event.') === 0) {
  3397. // $event.target.value
  3398. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  3399. } else {
  3400. extraObj['$' + index] = vm.__get_value(dataPath);
  3401. }
  3402. }
  3403. } else {
  3404. extraObj['$' + index] = getExtraValue(vm, dataPath);
  3405. }
  3406. });
  3407. }
  3408. return extraObj;
  3409. }
  3410. function getObjByArray(arr) {
  3411. var obj = {};
  3412. for (var i = 1; i < arr.length; i++) {
  3413. var element = arr[i];
  3414. obj[element[0]] = element[1];
  3415. }
  3416. return obj;
  3417. }
  3418. function processEventArgs(vm, event) {
  3419. var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  3420. var extra = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
  3421. var isCustom = arguments.length > 4 ? arguments[4] : undefined;
  3422. var methodName = arguments.length > 5 ? arguments[5] : undefined;
  3423. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  3424. // fixed 用户直接触发 mpInstance.triggerEvent
  3425. var __args__ = isPlainObject(event.detail) ? event.detail.__args__ || [event.detail] : [event.detail];
  3426. if (isCustom) {
  3427. // 自定义事件
  3428. isCustomMPEvent = event.currentTarget && event.currentTarget.dataset && event.currentTarget.dataset.comType === 'wx';
  3429. if (!args.length) {
  3430. // 无参数,直接传入 event 或 detail 数组
  3431. if (isCustomMPEvent) {
  3432. return [event];
  3433. }
  3434. return __args__;
  3435. }
  3436. }
  3437. var extraObj = processEventExtra(vm, extra, event, __args__);
  3438. var ret = [];
  3439. args.forEach(function (arg) {
  3440. if (arg === '$event') {
  3441. if (methodName === '__set_model' && !isCustom) {
  3442. // input v-model value
  3443. ret.push(event.target.value);
  3444. } else {
  3445. if (isCustom && !isCustomMPEvent) {
  3446. ret.push(__args__[0]);
  3447. } else {
  3448. // wxcomponent 组件或内置组件
  3449. ret.push(event);
  3450. }
  3451. }
  3452. } else {
  3453. if (Array.isArray(arg) && arg[0] === 'o') {
  3454. ret.push(getObjByArray(arg));
  3455. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  3456. ret.push(extraObj[arg]);
  3457. } else {
  3458. ret.push(arg);
  3459. }
  3460. }
  3461. });
  3462. return ret;
  3463. }
  3464. var ONCE = '~';
  3465. var CUSTOM = '^';
  3466. function isMatchEventType(eventType, optType) {
  3467. return eventType === optType || optType === 'regionchange' && (eventType === 'begin' || eventType === 'end');
  3468. }
  3469. function getContextVm(vm) {
  3470. var $parent = vm.$parent;
  3471. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  3472. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  3473. $parent = $parent.$parent;
  3474. }
  3475. return $parent && $parent.$parent;
  3476. }
  3477. function handleEvent(event) {
  3478. var _this2 = this;
  3479. event = wrapper$1(event);
  3480. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  3481. var dataset = (event.currentTarget || event.target).dataset;
  3482. if (!dataset) {
  3483. return console.warn('事件信息不存在');
  3484. }
  3485. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  3486. if (!eventOpts) {
  3487. return console.warn('事件信息不存在');
  3488. }
  3489. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  3490. var eventType = event.type;
  3491. var ret = [];
  3492. eventOpts.forEach(function (eventOpt) {
  3493. var type = eventOpt[0];
  3494. var eventsArray = eventOpt[1];
  3495. var isCustom = type.charAt(0) === CUSTOM;
  3496. type = isCustom ? type.slice(1) : type;
  3497. var isOnce = type.charAt(0) === ONCE;
  3498. type = isOnce ? type.slice(1) : type;
  3499. if (eventsArray && isMatchEventType(eventType, type)) {
  3500. eventsArray.forEach(function (eventArray) {
  3501. var methodName = eventArray[0];
  3502. if (methodName) {
  3503. var handlerCtx = _this2.$vm;
  3504. if (handlerCtx.$options.generic) {
  3505. // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  3506. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  3507. }
  3508. if (methodName === '$emit') {
  3509. handlerCtx.$emit.apply(handlerCtx, processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName));
  3510. return;
  3511. }
  3512. var handler = handlerCtx[methodName];
  3513. if (!isFn(handler)) {
  3514. var _type = _this2.$vm.mpType === 'page' ? 'Page' : 'Component';
  3515. var path = _this2.route || _this2.is;
  3516. throw new Error("".concat(_type, " \"").concat(path, "\" does not have a method \"").concat(methodName, "\""));
  3517. }
  3518. if (isOnce) {
  3519. if (handler.once) {
  3520. return;
  3521. }
  3522. handler.once = true;
  3523. }
  3524. var params = processEventArgs(_this2.$vm, event, eventArray[1], eventArray[2], isCustom, methodName);
  3525. params = Array.isArray(params) ? params : [];
  3526. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  3527. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  3528. // eslint-disable-next-line no-sparse-arrays
  3529. params = params.concat([,,,,,,,,,, event]);
  3530. }
  3531. ret.push(handler.apply(handlerCtx, params));
  3532. }
  3533. });
  3534. }
  3535. });
  3536. if (eventType === 'input' && ret.length === 1 && typeof ret[0] !== 'undefined') {
  3537. return ret[0];
  3538. }
  3539. }
  3540. var eventChannels = {};
  3541. function getEventChannel(id) {
  3542. var eventChannel = eventChannels[id];
  3543. delete eventChannels[id];
  3544. return eventChannel;
  3545. }
  3546. var hooks = ['onShow', 'onHide', 'onError', 'onPageNotFound', 'onThemeChange', 'onUnhandledRejection'];
  3547. function initEventChannel() {
  3548. _vue.default.prototype.getOpenerEventChannel = function () {
  3549. // 微信小程序使用自身getOpenerEventChannel
  3550. {
  3551. return this.$scope.getOpenerEventChannel();
  3552. }
  3553. };
  3554. var callHook = _vue.default.prototype.__call_hook;
  3555. _vue.default.prototype.__call_hook = function (hook, args) {
  3556. if (hook === 'onLoad' && args && args.__id__) {
  3557. this.__eventChannel__ = getEventChannel(args.__id__);
  3558. delete args.__id__;
  3559. }
  3560. return callHook.call(this, hook, args);
  3561. };
  3562. }
  3563. function initScopedSlotsParams() {
  3564. var center = {};
  3565. var parents = {};
  3566. function currentId(fn) {
  3567. var vueIds = this.$options.propsData.vueId;
  3568. if (vueIds) {
  3569. var vueId = vueIds.split(',')[0];
  3570. fn(vueId);
  3571. }
  3572. }
  3573. _vue.default.prototype.$hasSSP = function (vueId) {
  3574. var slot = center[vueId];
  3575. if (!slot) {
  3576. parents[vueId] = this;
  3577. this.$on('hook:destroyed', function () {
  3578. delete parents[vueId];
  3579. });
  3580. }
  3581. return slot;
  3582. };
  3583. _vue.default.prototype.$getSSP = function (vueId, name, needAll) {
  3584. var slot = center[vueId];
  3585. if (slot) {
  3586. var params = slot[name] || [];
  3587. if (needAll) {
  3588. return params;
  3589. }
  3590. return params[0];
  3591. }
  3592. };
  3593. _vue.default.prototype.$setSSP = function (name, value) {
  3594. var index = 0;
  3595. currentId.call(this, function (vueId) {
  3596. var slot = center[vueId];
  3597. var params = slot[name] = slot[name] || [];
  3598. params.push(value);
  3599. index = params.length - 1;
  3600. });
  3601. return index;
  3602. };
  3603. _vue.default.prototype.$initSSP = function () {
  3604. currentId.call(this, function (vueId) {
  3605. center[vueId] = {};
  3606. });
  3607. };
  3608. _vue.default.prototype.$callSSP = function () {
  3609. currentId.call(this, function (vueId) {
  3610. if (parents[vueId]) {
  3611. parents[vueId].$forceUpdate();
  3612. }
  3613. });
  3614. };
  3615. _vue.default.mixin({
  3616. destroyed: function destroyed() {
  3617. var propsData = this.$options.propsData;
  3618. var vueId = propsData && propsData.vueId;
  3619. if (vueId) {
  3620. delete center[vueId];
  3621. delete parents[vueId];
  3622. }
  3623. }
  3624. });
  3625. }
  3626. function parseBaseApp(vm, _ref4) {
  3627. var mocks = _ref4.mocks,
  3628. initRefs = _ref4.initRefs;
  3629. initEventChannel();
  3630. {
  3631. initScopedSlotsParams();
  3632. }
  3633. if (vm.$options.store) {
  3634. _vue.default.prototype.$store = vm.$options.store;
  3635. }
  3636. uniIdMixin(_vue.default);
  3637. _vue.default.prototype.mpHost = "mp-weixin";
  3638. _vue.default.mixin({
  3639. beforeCreate: function beforeCreate() {
  3640. if (!this.$options.mpType) {
  3641. return;
  3642. }
  3643. this.mpType = this.$options.mpType;
  3644. this.$mp = (0, _defineProperty2.default)({
  3645. data: {}
  3646. }, this.mpType, this.$options.mpInstance);
  3647. this.$scope = this.$options.mpInstance;
  3648. delete this.$options.mpType;
  3649. delete this.$options.mpInstance;
  3650. if (this.mpType === 'page' && typeof getApp === 'function') {
  3651. // hack vue-i18n
  3652. var app = getApp();
  3653. if (app.$vm && app.$vm.$i18n) {
  3654. this._i18n = app.$vm.$i18n;
  3655. }
  3656. }
  3657. if (this.mpType !== 'app') {
  3658. initRefs(this);
  3659. initMocks(this, mocks);
  3660. }
  3661. }
  3662. });
  3663. var appOptions = {
  3664. onLaunch: function onLaunch(args) {
  3665. if (this.$vm) {
  3666. // 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  3667. return;
  3668. }
  3669. {
  3670. if (wx.canIUse && !wx.canIUse('nextTick')) {
  3671. // 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  3672. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  3673. }
  3674. }
  3675. this.$vm = vm;
  3676. this.$vm.$mp = {
  3677. app: this
  3678. };
  3679. this.$vm.$scope = this;
  3680. // vm 上也挂载 globalData
  3681. this.$vm.globalData = this.globalData;
  3682. this.$vm._isMounted = true;
  3683. this.$vm.__call_hook('mounted', args);
  3684. this.$vm.__call_hook('onLaunch', args);
  3685. }
  3686. };
  3687. // 兼容旧版本 globalData
  3688. appOptions.globalData = vm.$options.globalData || {};
  3689. // 将 methods 中的方法挂在 getApp() 中
  3690. var methods = vm.$options.methods;
  3691. if (methods) {
  3692. Object.keys(methods).forEach(function (name) {
  3693. appOptions[name] = methods[name];
  3694. });
  3695. }
  3696. initAppLocale(_vue.default, vm, normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN);
  3697. initHooks(appOptions, hooks);
  3698. initUnknownHooks(appOptions, vm.$options);
  3699. return appOptions;
  3700. }
  3701. function parseApp(vm) {
  3702. return parseBaseApp(vm, {
  3703. mocks: mocks,
  3704. initRefs: initRefs
  3705. });
  3706. }
  3707. function createApp(vm) {
  3708. App(parseApp(vm));
  3709. return vm;
  3710. }
  3711. var encodeReserveRE = /[!'()*]/g;
  3712. var encodeReserveReplacer = function encodeReserveReplacer(c) {
  3713. return '%' + c.charCodeAt(0).toString(16);
  3714. };
  3715. var commaRE = /%2C/g;
  3716. // fixed encodeURIComponent which is more conformant to RFC3986:
  3717. // - escapes [!'()*]
  3718. // - preserve commas
  3719. var encode = function encode(str) {
  3720. return encodeURIComponent(str).replace(encodeReserveRE, encodeReserveReplacer).replace(commaRE, ',');
  3721. };
  3722. function stringifyQuery(obj) {
  3723. var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  3724. var res = obj ? Object.keys(obj).map(function (key) {
  3725. var val = obj[key];
  3726. if (val === undefined) {
  3727. return '';
  3728. }
  3729. if (val === null) {
  3730. return encodeStr(key);
  3731. }
  3732. if (Array.isArray(val)) {
  3733. var result = [];
  3734. val.forEach(function (val2) {
  3735. if (val2 === undefined) {
  3736. return;
  3737. }
  3738. if (val2 === null) {
  3739. result.push(encodeStr(key));
  3740. } else {
  3741. result.push(encodeStr(key) + '=' + encodeStr(val2));
  3742. }
  3743. });
  3744. return result.join('&');
  3745. }
  3746. return encodeStr(key) + '=' + encodeStr(val);
  3747. }).filter(function (x) {
  3748. return x.length > 0;
  3749. }).join('&') : null;
  3750. return res ? "?".concat(res) : '';
  3751. }
  3752. function parseBaseComponent(vueComponentOptions) {
  3753. var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  3754. isPage = _ref5.isPage,
  3755. initRelation = _ref5.initRelation;
  3756. var needVueOptions = arguments.length > 2 ? arguments[2] : undefined;
  3757. var _initVueComponent = initVueComponent(_vue.default, vueComponentOptions),
  3758. _initVueComponent2 = (0, _slicedToArray2.default)(_initVueComponent, 2),
  3759. VueComponent = _initVueComponent2[0],
  3760. vueOptions = _initVueComponent2[1];
  3761. var options = _objectSpread({
  3762. multipleSlots: true,
  3763. // styleIsolation: 'apply-shared',
  3764. addGlobalClass: true
  3765. }, vueOptions.options || {});
  3766. {
  3767. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  3768. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  3769. Object.assign(options, vueOptions['mp-weixin'].options);
  3770. }
  3771. }
  3772. var componentOptions = {
  3773. options: options,
  3774. data: initData(vueOptions, _vue.default.prototype),
  3775. behaviors: initBehaviors(vueOptions, initBehavior),
  3776. properties: initProperties(vueOptions.props, false, vueOptions.__file, options),
  3777. lifetimes: {
  3778. attached: function attached() {
  3779. var properties = this.properties;
  3780. var options = {
  3781. mpType: isPage.call(this) ? 'page' : 'component',
  3782. mpInstance: this,
  3783. propsData: properties
  3784. };
  3785. initVueIds(properties.vueId, this);
  3786. // 处理父子关系
  3787. initRelation.call(this, {
  3788. vuePid: this._$vuePid,
  3789. vueOptions: options
  3790. });
  3791. // 初始化 vue 实例
  3792. this.$vm = new VueComponent(options);
  3793. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  3794. initSlots(this.$vm, properties.vueSlots);
  3795. // 触发首次 setData
  3796. this.$vm.$mount();
  3797. },
  3798. ready: function ready() {
  3799. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  3800. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  3801. if (this.$vm) {
  3802. this.$vm._isMounted = true;
  3803. this.$vm.__call_hook('mounted');
  3804. this.$vm.__call_hook('onReady');
  3805. }
  3806. },
  3807. detached: function detached() {
  3808. this.$vm && this.$vm.$destroy();
  3809. }
  3810. },
  3811. pageLifetimes: {
  3812. show: function show(args) {
  3813. this.$vm && this.$vm.__call_hook('onPageShow', args);
  3814. },
  3815. hide: function hide() {
  3816. this.$vm && this.$vm.__call_hook('onPageHide');
  3817. },
  3818. resize: function resize(size) {
  3819. this.$vm && this.$vm.__call_hook('onPageResize', size);
  3820. }
  3821. },
  3822. methods: {
  3823. __l: handleLink,
  3824. __e: handleEvent
  3825. }
  3826. };
  3827. // externalClasses
  3828. if (vueOptions.externalClasses) {
  3829. componentOptions.externalClasses = vueOptions.externalClasses;
  3830. }
  3831. if (Array.isArray(vueOptions.wxsCallMethods)) {
  3832. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  3833. componentOptions.methods[callMethod] = function (args) {
  3834. return this.$vm[callMethod](args);
  3835. };
  3836. });
  3837. }
  3838. if (needVueOptions) {
  3839. return [componentOptions, vueOptions, VueComponent];
  3840. }
  3841. if (isPage) {
  3842. return componentOptions;
  3843. }
  3844. return [componentOptions, VueComponent];
  3845. }
  3846. function parseComponent(vueComponentOptions, needVueOptions) {
  3847. return parseBaseComponent(vueComponentOptions, {
  3848. isPage: isPage,
  3849. initRelation: initRelation
  3850. }, needVueOptions);
  3851. }
  3852. var hooks$1 = ['onShow', 'onHide', 'onUnload'];
  3853. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  3854. function parseBasePage(vuePageOptions) {
  3855. var _parseComponent = parseComponent(vuePageOptions, true),
  3856. _parseComponent2 = (0, _slicedToArray2.default)(_parseComponent, 2),
  3857. pageOptions = _parseComponent2[0],
  3858. vueOptions = _parseComponent2[1];
  3859. initHooks(pageOptions.methods, hooks$1, vueOptions);
  3860. pageOptions.methods.onLoad = function (query) {
  3861. this.options = query;
  3862. var copyQuery = Object.assign({}, query);
  3863. delete copyQuery.__id__;
  3864. this.$page = {
  3865. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery)
  3866. };
  3867. this.$vm.$mp.query = query; // 兼容 mpvue
  3868. this.$vm.__call_hook('onLoad', query);
  3869. };
  3870. {
  3871. initUnknownHooks(pageOptions.methods, vuePageOptions, ['onReady']);
  3872. }
  3873. {
  3874. initWorkletMethods(pageOptions.methods, vueOptions.methods);
  3875. }
  3876. return pageOptions;
  3877. }
  3878. function parsePage(vuePageOptions) {
  3879. return parseBasePage(vuePageOptions);
  3880. }
  3881. function createPage(vuePageOptions) {
  3882. {
  3883. return Component(parsePage(vuePageOptions));
  3884. }
  3885. }
  3886. function createComponent(vueOptions) {
  3887. {
  3888. return Component(parseComponent(vueOptions));
  3889. }
  3890. }
  3891. function createSubpackageApp(vm) {
  3892. var appOptions = parseApp(vm);
  3893. var app = getApp({
  3894. allowDefault: true
  3895. });
  3896. vm.$scope = app;
  3897. var globalData = app.globalData;
  3898. if (globalData) {
  3899. Object.keys(appOptions.globalData).forEach(function (name) {
  3900. if (!hasOwn(globalData, name)) {
  3901. globalData[name] = appOptions.globalData[name];
  3902. }
  3903. });
  3904. }
  3905. Object.keys(appOptions).forEach(function (name) {
  3906. if (!hasOwn(app, name)) {
  3907. app[name] = appOptions[name];
  3908. }
  3909. });
  3910. if (isFn(appOptions.onShow) && wx.onAppShow) {
  3911. wx.onAppShow(function () {
  3912. for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
  3913. args[_key5] = arguments[_key5];
  3914. }
  3915. vm.__call_hook('onShow', args);
  3916. });
  3917. }
  3918. if (isFn(appOptions.onHide) && wx.onAppHide) {
  3919. wx.onAppHide(function () {
  3920. for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
  3921. args[_key6] = arguments[_key6];
  3922. }
  3923. vm.__call_hook('onHide', args);
  3924. });
  3925. }
  3926. if (isFn(appOptions.onLaunch)) {
  3927. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  3928. vm.__call_hook('onLaunch', args);
  3929. }
  3930. return vm;
  3931. }
  3932. function createPlugin(vm) {
  3933. var appOptions = parseApp(vm);
  3934. if (isFn(appOptions.onShow) && wx.onAppShow) {
  3935. wx.onAppShow(function () {
  3936. for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
  3937. args[_key7] = arguments[_key7];
  3938. }
  3939. vm.__call_hook('onShow', args);
  3940. });
  3941. }
  3942. if (isFn(appOptions.onHide) && wx.onAppHide) {
  3943. wx.onAppHide(function () {
  3944. for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
  3945. args[_key8] = arguments[_key8];
  3946. }
  3947. vm.__call_hook('onHide', args);
  3948. });
  3949. }
  3950. if (isFn(appOptions.onLaunch)) {
  3951. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  3952. vm.__call_hook('onLaunch', args);
  3953. }
  3954. return vm;
  3955. }
  3956. todos.forEach(function (todoApi) {
  3957. protocols[todoApi] = false;
  3958. });
  3959. canIUses.forEach(function (canIUseApi) {
  3960. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name : canIUseApi;
  3961. if (!wx.canIUse(apiName)) {
  3962. protocols[canIUseApi] = false;
  3963. }
  3964. });
  3965. var uni = {};
  3966. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  3967. uni = new Proxy({}, {
  3968. get: function get(target, name) {
  3969. if (hasOwn(target, name)) {
  3970. return target[name];
  3971. }
  3972. if (baseApi[name]) {
  3973. return baseApi[name];
  3974. }
  3975. if (api[name]) {
  3976. return promisify(name, api[name]);
  3977. }
  3978. {
  3979. if (extraApi[name]) {
  3980. return promisify(name, extraApi[name]);
  3981. }
  3982. if (todoApis[name]) {
  3983. return promisify(name, todoApis[name]);
  3984. }
  3985. }
  3986. if (eventApi[name]) {
  3987. return eventApi[name];
  3988. }
  3989. return promisify(name, wrapper(name, wx[name]));
  3990. },
  3991. set: function set(target, name, value) {
  3992. target[name] = value;
  3993. return true;
  3994. }
  3995. });
  3996. } else {
  3997. Object.keys(baseApi).forEach(function (name) {
  3998. uni[name] = baseApi[name];
  3999. });
  4000. {
  4001. Object.keys(todoApis).forEach(function (name) {
  4002. uni[name] = promisify(name, todoApis[name]);
  4003. });
  4004. Object.keys(extraApi).forEach(function (name) {
  4005. uni[name] = promisify(name, extraApi[name]);
  4006. });
  4007. }
  4008. Object.keys(eventApi).forEach(function (name) {
  4009. uni[name] = eventApi[name];
  4010. });
  4011. Object.keys(api).forEach(function (name) {
  4012. uni[name] = promisify(name, api[name]);
  4013. });
  4014. Object.keys(wx).forEach(function (name) {
  4015. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  4016. uni[name] = promisify(name, wrapper(name, wx[name]));
  4017. }
  4018. });
  4019. }
  4020. wx.createApp = createApp;
  4021. wx.createPage = createPage;
  4022. wx.createComponent = createComponent;
  4023. wx.createSubpackageApp = createSubpackageApp;
  4024. wx.createPlugin = createPlugin;
  4025. var uni$1 = uni;
  4026. var _default = uni$1;
  4027. exports.default = _default;
  4028. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"], __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 3)))
  4029. /***/ }),
  4030. /***/ 20:
  4031. /*!****************************************************************!*\
  4032. !*** ./node_modules/@babel/runtime/helpers/iterableToArray.js ***!
  4033. \****************************************************************/
  4034. /*! no static exports found */
  4035. /***/ (function(module, exports) {
  4036. function _iterableToArray(iter) {
  4037. if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  4038. }
  4039. module.exports = _iterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  4040. /***/ }),
  4041. /***/ 21:
  4042. /*!******************************************************************!*\
  4043. !*** ./node_modules/@babel/runtime/helpers/nonIterableSpread.js ***!
  4044. \******************************************************************/
  4045. /*! no static exports found */
  4046. /***/ (function(module, exports) {
  4047. function _nonIterableSpread() {
  4048. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  4049. }
  4050. module.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports["default"] = module.exports;
  4051. /***/ }),
  4052. /***/ 212:
  4053. /*!************************************************************************************!*\
  4054. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js ***!
  4055. \************************************************************************************/
  4056. /*! no static exports found */
  4057. /***/ (function(module, exports, __webpack_require__) {
  4058. "use strict";
  4059. /* WEBPACK VAR INJECTION */(function(global, uni, wx) {
  4060. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  4061. Object.defineProperty(exports, "__esModule", {
  4062. value: true
  4063. });
  4064. exports.default = void 0;
  4065. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 42));
  4066. var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ 174));
  4067. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  4068. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  4069. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
  4070. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 44));
  4071. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  4072. var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ 172));
  4073. var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ 173));
  4074. var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ 175));
  4075. var _wrapNativeSuper2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ 213));
  4076. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  4077. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  4078. var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 22);
  4079. var _pages = _interopRequireDefault(__webpack_require__(/*! @/pages.json */ 215));
  4080. function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { 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(_e35) { throw _e35; }, 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 = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e36) { didErr = true; err = _e36; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
  4081. 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); }
  4082. 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; }
  4083. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
  4084. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
  4085. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
  4086. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  4087. "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self && self;
  4088. function n(e) {
  4089. return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
  4090. }
  4091. function s(e, t, n) {
  4092. return e(n = {
  4093. path: t,
  4094. exports: {},
  4095. require: function require(e, t) {
  4096. return function () {
  4097. throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
  4098. }(null == t && n.path);
  4099. }
  4100. }, n.exports), n.exports;
  4101. }
  4102. var r = s(function (e, t) {
  4103. var n;
  4104. e.exports = (n = n || function (e, t) {
  4105. var n = Object.create || function () {
  4106. function e() {}
  4107. return function (t) {
  4108. var n;
  4109. return e.prototype = t, n = new e(), e.prototype = null, n;
  4110. };
  4111. }(),
  4112. s = {},
  4113. r = s.lib = {},
  4114. i = r.Base = {
  4115. extend: function extend(e) {
  4116. var t = n(this);
  4117. return e && t.mixIn(e), t.hasOwnProperty("init") && this.init !== t.init || (t.init = function () {
  4118. t.$super.init.apply(this, arguments);
  4119. }), t.init.prototype = t, t.$super = this, t;
  4120. },
  4121. create: function create() {
  4122. var e = this.extend();
  4123. return e.init.apply(e, arguments), e;
  4124. },
  4125. init: function init() {},
  4126. mixIn: function mixIn(e) {
  4127. for (var t in e) {
  4128. e.hasOwnProperty(t) && (this[t] = e[t]);
  4129. }
  4130. e.hasOwnProperty("toString") && (this.toString = e.toString);
  4131. },
  4132. clone: function clone() {
  4133. return this.init.prototype.extend(this);
  4134. }
  4135. },
  4136. o = r.WordArray = i.extend({
  4137. init: function init(e, n) {
  4138. e = this.words = e || [], this.sigBytes = n != t ? n : 4 * e.length;
  4139. },
  4140. toString: function toString(e) {
  4141. return (e || c).stringify(this);
  4142. },
  4143. concat: function concat(e) {
  4144. var t = this.words,
  4145. n = e.words,
  4146. s = this.sigBytes,
  4147. r = e.sigBytes;
  4148. if (this.clamp(), s % 4) for (var i = 0; i < r; i++) {
  4149. var o = n[i >>> 2] >>> 24 - i % 4 * 8 & 255;
  4150. t[s + i >>> 2] |= o << 24 - (s + i) % 4 * 8;
  4151. } else for (i = 0; i < r; i += 4) {
  4152. t[s + i >>> 2] = n[i >>> 2];
  4153. }
  4154. return this.sigBytes += r, this;
  4155. },
  4156. clamp: function clamp() {
  4157. var t = this.words,
  4158. n = this.sigBytes;
  4159. t[n >>> 2] &= 4294967295 << 32 - n % 4 * 8, t.length = e.ceil(n / 4);
  4160. },
  4161. clone: function clone() {
  4162. var e = i.clone.call(this);
  4163. return e.words = this.words.slice(0), e;
  4164. },
  4165. random: function random(t) {
  4166. for (var n, s = [], r = function r(t) {
  4167. t = t;
  4168. var n = 987654321,
  4169. s = 4294967295;
  4170. return function () {
  4171. var r = ((n = 36969 * (65535 & n) + (n >> 16) & s) << 16) + (t = 18e3 * (65535 & t) + (t >> 16) & s) & s;
  4172. return r /= 4294967296, (r += .5) * (e.random() > .5 ? 1 : -1);
  4173. };
  4174. }, i = 0; i < t; i += 4) {
  4175. var a = r(4294967296 * (n || e.random()));
  4176. n = 987654071 * a(), s.push(4294967296 * a() | 0);
  4177. }
  4178. return new o.init(s, t);
  4179. }
  4180. }),
  4181. a = s.enc = {},
  4182. c = a.Hex = {
  4183. stringify: function stringify(e) {
  4184. for (var t = e.words, n = e.sigBytes, s = [], r = 0; r < n; r++) {
  4185. var i = t[r >>> 2] >>> 24 - r % 4 * 8 & 255;
  4186. s.push((i >>> 4).toString(16)), s.push((15 & i).toString(16));
  4187. }
  4188. return s.join("");
  4189. },
  4190. parse: function parse(e) {
  4191. for (var t = e.length, n = [], s = 0; s < t; s += 2) {
  4192. n[s >>> 3] |= parseInt(e.substr(s, 2), 16) << 24 - s % 8 * 4;
  4193. }
  4194. return new o.init(n, t / 2);
  4195. }
  4196. },
  4197. u = a.Latin1 = {
  4198. stringify: function stringify(e) {
  4199. for (var t = e.words, n = e.sigBytes, s = [], r = 0; r < n; r++) {
  4200. var i = t[r >>> 2] >>> 24 - r % 4 * 8 & 255;
  4201. s.push(String.fromCharCode(i));
  4202. }
  4203. return s.join("");
  4204. },
  4205. parse: function parse(e) {
  4206. for (var t = e.length, n = [], s = 0; s < t; s++) {
  4207. n[s >>> 2] |= (255 & e.charCodeAt(s)) << 24 - s % 4 * 8;
  4208. }
  4209. return new o.init(n, t);
  4210. }
  4211. },
  4212. h = a.Utf8 = {
  4213. stringify: function stringify(e) {
  4214. try {
  4215. return decodeURIComponent(escape(u.stringify(e)));
  4216. } catch (e) {
  4217. throw new Error("Malformed UTF-8 data");
  4218. }
  4219. },
  4220. parse: function parse(e) {
  4221. return u.parse(unescape(encodeURIComponent(e)));
  4222. }
  4223. },
  4224. l = r.BufferedBlockAlgorithm = i.extend({
  4225. reset: function reset() {
  4226. this._data = new o.init(), this._nDataBytes = 0;
  4227. },
  4228. _append: function _append(e) {
  4229. "string" == typeof e && (e = h.parse(e)), this._data.concat(e), this._nDataBytes += e.sigBytes;
  4230. },
  4231. _process: function _process(t) {
  4232. var n = this._data,
  4233. s = n.words,
  4234. r = n.sigBytes,
  4235. i = this.blockSize,
  4236. a = r / (4 * i),
  4237. c = (a = t ? e.ceil(a) : e.max((0 | a) - this._minBufferSize, 0)) * i,
  4238. u = e.min(4 * c, r);
  4239. if (c) {
  4240. for (var h = 0; h < c; h += i) {
  4241. this._doProcessBlock(s, h);
  4242. }
  4243. var l = s.splice(0, c);
  4244. n.sigBytes -= u;
  4245. }
  4246. return new o.init(l, u);
  4247. },
  4248. clone: function clone() {
  4249. var e = i.clone.call(this);
  4250. return e._data = this._data.clone(), e;
  4251. },
  4252. _minBufferSize: 0
  4253. });
  4254. r.Hasher = l.extend({
  4255. cfg: i.extend(),
  4256. init: function init(e) {
  4257. this.cfg = this.cfg.extend(e), this.reset();
  4258. },
  4259. reset: function reset() {
  4260. l.reset.call(this), this._doReset();
  4261. },
  4262. update: function update(e) {
  4263. return this._append(e), this._process(), this;
  4264. },
  4265. finalize: function finalize(e) {
  4266. return e && this._append(e), this._doFinalize();
  4267. },
  4268. blockSize: 16,
  4269. _createHelper: function _createHelper(e) {
  4270. return function (t, n) {
  4271. return new e.init(n).finalize(t);
  4272. };
  4273. },
  4274. _createHmacHelper: function _createHmacHelper(e) {
  4275. return function (t, n) {
  4276. return new d.HMAC.init(e, n).finalize(t);
  4277. };
  4278. }
  4279. });
  4280. var d = s.algo = {};
  4281. return s;
  4282. }(Math), n);
  4283. }),
  4284. i = r,
  4285. o = (s(function (e, t) {
  4286. var n;
  4287. e.exports = (n = i, function (e) {
  4288. var t = n,
  4289. s = t.lib,
  4290. r = s.WordArray,
  4291. i = s.Hasher,
  4292. o = t.algo,
  4293. a = [];
  4294. !function () {
  4295. for (var t = 0; t < 64; t++) {
  4296. a[t] = 4294967296 * e.abs(e.sin(t + 1)) | 0;
  4297. }
  4298. }();
  4299. var c = o.MD5 = i.extend({
  4300. _doReset: function _doReset() {
  4301. this._hash = new r.init([1732584193, 4023233417, 2562383102, 271733878]);
  4302. },
  4303. _doProcessBlock: function _doProcessBlock(e, t) {
  4304. for (var n = 0; n < 16; n++) {
  4305. var s = t + n,
  4306. r = e[s];
  4307. e[s] = 16711935 & (r << 8 | r >>> 24) | 4278255360 & (r << 24 | r >>> 8);
  4308. }
  4309. var i = this._hash.words,
  4310. o = e[t + 0],
  4311. c = e[t + 1],
  4312. p = e[t + 2],
  4313. f = e[t + 3],
  4314. g = e[t + 4],
  4315. m = e[t + 5],
  4316. y = e[t + 6],
  4317. _ = e[t + 7],
  4318. w = e[t + 8],
  4319. v = e[t + 9],
  4320. I = e[t + 10],
  4321. S = e[t + 11],
  4322. b = e[t + 12],
  4323. k = e[t + 13],
  4324. C = e[t + 14],
  4325. T = e[t + 15],
  4326. P = i[0],
  4327. A = i[1],
  4328. E = i[2],
  4329. O = i[3];
  4330. P = u(P, A, E, O, o, 7, a[0]), O = u(O, P, A, E, c, 12, a[1]), E = u(E, O, P, A, p, 17, a[2]), A = u(A, E, O, P, f, 22, a[3]), P = u(P, A, E, O, g, 7, a[4]), O = u(O, P, A, E, m, 12, a[5]), E = u(E, O, P, A, y, 17, a[6]), A = u(A, E, O, P, _, 22, a[7]), P = u(P, A, E, O, w, 7, a[8]), O = u(O, P, A, E, v, 12, a[9]), E = u(E, O, P, A, I, 17, a[10]), A = u(A, E, O, P, S, 22, a[11]), P = u(P, A, E, O, b, 7, a[12]), O = u(O, P, A, E, k, 12, a[13]), E = u(E, O, P, A, C, 17, a[14]), P = h(P, A = u(A, E, O, P, T, 22, a[15]), E, O, c, 5, a[16]), O = h(O, P, A, E, y, 9, a[17]), E = h(E, O, P, A, S, 14, a[18]), A = h(A, E, O, P, o, 20, a[19]), P = h(P, A, E, O, m, 5, a[20]), O = h(O, P, A, E, I, 9, a[21]), E = h(E, O, P, A, T, 14, a[22]), A = h(A, E, O, P, g, 20, a[23]), P = h(P, A, E, O, v, 5, a[24]), O = h(O, P, A, E, C, 9, a[25]), E = h(E, O, P, A, f, 14, a[26]), A = h(A, E, O, P, w, 20, a[27]), P = h(P, A, E, O, k, 5, a[28]), O = h(O, P, A, E, p, 9, a[29]), E = h(E, O, P, A, _, 14, a[30]), P = l(P, A = h(A, E, O, P, b, 20, a[31]), E, O, m, 4, a[32]), O = l(O, P, A, E, w, 11, a[33]), E = l(E, O, P, A, S, 16, a[34]), A = l(A, E, O, P, C, 23, a[35]), P = l(P, A, E, O, c, 4, a[36]), O = l(O, P, A, E, g, 11, a[37]), E = l(E, O, P, A, _, 16, a[38]), A = l(A, E, O, P, I, 23, a[39]), P = l(P, A, E, O, k, 4, a[40]), O = l(O, P, A, E, o, 11, a[41]), E = l(E, O, P, A, f, 16, a[42]), A = l(A, E, O, P, y, 23, a[43]), P = l(P, A, E, O, v, 4, a[44]), O = l(O, P, A, E, b, 11, a[45]), E = l(E, O, P, A, T, 16, a[46]), P = d(P, A = l(A, E, O, P, p, 23, a[47]), E, O, o, 6, a[48]), O = d(O, P, A, E, _, 10, a[49]), E = d(E, O, P, A, C, 15, a[50]), A = d(A, E, O, P, m, 21, a[51]), P = d(P, A, E, O, b, 6, a[52]), O = d(O, P, A, E, f, 10, a[53]), E = d(E, O, P, A, I, 15, a[54]), A = d(A, E, O, P, c, 21, a[55]), P = d(P, A, E, O, w, 6, a[56]), O = d(O, P, A, E, T, 10, a[57]), E = d(E, O, P, A, y, 15, a[58]), A = d(A, E, O, P, k, 21, a[59]), P = d(P, A, E, O, g, 6, a[60]), O = d(O, P, A, E, S, 10, a[61]), E = d(E, O, P, A, p, 15, a[62]), A = d(A, E, O, P, v, 21, a[63]), i[0] = i[0] + P | 0, i[1] = i[1] + A | 0, i[2] = i[2] + E | 0, i[3] = i[3] + O | 0;
  4331. },
  4332. _doFinalize: function _doFinalize() {
  4333. var t = this._data,
  4334. n = t.words,
  4335. s = 8 * this._nDataBytes,
  4336. r = 8 * t.sigBytes;
  4337. n[r >>> 5] |= 128 << 24 - r % 32;
  4338. var i = e.floor(s / 4294967296),
  4339. o = s;
  4340. n[15 + (r + 64 >>> 9 << 4)] = 16711935 & (i << 8 | i >>> 24) | 4278255360 & (i << 24 | i >>> 8), n[14 + (r + 64 >>> 9 << 4)] = 16711935 & (o << 8 | o >>> 24) | 4278255360 & (o << 24 | o >>> 8), t.sigBytes = 4 * (n.length + 1), this._process();
  4341. for (var a = this._hash, c = a.words, u = 0; u < 4; u++) {
  4342. var h = c[u];
  4343. c[u] = 16711935 & (h << 8 | h >>> 24) | 4278255360 & (h << 24 | h >>> 8);
  4344. }
  4345. return a;
  4346. },
  4347. clone: function clone() {
  4348. var e = i.clone.call(this);
  4349. return e._hash = this._hash.clone(), e;
  4350. }
  4351. });
  4352. function u(e, t, n, s, r, i, o) {
  4353. var a = e + (t & n | ~t & s) + r + o;
  4354. return (a << i | a >>> 32 - i) + t;
  4355. }
  4356. function h(e, t, n, s, r, i, o) {
  4357. var a = e + (t & s | n & ~s) + r + o;
  4358. return (a << i | a >>> 32 - i) + t;
  4359. }
  4360. function l(e, t, n, s, r, i, o) {
  4361. var a = e + (t ^ n ^ s) + r + o;
  4362. return (a << i | a >>> 32 - i) + t;
  4363. }
  4364. function d(e, t, n, s, r, i, o) {
  4365. var a = e + (n ^ (t | ~s)) + r + o;
  4366. return (a << i | a >>> 32 - i) + t;
  4367. }
  4368. t.MD5 = i._createHelper(c), t.HmacMD5 = i._createHmacHelper(c);
  4369. }(Math), n.MD5);
  4370. }), s(function (e, t) {
  4371. var n;
  4372. e.exports = (n = i, void function () {
  4373. var e = n,
  4374. t = e.lib.Base,
  4375. s = e.enc.Utf8;
  4376. e.algo.HMAC = t.extend({
  4377. init: function init(e, t) {
  4378. e = this._hasher = new e.init(), "string" == typeof t && (t = s.parse(t));
  4379. var n = e.blockSize,
  4380. r = 4 * n;
  4381. t.sigBytes > r && (t = e.finalize(t)), t.clamp();
  4382. for (var i = this._oKey = t.clone(), o = this._iKey = t.clone(), a = i.words, c = o.words, u = 0; u < n; u++) {
  4383. a[u] ^= 1549556828, c[u] ^= 909522486;
  4384. }
  4385. i.sigBytes = o.sigBytes = r, this.reset();
  4386. },
  4387. reset: function reset() {
  4388. var e = this._hasher;
  4389. e.reset(), e.update(this._iKey);
  4390. },
  4391. update: function update(e) {
  4392. return this._hasher.update(e), this;
  4393. },
  4394. finalize: function finalize(e) {
  4395. var t = this._hasher,
  4396. n = t.finalize(e);
  4397. return t.reset(), t.finalize(this._oKey.clone().concat(n));
  4398. }
  4399. });
  4400. }());
  4401. }), s(function (e, t) {
  4402. e.exports = i.HmacMD5;
  4403. })),
  4404. a = s(function (e, t) {
  4405. e.exports = i.enc.Utf8;
  4406. }),
  4407. c = s(function (e, t) {
  4408. var n;
  4409. e.exports = (n = i, function () {
  4410. var e = n,
  4411. t = e.lib.WordArray;
  4412. function s(e, n, s) {
  4413. for (var r = [], i = 0, o = 0; o < n; o++) {
  4414. if (o % 4) {
  4415. var a = s[e.charCodeAt(o - 1)] << o % 4 * 2,
  4416. c = s[e.charCodeAt(o)] >>> 6 - o % 4 * 2;
  4417. r[i >>> 2] |= (a | c) << 24 - i % 4 * 8, i++;
  4418. }
  4419. }
  4420. return t.create(r, i);
  4421. }
  4422. e.enc.Base64 = {
  4423. stringify: function stringify(e) {
  4424. var t = e.words,
  4425. n = e.sigBytes,
  4426. s = this._map;
  4427. e.clamp();
  4428. for (var r = [], i = 0; i < n; i += 3) {
  4429. for (var o = (t[i >>> 2] >>> 24 - i % 4 * 8 & 255) << 16 | (t[i + 1 >>> 2] >>> 24 - (i + 1) % 4 * 8 & 255) << 8 | t[i + 2 >>> 2] >>> 24 - (i + 2) % 4 * 8 & 255, a = 0; a < 4 && i + .75 * a < n; a++) {
  4430. r.push(s.charAt(o >>> 6 * (3 - a) & 63));
  4431. }
  4432. }
  4433. var c = s.charAt(64);
  4434. if (c) for (; r.length % 4;) {
  4435. r.push(c);
  4436. }
  4437. return r.join("");
  4438. },
  4439. parse: function parse(e) {
  4440. var t = e.length,
  4441. n = this._map,
  4442. r = this._reverseMap;
  4443. if (!r) {
  4444. r = this._reverseMap = [];
  4445. for (var i = 0; i < n.length; i++) {
  4446. r[n.charCodeAt(i)] = i;
  4447. }
  4448. }
  4449. var o = n.charAt(64);
  4450. if (o) {
  4451. var a = e.indexOf(o);
  4452. -1 !== a && (t = a);
  4453. }
  4454. return s(e, t, r);
  4455. },
  4456. _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
  4457. };
  4458. }(), n.enc.Base64);
  4459. });
  4460. var u = "FUNCTION",
  4461. h = "OBJECT",
  4462. l = "CLIENT_DB",
  4463. d = "pending",
  4464. p = "fullfilled",
  4465. f = "rejected";
  4466. function g(e) {
  4467. return Object.prototype.toString.call(e).slice(8, -1).toLowerCase();
  4468. }
  4469. function m(e) {
  4470. return "object" === g(e);
  4471. }
  4472. function y(e) {
  4473. return "function" == typeof e;
  4474. }
  4475. function _(e) {
  4476. return function () {
  4477. try {
  4478. return e.apply(e, arguments);
  4479. } catch (e) {
  4480. console.error(e);
  4481. }
  4482. };
  4483. }
  4484. var w = "REJECTED",
  4485. v = "NOT_PENDING";
  4486. var I = /*#__PURE__*/function () {
  4487. function I() {
  4488. var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  4489. e = _ref.createPromise,
  4490. _ref$retryRule = _ref.retryRule,
  4491. t = _ref$retryRule === void 0 ? w : _ref$retryRule;
  4492. (0, _classCallCheck2.default)(this, I);
  4493. this.createPromise = e, this.status = null, this.promise = null, this.retryRule = t;
  4494. }
  4495. (0, _createClass2.default)(I, [{
  4496. key: "needRetry",
  4497. get: function get() {
  4498. if (!this.status) return !0;
  4499. switch (this.retryRule) {
  4500. case w:
  4501. return this.status === f;
  4502. case v:
  4503. return this.status !== d;
  4504. }
  4505. }
  4506. }, {
  4507. key: "exec",
  4508. value: function exec() {
  4509. var _this = this;
  4510. return this.needRetry ? (this.status = d, this.promise = this.createPromise().then(function (e) {
  4511. return _this.status = p, Promise.resolve(e);
  4512. }, function (e) {
  4513. return _this.status = f, Promise.reject(e);
  4514. }), this.promise) : this.promise;
  4515. }
  4516. }]);
  4517. return I;
  4518. }();
  4519. function S(e) {
  4520. return e && "string" == typeof e ? JSON.parse(e) : e;
  4521. }
  4522. var b = "development" === "development",
  4523. k = "mp-weixin",
  4524. C = "true" === undefined || !0 === undefined,
  4525. T = S([]),
  4526. P = "h5" === k ? "web" : "app-plus" === k ? "app" : k,
  4527. A = S(undefined),
  4528. E = S([]) || [],
  4529. O = true;
  4530. var x = "";
  4531. try {
  4532. x = (__webpack_require__(/*! uni-stat-config */ 216).default || __webpack_require__(/*! uni-stat-config */ 216)).appid;
  4533. } catch (e) {}
  4534. var R = {};
  4535. function U(e) {
  4536. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  4537. var n, s;
  4538. return n = R, s = e, Object.prototype.hasOwnProperty.call(n, s) || (R[e] = t), R[e];
  4539. }
  4540. "app" === P && (R = uni._globalUniCloudObj ? uni._globalUniCloudObj : uni._globalUniCloudObj = {});
  4541. var L = ["invoke", "success", "fail", "complete"],
  4542. N = U("_globalUniCloudInterceptor");
  4543. function D(e, t) {
  4544. N[e] || (N[e] = {}), m(t) && Object.keys(t).forEach(function (n) {
  4545. L.indexOf(n) > -1 && function (e, t, n) {
  4546. var s = N[e][t];
  4547. s || (s = N[e][t] = []), -1 === s.indexOf(n) && y(n) && s.push(n);
  4548. }(e, n, t[n]);
  4549. });
  4550. }
  4551. function F(e, t) {
  4552. N[e] || (N[e] = {}), m(t) ? Object.keys(t).forEach(function (n) {
  4553. L.indexOf(n) > -1 && function (e, t, n) {
  4554. var s = N[e][t];
  4555. if (!s) return;
  4556. var r = s.indexOf(n);
  4557. r > -1 && s.splice(r, 1);
  4558. }(e, n, t[n]);
  4559. }) : delete N[e];
  4560. }
  4561. function q(e, t) {
  4562. return e && 0 !== e.length ? e.reduce(function (e, n) {
  4563. return e.then(function () {
  4564. return n(t);
  4565. });
  4566. }, Promise.resolve()) : Promise.resolve();
  4567. }
  4568. function M(e, t) {
  4569. return N[e] && N[e][t] || [];
  4570. }
  4571. function K(e) {
  4572. D("callObject", e);
  4573. }
  4574. var j = U("_globalUniCloudListener"),
  4575. B = "response",
  4576. $ = "needLogin",
  4577. W = "refreshToken",
  4578. z = "clientdb",
  4579. J = "cloudfunction",
  4580. H = "cloudobject";
  4581. function G(e) {
  4582. return j[e] || (j[e] = []), j[e];
  4583. }
  4584. function V(e, t) {
  4585. var n = G(e);
  4586. n.includes(t) || n.push(t);
  4587. }
  4588. function Y(e, t) {
  4589. var n = G(e),
  4590. s = n.indexOf(t);
  4591. -1 !== s && n.splice(s, 1);
  4592. }
  4593. function Q(e, t) {
  4594. var n = G(e);
  4595. for (var _e2 = 0; _e2 < n.length; _e2++) {
  4596. (0, n[_e2])(t);
  4597. }
  4598. }
  4599. var X,
  4600. Z = !1;
  4601. function ee() {
  4602. return X || (X = new Promise(function (e) {
  4603. Z && e(), function t() {
  4604. if ("function" == typeof getCurrentPages) {
  4605. var _t2 = getCurrentPages();
  4606. _t2 && _t2[0] && (Z = !0, e());
  4607. }
  4608. Z || setTimeout(function () {
  4609. t();
  4610. }, 30);
  4611. }();
  4612. }), X);
  4613. }
  4614. function te(e) {
  4615. var t = {};
  4616. for (var _n2 in e) {
  4617. var _s2 = e[_n2];
  4618. y(_s2) && (t[_n2] = _(_s2));
  4619. }
  4620. return t;
  4621. }
  4622. var ne = /*#__PURE__*/function (_Error) {
  4623. (0, _inherits2.default)(ne, _Error);
  4624. var _super = _createSuper(ne);
  4625. function ne(e) {
  4626. var _this2;
  4627. (0, _classCallCheck2.default)(this, ne);
  4628. _this2 = _super.call(this, e.message), _this2.errMsg = e.message || e.errMsg || "unknown system error", _this2.code = _this2.errCode = e.code || e.errCode || "SYSTEM_ERROR", _this2.errSubject = _this2.subject = e.subject || e.errSubject, _this2.cause = e.cause, _this2.requestId = e.requestId;
  4629. return _this2;
  4630. }
  4631. (0, _createClass2.default)(ne, [{
  4632. key: "toJson",
  4633. value: function toJson() {
  4634. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
  4635. if (!(e >= 10)) return e++, {
  4636. errCode: this.errCode,
  4637. errMsg: this.errMsg,
  4638. errSubject: this.errSubject,
  4639. cause: this.cause && this.cause.toJson ? this.cause.toJson(e) : this.cause
  4640. };
  4641. }
  4642. }]);
  4643. return ne;
  4644. }( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
  4645. var se = {
  4646. request: function request(e) {
  4647. return uni.request(e);
  4648. },
  4649. uploadFile: function uploadFile(e) {
  4650. return uni.uploadFile(e);
  4651. },
  4652. setStorageSync: function setStorageSync(e, t) {
  4653. return uni.setStorageSync(e, t);
  4654. },
  4655. getStorageSync: function getStorageSync(e) {
  4656. return uni.getStorageSync(e);
  4657. },
  4658. removeStorageSync: function removeStorageSync(e) {
  4659. return uni.removeStorageSync(e);
  4660. },
  4661. clearStorageSync: function clearStorageSync() {
  4662. return uni.clearStorageSync();
  4663. }
  4664. };
  4665. function re() {
  4666. return {
  4667. token: se.getStorageSync("uni_id_token") || se.getStorageSync("uniIdToken"),
  4668. tokenExpired: se.getStorageSync("uni_id_token_expired")
  4669. };
  4670. }
  4671. function ie() {
  4672. var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  4673. e = _ref2.token,
  4674. t = _ref2.tokenExpired;
  4675. e && se.setStorageSync("uni_id_token", e), t && se.setStorageSync("uni_id_token_expired", t);
  4676. }
  4677. var oe, ae;
  4678. function ce() {
  4679. return oe || (oe = uni.getSystemInfoSync()), oe;
  4680. }
  4681. function ue() {
  4682. var e, t;
  4683. try {
  4684. if (uni.getLaunchOptionsSync) {
  4685. if (uni.getLaunchOptionsSync.toString().indexOf("not yet implemented") > -1) return;
  4686. var _uni$getLaunchOptions = uni.getLaunchOptionsSync(),
  4687. _n3 = _uni$getLaunchOptions.scene,
  4688. _s3 = _uni$getLaunchOptions.channel;
  4689. e = _s3, t = _n3;
  4690. }
  4691. } catch (e) {}
  4692. return {
  4693. channel: e,
  4694. scene: t
  4695. };
  4696. }
  4697. function he() {
  4698. var e = uni.getLocale && uni.getLocale() || "en";
  4699. if (ae) return _objectSpread(_objectSpread({}, ae), {}, {
  4700. locale: e,
  4701. LOCALE: e
  4702. });
  4703. var t = ce(),
  4704. n = t.deviceId,
  4705. s = t.osName,
  4706. r = t.uniPlatform,
  4707. i = t.appId,
  4708. o = ["pixelRatio", "brand", "model", "system", "language", "version", "platform", "host", "SDKVersion", "swanNativeVersion", "app", "AppPlatform", "fontSizeSetting"];
  4709. for (var _e3 = 0; _e3 < o.length; _e3++) {
  4710. delete t[o[_e3]];
  4711. }
  4712. return ae = _objectSpread(_objectSpread({
  4713. PLATFORM: r,
  4714. OS: s,
  4715. APPID: i,
  4716. DEVICEID: n
  4717. }, ue()), t), _objectSpread(_objectSpread({}, ae), {}, {
  4718. locale: e,
  4719. LOCALE: e
  4720. });
  4721. }
  4722. var le = {
  4723. sign: function sign(e, t) {
  4724. var n = "";
  4725. return Object.keys(e).sort().forEach(function (t) {
  4726. e[t] && (n = n + "&" + t + "=" + e[t]);
  4727. }), n = n.slice(1), o(n, t).toString();
  4728. },
  4729. wrappedRequest: function wrappedRequest(e, t) {
  4730. return new Promise(function (n, s) {
  4731. t(Object.assign(e, {
  4732. complete: function complete(e) {
  4733. e || (e = {}), b && "web" === P && e.errMsg && 0 === e.errMsg.indexOf("request:fail") && console.warn("发布H5,需要在uniCloud后台操作,绑定安全域名,否则会因为跨域问题而无法访问。教程参考:https://uniapp.dcloud.io/uniCloud/quickstart?id=useinh5");
  4734. var t = e.data && e.data.header && e.data.header["x-serverless-request-id"] || e.header && e.header["request-id"];
  4735. if (!e.statusCode || e.statusCode >= 400) return s(new ne({
  4736. code: "SYS_ERR",
  4737. message: e.errMsg || "request:fail",
  4738. requestId: t
  4739. }));
  4740. var r = e.data;
  4741. if (r.error) return s(new ne({
  4742. code: r.error.code,
  4743. message: r.error.message,
  4744. requestId: t
  4745. }));
  4746. r.result = r.data, r.requestId = t, delete r.data, n(r);
  4747. }
  4748. }));
  4749. });
  4750. },
  4751. toBase64: function toBase64(e) {
  4752. return c.stringify(a.parse(e));
  4753. }
  4754. },
  4755. de = {
  4756. "uniCloud.init.paramRequired": "{param} required",
  4757. "uniCloud.uploadFile.fileError": "filePath should be instance of File"
  4758. };
  4759. var _e4 = (0, _uniI18n.initVueI18n)({
  4760. "zh-Hans": {
  4761. "uniCloud.init.paramRequired": "缺少参数:{param}",
  4762. "uniCloud.uploadFile.fileError": "filePath应为File对象"
  4763. },
  4764. "zh-Hant": {
  4765. "uniCloud.init.paramRequired": "缺少参数:{param}",
  4766. "uniCloud.uploadFile.fileError": "filePath应为File对象"
  4767. },
  4768. en: de,
  4769. fr: {
  4770. "uniCloud.init.paramRequired": "{param} required",
  4771. "uniCloud.uploadFile.fileError": "filePath should be instance of File"
  4772. },
  4773. es: {
  4774. "uniCloud.init.paramRequired": "{param} required",
  4775. "uniCloud.uploadFile.fileError": "filePath should be instance of File"
  4776. },
  4777. ja: de
  4778. }, "zh-Hans"),
  4779. pe = _e4.t;
  4780. var fe = /*#__PURE__*/function () {
  4781. function fe(e) {
  4782. var _this3 = this;
  4783. (0, _classCallCheck2.default)(this, fe);
  4784. ["spaceId", "clientSecret"].forEach(function (t) {
  4785. if (!Object.prototype.hasOwnProperty.call(e, t)) throw new Error(pe("uniCloud.init.paramRequired", {
  4786. param: t
  4787. }));
  4788. }), this.config = Object.assign({}, {
  4789. endpoint: 0 === e.spaceId.indexOf("mp-") ? "https://api.next.bspapp.com" : "https://api.bspapp.com"
  4790. }, 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 = se, this._getAccessTokenPromiseHub = new I({
  4791. createPromise: function createPromise() {
  4792. return _this3.requestAuth(_this3.setupRequest({
  4793. method: "serverless.auth.user.anonymousAuthorize",
  4794. params: "{}"
  4795. }, "auth")).then(function (e) {
  4796. if (!e.result || !e.result.accessToken) throw new ne({
  4797. code: "AUTH_FAILED",
  4798. message: "获取accessToken失败"
  4799. });
  4800. _this3.setAccessToken(e.result.accessToken);
  4801. });
  4802. },
  4803. retryRule: v
  4804. });
  4805. }
  4806. (0, _createClass2.default)(fe, [{
  4807. key: "hasAccessToken",
  4808. get: function get() {
  4809. return !!this.accessToken;
  4810. }
  4811. }, {
  4812. key: "setAccessToken",
  4813. value: function setAccessToken(e) {
  4814. this.accessToken = e;
  4815. }
  4816. }, {
  4817. key: "requestWrapped",
  4818. value: function requestWrapped(e) {
  4819. return le.wrappedRequest(e, this.adapter.request);
  4820. }
  4821. }, {
  4822. key: "requestAuth",
  4823. value: function requestAuth(e) {
  4824. return this.requestWrapped(e);
  4825. }
  4826. }, {
  4827. key: "request",
  4828. value: function request(e, t) {
  4829. var _this4 = this;
  4830. return Promise.resolve().then(function () {
  4831. return _this4.hasAccessToken ? t ? _this4.requestWrapped(e) : _this4.requestWrapped(e).catch(function (t) {
  4832. return new Promise(function (e, n) {
  4833. !t || "GATEWAY_INVALID_TOKEN" !== t.code && "InvalidParameter.InvalidToken" !== t.code ? n(t) : e();
  4834. }).then(function () {
  4835. return _this4.getAccessToken();
  4836. }).then(function () {
  4837. var t = _this4.rebuildRequest(e);
  4838. return _this4.request(t, !0);
  4839. });
  4840. }) : _this4.getAccessToken().then(function () {
  4841. var t = _this4.rebuildRequest(e);
  4842. return _this4.request(t, !0);
  4843. });
  4844. });
  4845. }
  4846. }, {
  4847. key: "rebuildRequest",
  4848. value: function rebuildRequest(e) {
  4849. var t = Object.assign({}, e);
  4850. return t.data.token = this.accessToken, t.header["x-basement-token"] = this.accessToken, t.header["x-serverless-sign"] = le.sign(t.data, this.config.clientSecret), t;
  4851. }
  4852. }, {
  4853. key: "setupRequest",
  4854. value: function setupRequest(e, t) {
  4855. var n = Object.assign({}, e, {
  4856. spaceId: this.config.spaceId,
  4857. timestamp: Date.now()
  4858. }),
  4859. s = {
  4860. "Content-Type": "application/json"
  4861. };
  4862. return "auth" !== t && (n.token = this.accessToken, s["x-basement-token"] = this.accessToken), s["x-serverless-sign"] = le.sign(n, this.config.clientSecret), {
  4863. url: this.config.requestUrl,
  4864. method: "POST",
  4865. data: n,
  4866. dataType: "json",
  4867. header: s
  4868. };
  4869. }
  4870. }, {
  4871. key: "getAccessToken",
  4872. value: function getAccessToken() {
  4873. return this._getAccessTokenPromiseHub.exec();
  4874. }
  4875. }, {
  4876. key: "authorize",
  4877. value: function () {
  4878. var _authorize = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
  4879. return _regenerator.default.wrap(function _callee$(_context) {
  4880. while (1) {
  4881. switch (_context.prev = _context.next) {
  4882. case 0:
  4883. _context.next = 2;
  4884. return this.getAccessToken();
  4885. case 2:
  4886. case "end":
  4887. return _context.stop();
  4888. }
  4889. }
  4890. }, _callee, this);
  4891. }));
  4892. function authorize() {
  4893. return _authorize.apply(this, arguments);
  4894. }
  4895. return authorize;
  4896. }()
  4897. }, {
  4898. key: "callFunction",
  4899. value: function callFunction(e) {
  4900. var t = {
  4901. method: "serverless.function.runtime.invoke",
  4902. params: JSON.stringify({
  4903. functionTarget: e.name,
  4904. functionArgs: e.data || {}
  4905. })
  4906. };
  4907. return this.request(this.setupRequest(t));
  4908. }
  4909. }, {
  4910. key: "getOSSUploadOptionsFromPath",
  4911. value: function getOSSUploadOptionsFromPath(e) {
  4912. var t = {
  4913. method: "serverless.file.resource.generateProximalSign",
  4914. params: JSON.stringify(e)
  4915. };
  4916. return this.request(this.setupRequest(t));
  4917. }
  4918. }, {
  4919. key: "uploadFileToOSS",
  4920. value: function uploadFileToOSS(_ref3) {
  4921. var _this5 = this;
  4922. var e = _ref3.url,
  4923. t = _ref3.formData,
  4924. n = _ref3.name,
  4925. s = _ref3.filePath,
  4926. r = _ref3.fileType,
  4927. i = _ref3.onUploadProgress;
  4928. return new Promise(function (o, a) {
  4929. var c = _this5.adapter.uploadFile({
  4930. url: e,
  4931. formData: t,
  4932. name: n,
  4933. filePath: s,
  4934. fileType: r,
  4935. header: {
  4936. "X-OSS-server-side-encrpytion": "AES256"
  4937. },
  4938. success: function success(e) {
  4939. e && e.statusCode < 400 ? o(e) : a(new ne({
  4940. code: "UPLOAD_FAILED",
  4941. message: "文件上传失败"
  4942. }));
  4943. },
  4944. fail: function fail(e) {
  4945. a(new ne({
  4946. code: e.code || "UPLOAD_FAILED",
  4947. message: e.message || e.errMsg || "文件上传失败"
  4948. }));
  4949. }
  4950. });
  4951. "function" == typeof i && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (e) {
  4952. i({
  4953. loaded: e.totalBytesSent,
  4954. total: e.totalBytesExpectedToSend
  4955. });
  4956. });
  4957. });
  4958. }
  4959. }, {
  4960. key: "reportOSSUpload",
  4961. value: function reportOSSUpload(e) {
  4962. var t = {
  4963. method: "serverless.file.resource.report",
  4964. params: JSON.stringify(e)
  4965. };
  4966. return this.request(this.setupRequest(t));
  4967. }
  4968. }, {
  4969. key: "uploadFile",
  4970. value: function () {
  4971. var _uploadFile = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(_ref4) {
  4972. var e, t, _ref4$fileType, n, _ref4$cloudPathAsReal, s, r, i, o, a, c, u, h, l, d, p, f, m, y, _, _e5, w;
  4973. return _regenerator.default.wrap(function _callee2$(_context2) {
  4974. while (1) {
  4975. switch (_context2.prev = _context2.next) {
  4976. case 0:
  4977. e = _ref4.filePath, t = _ref4.cloudPath, _ref4$fileType = _ref4.fileType, n = _ref4$fileType === void 0 ? "image" : _ref4$fileType, _ref4$cloudPathAsReal = _ref4.cloudPathAsRealPath, s = _ref4$cloudPathAsReal === void 0 ? !1 : _ref4$cloudPathAsReal, r = _ref4.onUploadProgress, i = _ref4.config;
  4978. if (!("string" !== g(t))) {
  4979. _context2.next = 3;
  4980. break;
  4981. }
  4982. throw new ne({
  4983. code: "INVALID_PARAM",
  4984. message: "cloudPath必须为字符串类型"
  4985. });
  4986. case 3:
  4987. if (t = t.trim()) {
  4988. _context2.next = 5;
  4989. break;
  4990. }
  4991. throw new ne({
  4992. code: "INVALID_PARAM",
  4993. message: "cloudPath不可为空"
  4994. });
  4995. case 5:
  4996. if (!/:\/\//.test(t)) {
  4997. _context2.next = 7;
  4998. break;
  4999. }
  5000. throw new ne({
  5001. code: "INVALID_PARAM",
  5002. message: "cloudPath不合法"
  5003. });
  5004. case 7:
  5005. o = i && i.envType || this.config.envType;
  5006. if (!(s && ("/" !== t[0] && (t = "/" + t), t.indexOf("\\") > -1))) {
  5007. _context2.next = 10;
  5008. break;
  5009. }
  5010. throw new ne({
  5011. code: "INVALID_PARAM",
  5012. message: "使用cloudPath作为路径时,cloudPath不可包含“\\”"
  5013. });
  5014. case 10:
  5015. _context2.next = 12;
  5016. return this.getOSSUploadOptionsFromPath({
  5017. env: o,
  5018. filename: s ? t.split("/").pop() : t,
  5019. fileId: s ? t : void 0
  5020. });
  5021. case 12:
  5022. a = _context2.sent.result;
  5023. c = "https://" + a.cdnDomain + "/" + a.ossPath;
  5024. u = a.securityToken;
  5025. h = a.accessKeyId;
  5026. l = a.signature;
  5027. d = a.host;
  5028. p = a.ossPath;
  5029. f = a.id;
  5030. m = a.policy;
  5031. y = a.ossCallbackUrl;
  5032. _ = {
  5033. "Cache-Control": "max-age=2592000",
  5034. "Content-Disposition": "attachment",
  5035. OSSAccessKeyId: h,
  5036. Signature: l,
  5037. host: d,
  5038. id: f,
  5039. key: p,
  5040. policy: m,
  5041. success_action_status: 200
  5042. };
  5043. if (u && (_["x-oss-security-token"] = u), y) {
  5044. _e5 = JSON.stringify({
  5045. callbackUrl: y,
  5046. callbackBody: JSON.stringify({
  5047. fileId: f,
  5048. spaceId: this.config.spaceId
  5049. }),
  5050. callbackBodyType: "application/json"
  5051. });
  5052. _.callback = le.toBase64(_e5);
  5053. }
  5054. w = {
  5055. url: "https://" + a.host,
  5056. formData: _,
  5057. fileName: "file",
  5058. name: "file",
  5059. filePath: e,
  5060. fileType: n
  5061. };
  5062. _context2.next = 27;
  5063. return this.uploadFileToOSS(Object.assign({}, w, {
  5064. onUploadProgress: r
  5065. }));
  5066. case 27:
  5067. if (!y) {
  5068. _context2.next = 29;
  5069. break;
  5070. }
  5071. return _context2.abrupt("return", {
  5072. success: !0,
  5073. filePath: e,
  5074. fileID: c
  5075. });
  5076. case 29:
  5077. _context2.next = 31;
  5078. return this.reportOSSUpload({
  5079. id: f
  5080. });
  5081. case 31:
  5082. if (!_context2.sent.success) {
  5083. _context2.next = 33;
  5084. break;
  5085. }
  5086. return _context2.abrupt("return", {
  5087. success: !0,
  5088. filePath: e,
  5089. fileID: c
  5090. });
  5091. case 33:
  5092. throw new ne({
  5093. code: "UPLOAD_FAILED",
  5094. message: "文件上传失败"
  5095. });
  5096. case 34:
  5097. case "end":
  5098. return _context2.stop();
  5099. }
  5100. }
  5101. }, _callee2, this);
  5102. }));
  5103. function uploadFile(_x) {
  5104. return _uploadFile.apply(this, arguments);
  5105. }
  5106. return uploadFile;
  5107. }()
  5108. }, {
  5109. key: "getTempFileURL",
  5110. value: function getTempFileURL() {
  5111. var _ref5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  5112. e = _ref5.fileList;
  5113. return new Promise(function (t, n) {
  5114. Array.isArray(e) && 0 !== e.length || n(new ne({
  5115. code: "INVALID_PARAM",
  5116. message: "fileList的元素必须是非空的字符串"
  5117. })), t({
  5118. fileList: e.map(function (e) {
  5119. return {
  5120. fileID: e,
  5121. tempFileURL: e
  5122. };
  5123. })
  5124. });
  5125. });
  5126. }
  5127. }, {
  5128. key: "getFileInfo",
  5129. value: function () {
  5130. var _getFileInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
  5131. var _ref6,
  5132. e,
  5133. t,
  5134. _args3 = arguments;
  5135. return _regenerator.default.wrap(function _callee3$(_context3) {
  5136. while (1) {
  5137. switch (_context3.prev = _context3.next) {
  5138. case 0:
  5139. _ref6 = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {}, e = _ref6.fileList;
  5140. if (!(!Array.isArray(e) || 0 === e.length)) {
  5141. _context3.next = 3;
  5142. break;
  5143. }
  5144. throw new ne({
  5145. code: "INVALID_PARAM",
  5146. message: "fileList的元素必须是非空的字符串"
  5147. });
  5148. case 3:
  5149. t = {
  5150. method: "serverless.file.resource.info",
  5151. params: JSON.stringify({
  5152. id: e.map(function (e) {
  5153. return e.split("?")[0];
  5154. }).join(",")
  5155. })
  5156. };
  5157. _context3.next = 6;
  5158. return this.request(this.setupRequest(t));
  5159. case 6:
  5160. _context3.t0 = _context3.sent.result;
  5161. return _context3.abrupt("return", {
  5162. fileList: _context3.t0
  5163. });
  5164. case 8:
  5165. case "end":
  5166. return _context3.stop();
  5167. }
  5168. }
  5169. }, _callee3, this);
  5170. }));
  5171. function getFileInfo() {
  5172. return _getFileInfo.apply(this, arguments);
  5173. }
  5174. return getFileInfo;
  5175. }()
  5176. }]);
  5177. return fe;
  5178. }();
  5179. var ge = {
  5180. init: function init(e) {
  5181. var t = new fe(e),
  5182. n = {
  5183. signInAnonymously: function signInAnonymously() {
  5184. return t.authorize();
  5185. },
  5186. getLoginState: function getLoginState() {
  5187. return Promise.resolve(!1);
  5188. }
  5189. };
  5190. return t.auth = function () {
  5191. return n;
  5192. }, t.customAuth = t.auth, t;
  5193. }
  5194. };
  5195. var me = "undefined" != typeof location && "http:" === location.protocol ? "http:" : "https:";
  5196. var ye;
  5197. !function (e) {
  5198. e.local = "local", e.none = "none", e.session = "session";
  5199. }(ye || (ye = {}));
  5200. var _e = function _e() {};
  5201. var we = function we() {
  5202. var e;
  5203. if (!Promise) {
  5204. e = function e() {}, e.promise = {};
  5205. var _t3 = function _t3() {
  5206. throw new ne({
  5207. message: 'Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.'
  5208. });
  5209. };
  5210. return Object.defineProperty(e.promise, "then", {
  5211. get: _t3
  5212. }), Object.defineProperty(e.promise, "catch", {
  5213. get: _t3
  5214. }), e;
  5215. }
  5216. var t = new Promise(function (t, n) {
  5217. e = function e(_e6, s) {
  5218. return _e6 ? n(_e6) : t(s);
  5219. };
  5220. });
  5221. return e.promise = t, e;
  5222. };
  5223. function ve(e) {
  5224. return void 0 === e;
  5225. }
  5226. function Ie(e) {
  5227. return "[object Null]" === Object.prototype.toString.call(e);
  5228. }
  5229. var Se;
  5230. function be(e) {
  5231. var t = (n = e, "[object Array]" === Object.prototype.toString.call(n) ? e : [e]);
  5232. var n;
  5233. var _iterator = _createForOfIteratorHelper(t),
  5234. _step;
  5235. try {
  5236. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  5237. var _e7 = _step.value;
  5238. var _t4 = _e7.isMatch,
  5239. _n4 = _e7.genAdapter,
  5240. _s4 = _e7.runtime;
  5241. if (_t4()) return {
  5242. adapter: _n4(),
  5243. runtime: _s4
  5244. };
  5245. }
  5246. } catch (err) {
  5247. _iterator.e(err);
  5248. } finally {
  5249. _iterator.f();
  5250. }
  5251. }
  5252. !function (e) {
  5253. e.WEB = "web", e.WX_MP = "wx_mp";
  5254. }(Se || (Se = {}));
  5255. var ke = {
  5256. adapter: null,
  5257. runtime: void 0
  5258. },
  5259. Ce = ["anonymousUuidKey"];
  5260. var Te = /*#__PURE__*/function (_e8) {
  5261. (0, _inherits2.default)(Te, _e8);
  5262. var _super2 = _createSuper(Te);
  5263. function Te() {
  5264. var _this6;
  5265. (0, _classCallCheck2.default)(this, Te);
  5266. _this6 = _super2.call(this), ke.adapter.root.tcbObject || (ke.adapter.root.tcbObject = {});
  5267. return _this6;
  5268. }
  5269. (0, _createClass2.default)(Te, [{
  5270. key: "setItem",
  5271. value: function setItem(e, t) {
  5272. ke.adapter.root.tcbObject[e] = t;
  5273. }
  5274. }, {
  5275. key: "getItem",
  5276. value: function getItem(e) {
  5277. return ke.adapter.root.tcbObject[e];
  5278. }
  5279. }, {
  5280. key: "removeItem",
  5281. value: function removeItem(e) {
  5282. delete ke.adapter.root.tcbObject[e];
  5283. }
  5284. }, {
  5285. key: "clear",
  5286. value: function clear() {
  5287. delete ke.adapter.root.tcbObject;
  5288. }
  5289. }]);
  5290. return Te;
  5291. }(_e);
  5292. function Pe(e, t) {
  5293. switch (e) {
  5294. case "local":
  5295. return t.localStorage || new Te();
  5296. case "none":
  5297. return new Te();
  5298. default:
  5299. return t.sessionStorage || new Te();
  5300. }
  5301. }
  5302. var Ae = /*#__PURE__*/function () {
  5303. function Ae(e) {
  5304. (0, _classCallCheck2.default)(this, Ae);
  5305. if (!this._storage) {
  5306. this._persistence = ke.adapter.primaryStorage || e.persistence, this._storage = Pe(this._persistence, ke.adapter);
  5307. var _t5 = "access_token_".concat(e.env),
  5308. _n5 = "access_token_expire_".concat(e.env),
  5309. _s5 = "refresh_token_".concat(e.env),
  5310. _r = "anonymous_uuid_".concat(e.env),
  5311. _i = "login_type_".concat(e.env),
  5312. _o = "user_info_".concat(e.env);
  5313. this.keys = {
  5314. accessTokenKey: _t5,
  5315. accessTokenExpireKey: _n5,
  5316. refreshTokenKey: _s5,
  5317. anonymousUuidKey: _r,
  5318. loginTypeKey: _i,
  5319. userInfoKey: _o
  5320. };
  5321. }
  5322. }
  5323. (0, _createClass2.default)(Ae, [{
  5324. key: "updatePersistence",
  5325. value: function updatePersistence(e) {
  5326. if (e === this._persistence) return;
  5327. var t = "local" === this._persistence;
  5328. this._persistence = e;
  5329. var n = Pe(e, ke.adapter);
  5330. for (var _e9 in this.keys) {
  5331. var _s6 = this.keys[_e9];
  5332. if (t && Ce.includes(_e9)) continue;
  5333. var _r2 = this._storage.getItem(_s6);
  5334. ve(_r2) || Ie(_r2) || (n.setItem(_s6, _r2), this._storage.removeItem(_s6));
  5335. }
  5336. this._storage = n;
  5337. }
  5338. }, {
  5339. key: "setStore",
  5340. value: function setStore(e, t, n) {
  5341. if (!this._storage) return;
  5342. var s = {
  5343. version: n || "localCachev1",
  5344. content: t
  5345. },
  5346. r = JSON.stringify(s);
  5347. try {
  5348. this._storage.setItem(e, r);
  5349. } catch (e) {
  5350. throw e;
  5351. }
  5352. }
  5353. }, {
  5354. key: "getStore",
  5355. value: function getStore(e, t) {
  5356. try {
  5357. if (!this._storage) return;
  5358. } catch (e) {
  5359. return "";
  5360. }
  5361. t = t || "localCachev1";
  5362. var n = this._storage.getItem(e);
  5363. if (!n) return "";
  5364. if (n.indexOf(t) >= 0) {
  5365. return JSON.parse(n).content;
  5366. }
  5367. return "";
  5368. }
  5369. }, {
  5370. key: "removeStore",
  5371. value: function removeStore(e) {
  5372. this._storage.removeItem(e);
  5373. }
  5374. }]);
  5375. return Ae;
  5376. }();
  5377. var Ee = {},
  5378. Oe = {};
  5379. function xe(e) {
  5380. return Ee[e];
  5381. }
  5382. var Re = /*#__PURE__*/(0, _createClass2.default)(function Re(e, t) {
  5383. (0, _classCallCheck2.default)(this, Re);
  5384. this.data = t || null, this.name = e;
  5385. });
  5386. var Ue = /*#__PURE__*/function (_Re) {
  5387. (0, _inherits2.default)(Ue, _Re);
  5388. var _super3 = _createSuper(Ue);
  5389. function Ue(e, t) {
  5390. var _this7;
  5391. (0, _classCallCheck2.default)(this, Ue);
  5392. _this7 = _super3.call(this, "error", {
  5393. error: e,
  5394. data: t
  5395. }), _this7.error = e;
  5396. return _this7;
  5397. }
  5398. return (0, _createClass2.default)(Ue);
  5399. }(Re);
  5400. var Le = new ( /*#__PURE__*/function () {
  5401. function _class() {
  5402. (0, _classCallCheck2.default)(this, _class);
  5403. this._listeners = {};
  5404. }
  5405. (0, _createClass2.default)(_class, [{
  5406. key: "on",
  5407. value: function on(e, t) {
  5408. return function (e, t, n) {
  5409. n[e] = n[e] || [], n[e].push(t);
  5410. }(e, t, this._listeners), this;
  5411. }
  5412. }, {
  5413. key: "off",
  5414. value: function off(e, t) {
  5415. return function (e, t, n) {
  5416. if (n && n[e]) {
  5417. var _s7 = n[e].indexOf(t);
  5418. -1 !== _s7 && n[e].splice(_s7, 1);
  5419. }
  5420. }(e, t, this._listeners), this;
  5421. }
  5422. }, {
  5423. key: "fire",
  5424. value: function fire(e, t) {
  5425. if (e instanceof Ue) return console.error(e.error), this;
  5426. var n = "string" == typeof e ? new Re(e, t || {}) : e;
  5427. var s = n.name;
  5428. if (this._listens(s)) {
  5429. n.target = this;
  5430. var _e10 = this._listeners[s] ? (0, _toConsumableArray2.default)(this._listeners[s]) : [];
  5431. var _iterator2 = _createForOfIteratorHelper(_e10),
  5432. _step2;
  5433. try {
  5434. for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
  5435. var _t6 = _step2.value;
  5436. _t6.call(this, n);
  5437. }
  5438. } catch (err) {
  5439. _iterator2.e(err);
  5440. } finally {
  5441. _iterator2.f();
  5442. }
  5443. }
  5444. return this;
  5445. }
  5446. }, {
  5447. key: "_listens",
  5448. value: function _listens(e) {
  5449. return this._listeners[e] && this._listeners[e].length > 0;
  5450. }
  5451. }]);
  5452. return _class;
  5453. }())();
  5454. function Ne(e, t) {
  5455. Le.on(e, t);
  5456. }
  5457. function De(e) {
  5458. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  5459. Le.fire(e, t);
  5460. }
  5461. function Fe(e, t) {
  5462. Le.off(e, t);
  5463. }
  5464. var qe = "loginStateChanged",
  5465. Me = "loginStateExpire",
  5466. Ke = "loginTypeChanged",
  5467. je = "anonymousConverted",
  5468. Be = "refreshAccessToken";
  5469. var $e;
  5470. !function (e) {
  5471. 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";
  5472. }($e || ($e = {}));
  5473. var We = ["auth.getJwt", "auth.logout", "auth.signInWithTicket", "auth.signInAnonymously", "auth.signIn", "auth.fetchAccessTokenWithRefreshToken", "auth.signUpWithEmailAndPassword", "auth.activateEndUserMail", "auth.sendPasswordResetEmail", "auth.resetPasswordWithToken", "auth.isUsernameRegistered"],
  5474. ze = {
  5475. "X-SDK-Version": "1.3.5"
  5476. };
  5477. function Je(e, t, n) {
  5478. var s = e[t];
  5479. e[t] = function (t) {
  5480. var r = {},
  5481. i = {};
  5482. n.forEach(function (n) {
  5483. var _n$call = n.call(e, t),
  5484. s = _n$call.data,
  5485. o = _n$call.headers;
  5486. Object.assign(r, s), Object.assign(i, o);
  5487. });
  5488. var o = t.data;
  5489. return o && function () {
  5490. var e;
  5491. if (e = o, "[object FormData]" !== Object.prototype.toString.call(e)) t.data = _objectSpread(_objectSpread({}, o), r);else for (var _e11 in r) {
  5492. o.append(_e11, r[_e11]);
  5493. }
  5494. }(), t.headers = _objectSpread(_objectSpread({}, t.headers || {}), i), s.call(e, t);
  5495. };
  5496. }
  5497. function He() {
  5498. var e = Math.random().toString(16).slice(2);
  5499. return {
  5500. data: {
  5501. seqId: e
  5502. },
  5503. headers: _objectSpread(_objectSpread({}, ze), {}, {
  5504. "x-seqid": e
  5505. })
  5506. };
  5507. }
  5508. var Ge = /*#__PURE__*/function () {
  5509. function Ge() {
  5510. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  5511. (0, _classCallCheck2.default)(this, Ge);
  5512. var t;
  5513. this.config = e, this._reqClass = new ke.adapter.reqClass({
  5514. timeout: this.config.timeout,
  5515. timeoutMsg: "\u8BF7\u6C42\u5728".concat(this.config.timeout / 1e3, "s\u5185\u672A\u5B8C\u6210\uFF0C\u5DF2\u4E2D\u65AD"),
  5516. restrictedMethods: ["post"]
  5517. }), this._cache = xe(this.config.env), this._localCache = (t = this.config.env, Oe[t]), Je(this._reqClass, "post", [He]), Je(this._reqClass, "upload", [He]), Je(this._reqClass, "download", [He]);
  5518. }
  5519. (0, _createClass2.default)(Ge, [{
  5520. key: "post",
  5521. value: function () {
  5522. var _post = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(e) {
  5523. return _regenerator.default.wrap(function _callee4$(_context4) {
  5524. while (1) {
  5525. switch (_context4.prev = _context4.next) {
  5526. case 0:
  5527. _context4.next = 2;
  5528. return this._reqClass.post(e);
  5529. case 2:
  5530. return _context4.abrupt("return", _context4.sent);
  5531. case 3:
  5532. case "end":
  5533. return _context4.stop();
  5534. }
  5535. }
  5536. }, _callee4, this);
  5537. }));
  5538. function post(_x2) {
  5539. return _post.apply(this, arguments);
  5540. }
  5541. return post;
  5542. }()
  5543. }, {
  5544. key: "upload",
  5545. value: function () {
  5546. var _upload = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(e) {
  5547. return _regenerator.default.wrap(function _callee5$(_context5) {
  5548. while (1) {
  5549. switch (_context5.prev = _context5.next) {
  5550. case 0:
  5551. _context5.next = 2;
  5552. return this._reqClass.upload(e);
  5553. case 2:
  5554. return _context5.abrupt("return", _context5.sent);
  5555. case 3:
  5556. case "end":
  5557. return _context5.stop();
  5558. }
  5559. }
  5560. }, _callee5, this);
  5561. }));
  5562. function upload(_x3) {
  5563. return _upload.apply(this, arguments);
  5564. }
  5565. return upload;
  5566. }()
  5567. }, {
  5568. key: "download",
  5569. value: function () {
  5570. var _download = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(e) {
  5571. return _regenerator.default.wrap(function _callee6$(_context6) {
  5572. while (1) {
  5573. switch (_context6.prev = _context6.next) {
  5574. case 0:
  5575. _context6.next = 2;
  5576. return this._reqClass.download(e);
  5577. case 2:
  5578. return _context6.abrupt("return", _context6.sent);
  5579. case 3:
  5580. case "end":
  5581. return _context6.stop();
  5582. }
  5583. }
  5584. }, _callee6, this);
  5585. }));
  5586. function download(_x4) {
  5587. return _download.apply(this, arguments);
  5588. }
  5589. return download;
  5590. }()
  5591. }, {
  5592. key: "refreshAccessToken",
  5593. value: function () {
  5594. var _refreshAccessToken2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
  5595. var e, t;
  5596. return _regenerator.default.wrap(function _callee7$(_context7) {
  5597. while (1) {
  5598. switch (_context7.prev = _context7.next) {
  5599. case 0:
  5600. this._refreshAccessTokenPromise || (this._refreshAccessTokenPromise = this._refreshAccessToken());
  5601. _context7.prev = 1;
  5602. _context7.next = 4;
  5603. return this._refreshAccessTokenPromise;
  5604. case 4:
  5605. e = _context7.sent;
  5606. _context7.next = 10;
  5607. break;
  5608. case 7:
  5609. _context7.prev = 7;
  5610. _context7.t0 = _context7["catch"](1);
  5611. t = _context7.t0;
  5612. case 10:
  5613. if (!(this._refreshAccessTokenPromise = null, this._shouldRefreshAccessTokenHook = null, t)) {
  5614. _context7.next = 12;
  5615. break;
  5616. }
  5617. throw t;
  5618. case 12:
  5619. return _context7.abrupt("return", e);
  5620. case 13:
  5621. case "end":
  5622. return _context7.stop();
  5623. }
  5624. }
  5625. }, _callee7, this, [[1, 7]]);
  5626. }));
  5627. function refreshAccessToken() {
  5628. return _refreshAccessToken2.apply(this, arguments);
  5629. }
  5630. return refreshAccessToken;
  5631. }()
  5632. }, {
  5633. key: "_refreshAccessToken",
  5634. value: function () {
  5635. var _refreshAccessToken3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
  5636. var _this$_cache$keys, e, t, n, s, r, i, o, a, _e12, _e13, _t7, _s8;
  5637. return _regenerator.default.wrap(function _callee8$(_context8) {
  5638. while (1) {
  5639. switch (_context8.prev = _context8.next) {
  5640. case 0:
  5641. _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, r = _this$_cache$keys.anonymousUuidKey;
  5642. this._cache.removeStore(e), this._cache.removeStore(t);
  5643. i = this._cache.getStore(n);
  5644. if (i) {
  5645. _context8.next = 5;
  5646. break;
  5647. }
  5648. throw new ne({
  5649. message: "未登录CloudBase"
  5650. });
  5651. case 5:
  5652. o = {
  5653. refresh_token: i
  5654. };
  5655. _context8.next = 8;
  5656. return this.request("auth.fetchAccessTokenWithRefreshToken", o);
  5657. case 8:
  5658. a = _context8.sent;
  5659. if (!a.data.code) {
  5660. _context8.next = 21;
  5661. break;
  5662. }
  5663. _e12 = a.data.code;
  5664. if (!("SIGN_PARAM_INVALID" === _e12 || "REFRESH_TOKEN_EXPIRED" === _e12 || "INVALID_REFRESH_TOKEN" === _e12)) {
  5665. _context8.next = 20;
  5666. break;
  5667. }
  5668. if (!(this._cache.getStore(s) === $e.ANONYMOUS && "INVALID_REFRESH_TOKEN" === _e12)) {
  5669. _context8.next = 19;
  5670. break;
  5671. }
  5672. _e13 = this._cache.getStore(r);
  5673. _t7 = this._cache.getStore(n);
  5674. _context8.next = 17;
  5675. return this.send("auth.signInAnonymously", {
  5676. anonymous_uuid: _e13,
  5677. refresh_token: _t7
  5678. });
  5679. case 17:
  5680. _s8 = _context8.sent;
  5681. return _context8.abrupt("return", (this.setRefreshToken(_s8.refresh_token), this._refreshAccessToken()));
  5682. case 19:
  5683. De(Me), this._cache.removeStore(n);
  5684. case 20:
  5685. throw new ne({
  5686. code: a.data.code,
  5687. message: "\u5237\u65B0access token\u5931\u8D25\uFF1A".concat(a.data.code)
  5688. });
  5689. case 21:
  5690. if (!a.data.access_token) {
  5691. _context8.next = 23;
  5692. break;
  5693. }
  5694. return _context8.abrupt("return", (De(Be), this._cache.setStore(e, a.data.access_token), this._cache.setStore(t, a.data.access_token_expire + Date.now()), {
  5695. accessToken: a.data.access_token,
  5696. accessTokenExpire: a.data.access_token_expire
  5697. }));
  5698. case 23:
  5699. a.data.refresh_token && (this._cache.removeStore(n), this._cache.setStore(n, a.data.refresh_token), this._refreshAccessToken());
  5700. case 24:
  5701. case "end":
  5702. return _context8.stop();
  5703. }
  5704. }
  5705. }, _callee8, this);
  5706. }));
  5707. function _refreshAccessToken() {
  5708. return _refreshAccessToken3.apply(this, arguments);
  5709. }
  5710. return _refreshAccessToken;
  5711. }()
  5712. }, {
  5713. key: "getAccessToken",
  5714. value: function () {
  5715. var _getAccessToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
  5716. var _this$_cache$keys2, e, t, n, s, r, i;
  5717. return _regenerator.default.wrap(function _callee9$(_context9) {
  5718. while (1) {
  5719. switch (_context9.prev = _context9.next) {
  5720. case 0:
  5721. _this$_cache$keys2 = this._cache.keys, e = _this$_cache$keys2.accessTokenKey, t = _this$_cache$keys2.accessTokenExpireKey, n = _this$_cache$keys2.refreshTokenKey;
  5722. if (this._cache.getStore(n)) {
  5723. _context9.next = 3;
  5724. break;
  5725. }
  5726. throw new ne({
  5727. message: "refresh token不存在,登录状态异常"
  5728. });
  5729. case 3:
  5730. s = this._cache.getStore(e), r = this._cache.getStore(t), i = !0;
  5731. _context9.t0 = this._shouldRefreshAccessTokenHook;
  5732. if (!_context9.t0) {
  5733. _context9.next = 9;
  5734. break;
  5735. }
  5736. _context9.next = 8;
  5737. return this._shouldRefreshAccessTokenHook(s, r);
  5738. case 8:
  5739. _context9.t0 = !_context9.sent;
  5740. case 9:
  5741. _context9.t1 = _context9.t0;
  5742. if (!_context9.t1) {
  5743. _context9.next = 12;
  5744. break;
  5745. }
  5746. i = !1;
  5747. case 12:
  5748. return _context9.abrupt("return", (!s || !r || r < Date.now()) && i ? this.refreshAccessToken() : {
  5749. accessToken: s,
  5750. accessTokenExpire: r
  5751. });
  5752. case 13:
  5753. case "end":
  5754. return _context9.stop();
  5755. }
  5756. }
  5757. }, _callee9, this);
  5758. }));
  5759. function getAccessToken() {
  5760. return _getAccessToken.apply(this, arguments);
  5761. }
  5762. return getAccessToken;
  5763. }()
  5764. }, {
  5765. key: "request",
  5766. value: function () {
  5767. var _request = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10(e, t, n) {
  5768. var s, r, i, _e14, o, _e15, _e16, a, c, u, h, l, d, p, f, g;
  5769. return _regenerator.default.wrap(function _callee10$(_context10) {
  5770. while (1) {
  5771. switch (_context10.prev = _context10.next) {
  5772. case 0:
  5773. s = "x-tcb-trace_".concat(this.config.env);
  5774. r = "application/x-www-form-urlencoded";
  5775. i = _objectSpread({
  5776. action: e,
  5777. env: this.config.env,
  5778. dataVersion: "2019-08-16"
  5779. }, t);
  5780. if (!(-1 === We.indexOf(e))) {
  5781. _context10.next = 10;
  5782. break;
  5783. }
  5784. _e14 = this._cache.keys.refreshTokenKey;
  5785. _context10.t0 = this._cache.getStore(_e14);
  5786. if (!_context10.t0) {
  5787. _context10.next = 10;
  5788. break;
  5789. }
  5790. _context10.next = 9;
  5791. return this.getAccessToken();
  5792. case 9:
  5793. i.access_token = _context10.sent.accessToken;
  5794. case 10:
  5795. if ("storage.uploadFile" === e) {
  5796. o = new FormData();
  5797. for (_e15 in o) {
  5798. o.hasOwnProperty(_e15) && void 0 !== o[_e15] && o.append(_e15, i[_e15]);
  5799. }
  5800. r = "multipart/form-data";
  5801. } else {
  5802. r = "application/json", o = {};
  5803. for (_e16 in i) {
  5804. void 0 !== i[_e16] && (o[_e16] = i[_e16]);
  5805. }
  5806. }
  5807. a = {
  5808. headers: {
  5809. "content-type": r
  5810. }
  5811. };
  5812. n && n.onUploadProgress && (a.onUploadProgress = n.onUploadProgress);
  5813. c = this._localCache.getStore(s);
  5814. c && (a.headers["X-TCB-Trace"] = c);
  5815. u = t.parse, h = t.inQuery, l = t.search;
  5816. d = {
  5817. env: this.config.env
  5818. };
  5819. u && (d.parse = !0), h && (d = _objectSpread(_objectSpread({}, h), d));
  5820. p = function (e, t) {
  5821. var n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  5822. var s = /\?/.test(t);
  5823. var r = "";
  5824. for (var _e17 in n) {
  5825. "" === r ? !s && (t += "?") : r += "&", r += "".concat(_e17, "=").concat(encodeURIComponent(n[_e17]));
  5826. }
  5827. return /^http(s)?\:\/\//.test(t += r) ? t : "".concat(e).concat(t);
  5828. }(me, "//tcb-api.tencentcloudapi.com/web", d);
  5829. l && (p += l);
  5830. _context10.next = 22;
  5831. return this.post(_objectSpread({
  5832. url: p,
  5833. data: o
  5834. }, a));
  5835. case 22:
  5836. f = _context10.sent;
  5837. g = f.header && f.header["x-tcb-trace"];
  5838. if (!(g && this._localCache.setStore(s, g), 200 !== Number(f.status) && 200 !== Number(f.statusCode) || !f.data)) {
  5839. _context10.next = 26;
  5840. break;
  5841. }
  5842. throw new ne({
  5843. code: "NETWORK_ERROR",
  5844. message: "network request error"
  5845. });
  5846. case 26:
  5847. return _context10.abrupt("return", f);
  5848. case 27:
  5849. case "end":
  5850. return _context10.stop();
  5851. }
  5852. }
  5853. }, _callee10, this);
  5854. }));
  5855. function request(_x5, _x6, _x7) {
  5856. return _request.apply(this, arguments);
  5857. }
  5858. return request;
  5859. }()
  5860. }, {
  5861. key: "send",
  5862. value: function () {
  5863. var _send = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11(e) {
  5864. var t,
  5865. n,
  5866. _n6,
  5867. _args11 = arguments;
  5868. return _regenerator.default.wrap(function _callee11$(_context11) {
  5869. while (1) {
  5870. switch (_context11.prev = _context11.next) {
  5871. case 0:
  5872. t = _args11.length > 1 && _args11[1] !== undefined ? _args11[1] : {};
  5873. _context11.next = 3;
  5874. return this.request(e, t, {
  5875. onUploadProgress: t.onUploadProgress
  5876. });
  5877. case 3:
  5878. n = _context11.sent;
  5879. if (!("ACCESS_TOKEN_EXPIRED" === n.data.code && -1 === We.indexOf(e))) {
  5880. _context11.next = 13;
  5881. break;
  5882. }
  5883. _context11.next = 7;
  5884. return this.refreshAccessToken();
  5885. case 7:
  5886. _context11.next = 9;
  5887. return this.request(e, t, {
  5888. onUploadProgress: t.onUploadProgress
  5889. });
  5890. case 9:
  5891. _n6 = _context11.sent;
  5892. if (!_n6.data.code) {
  5893. _context11.next = 12;
  5894. break;
  5895. }
  5896. throw new ne({
  5897. code: _n6.data.code,
  5898. message: _n6.data.message
  5899. });
  5900. case 12:
  5901. return _context11.abrupt("return", _n6.data);
  5902. case 13:
  5903. if (!n.data.code) {
  5904. _context11.next = 15;
  5905. break;
  5906. }
  5907. throw new ne({
  5908. code: n.data.code,
  5909. message: n.data.message
  5910. });
  5911. case 15:
  5912. return _context11.abrupt("return", n.data);
  5913. case 16:
  5914. case "end":
  5915. return _context11.stop();
  5916. }
  5917. }
  5918. }, _callee11, this);
  5919. }));
  5920. function send(_x8) {
  5921. return _send.apply(this, arguments);
  5922. }
  5923. return send;
  5924. }()
  5925. }, {
  5926. key: "setRefreshToken",
  5927. value: function setRefreshToken(e) {
  5928. var _this$_cache$keys3 = this._cache.keys,
  5929. t = _this$_cache$keys3.accessTokenKey,
  5930. n = _this$_cache$keys3.accessTokenExpireKey,
  5931. s = _this$_cache$keys3.refreshTokenKey;
  5932. this._cache.removeStore(t), this._cache.removeStore(n), this._cache.setStore(s, e);
  5933. }
  5934. }]);
  5935. return Ge;
  5936. }();
  5937. var Ve = {};
  5938. function Ye(e) {
  5939. return Ve[e];
  5940. }
  5941. var Qe = /*#__PURE__*/function () {
  5942. function Qe(e) {
  5943. (0, _classCallCheck2.default)(this, Qe);
  5944. this.config = e, this._cache = xe(e.env), this._request = Ye(e.env);
  5945. }
  5946. (0, _createClass2.default)(Qe, [{
  5947. key: "setRefreshToken",
  5948. value: function setRefreshToken(e) {
  5949. var _this$_cache$keys4 = this._cache.keys,
  5950. t = _this$_cache$keys4.accessTokenKey,
  5951. n = _this$_cache$keys4.accessTokenExpireKey,
  5952. s = _this$_cache$keys4.refreshTokenKey;
  5953. this._cache.removeStore(t), this._cache.removeStore(n), this._cache.setStore(s, e);
  5954. }
  5955. }, {
  5956. key: "setAccessToken",
  5957. value: function setAccessToken(e, t) {
  5958. var _this$_cache$keys5 = this._cache.keys,
  5959. n = _this$_cache$keys5.accessTokenKey,
  5960. s = _this$_cache$keys5.accessTokenExpireKey;
  5961. this._cache.setStore(n, e), this._cache.setStore(s, t);
  5962. }
  5963. }, {
  5964. key: "refreshUserInfo",
  5965. value: function () {
  5966. var _refreshUserInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
  5967. var _yield$this$_request$, e;
  5968. return _regenerator.default.wrap(function _callee12$(_context12) {
  5969. while (1) {
  5970. switch (_context12.prev = _context12.next) {
  5971. case 0:
  5972. _context12.next = 2;
  5973. return this._request.send("auth.getUserInfo", {});
  5974. case 2:
  5975. _yield$this$_request$ = _context12.sent;
  5976. e = _yield$this$_request$.data;
  5977. return _context12.abrupt("return", (this.setLocalUserInfo(e), e));
  5978. case 5:
  5979. case "end":
  5980. return _context12.stop();
  5981. }
  5982. }
  5983. }, _callee12, this);
  5984. }));
  5985. function refreshUserInfo() {
  5986. return _refreshUserInfo.apply(this, arguments);
  5987. }
  5988. return refreshUserInfo;
  5989. }()
  5990. }, {
  5991. key: "setLocalUserInfo",
  5992. value: function setLocalUserInfo(e) {
  5993. var t = this._cache.keys.userInfoKey;
  5994. this._cache.setStore(t, e);
  5995. }
  5996. }]);
  5997. return Qe;
  5998. }();
  5999. var Xe = /*#__PURE__*/function () {
  6000. function Xe(e) {
  6001. (0, _classCallCheck2.default)(this, Xe);
  6002. if (!e) throw new ne({
  6003. code: "PARAM_ERROR",
  6004. message: "envId is not defined"
  6005. });
  6006. this._envId = e, this._cache = xe(this._envId), this._request = Ye(this._envId), this.setUserInfo();
  6007. }
  6008. (0, _createClass2.default)(Xe, [{
  6009. key: "linkWithTicket",
  6010. value: function linkWithTicket(e) {
  6011. if ("string" != typeof e) throw new ne({
  6012. code: "PARAM_ERROR",
  6013. message: "ticket must be string"
  6014. });
  6015. return this._request.send("auth.linkWithTicket", {
  6016. ticket: e
  6017. });
  6018. }
  6019. }, {
  6020. key: "linkWithRedirect",
  6021. value: function linkWithRedirect(e) {
  6022. e.signInWithRedirect();
  6023. }
  6024. }, {
  6025. key: "updatePassword",
  6026. value: function updatePassword(e, t) {
  6027. return this._request.send("auth.updatePassword", {
  6028. oldPassword: t,
  6029. newPassword: e
  6030. });
  6031. }
  6032. }, {
  6033. key: "updateEmail",
  6034. value: function updateEmail(e) {
  6035. return this._request.send("auth.updateEmail", {
  6036. newEmail: e
  6037. });
  6038. }
  6039. }, {
  6040. key: "updateUsername",
  6041. value: function updateUsername(e) {
  6042. if ("string" != typeof e) throw new ne({
  6043. code: "PARAM_ERROR",
  6044. message: "username must be a string"
  6045. });
  6046. return this._request.send("auth.updateUsername", {
  6047. username: e
  6048. });
  6049. }
  6050. }, {
  6051. key: "getLinkedUidList",
  6052. value: function () {
  6053. var _getLinkedUidList = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13() {
  6054. var _yield$this$_request$2, e, t, n;
  6055. return _regenerator.default.wrap(function _callee13$(_context13) {
  6056. while (1) {
  6057. switch (_context13.prev = _context13.next) {
  6058. case 0:
  6059. _context13.next = 2;
  6060. return this._request.send("auth.getLinkedUidList", {});
  6061. case 2:
  6062. _yield$this$_request$2 = _context13.sent;
  6063. e = _yield$this$_request$2.data;
  6064. t = !1;
  6065. n = e.users;
  6066. return _context13.abrupt("return", (n.forEach(function (e) {
  6067. e.wxOpenId && e.wxPublicId && (t = !0);
  6068. }), {
  6069. users: n,
  6070. hasPrimaryUid: t
  6071. }));
  6072. case 7:
  6073. case "end":
  6074. return _context13.stop();
  6075. }
  6076. }
  6077. }, _callee13, this);
  6078. }));
  6079. function getLinkedUidList() {
  6080. return _getLinkedUidList.apply(this, arguments);
  6081. }
  6082. return getLinkedUidList;
  6083. }()
  6084. }, {
  6085. key: "setPrimaryUid",
  6086. value: function setPrimaryUid(e) {
  6087. return this._request.send("auth.setPrimaryUid", {
  6088. uid: e
  6089. });
  6090. }
  6091. }, {
  6092. key: "unlink",
  6093. value: function unlink(e) {
  6094. return this._request.send("auth.unlink", {
  6095. platform: e
  6096. });
  6097. }
  6098. }, {
  6099. key: "update",
  6100. value: function () {
  6101. var _update = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(e) {
  6102. var t, n, s, r, i, o, _yield$this$_request$3, a;
  6103. return _regenerator.default.wrap(function _callee14$(_context14) {
  6104. while (1) {
  6105. switch (_context14.prev = _context14.next) {
  6106. case 0:
  6107. t = e.nickName;
  6108. n = e.gender;
  6109. s = e.avatarUrl;
  6110. r = e.province;
  6111. i = e.country;
  6112. o = e.city;
  6113. _context14.next = 8;
  6114. return this._request.send("auth.updateUserInfo", {
  6115. nickName: t,
  6116. gender: n,
  6117. avatarUrl: s,
  6118. province: r,
  6119. country: i,
  6120. city: o
  6121. });
  6122. case 8:
  6123. _yield$this$_request$3 = _context14.sent;
  6124. a = _yield$this$_request$3.data;
  6125. this.setLocalUserInfo(a);
  6126. case 11:
  6127. case "end":
  6128. return _context14.stop();
  6129. }
  6130. }
  6131. }, _callee14, this);
  6132. }));
  6133. function update(_x9) {
  6134. return _update.apply(this, arguments);
  6135. }
  6136. return update;
  6137. }()
  6138. }, {
  6139. key: "refresh",
  6140. value: function () {
  6141. var _refresh = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
  6142. var _yield$this$_request$4, e;
  6143. return _regenerator.default.wrap(function _callee15$(_context15) {
  6144. while (1) {
  6145. switch (_context15.prev = _context15.next) {
  6146. case 0:
  6147. _context15.next = 2;
  6148. return this._request.send("auth.getUserInfo", {});
  6149. case 2:
  6150. _yield$this$_request$4 = _context15.sent;
  6151. e = _yield$this$_request$4.data;
  6152. return _context15.abrupt("return", (this.setLocalUserInfo(e), e));
  6153. case 5:
  6154. case "end":
  6155. return _context15.stop();
  6156. }
  6157. }
  6158. }, _callee15, this);
  6159. }));
  6160. function refresh() {
  6161. return _refresh.apply(this, arguments);
  6162. }
  6163. return refresh;
  6164. }()
  6165. }, {
  6166. key: "setUserInfo",
  6167. value: function setUserInfo() {
  6168. var _this8 = this;
  6169. var e = this._cache.keys.userInfoKey,
  6170. t = this._cache.getStore(e);
  6171. ["uid", "loginType", "openid", "wxOpenId", "wxPublicId", "unionId", "qqMiniOpenId", "email", "hasPassword", "customUserId", "nickName", "gender", "avatarUrl"].forEach(function (e) {
  6172. _this8[e] = t[e];
  6173. }), this.location = {
  6174. country: t.country,
  6175. province: t.province,
  6176. city: t.city
  6177. };
  6178. }
  6179. }, {
  6180. key: "setLocalUserInfo",
  6181. value: function setLocalUserInfo(e) {
  6182. var t = this._cache.keys.userInfoKey;
  6183. this._cache.setStore(t, e), this.setUserInfo();
  6184. }
  6185. }]);
  6186. return Xe;
  6187. }();
  6188. var Ze = /*#__PURE__*/function () {
  6189. function Ze(e) {
  6190. (0, _classCallCheck2.default)(this, Ze);
  6191. if (!e) throw new ne({
  6192. code: "PARAM_ERROR",
  6193. message: "envId is not defined"
  6194. });
  6195. this._cache = xe(e);
  6196. var _this$_cache$keys6 = this._cache.keys,
  6197. t = _this$_cache$keys6.refreshTokenKey,
  6198. n = _this$_cache$keys6.accessTokenKey,
  6199. s = _this$_cache$keys6.accessTokenExpireKey,
  6200. r = this._cache.getStore(t),
  6201. i = this._cache.getStore(n),
  6202. o = this._cache.getStore(s);
  6203. this.credential = {
  6204. refreshToken: r,
  6205. accessToken: i,
  6206. accessTokenExpire: o
  6207. }, this.user = new Xe(e);
  6208. }
  6209. (0, _createClass2.default)(Ze, [{
  6210. key: "isAnonymousAuth",
  6211. get: function get() {
  6212. return this.loginType === $e.ANONYMOUS;
  6213. }
  6214. }, {
  6215. key: "isCustomAuth",
  6216. get: function get() {
  6217. return this.loginType === $e.CUSTOM;
  6218. }
  6219. }, {
  6220. key: "isWeixinAuth",
  6221. get: function get() {
  6222. return this.loginType === $e.WECHAT || this.loginType === $e.WECHAT_OPEN || this.loginType === $e.WECHAT_PUBLIC;
  6223. }
  6224. }, {
  6225. key: "loginType",
  6226. get: function get() {
  6227. return this._cache.getStore(this._cache.keys.loginTypeKey);
  6228. }
  6229. }]);
  6230. return Ze;
  6231. }();
  6232. var et = /*#__PURE__*/function (_Qe) {
  6233. (0, _inherits2.default)(et, _Qe);
  6234. var _super4 = _createSuper(et);
  6235. function et() {
  6236. (0, _classCallCheck2.default)(this, et);
  6237. return _super4.apply(this, arguments);
  6238. }
  6239. (0, _createClass2.default)(et, [{
  6240. key: "signIn",
  6241. value: function () {
  6242. var _signIn = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
  6243. var _this$_cache$keys7, e, t, n, s, r, _e18;
  6244. return _regenerator.default.wrap(function _callee16$(_context16) {
  6245. while (1) {
  6246. switch (_context16.prev = _context16.next) {
  6247. case 0:
  6248. this._cache.updatePersistence("local");
  6249. _this$_cache$keys7 = this._cache.keys;
  6250. e = _this$_cache$keys7.anonymousUuidKey;
  6251. t = _this$_cache$keys7.refreshTokenKey;
  6252. n = this._cache.getStore(e) || void 0;
  6253. s = this._cache.getStore(t) || void 0;
  6254. _context16.next = 8;
  6255. return this._request.send("auth.signInAnonymously", {
  6256. anonymous_uuid: n,
  6257. refresh_token: s
  6258. });
  6259. case 8:
  6260. r = _context16.sent;
  6261. if (!(r.uuid && r.refresh_token)) {
  6262. _context16.next = 20;
  6263. break;
  6264. }
  6265. this._setAnonymousUUID(r.uuid);
  6266. this.setRefreshToken(r.refresh_token);
  6267. _context16.next = 14;
  6268. return this._request.refreshAccessToken();
  6269. case 14:
  6270. De(qe);
  6271. De(Ke, {
  6272. env: this.config.env,
  6273. loginType: $e.ANONYMOUS,
  6274. persistence: "local"
  6275. });
  6276. _e18 = new Ze(this.config.env);
  6277. _context16.next = 19;
  6278. return _e18.user.refresh();
  6279. case 19:
  6280. return _context16.abrupt("return", _e18);
  6281. case 20:
  6282. throw new ne({
  6283. message: "匿名登录失败"
  6284. });
  6285. case 21:
  6286. case "end":
  6287. return _context16.stop();
  6288. }
  6289. }
  6290. }, _callee16, this);
  6291. }));
  6292. function signIn() {
  6293. return _signIn.apply(this, arguments);
  6294. }
  6295. return signIn;
  6296. }()
  6297. }, {
  6298. key: "linkAndRetrieveDataWithTicket",
  6299. value: function () {
  6300. var _linkAndRetrieveDataWithTicket = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17(e) {
  6301. var _this$_cache$keys8, t, n, s, r, i;
  6302. return _regenerator.default.wrap(function _callee17$(_context17) {
  6303. while (1) {
  6304. switch (_context17.prev = _context17.next) {
  6305. case 0:
  6306. _this$_cache$keys8 = this._cache.keys;
  6307. t = _this$_cache$keys8.anonymousUuidKey;
  6308. n = _this$_cache$keys8.refreshTokenKey;
  6309. s = this._cache.getStore(t);
  6310. r = this._cache.getStore(n);
  6311. _context17.next = 7;
  6312. return this._request.send("auth.linkAndRetrieveDataWithTicket", {
  6313. anonymous_uuid: s,
  6314. refresh_token: r,
  6315. ticket: e
  6316. });
  6317. case 7:
  6318. i = _context17.sent;
  6319. if (!i.refresh_token) {
  6320. _context17.next = 16;
  6321. break;
  6322. }
  6323. this._clearAnonymousUUID();
  6324. this.setRefreshToken(i.refresh_token);
  6325. _context17.next = 13;
  6326. return this._request.refreshAccessToken();
  6327. case 13:
  6328. De(je, {
  6329. env: this.config.env
  6330. });
  6331. De(Ke, {
  6332. loginType: $e.CUSTOM,
  6333. persistence: "local"
  6334. });
  6335. return _context17.abrupt("return", {
  6336. credential: {
  6337. refreshToken: i.refresh_token
  6338. }
  6339. });
  6340. case 16:
  6341. throw new ne({
  6342. message: "匿名转化失败"
  6343. });
  6344. case 17:
  6345. case "end":
  6346. return _context17.stop();
  6347. }
  6348. }
  6349. }, _callee17, this);
  6350. }));
  6351. function linkAndRetrieveDataWithTicket(_x10) {
  6352. return _linkAndRetrieveDataWithTicket.apply(this, arguments);
  6353. }
  6354. return linkAndRetrieveDataWithTicket;
  6355. }()
  6356. }, {
  6357. key: "_setAnonymousUUID",
  6358. value: function _setAnonymousUUID(e) {
  6359. var _this$_cache$keys9 = this._cache.keys,
  6360. t = _this$_cache$keys9.anonymousUuidKey,
  6361. n = _this$_cache$keys9.loginTypeKey;
  6362. this._cache.removeStore(t), this._cache.setStore(t, e), this._cache.setStore(n, $e.ANONYMOUS);
  6363. }
  6364. }, {
  6365. key: "_clearAnonymousUUID",
  6366. value: function _clearAnonymousUUID() {
  6367. this._cache.removeStore(this._cache.keys.anonymousUuidKey);
  6368. }
  6369. }]);
  6370. return et;
  6371. }(Qe);
  6372. var tt = /*#__PURE__*/function (_Qe2) {
  6373. (0, _inherits2.default)(tt, _Qe2);
  6374. var _super5 = _createSuper(tt);
  6375. function tt() {
  6376. (0, _classCallCheck2.default)(this, tt);
  6377. return _super5.apply(this, arguments);
  6378. }
  6379. (0, _createClass2.default)(tt, [{
  6380. key: "signIn",
  6381. value: function () {
  6382. var _signIn2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18(e) {
  6383. var t, n;
  6384. return _regenerator.default.wrap(function _callee18$(_context18) {
  6385. while (1) {
  6386. switch (_context18.prev = _context18.next) {
  6387. case 0:
  6388. if (!("string" != typeof e)) {
  6389. _context18.next = 2;
  6390. break;
  6391. }
  6392. throw new ne({
  6393. code: "PARAM_ERROR",
  6394. message: "ticket must be a string"
  6395. });
  6396. case 2:
  6397. t = this._cache.keys.refreshTokenKey;
  6398. _context18.next = 5;
  6399. return this._request.send("auth.signInWithTicket", {
  6400. ticket: e,
  6401. refresh_token: this._cache.getStore(t) || ""
  6402. });
  6403. case 5:
  6404. n = _context18.sent;
  6405. if (!n.refresh_token) {
  6406. _context18.next = 15;
  6407. break;
  6408. }
  6409. this.setRefreshToken(n.refresh_token);
  6410. _context18.next = 10;
  6411. return this._request.refreshAccessToken();
  6412. case 10:
  6413. De(qe);
  6414. De(Ke, {
  6415. env: this.config.env,
  6416. loginType: $e.CUSTOM,
  6417. persistence: this.config.persistence
  6418. });
  6419. _context18.next = 14;
  6420. return this.refreshUserInfo();
  6421. case 14:
  6422. return _context18.abrupt("return", new Ze(this.config.env));
  6423. case 15:
  6424. throw new ne({
  6425. message: "自定义登录失败"
  6426. });
  6427. case 16:
  6428. case "end":
  6429. return _context18.stop();
  6430. }
  6431. }
  6432. }, _callee18, this);
  6433. }));
  6434. function signIn(_x11) {
  6435. return _signIn2.apply(this, arguments);
  6436. }
  6437. return signIn;
  6438. }()
  6439. }]);
  6440. return tt;
  6441. }(Qe);
  6442. var nt = /*#__PURE__*/function (_Qe3) {
  6443. (0, _inherits2.default)(nt, _Qe3);
  6444. var _super6 = _createSuper(nt);
  6445. function nt() {
  6446. (0, _classCallCheck2.default)(this, nt);
  6447. return _super6.apply(this, arguments);
  6448. }
  6449. (0, _createClass2.default)(nt, [{
  6450. key: "signIn",
  6451. value: function () {
  6452. var _signIn3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19(e, t) {
  6453. var n, s, r, i, o;
  6454. return _regenerator.default.wrap(function _callee19$(_context19) {
  6455. while (1) {
  6456. switch (_context19.prev = _context19.next) {
  6457. case 0:
  6458. if (!("string" != typeof e)) {
  6459. _context19.next = 2;
  6460. break;
  6461. }
  6462. throw new ne({
  6463. code: "PARAM_ERROR",
  6464. message: "email must be a string"
  6465. });
  6466. case 2:
  6467. n = this._cache.keys.refreshTokenKey;
  6468. _context19.next = 5;
  6469. return this._request.send("auth.signIn", {
  6470. loginType: "EMAIL",
  6471. email: e,
  6472. password: t,
  6473. refresh_token: this._cache.getStore(n) || ""
  6474. });
  6475. case 5:
  6476. s = _context19.sent;
  6477. r = s.refresh_token;
  6478. i = s.access_token;
  6479. o = s.access_token_expire;
  6480. if (!r) {
  6481. _context19.next = 22;
  6482. break;
  6483. }
  6484. this.setRefreshToken(r);
  6485. if (!(i && o)) {
  6486. _context19.next = 15;
  6487. break;
  6488. }
  6489. this.setAccessToken(i, o);
  6490. _context19.next = 17;
  6491. break;
  6492. case 15:
  6493. _context19.next = 17;
  6494. return this._request.refreshAccessToken();
  6495. case 17:
  6496. _context19.next = 19;
  6497. return this.refreshUserInfo();
  6498. case 19:
  6499. De(qe);
  6500. De(Ke, {
  6501. env: this.config.env,
  6502. loginType: $e.EMAIL,
  6503. persistence: this.config.persistence
  6504. });
  6505. return _context19.abrupt("return", new Ze(this.config.env));
  6506. case 22:
  6507. throw s.code ? new ne({
  6508. code: s.code,
  6509. message: "\u90AE\u7BB1\u767B\u5F55\u5931\u8D25: ".concat(s.message)
  6510. }) : new ne({
  6511. message: "邮箱登录失败"
  6512. });
  6513. case 23:
  6514. case "end":
  6515. return _context19.stop();
  6516. }
  6517. }
  6518. }, _callee19, this);
  6519. }));
  6520. function signIn(_x12, _x13) {
  6521. return _signIn3.apply(this, arguments);
  6522. }
  6523. return signIn;
  6524. }()
  6525. }, {
  6526. key: "activate",
  6527. value: function () {
  6528. var _activate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee20(e) {
  6529. return _regenerator.default.wrap(function _callee20$(_context20) {
  6530. while (1) {
  6531. switch (_context20.prev = _context20.next) {
  6532. case 0:
  6533. return _context20.abrupt("return", this._request.send("auth.activateEndUserMail", {
  6534. token: e
  6535. }));
  6536. case 1:
  6537. case "end":
  6538. return _context20.stop();
  6539. }
  6540. }
  6541. }, _callee20, this);
  6542. }));
  6543. function activate(_x14) {
  6544. return _activate.apply(this, arguments);
  6545. }
  6546. return activate;
  6547. }()
  6548. }, {
  6549. key: "resetPasswordWithToken",
  6550. value: function () {
  6551. var _resetPasswordWithToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21(e, t) {
  6552. return _regenerator.default.wrap(function _callee21$(_context21) {
  6553. while (1) {
  6554. switch (_context21.prev = _context21.next) {
  6555. case 0:
  6556. return _context21.abrupt("return", this._request.send("auth.resetPasswordWithToken", {
  6557. token: e,
  6558. newPassword: t
  6559. }));
  6560. case 1:
  6561. case "end":
  6562. return _context21.stop();
  6563. }
  6564. }
  6565. }, _callee21, this);
  6566. }));
  6567. function resetPasswordWithToken(_x15, _x16) {
  6568. return _resetPasswordWithToken.apply(this, arguments);
  6569. }
  6570. return resetPasswordWithToken;
  6571. }()
  6572. }]);
  6573. return nt;
  6574. }(Qe);
  6575. var st = /*#__PURE__*/function (_Qe4) {
  6576. (0, _inherits2.default)(st, _Qe4);
  6577. var _super7 = _createSuper(st);
  6578. function st() {
  6579. (0, _classCallCheck2.default)(this, st);
  6580. return _super7.apply(this, arguments);
  6581. }
  6582. (0, _createClass2.default)(st, [{
  6583. key: "signIn",
  6584. value: function () {
  6585. var _signIn4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee22(e, t) {
  6586. var n, s, r, i, o;
  6587. return _regenerator.default.wrap(function _callee22$(_context22) {
  6588. while (1) {
  6589. switch (_context22.prev = _context22.next) {
  6590. case 0:
  6591. if (!("string" != typeof e)) {
  6592. _context22.next = 2;
  6593. break;
  6594. }
  6595. throw new ne({
  6596. code: "PARAM_ERROR",
  6597. message: "username must be a string"
  6598. });
  6599. case 2:
  6600. "string" != typeof t && (t = "", console.warn("password is empty"));
  6601. n = this._cache.keys.refreshTokenKey;
  6602. _context22.next = 6;
  6603. return this._request.send("auth.signIn", {
  6604. loginType: $e.USERNAME,
  6605. username: e,
  6606. password: t,
  6607. refresh_token: this._cache.getStore(n) || ""
  6608. });
  6609. case 6:
  6610. s = _context22.sent;
  6611. r = s.refresh_token;
  6612. i = s.access_token_expire;
  6613. o = s.access_token;
  6614. if (!r) {
  6615. _context22.next = 23;
  6616. break;
  6617. }
  6618. this.setRefreshToken(r);
  6619. if (!(o && i)) {
  6620. _context22.next = 16;
  6621. break;
  6622. }
  6623. this.setAccessToken(o, i);
  6624. _context22.next = 18;
  6625. break;
  6626. case 16:
  6627. _context22.next = 18;
  6628. return this._request.refreshAccessToken();
  6629. case 18:
  6630. _context22.next = 20;
  6631. return this.refreshUserInfo();
  6632. case 20:
  6633. De(qe);
  6634. De(Ke, {
  6635. env: this.config.env,
  6636. loginType: $e.USERNAME,
  6637. persistence: this.config.persistence
  6638. });
  6639. return _context22.abrupt("return", new Ze(this.config.env));
  6640. case 23:
  6641. throw s.code ? new ne({
  6642. code: s.code,
  6643. message: "\u7528\u6237\u540D\u5BC6\u7801\u767B\u5F55\u5931\u8D25: ".concat(s.message)
  6644. }) : new ne({
  6645. message: "用户名密码登录失败"
  6646. });
  6647. case 24:
  6648. case "end":
  6649. return _context22.stop();
  6650. }
  6651. }
  6652. }, _callee22, this);
  6653. }));
  6654. function signIn(_x17, _x18) {
  6655. return _signIn4.apply(this, arguments);
  6656. }
  6657. return signIn;
  6658. }()
  6659. }]);
  6660. return st;
  6661. }(Qe);
  6662. var rt = /*#__PURE__*/function () {
  6663. function rt(e) {
  6664. (0, _classCallCheck2.default)(this, rt);
  6665. this.config = e, this._cache = xe(e.env), this._request = Ye(e.env), this._onAnonymousConverted = this._onAnonymousConverted.bind(this), this._onLoginTypeChanged = this._onLoginTypeChanged.bind(this), Ne(Ke, this._onLoginTypeChanged);
  6666. }
  6667. (0, _createClass2.default)(rt, [{
  6668. key: "currentUser",
  6669. get: function get() {
  6670. var e = this.hasLoginState();
  6671. return e && e.user || null;
  6672. }
  6673. }, {
  6674. key: "loginType",
  6675. get: function get() {
  6676. return this._cache.getStore(this._cache.keys.loginTypeKey);
  6677. }
  6678. }, {
  6679. key: "anonymousAuthProvider",
  6680. value: function anonymousAuthProvider() {
  6681. return new et(this.config);
  6682. }
  6683. }, {
  6684. key: "customAuthProvider",
  6685. value: function customAuthProvider() {
  6686. return new tt(this.config);
  6687. }
  6688. }, {
  6689. key: "emailAuthProvider",
  6690. value: function emailAuthProvider() {
  6691. return new nt(this.config);
  6692. }
  6693. }, {
  6694. key: "usernameAuthProvider",
  6695. value: function usernameAuthProvider() {
  6696. return new st(this.config);
  6697. }
  6698. }, {
  6699. key: "signInAnonymously",
  6700. value: function () {
  6701. var _signInAnonymously = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee23() {
  6702. return _regenerator.default.wrap(function _callee23$(_context23) {
  6703. while (1) {
  6704. switch (_context23.prev = _context23.next) {
  6705. case 0:
  6706. return _context23.abrupt("return", new et(this.config).signIn());
  6707. case 1:
  6708. case "end":
  6709. return _context23.stop();
  6710. }
  6711. }
  6712. }, _callee23, this);
  6713. }));
  6714. function signInAnonymously() {
  6715. return _signInAnonymously.apply(this, arguments);
  6716. }
  6717. return signInAnonymously;
  6718. }()
  6719. }, {
  6720. key: "signInWithEmailAndPassword",
  6721. value: function () {
  6722. var _signInWithEmailAndPassword = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee24(e, t) {
  6723. return _regenerator.default.wrap(function _callee24$(_context24) {
  6724. while (1) {
  6725. switch (_context24.prev = _context24.next) {
  6726. case 0:
  6727. return _context24.abrupt("return", new nt(this.config).signIn(e, t));
  6728. case 1:
  6729. case "end":
  6730. return _context24.stop();
  6731. }
  6732. }
  6733. }, _callee24, this);
  6734. }));
  6735. function signInWithEmailAndPassword(_x19, _x20) {
  6736. return _signInWithEmailAndPassword.apply(this, arguments);
  6737. }
  6738. return signInWithEmailAndPassword;
  6739. }()
  6740. }, {
  6741. key: "signInWithUsernameAndPassword",
  6742. value: function signInWithUsernameAndPassword(e, t) {
  6743. return new st(this.config).signIn(e, t);
  6744. }
  6745. }, {
  6746. key: "linkAndRetrieveDataWithTicket",
  6747. value: function () {
  6748. var _linkAndRetrieveDataWithTicket2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee25(e) {
  6749. return _regenerator.default.wrap(function _callee25$(_context25) {
  6750. while (1) {
  6751. switch (_context25.prev = _context25.next) {
  6752. case 0:
  6753. this._anonymousAuthProvider || (this._anonymousAuthProvider = new et(this.config)), Ne(je, this._onAnonymousConverted);
  6754. _context25.next = 3;
  6755. return this._anonymousAuthProvider.linkAndRetrieveDataWithTicket(e);
  6756. case 3:
  6757. return _context25.abrupt("return", _context25.sent);
  6758. case 4:
  6759. case "end":
  6760. return _context25.stop();
  6761. }
  6762. }
  6763. }, _callee25, this);
  6764. }));
  6765. function linkAndRetrieveDataWithTicket(_x21) {
  6766. return _linkAndRetrieveDataWithTicket2.apply(this, arguments);
  6767. }
  6768. return linkAndRetrieveDataWithTicket;
  6769. }()
  6770. }, {
  6771. key: "signOut",
  6772. value: function () {
  6773. var _signOut = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee26() {
  6774. var _this$_cache$keys10, e, t, n, s, r;
  6775. return _regenerator.default.wrap(function _callee26$(_context26) {
  6776. while (1) {
  6777. switch (_context26.prev = _context26.next) {
  6778. case 0:
  6779. if (!(this.loginType === $e.ANONYMOUS)) {
  6780. _context26.next = 2;
  6781. break;
  6782. }
  6783. throw new ne({
  6784. message: "匿名用户不支持登出操作"
  6785. });
  6786. case 2:
  6787. _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);
  6788. if (s) {
  6789. _context26.next = 5;
  6790. break;
  6791. }
  6792. return _context26.abrupt("return");
  6793. case 5:
  6794. _context26.next = 7;
  6795. return this._request.send("auth.logout", {
  6796. refresh_token: s
  6797. });
  6798. case 7:
  6799. r = _context26.sent;
  6800. return _context26.abrupt("return", (this._cache.removeStore(e), this._cache.removeStore(t), this._cache.removeStore(n), De(qe), De(Ke, {
  6801. env: this.config.env,
  6802. loginType: $e.NULL,
  6803. persistence: this.config.persistence
  6804. }), r));
  6805. case 9:
  6806. case "end":
  6807. return _context26.stop();
  6808. }
  6809. }
  6810. }, _callee26, this);
  6811. }));
  6812. function signOut() {
  6813. return _signOut.apply(this, arguments);
  6814. }
  6815. return signOut;
  6816. }()
  6817. }, {
  6818. key: "signUpWithEmailAndPassword",
  6819. value: function () {
  6820. var _signUpWithEmailAndPassword = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee27(e, t) {
  6821. return _regenerator.default.wrap(function _callee27$(_context27) {
  6822. while (1) {
  6823. switch (_context27.prev = _context27.next) {
  6824. case 0:
  6825. return _context27.abrupt("return", this._request.send("auth.signUpWithEmailAndPassword", {
  6826. email: e,
  6827. password: t
  6828. }));
  6829. case 1:
  6830. case "end":
  6831. return _context27.stop();
  6832. }
  6833. }
  6834. }, _callee27, this);
  6835. }));
  6836. function signUpWithEmailAndPassword(_x22, _x23) {
  6837. return _signUpWithEmailAndPassword.apply(this, arguments);
  6838. }
  6839. return signUpWithEmailAndPassword;
  6840. }()
  6841. }, {
  6842. key: "sendPasswordResetEmail",
  6843. value: function () {
  6844. var _sendPasswordResetEmail = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee28(e) {
  6845. return _regenerator.default.wrap(function _callee28$(_context28) {
  6846. while (1) {
  6847. switch (_context28.prev = _context28.next) {
  6848. case 0:
  6849. return _context28.abrupt("return", this._request.send("auth.sendPasswordResetEmail", {
  6850. email: e
  6851. }));
  6852. case 1:
  6853. case "end":
  6854. return _context28.stop();
  6855. }
  6856. }
  6857. }, _callee28, this);
  6858. }));
  6859. function sendPasswordResetEmail(_x24) {
  6860. return _sendPasswordResetEmail.apply(this, arguments);
  6861. }
  6862. return sendPasswordResetEmail;
  6863. }()
  6864. }, {
  6865. key: "onLoginStateChanged",
  6866. value: function onLoginStateChanged(e) {
  6867. var _this9 = this;
  6868. Ne(qe, function () {
  6869. var t = _this9.hasLoginState();
  6870. e.call(_this9, t);
  6871. });
  6872. var t = this.hasLoginState();
  6873. e.call(this, t);
  6874. }
  6875. }, {
  6876. key: "onLoginStateExpired",
  6877. value: function onLoginStateExpired(e) {
  6878. Ne(Me, e.bind(this));
  6879. }
  6880. }, {
  6881. key: "onAccessTokenRefreshed",
  6882. value: function onAccessTokenRefreshed(e) {
  6883. Ne(Be, e.bind(this));
  6884. }
  6885. }, {
  6886. key: "onAnonymousConverted",
  6887. value: function onAnonymousConverted(e) {
  6888. Ne(je, e.bind(this));
  6889. }
  6890. }, {
  6891. key: "onLoginTypeChanged",
  6892. value: function onLoginTypeChanged(e) {
  6893. var _this10 = this;
  6894. Ne(Ke, function () {
  6895. var t = _this10.hasLoginState();
  6896. e.call(_this10, t);
  6897. });
  6898. }
  6899. }, {
  6900. key: "getAccessToken",
  6901. value: function () {
  6902. var _getAccessToken2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee29() {
  6903. return _regenerator.default.wrap(function _callee29$(_context29) {
  6904. while (1) {
  6905. switch (_context29.prev = _context29.next) {
  6906. case 0:
  6907. _context29.next = 2;
  6908. return this._request.getAccessToken();
  6909. case 2:
  6910. _context29.t0 = _context29.sent.accessToken;
  6911. _context29.t1 = this.config.env;
  6912. return _context29.abrupt("return", {
  6913. accessToken: _context29.t0,
  6914. env: _context29.t1
  6915. });
  6916. case 5:
  6917. case "end":
  6918. return _context29.stop();
  6919. }
  6920. }
  6921. }, _callee29, this);
  6922. }));
  6923. function getAccessToken() {
  6924. return _getAccessToken2.apply(this, arguments);
  6925. }
  6926. return getAccessToken;
  6927. }()
  6928. }, {
  6929. key: "hasLoginState",
  6930. value: function hasLoginState() {
  6931. var e = this._cache.keys.refreshTokenKey;
  6932. return this._cache.getStore(e) ? new Ze(this.config.env) : null;
  6933. }
  6934. }, {
  6935. key: "isUsernameRegistered",
  6936. value: function () {
  6937. var _isUsernameRegistered = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee30(e) {
  6938. var _yield$this$_request$5, t;
  6939. return _regenerator.default.wrap(function _callee30$(_context30) {
  6940. while (1) {
  6941. switch (_context30.prev = _context30.next) {
  6942. case 0:
  6943. if (!("string" != typeof e)) {
  6944. _context30.next = 2;
  6945. break;
  6946. }
  6947. throw new ne({
  6948. code: "PARAM_ERROR",
  6949. message: "username must be a string"
  6950. });
  6951. case 2:
  6952. _context30.next = 4;
  6953. return this._request.send("auth.isUsernameRegistered", {
  6954. username: e
  6955. });
  6956. case 4:
  6957. _yield$this$_request$5 = _context30.sent;
  6958. t = _yield$this$_request$5.data;
  6959. return _context30.abrupt("return", t && t.isRegistered);
  6960. case 7:
  6961. case "end":
  6962. return _context30.stop();
  6963. }
  6964. }
  6965. }, _callee30, this);
  6966. }));
  6967. function isUsernameRegistered(_x25) {
  6968. return _isUsernameRegistered.apply(this, arguments);
  6969. }
  6970. return isUsernameRegistered;
  6971. }()
  6972. }, {
  6973. key: "getLoginState",
  6974. value: function getLoginState() {
  6975. return Promise.resolve(this.hasLoginState());
  6976. }
  6977. }, {
  6978. key: "signInWithTicket",
  6979. value: function () {
  6980. var _signInWithTicket = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee31(e) {
  6981. return _regenerator.default.wrap(function _callee31$(_context31) {
  6982. while (1) {
  6983. switch (_context31.prev = _context31.next) {
  6984. case 0:
  6985. return _context31.abrupt("return", new tt(this.config).signIn(e));
  6986. case 1:
  6987. case "end":
  6988. return _context31.stop();
  6989. }
  6990. }
  6991. }, _callee31, this);
  6992. }));
  6993. function signInWithTicket(_x26) {
  6994. return _signInWithTicket.apply(this, arguments);
  6995. }
  6996. return signInWithTicket;
  6997. }()
  6998. }, {
  6999. key: "shouldRefreshAccessToken",
  7000. value: function shouldRefreshAccessToken(e) {
  7001. this._request._shouldRefreshAccessTokenHook = e.bind(this);
  7002. }
  7003. }, {
  7004. key: "getUserInfo",
  7005. value: function getUserInfo() {
  7006. return this._request.send("auth.getUserInfo", {}).then(function (e) {
  7007. return e.code ? e : _objectSpread(_objectSpread({}, e.data), {}, {
  7008. requestId: e.seqId
  7009. });
  7010. });
  7011. }
  7012. }, {
  7013. key: "getAuthHeader",
  7014. value: function getAuthHeader() {
  7015. var _this$_cache$keys11 = this._cache.keys,
  7016. e = _this$_cache$keys11.refreshTokenKey,
  7017. t = _this$_cache$keys11.accessTokenKey,
  7018. n = this._cache.getStore(e);
  7019. return {
  7020. "x-cloudbase-credentials": this._cache.getStore(t) + "/@@/" + n
  7021. };
  7022. }
  7023. }, {
  7024. key: "_onAnonymousConverted",
  7025. value: function _onAnonymousConverted(e) {
  7026. var t = e.data.env;
  7027. t === this.config.env && this._cache.updatePersistence(this.config.persistence);
  7028. }
  7029. }, {
  7030. key: "_onLoginTypeChanged",
  7031. value: function _onLoginTypeChanged(e) {
  7032. var _e$data = e.data,
  7033. t = _e$data.loginType,
  7034. n = _e$data.persistence,
  7035. s = _e$data.env;
  7036. s === this.config.env && (this._cache.updatePersistence(n), this._cache.setStore(this._cache.keys.loginTypeKey, t));
  7037. }
  7038. }]);
  7039. return rt;
  7040. }();
  7041. var it = function it(e, t) {
  7042. t = t || we();
  7043. var n = Ye(this.config.env),
  7044. s = e.cloudPath,
  7045. r = e.filePath,
  7046. i = e.onUploadProgress,
  7047. _e$fileType = e.fileType,
  7048. o = _e$fileType === void 0 ? "image" : _e$fileType;
  7049. return n.send("storage.getUploadMetadata", {
  7050. path: s
  7051. }).then(function (e) {
  7052. var _e$data2 = e.data,
  7053. a = _e$data2.url,
  7054. c = _e$data2.authorization,
  7055. u = _e$data2.token,
  7056. h = _e$data2.fileId,
  7057. l = _e$data2.cosFileId,
  7058. d = e.requestId,
  7059. p = {
  7060. key: s,
  7061. signature: c,
  7062. "x-cos-meta-fileid": l,
  7063. success_action_status: "201",
  7064. "x-cos-security-token": u
  7065. };
  7066. n.upload({
  7067. url: a,
  7068. data: p,
  7069. file: r,
  7070. name: s,
  7071. fileType: o,
  7072. onUploadProgress: i
  7073. }).then(function (e) {
  7074. 201 === e.statusCode ? t(null, {
  7075. fileID: h,
  7076. requestId: d
  7077. }) : t(new ne({
  7078. code: "STORAGE_REQUEST_FAIL",
  7079. message: "STORAGE_REQUEST_FAIL: ".concat(e.data)
  7080. }));
  7081. }).catch(function (e) {
  7082. t(e);
  7083. });
  7084. }).catch(function (e) {
  7085. t(e);
  7086. }), t.promise;
  7087. },
  7088. ot = function ot(e, t) {
  7089. t = t || we();
  7090. var n = Ye(this.config.env),
  7091. s = e.cloudPath;
  7092. return n.send("storage.getUploadMetadata", {
  7093. path: s
  7094. }).then(function (e) {
  7095. t(null, e);
  7096. }).catch(function (e) {
  7097. t(e);
  7098. }), t.promise;
  7099. },
  7100. at = function at(_ref7, t) {
  7101. var e = _ref7.fileList;
  7102. if (t = t || we(), !e || !Array.isArray(e)) return {
  7103. code: "INVALID_PARAM",
  7104. message: "fileList必须是非空的数组"
  7105. };
  7106. var _iterator3 = _createForOfIteratorHelper(e),
  7107. _step3;
  7108. try {
  7109. for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
  7110. var _t8 = _step3.value;
  7111. if (!_t8 || "string" != typeof _t8) return {
  7112. code: "INVALID_PARAM",
  7113. message: "fileList的元素必须是非空的字符串"
  7114. };
  7115. }
  7116. } catch (err) {
  7117. _iterator3.e(err);
  7118. } finally {
  7119. _iterator3.f();
  7120. }
  7121. var n = {
  7122. fileid_list: e
  7123. };
  7124. return Ye(this.config.env).send("storage.batchDeleteFile", n).then(function (e) {
  7125. e.code ? t(null, e) : t(null, {
  7126. fileList: e.data.delete_list,
  7127. requestId: e.requestId
  7128. });
  7129. }).catch(function (e) {
  7130. t(e);
  7131. }), t.promise;
  7132. },
  7133. ct = function ct(_ref8, t) {
  7134. var e = _ref8.fileList;
  7135. t = t || we(), e && Array.isArray(e) || t(null, {
  7136. code: "INVALID_PARAM",
  7137. message: "fileList必须是非空的数组"
  7138. });
  7139. var n = [];
  7140. var _iterator4 = _createForOfIteratorHelper(e),
  7141. _step4;
  7142. try {
  7143. for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
  7144. var _s9 = _step4.value;
  7145. "object" == (0, _typeof2.default)(_s9) ? (_s9.hasOwnProperty("fileID") && _s9.hasOwnProperty("maxAge") || t(null, {
  7146. code: "INVALID_PARAM",
  7147. message: "fileList的元素必须是包含fileID和maxAge的对象"
  7148. }), n.push({
  7149. fileid: _s9.fileID,
  7150. max_age: _s9.maxAge
  7151. })) : "string" == typeof _s9 ? n.push({
  7152. fileid: _s9
  7153. }) : t(null, {
  7154. code: "INVALID_PARAM",
  7155. message: "fileList的元素必须是字符串"
  7156. });
  7157. }
  7158. } catch (err) {
  7159. _iterator4.e(err);
  7160. } finally {
  7161. _iterator4.f();
  7162. }
  7163. var s = {
  7164. file_list: n
  7165. };
  7166. return Ye(this.config.env).send("storage.batchGetDownloadUrl", s).then(function (e) {
  7167. e.code ? t(null, e) : t(null, {
  7168. fileList: e.data.download_list,
  7169. requestId: e.requestId
  7170. });
  7171. }).catch(function (e) {
  7172. t(e);
  7173. }), t.promise;
  7174. },
  7175. ut = /*#__PURE__*/function () {
  7176. var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee32(_ref9, t) {
  7177. var e, n, s, r;
  7178. return _regenerator.default.wrap(function _callee32$(_context32) {
  7179. while (1) {
  7180. switch (_context32.prev = _context32.next) {
  7181. case 0:
  7182. e = _ref9.fileID;
  7183. _context32.next = 3;
  7184. return ct.call(this, {
  7185. fileList: [{
  7186. fileID: e,
  7187. maxAge: 600
  7188. }]
  7189. });
  7190. case 3:
  7191. n = _context32.sent.fileList[0];
  7192. if (!("SUCCESS" !== n.code)) {
  7193. _context32.next = 6;
  7194. break;
  7195. }
  7196. return _context32.abrupt("return", t ? t(n) : new Promise(function (e) {
  7197. e(n);
  7198. }));
  7199. case 6:
  7200. s = Ye(this.config.env);
  7201. r = n.download_url;
  7202. if (!(r = encodeURI(r), !t)) {
  7203. _context32.next = 10;
  7204. break;
  7205. }
  7206. return _context32.abrupt("return", s.download({
  7207. url: r
  7208. }));
  7209. case 10:
  7210. _context32.t0 = t;
  7211. _context32.next = 13;
  7212. return s.download({
  7213. url: r
  7214. });
  7215. case 13:
  7216. _context32.t1 = _context32.sent;
  7217. (0, _context32.t0)(_context32.t1);
  7218. case 15:
  7219. case "end":
  7220. return _context32.stop();
  7221. }
  7222. }
  7223. }, _callee32, this);
  7224. }));
  7225. return function ut(_x27, _x28) {
  7226. return _ref10.apply(this, arguments);
  7227. };
  7228. }(),
  7229. ht = function ht(_ref11, i) {
  7230. var e = _ref11.name,
  7231. t = _ref11.data,
  7232. n = _ref11.query,
  7233. s = _ref11.parse,
  7234. r = _ref11.search;
  7235. var o = i || we();
  7236. var a;
  7237. try {
  7238. a = t ? JSON.stringify(t) : "";
  7239. } catch (e) {
  7240. return Promise.reject(e);
  7241. }
  7242. if (!e) return Promise.reject(new ne({
  7243. code: "PARAM_ERROR",
  7244. message: "函数名不能为空"
  7245. }));
  7246. var c = {
  7247. inQuery: n,
  7248. parse: s,
  7249. search: r,
  7250. function_name: e,
  7251. request_data: a
  7252. };
  7253. return Ye(this.config.env).send("functions.invokeFunction", c).then(function (e) {
  7254. if (e.code) o(null, e);else {
  7255. var _t9 = e.data.response_data;
  7256. if (s) o(null, {
  7257. result: _t9,
  7258. requestId: e.requestId
  7259. });else try {
  7260. _t9 = JSON.parse(e.data.response_data), o(null, {
  7261. result: _t9,
  7262. requestId: e.requestId
  7263. });
  7264. } catch (e) {
  7265. o(new ne({
  7266. message: "response data must be json"
  7267. }));
  7268. }
  7269. }
  7270. return o.promise;
  7271. }).catch(function (e) {
  7272. o(e);
  7273. }), o.promise;
  7274. },
  7275. lt = {
  7276. timeout: 15e3,
  7277. persistence: "session"
  7278. },
  7279. dt = {};
  7280. var pt = /*#__PURE__*/function () {
  7281. function pt(e) {
  7282. (0, _classCallCheck2.default)(this, pt);
  7283. this.config = e || this.config, this.authObj = void 0;
  7284. }
  7285. (0, _createClass2.default)(pt, [{
  7286. key: "init",
  7287. value: function init(e) {
  7288. switch (ke.adapter || (this.requestClient = new ke.adapter.reqClass({
  7289. timeout: e.timeout || 5e3,
  7290. timeoutMsg: "\u8BF7\u6C42\u5728".concat((e.timeout || 5e3) / 1e3, "s\u5185\u672A\u5B8C\u6210\uFF0C\u5DF2\u4E2D\u65AD")
  7291. })), this.config = _objectSpread(_objectSpread({}, lt), e), !0) {
  7292. case this.config.timeout > 6e5:
  7293. console.warn("timeout大于可配置上限[10分钟],已重置为上限数值"), this.config.timeout = 6e5;
  7294. break;
  7295. case this.config.timeout < 100:
  7296. console.warn("timeout小于可配置下限[100ms],已重置为下限数值"), this.config.timeout = 100;
  7297. }
  7298. return new pt(this.config);
  7299. }
  7300. }, {
  7301. key: "auth",
  7302. value: function auth() {
  7303. var _ref12 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  7304. e = _ref12.persistence;
  7305. if (this.authObj) return this.authObj;
  7306. var t = e || ke.adapter.primaryStorage || lt.persistence;
  7307. var n;
  7308. return t !== this.config.persistence && (this.config.persistence = t), function (e) {
  7309. var t = e.env;
  7310. Ee[t] = new Ae(e), Oe[t] = new Ae(_objectSpread(_objectSpread({}, e), {}, {
  7311. persistence: "local"
  7312. }));
  7313. }(this.config), n = this.config, Ve[n.env] = new Ge(n), this.authObj = new rt(this.config), this.authObj;
  7314. }
  7315. }, {
  7316. key: "on",
  7317. value: function on(e, t) {
  7318. return Ne.apply(this, [e, t]);
  7319. }
  7320. }, {
  7321. key: "off",
  7322. value: function off(e, t) {
  7323. return Fe.apply(this, [e, t]);
  7324. }
  7325. }, {
  7326. key: "callFunction",
  7327. value: function callFunction(e, t) {
  7328. return ht.apply(this, [e, t]);
  7329. }
  7330. }, {
  7331. key: "deleteFile",
  7332. value: function deleteFile(e, t) {
  7333. return at.apply(this, [e, t]);
  7334. }
  7335. }, {
  7336. key: "getTempFileURL",
  7337. value: function getTempFileURL(e, t) {
  7338. return ct.apply(this, [e, t]);
  7339. }
  7340. }, {
  7341. key: "downloadFile",
  7342. value: function downloadFile(e, t) {
  7343. return ut.apply(this, [e, t]);
  7344. }
  7345. }, {
  7346. key: "uploadFile",
  7347. value: function uploadFile(e, t) {
  7348. return it.apply(this, [e, t]);
  7349. }
  7350. }, {
  7351. key: "getUploadMetadata",
  7352. value: function getUploadMetadata(e, t) {
  7353. return ot.apply(this, [e, t]);
  7354. }
  7355. }, {
  7356. key: "registerExtension",
  7357. value: function registerExtension(e) {
  7358. dt[e.name] = e;
  7359. }
  7360. }, {
  7361. key: "invokeExtension",
  7362. value: function () {
  7363. var _invokeExtension = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee33(e, t) {
  7364. var n;
  7365. return _regenerator.default.wrap(function _callee33$(_context33) {
  7366. while (1) {
  7367. switch (_context33.prev = _context33.next) {
  7368. case 0:
  7369. n = dt[e];
  7370. if (n) {
  7371. _context33.next = 3;
  7372. break;
  7373. }
  7374. throw new ne({
  7375. message: "\u6269\u5C55".concat(e, " \u5FC5\u987B\u5148\u6CE8\u518C")
  7376. });
  7377. case 3:
  7378. _context33.next = 5;
  7379. return n.invoke(t, this);
  7380. case 5:
  7381. return _context33.abrupt("return", _context33.sent);
  7382. case 6:
  7383. case "end":
  7384. return _context33.stop();
  7385. }
  7386. }
  7387. }, _callee33, this);
  7388. }));
  7389. function invokeExtension(_x29, _x30) {
  7390. return _invokeExtension.apply(this, arguments);
  7391. }
  7392. return invokeExtension;
  7393. }()
  7394. }, {
  7395. key: "useAdapters",
  7396. value: function useAdapters(e) {
  7397. var _ref13 = be(e) || {},
  7398. t = _ref13.adapter,
  7399. n = _ref13.runtime;
  7400. t && (ke.adapter = t), n && (ke.runtime = n);
  7401. }
  7402. }]);
  7403. return pt;
  7404. }();
  7405. var ft = new pt();
  7406. function gt(e, t, n) {
  7407. void 0 === n && (n = {});
  7408. var s = /\?/.test(t),
  7409. r = "";
  7410. for (var i in n) {
  7411. "" === r ? !s && (t += "?") : r += "&", r += i + "=" + encodeURIComponent(n[i]);
  7412. }
  7413. return /^http(s)?:\/\//.test(t += r) ? t : "" + e + t;
  7414. }
  7415. var mt = /*#__PURE__*/function () {
  7416. function mt() {
  7417. (0, _classCallCheck2.default)(this, mt);
  7418. }
  7419. (0, _createClass2.default)(mt, [{
  7420. key: "post",
  7421. value: function post(e) {
  7422. var t = e.url,
  7423. n = e.data,
  7424. s = e.headers;
  7425. return new Promise(function (e, r) {
  7426. se.request({
  7427. url: gt("https:", t),
  7428. data: n,
  7429. method: "POST",
  7430. header: s,
  7431. success: function success(t) {
  7432. e(t);
  7433. },
  7434. fail: function fail(e) {
  7435. r(e);
  7436. }
  7437. });
  7438. });
  7439. }
  7440. }, {
  7441. key: "upload",
  7442. value: function upload(e) {
  7443. return new Promise(function (t, n) {
  7444. var s = e.url,
  7445. r = e.file,
  7446. i = e.data,
  7447. o = e.headers,
  7448. a = e.fileType,
  7449. c = se.uploadFile({
  7450. url: gt("https:", s),
  7451. name: "file",
  7452. formData: Object.assign({}, i),
  7453. filePath: r,
  7454. fileType: a,
  7455. header: o,
  7456. success: function success(e) {
  7457. var n = {
  7458. statusCode: e.statusCode,
  7459. data: e.data || {}
  7460. };
  7461. 200 === e.statusCode && i.success_action_status && (n.statusCode = parseInt(i.success_action_status, 10)), t(n);
  7462. },
  7463. fail: function fail(e) {
  7464. n(new Error(e.errMsg || "uploadFile:fail"));
  7465. }
  7466. });
  7467. "function" == typeof e.onUploadProgress && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (t) {
  7468. e.onUploadProgress({
  7469. loaded: t.totalBytesSent,
  7470. total: t.totalBytesExpectedToSend
  7471. });
  7472. });
  7473. });
  7474. }
  7475. }]);
  7476. return mt;
  7477. }();
  7478. var yt = {
  7479. setItem: function setItem(e, t) {
  7480. se.setStorageSync(e, t);
  7481. },
  7482. getItem: function getItem(e) {
  7483. return se.getStorageSync(e);
  7484. },
  7485. removeItem: function removeItem(e) {
  7486. se.removeStorageSync(e);
  7487. },
  7488. clear: function clear() {
  7489. se.clearStorageSync();
  7490. }
  7491. };
  7492. var _t = {
  7493. genAdapter: function genAdapter() {
  7494. return {
  7495. root: {},
  7496. reqClass: mt,
  7497. localStorage: yt,
  7498. primaryStorage: "local"
  7499. };
  7500. },
  7501. isMatch: function isMatch() {
  7502. return !0;
  7503. },
  7504. runtime: "uni_app"
  7505. };
  7506. ft.useAdapters(_t);
  7507. var wt = ft,
  7508. vt = wt.init;
  7509. wt.init = function (e) {
  7510. e.env = e.spaceId;
  7511. var t = vt.call(this, e);
  7512. t.config.provider = "tencent", t.config.spaceId = e.spaceId;
  7513. var n = t.auth;
  7514. return t.auth = function (e) {
  7515. var t = n.call(this, e);
  7516. return ["linkAndRetrieveDataWithTicket", "signInAnonymously", "signOut", "getAccessToken", "getLoginState", "signInWithTicket", "getUserInfo"].forEach(function (e) {
  7517. var n;
  7518. t[e] = (n = t[e], function (e) {
  7519. e = e || {};
  7520. var _te = te(e),
  7521. t = _te.success,
  7522. s = _te.fail,
  7523. r = _te.complete;
  7524. if (!(t || s || r)) return n.call(this, e);
  7525. n.call(this, e).then(function (e) {
  7526. t && t(e), r && r(e);
  7527. }, function (e) {
  7528. s && s(e), r && r(e);
  7529. });
  7530. }).bind(t);
  7531. }), t;
  7532. }, t.customAuth = t.auth, t;
  7533. };
  7534. var It = wt;
  7535. var St = /*#__PURE__*/function (_fe) {
  7536. (0, _inherits2.default)(St, _fe);
  7537. var _super8 = _createSuper(St);
  7538. function St() {
  7539. (0, _classCallCheck2.default)(this, St);
  7540. return _super8.apply(this, arguments);
  7541. }
  7542. (0, _createClass2.default)(St, [{
  7543. key: "getAccessToken",
  7544. value: function getAccessToken() {
  7545. var _this11 = this;
  7546. return new Promise(function (e, t) {
  7547. var n = "Anonymous_Access_token";
  7548. _this11.setAccessToken(n), e(n);
  7549. });
  7550. }
  7551. }, {
  7552. key: "setupRequest",
  7553. value: function setupRequest(e, t) {
  7554. var n = Object.assign({}, e, {
  7555. spaceId: this.config.spaceId,
  7556. timestamp: Date.now()
  7557. }),
  7558. s = {
  7559. "Content-Type": "application/json"
  7560. };
  7561. "auth" !== t && (n.token = this.accessToken, s["x-basement-token"] = this.accessToken), s["x-serverless-sign"] = le.sign(n, this.config.clientSecret);
  7562. var r = he();
  7563. s["x-client-info"] = encodeURIComponent(JSON.stringify(r));
  7564. var _re = re(),
  7565. i = _re.token;
  7566. return s["x-client-token"] = i, {
  7567. url: this.config.requestUrl,
  7568. method: "POST",
  7569. data: n,
  7570. dataType: "json",
  7571. header: JSON.parse(JSON.stringify(s))
  7572. };
  7573. }
  7574. }, {
  7575. key: "uploadFileToOSS",
  7576. value: function uploadFileToOSS(_ref14) {
  7577. var _this12 = this;
  7578. var e = _ref14.url,
  7579. t = _ref14.formData,
  7580. n = _ref14.name,
  7581. s = _ref14.filePath,
  7582. r = _ref14.fileType,
  7583. i = _ref14.onUploadProgress;
  7584. return new Promise(function (o, a) {
  7585. var c = _this12.adapter.uploadFile({
  7586. url: e,
  7587. formData: t,
  7588. name: n,
  7589. filePath: s,
  7590. fileType: r,
  7591. success: function success(e) {
  7592. e && e.statusCode < 400 ? o(e) : a(new ne({
  7593. code: "UPLOAD_FAILED",
  7594. message: "文件上传失败"
  7595. }));
  7596. },
  7597. fail: function fail(e) {
  7598. a(new ne({
  7599. code: e.code || "UPLOAD_FAILED",
  7600. message: e.message || e.errMsg || "文件上传失败"
  7601. }));
  7602. }
  7603. });
  7604. "function" == typeof i && c && "function" == typeof c.onProgressUpdate && c.onProgressUpdate(function (e) {
  7605. i({
  7606. loaded: e.totalBytesSent,
  7607. total: e.totalBytesExpectedToSend
  7608. });
  7609. });
  7610. });
  7611. }
  7612. }, {
  7613. key: "uploadFile",
  7614. value: function uploadFile(_ref15) {
  7615. var _this13 = this;
  7616. var e = _ref15.filePath,
  7617. t = _ref15.cloudPath,
  7618. _ref15$fileType = _ref15.fileType,
  7619. n = _ref15$fileType === void 0 ? "image" : _ref15$fileType,
  7620. s = _ref15.onUploadProgress;
  7621. if (!t) throw new ne({
  7622. code: "CLOUDPATH_REQUIRED",
  7623. message: "cloudPath不可为空"
  7624. });
  7625. var r;
  7626. return this.getOSSUploadOptionsFromPath({
  7627. cloudPath: t
  7628. }).then(function (t) {
  7629. var _t$result = t.result,
  7630. i = _t$result.url,
  7631. o = _t$result.formData,
  7632. a = _t$result.name;
  7633. r = t.result.fileUrl;
  7634. var c = {
  7635. url: i,
  7636. formData: o,
  7637. name: a,
  7638. filePath: e,
  7639. fileType: n
  7640. };
  7641. return _this13.uploadFileToOSS(Object.assign({}, c, {
  7642. onUploadProgress: s
  7643. }));
  7644. }).then(function () {
  7645. return _this13.reportOSSUpload({
  7646. cloudPath: t
  7647. });
  7648. }).then(function (t) {
  7649. return new Promise(function (n, s) {
  7650. t.success ? n({
  7651. success: !0,
  7652. filePath: e,
  7653. fileID: r
  7654. }) : s(new ne({
  7655. code: "UPLOAD_FAILED",
  7656. message: "文件上传失败"
  7657. }));
  7658. });
  7659. });
  7660. }
  7661. }, {
  7662. key: "deleteFile",
  7663. value: function deleteFile(_ref16) {
  7664. var e = _ref16.fileList;
  7665. var t = {
  7666. method: "serverless.file.resource.delete",
  7667. params: JSON.stringify({
  7668. fileList: e
  7669. })
  7670. };
  7671. return this.request(this.setupRequest(t)).then(function (e) {
  7672. if (e.success) return e.result;
  7673. throw new ne({
  7674. code: "DELETE_FILE_FAILED",
  7675. message: "删除文件失败"
  7676. });
  7677. });
  7678. }
  7679. }, {
  7680. key: "getTempFileURL",
  7681. value: function getTempFileURL() {
  7682. var _ref17 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  7683. e = _ref17.fileList;
  7684. if (!Array.isArray(e) || 0 === e.length) throw new ne({
  7685. code: "INVALID_PARAM",
  7686. message: "fileList的元素必须是非空的字符串"
  7687. });
  7688. var t = {
  7689. method: "serverless.file.resource.getTempFileURL",
  7690. params: JSON.stringify({
  7691. fileList: e
  7692. })
  7693. };
  7694. return this.request(this.setupRequest(t)).then(function (e) {
  7695. if (e.success) return {
  7696. fileList: e.result.fileList.map(function (e) {
  7697. return {
  7698. fileID: e.fileID,
  7699. tempFileURL: e.tempFileURL
  7700. };
  7701. })
  7702. };
  7703. throw new ne({
  7704. code: "GET_TEMP_FILE_URL_FAILED",
  7705. message: "获取临时文件链接失败"
  7706. });
  7707. });
  7708. }
  7709. }]);
  7710. return St;
  7711. }(fe);
  7712. var bt = {
  7713. init: function init(e) {
  7714. var t = new St(e),
  7715. n = {
  7716. signInAnonymously: function signInAnonymously() {
  7717. return t.authorize();
  7718. },
  7719. getLoginState: function getLoginState() {
  7720. return Promise.resolve(!1);
  7721. }
  7722. };
  7723. return t.auth = function () {
  7724. return n;
  7725. }, t.customAuth = t.auth, t;
  7726. }
  7727. };
  7728. function kt(_ref18) {
  7729. var e = _ref18.data;
  7730. var t;
  7731. t = he();
  7732. var n = JSON.parse(JSON.stringify(e || {}));
  7733. if (Object.assign(n, {
  7734. clientInfo: t
  7735. }), !n.uniIdToken) {
  7736. var _re2 = re(),
  7737. _e19 = _re2.token;
  7738. _e19 && (n.uniIdToken = _e19);
  7739. }
  7740. return n;
  7741. }
  7742. function Ct() {
  7743. return _Ct.apply(this, arguments);
  7744. }
  7745. function _Ct() {
  7746. _Ct = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee54() {
  7747. var _this26 = this;
  7748. var _ref60,
  7749. e,
  7750. t,
  7751. _this$__dev__,
  7752. n,
  7753. s,
  7754. r,
  7755. i,
  7756. o,
  7757. a,
  7758. _args6 = arguments;
  7759. return _regenerator.default.wrap(function _callee54$(_context54) {
  7760. while (1) {
  7761. switch (_context54.prev = _context54.next) {
  7762. case 0:
  7763. _ref60 = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {}, e = _ref60.name, t = _ref60.data;
  7764. _context54.next = 3;
  7765. return this.__dev__.initLocalNetwork();
  7766. case 3:
  7767. _this$__dev__ = this.__dev__, n = _this$__dev__.localAddress, s = _this$__dev__.localPort, r = {
  7768. aliyun: "aliyun",
  7769. tencent: "tcb"
  7770. }[this.config.provider], i = this.config.spaceId, o = "http://".concat(n, ":").concat(s, "/system/check-function"), a = "http://".concat(n, ":").concat(s, "/cloudfunctions/").concat(e);
  7771. return _context54.abrupt("return", new Promise(function (t, n) {
  7772. se.request({
  7773. method: "POST",
  7774. url: o,
  7775. data: {
  7776. name: e,
  7777. platform: P,
  7778. provider: r,
  7779. spaceId: i
  7780. },
  7781. timeout: 3e3,
  7782. success: function success(e) {
  7783. t(e);
  7784. },
  7785. fail: function fail() {
  7786. t({
  7787. data: {
  7788. code: "NETWORK_ERROR",
  7789. message: "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下,自动切换为已部署的云函数。"
  7790. }
  7791. });
  7792. }
  7793. });
  7794. }).then(function () {
  7795. var _ref61 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  7796. e = _ref61.data;
  7797. var _ref62 = e || {},
  7798. t = _ref62.code,
  7799. n = _ref62.message;
  7800. return {
  7801. code: 0 === t ? 0 : t || "SYS_ERR",
  7802. message: n || "SYS_ERR"
  7803. };
  7804. }).then(function (_ref63) {
  7805. var n = _ref63.code,
  7806. s = _ref63.message;
  7807. if (0 !== n) {
  7808. switch (n) {
  7809. case "MODULE_ENCRYPTED":
  7810. 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"));
  7811. break;
  7812. case "FUNCTION_ENCRYPTED":
  7813. 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"));
  7814. break;
  7815. case "ACTION_ENCRYPTED":
  7816. console.error(s || "需要访问加密的uni-clientDB-action,自动切换为云端环境");
  7817. break;
  7818. case "NETWORK_ERROR":
  7819. {
  7820. var _e31 = "连接本地调试服务失败,请检查客户端是否和主机在同一局域网下";
  7821. throw console.error(_e31), new Error(_e31);
  7822. }
  7823. case "SWITCH_TO_CLOUD":
  7824. break;
  7825. default:
  7826. {
  7827. var _e32 = "\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");
  7828. throw console.error(_e32), new Error(_e32);
  7829. }
  7830. }
  7831. return _this26._callCloudFunction({
  7832. name: e,
  7833. data: t
  7834. });
  7835. }
  7836. return new Promise(function (e, n) {
  7837. var s = kt.call(_this26, {
  7838. data: t
  7839. });
  7840. se.request({
  7841. method: "POST",
  7842. url: a,
  7843. data: {
  7844. provider: r,
  7845. platform: P,
  7846. param: s
  7847. },
  7848. success: function success() {
  7849. var _ref64 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  7850. t = _ref64.statusCode,
  7851. s = _ref64.data;
  7852. return !t || t >= 400 ? n(new ne({
  7853. code: s.code || "SYS_ERR",
  7854. message: s.message || "request:fail"
  7855. })) : e({
  7856. result: s
  7857. });
  7858. },
  7859. fail: function fail(e) {
  7860. n(new ne({
  7861. code: e.code || e.errCode || "SYS_ERR",
  7862. message: e.message || e.errMsg || "request:fail"
  7863. }));
  7864. }
  7865. });
  7866. });
  7867. }));
  7868. case 5:
  7869. case "end":
  7870. return _context54.stop();
  7871. }
  7872. }
  7873. }, _callee54, this);
  7874. }));
  7875. return _Ct.apply(this, arguments);
  7876. }
  7877. var Tt = [{
  7878. rule: /fc_function_not_found|FUNCTION_NOT_FOUND/,
  7879. content: ",云函数[{functionName}]在云端不存在,请检查此云函数名称是否正确以及该云函数是否已上传到服务空间",
  7880. mode: "append"
  7881. }];
  7882. var Pt = /[\\^$.*+?()[\]{}|]/g,
  7883. At = RegExp(Pt.source);
  7884. function Et(e, t, n) {
  7885. return e.replace(new RegExp((s = t) && At.test(s) ? s.replace(Pt, "\\$&") : s, "g"), n);
  7886. var s;
  7887. }
  7888. var Ot = "none",
  7889. xt = "request",
  7890. Rt = "response",
  7891. Ut = "both";
  7892. var Lt = /*#__PURE__*/function () {
  7893. function Lt() {
  7894. var _ref19 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  7895. e = _ref19.secretType,
  7896. t = _ref19.uniCloudIns;
  7897. (0, _classCallCheck2.default)(this, Lt);
  7898. this.clientType = "", this.secretType = e || Ot, this.uniCloudIns = t;
  7899. var _this$uniCloudIns$con = this.uniCloudIns.config,
  7900. n = _this$uniCloudIns$con.provider,
  7901. s = _this$uniCloudIns$con.spaceId;
  7902. var r;
  7903. this.provider = n, this.spaceId = s, this.scopedGlobalCache = (r = this.uniCloudIns, U("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}", r.config.spaceId)));
  7904. }
  7905. (0, _createClass2.default)(Lt, [{
  7906. key: "getSystemInfo",
  7907. value: function getSystemInfo() {
  7908. return this._systemInfo || (this._systemInfo = ce()), this._systemInfo;
  7909. }
  7910. }, {
  7911. key: "appId",
  7912. get: function get() {
  7913. return this.getSystemInfo().appId;
  7914. }
  7915. }, {
  7916. key: "deviceId",
  7917. get: function get() {
  7918. return this.getSystemInfo().deviceId;
  7919. }
  7920. }, {
  7921. key: "encryptData",
  7922. value: function () {
  7923. var _encryptData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee34(e) {
  7924. return _regenerator.default.wrap(function _callee34$(_context34) {
  7925. while (1) {
  7926. switch (_context34.prev = _context34.next) {
  7927. case 0:
  7928. return _context34.abrupt("return", this.secretType === Ot ? e : this.platformEncryptData(e));
  7929. case 1:
  7930. case "end":
  7931. return _context34.stop();
  7932. }
  7933. }
  7934. }, _callee34, this);
  7935. }));
  7936. function encryptData(_x31) {
  7937. return _encryptData.apply(this, arguments);
  7938. }
  7939. return encryptData;
  7940. }()
  7941. }, {
  7942. key: "decryptResult",
  7943. value: function () {
  7944. var _decryptResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee35(e) {
  7945. var _ref20, t, n;
  7946. return _regenerator.default.wrap(function _callee35$(_context35) {
  7947. while (1) {
  7948. switch (_context35.prev = _context35.next) {
  7949. case 0:
  7950. if (!(this.secretType === Ot)) {
  7951. _context35.next = 2;
  7952. break;
  7953. }
  7954. return _context35.abrupt("return", e);
  7955. case 2:
  7956. _ref20 = e || {}, t = _ref20.errCode, n = _ref20.content;
  7957. return _context35.abrupt("return", t || !n ? e : this.secretType === xt ? n : this.platformDecryptResult(e));
  7958. case 4:
  7959. case "end":
  7960. return _context35.stop();
  7961. }
  7962. }
  7963. }, _callee35, this);
  7964. }));
  7965. function decryptResult(_x32) {
  7966. return _decryptResult.apply(this, arguments);
  7967. }
  7968. return decryptResult;
  7969. }()
  7970. }, {
  7971. key: "wrapVerifyClientCallFunction",
  7972. value: function wrapVerifyClientCallFunction(e) {
  7973. var t = this;
  7974. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee36() {
  7975. var _ref22,
  7976. n,
  7977. _ref22$data,
  7978. s,
  7979. r,
  7980. _args36 = arguments;
  7981. return _regenerator.default.wrap(function _callee36$(_context36) {
  7982. while (1) {
  7983. switch (_context36.prev = _context36.next) {
  7984. case 0:
  7985. _ref22 = _args36.length > 0 && _args36[0] !== undefined ? _args36[0] : {}, n = _ref22.name, _ref22$data = _ref22.data, s = _ref22$data === void 0 ? {} : _ref22$data;
  7986. _context36.next = 3;
  7987. return t.prepare();
  7988. case 3:
  7989. _context36.next = 5;
  7990. return t.platformGetSignOption();
  7991. case 5:
  7992. (s = JSON.parse(JSON.stringify(s)))._uniCloudOptions = _context36.sent;
  7993. _context36.next = 8;
  7994. return e({
  7995. name: n,
  7996. data: s
  7997. });
  7998. case 8:
  7999. r = _context36.sent;
  8000. _context36.t0 = t.isClientKeyNotFound(r);
  8001. if (!_context36.t0) {
  8002. _context36.next = 19;
  8003. break;
  8004. }
  8005. _context36.next = 13;
  8006. return t.prepare({
  8007. forceUpdate: !0
  8008. });
  8009. case 13:
  8010. _context36.next = 15;
  8011. return t.platformGetSignOption();
  8012. case 15:
  8013. s._uniCloudOptions = _context36.sent;
  8014. _context36.next = 18;
  8015. return e({
  8016. name: n,
  8017. data: s
  8018. });
  8019. case 18:
  8020. r = _context36.sent;
  8021. case 19:
  8022. return _context36.abrupt("return", r);
  8023. case 20:
  8024. case "end":
  8025. return _context36.stop();
  8026. }
  8027. }
  8028. }, _callee36);
  8029. }));
  8030. }
  8031. }, {
  8032. key: "wrapEncryptDataCallFunction",
  8033. value: function wrapEncryptDataCallFunction(e) {
  8034. var t = this;
  8035. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee37() {
  8036. var _ref24,
  8037. n,
  8038. _ref24$data,
  8039. s,
  8040. r,
  8041. i,
  8042. _r3,
  8043. _args37 = arguments;
  8044. return _regenerator.default.wrap(function _callee37$(_context37) {
  8045. while (1) {
  8046. switch (_context37.prev = _context37.next) {
  8047. case 0:
  8048. _ref24 = _args37.length > 0 && _args37[0] !== undefined ? _args37[0] : {}, n = _ref24.name, _ref24$data = _ref24.data, s = _ref24$data === void 0 ? {} : _ref24$data;
  8049. _context37.next = 3;
  8050. return t.prepare();
  8051. case 3:
  8052. _context37.next = 5;
  8053. return t.encryptData(s);
  8054. case 5:
  8055. r = _context37.sent;
  8056. _context37.next = 8;
  8057. return e({
  8058. name: n,
  8059. data: r
  8060. });
  8061. case 8:
  8062. i = _context37.sent;
  8063. if (!t.isClientKeyNotFound(i)) {
  8064. _context37.next = 21;
  8065. break;
  8066. }
  8067. _context37.next = 12;
  8068. return t.prepare({
  8069. forceUpdate: !0
  8070. });
  8071. case 12:
  8072. _context37.next = 14;
  8073. return t.encryptData(s);
  8074. case 14:
  8075. _r3 = _context37.sent;
  8076. _context37.next = 17;
  8077. return t.platformGetSignOption();
  8078. case 17:
  8079. s._uniCloudOptions = _context37.sent;
  8080. _context37.next = 20;
  8081. return e({
  8082. name: n,
  8083. data: _r3
  8084. });
  8085. case 20:
  8086. i = _context37.sent;
  8087. case 21:
  8088. _context37.next = 23;
  8089. return t.decryptResult(i.result);
  8090. case 23:
  8091. i.result = _context37.sent;
  8092. return _context37.abrupt("return", i);
  8093. case 25:
  8094. case "end":
  8095. return _context37.stop();
  8096. }
  8097. }
  8098. }, _callee37);
  8099. }));
  8100. }
  8101. }]);
  8102. return Lt;
  8103. }();
  8104. /*! MIT License. Copyright 2015-2018 Richard Moore <me@ricmoo.com>. See LICENSE.txt. */
  8105. function Nt(e) {
  8106. return parseInt(e) === e;
  8107. }
  8108. function Dt(e) {
  8109. if (!Nt(e.length)) return !1;
  8110. for (var t = 0; t < e.length; t++) {
  8111. if (!Nt(e[t]) || e[t] < 0 || e[t] > 255) return !1;
  8112. }
  8113. return !0;
  8114. }
  8115. function Ft(e, t) {
  8116. if (e.buffer && "Uint8Array" === e.name) return t && (e = e.slice ? e.slice() : Array.prototype.slice.call(e)), e;
  8117. if (Array.isArray(e)) {
  8118. if (!Dt(e)) throw new Error("Array contains invalid value: " + e);
  8119. return new Uint8Array(e);
  8120. }
  8121. if (Nt(e.length) && Dt(e)) return new Uint8Array(e);
  8122. throw new Error("unsupported array-like object");
  8123. }
  8124. function qt(e) {
  8125. return new Uint8Array(e);
  8126. }
  8127. function Mt(e, t, n, s, r) {
  8128. null == s && null == r || (e = e.slice ? e.slice(s, r) : Array.prototype.slice.call(e, s, r)), t.set(e, n);
  8129. }
  8130. var Kt,
  8131. jt = {
  8132. toBytes: function toBytes(e) {
  8133. var t = [],
  8134. n = 0;
  8135. for (e = encodeURI(e); n < e.length;) {
  8136. var s = e.charCodeAt(n++);
  8137. 37 === s ? (t.push(parseInt(e.substr(n, 2), 16)), n += 2) : t.push(s);
  8138. }
  8139. return Ft(t);
  8140. },
  8141. fromBytes: function fromBytes(e) {
  8142. for (var t = [], n = 0; n < e.length;) {
  8143. var s = e[n];
  8144. s < 128 ? (t.push(String.fromCharCode(s)), n++) : s > 191 && s < 224 ? (t.push(String.fromCharCode((31 & s) << 6 | 63 & e[n + 1])), n += 2) : (t.push(String.fromCharCode((15 & s) << 12 | (63 & e[n + 1]) << 6 | 63 & e[n + 2])), n += 3);
  8145. }
  8146. return t.join("");
  8147. }
  8148. },
  8149. Bt = (Kt = "0123456789abcdef", {
  8150. toBytes: function toBytes(e) {
  8151. for (var t = [], n = 0; n < e.length; n += 2) {
  8152. t.push(parseInt(e.substr(n, 2), 16));
  8153. }
  8154. return t;
  8155. },
  8156. fromBytes: function fromBytes(e) {
  8157. for (var t = [], n = 0; n < e.length; n++) {
  8158. var s = e[n];
  8159. t.push(Kt[(240 & s) >> 4] + Kt[15 & s]);
  8160. }
  8161. return t.join("");
  8162. }
  8163. }),
  8164. $t = {
  8165. 16: 10,
  8166. 24: 12,
  8167. 32: 14
  8168. },
  8169. Wt = [1, 2, 4, 8, 16, 32, 64, 128, 27, 54, 108, 216, 171, 77, 154, 47, 94, 188, 99, 198, 151, 53, 106, 212, 179, 125, 250, 239, 197, 145],
  8170. zt = [99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171, 118, 202, 130, 201, 125, 250, 89, 71, 240, 173, 212, 162, 175, 156, 164, 114, 192, 183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241, 113, 216, 49, 21, 4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226, 235, 39, 178, 117, 9, 131, 44, 26, 27, 110, 90, 160, 82, 59, 214, 179, 41, 227, 47, 132, 83, 209, 0, 237, 32, 252, 177, 91, 106, 203, 190, 57, 74, 76, 88, 207, 208, 239, 170, 251, 67, 77, 51, 133, 69, 249, 2, 127, 80, 60, 159, 168, 81, 163, 64, 143, 146, 157, 56, 245, 188, 182, 218, 33, 16, 255, 243, 210, 205, 12, 19, 236, 95, 151, 68, 23, 196, 167, 126, 61, 100, 93, 25, 115, 96, 129, 79, 220, 34, 42, 144, 136, 70, 238, 184, 20, 222, 94, 11, 219, 224, 50, 58, 10, 73, 6, 36, 92, 194, 211, 172, 98, 145, 149, 228, 121, 231, 200, 55, 109, 141, 213, 78, 169, 108, 86, 244, 234, 101, 122, 174, 8, 186, 120, 37, 46, 28, 166, 180, 198, 232, 221, 116, 31, 75, 189, 139, 138, 112, 62, 181, 102, 72, 3, 246, 14, 97, 53, 87, 185, 134, 193, 29, 158, 225, 248, 152, 17, 105, 217, 142, 148, 155, 30, 135, 233, 206, 85, 40, 223, 140, 161, 137, 13, 191, 230, 66, 104, 65, 153, 45, 15, 176, 84, 187, 22],
  8171. Jt = [82, 9, 106, 213, 48, 54, 165, 56, 191, 64, 163, 158, 129, 243, 215, 251, 124, 227, 57, 130, 155, 47, 255, 135, 52, 142, 67, 68, 196, 222, 233, 203, 84, 123, 148, 50, 166, 194, 35, 61, 238, 76, 149, 11, 66, 250, 195, 78, 8, 46, 161, 102, 40, 217, 36, 178, 118, 91, 162, 73, 109, 139, 209, 37, 114, 248, 246, 100, 134, 104, 152, 22, 212, 164, 92, 204, 93, 101, 182, 146, 108, 112, 72, 80, 253, 237, 185, 218, 94, 21, 70, 87, 167, 141, 157, 132, 144, 216, 171, 0, 140, 188, 211, 10, 247, 228, 88, 5, 184, 179, 69, 6, 208, 44, 30, 143, 202, 63, 15, 2, 193, 175, 189, 3, 1, 19, 138, 107, 58, 145, 17, 65, 79, 103, 220, 234, 151, 242, 207, 206, 240, 180, 230, 115, 150, 172, 116, 34, 231, 173, 53, 133, 226, 249, 55, 232, 28, 117, 223, 110, 71, 241, 26, 113, 29, 41, 197, 137, 111, 183, 98, 14, 170, 24, 190, 27, 252, 86, 62, 75, 198, 210, 121, 32, 154, 219, 192, 254, 120, 205, 90, 244, 31, 221, 168, 51, 136, 7, 199, 49, 177, 18, 16, 89, 39, 128, 236, 95, 96, 81, 127, 169, 25, 181, 74, 13, 45, 229, 122, 159, 147, 201, 156, 239, 160, 224, 59, 77, 174, 42, 245, 176, 200, 235, 187, 60, 131, 83, 153, 97, 23, 43, 4, 126, 186, 119, 214, 38, 225, 105, 20, 99, 85, 33, 12, 125],
  8172. Ht = [3328402341, 4168907908, 4000806809, 4135287693, 4294111757, 3597364157, 3731845041, 2445657428, 1613770832, 33620227, 3462883241, 1445669757, 3892248089, 3050821474, 1303096294, 3967186586, 2412431941, 528646813, 2311702848, 4202528135, 4026202645, 2992200171, 2387036105, 4226871307, 1101901292, 3017069671, 1604494077, 1169141738, 597466303, 1403299063, 3832705686, 2613100635, 1974974402, 3791519004, 1033081774, 1277568618, 1815492186, 2118074177, 4126668546, 2211236943, 1748251740, 1369810420, 3521504564, 4193382664, 3799085459, 2883115123, 1647391059, 706024767, 134480908, 2512897874, 1176707941, 2646852446, 806885416, 932615841, 168101135, 798661301, 235341577, 605164086, 461406363, 3756188221, 3454790438, 1311188841, 2142417613, 3933566367, 302582043, 495158174, 1479289972, 874125870, 907746093, 3698224818, 3025820398, 1537253627, 2756858614, 1983593293, 3084310113, 2108928974, 1378429307, 3722699582, 1580150641, 327451799, 2790478837, 3117535592, 0, 3253595436, 1075847264, 3825007647, 2041688520, 3059440621, 3563743934, 2378943302, 1740553945, 1916352843, 2487896798, 2555137236, 2958579944, 2244988746, 3151024235, 3320835882, 1336584933, 3992714006, 2252555205, 2588757463, 1714631509, 293963156, 2319795663, 3925473552, 67240454, 4269768577, 2689618160, 2017213508, 631218106, 1269344483, 2723238387, 1571005438, 2151694528, 93294474, 1066570413, 563977660, 1882732616, 4059428100, 1673313503, 2008463041, 2950355573, 1109467491, 537923632, 3858759450, 4260623118, 3218264685, 2177748300, 403442708, 638784309, 3287084079, 3193921505, 899127202, 2286175436, 773265209, 2479146071, 1437050866, 4236148354, 2050833735, 3362022572, 3126681063, 840505643, 3866325909, 3227541664, 427917720, 2655997905, 2749160575, 1143087718, 1412049534, 999329963, 193497219, 2353415882, 3354324521, 1807268051, 672404540, 2816401017, 3160301282, 369822493, 2916866934, 3688947771, 1681011286, 1949973070, 336202270, 2454276571, 201721354, 1210328172, 3093060836, 2680341085, 3184776046, 1135389935, 3294782118, 965841320, 831886756, 3554993207, 4068047243, 3588745010, 2345191491, 1849112409, 3664604599, 26054028, 2983581028, 2622377682, 1235855840, 3630984372, 2891339514, 4092916743, 3488279077, 3395642799, 4101667470, 1202630377, 268961816, 1874508501, 4034427016, 1243948399, 1546530418, 941366308, 1470539505, 1941222599, 2546386513, 3421038627, 2715671932, 3899946140, 1042226977, 2521517021, 1639824860, 227249030, 260737669, 3765465232, 2084453954, 1907733956, 3429263018, 2420656344, 100860677, 4160157185, 470683154, 3261161891, 1781871967, 2924959737, 1773779408, 394692241, 2579611992, 974986535, 664706745, 3655459128, 3958962195, 731420851, 571543859, 3530123707, 2849626480, 126783113, 865375399, 765172662, 1008606754, 361203602, 3387549984, 2278477385, 2857719295, 1344809080, 2782912378, 59542671, 1503764984, 160008576, 437062935, 1707065306, 3622233649, 2218934982, 3496503480, 2185314755, 697932208, 1512910199, 504303377, 2075177163, 2824099068, 1841019862, 739644986],
  8173. Gt = [2781242211, 2230877308, 2582542199, 2381740923, 234877682, 3184946027, 2984144751, 1418839493, 1348481072, 50462977, 2848876391, 2102799147, 434634494, 1656084439, 3863849899, 2599188086, 1167051466, 2636087938, 1082771913, 2281340285, 368048890, 3954334041, 3381544775, 201060592, 3963727277, 1739838676, 4250903202, 3930435503, 3206782108, 4149453988, 2531553906, 1536934080, 3262494647, 484572669, 2923271059, 1783375398, 1517041206, 1098792767, 49674231, 1334037708, 1550332980, 4098991525, 886171109, 150598129, 2481090929, 1940642008, 1398944049, 1059722517, 201851908, 1385547719, 1699095331, 1587397571, 674240536, 2704774806, 252314885, 3039795866, 151914247, 908333586, 2602270848, 1038082786, 651029483, 1766729511, 3447698098, 2682942837, 454166793, 2652734339, 1951935532, 775166490, 758520603, 3000790638, 4004797018, 4217086112, 4137964114, 1299594043, 1639438038, 3464344499, 2068982057, 1054729187, 1901997871, 2534638724, 4121318227, 1757008337, 0, 750906861, 1614815264, 535035132, 3363418545, 3988151131, 3201591914, 1183697867, 3647454910, 1265776953, 3734260298, 3566750796, 3903871064, 1250283471, 1807470800, 717615087, 3847203498, 384695291, 3313910595, 3617213773, 1432761139, 2484176261, 3481945413, 283769337, 100925954, 2180939647, 4037038160, 1148730428, 3123027871, 3813386408, 4087501137, 4267549603, 3229630528, 2315620239, 2906624658, 3156319645, 1215313976, 82966005, 3747855548, 3245848246, 1974459098, 1665278241, 807407632, 451280895, 251524083, 1841287890, 1283575245, 337120268, 891687699, 801369324, 3787349855, 2721421207, 3431482436, 959321879, 1469301956, 4065699751, 2197585534, 1199193405, 2898814052, 3887750493, 724703513, 2514908019, 2696962144, 2551808385, 3516813135, 2141445340, 1715741218, 2119445034, 2872807568, 2198571144, 3398190662, 700968686, 3547052216, 1009259540, 2041044702, 3803995742, 487983883, 1991105499, 1004265696, 1449407026, 1316239930, 504629770, 3683797321, 168560134, 1816667172, 3837287516, 1570751170, 1857934291, 4014189740, 2797888098, 2822345105, 2754712981, 936633572, 2347923833, 852879335, 1133234376, 1500395319, 3084545389, 2348912013, 1689376213, 3533459022, 3762923945, 3034082412, 4205598294, 133428468, 634383082, 2949277029, 2398386810, 3913789102, 403703816, 3580869306, 2297460856, 1867130149, 1918643758, 607656988, 4049053350, 3346248884, 1368901318, 600565992, 2090982877, 2632479860, 557719327, 3717614411, 3697393085, 2249034635, 2232388234, 2430627952, 1115438654, 3295786421, 2865522278, 3633334344, 84280067, 33027830, 303828494, 2747425121, 1600795957, 4188952407, 3496589753, 2434238086, 1486471617, 658119965, 3106381470, 953803233, 334231800, 3005978776, 857870609, 3151128937, 1890179545, 2298973838, 2805175444, 3056442267, 574365214, 2450884487, 550103529, 1233637070, 4289353045, 2018519080, 2057691103, 2399374476, 4166623649, 2148108681, 387583245, 3664101311, 836232934, 3330556482, 3100665960, 3280093505, 2955516313, 2002398509, 287182607, 3413881008, 4238890068, 3597515707, 975967766],
  8174. Vt = [1671808611, 2089089148, 2006576759, 2072901243, 4061003762, 1807603307, 1873927791, 3310653893, 810573872, 16974337, 1739181671, 729634347, 4263110654, 3613570519, 2883997099, 1989864566, 3393556426, 2191335298, 3376449993, 2106063485, 4195741690, 1508618841, 1204391495, 4027317232, 2917941677, 3563566036, 2734514082, 2951366063, 2629772188, 2767672228, 1922491506, 3227229120, 3082974647, 4246528509, 2477669779, 644500518, 911895606, 1061256767, 4144166391, 3427763148, 878471220, 2784252325, 3845444069, 4043897329, 1905517169, 3631459288, 827548209, 356461077, 67897348, 3344078279, 593839651, 3277757891, 405286936, 2527147926, 84871685, 2595565466, 118033927, 305538066, 2157648768, 3795705826, 3945188843, 661212711, 2999812018, 1973414517, 152769033, 2208177539, 745822252, 439235610, 455947803, 1857215598, 1525593178, 2700827552, 1391895634, 994932283, 3596728278, 3016654259, 695947817, 3812548067, 795958831, 2224493444, 1408607827, 3513301457, 0, 3979133421, 543178784, 4229948412, 2982705585, 1542305371, 1790891114, 3410398667, 3201918910, 961245753, 1256100938, 1289001036, 1491644504, 3477767631, 3496721360, 4012557807, 2867154858, 4212583931, 1137018435, 1305975373, 861234739, 2241073541, 1171229253, 4178635257, 33948674, 2139225727, 1357946960, 1011120188, 2679776671, 2833468328, 1374921297, 2751356323, 1086357568, 2408187279, 2460827538, 2646352285, 944271416, 4110742005, 3168756668, 3066132406, 3665145818, 560153121, 271589392, 4279952895, 4077846003, 3530407890, 3444343245, 202643468, 322250259, 3962553324, 1608629855, 2543990167, 1154254916, 389623319, 3294073796, 2817676711, 2122513534, 1028094525, 1689045092, 1575467613, 422261273, 1939203699, 1621147744, 2174228865, 1339137615, 3699352540, 577127458, 712922154, 2427141008, 2290289544, 1187679302, 3995715566, 3100863416, 339486740, 3732514782, 1591917662, 186455563, 3681988059, 3762019296, 844522546, 978220090, 169743370, 1239126601, 101321734, 611076132, 1558493276, 3260915650, 3547250131, 2901361580, 1655096418, 2443721105, 2510565781, 3828863972, 2039214713, 3878868455, 3359869896, 928607799, 1840765549, 2374762893, 3580146133, 1322425422, 2850048425, 1823791212, 1459268694, 4094161908, 3928346602, 1706019429, 2056189050, 2934523822, 135794696, 3134549946, 2022240376, 628050469, 779246638, 472135708, 2800834470, 3032970164, 3327236038, 3894660072, 3715932637, 1956440180, 522272287, 1272813131, 3185336765, 2340818315, 2323976074, 1888542832, 1044544574, 3049550261, 1722469478, 1222152264, 50660867, 4127324150, 236067854, 1638122081, 895445557, 1475980887, 3117443513, 2257655686, 3243809217, 489110045, 2662934430, 3778599393, 4162055160, 2561878936, 288563729, 1773916777, 3648039385, 2391345038, 2493985684, 2612407707, 505560094, 2274497927, 3911240169, 3460925390, 1442818645, 678973480, 3749357023, 2358182796, 2717407649, 2306869641, 219617805, 3218761151, 3862026214, 1120306242, 1756942440, 1103331905, 2578459033, 762796589, 252780047, 2966125488, 1425844308, 3151392187, 372911126],
  8175. Yt = [1667474886, 2088535288, 2004326894, 2071694838, 4075949567, 1802223062, 1869591006, 3318043793, 808472672, 16843522, 1734846926, 724270422, 4278065639, 3621216949, 2880169549, 1987484396, 3402253711, 2189597983, 3385409673, 2105378810, 4210693615, 1499065266, 1195886990, 4042263547, 2913856577, 3570689971, 2728590687, 2947541573, 2627518243, 2762274643, 1920112356, 3233831835, 3082273397, 4261223649, 2475929149, 640051788, 909531756, 1061110142, 4160160501, 3435941763, 875846760, 2779116625, 3857003729, 4059105529, 1903268834, 3638064043, 825316194, 353713962, 67374088, 3351728789, 589522246, 3284360861, 404236336, 2526454071, 84217610, 2593830191, 117901582, 303183396, 2155911963, 3806477791, 3958056653, 656894286, 2998062463, 1970642922, 151591698, 2206440989, 741110872, 437923380, 454765878, 1852748508, 1515908788, 2694904667, 1381168804, 993742198, 3604373943, 3014905469, 690584402, 3823320797, 791638366, 2223281939, 1398011302, 3520161977, 0, 3991743681, 538992704, 4244381667, 2981218425, 1532751286, 1785380564, 3419096717, 3200178535, 960056178, 1246420628, 1280103576, 1482221744, 3486468741, 3503319995, 4025428677, 2863326543, 4227536621, 1128514950, 1296947098, 859002214, 2240123921, 1162203018, 4193849577, 33687044, 2139062782, 1347481760, 1010582648, 2678045221, 2829640523, 1364325282, 2745433693, 1077985408, 2408548869, 2459086143, 2644360225, 943212656, 4126475505, 3166494563, 3065430391, 3671750063, 555836226, 269496352, 4294908645, 4092792573, 3537006015, 3452783745, 202118168, 320025894, 3974901699, 1600119230, 2543297077, 1145359496, 387397934, 3301201811, 2812801621, 2122220284, 1027426170, 1684319432, 1566435258, 421079858, 1936954854, 1616945344, 2172753945, 1330631070, 3705438115, 572679748, 707427924, 2425400123, 2290647819, 1179044492, 4008585671, 3099120491, 336870440, 3739122087, 1583276732, 185277718, 3688593069, 3772791771, 842159716, 976899700, 168435220, 1229577106, 101059084, 606366792, 1549591736, 3267517855, 3553849021, 2897014595, 1650632388, 2442242105, 2509612081, 3840161747, 2038008818, 3890688725, 3368567691, 926374254, 1835907034, 2374863873, 3587531953, 1313788572, 2846482505, 1819063512, 1448540844, 4109633523, 3941213647, 1701162954, 2054852340, 2930698567, 134748176, 3132806511, 2021165296, 623210314, 774795868, 471606328, 2795958615, 3031746419, 3334885783, 3907527627, 3722280097, 1953799400, 522133822, 1263263126, 3183336545, 2341176845, 2324333839, 1886425312, 1044267644, 3048588401, 1718004428, 1212733584, 50529542, 4143317495, 235803164, 1633788866, 892690282, 1465383342, 3115962473, 2256965911, 3250673817, 488449850, 2661202215, 3789633753, 4177007595, 2560144171, 286339874, 1768537042, 3654906025, 2391705863, 2492770099, 2610673197, 505291324, 2273808917, 3924369609, 3469625735, 1431699370, 673740880, 3755965093, 2358021891, 2711746649, 2307489801, 218961690, 3217021541, 3873845719, 1111672452, 1751693520, 1094828930, 2576986153, 757954394, 252645662, 2964376443, 1414855848, 3149649517, 370555436],
  8176. Qt = [1374988112, 2118214995, 437757123, 975658646, 1001089995, 530400753, 2902087851, 1273168787, 540080725, 2910219766, 2295101073, 4110568485, 1340463100, 3307916247, 641025152, 3043140495, 3736164937, 632953703, 1172967064, 1576976609, 3274667266, 2169303058, 2370213795, 1809054150, 59727847, 361929877, 3211623147, 2505202138, 3569255213, 1484005843, 1239443753, 2395588676, 1975683434, 4102977912, 2572697195, 666464733, 3202437046, 4035489047, 3374361702, 2110667444, 1675577880, 3843699074, 2538681184, 1649639237, 2976151520, 3144396420, 4269907996, 4178062228, 1883793496, 2403728665, 2497604743, 1383856311, 2876494627, 1917518562, 3810496343, 1716890410, 3001755655, 800440835, 2261089178, 3543599269, 807962610, 599762354, 33778362, 3977675356, 2328828971, 2809771154, 4077384432, 1315562145, 1708848333, 101039829, 3509871135, 3299278474, 875451293, 2733856160, 92987698, 2767645557, 193195065, 1080094634, 1584504582, 3178106961, 1042385657, 2531067453, 3711829422, 1306967366, 2438237621, 1908694277, 67556463, 1615861247, 429456164, 3602770327, 2302690252, 1742315127, 2968011453, 126454664, 3877198648, 2043211483, 2709260871, 2084704233, 4169408201, 0, 159417987, 841739592, 504459436, 1817866830, 4245618683, 260388950, 1034867998, 908933415, 168810852, 1750902305, 2606453969, 607530554, 202008497, 2472011535, 3035535058, 463180190, 2160117071, 1641816226, 1517767529, 470948374, 3801332234, 3231722213, 1008918595, 303765277, 235474187, 4069246893, 766945465, 337553864, 1475418501, 2943682380, 4003061179, 2743034109, 4144047775, 1551037884, 1147550661, 1543208500, 2336434550, 3408119516, 3069049960, 3102011747, 3610369226, 1113818384, 328671808, 2227573024, 2236228733, 3535486456, 2935566865, 3341394285, 496906059, 3702665459, 226906860, 2009195472, 733156972, 2842737049, 294930682, 1206477858, 2835123396, 2700099354, 1451044056, 573804783, 2269728455, 3644379585, 2362090238, 2564033334, 2801107407, 2776292904, 3669462566, 1068351396, 742039012, 1350078989, 1784663195, 1417561698, 4136440770, 2430122216, 775550814, 2193862645, 2673705150, 1775276924, 1876241833, 3475313331, 3366754619, 270040487, 3902563182, 3678124923, 3441850377, 1851332852, 3969562369, 2203032232, 3868552805, 2868897406, 566021896, 4011190502, 3135740889, 1248802510, 3936291284, 699432150, 832877231, 708780849, 3332740144, 899835584, 1951317047, 4236429990, 3767586992, 866637845, 4043610186, 1106041591, 2144161806, 395441711, 1984812685, 1139781709, 3433712980, 3835036895, 2664543715, 1282050075, 3240894392, 1181045119, 2640243204, 25965917, 4203181171, 4211818798, 3009879386, 2463879762, 3910161971, 1842759443, 2597806476, 933301370, 1509430414, 3943906441, 3467192302, 3076639029, 3776767469, 2051518780, 2631065433, 1441952575, 404016761, 1942435775, 1408749034, 1610459739, 3745345300, 2017778566, 3400528769, 3110650942, 941896748, 3265478751, 371049330, 3168937228, 675039627, 4279080257, 967311729, 135050206, 3635733660, 1683407248, 2076935265, 3576870512, 1215061108, 3501741890],
  8177. Xt = [1347548327, 1400783205, 3273267108, 2520393566, 3409685355, 4045380933, 2880240216, 2471224067, 1428173050, 4138563181, 2441661558, 636813900, 4233094615, 3620022987, 2149987652, 2411029155, 1239331162, 1730525723, 2554718734, 3781033664, 46346101, 310463728, 2743944855, 3328955385, 3875770207, 2501218972, 3955191162, 3667219033, 768917123, 3545789473, 692707433, 1150208456, 1786102409, 2029293177, 1805211710, 3710368113, 3065962831, 401639597, 1724457132, 3028143674, 409198410, 2196052529, 1620529459, 1164071807, 3769721975, 2226875310, 486441376, 2499348523, 1483753576, 428819965, 2274680428, 3075636216, 598438867, 3799141122, 1474502543, 711349675, 129166120, 53458370, 2592523643, 2782082824, 4063242375, 2988687269, 3120694122, 1559041666, 730517276, 2460449204, 4042459122, 2706270690, 3446004468, 3573941694, 533804130, 2328143614, 2637442643, 2695033685, 839224033, 1973745387, 957055980, 2856345839, 106852767, 1371368976, 4181598602, 1033297158, 2933734917, 1179510461, 3046200461, 91341917, 1862534868, 4284502037, 605657339, 2547432937, 3431546947, 2003294622, 3182487618, 2282195339, 954669403, 3682191598, 1201765386, 3917234703, 3388507166, 0, 2198438022, 1211247597, 2887651696, 1315723890, 4227665663, 1443857720, 507358933, 657861945, 1678381017, 560487590, 3516619604, 975451694, 2970356327, 261314535, 3535072918, 2652609425, 1333838021, 2724322336, 1767536459, 370938394, 182621114, 3854606378, 1128014560, 487725847, 185469197, 2918353863, 3106780840, 3356761769, 2237133081, 1286567175, 3152976349, 4255350624, 2683765030, 3160175349, 3309594171, 878443390, 1988838185, 3704300486, 1756818940, 1673061617, 3403100636, 272786309, 1075025698, 545572369, 2105887268, 4174560061, 296679730, 1841768865, 1260232239, 4091327024, 3960309330, 3497509347, 1814803222, 2578018489, 4195456072, 575138148, 3299409036, 446754879, 3629546796, 4011996048, 3347532110, 3252238545, 4270639778, 915985419, 3483825537, 681933534, 651868046, 2755636671, 3828103837, 223377554, 2607439820, 1649704518, 3270937875, 3901806776, 1580087799, 4118987695, 3198115200, 2087309459, 2842678573, 3016697106, 1003007129, 2802849917, 1860738147, 2077965243, 164439672, 4100872472, 32283319, 2827177882, 1709610350, 2125135846, 136428751, 3874428392, 3652904859, 3460984630, 3572145929, 3593056380, 2939266226, 824852259, 818324884, 3224740454, 930369212, 2801566410, 2967507152, 355706840, 1257309336, 4148292826, 243256656, 790073846, 2373340630, 1296297904, 1422699085, 3756299780, 3818836405, 457992840, 3099667487, 2135319889, 77422314, 1560382517, 1945798516, 788204353, 1521706781, 1385356242, 870912086, 325965383, 2358957921, 2050466060, 2388260884, 2313884476, 4006521127, 901210569, 3990953189, 1014646705, 1503449823, 1062597235, 2031621326, 3212035895, 3931371469, 1533017514, 350174575, 2256028891, 2177544179, 1052338372, 741876788, 1606591296, 1914052035, 213705253, 2334669897, 1107234197, 1899603969, 3725069491, 2631447780, 2422494913, 1635502980, 1893020342, 1950903388, 1120974935],
  8178. Zt = [2807058932, 1699970625, 2764249623, 1586903591, 1808481195, 1173430173, 1487645946, 59984867, 4199882800, 1844882806, 1989249228, 1277555970, 3623636965, 3419915562, 1149249077, 2744104290, 1514790577, 459744698, 244860394, 3235995134, 1963115311, 4027744588, 2544078150, 4190530515, 1608975247, 2627016082, 2062270317, 1507497298, 2200818878, 567498868, 1764313568, 3359936201, 2305455554, 2037970062, 1047239e3, 1910319033, 1337376481, 2904027272, 2892417312, 984907214, 1243112415, 830661914, 861968209, 2135253587, 2011214180, 2927934315, 2686254721, 731183368, 1750626376, 4246310725, 1820824798, 4172763771, 3542330227, 48394827, 2404901663, 2871682645, 671593195, 3254988725, 2073724613, 145085239, 2280796200, 2779915199, 1790575107, 2187128086, 472615631, 3029510009, 4075877127, 3802222185, 4107101658, 3201631749, 1646252340, 4270507174, 1402811438, 1436590835, 3778151818, 3950355702, 3963161475, 4020912224, 2667994737, 273792366, 2331590177, 104699613, 95345982, 3175501286, 2377486676, 1560637892, 3564045318, 369057872, 4213447064, 3919042237, 1137477952, 2658625497, 1119727848, 2340947849, 1530455833, 4007360968, 172466556, 266959938, 516552836, 0, 2256734592, 3980931627, 1890328081, 1917742170, 4294704398, 945164165, 3575528878, 958871085, 3647212047, 2787207260, 1423022939, 775562294, 1739656202, 3876557655, 2530391278, 2443058075, 3310321856, 547512796, 1265195639, 437656594, 3121275539, 719700128, 3762502690, 387781147, 218828297, 3350065803, 2830708150, 2848461854, 428169201, 122466165, 3720081049, 1627235199, 648017665, 4122762354, 1002783846, 2117360635, 695634755, 3336358691, 4234721005, 4049844452, 3704280881, 2232435299, 574624663, 287343814, 612205898, 1039717051, 840019705, 2708326185, 793451934, 821288114, 1391201670, 3822090177, 376187827, 3113855344, 1224348052, 1679968233, 2361698556, 1058709744, 752375421, 2431590963, 1321699145, 3519142200, 2734591178, 188127444, 2177869557, 3727205754, 2384911031, 3215212461, 2648976442, 2450346104, 3432737375, 1180849278, 331544205, 3102249176, 4150144569, 2952102595, 2159976285, 2474404304, 766078933, 313773861, 2570832044, 2108100632, 1668212892, 3145456443, 2013908262, 418672217, 3070356634, 2594734927, 1852171925, 3867060991, 3473416636, 3907448597, 2614737639, 919489135, 164948639, 2094410160, 2997825956, 590424639, 2486224549, 1723872674, 3157750862, 3399941250, 3501252752, 3625268135, 2555048196, 3673637356, 1343127501, 4130281361, 3599595085, 2957853679, 1297403050, 81781910, 3051593425, 2283490410, 532201772, 1367295589, 3926170974, 895287692, 1953757831, 1093597963, 492483431, 3528626907, 1446242576, 1192455638, 1636604631, 209336225, 344873464, 1015671571, 669961897, 3375740769, 3857572124, 2973530695, 3747192018, 1933530610, 3464042516, 935293895, 3454686199, 2858115069, 1863638845, 3683022916, 4085369519, 3292445032, 875313188, 1080017571, 3279033885, 621591778, 1233856572, 2504130317, 24197544, 3017672716, 3835484340, 3247465558, 2220981195, 3060847922, 1551124588, 1463996600],
  8179. en = [4104605777, 1097159550, 396673818, 660510266, 2875968315, 2638606623, 4200115116, 3808662347, 821712160, 1986918061, 3430322568, 38544885, 3856137295, 718002117, 893681702, 1654886325, 2975484382, 3122358053, 3926825029, 4274053469, 796197571, 1290801793, 1184342925, 3556361835, 2405426947, 2459735317, 1836772287, 1381620373, 3196267988, 1948373848, 3764988233, 3385345166, 3263785589, 2390325492, 1480485785, 3111247143, 3780097726, 2293045232, 548169417, 3459953789, 3746175075, 439452389, 1362321559, 1400849762, 1685577905, 1806599355, 2174754046, 137073913, 1214797936, 1174215055, 3731654548, 2079897426, 1943217067, 1258480242, 529487843, 1437280870, 3945269170, 3049390895, 3313212038, 923313619, 679998e3, 3215307299, 57326082, 377642221, 3474729866, 2041877159, 133361907, 1776460110, 3673476453, 96392454, 878845905, 2801699524, 777231668, 4082475170, 2330014213, 4142626212, 2213296395, 1626319424, 1906247262, 1846563261, 562755902, 3708173718, 1040559837, 3871163981, 1418573201, 3294430577, 114585348, 1343618912, 2566595609, 3186202582, 1078185097, 3651041127, 3896688048, 2307622919, 425408743, 3371096953, 2081048481, 1108339068, 2216610296, 0, 2156299017, 736970802, 292596766, 1517440620, 251657213, 2235061775, 2933202493, 758720310, 265905162, 1554391400, 1532285339, 908999204, 174567692, 1474760595, 4002861748, 2610011675, 3234156416, 3693126241, 2001430874, 303699484, 2478443234, 2687165888, 585122620, 454499602, 151849742, 2345119218, 3064510765, 514443284, 4044981591, 1963412655, 2581445614, 2137062819, 19308535, 1928707164, 1715193156, 4219352155, 1126790795, 600235211, 3992742070, 3841024952, 836553431, 1669664834, 2535604243, 3323011204, 1243905413, 3141400786, 4180808110, 698445255, 2653899549, 2989552604, 2253581325, 3252932727, 3004591147, 1891211689, 2487810577, 3915653703, 4237083816, 4030667424, 2100090966, 865136418, 1229899655, 953270745, 3399679628, 3557504664, 4118925222, 2061379749, 3079546586, 2915017791, 983426092, 2022837584, 1607244650, 2118541908, 2366882550, 3635996816, 972512814, 3283088770, 1568718495, 3499326569, 3576539503, 621982671, 2895723464, 410887952, 2623762152, 1002142683, 645401037, 1494807662, 2595684844, 1335535747, 2507040230, 4293295786, 3167684641, 367585007, 3885750714, 1865862730, 2668221674, 2960971305, 2763173681, 1059270954, 2777952454, 2724642869, 1320957812, 2194319100, 2429595872, 2815956275, 77089521, 3973773121, 3444575871, 2448830231, 1305906550, 4021308739, 2857194700, 2516901860, 3518358430, 1787304780, 740276417, 1699839814, 1592394909, 2352307457, 2272556026, 188821243, 1729977011, 3687994002, 274084841, 3594982253, 3613494426, 2701949495, 4162096729, 322734571, 2837966542, 1640576439, 484830689, 1202797690, 3537852828, 4067639125, 349075736, 3342319475, 4157467219, 4255800159, 1030690015, 1155237496, 2951971274, 1757691577, 607398968, 2738905026, 499347990, 3794078908, 1011452712, 227885567, 2818666809, 213114376, 3034881240, 1455525988, 3414450555, 850817237, 1817998408, 3092726480],
  8180. tn = [0, 235474187, 470948374, 303765277, 941896748, 908933415, 607530554, 708780849, 1883793496, 2118214995, 1817866830, 1649639237, 1215061108, 1181045119, 1417561698, 1517767529, 3767586992, 4003061179, 4236429990, 4069246893, 3635733660, 3602770327, 3299278474, 3400528769, 2430122216, 2664543715, 2362090238, 2193862645, 2835123396, 2801107407, 3035535058, 3135740889, 3678124923, 3576870512, 3341394285, 3374361702, 3810496343, 3977675356, 4279080257, 4043610186, 2876494627, 2776292904, 3076639029, 3110650942, 2472011535, 2640243204, 2403728665, 2169303058, 1001089995, 899835584, 666464733, 699432150, 59727847, 226906860, 530400753, 294930682, 1273168787, 1172967064, 1475418501, 1509430414, 1942435775, 2110667444, 1876241833, 1641816226, 2910219766, 2743034109, 2976151520, 3211623147, 2505202138, 2606453969, 2302690252, 2269728455, 3711829422, 3543599269, 3240894392, 3475313331, 3843699074, 3943906441, 4178062228, 4144047775, 1306967366, 1139781709, 1374988112, 1610459739, 1975683434, 2076935265, 1775276924, 1742315127, 1034867998, 866637845, 566021896, 800440835, 92987698, 193195065, 429456164, 395441711, 1984812685, 2017778566, 1784663195, 1683407248, 1315562145, 1080094634, 1383856311, 1551037884, 101039829, 135050206, 437757123, 337553864, 1042385657, 807962610, 573804783, 742039012, 2531067453, 2564033334, 2328828971, 2227573024, 2935566865, 2700099354, 3001755655, 3168937228, 3868552805, 3902563182, 4203181171, 4102977912, 3736164937, 3501741890, 3265478751, 3433712980, 1106041591, 1340463100, 1576976609, 1408749034, 2043211483, 2009195472, 1708848333, 1809054150, 832877231, 1068351396, 766945465, 599762354, 159417987, 126454664, 361929877, 463180190, 2709260871, 2943682380, 3178106961, 3009879386, 2572697195, 2538681184, 2236228733, 2336434550, 3509871135, 3745345300, 3441850377, 3274667266, 3910161971, 3877198648, 4110568485, 4211818798, 2597806476, 2497604743, 2261089178, 2295101073, 2733856160, 2902087851, 3202437046, 2968011453, 3936291284, 3835036895, 4136440770, 4169408201, 3535486456, 3702665459, 3467192302, 3231722213, 2051518780, 1951317047, 1716890410, 1750902305, 1113818384, 1282050075, 1584504582, 1350078989, 168810852, 67556463, 371049330, 404016761, 841739592, 1008918595, 775550814, 540080725, 3969562369, 3801332234, 4035489047, 4269907996, 3569255213, 3669462566, 3366754619, 3332740144, 2631065433, 2463879762, 2160117071, 2395588676, 2767645557, 2868897406, 3102011747, 3069049960, 202008497, 33778362, 270040487, 504459436, 875451293, 975658646, 675039627, 641025152, 2084704233, 1917518562, 1615861247, 1851332852, 1147550661, 1248802510, 1484005843, 1451044056, 933301370, 967311729, 733156972, 632953703, 260388950, 25965917, 328671808, 496906059, 1206477858, 1239443753, 1543208500, 1441952575, 2144161806, 1908694277, 1675577880, 1842759443, 3610369226, 3644379585, 3408119516, 3307916247, 4011190502, 3776767469, 4077384432, 4245618683, 2809771154, 2842737049, 3144396420, 3043140495, 2673705150, 2438237621, 2203032232, 2370213795],
  8181. nn = [0, 185469197, 370938394, 487725847, 741876788, 657861945, 975451694, 824852259, 1483753576, 1400783205, 1315723890, 1164071807, 1950903388, 2135319889, 1649704518, 1767536459, 2967507152, 3152976349, 2801566410, 2918353863, 2631447780, 2547432937, 2328143614, 2177544179, 3901806776, 3818836405, 4270639778, 4118987695, 3299409036, 3483825537, 3535072918, 3652904859, 2077965243, 1893020342, 1841768865, 1724457132, 1474502543, 1559041666, 1107234197, 1257309336, 598438867, 681933534, 901210569, 1052338372, 261314535, 77422314, 428819965, 310463728, 3409685355, 3224740454, 3710368113, 3593056380, 3875770207, 3960309330, 4045380933, 4195456072, 2471224067, 2554718734, 2237133081, 2388260884, 3212035895, 3028143674, 2842678573, 2724322336, 4138563181, 4255350624, 3769721975, 3955191162, 3667219033, 3516619604, 3431546947, 3347532110, 2933734917, 2782082824, 3099667487, 3016697106, 2196052529, 2313884476, 2499348523, 2683765030, 1179510461, 1296297904, 1347548327, 1533017514, 1786102409, 1635502980, 2087309459, 2003294622, 507358933, 355706840, 136428751, 53458370, 839224033, 957055980, 605657339, 790073846, 2373340630, 2256028891, 2607439820, 2422494913, 2706270690, 2856345839, 3075636216, 3160175349, 3573941694, 3725069491, 3273267108, 3356761769, 4181598602, 4063242375, 4011996048, 3828103837, 1033297158, 915985419, 730517276, 545572369, 296679730, 446754879, 129166120, 213705253, 1709610350, 1860738147, 1945798516, 2029293177, 1239331162, 1120974935, 1606591296, 1422699085, 4148292826, 4233094615, 3781033664, 3931371469, 3682191598, 3497509347, 3446004468, 3328955385, 2939266226, 2755636671, 3106780840, 2988687269, 2198438022, 2282195339, 2501218972, 2652609425, 1201765386, 1286567175, 1371368976, 1521706781, 1805211710, 1620529459, 2105887268, 1988838185, 533804130, 350174575, 164439672, 46346101, 870912086, 954669403, 636813900, 788204353, 2358957921, 2274680428, 2592523643, 2441661558, 2695033685, 2880240216, 3065962831, 3182487618, 3572145929, 3756299780, 3270937875, 3388507166, 4174560061, 4091327024, 4006521127, 3854606378, 1014646705, 930369212, 711349675, 560487590, 272786309, 457992840, 106852767, 223377554, 1678381017, 1862534868, 1914052035, 2031621326, 1211247597, 1128014560, 1580087799, 1428173050, 32283319, 182621114, 401639597, 486441376, 768917123, 651868046, 1003007129, 818324884, 1503449823, 1385356242, 1333838021, 1150208456, 1973745387, 2125135846, 1673061617, 1756818940, 2970356327, 3120694122, 2802849917, 2887651696, 2637442643, 2520393566, 2334669897, 2149987652, 3917234703, 3799141122, 4284502037, 4100872472, 3309594171, 3460984630, 3545789473, 3629546796, 2050466060, 1899603969, 1814803222, 1730525723, 1443857720, 1560382517, 1075025698, 1260232239, 575138148, 692707433, 878443390, 1062597235, 243256656, 91341917, 409198410, 325965383, 3403100636, 3252238545, 3704300486, 3620022987, 3874428392, 3990953189, 4042459122, 4227665663, 2460449204, 2578018489, 2226875310, 2411029155, 3198115200, 3046200461, 2827177882, 2743944855],
  8182. sn = [0, 218828297, 437656594, 387781147, 875313188, 958871085, 775562294, 590424639, 1750626376, 1699970625, 1917742170, 2135253587, 1551124588, 1367295589, 1180849278, 1265195639, 3501252752, 3720081049, 3399941250, 3350065803, 3835484340, 3919042237, 4270507174, 4085369519, 3102249176, 3051593425, 2734591178, 2952102595, 2361698556, 2177869557, 2530391278, 2614737639, 3145456443, 3060847922, 2708326185, 2892417312, 2404901663, 2187128086, 2504130317, 2555048196, 3542330227, 3727205754, 3375740769, 3292445032, 3876557655, 3926170974, 4246310725, 4027744588, 1808481195, 1723872674, 1910319033, 2094410160, 1608975247, 1391201670, 1173430173, 1224348052, 59984867, 244860394, 428169201, 344873464, 935293895, 984907214, 766078933, 547512796, 1844882806, 1627235199, 2011214180, 2062270317, 1507497298, 1423022939, 1137477952, 1321699145, 95345982, 145085239, 532201772, 313773861, 830661914, 1015671571, 731183368, 648017665, 3175501286, 2957853679, 2807058932, 2858115069, 2305455554, 2220981195, 2474404304, 2658625497, 3575528878, 3625268135, 3473416636, 3254988725, 3778151818, 3963161475, 4213447064, 4130281361, 3599595085, 3683022916, 3432737375, 3247465558, 3802222185, 4020912224, 4172763771, 4122762354, 3201631749, 3017672716, 2764249623, 2848461854, 2331590177, 2280796200, 2431590963, 2648976442, 104699613, 188127444, 472615631, 287343814, 840019705, 1058709744, 671593195, 621591778, 1852171925, 1668212892, 1953757831, 2037970062, 1514790577, 1463996600, 1080017571, 1297403050, 3673637356, 3623636965, 3235995134, 3454686199, 4007360968, 3822090177, 4107101658, 4190530515, 2997825956, 3215212461, 2830708150, 2779915199, 2256734592, 2340947849, 2627016082, 2443058075, 172466556, 122466165, 273792366, 492483431, 1047239e3, 861968209, 612205898, 695634755, 1646252340, 1863638845, 2013908262, 1963115311, 1446242576, 1530455833, 1277555970, 1093597963, 1636604631, 1820824798, 2073724613, 1989249228, 1436590835, 1487645946, 1337376481, 1119727848, 164948639, 81781910, 331544205, 516552836, 1039717051, 821288114, 669961897, 719700128, 2973530695, 3157750862, 2871682645, 2787207260, 2232435299, 2283490410, 2667994737, 2450346104, 3647212047, 3564045318, 3279033885, 3464042516, 3980931627, 3762502690, 4150144569, 4199882800, 3070356634, 3121275539, 2904027272, 2686254721, 2200818878, 2384911031, 2570832044, 2486224549, 3747192018, 3528626907, 3310321856, 3359936201, 3950355702, 3867060991, 4049844452, 4234721005, 1739656202, 1790575107, 2108100632, 1890328081, 1402811438, 1586903591, 1233856572, 1149249077, 266959938, 48394827, 369057872, 418672217, 1002783846, 919489135, 567498868, 752375421, 209336225, 24197544, 376187827, 459744698, 945164165, 895287692, 574624663, 793451934, 1679968233, 1764313568, 2117360635, 1933530610, 1343127501, 1560637892, 1243112415, 1192455638, 3704280881, 3519142200, 3336358691, 3419915562, 3907448597, 3857572124, 4075877127, 4294704398, 3029510009, 3113855344, 2927934315, 2744104290, 2159976285, 2377486676, 2594734927, 2544078150],
  8183. rn = [0, 151849742, 303699484, 454499602, 607398968, 758720310, 908999204, 1059270954, 1214797936, 1097159550, 1517440620, 1400849762, 1817998408, 1699839814, 2118541908, 2001430874, 2429595872, 2581445614, 2194319100, 2345119218, 3034881240, 3186202582, 2801699524, 2951971274, 3635996816, 3518358430, 3399679628, 3283088770, 4237083816, 4118925222, 4002861748, 3885750714, 1002142683, 850817237, 698445255, 548169417, 529487843, 377642221, 227885567, 77089521, 1943217067, 2061379749, 1640576439, 1757691577, 1474760595, 1592394909, 1174215055, 1290801793, 2875968315, 2724642869, 3111247143, 2960971305, 2405426947, 2253581325, 2638606623, 2487810577, 3808662347, 3926825029, 4044981591, 4162096729, 3342319475, 3459953789, 3576539503, 3693126241, 1986918061, 2137062819, 1685577905, 1836772287, 1381620373, 1532285339, 1078185097, 1229899655, 1040559837, 923313619, 740276417, 621982671, 439452389, 322734571, 137073913, 19308535, 3871163981, 4021308739, 4104605777, 4255800159, 3263785589, 3414450555, 3499326569, 3651041127, 2933202493, 2815956275, 3167684641, 3049390895, 2330014213, 2213296395, 2566595609, 2448830231, 1305906550, 1155237496, 1607244650, 1455525988, 1776460110, 1626319424, 2079897426, 1928707164, 96392454, 213114376, 396673818, 514443284, 562755902, 679998e3, 865136418, 983426092, 3708173718, 3557504664, 3474729866, 3323011204, 4180808110, 4030667424, 3945269170, 3794078908, 2507040230, 2623762152, 2272556026, 2390325492, 2975484382, 3092726480, 2738905026, 2857194700, 3973773121, 3856137295, 4274053469, 4157467219, 3371096953, 3252932727, 3673476453, 3556361835, 2763173681, 2915017791, 3064510765, 3215307299, 2156299017, 2307622919, 2459735317, 2610011675, 2081048481, 1963412655, 1846563261, 1729977011, 1480485785, 1362321559, 1243905413, 1126790795, 878845905, 1030690015, 645401037, 796197571, 274084841, 425408743, 38544885, 188821243, 3613494426, 3731654548, 3313212038, 3430322568, 4082475170, 4200115116, 3780097726, 3896688048, 2668221674, 2516901860, 2366882550, 2216610296, 3141400786, 2989552604, 2837966542, 2687165888, 1202797690, 1320957812, 1437280870, 1554391400, 1669664834, 1787304780, 1906247262, 2022837584, 265905162, 114585348, 499347990, 349075736, 736970802, 585122620, 972512814, 821712160, 2595684844, 2478443234, 2293045232, 2174754046, 3196267988, 3079546586, 2895723464, 2777952454, 3537852828, 3687994002, 3234156416, 3385345166, 4142626212, 4293295786, 3841024952, 3992742070, 174567692, 57326082, 410887952, 292596766, 777231668, 660510266, 1011452712, 893681702, 1108339068, 1258480242, 1343618912, 1494807662, 1715193156, 1865862730, 1948373848, 2100090966, 2701949495, 2818666809, 3004591147, 3122358053, 2235061775, 2352307457, 2535604243, 2653899549, 3915653703, 3764988233, 4219352155, 4067639125, 3444575871, 3294430577, 3746175075, 3594982253, 836553431, 953270745, 600235211, 718002117, 367585007, 484830689, 133361907, 251657213, 2041877159, 1891211689, 1806599355, 1654886325, 1568718495, 1418573201, 1335535747, 1184342925];
  8184. function on(e) {
  8185. for (var t = [], n = 0; n < e.length; n += 4) {
  8186. t.push(e[n] << 24 | e[n + 1] << 16 | e[n + 2] << 8 | e[n + 3]);
  8187. }
  8188. return t;
  8189. }
  8190. var an = /*#__PURE__*/function () {
  8191. function an(e) {
  8192. (0, _classCallCheck2.default)(this, an);
  8193. if (!(this instanceof an)) throw Error("AES must be instanitated with `new`");
  8194. Object.defineProperty(this, "key", {
  8195. value: Ft(e, !0)
  8196. }), this._prepare();
  8197. }
  8198. (0, _createClass2.default)(an, [{
  8199. key: "_prepare",
  8200. value: function _prepare() {
  8201. var e = $t[this.key.length];
  8202. if (null == e) throw new Error("invalid key size (must be 16, 24 or 32 bytes)");
  8203. this._Ke = [], this._Kd = [];
  8204. for (var t = 0; t <= e; t++) {
  8205. this._Ke.push([0, 0, 0, 0]), this._Kd.push([0, 0, 0, 0]);
  8206. }
  8207. var n,
  8208. s = 4 * (e + 1),
  8209. r = this.key.length / 4,
  8210. i = on(this.key);
  8211. for (t = 0; t < r; t++) {
  8212. n = t >> 2, this._Ke[n][t % 4] = i[t], this._Kd[e - n][t % 4] = i[t];
  8213. }
  8214. for (var o, a = 0, c = r; c < s;) {
  8215. if (o = i[r - 1], i[0] ^= zt[o >> 16 & 255] << 24 ^ zt[o >> 8 & 255] << 16 ^ zt[255 & o] << 8 ^ zt[o >> 24 & 255] ^ Wt[a] << 24, a += 1, 8 != r) for (t = 1; t < r; t++) {
  8216. i[t] ^= i[t - 1];
  8217. } else {
  8218. for (t = 1; t < r / 2; t++) {
  8219. i[t] ^= i[t - 1];
  8220. }
  8221. o = i[r / 2 - 1], i[r / 2] ^= zt[255 & o] ^ zt[o >> 8 & 255] << 8 ^ zt[o >> 16 & 255] << 16 ^ zt[o >> 24 & 255] << 24;
  8222. for (t = r / 2 + 1; t < r; t++) {
  8223. i[t] ^= i[t - 1];
  8224. }
  8225. }
  8226. for (t = 0; t < r && c < s;) {
  8227. u = c >> 2, h = c % 4, this._Ke[u][h] = i[t], this._Kd[e - u][h] = i[t++], c++;
  8228. }
  8229. }
  8230. for (var u = 1; u < e; u++) {
  8231. for (var h = 0; h < 4; h++) {
  8232. o = this._Kd[u][h], this._Kd[u][h] = tn[o >> 24 & 255] ^ nn[o >> 16 & 255] ^ sn[o >> 8 & 255] ^ rn[255 & o];
  8233. }
  8234. }
  8235. }
  8236. }, {
  8237. key: "encrypt",
  8238. value: function encrypt(e) {
  8239. if (16 != e.length) throw new Error("invalid plaintext size (must be 16 bytes)");
  8240. for (var t = this._Ke.length - 1, n = [0, 0, 0, 0], s = on(e), r = 0; r < 4; r++) {
  8241. s[r] ^= this._Ke[0][r];
  8242. }
  8243. for (var i = 1; i < t; i++) {
  8244. for (r = 0; r < 4; r++) {
  8245. n[r] = Ht[s[r] >> 24 & 255] ^ Gt[s[(r + 1) % 4] >> 16 & 255] ^ Vt[s[(r + 2) % 4] >> 8 & 255] ^ Yt[255 & s[(r + 3) % 4]] ^ this._Ke[i][r];
  8246. }
  8247. s = n.slice();
  8248. }
  8249. var o,
  8250. a = qt(16);
  8251. for (r = 0; r < 4; r++) {
  8252. o = this._Ke[t][r], a[4 * r] = 255 & (zt[s[r] >> 24 & 255] ^ o >> 24), a[4 * r + 1] = 255 & (zt[s[(r + 1) % 4] >> 16 & 255] ^ o >> 16), a[4 * r + 2] = 255 & (zt[s[(r + 2) % 4] >> 8 & 255] ^ o >> 8), a[4 * r + 3] = 255 & (zt[255 & s[(r + 3) % 4]] ^ o);
  8253. }
  8254. return a;
  8255. }
  8256. }, {
  8257. key: "decrypt",
  8258. value: function decrypt(e) {
  8259. if (16 != e.length) throw new Error("invalid ciphertext size (must be 16 bytes)");
  8260. for (var t = this._Kd.length - 1, n = [0, 0, 0, 0], s = on(e), r = 0; r < 4; r++) {
  8261. s[r] ^= this._Kd[0][r];
  8262. }
  8263. for (var i = 1; i < t; i++) {
  8264. for (r = 0; r < 4; r++) {
  8265. n[r] = Qt[s[r] >> 24 & 255] ^ Xt[s[(r + 3) % 4] >> 16 & 255] ^ Zt[s[(r + 2) % 4] >> 8 & 255] ^ en[255 & s[(r + 1) % 4]] ^ this._Kd[i][r];
  8266. }
  8267. s = n.slice();
  8268. }
  8269. var o,
  8270. a = qt(16);
  8271. for (r = 0; r < 4; r++) {
  8272. o = this._Kd[t][r], a[4 * r] = 255 & (Jt[s[r] >> 24 & 255] ^ o >> 24), a[4 * r + 1] = 255 & (Jt[s[(r + 3) % 4] >> 16 & 255] ^ o >> 16), a[4 * r + 2] = 255 & (Jt[s[(r + 2) % 4] >> 8 & 255] ^ o >> 8), a[4 * r + 3] = 255 & (Jt[255 & s[(r + 1) % 4]] ^ o);
  8273. }
  8274. return a;
  8275. }
  8276. }]);
  8277. return an;
  8278. }();
  8279. var cn = /*#__PURE__*/function () {
  8280. function cn(e) {
  8281. (0, _classCallCheck2.default)(this, cn);
  8282. if (!(this instanceof cn)) throw Error("AES must be instanitated with `new`");
  8283. this.description = "Electronic Code Block", this.name = "ecb", this._aes = new an(e);
  8284. }
  8285. (0, _createClass2.default)(cn, [{
  8286. key: "encrypt",
  8287. value: function encrypt(e) {
  8288. if ((e = Ft(e)).length % 16 != 0) throw new Error("invalid plaintext size (must be multiple of 16 bytes)");
  8289. for (var t = qt(e.length), n = qt(16), s = 0; s < e.length; s += 16) {
  8290. Mt(e, n, 0, s, s + 16), Mt(n = this._aes.encrypt(n), t, s);
  8291. }
  8292. return t;
  8293. }
  8294. }, {
  8295. key: "decrypt",
  8296. value: function decrypt(e) {
  8297. if ((e = Ft(e)).length % 16 != 0) throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");
  8298. for (var t = qt(e.length), n = qt(16), s = 0; s < e.length; s += 16) {
  8299. Mt(e, n, 0, s, s + 16), Mt(n = this._aes.decrypt(n), t, s);
  8300. }
  8301. return t;
  8302. }
  8303. }]);
  8304. return cn;
  8305. }();
  8306. var un = /*#__PURE__*/function () {
  8307. function un(e, t) {
  8308. (0, _classCallCheck2.default)(this, un);
  8309. if (!(this instanceof un)) throw Error("AES must be instanitated with `new`");
  8310. if (this.description = "Cipher Block Chaining", this.name = "cbc", t) {
  8311. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 bytes)");
  8312. } else t = qt(16);
  8313. this._lastCipherblock = Ft(t, !0), this._aes = new an(e);
  8314. }
  8315. (0, _createClass2.default)(un, [{
  8316. key: "encrypt",
  8317. value: function encrypt(e) {
  8318. if ((e = Ft(e)).length % 16 != 0) throw new Error("invalid plaintext size (must be multiple of 16 bytes)");
  8319. for (var t = qt(e.length), n = qt(16), s = 0; s < e.length; s += 16) {
  8320. Mt(e, n, 0, s, s + 16);
  8321. for (var r = 0; r < 16; r++) {
  8322. n[r] ^= this._lastCipherblock[r];
  8323. }
  8324. this._lastCipherblock = this._aes.encrypt(n), Mt(this._lastCipherblock, t, s);
  8325. }
  8326. return t;
  8327. }
  8328. }, {
  8329. key: "decrypt",
  8330. value: function decrypt(e) {
  8331. if ((e = Ft(e)).length % 16 != 0) throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");
  8332. for (var t = qt(e.length), n = qt(16), s = 0; s < e.length; s += 16) {
  8333. Mt(e, n, 0, s, s + 16), n = this._aes.decrypt(n);
  8334. for (var r = 0; r < 16; r++) {
  8335. t[s + r] = n[r] ^ this._lastCipherblock[r];
  8336. }
  8337. Mt(e, this._lastCipherblock, 0, s, s + 16);
  8338. }
  8339. return t;
  8340. }
  8341. }]);
  8342. return un;
  8343. }();
  8344. var hn = /*#__PURE__*/function () {
  8345. function hn(e, t, n) {
  8346. (0, _classCallCheck2.default)(this, hn);
  8347. if (!(this instanceof hn)) throw Error("AES must be instanitated with `new`");
  8348. if (this.description = "Cipher Feedback", this.name = "cfb", t) {
  8349. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 size)");
  8350. } else t = qt(16);
  8351. n || (n = 1), this.segmentSize = n, this._shiftRegister = Ft(t, !0), this._aes = new an(e);
  8352. }
  8353. (0, _createClass2.default)(hn, [{
  8354. key: "encrypt",
  8355. value: function encrypt(e) {
  8356. if (e.length % this.segmentSize != 0) throw new Error("invalid plaintext size (must be segmentSize bytes)");
  8357. for (var t, n = Ft(e, !0), s = 0; s < n.length; s += this.segmentSize) {
  8358. t = this._aes.encrypt(this._shiftRegister);
  8359. for (var r = 0; r < this.segmentSize; r++) {
  8360. n[s + r] ^= t[r];
  8361. }
  8362. Mt(this._shiftRegister, this._shiftRegister, 0, this.segmentSize), Mt(n, this._shiftRegister, 16 - this.segmentSize, s, s + this.segmentSize);
  8363. }
  8364. return n;
  8365. }
  8366. }, {
  8367. key: "decrypt",
  8368. value: function decrypt(e) {
  8369. if (e.length % this.segmentSize != 0) throw new Error("invalid ciphertext size (must be segmentSize bytes)");
  8370. for (var t, n = Ft(e, !0), s = 0; s < n.length; s += this.segmentSize) {
  8371. t = this._aes.encrypt(this._shiftRegister);
  8372. for (var r = 0; r < this.segmentSize; r++) {
  8373. n[s + r] ^= t[r];
  8374. }
  8375. Mt(this._shiftRegister, this._shiftRegister, 0, this.segmentSize), Mt(e, this._shiftRegister, 16 - this.segmentSize, s, s + this.segmentSize);
  8376. }
  8377. return n;
  8378. }
  8379. }]);
  8380. return hn;
  8381. }();
  8382. var ln = /*#__PURE__*/function () {
  8383. function ln(e, t) {
  8384. (0, _classCallCheck2.default)(this, ln);
  8385. if (!(this instanceof ln)) throw Error("AES must be instanitated with `new`");
  8386. if (this.description = "Output Feedback", this.name = "ofb", t) {
  8387. if (16 != t.length) throw new Error("invalid initialation vector size (must be 16 bytes)");
  8388. } else t = qt(16);
  8389. this._lastPrecipher = Ft(t, !0), this._lastPrecipherIndex = 16, this._aes = new an(e);
  8390. }
  8391. (0, _createClass2.default)(ln, [{
  8392. key: "encrypt",
  8393. value: function encrypt(e) {
  8394. for (var t = Ft(e, !0), n = 0; n < t.length; n++) {
  8395. 16 === this._lastPrecipherIndex && (this._lastPrecipher = this._aes.encrypt(this._lastPrecipher), this._lastPrecipherIndex = 0), t[n] ^= this._lastPrecipher[this._lastPrecipherIndex++];
  8396. }
  8397. return t;
  8398. }
  8399. }, {
  8400. key: "decrypt",
  8401. value: function decrypt(e) {
  8402. return this.encrypt(e);
  8403. }
  8404. }]);
  8405. return ln;
  8406. }();
  8407. var dn = /*#__PURE__*/function () {
  8408. function dn(e) {
  8409. (0, _classCallCheck2.default)(this, dn);
  8410. if (!(this instanceof dn)) throw Error("Counter must be instanitated with `new`");
  8411. 0 === e || e || (e = 1), "number" == typeof e ? (this._counter = qt(16), this.setValue(e)) : this.setBytes(e);
  8412. }
  8413. (0, _createClass2.default)(dn, [{
  8414. key: "setValue",
  8415. value: function setValue(e) {
  8416. if ("number" != typeof e || parseInt(e) != e) throw new Error("invalid counter value (must be an integer)");
  8417. if (e > Number.MAX_SAFE_INTEGER) throw new Error("integer value out of safe range");
  8418. for (var t = 15; t >= 0; --t) {
  8419. this._counter[t] = e % 256, e = parseInt(e / 256);
  8420. }
  8421. }
  8422. }, {
  8423. key: "setBytes",
  8424. value: function setBytes(e) {
  8425. if (16 != (e = Ft(e, !0)).length) throw new Error("invalid counter bytes size (must be 16 bytes)");
  8426. this._counter = e;
  8427. }
  8428. }, {
  8429. key: "increment",
  8430. value: function increment() {
  8431. for (var e = 15; e >= 0; e--) {
  8432. if (255 !== this._counter[e]) {
  8433. this._counter[e]++;
  8434. break;
  8435. }
  8436. this._counter[e] = 0;
  8437. }
  8438. }
  8439. }]);
  8440. return dn;
  8441. }();
  8442. var pn = /*#__PURE__*/function () {
  8443. function pn(e, t) {
  8444. (0, _classCallCheck2.default)(this, pn);
  8445. if (!(this instanceof pn)) throw Error("AES must be instanitated with `new`");
  8446. this.description = "Counter", this.name = "ctr", t instanceof dn || (t = new dn(t)), this._counter = t, this._remainingCounter = null, this._remainingCounterIndex = 16, this._aes = new an(e);
  8447. }
  8448. (0, _createClass2.default)(pn, [{
  8449. key: "encrypt",
  8450. value: function encrypt(e) {
  8451. for (var t = Ft(e, !0), n = 0; n < t.length; n++) {
  8452. 16 === this._remainingCounterIndex && (this._remainingCounter = this._aes.encrypt(this._counter._counter), this._remainingCounterIndex = 0, this._counter.increment()), t[n] ^= this._remainingCounter[this._remainingCounterIndex++];
  8453. }
  8454. return t;
  8455. }
  8456. }, {
  8457. key: "decrypt",
  8458. value: function decrypt(e) {
  8459. return this.encrypt(e);
  8460. }
  8461. }]);
  8462. return pn;
  8463. }();
  8464. var fn = {
  8465. AES: an,
  8466. Counter: dn,
  8467. ModeOfOperation: {
  8468. ecb: cn,
  8469. cbc: un,
  8470. cfb: hn,
  8471. ofb: ln,
  8472. ctr: pn
  8473. },
  8474. utils: {
  8475. hex: Bt,
  8476. utf8: jt
  8477. },
  8478. padding: {
  8479. pkcs7: {
  8480. pad: function pad(e) {
  8481. var t = 16 - (e = Ft(e, !0)).length % 16,
  8482. n = qt(e.length + t);
  8483. Mt(e, n);
  8484. for (var s = e.length; s < n.length; s++) {
  8485. n[s] = t;
  8486. }
  8487. return n;
  8488. },
  8489. strip: function strip(e) {
  8490. if ((e = Ft(e, !0)).length < 16) throw new Error("PKCS#7 invalid length");
  8491. var t = e[e.length - 1];
  8492. if (t > 16) throw new Error("PKCS#7 padding byte out of range");
  8493. for (var n = e.length - t, s = 0; s < t; s++) {
  8494. if (e[n + s] !== t) throw new Error("PKCS#7 invalid padding byte");
  8495. }
  8496. var r = qt(n);
  8497. return Mt(e, r, 0, 0, n), r;
  8498. }
  8499. }
  8500. },
  8501. _arrayTest: {
  8502. coerceArray: Ft,
  8503. createArray: qt,
  8504. copyArray: Mt
  8505. }
  8506. };
  8507. function gn(e, t, n) {
  8508. var s = new Uint8Array(uni.base64ToArrayBuffer(t)),
  8509. r = fn.utils.utf8.toBytes(n),
  8510. i = fn.utils.utf8.toBytes(e),
  8511. o = new fn.ModeOfOperation.cbc(s, r),
  8512. a = fn.padding.pkcs7.pad(i),
  8513. c = o.encrypt(a);
  8514. return uni.arrayBufferToBase64(c);
  8515. }
  8516. var mn = {
  8517. code: 2e4,
  8518. message: "System error"
  8519. },
  8520. yn = {
  8521. code: 20101,
  8522. message: "Invalid client"
  8523. },
  8524. _n = {
  8525. code: 20102,
  8526. message: "Get encrypt key failed"
  8527. },
  8528. wn = {
  8529. 10001: "Secure network is not supported on current playground or unimpsdk",
  8530. 10003: "Config missing in current app. If the problem pesist, please contact DCloud.",
  8531. 10009: "Encrypt payload failed",
  8532. 10010: "Decrypt response failed"
  8533. };
  8534. function vn(e) {
  8535. var _ref25 = e || {},
  8536. t = _ref25.errSubject,
  8537. n = _ref25.subject,
  8538. s = _ref25.errCode,
  8539. r = _ref25.errMsg,
  8540. i = _ref25.code,
  8541. o = _ref25.message,
  8542. a = _ref25.cause;
  8543. return new ne({
  8544. subject: t || n || "uni-secure-network",
  8545. code: s || i || mn.code,
  8546. message: r || o,
  8547. cause: a
  8548. });
  8549. }
  8550. var In,
  8551. Sn,
  8552. bn = null;
  8553. var kn = /*#__PURE__*/function (_Lt) {
  8554. (0, _inherits2.default)(kn, _Lt);
  8555. var _super9 = _createSuper(kn);
  8556. function kn(e) {
  8557. var _this14;
  8558. (0, _classCallCheck2.default)(this, kn);
  8559. _this14 = _super9.call(this, e), _this14.clientType = "mp-weixin", _this14.userEncryptKey = null;
  8560. return _this14;
  8561. }
  8562. (0, _createClass2.default)(kn, [{
  8563. key: "isLogin",
  8564. value: function isLogin() {
  8565. return !!this.scopedGlobalCache.mpWeixinCode || !!this.scopedGlobalCache.mpWeixinOpenid;
  8566. }
  8567. }, {
  8568. key: "prepare",
  8569. value: function () {
  8570. var _prepare2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee38() {
  8571. return _regenerator.default.wrap(function _callee38$(_context38) {
  8572. while (1) {
  8573. switch (_context38.prev = _context38.next) {
  8574. case 0:
  8575. if (this.isLogin()) {
  8576. _context38.next = 7;
  8577. break;
  8578. }
  8579. if (this.scopedGlobalCache.initPromise) {
  8580. _context38.next = 3;
  8581. break;
  8582. }
  8583. throw new Error("`uniCloud.initSecureNetworkByWeixin` has not yet been called");
  8584. case 3:
  8585. _context38.next = 5;
  8586. return this.scopedGlobalCache.initPromise;
  8587. case 5:
  8588. if (this.isLogin()) {
  8589. _context38.next = 7;
  8590. break;
  8591. }
  8592. throw new Error("uniCloud.initSecureNetworkByWeixin` has not yet been called or successfully excuted");
  8593. case 7:
  8594. case "end":
  8595. return _context38.stop();
  8596. }
  8597. }
  8598. }, _callee38, this);
  8599. }));
  8600. function prepare() {
  8601. return _prepare2.apply(this, arguments);
  8602. }
  8603. return prepare;
  8604. }()
  8605. }, {
  8606. key: "getUserEncryptKey",
  8607. value: function () {
  8608. var _getUserEncryptKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee39() {
  8609. var _this15 = this;
  8610. var e;
  8611. return _regenerator.default.wrap(function _callee39$(_context39) {
  8612. while (1) {
  8613. switch (_context39.prev = _context39.next) {
  8614. case 0:
  8615. if (!this.userEncryptKey) {
  8616. _context39.next = 2;
  8617. break;
  8618. }
  8619. return _context39.abrupt("return", this.userEncryptKey);
  8620. case 2:
  8621. if (!(bn && bn.expireTime)) {
  8622. _context39.next = 6;
  8623. break;
  8624. }
  8625. e = Date.now();
  8626. if (!(bn.expireTime - e > 0)) {
  8627. _context39.next = 6;
  8628. break;
  8629. }
  8630. return _context39.abrupt("return", (this.userEncryptKey = bn, this.userEncryptKey));
  8631. case 6:
  8632. return _context39.abrupt("return", new Promise(function (e, t) {
  8633. uni.getUserCryptoManager().getLatestUserKey({
  8634. success: function success(t) {
  8635. bn = t, _this15.userEncryptKey = t, e(_this15.userEncryptKey);
  8636. },
  8637. fail: function fail(e) {
  8638. t(vn(_objectSpread(_objectSpread({}, _n), {}, {
  8639. cause: e
  8640. })));
  8641. }
  8642. });
  8643. }));
  8644. case 7:
  8645. case "end":
  8646. return _context39.stop();
  8647. }
  8648. }
  8649. }, _callee39, this);
  8650. }));
  8651. function getUserEncryptKey() {
  8652. return _getUserEncryptKey.apply(this, arguments);
  8653. }
  8654. return getUserEncryptKey;
  8655. }()
  8656. }, {
  8657. key: "getWxAppId",
  8658. value: function getWxAppId() {
  8659. return wx.getAccountInfoSync().miniProgram.appId;
  8660. }
  8661. }, {
  8662. key: "platformGetSignOption",
  8663. value: function () {
  8664. var _platformGetSignOption = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee40() {
  8665. var _yield$this$getUserEn, e, t, n;
  8666. return _regenerator.default.wrap(function _callee40$(_context40) {
  8667. while (1) {
  8668. switch (_context40.prev = _context40.next) {
  8669. case 0:
  8670. _context40.next = 2;
  8671. return this.getUserEncryptKey();
  8672. case 2:
  8673. _yield$this$getUserEn = _context40.sent;
  8674. e = _yield$this$getUserEn.encryptKey;
  8675. t = _yield$this$getUserEn.iv;
  8676. n = _yield$this$getUserEn.version;
  8677. return _context40.abrupt("return", {
  8678. verifyClientSign: gn(JSON.stringify({
  8679. data: JSON.stringify({}),
  8680. appId: this.appId,
  8681. deviceId: this.deviceId,
  8682. wxAppId: this.getWxAppId(),
  8683. simulator: "devtools" === ce().platform,
  8684. timestamp: Date.now()
  8685. }), e, t),
  8686. encryptKeyId: n,
  8687. mpWeixinCode: this.scopedGlobalCache.mpWeixinCode,
  8688. mpWeixinOpenid: this.scopedGlobalCache.mpWeixinOpenid
  8689. });
  8690. case 7:
  8691. case "end":
  8692. return _context40.stop();
  8693. }
  8694. }
  8695. }, _callee40, this);
  8696. }));
  8697. function platformGetSignOption() {
  8698. return _platformGetSignOption.apply(this, arguments);
  8699. }
  8700. return platformGetSignOption;
  8701. }()
  8702. }, {
  8703. key: "platformEncryptData",
  8704. value: function () {
  8705. var _platformEncryptData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee41(e) {
  8706. var _yield$this$getUserEn2, t, n, s, r;
  8707. return _regenerator.default.wrap(function _callee41$(_context41) {
  8708. while (1) {
  8709. switch (_context41.prev = _context41.next) {
  8710. case 0:
  8711. _context41.next = 2;
  8712. return this.getUserEncryptKey();
  8713. case 2:
  8714. _yield$this$getUserEn2 = _context41.sent;
  8715. t = _yield$this$getUserEn2.encryptKey;
  8716. n = _yield$this$getUserEn2.iv;
  8717. s = _yield$this$getUserEn2.version;
  8718. r = {
  8719. secretType: this.secretType,
  8720. encryptKeyId: s,
  8721. mpWeixinCode: this.scopedGlobalCache.mpWeixinCode,
  8722. mpWeixinOpenid: this.scopedGlobalCache.mpWeixinOpenid
  8723. };
  8724. return _context41.abrupt("return", this.secretType === Rt ? {
  8725. content: e,
  8726. _uniCloudOptions: r
  8727. } : {
  8728. content: gn(JSON.stringify({
  8729. data: JSON.stringify(e),
  8730. appId: this.appId,
  8731. deviceId: this.deviceId,
  8732. wxAppId: this.getWxAppId(),
  8733. simulator: "devtools" === ce().platform,
  8734. timestamp: Date.now()
  8735. }), t, n),
  8736. _uniCloudOptions: r
  8737. });
  8738. case 8:
  8739. case "end":
  8740. return _context41.stop();
  8741. }
  8742. }
  8743. }, _callee41, this);
  8744. }));
  8745. function platformEncryptData(_x33) {
  8746. return _platformEncryptData.apply(this, arguments);
  8747. }
  8748. return platformEncryptData;
  8749. }()
  8750. }, {
  8751. key: "platformDecryptResult",
  8752. value: function () {
  8753. var _platformDecryptResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee42(e) {
  8754. var t, _yield$this$getUserEn3, n, s;
  8755. return _regenerator.default.wrap(function _callee42$(_context42) {
  8756. while (1) {
  8757. switch (_context42.prev = _context42.next) {
  8758. case 0:
  8759. t = e.content;
  8760. _context42.next = 3;
  8761. return this.getUserEncryptKey();
  8762. case 3:
  8763. _yield$this$getUserEn3 = _context42.sent;
  8764. n = _yield$this$getUserEn3.encryptKey;
  8765. s = _yield$this$getUserEn3.iv;
  8766. return _context42.abrupt("return", JSON.parse(function (e, t, n) {
  8767. var s = new Uint8Array(uni.base64ToArrayBuffer(e)),
  8768. r = new Uint8Array(uni.base64ToArrayBuffer(t)),
  8769. i = fn.utils.utf8.toBytes(n),
  8770. o = new fn.ModeOfOperation.cbc(r, i),
  8771. a = fn.padding.pkcs7.strip(o.decrypt(s));
  8772. return fn.utils.utf8.fromBytes(a);
  8773. }(t, n, s)));
  8774. case 7:
  8775. case "end":
  8776. return _context42.stop();
  8777. }
  8778. }
  8779. }, _callee42, this);
  8780. }));
  8781. function platformDecryptResult(_x34) {
  8782. return _platformDecryptResult.apply(this, arguments);
  8783. }
  8784. return platformDecryptResult;
  8785. }()
  8786. }, {
  8787. key: "isClientKeyNotFound",
  8788. value: function isClientKeyNotFound() {
  8789. return !1;
  8790. }
  8791. }]);
  8792. return kn;
  8793. }(Lt);
  8794. function Cn(e) {
  8795. var t = ["hasClientKey", "encryptGetClientKeyPayload", "setClientKey", "encrypt", "decrypt"],
  8796. n = {};
  8797. var _loop = function _loop(_s10) {
  8798. var r = t[_s10];
  8799. n[r] = function () {
  8800. for (var _len = arguments.length, t = new Array(_len), _key = 0; _key < _len; _key++) {
  8801. t[_key] = arguments[_key];
  8802. }
  8803. return new Promise(function (n, s) {
  8804. "function" == typeof e[r] ? e[r].apply(e, t.concat([function () {
  8805. var _ref26 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  8806. e = _ref26.type,
  8807. t = _ref26.data,
  8808. r = _ref26.errCode,
  8809. i = _ref26.errMsg,
  8810. o = _ref26.errSubject,
  8811. a = _ref26.message;
  8812. "success" === e ? n(t) : s(vn({
  8813. errCode: r,
  8814. errMsg: wn[r] || i || a,
  8815. errSubject: o
  8816. }));
  8817. }])) : s(vn({
  8818. message: "请检查manifest.json内是否开启安全网络模块,另外注意标准基座不支持安全网络模块"
  8819. }));
  8820. });
  8821. };
  8822. };
  8823. for (var _s10 = 0; _s10 < t.length; _s10++) {
  8824. _loop(_s10);
  8825. }
  8826. return n;
  8827. }
  8828. var Tn = /*#__PURE__*/function (_Lt2) {
  8829. (0, _inherits2.default)(Tn, _Lt2);
  8830. var _super10 = _createSuper(Tn);
  8831. function Tn(e) {
  8832. var _this16;
  8833. (0, _classCallCheck2.default)(this, Tn);
  8834. _this16 = _super10.call(this, e), _this16.clientType = "app", _this16.appUtils = _objectSpread({}, Cn(uni.requireNativePlugin("plus"))), _this16.systemInfo = In || (In = ce());
  8835. return _this16;
  8836. }
  8837. (0, _createClass2.default)(Tn, [{
  8838. key: "hasClientKey",
  8839. value: function () {
  8840. var _hasClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee43() {
  8841. return _regenerator.default.wrap(function _callee43$(_context43) {
  8842. while (1) {
  8843. switch (_context43.prev = _context43.next) {
  8844. case 0:
  8845. _context43.next = 2;
  8846. return this.appUtils.hasClientKey({
  8847. provider: this.provider,
  8848. spaceId: this.spaceId
  8849. });
  8850. case 2:
  8851. this._hasClientKey = _context43.sent;
  8852. return _context43.abrupt("return", this._hasClientKey);
  8853. case 4:
  8854. case "end":
  8855. return _context43.stop();
  8856. }
  8857. }
  8858. }, _callee43, this);
  8859. }));
  8860. function hasClientKey() {
  8861. return _hasClientKey.apply(this, arguments);
  8862. }
  8863. return hasClientKey;
  8864. }()
  8865. }, {
  8866. key: "getAppClientKey",
  8867. value: function () {
  8868. var _getAppClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee44() {
  8869. var _yield$this$appUtils$, e, t, n, s, r;
  8870. return _regenerator.default.wrap(function _callee44$(_context44) {
  8871. while (1) {
  8872. switch (_context44.prev = _context44.next) {
  8873. case 0:
  8874. _context44.next = 2;
  8875. return this.appUtils.encryptGetClientKeyPayload({
  8876. data: JSON.stringify({})
  8877. });
  8878. case 2:
  8879. _yield$this$appUtils$ = _context44.sent;
  8880. e = _yield$this$appUtils$.data;
  8881. t = _yield$this$appUtils$.key;
  8882. _context44.next = 7;
  8883. return this.uniCloudIns.callFunction({
  8884. name: "DCloud-clientDB",
  8885. data: {
  8886. redirectTo: "encryption",
  8887. action: "getAppClientKey",
  8888. data: e,
  8889. key: t
  8890. }
  8891. });
  8892. case 7:
  8893. _context44.t0 = _context44.sent.result;
  8894. if (_context44.t0) {
  8895. _context44.next = 10;
  8896. break;
  8897. }
  8898. _context44.t0 = {};
  8899. case 10:
  8900. n = _context44.t0;
  8901. if (!(0 !== n.errCode)) {
  8902. _context44.next = 13;
  8903. break;
  8904. }
  8905. throw function (e) {
  8906. return new ne({
  8907. subject: e.errSubject || "uni-secure-network",
  8908. code: e.errCode || e.code || mn.code,
  8909. message: e.errMsg || e.message
  8910. });
  8911. }(n);
  8912. case 13:
  8913. s = n.clientKey, r = n.key;
  8914. _context44.next = 16;
  8915. return this.appUtils.setClientKey({
  8916. provider: this.provider,
  8917. spaceId: this.spaceId,
  8918. clientKey: s,
  8919. key: r
  8920. });
  8921. case 16:
  8922. case "end":
  8923. return _context44.stop();
  8924. }
  8925. }
  8926. }, _callee44, this);
  8927. }));
  8928. function getAppClientKey() {
  8929. return _getAppClientKey.apply(this, arguments);
  8930. }
  8931. return getAppClientKey;
  8932. }()
  8933. }, {
  8934. key: "ensureClientKey",
  8935. value: function () {
  8936. var _ensureClientKey = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee45() {
  8937. var _this17 = this;
  8938. var _ref27,
  8939. _ref27$forceUpdate,
  8940. e,
  8941. _args45 = arguments;
  8942. return _regenerator.default.wrap(function _callee45$(_context45) {
  8943. while (1) {
  8944. switch (_context45.prev = _context45.next) {
  8945. case 0:
  8946. _ref27 = _args45.length > 0 && _args45[0] !== undefined ? _args45[0] : {}, _ref27$forceUpdate = _ref27.forceUpdate, e = _ref27$forceUpdate === void 0 ? !1 : _ref27$forceUpdate;
  8947. _context45.t1 = !0;
  8948. _context45.next = 4;
  8949. return this.hasClientKey();
  8950. case 4:
  8951. _context45.t2 = _context45.sent;
  8952. _context45.t0 = _context45.t1 !== _context45.t2;
  8953. if (_context45.t0) {
  8954. _context45.next = 8;
  8955. break;
  8956. }
  8957. _context45.t0 = e;
  8958. case 8:
  8959. if (!_context45.t0) {
  8960. _context45.next = 10;
  8961. break;
  8962. }
  8963. return _context45.abrupt("return", (e && this.scopedGlobalCache.initPromise && this.scopedGlobalCache.initStatus === d || !e && this.scopedGlobalCache.initPromise && this.scopedGlobalCache.initStatus !== f || (this.scopedGlobalCache.initPromise = this.getAppClientKey(), this.scopedGlobalCache.initPromise.then(function (e) {
  8964. _this17.scopedGlobalCache.initStatus = p;
  8965. }).catch(function (e) {
  8966. throw _this17.scopedGlobalCache.initStatus = f, e;
  8967. }), this.scopedGlobalCache.initStatus = d), this.scopedGlobalCache.initPromise));
  8968. case 10:
  8969. case "end":
  8970. return _context45.stop();
  8971. }
  8972. }
  8973. }, _callee45, this);
  8974. }));
  8975. function ensureClientKey() {
  8976. return _ensureClientKey.apply(this, arguments);
  8977. }
  8978. return ensureClientKey;
  8979. }()
  8980. }, {
  8981. key: "prepare",
  8982. value: function () {
  8983. var _prepare3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee46() {
  8984. var _ref28,
  8985. _ref28$forceUpdate,
  8986. e,
  8987. _args46 = arguments;
  8988. return _regenerator.default.wrap(function _callee46$(_context46) {
  8989. while (1) {
  8990. switch (_context46.prev = _context46.next) {
  8991. case 0:
  8992. _ref28 = _args46.length > 0 && _args46[0] !== undefined ? _args46[0] : {}, _ref28$forceUpdate = _ref28.forceUpdate, e = _ref28$forceUpdate === void 0 ? !1 : _ref28$forceUpdate;
  8993. _context46.next = 3;
  8994. return this.ensureClientKey({
  8995. forceUpdate: e
  8996. });
  8997. case 3:
  8998. case "end":
  8999. return _context46.stop();
  9000. }
  9001. }
  9002. }, _callee46, this);
  9003. }));
  9004. function prepare() {
  9005. return _prepare3.apply(this, arguments);
  9006. }
  9007. return prepare;
  9008. }()
  9009. }, {
  9010. key: "platformGetSignOption",
  9011. value: function () {
  9012. var _platformGetSignOption2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee47() {
  9013. var _yield$this$appUtils$2, e, t;
  9014. return _regenerator.default.wrap(function _callee47$(_context47) {
  9015. while (1) {
  9016. switch (_context47.prev = _context47.next) {
  9017. case 0:
  9018. _context47.next = 2;
  9019. return this.appUtils.encrypt({
  9020. provider: this.provider,
  9021. spaceId: this.spaceId,
  9022. data: JSON.stringify({})
  9023. });
  9024. case 2:
  9025. _yield$this$appUtils$2 = _context47.sent;
  9026. e = _yield$this$appUtils$2.data;
  9027. t = _yield$this$appUtils$2.key;
  9028. return _context47.abrupt("return", {
  9029. verifyClientSign: e,
  9030. encryptKeyId: t
  9031. });
  9032. case 6:
  9033. case "end":
  9034. return _context47.stop();
  9035. }
  9036. }
  9037. }, _callee47, this);
  9038. }));
  9039. function platformGetSignOption() {
  9040. return _platformGetSignOption2.apply(this, arguments);
  9041. }
  9042. return platformGetSignOption;
  9043. }()
  9044. }, {
  9045. key: "platformEncryptData",
  9046. value: function () {
  9047. var _platformEncryptData2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee48(e) {
  9048. var _yield$this$appUtils$3, t, n, s;
  9049. return _regenerator.default.wrap(function _callee48$(_context48) {
  9050. while (1) {
  9051. switch (_context48.prev = _context48.next) {
  9052. case 0:
  9053. _context48.next = 2;
  9054. return this.appUtils.encrypt({
  9055. provider: this.provider,
  9056. spaceId: this.spaceId,
  9057. data: JSON.stringify(e)
  9058. });
  9059. case 2:
  9060. _yield$this$appUtils$3 = _context48.sent;
  9061. t = _yield$this$appUtils$3.data;
  9062. n = _yield$this$appUtils$3.key;
  9063. s = {
  9064. secretType: this.secretType,
  9065. encryptKeyId: n
  9066. };
  9067. return _context48.abrupt("return", this.secretType === Rt ? {
  9068. content: e,
  9069. _uniCloudOptions: s
  9070. } : {
  9071. content: t,
  9072. _uniCloudOptions: s
  9073. });
  9074. case 7:
  9075. case "end":
  9076. return _context48.stop();
  9077. }
  9078. }
  9079. }, _callee48, this);
  9080. }));
  9081. function platformEncryptData(_x35) {
  9082. return _platformEncryptData2.apply(this, arguments);
  9083. }
  9084. return platformEncryptData;
  9085. }()
  9086. }, {
  9087. key: "platformDecryptResult",
  9088. value: function () {
  9089. var _platformDecryptResult2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee49(e) {
  9090. var t, _e$_uniCloudOptions, n, s, r;
  9091. return _regenerator.default.wrap(function _callee49$(_context49) {
  9092. while (1) {
  9093. switch (_context49.prev = _context49.next) {
  9094. case 0:
  9095. t = e.content;
  9096. _e$_uniCloudOptions = e._uniCloudOptions;
  9097. n = _e$_uniCloudOptions === void 0 ? {} : _e$_uniCloudOptions;
  9098. s = n.encryptKeyId;
  9099. _context49.next = 6;
  9100. return this.appUtils.decrypt({
  9101. provider: this.provider,
  9102. spaceId: this.spaceId,
  9103. data: t,
  9104. key: s
  9105. });
  9106. case 6:
  9107. r = _context49.sent;
  9108. return _context49.abrupt("return", JSON.parse(r.data));
  9109. case 8:
  9110. case "end":
  9111. return _context49.stop();
  9112. }
  9113. }
  9114. }, _callee49, this);
  9115. }));
  9116. function platformDecryptResult(_x36) {
  9117. return _platformDecryptResult2.apply(this, arguments);
  9118. }
  9119. return platformDecryptResult;
  9120. }()
  9121. }, {
  9122. key: "isClientKeyNotFound",
  9123. value: function isClientKeyNotFound() {
  9124. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  9125. var t = e.result || {};
  9126. return 70009 === t.errCode && "uni-secure-network" === t.errSubject;
  9127. }
  9128. }]);
  9129. return Tn;
  9130. }(Lt);
  9131. function Pn() {
  9132. var _ref29 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  9133. e = _ref29.secretType;
  9134. return e === xt || e === Rt || e === Ut;
  9135. }
  9136. function An() {
  9137. var _ref30 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  9138. e = _ref30.name,
  9139. _ref30$data = _ref30.data,
  9140. t = _ref30$data === void 0 ? {} : _ref30$data;
  9141. return "app" === P && "DCloud-clientDB" === e && "encryption" === t.redirectTo && "getAppClientKey" === t.action;
  9142. }
  9143. function En() {
  9144. var _ref31 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  9145. e = _ref31.provider,
  9146. t = _ref31.spaceId,
  9147. n = _ref31.functionName;
  9148. var _ce = ce(),
  9149. s = _ce.appId,
  9150. r = _ce.uniPlatform,
  9151. i = _ce.osName;
  9152. var o = r;
  9153. "app" === r && (o = i);
  9154. var a = function () {
  9155. var _ref32 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  9156. e = _ref32.provider,
  9157. t = _ref32.spaceId;
  9158. var n = T;
  9159. if (!n) return {};
  9160. e = function (e) {
  9161. return "tencent" === e ? "tcb" : e;
  9162. }(e);
  9163. var s = n.find(function (n) {
  9164. return n.provider === e && n.spaceId === t;
  9165. });
  9166. return s && s.config;
  9167. }({
  9168. provider: e,
  9169. spaceId: t
  9170. });
  9171. if (!a || !a.accessControl || !a.accessControl.enable) return !1;
  9172. var c = a.accessControl.function || {},
  9173. u = Object.keys(c);
  9174. if (0 === u.length) return !0;
  9175. var h = function (e, t) {
  9176. var n, s, r;
  9177. for (var _i2 = 0; _i2 < e.length; _i2++) {
  9178. var _o2 = e[_i2];
  9179. _o2 !== t ? "*" !== _o2 ? _o2.split(",").map(function (e) {
  9180. return e.trim();
  9181. }).indexOf(t) > -1 && (s = _o2) : r = _o2 : n = _o2;
  9182. }
  9183. return n || s || r;
  9184. }(u, n);
  9185. if (!h) return !1;
  9186. if ((c[h] || []).find(function () {
  9187. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  9188. return e.appId === s && (e.platform || "").toLowerCase() === o.toLowerCase();
  9189. })) return !0;
  9190. throw console.error("\u6B64\u5E94\u7528[appId: ".concat(s, ", platform: ").concat(o, "]\u4E0D\u5728\u4E91\u7AEF\u914D\u7F6E\u7684\u5141\u8BB8\u8BBF\u95EE\u7684\u5E94\u7528\u5217\u8868\u5185\uFF0C\u53C2\u8003\uFF1Ahttps://uniapp.dcloud.net.cn/uniCloud/secure-network.html#verify-client")), vn(yn);
  9191. }
  9192. function On(_ref33) {
  9193. var e = _ref33.functionName,
  9194. t = _ref33.result,
  9195. n = _ref33.logPvd;
  9196. if (b && this.__dev__.debugLog && t && t.requestId) {
  9197. var _s11 = JSON.stringify({
  9198. spaceId: this.config.spaceId,
  9199. functionName: e,
  9200. requestId: t.requestId
  9201. });
  9202. console.log("[".concat(n, "-request]").concat(_s11, "[/").concat(n, "-request]"));
  9203. }
  9204. }
  9205. function xn(e) {
  9206. var t = e.callFunction,
  9207. n = function n(_n7) {
  9208. var _this18 = this;
  9209. var s = _n7.name;
  9210. _n7.data = kt.call(e, {
  9211. data: _n7.data
  9212. });
  9213. var r = {
  9214. aliyun: "aliyun",
  9215. tencent: "tcb",
  9216. tcb: "tcb"
  9217. }[this.config.provider],
  9218. i = Pn(_n7),
  9219. o = An(_n7),
  9220. a = i || o;
  9221. return t.call(this, _n7).then(function (e) {
  9222. return e.errCode = 0, !a && On.call(_this18, {
  9223. functionName: s,
  9224. result: e,
  9225. logPvd: r
  9226. }), Promise.resolve(e);
  9227. }, function (e) {
  9228. return !a && On.call(_this18, {
  9229. functionName: s,
  9230. result: e,
  9231. logPvd: r
  9232. }), e && e.message && (e.message = function () {
  9233. var _ref34 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  9234. _ref34$message = _ref34.message,
  9235. e = _ref34$message === void 0 ? "" : _ref34$message,
  9236. _ref34$extraInfo = _ref34.extraInfo,
  9237. t = _ref34$extraInfo === void 0 ? {} : _ref34$extraInfo,
  9238. _ref34$formatter = _ref34.formatter,
  9239. n = _ref34$formatter === void 0 ? [] : _ref34$formatter;
  9240. for (var _s12 = 0; _s12 < n.length; _s12++) {
  9241. var _n$_s = n[_s12],
  9242. _r4 = _n$_s.rule,
  9243. _i3 = _n$_s.content,
  9244. _o3 = _n$_s.mode,
  9245. _a = e.match(_r4);
  9246. if (!_a) continue;
  9247. var _c = _i3;
  9248. for (var _e20 = 1; _e20 < _a.length; _e20++) {
  9249. _c = Et(_c, "{$".concat(_e20, "}"), _a[_e20]);
  9250. }
  9251. for (var _e21 in t) {
  9252. _c = Et(_c, "{".concat(_e21, "}"), t[_e21]);
  9253. }
  9254. return "replace" === _o3 ? _c : e + _c;
  9255. }
  9256. return e;
  9257. }({
  9258. message: "[".concat(_n7.name, "]: ").concat(e.message),
  9259. formatter: Tt,
  9260. extraInfo: {
  9261. functionName: s
  9262. }
  9263. })), Promise.reject(e);
  9264. });
  9265. };
  9266. e.callFunction = function (t) {
  9267. var _e$config = e.config,
  9268. s = _e$config.provider,
  9269. r = _e$config.spaceId,
  9270. i = t.name;
  9271. var o, a;
  9272. if (t.data = t.data || {}, b && e.__dev__.debugInfo && !e.__dev__.debugInfo.forceRemote && E ? (e._callCloudFunction || (e._callCloudFunction = n, e._callLocalFunction = Ct), o = Ct) : o = n, o = o.bind(e), An(t)) a = n.call(e, t);else if (function (_ref35) {
  9273. var e = _ref35.name,
  9274. _ref35$data = _ref35.data,
  9275. t = _ref35$data === void 0 ? {} : _ref35$data;
  9276. return "mp-weixin" === P && "uni-id-co" === e && "secureNetworkHandshakeByWeixin" === t.method;
  9277. }(t)) a = o.call(e, t);else if (Pn(t)) {
  9278. a = new Sn({
  9279. secretType: t.secretType,
  9280. uniCloudIns: e
  9281. }).wrapEncryptDataCallFunction(n.bind(e))(t);
  9282. } else if (En({
  9283. provider: s,
  9284. spaceId: r,
  9285. functionName: i
  9286. })) {
  9287. a = new Sn({
  9288. secretType: t.secretType,
  9289. uniCloudIns: e
  9290. }).wrapVerifyClientCallFunction(n.bind(e))(t);
  9291. } else a = o(t);
  9292. return Object.defineProperty(a, "result", {
  9293. get: function get() {
  9294. return console.warn("当前返回结果为Promise类型,不可直接访问其result属性,详情请参考:https://uniapp.dcloud.net.cn/uniCloud/faq?id=promise"), {};
  9295. }
  9296. }), a;
  9297. };
  9298. }
  9299. Sn = "mp-weixin" !== P && "app" !== P ? /*#__PURE__*/function () {
  9300. function _class2() {
  9301. (0, _classCallCheck2.default)(this, _class2);
  9302. throw vn({
  9303. message: "Platform ".concat(P, " is not supported by secure network")
  9304. });
  9305. }
  9306. return (0, _createClass2.default)(_class2);
  9307. }() : C ? "mp-weixin" === P ? kn : Tn : /*#__PURE__*/function () {
  9308. function _class3() {
  9309. (0, _classCallCheck2.default)(this, _class3);
  9310. throw vn({
  9311. message: "Platform ".concat(P, " is not enabled, please check whether secure network module is enabled in your manifest.json")
  9312. });
  9313. }
  9314. return (0, _createClass2.default)(_class3);
  9315. }();
  9316. var Rn = Symbol("CLIENT_DB_INTERNAL");
  9317. function Un(e, t) {
  9318. return e.then = "DoNotReturnProxyWithAFunctionNamedThen", e._internalType = Rn, e.inspect = null, e.__ob__ = void 0, new Proxy(e, {
  9319. get: function get(e, n, s) {
  9320. if ("_uniClient" === n) return null;
  9321. if ("symbol" == (0, _typeof2.default)(n)) return e[n];
  9322. if (n in e || "string" != typeof n) {
  9323. var _t10 = e[n];
  9324. return "function" == typeof _t10 ? _t10.bind(e) : _t10;
  9325. }
  9326. return t.get(e, n, s);
  9327. }
  9328. });
  9329. }
  9330. function Ln(e) {
  9331. return {
  9332. on: function on(t, n) {
  9333. e[t] = e[t] || [], e[t].indexOf(n) > -1 || e[t].push(n);
  9334. },
  9335. off: function off(t, n) {
  9336. e[t] = e[t] || [];
  9337. var s = e[t].indexOf(n);
  9338. -1 !== s && e[t].splice(s, 1);
  9339. }
  9340. };
  9341. }
  9342. var Nn = ["db.Geo", "db.command", "command.aggregate"];
  9343. function Dn(e, t) {
  9344. return Nn.indexOf("".concat(e, ".").concat(t)) > -1;
  9345. }
  9346. function Fn(e) {
  9347. switch (g(e)) {
  9348. case "array":
  9349. return e.map(function (e) {
  9350. return Fn(e);
  9351. });
  9352. case "object":
  9353. return e._internalType === Rn || Object.keys(e).forEach(function (t) {
  9354. e[t] = Fn(e[t]);
  9355. }), e;
  9356. case "regexp":
  9357. return {
  9358. $regexp: {
  9359. source: e.source,
  9360. flags: e.flags
  9361. }
  9362. };
  9363. case "date":
  9364. return {
  9365. $date: e.toISOString()
  9366. };
  9367. default:
  9368. return e;
  9369. }
  9370. }
  9371. function qn(e) {
  9372. return e && e.content && e.content.$method;
  9373. }
  9374. var Mn = /*#__PURE__*/function () {
  9375. function Mn(e, t, n) {
  9376. (0, _classCallCheck2.default)(this, Mn);
  9377. this.content = e, this.prevStage = t || null, this.udb = null, this._database = n;
  9378. }
  9379. (0, _createClass2.default)(Mn, [{
  9380. key: "toJSON",
  9381. value: function toJSON() {
  9382. var e = this;
  9383. var t = [e.content];
  9384. for (; e.prevStage;) {
  9385. e = e.prevStage, t.push(e.content);
  9386. }
  9387. return {
  9388. $db: t.reverse().map(function (e) {
  9389. return {
  9390. $method: e.$method,
  9391. $param: Fn(e.$param)
  9392. };
  9393. })
  9394. };
  9395. }
  9396. }, {
  9397. key: "toString",
  9398. value: function toString() {
  9399. return JSON.stringify(this.toJSON());
  9400. }
  9401. }, {
  9402. key: "getAction",
  9403. value: function getAction() {
  9404. var e = this.toJSON().$db.find(function (e) {
  9405. return "action" === e.$method;
  9406. });
  9407. return e && e.$param && e.$param[0];
  9408. }
  9409. }, {
  9410. key: "getCommand",
  9411. value: function getCommand() {
  9412. return {
  9413. $db: this.toJSON().$db.filter(function (e) {
  9414. return "action" !== e.$method;
  9415. })
  9416. };
  9417. }
  9418. }, {
  9419. key: "isAggregate",
  9420. get: function get() {
  9421. var e = this;
  9422. for (; e;) {
  9423. var t = qn(e),
  9424. _n8 = qn(e.prevStage);
  9425. if ("aggregate" === t && "collection" === _n8 || "pipeline" === t) return !0;
  9426. e = e.prevStage;
  9427. }
  9428. return !1;
  9429. }
  9430. }, {
  9431. key: "isCommand",
  9432. get: function get() {
  9433. var e = this;
  9434. for (; e;) {
  9435. if ("command" === qn(e)) return !0;
  9436. e = e.prevStage;
  9437. }
  9438. return !1;
  9439. }
  9440. }, {
  9441. key: "isAggregateCommand",
  9442. get: function get() {
  9443. var e = this;
  9444. for (; e;) {
  9445. var t = qn(e),
  9446. _n9 = qn(e.prevStage);
  9447. if ("aggregate" === t && "command" === _n9) return !0;
  9448. e = e.prevStage;
  9449. }
  9450. return !1;
  9451. }
  9452. }, {
  9453. key: "getNextStageFn",
  9454. value: function getNextStageFn(e) {
  9455. var t = this;
  9456. return function () {
  9457. return Kn({
  9458. $method: e,
  9459. $param: Fn(Array.from(arguments))
  9460. }, t, t._database);
  9461. };
  9462. }
  9463. }, {
  9464. key: "count",
  9465. get: function get() {
  9466. return this.isAggregate ? this.getNextStageFn("count") : function () {
  9467. return this._send("count", Array.from(arguments));
  9468. };
  9469. }
  9470. }, {
  9471. key: "remove",
  9472. get: function get() {
  9473. return this.isCommand ? this.getNextStageFn("remove") : function () {
  9474. return this._send("remove", Array.from(arguments));
  9475. };
  9476. }
  9477. }, {
  9478. key: "get",
  9479. value: function get() {
  9480. return this._send("get", Array.from(arguments));
  9481. }
  9482. }, {
  9483. key: "add",
  9484. get: function get() {
  9485. return this.isCommand ? this.getNextStageFn("add") : function () {
  9486. return this._send("add", Array.from(arguments));
  9487. };
  9488. }
  9489. }, {
  9490. key: "update",
  9491. value: function update() {
  9492. return this._send("update", Array.from(arguments));
  9493. }
  9494. }, {
  9495. key: "end",
  9496. value: function end() {
  9497. return this._send("end", Array.from(arguments));
  9498. }
  9499. }, {
  9500. key: "set",
  9501. get: function get() {
  9502. return this.isCommand ? this.getNextStageFn("set") : function () {
  9503. throw new Error("JQL禁止使用set方法");
  9504. };
  9505. }
  9506. }, {
  9507. key: "_send",
  9508. value: function _send(e, t) {
  9509. var n = this.getAction(),
  9510. s = this.getCommand();
  9511. if (s.$db.push({
  9512. $method: e,
  9513. $param: Fn(t)
  9514. }), b) {
  9515. var _e22 = s.$db.find(function (e) {
  9516. return "collection" === e.$method;
  9517. }),
  9518. _t11 = _e22 && _e22.$param;
  9519. _t11 && 1 === _t11.length && "string" == typeof _e22.$param[0] && _e22.$param[0].indexOf(",") > -1 && console.warn("检测到使用JQL语法联表查询时,未使用getTemp先过滤主表数据,在主表数据量大的情况下可能会查询缓慢。\n- 如何优化请参考此文档:https://uniapp.dcloud.net.cn/uniCloud/jql?id=lookup-with-temp \n- 如果主表数据量很小请忽略此信息,项目发行时不会出现此提示。");
  9520. }
  9521. return this._database._callCloudFunction({
  9522. action: n,
  9523. command: s
  9524. });
  9525. }
  9526. }]);
  9527. return Mn;
  9528. }();
  9529. function Kn(e, t, n) {
  9530. return Un(new Mn(e, t, n), {
  9531. get: function get(e, t) {
  9532. var s = "db";
  9533. return e && e.content && (s = e.content.$method), Dn(s, t) ? Kn({
  9534. $method: t
  9535. }, e, n) : function () {
  9536. return Kn({
  9537. $method: t,
  9538. $param: Fn(Array.from(arguments))
  9539. }, e, n);
  9540. };
  9541. }
  9542. });
  9543. }
  9544. function jn(_ref36) {
  9545. var e = _ref36.path,
  9546. t = _ref36.method;
  9547. return /*#__PURE__*/function () {
  9548. function _class4() {
  9549. (0, _classCallCheck2.default)(this, _class4);
  9550. this.param = Array.from(arguments);
  9551. }
  9552. (0, _createClass2.default)(_class4, [{
  9553. key: "toJSON",
  9554. value: function toJSON() {
  9555. return {
  9556. $newDb: [].concat((0, _toConsumableArray2.default)(e.map(function (e) {
  9557. return {
  9558. $method: e
  9559. };
  9560. })), [{
  9561. $method: t,
  9562. $param: this.param
  9563. }])
  9564. };
  9565. }
  9566. }, {
  9567. key: "toString",
  9568. value: function toString() {
  9569. return JSON.stringify(this.toJSON());
  9570. }
  9571. }]);
  9572. return _class4;
  9573. }();
  9574. }
  9575. function Bn(e) {
  9576. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  9577. return Un(new e(t), {
  9578. get: function get(e, t) {
  9579. return Dn("db", t) ? Kn({
  9580. $method: t
  9581. }, null, e) : function () {
  9582. return Kn({
  9583. $method: t,
  9584. $param: Fn(Array.from(arguments))
  9585. }, null, e);
  9586. };
  9587. }
  9588. });
  9589. }
  9590. var $n = /*#__PURE__*/function (_ref37) {
  9591. (0, _inherits2.default)($n, _ref37);
  9592. var _super11 = _createSuper($n);
  9593. function $n() {
  9594. (0, _classCallCheck2.default)(this, $n);
  9595. return _super11.apply(this, arguments);
  9596. }
  9597. (0, _createClass2.default)($n, [{
  9598. key: "_parseResult",
  9599. value: function _parseResult(e) {
  9600. return this._isJQL ? e.result : e;
  9601. }
  9602. }, {
  9603. key: "_callCloudFunction",
  9604. value: function _callCloudFunction(_ref38) {
  9605. var _this19 = this;
  9606. var e = _ref38.action,
  9607. t = _ref38.command,
  9608. n = _ref38.multiCommand,
  9609. s = _ref38.queryList;
  9610. function r(e, t) {
  9611. if (n && s) for (var _n10 = 0; _n10 < s.length; _n10++) {
  9612. var _r5 = s[_n10];
  9613. _r5.udb && "function" == typeof _r5.udb.setResult && (t ? _r5.udb.setResult(t) : _r5.udb.setResult(e.result.dataList[_n10]));
  9614. }
  9615. }
  9616. var i = this,
  9617. o = this._isJQL ? "databaseForJQL" : "database";
  9618. function a(e) {
  9619. return i._callback("error", [e]), q(M(o, "fail"), e).then(function () {
  9620. return q(M(o, "complete"), e);
  9621. }).then(function () {
  9622. return r(null, e), Q(B, {
  9623. type: z,
  9624. content: e
  9625. }), Promise.reject(e);
  9626. });
  9627. }
  9628. var c = q(M(o, "invoke")),
  9629. u = this._uniClient;
  9630. return c.then(function () {
  9631. return u.callFunction({
  9632. name: "DCloud-clientDB",
  9633. type: l,
  9634. data: {
  9635. action: e,
  9636. command: t,
  9637. multiCommand: n
  9638. }
  9639. });
  9640. }).then(function (e) {
  9641. var _e$result = e.result,
  9642. t = _e$result.code,
  9643. n = _e$result.message,
  9644. s = _e$result.token,
  9645. c = _e$result.tokenExpired,
  9646. _e$result$systemInfo = _e$result.systemInfo,
  9647. u = _e$result$systemInfo === void 0 ? [] : _e$result$systemInfo;
  9648. if (u) for (var _e23 = 0; _e23 < u.length; _e23++) {
  9649. var _u$_e = u[_e23],
  9650. _t12 = _u$_e.level,
  9651. _n11 = _u$_e.message,
  9652. _s13 = _u$_e.detail,
  9653. _r6 = console["app" === P && "warn" === _t12 ? "error" : _t12] || console.log;
  9654. var _i4 = "[System Info]" + _n11;
  9655. _s13 && (_i4 = "".concat(_i4, "\n\u8BE6\u7EC6\u4FE1\u606F\uFF1A").concat(_s13)), _r6(_i4);
  9656. }
  9657. if (t) {
  9658. return a(new ne({
  9659. code: t,
  9660. message: n,
  9661. requestId: e.requestId
  9662. }));
  9663. }
  9664. e.result.errCode = e.result.errCode || e.result.code, e.result.errMsg = e.result.errMsg || e.result.message, s && c && (ie({
  9665. token: s,
  9666. tokenExpired: c
  9667. }), _this19._callbackAuth("refreshToken", [{
  9668. token: s,
  9669. tokenExpired: c
  9670. }]), _this19._callback("refreshToken", [{
  9671. token: s,
  9672. tokenExpired: c
  9673. }]), Q(W, {
  9674. token: s,
  9675. tokenExpired: c
  9676. }));
  9677. var h = [{
  9678. prop: "affectedDocs",
  9679. tips: "affectedDocs不再推荐使用,请使用inserted/deleted/updated/data.length替代"
  9680. }, {
  9681. prop: "code",
  9682. tips: "code不再推荐使用,请使用errCode替代"
  9683. }, {
  9684. prop: "message",
  9685. tips: "message不再推荐使用,请使用errMsg替代"
  9686. }];
  9687. var _loop2 = function _loop2(_t13) {
  9688. var _h$_t = h[_t13],
  9689. n = _h$_t.prop,
  9690. s = _h$_t.tips;
  9691. if (n in e.result) {
  9692. var _t14 = e.result[n];
  9693. Object.defineProperty(e.result, n, {
  9694. get: function get() {
  9695. return console.warn(s), _t14;
  9696. }
  9697. });
  9698. }
  9699. };
  9700. for (var _t13 = 0; _t13 < h.length; _t13++) {
  9701. _loop2(_t13);
  9702. }
  9703. return function (e) {
  9704. return q(M(o, "success"), e).then(function () {
  9705. return q(M(o, "complete"), e);
  9706. }).then(function () {
  9707. r(e, null);
  9708. var t = i._parseResult(e);
  9709. return Q(B, {
  9710. type: z,
  9711. content: t
  9712. }), Promise.resolve(t);
  9713. });
  9714. }(e);
  9715. }, function (e) {
  9716. /fc_function_not_found|FUNCTION_NOT_FOUND/g.test(e.message) && console.warn("clientDB未初始化,请在web控制台保存一次schema以开启clientDB");
  9717. return a(new ne({
  9718. code: e.code || "SYSTEM_ERROR",
  9719. message: e.message,
  9720. requestId: e.requestId
  9721. }));
  9722. });
  9723. }
  9724. }]);
  9725. return $n;
  9726. }( /*#__PURE__*/function () {
  9727. function _class5() {
  9728. var _ref39 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  9729. _ref39$uniClient = _ref39.uniClient,
  9730. e = _ref39$uniClient === void 0 ? {} : _ref39$uniClient,
  9731. _ref39$isJQL = _ref39.isJQL,
  9732. t = _ref39$isJQL === void 0 ? !1 : _ref39$isJQL;
  9733. (0, _classCallCheck2.default)(this, _class5);
  9734. this._uniClient = e, this._authCallBacks = {}, this._dbCallBacks = {}, e._isDefault && (this._dbCallBacks = U("_globalUniCloudDatabaseCallback")), t || (this.auth = Ln(this._authCallBacks)), this._isJQL = t, Object.assign(this, Ln(this._dbCallBacks)), this.env = Un({}, {
  9735. get: function get(e, t) {
  9736. return {
  9737. $env: t
  9738. };
  9739. }
  9740. }), this.Geo = Un({}, {
  9741. get: function get(e, t) {
  9742. return jn({
  9743. path: ["Geo"],
  9744. method: t
  9745. });
  9746. }
  9747. }), this.serverDate = jn({
  9748. path: [],
  9749. method: "serverDate"
  9750. }), this.RegExp = jn({
  9751. path: [],
  9752. method: "RegExp"
  9753. });
  9754. }
  9755. (0, _createClass2.default)(_class5, [{
  9756. key: "getCloudEnv",
  9757. value: function getCloudEnv(e) {
  9758. if ("string" != typeof e || !e.trim()) throw new Error("getCloudEnv参数错误");
  9759. return {
  9760. $env: e.replace("$cloudEnv_", "")
  9761. };
  9762. }
  9763. }, {
  9764. key: "_callback",
  9765. value: function _callback(e, t) {
  9766. var n = this._dbCallBacks;
  9767. n[e] && n[e].forEach(function (e) {
  9768. e.apply(void 0, (0, _toConsumableArray2.default)(t));
  9769. });
  9770. }
  9771. }, {
  9772. key: "_callbackAuth",
  9773. value: function _callbackAuth(e, t) {
  9774. var n = this._authCallBacks;
  9775. n[e] && n[e].forEach(function (e) {
  9776. e.apply(void 0, (0, _toConsumableArray2.default)(t));
  9777. });
  9778. }
  9779. }, {
  9780. key: "multiSend",
  9781. value: function multiSend() {
  9782. var e = Array.from(arguments),
  9783. t = e.map(function (e) {
  9784. var t = e.getAction(),
  9785. n = e.getCommand();
  9786. if ("getTemp" !== n.$db[n.$db.length - 1].$method) throw new Error("multiSend只支持子命令内使用getTemp");
  9787. return {
  9788. action: t,
  9789. command: n
  9790. };
  9791. });
  9792. return this._callCloudFunction({
  9793. multiCommand: t,
  9794. queryList: e
  9795. });
  9796. }
  9797. }]);
  9798. return _class5;
  9799. }());
  9800. var Wn = "token无效,跳转登录页面",
  9801. zn = "token过期,跳转登录页面",
  9802. Jn = {
  9803. TOKEN_INVALID_TOKEN_EXPIRED: zn,
  9804. TOKEN_INVALID_INVALID_CLIENTID: Wn,
  9805. TOKEN_INVALID: Wn,
  9806. TOKEN_INVALID_WRONG_TOKEN: Wn,
  9807. TOKEN_INVALID_ANONYMOUS_USER: Wn
  9808. },
  9809. Hn = {
  9810. "uni-id-token-expired": zn,
  9811. "uni-id-check-token-failed": Wn,
  9812. "uni-id-token-not-exist": Wn,
  9813. "uni-id-check-device-feature-failed": Wn
  9814. };
  9815. function Gn(e, t) {
  9816. var n = "";
  9817. return n = e ? "".concat(e, "/").concat(t) : t, n.replace(/^\//, "");
  9818. }
  9819. function Vn() {
  9820. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  9821. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
  9822. var n = [],
  9823. s = [];
  9824. return e.forEach(function (e) {
  9825. !0 === e.needLogin ? n.push(Gn(t, e.path)) : !1 === e.needLogin && s.push(Gn(t, e.path));
  9826. }), {
  9827. needLoginPage: n,
  9828. notNeedLoginPage: s
  9829. };
  9830. }
  9831. function Yn(e) {
  9832. return e.split("?")[0].replace(/^\//, "");
  9833. }
  9834. function Qn() {
  9835. return function (e) {
  9836. var t = e && e.$page && e.$page.fullPath || "";
  9837. return t ? ("/" !== t.charAt(0) && (t = "/" + t), t) : t;
  9838. }(function () {
  9839. var e = getCurrentPages();
  9840. return e[e.length - 1];
  9841. }());
  9842. }
  9843. function Xn() {
  9844. return Yn(Qn());
  9845. }
  9846. function Zn() {
  9847. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
  9848. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  9849. if (!e) return !1;
  9850. if (!(t && t.list && t.list.length)) return !1;
  9851. var n = t.list,
  9852. s = Yn(e);
  9853. return n.some(function (e) {
  9854. return e.pagePath === s;
  9855. });
  9856. }
  9857. var es = !!_pages.default.uniIdRouter;
  9858. var _ref40 = function () {
  9859. var _ref21 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _pages.default,
  9860. _ref21$pages = _ref21.pages,
  9861. e = _ref21$pages === void 0 ? [] : _ref21$pages,
  9862. _ref21$subPackages = _ref21.subPackages,
  9863. n = _ref21$subPackages === void 0 ? [] : _ref21$subPackages,
  9864. _ref21$uniIdRouter = _ref21.uniIdRouter,
  9865. s = _ref21$uniIdRouter === void 0 ? {} : _ref21$uniIdRouter,
  9866. _ref21$tabBar = _ref21.tabBar,
  9867. r = _ref21$tabBar === void 0 ? {} : _ref21$tabBar;
  9868. var i = s.loginPage,
  9869. _s$needLogin = s.needLogin,
  9870. o = _s$needLogin === void 0 ? [] : _s$needLogin,
  9871. _s$resToLogin = s.resToLogin,
  9872. a = _s$resToLogin === void 0 ? !0 : _s$resToLogin,
  9873. _Vn = Vn(e),
  9874. c = _Vn.needLoginPage,
  9875. u = _Vn.notNeedLoginPage,
  9876. _ref23 = function () {
  9877. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  9878. var t = [],
  9879. n = [];
  9880. return e.forEach(function (e) {
  9881. var s = e.root,
  9882. _e$pages = e.pages,
  9883. r = _e$pages === void 0 ? [] : _e$pages,
  9884. _Vn2 = Vn(r, s),
  9885. i = _Vn2.needLoginPage,
  9886. o = _Vn2.notNeedLoginPage;
  9887. t.push.apply(t, (0, _toConsumableArray2.default)(i)), n.push.apply(n, (0, _toConsumableArray2.default)(o));
  9888. }), {
  9889. needLoginPage: t,
  9890. notNeedLoginPage: n
  9891. };
  9892. }(n),
  9893. h = _ref23.needLoginPage,
  9894. l = _ref23.notNeedLoginPage;
  9895. return {
  9896. loginPage: i,
  9897. routerNeedLogin: o,
  9898. resToLogin: a,
  9899. needLoginPage: [].concat((0, _toConsumableArray2.default)(c), (0, _toConsumableArray2.default)(h)),
  9900. notNeedLoginPage: [].concat((0, _toConsumableArray2.default)(u), (0, _toConsumableArray2.default)(l)),
  9901. loginPageInTabBar: Zn(i, r)
  9902. };
  9903. }(),
  9904. ts = _ref40.loginPage,
  9905. ns = _ref40.routerNeedLogin,
  9906. ss = _ref40.resToLogin,
  9907. rs = _ref40.needLoginPage,
  9908. is = _ref40.notNeedLoginPage,
  9909. os = _ref40.loginPageInTabBar;
  9910. if (rs.indexOf(ts) > -1) throw new Error("Login page [".concat(ts, "] should not be \"needLogin\", please check your pages.json"));
  9911. function as(e) {
  9912. var t = Xn();
  9913. if ("/" === e.charAt(0)) return e;
  9914. var _e$split = e.split("?"),
  9915. _e$split2 = (0, _slicedToArray2.default)(_e$split, 2),
  9916. n = _e$split2[0],
  9917. s = _e$split2[1],
  9918. r = n.replace(/^\//, "").split("/"),
  9919. i = t.split("/");
  9920. i.pop();
  9921. for (var _e24 = 0; _e24 < r.length; _e24++) {
  9922. var _t15 = r[_e24];
  9923. ".." === _t15 ? i.pop() : "." !== _t15 && i.push(_t15);
  9924. }
  9925. return "" === i[0] && i.shift(), "/" + i.join("/") + (s ? "?" + s : "");
  9926. }
  9927. function cs(e) {
  9928. var t = Yn(as(e));
  9929. return !(is.indexOf(t) > -1) && (rs.indexOf(t) > -1 || ns.some(function (t) {
  9930. return function (e, t) {
  9931. return new RegExp(t).test(e);
  9932. }(e, t);
  9933. }));
  9934. }
  9935. function us(_ref41) {
  9936. var e = _ref41.redirect;
  9937. var t = Yn(e),
  9938. n = Yn(ts);
  9939. return Xn() !== n && t !== n;
  9940. }
  9941. function hs() {
  9942. var _ref42 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  9943. e = _ref42.api,
  9944. t = _ref42.redirect;
  9945. if (!t || !us({
  9946. redirect: t
  9947. })) return;
  9948. var n = function (e, t) {
  9949. return "/" !== e.charAt(0) && (e = "/" + e), t ? e.indexOf("?") > -1 ? e + "&uniIdRedirectUrl=".concat(encodeURIComponent(t)) : e + "?uniIdRedirectUrl=".concat(encodeURIComponent(t)) : e;
  9950. }(ts, t);
  9951. os ? "navigateTo" !== e && "redirectTo" !== e || (e = "switchTab") : "switchTab" === e && (e = "navigateTo");
  9952. var s = {
  9953. navigateTo: uni.navigateTo,
  9954. redirectTo: uni.redirectTo,
  9955. switchTab: uni.switchTab,
  9956. reLaunch: uni.reLaunch
  9957. };
  9958. setTimeout(function () {
  9959. s[e]({
  9960. url: n
  9961. });
  9962. });
  9963. }
  9964. function ls() {
  9965. var _ref43 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  9966. e = _ref43.url;
  9967. var t = {
  9968. abortLoginPageJump: !1,
  9969. autoToLoginPage: !1
  9970. },
  9971. n = function () {
  9972. var _re3 = re(),
  9973. e = _re3.token,
  9974. t = _re3.tokenExpired;
  9975. var n;
  9976. if (e) {
  9977. if (t < Date.now()) {
  9978. var _e25 = "uni-id-token-expired";
  9979. n = {
  9980. errCode: _e25,
  9981. errMsg: Hn[_e25]
  9982. };
  9983. }
  9984. } else {
  9985. var _e26 = "uni-id-check-token-failed";
  9986. n = {
  9987. errCode: _e26,
  9988. errMsg: Hn[_e26]
  9989. };
  9990. }
  9991. return n;
  9992. }();
  9993. if (cs(e) && n) {
  9994. n.uniIdRedirectUrl = e;
  9995. if (G($).length > 0) return setTimeout(function () {
  9996. Q($, n);
  9997. }, 0), t.abortLoginPageJump = !0, t;
  9998. t.autoToLoginPage = !0;
  9999. }
  10000. return t;
  10001. }
  10002. function ds() {
  10003. !function () {
  10004. var e = Qn(),
  10005. _ls = ls({
  10006. url: e
  10007. }),
  10008. t = _ls.abortLoginPageJump,
  10009. n = _ls.autoToLoginPage;
  10010. t || n && hs({
  10011. api: "redirectTo",
  10012. redirect: e
  10013. });
  10014. }();
  10015. var e = ["navigateTo", "redirectTo", "reLaunch", "switchTab"];
  10016. var _loop3 = function _loop3(_t16) {
  10017. var n = e[_t16];
  10018. uni.addInterceptor(n, {
  10019. invoke: function invoke(e) {
  10020. var _ls2 = ls({
  10021. url: e.url
  10022. }),
  10023. t = _ls2.abortLoginPageJump,
  10024. s = _ls2.autoToLoginPage;
  10025. return t ? e : s ? (hs({
  10026. api: n,
  10027. redirect: as(e.url)
  10028. }), !1) : e;
  10029. }
  10030. });
  10031. };
  10032. for (var _t16 = 0; _t16 < e.length; _t16++) {
  10033. _loop3(_t16);
  10034. }
  10035. }
  10036. function ps() {
  10037. this.onResponse(function (e) {
  10038. var t = e.type,
  10039. n = e.content;
  10040. var s = !1;
  10041. switch (t) {
  10042. case "cloudobject":
  10043. s = function (e) {
  10044. if ("object" != (0, _typeof2.default)(e)) return !1;
  10045. var _ref44 = e || {},
  10046. t = _ref44.errCode;
  10047. return t in Hn;
  10048. }(n);
  10049. break;
  10050. case "clientdb":
  10051. s = function (e) {
  10052. if ("object" != (0, _typeof2.default)(e)) return !1;
  10053. var _ref45 = e || {},
  10054. t = _ref45.errCode;
  10055. return t in Jn;
  10056. }(n);
  10057. }
  10058. s && function () {
  10059. var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  10060. var t = G($);
  10061. ee().then(function () {
  10062. var n = Qn();
  10063. if (n && us({
  10064. redirect: n
  10065. })) return t.length > 0 ? Q($, Object.assign({
  10066. uniIdRedirectUrl: n
  10067. }, e)) : void (ts && hs({
  10068. api: "navigateTo",
  10069. redirect: n
  10070. }));
  10071. });
  10072. }(n);
  10073. });
  10074. }
  10075. function fs(e) {
  10076. !function (e) {
  10077. e.onResponse = function (e) {
  10078. V(B, e);
  10079. }, e.offResponse = function (e) {
  10080. Y(B, e);
  10081. };
  10082. }(e), function (e) {
  10083. e.onNeedLogin = function (e) {
  10084. V($, e);
  10085. }, e.offNeedLogin = function (e) {
  10086. Y($, e);
  10087. }, es && (U("_globalUniCloudStatus").needLoginInit || (U("_globalUniCloudStatus").needLoginInit = !0, ee().then(function () {
  10088. ds.call(e);
  10089. }), ss && ps.call(e)));
  10090. }(e), function (e) {
  10091. e.onRefreshToken = function (e) {
  10092. V(W, e);
  10093. }, e.offRefreshToken = function (e) {
  10094. Y(W, e);
  10095. };
  10096. }(e);
  10097. }
  10098. var gs;
  10099. var ms = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  10100. ys = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  10101. function _s() {
  10102. var e = re().token || "",
  10103. t = e.split(".");
  10104. if (!e || 3 !== t.length) return {
  10105. uid: null,
  10106. role: [],
  10107. permission: [],
  10108. tokenExpired: 0
  10109. };
  10110. var n;
  10111. try {
  10112. n = JSON.parse((s = t[1], decodeURIComponent(gs(s).split("").map(function (e) {
  10113. return "%" + ("00" + e.charCodeAt(0).toString(16)).slice(-2);
  10114. }).join(""))));
  10115. } catch (e) {
  10116. throw new Error("获取当前用户信息出错,详细错误信息为:" + e.message);
  10117. }
  10118. var s;
  10119. return n.tokenExpired = 1e3 * n.exp, delete n.exp, delete n.iat, n;
  10120. }
  10121. gs = "function" != typeof atob ? function (e) {
  10122. if (e = String(e).replace(/[\t\n\f\r ]+/g, ""), !ys.test(e)) throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
  10123. var t;
  10124. e += "==".slice(2 - (3 & e.length));
  10125. for (var n, s, r = "", i = 0; i < e.length;) {
  10126. t = ms.indexOf(e.charAt(i++)) << 18 | ms.indexOf(e.charAt(i++)) << 12 | (n = ms.indexOf(e.charAt(i++))) << 6 | (s = ms.indexOf(e.charAt(i++))), r += 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);
  10127. }
  10128. return r;
  10129. } : atob;
  10130. var ws = s(function (e, t) {
  10131. Object.defineProperty(t, "__esModule", {
  10132. value: !0
  10133. });
  10134. var n = "chooseAndUploadFile:ok",
  10135. s = "chooseAndUploadFile:fail";
  10136. function r(e, t) {
  10137. return e.tempFiles.forEach(function (e, n) {
  10138. 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("."));
  10139. }), e.tempFilePaths || (e.tempFilePaths = e.tempFiles.map(function (e) {
  10140. return e.path;
  10141. })), e;
  10142. }
  10143. function i(e, t, _ref46) {
  10144. var s = _ref46.onChooseFile,
  10145. r = _ref46.onUploadProgress;
  10146. return t.then(function (e) {
  10147. if (s) {
  10148. var _t17 = s(e);
  10149. if (void 0 !== _t17) return Promise.resolve(_t17).then(function (t) {
  10150. return void 0 === t ? e : t;
  10151. });
  10152. }
  10153. return e;
  10154. }).then(function (t) {
  10155. return !1 === t ? {
  10156. errMsg: n,
  10157. tempFilePaths: [],
  10158. tempFiles: []
  10159. } : function (e, t) {
  10160. var s = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 5;
  10161. var r = arguments.length > 3 ? arguments[3] : undefined;
  10162. (t = Object.assign({}, t)).errMsg = n;
  10163. var i = t.tempFiles,
  10164. o = i.length;
  10165. var a = 0;
  10166. return new Promise(function (n) {
  10167. for (; a < s;) {
  10168. c();
  10169. }
  10170. function c() {
  10171. var s = a++;
  10172. if (s >= o) return void (!i.find(function (e) {
  10173. return !e.url && !e.errMsg;
  10174. }) && n(t));
  10175. var u = i[s];
  10176. e.uploadFile({
  10177. filePath: u.path,
  10178. cloudPath: u.cloudPath,
  10179. fileType: u.fileType,
  10180. onUploadProgress: function onUploadProgress(e) {
  10181. e.index = s, e.tempFile = u, e.tempFilePath = u.path, r && r(e);
  10182. }
  10183. }).then(function (e) {
  10184. u.url = e.fileID, s < o && c();
  10185. }).catch(function (e) {
  10186. u.errMsg = e.errMsg || e.message, s < o && c();
  10187. });
  10188. }
  10189. });
  10190. }(e, t, 5, r);
  10191. });
  10192. }
  10193. t.initChooseAndUploadFile = function (e) {
  10194. return function () {
  10195. var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
  10196. type: "all"
  10197. };
  10198. return "image" === t.type ? i(e, function (e) {
  10199. var t = e.count,
  10200. n = e.sizeType,
  10201. _e$sourceType = e.sourceType,
  10202. i = _e$sourceType === void 0 ? ["album", "camera"] : _e$sourceType,
  10203. o = e.extension;
  10204. return new Promise(function (e, a) {
  10205. uni.chooseImage({
  10206. count: t,
  10207. sizeType: n,
  10208. sourceType: i,
  10209. extension: o,
  10210. success: function success(t) {
  10211. e(r(t, "image"));
  10212. },
  10213. fail: function fail(e) {
  10214. a({
  10215. errMsg: e.errMsg.replace("chooseImage:fail", s)
  10216. });
  10217. }
  10218. });
  10219. });
  10220. }(t), t) : "video" === t.type ? i(e, function (e) {
  10221. var t = e.camera,
  10222. n = e.compressed,
  10223. i = e.maxDuration,
  10224. _e$sourceType2 = e.sourceType,
  10225. o = _e$sourceType2 === void 0 ? ["album", "camera"] : _e$sourceType2,
  10226. a = e.extension;
  10227. return new Promise(function (e, c) {
  10228. uni.chooseVideo({
  10229. camera: t,
  10230. compressed: n,
  10231. maxDuration: i,
  10232. sourceType: o,
  10233. extension: a,
  10234. success: function success(t) {
  10235. var n = t.tempFilePath,
  10236. s = t.duration,
  10237. i = t.size,
  10238. o = t.height,
  10239. a = t.width;
  10240. e(r({
  10241. errMsg: "chooseVideo:ok",
  10242. tempFilePaths: [n],
  10243. tempFiles: [{
  10244. name: t.tempFile && t.tempFile.name || "",
  10245. path: n,
  10246. size: i,
  10247. type: t.tempFile && t.tempFile.type || "",
  10248. width: a,
  10249. height: o,
  10250. duration: s,
  10251. fileType: "video",
  10252. cloudPath: ""
  10253. }]
  10254. }, "video"));
  10255. },
  10256. fail: function fail(e) {
  10257. c({
  10258. errMsg: e.errMsg.replace("chooseVideo:fail", s)
  10259. });
  10260. }
  10261. });
  10262. });
  10263. }(t), t) : i(e, function (e) {
  10264. var t = e.count,
  10265. n = e.extension;
  10266. return new Promise(function (e, i) {
  10267. var o = uni.chooseFile;
  10268. if ("undefined" != typeof wx && "function" == typeof wx.chooseMessageFile && (o = wx.chooseMessageFile), "function" != typeof o) return i({
  10269. errMsg: s + " 请指定 type 类型,该平台仅支持选择 image 或 video。"
  10270. });
  10271. o({
  10272. type: "all",
  10273. count: t,
  10274. extension: n,
  10275. success: function success(t) {
  10276. e(r(t));
  10277. },
  10278. fail: function fail(e) {
  10279. i({
  10280. errMsg: e.errMsg.replace("chooseFile:fail", s)
  10281. });
  10282. }
  10283. });
  10284. });
  10285. }(t), t);
  10286. };
  10287. };
  10288. }),
  10289. vs = n(ws);
  10290. var Is = "manual";
  10291. function Ss(e) {
  10292. return {
  10293. props: {
  10294. localdata: {
  10295. type: Array,
  10296. default: function _default() {
  10297. return [];
  10298. }
  10299. },
  10300. options: {
  10301. type: [Object, Array],
  10302. default: function _default() {
  10303. return {};
  10304. }
  10305. },
  10306. spaceInfo: {
  10307. type: Object,
  10308. default: function _default() {
  10309. return {};
  10310. }
  10311. },
  10312. collection: {
  10313. type: [String, Array],
  10314. default: ""
  10315. },
  10316. action: {
  10317. type: String,
  10318. default: ""
  10319. },
  10320. field: {
  10321. type: String,
  10322. default: ""
  10323. },
  10324. orderby: {
  10325. type: String,
  10326. default: ""
  10327. },
  10328. where: {
  10329. type: [String, Object],
  10330. default: ""
  10331. },
  10332. pageData: {
  10333. type: String,
  10334. default: "add"
  10335. },
  10336. pageCurrent: {
  10337. type: Number,
  10338. default: 1
  10339. },
  10340. pageSize: {
  10341. type: Number,
  10342. default: 20
  10343. },
  10344. getcount: {
  10345. type: [Boolean, String],
  10346. default: !1
  10347. },
  10348. gettree: {
  10349. type: [Boolean, String],
  10350. default: !1
  10351. },
  10352. gettreepath: {
  10353. type: [Boolean, String],
  10354. default: !1
  10355. },
  10356. startwith: {
  10357. type: String,
  10358. default: ""
  10359. },
  10360. limitlevel: {
  10361. type: Number,
  10362. default: 10
  10363. },
  10364. groupby: {
  10365. type: String,
  10366. default: ""
  10367. },
  10368. groupField: {
  10369. type: String,
  10370. default: ""
  10371. },
  10372. distinct: {
  10373. type: [Boolean, String],
  10374. default: !1
  10375. },
  10376. foreignKey: {
  10377. type: String,
  10378. default: ""
  10379. },
  10380. loadtime: {
  10381. type: String,
  10382. default: "auto"
  10383. },
  10384. manual: {
  10385. type: Boolean,
  10386. default: !1
  10387. }
  10388. },
  10389. data: function data() {
  10390. return {
  10391. mixinDatacomLoading: !1,
  10392. mixinDatacomHasMore: !1,
  10393. mixinDatacomResData: [],
  10394. mixinDatacomErrorMessage: "",
  10395. mixinDatacomPage: {}
  10396. };
  10397. },
  10398. created: function created() {
  10399. var _this20 = this;
  10400. this.mixinDatacomPage = {
  10401. current: this.pageCurrent,
  10402. size: this.pageSize,
  10403. count: 0
  10404. }, this.$watch(function () {
  10405. var e = [];
  10406. return ["pageCurrent", "pageSize", "localdata", "collection", "action", "field", "orderby", "where", "getont", "getcount", "gettree", "groupby", "groupField", "distinct"].forEach(function (t) {
  10407. e.push(_this20[t]);
  10408. }), e;
  10409. }, function (e, t) {
  10410. if (_this20.loadtime === Is) return;
  10411. var n = !1;
  10412. var s = [];
  10413. for (var _r7 = 2; _r7 < e.length; _r7++) {
  10414. e[_r7] !== t[_r7] && (s.push(e[_r7]), n = !0);
  10415. }
  10416. e[0] !== t[0] && (_this20.mixinDatacomPage.current = _this20.pageCurrent), _this20.mixinDatacomPage.size = _this20.pageSize, _this20.onMixinDatacomPropsChange(n, s);
  10417. });
  10418. },
  10419. methods: {
  10420. onMixinDatacomPropsChange: function onMixinDatacomPropsChange(e, t) {},
  10421. mixinDatacomEasyGet: function mixinDatacomEasyGet() {
  10422. var _this21 = this;
  10423. var _ref47 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  10424. _ref47$getone = _ref47.getone,
  10425. e = _ref47$getone === void 0 ? !1 : _ref47$getone,
  10426. t = _ref47.success,
  10427. n = _ref47.fail;
  10428. this.mixinDatacomLoading || (this.mixinDatacomLoading = !0, this.mixinDatacomErrorMessage = "", this.mixinDatacomGet().then(function (n) {
  10429. _this21.mixinDatacomLoading = !1;
  10430. var _n$result = n.result,
  10431. s = _n$result.data,
  10432. r = _n$result.count;
  10433. _this21.getcount && (_this21.mixinDatacomPage.count = r), _this21.mixinDatacomHasMore = s.length < _this21.pageSize;
  10434. var i = e ? s.length ? s[0] : void 0 : s;
  10435. _this21.mixinDatacomResData = i, t && t(i);
  10436. }).catch(function (e) {
  10437. _this21.mixinDatacomLoading = !1, _this21.mixinDatacomErrorMessage = e, n && n(e);
  10438. }));
  10439. },
  10440. mixinDatacomGet: function mixinDatacomGet() {
  10441. var _n12;
  10442. var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  10443. var n = e.database(this.spaceInfo);
  10444. var s = t.action || this.action;
  10445. s && (n = n.action(s));
  10446. var r = t.collection || this.collection;
  10447. n = Array.isArray(r) ? (_n12 = n).collection.apply(_n12, (0, _toConsumableArray2.default)(r)) : n.collection(r);
  10448. var i = t.where || this.where;
  10449. i && Object.keys(i).length && (n = n.where(i));
  10450. var o = t.field || this.field;
  10451. o && (n = n.field(o));
  10452. var a = t.foreignKey || this.foreignKey;
  10453. a && (n = n.foreignKey(a));
  10454. var c = t.groupby || this.groupby;
  10455. c && (n = n.groupBy(c));
  10456. var u = t.groupField || this.groupField;
  10457. u && (n = n.groupField(u));
  10458. !0 === (void 0 !== t.distinct ? t.distinct : this.distinct) && (n = n.distinct());
  10459. var h = t.orderby || this.orderby;
  10460. h && (n = n.orderBy(h));
  10461. var l = void 0 !== t.pageCurrent ? t.pageCurrent : this.mixinDatacomPage.current,
  10462. d = void 0 !== t.pageSize ? t.pageSize : this.mixinDatacomPage.size,
  10463. p = void 0 !== t.getcount ? t.getcount : this.getcount,
  10464. f = void 0 !== t.gettree ? t.gettree : this.gettree,
  10465. g = void 0 !== t.gettreepath ? t.gettreepath : this.gettreepath,
  10466. m = {
  10467. getCount: p
  10468. },
  10469. y = {
  10470. limitLevel: void 0 !== t.limitlevel ? t.limitlevel : this.limitlevel,
  10471. startWith: void 0 !== t.startwith ? t.startwith : this.startwith
  10472. };
  10473. return f && (m.getTree = y), g && (m.getTreePath = y), n = n.skip(d * (l - 1)).limit(d).get(m), n;
  10474. }
  10475. }
  10476. };
  10477. }
  10478. function bs(e) {
  10479. return function (t) {
  10480. var n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  10481. n = function (e) {
  10482. var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  10483. return e.customUI = t.customUI || e.customUI, e.parseSystemError = t.parseSystemError || e.parseSystemError, Object.assign(e.loadingOptions, t.loadingOptions), Object.assign(e.errorOptions, t.errorOptions), "object" == (0, _typeof2.default)(t.secretMethods) && (e.secretMethods = t.secretMethods), e;
  10484. }({
  10485. customUI: !1,
  10486. loadingOptions: {
  10487. title: "加载中...",
  10488. mask: !0
  10489. },
  10490. errorOptions: {
  10491. type: "modal",
  10492. retry: !1
  10493. }
  10494. }, n);
  10495. var _n13 = n,
  10496. s = _n13.customUI,
  10497. r = _n13.loadingOptions,
  10498. i = _n13.errorOptions,
  10499. o = _n13.parseSystemError,
  10500. a = !s;
  10501. return new Proxy({}, {
  10502. get: function get(s, c) {
  10503. return function () {
  10504. var _ref48 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  10505. e = _ref48.fn,
  10506. t = _ref48.interceptorName,
  10507. n = _ref48.getCallbackArgs;
  10508. return /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee50() {
  10509. var _len2,
  10510. s,
  10511. _key2,
  10512. r,
  10513. i,
  10514. o,
  10515. _args = arguments;
  10516. return _regenerator.default.wrap(function _callee50$(_context50) {
  10517. while (1) {
  10518. switch (_context50.prev = _context50.next) {
  10519. case 0:
  10520. for (_len2 = _args.length, s = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  10521. s[_key2] = _args[_key2];
  10522. }
  10523. r = n ? n({
  10524. params: s
  10525. }) : {};
  10526. _context50.prev = 2;
  10527. _context50.next = 5;
  10528. return q(M(t, "invoke"), _objectSpread({}, r));
  10529. case 5:
  10530. _context50.next = 7;
  10531. return e.apply(void 0, s);
  10532. case 7:
  10533. i = _context50.sent;
  10534. _context50.next = 10;
  10535. return q(M(t, "success"), _objectSpread(_objectSpread({}, r), {}, {
  10536. result: i
  10537. }));
  10538. case 10:
  10539. return _context50.abrupt("return", i);
  10540. case 13:
  10541. _context50.prev = 13;
  10542. _context50.t0 = _context50["catch"](2);
  10543. o = _context50.t0;
  10544. _context50.next = 18;
  10545. return q(M(t, "fail"), _objectSpread(_objectSpread({}, r), {}, {
  10546. error: o
  10547. }));
  10548. case 18:
  10549. throw o;
  10550. case 19:
  10551. _context50.prev = 19;
  10552. _context50.next = 22;
  10553. return q(M(t, "complete"), o ? _objectSpread(_objectSpread({}, r), {}, {
  10554. error: o
  10555. }) : _objectSpread(_objectSpread({}, r), {}, {
  10556. result: i
  10557. }));
  10558. case 22:
  10559. return _context50.finish(19);
  10560. case 23:
  10561. case "end":
  10562. return _context50.stop();
  10563. }
  10564. }
  10565. }, _callee50, null, [[2, 13, 19, 23]]);
  10566. }));
  10567. }({
  10568. fn: function () {
  10569. var _s14 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee52() {
  10570. var l,
  10571. _len3,
  10572. u,
  10573. _key3,
  10574. d,
  10575. p,
  10576. _ref50,
  10577. f,
  10578. g,
  10579. m,
  10580. y,
  10581. _e27,
  10582. _yield,
  10583. _t18,
  10584. _n14,
  10585. _args4 = arguments;
  10586. return _regenerator.default.wrap(function _callee52$(_context52) {
  10587. while (1) {
  10588. switch (_context52.prev = _context52.next) {
  10589. case 0:
  10590. a && uni.showLoading({
  10591. title: r.title,
  10592. mask: r.mask
  10593. });
  10594. for (_len3 = _args4.length, u = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  10595. u[_key3] = _args4[_key3];
  10596. }
  10597. d = {
  10598. name: t,
  10599. type: h,
  10600. data: {
  10601. method: c,
  10602. params: u
  10603. }
  10604. };
  10605. "object" == (0, _typeof2.default)(n.secretMethods) && function (e, t) {
  10606. var n = t.data.method,
  10607. s = e.secretMethods || {},
  10608. r = s[n] || s["*"];
  10609. r && (t.secretType = r);
  10610. }(n, d);
  10611. p = !1;
  10612. _context52.prev = 5;
  10613. _context52.next = 8;
  10614. return e.callFunction(d);
  10615. case 8:
  10616. l = _context52.sent;
  10617. _context52.next = 14;
  10618. break;
  10619. case 11:
  10620. _context52.prev = 11;
  10621. _context52.t0 = _context52["catch"](5);
  10622. p = !0, l = {
  10623. result: new ne(_context52.t0)
  10624. };
  10625. case 14:
  10626. _ref50 = l.result || {}, f = _ref50.errSubject, g = _ref50.errCode, m = _ref50.errMsg, y = _ref50.newToken;
  10627. if (!(a && uni.hideLoading(), y && y.token && y.tokenExpired && (ie(y), Q(W, _objectSpread({}, y))), g)) {
  10628. _context52.next = 39;
  10629. break;
  10630. }
  10631. _e27 = m;
  10632. if (!(p && o)) {
  10633. _context52.next = 24;
  10634. break;
  10635. }
  10636. _context52.next = 20;
  10637. return o({
  10638. objectName: t,
  10639. methodName: c,
  10640. params: u,
  10641. errSubject: f,
  10642. errCode: g,
  10643. errMsg: m
  10644. });
  10645. case 20:
  10646. _context52.t1 = _context52.sent.errMsg;
  10647. if (_context52.t1) {
  10648. _context52.next = 23;
  10649. break;
  10650. }
  10651. _context52.t1 = m;
  10652. case 23:
  10653. _e27 = _context52.t1;
  10654. case 24:
  10655. if (!a) {
  10656. _context52.next = 37;
  10657. break;
  10658. }
  10659. if (!("toast" === i.type)) {
  10660. _context52.next = 29;
  10661. break;
  10662. }
  10663. uni.showToast({
  10664. title: _e27,
  10665. icon: "none"
  10666. });
  10667. _context52.next = 37;
  10668. break;
  10669. case 29:
  10670. if (!("modal" !== i.type)) {
  10671. _context52.next = 31;
  10672. break;
  10673. }
  10674. throw new Error("Invalid errorOptions.type: ".concat(i.type));
  10675. case 31:
  10676. _context52.next = 33;
  10677. return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee51() {
  10678. var _ref52,
  10679. e,
  10680. t,
  10681. n,
  10682. s,
  10683. r,
  10684. _args2 = arguments;
  10685. return _regenerator.default.wrap(function _callee51$(_context51) {
  10686. while (1) {
  10687. switch (_context51.prev = _context51.next) {
  10688. case 0:
  10689. _ref52 = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {}, e = _ref52.title, t = _ref52.content, n = _ref52.showCancel, s = _ref52.cancelText, r = _ref52.confirmText;
  10690. return _context51.abrupt("return", new Promise(function (i, o) {
  10691. uni.showModal({
  10692. title: e,
  10693. content: t,
  10694. showCancel: n,
  10695. cancelText: s,
  10696. confirmText: r,
  10697. success: function success(e) {
  10698. i(e);
  10699. },
  10700. fail: function fail() {
  10701. i({
  10702. confirm: !1,
  10703. cancel: !0
  10704. });
  10705. }
  10706. });
  10707. }));
  10708. case 2:
  10709. case "end":
  10710. return _context51.stop();
  10711. }
  10712. }
  10713. }, _callee51);
  10714. }))({
  10715. title: "提示",
  10716. content: _e27,
  10717. showCancel: i.retry,
  10718. cancelText: "取消",
  10719. confirmText: i.retry ? "重试" : "确定"
  10720. });
  10721. case 33:
  10722. _yield = _context52.sent;
  10723. _t18 = _yield.confirm;
  10724. if (!(i.retry && _t18)) {
  10725. _context52.next = 37;
  10726. break;
  10727. }
  10728. return _context52.abrupt("return", s.apply(void 0, u));
  10729. case 37:
  10730. _n14 = new ne({
  10731. subject: f,
  10732. code: g,
  10733. message: m,
  10734. requestId: l.requestId
  10735. });
  10736. throw _n14.detail = l.result, Q(B, {
  10737. type: H,
  10738. content: _n14
  10739. }), _n14;
  10740. case 39:
  10741. return _context52.abrupt("return", (Q(B, {
  10742. type: H,
  10743. content: l.result
  10744. }), l.result));
  10745. case 40:
  10746. case "end":
  10747. return _context52.stop();
  10748. }
  10749. }
  10750. }, _callee52, null, [[5, 11]]);
  10751. }));
  10752. function s() {
  10753. return _s14.apply(this, arguments);
  10754. }
  10755. return s;
  10756. }(),
  10757. interceptorName: "callObject",
  10758. getCallbackArgs: function getCallbackArgs() {
  10759. var _ref53 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  10760. e = _ref53.params;
  10761. return {
  10762. objectName: t,
  10763. methodName: c,
  10764. params: e
  10765. };
  10766. }
  10767. });
  10768. }
  10769. });
  10770. };
  10771. }
  10772. function ks(e) {
  10773. return U("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}", e.config.spaceId));
  10774. }
  10775. function Cs() {
  10776. return _Cs.apply(this, arguments);
  10777. }
  10778. function _Cs() {
  10779. _Cs = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee55() {
  10780. var _ref65,
  10781. e,
  10782. _ref65$callLoginByWei,
  10783. t,
  10784. n,
  10785. s,
  10786. r,
  10787. _args7 = arguments;
  10788. return _regenerator.default.wrap(function _callee55$(_context55) {
  10789. while (1) {
  10790. switch (_context55.prev = _context55.next) {
  10791. case 0:
  10792. _ref65 = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : {}, e = _ref65.openid, _ref65$callLoginByWei = _ref65.callLoginByWeixin, t = _ref65$callLoginByWei === void 0 ? !1 : _ref65$callLoginByWei;
  10793. n = ks(this);
  10794. if (!("mp-weixin" !== P)) {
  10795. _context55.next = 4;
  10796. break;
  10797. }
  10798. throw new Error("[SecureNetwork] API `initSecureNetworkByWeixin` is not supported on platform `".concat(P, "`"));
  10799. case 4:
  10800. if (!(e && t)) {
  10801. _context55.next = 6;
  10802. break;
  10803. }
  10804. throw new Error("[SecureNetwork] openid and callLoginByWeixin cannot be passed at the same time");
  10805. case 6:
  10806. if (!e) {
  10807. _context55.next = 8;
  10808. break;
  10809. }
  10810. return _context55.abrupt("return", (n.mpWeixinOpenid = e, {}));
  10811. case 8:
  10812. _context55.next = 10;
  10813. return new Promise(function (e, t) {
  10814. uni.login({
  10815. success: function success(t) {
  10816. e(t.code);
  10817. },
  10818. fail: function fail(e) {
  10819. t(new Error(e.errMsg));
  10820. }
  10821. });
  10822. });
  10823. case 10:
  10824. s = _context55.sent;
  10825. r = this.importObject("uni-id-co", {
  10826. customUI: !0
  10827. });
  10828. _context55.next = 14;
  10829. return r.secureNetworkHandshakeByWeixin({
  10830. code: s,
  10831. callLoginByWeixin: t
  10832. });
  10833. case 14:
  10834. n.mpWeixinCode = s;
  10835. return _context55.abrupt("return", {
  10836. code: s
  10837. });
  10838. case 16:
  10839. case "end":
  10840. return _context55.stop();
  10841. }
  10842. }
  10843. }, _callee55, this);
  10844. }));
  10845. return _Cs.apply(this, arguments);
  10846. }
  10847. function Ts(_x37) {
  10848. return _Ts.apply(this, arguments);
  10849. }
  10850. function _Ts() {
  10851. _Ts = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee56(e) {
  10852. var t;
  10853. return _regenerator.default.wrap(function _callee56$(_context56) {
  10854. while (1) {
  10855. switch (_context56.prev = _context56.next) {
  10856. case 0:
  10857. t = ks(this);
  10858. return _context56.abrupt("return", (t.initPromise || (t.initPromise = Cs.call(this, e)), t.initPromise));
  10859. case 2:
  10860. case "end":
  10861. return _context56.stop();
  10862. }
  10863. }
  10864. }, _callee56, this);
  10865. }));
  10866. return _Ts.apply(this, arguments);
  10867. }
  10868. function Ps(e) {
  10869. return function () {
  10870. var _ref54 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  10871. t = _ref54.openid,
  10872. _ref54$callLoginByWei = _ref54.callLoginByWeixin,
  10873. n = _ref54$callLoginByWei === void 0 ? !1 : _ref54$callLoginByWei;
  10874. return Ts.call(e, {
  10875. openid: t,
  10876. callLoginByWeixin: n
  10877. });
  10878. };
  10879. }
  10880. function As(e) {
  10881. var t = {
  10882. getSystemInfo: uni.getSystemInfo,
  10883. getPushClientId: uni.getPushClientId
  10884. };
  10885. return function (n) {
  10886. return new Promise(function (s, r) {
  10887. t[e](_objectSpread(_objectSpread({}, n), {}, {
  10888. success: function success(e) {
  10889. s(e);
  10890. },
  10891. fail: function fail(e) {
  10892. r(e);
  10893. }
  10894. }));
  10895. });
  10896. };
  10897. }
  10898. var Es = /*#__PURE__*/function (_ref55) {
  10899. (0, _inherits2.default)(Es, _ref55);
  10900. var _super12 = _createSuper(Es);
  10901. function Es() {
  10902. var _this22;
  10903. (0, _classCallCheck2.default)(this, Es);
  10904. _this22 = _super12.call(this), _this22._uniPushMessageCallback = _this22._receivePushMessage.bind((0, _assertThisInitialized2.default)(_this22)), _this22._currentMessageId = -1, _this22._payloadQueue = [];
  10905. return _this22;
  10906. }
  10907. (0, _createClass2.default)(Es, [{
  10908. key: "init",
  10909. value: function init() {
  10910. var _this23 = this;
  10911. return Promise.all([As("getSystemInfo")(), As("getPushClientId")()]).then(function () {
  10912. var _ref56 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [],
  10913. _ref57 = (0, _slicedToArray2.default)(_ref56, 2),
  10914. _ref57$ = _ref57[0];
  10915. _ref57$ = _ref57$ === void 0 ? {} : _ref57$;
  10916. var e = _ref57$.appId,
  10917. _ref57$2 = _ref57[1];
  10918. _ref57$2 = _ref57$2 === void 0 ? {} : _ref57$2;
  10919. var t = _ref57$2.cid;
  10920. if (!e) throw new Error("Invalid appId, please check the manifest.json file");
  10921. if (!t) throw new Error("Invalid push client id");
  10922. _this23._appId = e, _this23._pushClientId = t, _this23._seqId = Date.now() + "-" + Math.floor(9e5 * Math.random() + 1e5), _this23.emit("open"), _this23._initMessageListener();
  10923. }, function (e) {
  10924. throw _this23.emit("error", e), _this23.close(), e;
  10925. });
  10926. }
  10927. }, {
  10928. key: "open",
  10929. value: function () {
  10930. var _open = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee53() {
  10931. return _regenerator.default.wrap(function _callee53$(_context53) {
  10932. while (1) {
  10933. switch (_context53.prev = _context53.next) {
  10934. case 0:
  10935. return _context53.abrupt("return", this.init());
  10936. case 1:
  10937. case "end":
  10938. return _context53.stop();
  10939. }
  10940. }
  10941. }, _callee53, this);
  10942. }));
  10943. function open() {
  10944. return _open.apply(this, arguments);
  10945. }
  10946. return open;
  10947. }()
  10948. }, {
  10949. key: "_isUniCloudSSE",
  10950. value: function _isUniCloudSSE(e) {
  10951. if ("receive" !== e.type) return !1;
  10952. var t = e && e.data && e.data.payload;
  10953. return !(!t || "UNI_CLOUD_SSE" !== t.channel || t.seqId !== this._seqId);
  10954. }
  10955. }, {
  10956. key: "_receivePushMessage",
  10957. value: function _receivePushMessage(e) {
  10958. if (!this._isUniCloudSSE(e)) return;
  10959. var t = e && e.data && e.data.payload,
  10960. n = t.action,
  10961. s = t.messageId,
  10962. r = t.message;
  10963. this._payloadQueue.push({
  10964. action: n,
  10965. messageId: s,
  10966. message: r
  10967. }), this._consumMessage();
  10968. }
  10969. }, {
  10970. key: "_consumMessage",
  10971. value: function _consumMessage() {
  10972. var _this24 = this;
  10973. for (;;) {
  10974. var _e28 = this._payloadQueue.find(function (e) {
  10975. return e.messageId === _this24._currentMessageId + 1;
  10976. });
  10977. if (!_e28) break;
  10978. this._currentMessageId++, this._parseMessagePayload(_e28);
  10979. }
  10980. }
  10981. }, {
  10982. key: "_parseMessagePayload",
  10983. value: function _parseMessagePayload(e) {
  10984. var t = e.action,
  10985. n = e.messageId,
  10986. s = e.message;
  10987. "end" === t ? this._end({
  10988. messageId: n,
  10989. message: s
  10990. }) : "message" === t && this._appendMessage({
  10991. messageId: n,
  10992. message: s
  10993. });
  10994. }
  10995. }, {
  10996. key: "_appendMessage",
  10997. value: function _appendMessage() {
  10998. var _ref58 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  10999. e = _ref58.messageId,
  11000. t = _ref58.message;
  11001. this.emit("message", t);
  11002. }
  11003. }, {
  11004. key: "_end",
  11005. value: function _end() {
  11006. var _ref59 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  11007. e = _ref59.messageId,
  11008. t = _ref59.message;
  11009. this.emit("end", t), this.close();
  11010. }
  11011. }, {
  11012. key: "_initMessageListener",
  11013. value: function _initMessageListener() {
  11014. uni.onPushMessage(this._uniPushMessageCallback);
  11015. }
  11016. }, {
  11017. key: "_destroy",
  11018. value: function _destroy() {
  11019. uni.offPushMessage(this._uniPushMessageCallback);
  11020. }
  11021. }, {
  11022. key: "toJSON",
  11023. value: function toJSON() {
  11024. return {
  11025. appId: this._appId,
  11026. pushClientId: this._pushClientId,
  11027. seqId: this._seqId
  11028. };
  11029. }
  11030. }, {
  11031. key: "close",
  11032. value: function close() {
  11033. this._destroy(), this.emit("close");
  11034. }
  11035. }]);
  11036. return Es;
  11037. }( /*#__PURE__*/function () {
  11038. function _class6() {
  11039. (0, _classCallCheck2.default)(this, _class6);
  11040. this._callback = {};
  11041. }
  11042. (0, _createClass2.default)(_class6, [{
  11043. key: "addListener",
  11044. value: function addListener(e, t) {
  11045. this._callback[e] || (this._callback[e] = []), this._callback[e].push(t);
  11046. }
  11047. }, {
  11048. key: "on",
  11049. value: function on(e, t) {
  11050. return this.addListener(e, t);
  11051. }
  11052. }, {
  11053. key: "removeListener",
  11054. value: function removeListener(e, t) {
  11055. if (!t) throw new Error('The "listener" argument must be of type function. Received undefined');
  11056. var n = this._callback[e];
  11057. if (!n) return;
  11058. var s = function (e, t) {
  11059. for (var _n15 = e.length - 1; _n15 >= 0; _n15--) {
  11060. if (e[_n15] === t) return _n15;
  11061. }
  11062. return -1;
  11063. }(n, t);
  11064. n.splice(s, 1);
  11065. }
  11066. }, {
  11067. key: "off",
  11068. value: function off(e, t) {
  11069. return this.removeListener(e, t);
  11070. }
  11071. }, {
  11072. key: "removeAllListener",
  11073. value: function removeAllListener(e) {
  11074. delete this._callback[e];
  11075. }
  11076. }, {
  11077. key: "emit",
  11078. value: function emit(e) {
  11079. var n = this._callback[e];
  11080. for (var _len4 = arguments.length, t = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
  11081. t[_key4 - 1] = arguments[_key4];
  11082. }
  11083. if (n) for (var _e29 = 0; _e29 < n.length; _e29++) {
  11084. n[_e29].apply(n, t);
  11085. }
  11086. }
  11087. }]);
  11088. return _class6;
  11089. }());
  11090. function Os(_x38, _x39) {
  11091. return _Os.apply(this, arguments);
  11092. }
  11093. function _Os() {
  11094. _Os = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee57(e, t) {
  11095. var n, _e33, s;
  11096. return _regenerator.default.wrap(function _callee57$(_context57) {
  11097. while (1) {
  11098. switch (_context57.prev = _context57.next) {
  11099. case 0:
  11100. n = "http://".concat(e, ":").concat(t, "/system/ping");
  11101. _context57.prev = 1;
  11102. _context57.next = 4;
  11103. return s = {
  11104. url: n,
  11105. timeout: 500
  11106. }, new Promise(function (e, t) {
  11107. se.request(_objectSpread(_objectSpread({}, s), {}, {
  11108. success: function success(t) {
  11109. e(t);
  11110. },
  11111. fail: function fail(e) {
  11112. t(e);
  11113. }
  11114. }));
  11115. });
  11116. case 4:
  11117. _e33 = _context57.sent;
  11118. return _context57.abrupt("return", !(!_e33.data || 0 !== _e33.data.code));
  11119. case 8:
  11120. _context57.prev = 8;
  11121. _context57.t0 = _context57["catch"](1);
  11122. return _context57.abrupt("return", !1);
  11123. case 11:
  11124. case "end":
  11125. return _context57.stop();
  11126. }
  11127. }
  11128. }, _callee57, null, [[1, 8]]);
  11129. }));
  11130. return _Os.apply(this, arguments);
  11131. }
  11132. function xs(_x40) {
  11133. return _xs.apply(this, arguments);
  11134. }
  11135. function _xs() {
  11136. _xs = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee59(e) {
  11137. var _ce2, _e34, _t20, t, _t$debugInfo, n, s, _yield2, r, i, o;
  11138. return _regenerator.default.wrap(function _callee59$(_context59) {
  11139. while (1) {
  11140. switch (_context59.prev = _context59.next) {
  11141. case 0:
  11142. if (b) {
  11143. _context59.next = 2;
  11144. break;
  11145. }
  11146. return _context59.abrupt("return", Promise.resolve());
  11147. case 2:
  11148. if ("app" === P) {
  11149. _ce2 = ce(), _e34 = _ce2.osName, _t20 = _ce2.osVersion;
  11150. "ios" === _e34 && function (e) {
  11151. if (!e || "string" != typeof e) return 0;
  11152. var t = e.match(/^(\d+)./);
  11153. return t && t[1] ? parseInt(t[1]) : 0;
  11154. }(_t20) >= 14 && console.warn("iOS 14及以上版本连接uniCloud本地调试服务需要允许客户端查找并连接到本地网络上的设备(仅开发模式生效,发行模式会连接uniCloud云端服务)");
  11155. }
  11156. t = e.__dev__;
  11157. if (t.debugInfo) {
  11158. _context59.next = 6;
  11159. break;
  11160. }
  11161. return _context59.abrupt("return");
  11162. case 6:
  11163. _t$debugInfo = t.debugInfo;
  11164. n = _t$debugInfo.address;
  11165. s = _t$debugInfo.servePort;
  11166. _context59.next = 11;
  11167. return function () {
  11168. var _ref66 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee58(e, t) {
  11169. var n, _s15, _r8;
  11170. return _regenerator.default.wrap(function _callee58$(_context58) {
  11171. while (1) {
  11172. switch (_context58.prev = _context58.next) {
  11173. case 0:
  11174. _s15 = 0;
  11175. case 1:
  11176. if (!(_s15 < e.length)) {
  11177. _context58.next = 11;
  11178. break;
  11179. }
  11180. _r8 = e[_s15];
  11181. _context58.next = 5;
  11182. return Os(_r8, t);
  11183. case 5:
  11184. if (!_context58.sent) {
  11185. _context58.next = 8;
  11186. break;
  11187. }
  11188. n = _r8;
  11189. return _context58.abrupt("break", 11);
  11190. case 8:
  11191. _s15++;
  11192. _context58.next = 1;
  11193. break;
  11194. case 11:
  11195. return _context58.abrupt("return", {
  11196. address: n,
  11197. port: t
  11198. });
  11199. case 12:
  11200. case "end":
  11201. return _context58.stop();
  11202. }
  11203. }
  11204. }, _callee58);
  11205. }));
  11206. return function (_x41, _x42) {
  11207. return _ref66.apply(this, arguments);
  11208. };
  11209. }()(n, s);
  11210. case 11:
  11211. _yield2 = _context59.sent;
  11212. r = _yield2.address;
  11213. if (!r) {
  11214. _context59.next = 15;
  11215. break;
  11216. }
  11217. return _context59.abrupt("return", (t.localAddress = r, void (t.localPort = s)));
  11218. case 15:
  11219. i = console["app" === P ? "error" : "warn"];
  11220. o = "";
  11221. if (!("remote" === t.debugInfo.initialLaunchType ? (t.debugInfo.forceRemote = !0, o = "当前客户端和HBuilderX不在同一局域网下(或其他网络原因无法连接HBuilderX),uniCloud本地调试服务不对当前客户端生效。\n- 如果不使用uniCloud本地调试服务,请直接忽略此信息。\n- 如需使用uniCloud本地调试服务,请将客户端与主机连接到同一局域网下并重新运行到客户端。") : o = "无法连接uniCloud本地调试服务,请检查当前客户端是否与主机在同一局域网下。\n- 如需使用uniCloud本地调试服务,请将客户端与主机连接到同一局域网下并重新运行到客户端。", o += "\n- 如果在HBuilderX开启的状态下切换过网络环境,请重启HBuilderX后再试\n- 检查系统防火墙是否拦截了HBuilderX自带的nodejs\n- 检查是否错误的使用拦截器修改uni.request方法的参数", "web" === P && (o += "\n- 部分浏览器开启节流模式之后访问本地地址受限,请检查是否启用了节流模式"), 0 === P.indexOf("mp-") && (o += "\n- 小程序中如何使用uniCloud,请参考:https://uniapp.dcloud.net.cn/uniCloud/publish.html#useinmp"), !t.debugInfo.forceRemote)) {
  11222. _context59.next = 19;
  11223. break;
  11224. }
  11225. throw new Error(o);
  11226. case 19:
  11227. i(o);
  11228. case 20:
  11229. case "end":
  11230. return _context59.stop();
  11231. }
  11232. }
  11233. }, _callee59);
  11234. }));
  11235. return _xs.apply(this, arguments);
  11236. }
  11237. function Rs(e) {
  11238. e._initPromiseHub || (e._initPromiseHub = new I({
  11239. createPromise: function createPromise() {
  11240. var t = Promise.resolve();
  11241. var n;
  11242. n = 1, t = new Promise(function (e) {
  11243. setTimeout(function () {
  11244. e();
  11245. }, n);
  11246. });
  11247. var s = e.auth();
  11248. return t.then(function () {
  11249. return s.getLoginState();
  11250. }).then(function (e) {
  11251. return e ? Promise.resolve() : s.signInAnonymously();
  11252. });
  11253. }
  11254. }));
  11255. }
  11256. var Us = {
  11257. tcb: It,
  11258. tencent: It,
  11259. aliyun: ge,
  11260. private: bt
  11261. };
  11262. var Ls = new ( /*#__PURE__*/function () {
  11263. function _class7() {
  11264. (0, _classCallCheck2.default)(this, _class7);
  11265. }
  11266. (0, _createClass2.default)(_class7, [{
  11267. key: "init",
  11268. value: function init(e) {
  11269. var t = {};
  11270. var n = Us[e.provider];
  11271. if (!n) throw new Error("未提供正确的provider参数");
  11272. t = n.init(e), b && function (e) {
  11273. if (!b) return;
  11274. var t = {};
  11275. e.__dev__ = t, t.debugLog = b && ("web" === P && navigator.userAgent.indexOf("HBuilderX") > 0 || "app" === P);
  11276. var n = A;
  11277. n && !n.code && (t.debugInfo = n);
  11278. var s = new I({
  11279. createPromise: function createPromise() {
  11280. return xs(e);
  11281. }
  11282. });
  11283. t.initLocalNetwork = function () {
  11284. return s.exec();
  11285. };
  11286. }(t), Rs(t), xn(t), function (e) {
  11287. var t = e.uploadFile;
  11288. e.uploadFile = function (e) {
  11289. return t.call(this, e);
  11290. };
  11291. }(t), function (e) {
  11292. e.database = function (t) {
  11293. if (t && Object.keys(t).length > 0) return e.init(t).database();
  11294. if (this._database) return this._database;
  11295. var n = Bn($n, {
  11296. uniClient: e
  11297. });
  11298. return this._database = n, n;
  11299. }, e.databaseForJQL = function (t) {
  11300. if (t && Object.keys(t).length > 0) return e.init(t).databaseForJQL();
  11301. if (this._databaseForJQL) return this._databaseForJQL;
  11302. var n = Bn($n, {
  11303. uniClient: e,
  11304. isJQL: !0
  11305. });
  11306. return this._databaseForJQL = n, n;
  11307. };
  11308. }(t), function (e) {
  11309. e.getCurrentUserInfo = _s, e.chooseAndUploadFile = vs.initChooseAndUploadFile(e), Object.assign(e, {
  11310. get mixinDatacom() {
  11311. return Ss(e);
  11312. }
  11313. }), e.SSEChannel = Es, e.initSecureNetworkByWeixin = Ps(e), e.importObject = bs(e);
  11314. }(t);
  11315. return ["callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "chooseAndUploadFile"].forEach(function (e) {
  11316. if (!t[e]) return;
  11317. var n = t[e];
  11318. t[e] = function () {
  11319. return n.apply(t, Array.from(arguments));
  11320. }, t[e] = function (e, t) {
  11321. return function (n) {
  11322. var _this25 = this;
  11323. var s = !1;
  11324. if ("callFunction" === t) {
  11325. var _e30 = n && n.type || u;
  11326. s = _e30 !== u;
  11327. }
  11328. var r = "callFunction" === t && !s,
  11329. i = this._initPromiseHub.exec();
  11330. n = n || {};
  11331. var _te2 = te(n),
  11332. o = _te2.success,
  11333. a = _te2.fail,
  11334. c = _te2.complete,
  11335. h = i.then(function () {
  11336. return s ? Promise.resolve() : q(M(t, "invoke"), n);
  11337. }).then(function () {
  11338. return e.call(_this25, n);
  11339. }).then(function (e) {
  11340. return s ? Promise.resolve(e) : q(M(t, "success"), e).then(function () {
  11341. return q(M(t, "complete"), e);
  11342. }).then(function () {
  11343. return r && Q(B, {
  11344. type: J,
  11345. content: e
  11346. }), Promise.resolve(e);
  11347. });
  11348. }, function (e) {
  11349. return s ? Promise.reject(e) : q(M(t, "fail"), e).then(function () {
  11350. return q(M(t, "complete"), e);
  11351. }).then(function () {
  11352. return Q(B, {
  11353. type: J,
  11354. content: e
  11355. }), Promise.reject(e);
  11356. });
  11357. });
  11358. if (!(o || a || c)) return h;
  11359. h.then(function (e) {
  11360. o && o(e), c && c(e), r && Q(B, {
  11361. type: J,
  11362. content: e
  11363. });
  11364. }, function (e) {
  11365. a && a(e), c && c(e), r && Q(B, {
  11366. type: J,
  11367. content: e
  11368. });
  11369. });
  11370. };
  11371. }(t[e], e).bind(t);
  11372. }), t.init = this.init, t;
  11373. }
  11374. }]);
  11375. return _class7;
  11376. }())();
  11377. (function () {
  11378. var e = E;
  11379. var t = {};
  11380. if (e && 1 === e.length) t = e[0], Ls = Ls.init(t), Ls._isDefault = !0;else {
  11381. var _t19 = ["auth", "callFunction", "uploadFile", "deleteFile", "getTempFileURL", "downloadFile", "database", "getCurrentUSerInfo", "importObject"];
  11382. var _n16;
  11383. _n16 = e && e.length > 0 ? "应用有多个服务空间,请通过uniCloud.init方法指定要使用的服务空间" : O ? "应用未关联服务空间,请在uniCloud目录右键关联服务空间" : "uni-app cli项目内使用uniCloud需要使用HBuilderX的运行菜单运行项目,且需要在uniCloud目录关联服务空间", _t19.forEach(function (e) {
  11384. Ls[e] = function () {
  11385. return console.error(_n16), Promise.reject(new ne({
  11386. code: "SYS_ERR",
  11387. message: _n16
  11388. }));
  11389. };
  11390. });
  11391. }
  11392. Object.assign(Ls, {
  11393. get mixinDatacom() {
  11394. return Ss(Ls);
  11395. }
  11396. }), fs(Ls), Ls.addInterceptor = D, Ls.removeInterceptor = F, Ls.interceptObject = K, b && "web" === P && (window.uniCloud = Ls);
  11397. })();
  11398. var Ns = Ls;
  11399. exports.default = Ns;
  11400. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3), __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"], __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"]))
  11401. /***/ }),
  11402. /***/ 213:
  11403. /*!****************************************************************!*\
  11404. !*** ./node_modules/@babel/runtime/helpers/wrapNativeSuper.js ***!
  11405. \****************************************************************/
  11406. /*! no static exports found */
  11407. /***/ (function(module, exports, __webpack_require__) {
  11408. var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf.js */ 175);
  11409. var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ 16);
  11410. var isNativeFunction = __webpack_require__(/*! ./isNativeFunction.js */ 214);
  11411. var construct = __webpack_require__(/*! ./construct.js */ 15);
  11412. function _wrapNativeSuper(Class) {
  11413. var _cache = typeof Map === "function" ? new Map() : undefined;
  11414. module.exports = _wrapNativeSuper = function _wrapNativeSuper(Class) {
  11415. if (Class === null || !isNativeFunction(Class)) return Class;
  11416. if (typeof Class !== "function") {
  11417. throw new TypeError("Super expression must either be null or a function");
  11418. }
  11419. if (typeof _cache !== "undefined") {
  11420. if (_cache.has(Class)) return _cache.get(Class);
  11421. _cache.set(Class, Wrapper);
  11422. }
  11423. function Wrapper() {
  11424. return construct(Class, arguments, getPrototypeOf(this).constructor);
  11425. }
  11426. Wrapper.prototype = Object.create(Class.prototype, {
  11427. constructor: {
  11428. value: Wrapper,
  11429. enumerable: false,
  11430. writable: true,
  11431. configurable: true
  11432. }
  11433. });
  11434. return setPrototypeOf(Wrapper, Class);
  11435. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  11436. return _wrapNativeSuper(Class);
  11437. }
  11438. module.exports = _wrapNativeSuper, module.exports.__esModule = true, module.exports["default"] = module.exports;
  11439. /***/ }),
  11440. /***/ 214:
  11441. /*!*****************************************************************!*\
  11442. !*** ./node_modules/@babel/runtime/helpers/isNativeFunction.js ***!
  11443. \*****************************************************************/
  11444. /*! no static exports found */
  11445. /***/ (function(module, exports) {
  11446. function _isNativeFunction(fn) {
  11447. return Function.toString.call(fn).indexOf("[native code]") !== -1;
  11448. }
  11449. module.exports = _isNativeFunction, module.exports.__esModule = true, module.exports["default"] = module.exports;
  11450. /***/ }),
  11451. /***/ 215:
  11452. /*!***************************************************************************************!*\
  11453. !*** E:/work/Project_newGit/hptwxMiniProgram/pages.json?{"type":"origin-pages-json"} ***!
  11454. \***************************************************************************************/
  11455. /*! no static exports found */
  11456. /***/ (function(module, exports, __webpack_require__) {
  11457. "use strict";
  11458. Object.defineProperty(exports, "__esModule", {
  11459. value: true
  11460. });
  11461. exports.default = void 0;
  11462. var _default = {
  11463. "pages": [{
  11464. "path": "pages/index/index",
  11465. "style": {
  11466. "navigationBarTitleText": "首页"
  11467. }
  11468. }, {
  11469. "path": "pages/history/history",
  11470. "style": {
  11471. "navigationBarTitleText": "操作记录",
  11472. "enablePullDownRefresh": true
  11473. }
  11474. }, {
  11475. "path": "pages/history/detail/detail",
  11476. "style": {
  11477. "navigationBarTitleText": "操作记录详情"
  11478. }
  11479. }, {
  11480. "path": "pages/myCenter/myCenter",
  11481. "style": {
  11482. "navigationBarTitleText": "我的",
  11483. "enablePullDownRefresh": false
  11484. }
  11485. }, {
  11486. "path": "pages/login/index",
  11487. "style": {
  11488. "navigationBarTitleText": "登录"
  11489. }
  11490. }, {
  11491. "path": "pages/authorizedLogin/index",
  11492. "style": {
  11493. "navigationBarTitleText": "授权登录"
  11494. }
  11495. }, {
  11496. "path": "pages/service_agreement/service_agreement",
  11497. "style": {
  11498. "navigationBarTitleText": "隐私协议"
  11499. }
  11500. }, {
  11501. "path": "pages/app_views/satisfaction_evaluation/satisfaction_evaluation",
  11502. "style": {
  11503. "navigationBarTitleText": "满意度评价",
  11504. "enablePullDownRefresh": false
  11505. }
  11506. }, {
  11507. "path": "pages/app_views/safe_checked/safe_checked",
  11508. "style": {
  11509. "navigationBarTitleText": "安全巡检",
  11510. "enablePullDownRefresh": false
  11511. }
  11512. }, {
  11513. "path": "pages/app_views/danger/submit/submit",
  11514. "style": {
  11515. "navigationBarTitleText": "登记隐患",
  11516. "enablePullDownRefresh": false
  11517. }
  11518. }, {
  11519. "path": "pages/app_views/equipment_maintenance/equipment_maintenance",
  11520. "style": {
  11521. "navigationBarTitleText": "设备保养",
  11522. "enablePullDownRefresh": false
  11523. }
  11524. }, {
  11525. "path": "pages/app_views/problem_feedback/problem_feedback",
  11526. "style": {
  11527. "navigationBarTitleText": "问题反馈",
  11528. "enablePullDownRefresh": false
  11529. }
  11530. }, {
  11531. "path": "pages/app_views/danger/handle/handle",
  11532. "style": {
  11533. "navigationBarTitleText": "隐患处理",
  11534. "enablePullDownRefresh": false
  11535. }
  11536. }, {
  11537. "path": "pages/app_views/checkList/index/index",
  11538. "style": {
  11539. "navigationBarTitleText": "清单",
  11540. "enablePullDownRefresh": false
  11541. }
  11542. }, {
  11543. "path": "pages/app_views/checkList/from/from",
  11544. "style": {
  11545. "navigationBarTitleText": "风险点巡检",
  11546. "enablePullDownRefresh": false
  11547. }
  11548. }],
  11549. "tabBar": {
  11550. "color": "#7A7E83",
  11551. "selectedColor": "#1296db",
  11552. "borderStyle": "black",
  11553. "backgroundColor": "#ffffff",
  11554. "list": [{
  11555. "pagePath": "pages/index/index",
  11556. "iconPath": "static/tabbar/index.png",
  11557. "selectedIconPath": "static/tabbar/indexEd.png",
  11558. "text": "首页"
  11559. }, {
  11560. "pagePath": "pages/history/history",
  11561. "iconPath": "static/tabbar/history.png",
  11562. "selectedIconPath": "static/tabbar/historyEd.png",
  11563. "text": "历史"
  11564. }, {
  11565. "pagePath": "pages/myCenter/myCenter",
  11566. "iconPath": "static/tabbar/myCenter.png",
  11567. "selectedIconPath": "static/tabbar/myCenterEd.png",
  11568. "text": "我的"
  11569. }]
  11570. },
  11571. "globalStyle": {
  11572. "navigationBarTextStyle": "black",
  11573. "navigationBarTitleText": "uni-app",
  11574. "navigationBarBackgroundColor": "#F8F8F8",
  11575. "backgroundColor": "#F8F8F8"
  11576. },
  11577. "uniIdRouter": {}
  11578. };
  11579. exports.default = _default;
  11580. /***/ }),
  11581. /***/ 216:
  11582. /*!**************************************************************************!*\
  11583. !*** E:/work/Project_newGit/hptwxMiniProgram/pages.json?{"type":"stat"} ***!
  11584. \**************************************************************************/
  11585. /*! no static exports found */
  11586. /***/ (function(module, exports, __webpack_require__) {
  11587. "use strict";
  11588. Object.defineProperty(exports, "__esModule", {
  11589. value: true
  11590. });
  11591. exports.default = void 0;
  11592. var _default = {
  11593. "appid": "__UNI__2E20170"
  11594. };
  11595. exports.default = _default;
  11596. /***/ }),
  11597. /***/ 22:
  11598. /*!*************************************************************!*\
  11599. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  11600. \*************************************************************/
  11601. /*! no static exports found */
  11602. /***/ (function(module, exports, __webpack_require__) {
  11603. "use strict";
  11604. /* WEBPACK VAR INJECTION */(function(uni, global) {
  11605. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  11606. Object.defineProperty(exports, "__esModule", {
  11607. value: true
  11608. });
  11609. exports.LOCALE_ZH_HANT = exports.LOCALE_ZH_HANS = exports.LOCALE_FR = exports.LOCALE_ES = exports.LOCALE_EN = exports.I18n = exports.Formatter = void 0;
  11610. exports.compileI18nJsonStr = compileI18nJsonStr;
  11611. exports.hasI18nJson = hasI18nJson;
  11612. exports.initVueI18n = initVueI18n;
  11613. exports.isI18nStr = isI18nStr;
  11614. exports.isString = void 0;
  11615. exports.normalizeLocale = normalizeLocale;
  11616. exports.parseI18nJson = parseI18nJson;
  11617. exports.resolveLocale = resolveLocale;
  11618. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ 5));
  11619. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  11620. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  11621. var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ 13));
  11622. var isObject = function isObject(val) {
  11623. return val !== null && (0, _typeof2.default)(val) === 'object';
  11624. };
  11625. var defaultDelimiters = ['{', '}'];
  11626. var BaseFormatter = /*#__PURE__*/function () {
  11627. function BaseFormatter() {
  11628. (0, _classCallCheck2.default)(this, BaseFormatter);
  11629. this._caches = Object.create(null);
  11630. }
  11631. (0, _createClass2.default)(BaseFormatter, [{
  11632. key: "interpolate",
  11633. value: function interpolate(message, values) {
  11634. var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  11635. if (!values) {
  11636. return [message];
  11637. }
  11638. var tokens = this._caches[message];
  11639. if (!tokens) {
  11640. tokens = parse(message, delimiters);
  11641. this._caches[message] = tokens;
  11642. }
  11643. return compile(tokens, values);
  11644. }
  11645. }]);
  11646. return BaseFormatter;
  11647. }();
  11648. exports.Formatter = BaseFormatter;
  11649. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  11650. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  11651. function parse(format, _ref) {
  11652. var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
  11653. startDelimiter = _ref2[0],
  11654. endDelimiter = _ref2[1];
  11655. var tokens = [];
  11656. var position = 0;
  11657. var text = '';
  11658. while (position < format.length) {
  11659. var char = format[position++];
  11660. if (char === startDelimiter) {
  11661. if (text) {
  11662. tokens.push({
  11663. type: 'text',
  11664. value: text
  11665. });
  11666. }
  11667. text = '';
  11668. var sub = '';
  11669. char = format[position++];
  11670. while (char !== undefined && char !== endDelimiter) {
  11671. sub += char;
  11672. char = format[position++];
  11673. }
  11674. var isClosed = char === endDelimiter;
  11675. var type = RE_TOKEN_LIST_VALUE.test(sub) ? 'list' : isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ? 'named' : 'unknown';
  11676. tokens.push({
  11677. value: sub,
  11678. type: type
  11679. });
  11680. }
  11681. // else if (char === '%') {
  11682. // // when found rails i18n syntax, skip text capture
  11683. // if (format[position] !== '{') {
  11684. // text += char
  11685. // }
  11686. // }
  11687. else {
  11688. text += char;
  11689. }
  11690. }
  11691. text && tokens.push({
  11692. type: 'text',
  11693. value: text
  11694. });
  11695. return tokens;
  11696. }
  11697. function compile(tokens, values) {
  11698. var compiled = [];
  11699. var index = 0;
  11700. var mode = Array.isArray(values) ? 'list' : isObject(values) ? 'named' : 'unknown';
  11701. if (mode === 'unknown') {
  11702. return compiled;
  11703. }
  11704. while (index < tokens.length) {
  11705. var token = tokens[index];
  11706. switch (token.type) {
  11707. case 'text':
  11708. compiled.push(token.value);
  11709. break;
  11710. case 'list':
  11711. compiled.push(values[parseInt(token.value, 10)]);
  11712. break;
  11713. case 'named':
  11714. if (mode === 'named') {
  11715. compiled.push(values[token.value]);
  11716. } else {
  11717. if (true) {
  11718. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  11719. }
  11720. }
  11721. break;
  11722. case 'unknown':
  11723. if (true) {
  11724. console.warn("Detect 'unknown' type of token!");
  11725. }
  11726. break;
  11727. }
  11728. index++;
  11729. }
  11730. return compiled;
  11731. }
  11732. var LOCALE_ZH_HANS = 'zh-Hans';
  11733. exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  11734. var LOCALE_ZH_HANT = 'zh-Hant';
  11735. exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  11736. var LOCALE_EN = 'en';
  11737. exports.LOCALE_EN = LOCALE_EN;
  11738. var LOCALE_FR = 'fr';
  11739. exports.LOCALE_FR = LOCALE_FR;
  11740. var LOCALE_ES = 'es';
  11741. exports.LOCALE_ES = LOCALE_ES;
  11742. var hasOwnProperty = Object.prototype.hasOwnProperty;
  11743. var hasOwn = function hasOwn(val, key) {
  11744. return hasOwnProperty.call(val, key);
  11745. };
  11746. var defaultFormatter = new BaseFormatter();
  11747. function include(str, parts) {
  11748. return !!parts.find(function (part) {
  11749. return str.indexOf(part) !== -1;
  11750. });
  11751. }
  11752. function startsWith(str, parts) {
  11753. return parts.find(function (part) {
  11754. return str.indexOf(part) === 0;
  11755. });
  11756. }
  11757. function normalizeLocale(locale, messages) {
  11758. if (!locale) {
  11759. return;
  11760. }
  11761. locale = locale.trim().replace(/_/g, '-');
  11762. if (messages && messages[locale]) {
  11763. return locale;
  11764. }
  11765. locale = locale.toLowerCase();
  11766. if (locale === 'chinese') {
  11767. // 支付宝
  11768. return LOCALE_ZH_HANS;
  11769. }
  11770. if (locale.indexOf('zh') === 0) {
  11771. if (locale.indexOf('-hans') > -1) {
  11772. return LOCALE_ZH_HANS;
  11773. }
  11774. if (locale.indexOf('-hant') > -1) {
  11775. return LOCALE_ZH_HANT;
  11776. }
  11777. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  11778. return LOCALE_ZH_HANT;
  11779. }
  11780. return LOCALE_ZH_HANS;
  11781. }
  11782. var locales = [LOCALE_EN, LOCALE_FR, LOCALE_ES];
  11783. if (messages && Object.keys(messages).length > 0) {
  11784. locales = Object.keys(messages);
  11785. }
  11786. var lang = startsWith(locale, locales);
  11787. if (lang) {
  11788. return lang;
  11789. }
  11790. }
  11791. var I18n = /*#__PURE__*/function () {
  11792. function I18n(_ref3) {
  11793. var locale = _ref3.locale,
  11794. fallbackLocale = _ref3.fallbackLocale,
  11795. messages = _ref3.messages,
  11796. watcher = _ref3.watcher,
  11797. formater = _ref3.formater;
  11798. (0, _classCallCheck2.default)(this, I18n);
  11799. this.locale = LOCALE_EN;
  11800. this.fallbackLocale = LOCALE_EN;
  11801. this.message = {};
  11802. this.messages = {};
  11803. this.watchers = [];
  11804. if (fallbackLocale) {
  11805. this.fallbackLocale = fallbackLocale;
  11806. }
  11807. this.formater = formater || defaultFormatter;
  11808. this.messages = messages || {};
  11809. this.setLocale(locale || LOCALE_EN);
  11810. if (watcher) {
  11811. this.watchLocale(watcher);
  11812. }
  11813. }
  11814. (0, _createClass2.default)(I18n, [{
  11815. key: "setLocale",
  11816. value: function setLocale(locale) {
  11817. var _this = this;
  11818. var oldLocale = this.locale;
  11819. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  11820. if (!this.messages[this.locale]) {
  11821. // 可能初始化时不存在
  11822. this.messages[this.locale] = {};
  11823. }
  11824. this.message = this.messages[this.locale];
  11825. // 仅发生变化时,通知
  11826. if (oldLocale !== this.locale) {
  11827. this.watchers.forEach(function (watcher) {
  11828. watcher(_this.locale, oldLocale);
  11829. });
  11830. }
  11831. }
  11832. }, {
  11833. key: "getLocale",
  11834. value: function getLocale() {
  11835. return this.locale;
  11836. }
  11837. }, {
  11838. key: "watchLocale",
  11839. value: function watchLocale(fn) {
  11840. var _this2 = this;
  11841. var index = this.watchers.push(fn) - 1;
  11842. return function () {
  11843. _this2.watchers.splice(index, 1);
  11844. };
  11845. }
  11846. }, {
  11847. key: "add",
  11848. value: function add(locale, message) {
  11849. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  11850. var curMessages = this.messages[locale];
  11851. if (curMessages) {
  11852. if (override) {
  11853. Object.assign(curMessages, message);
  11854. } else {
  11855. Object.keys(message).forEach(function (key) {
  11856. if (!hasOwn(curMessages, key)) {
  11857. curMessages[key] = message[key];
  11858. }
  11859. });
  11860. }
  11861. } else {
  11862. this.messages[locale] = message;
  11863. }
  11864. }
  11865. }, {
  11866. key: "f",
  11867. value: function f(message, values, delimiters) {
  11868. return this.formater.interpolate(message, values, delimiters).join('');
  11869. }
  11870. }, {
  11871. key: "t",
  11872. value: function t(key, locale, values) {
  11873. var message = this.message;
  11874. if (typeof locale === 'string') {
  11875. locale = normalizeLocale(locale, this.messages);
  11876. locale && (message = this.messages[locale]);
  11877. } else {
  11878. values = locale;
  11879. }
  11880. if (!hasOwn(message, key)) {
  11881. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  11882. return key;
  11883. }
  11884. return this.formater.interpolate(message[key], values).join('');
  11885. }
  11886. }]);
  11887. return I18n;
  11888. }();
  11889. exports.I18n = I18n;
  11890. function watchAppLocale(appVm, i18n) {
  11891. // 需要保证 watch 的触发在组件渲染之前
  11892. if (appVm.$watchLocale) {
  11893. // vue2
  11894. appVm.$watchLocale(function (newLocale) {
  11895. i18n.setLocale(newLocale);
  11896. });
  11897. } else {
  11898. appVm.$watch(function () {
  11899. return appVm.$locale;
  11900. }, function (newLocale) {
  11901. i18n.setLocale(newLocale);
  11902. });
  11903. }
  11904. }
  11905. function getDefaultLocale() {
  11906. if (typeof uni !== 'undefined' && uni.getLocale) {
  11907. return uni.getLocale();
  11908. }
  11909. // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
  11910. if (typeof global !== 'undefined' && global.getLocale) {
  11911. return global.getLocale();
  11912. }
  11913. return LOCALE_EN;
  11914. }
  11915. function initVueI18n(locale) {
  11916. var messages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  11917. var fallbackLocale = arguments.length > 2 ? arguments[2] : undefined;
  11918. var watcher = arguments.length > 3 ? arguments[3] : undefined;
  11919. // 兼容旧版本入参
  11920. if (typeof locale !== 'string') {
  11921. var _ref4 = [messages, locale];
  11922. locale = _ref4[0];
  11923. messages = _ref4[1];
  11924. }
  11925. if (typeof locale !== 'string') {
  11926. // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
  11927. locale = getDefaultLocale();
  11928. }
  11929. if (typeof fallbackLocale !== 'string') {
  11930. fallbackLocale = typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale || LOCALE_EN;
  11931. }
  11932. var i18n = new I18n({
  11933. locale: locale,
  11934. fallbackLocale: fallbackLocale,
  11935. messages: messages,
  11936. watcher: watcher
  11937. });
  11938. var _t = function t(key, values) {
  11939. if (typeof getApp !== 'function') {
  11940. // app view
  11941. /* eslint-disable no-func-assign */
  11942. _t = function t(key, values) {
  11943. return i18n.t(key, values);
  11944. };
  11945. } else {
  11946. var isWatchedAppLocale = false;
  11947. _t = function t(key, values) {
  11948. var appVm = getApp().$vm;
  11949. // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
  11950. // options: {
  11951. // type: Array,
  11952. // default () {
  11953. // return [{
  11954. // icon: 'shop',
  11955. // text: t("uni-goods-nav.options.shop"),
  11956. // }, {
  11957. // icon: 'cart',
  11958. // text: t("uni-goods-nav.options.cart")
  11959. // }]
  11960. // }
  11961. // },
  11962. if (appVm) {
  11963. // 触发响应式
  11964. appVm.$locale;
  11965. if (!isWatchedAppLocale) {
  11966. isWatchedAppLocale = true;
  11967. watchAppLocale(appVm, i18n);
  11968. }
  11969. }
  11970. return i18n.t(key, values);
  11971. };
  11972. }
  11973. return _t(key, values);
  11974. };
  11975. return {
  11976. i18n: i18n,
  11977. f: function f(message, values, delimiters) {
  11978. return i18n.f(message, values, delimiters);
  11979. },
  11980. t: function t(key, values) {
  11981. return _t(key, values);
  11982. },
  11983. add: function add(locale, message) {
  11984. var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  11985. return i18n.add(locale, message, override);
  11986. },
  11987. watch: function watch(fn) {
  11988. return i18n.watchLocale(fn);
  11989. },
  11990. getLocale: function getLocale() {
  11991. return i18n.getLocale();
  11992. },
  11993. setLocale: function setLocale(newLocale) {
  11994. return i18n.setLocale(newLocale);
  11995. }
  11996. };
  11997. }
  11998. var isString = function isString(val) {
  11999. return typeof val === 'string';
  12000. };
  12001. exports.isString = isString;
  12002. var formater;
  12003. function hasI18nJson(jsonObj, delimiters) {
  12004. if (!formater) {
  12005. formater = new BaseFormatter();
  12006. }
  12007. return walkJsonObj(jsonObj, function (jsonObj, key) {
  12008. var value = jsonObj[key];
  12009. if (isString(value)) {
  12010. if (isI18nStr(value, delimiters)) {
  12011. return true;
  12012. }
  12013. } else {
  12014. return hasI18nJson(value, delimiters);
  12015. }
  12016. });
  12017. }
  12018. function parseI18nJson(jsonObj, values, delimiters) {
  12019. if (!formater) {
  12020. formater = new BaseFormatter();
  12021. }
  12022. walkJsonObj(jsonObj, function (jsonObj, key) {
  12023. var value = jsonObj[key];
  12024. if (isString(value)) {
  12025. if (isI18nStr(value, delimiters)) {
  12026. jsonObj[key] = compileStr(value, values, delimiters);
  12027. }
  12028. } else {
  12029. parseI18nJson(value, values, delimiters);
  12030. }
  12031. });
  12032. return jsonObj;
  12033. }
  12034. function compileI18nJsonStr(jsonStr, _ref5) {
  12035. var locale = _ref5.locale,
  12036. locales = _ref5.locales,
  12037. delimiters = _ref5.delimiters;
  12038. if (!isI18nStr(jsonStr, delimiters)) {
  12039. return jsonStr;
  12040. }
  12041. if (!formater) {
  12042. formater = new BaseFormatter();
  12043. }
  12044. var localeValues = [];
  12045. Object.keys(locales).forEach(function (name) {
  12046. if (name !== locale) {
  12047. localeValues.push({
  12048. locale: name,
  12049. values: locales[name]
  12050. });
  12051. }
  12052. });
  12053. localeValues.unshift({
  12054. locale: locale,
  12055. values: locales[locale]
  12056. });
  12057. try {
  12058. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  12059. } catch (e) {}
  12060. return jsonStr;
  12061. }
  12062. function isI18nStr(value, delimiters) {
  12063. return value.indexOf(delimiters[0]) > -1;
  12064. }
  12065. function compileStr(value, values, delimiters) {
  12066. return formater.interpolate(value, values, delimiters).join('');
  12067. }
  12068. function compileValue(jsonObj, key, localeValues, delimiters) {
  12069. var value = jsonObj[key];
  12070. if (isString(value)) {
  12071. // 存在国际化
  12072. if (isI18nStr(value, delimiters)) {
  12073. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  12074. if (localeValues.length > 1) {
  12075. // 格式化国际化语言
  12076. var valueLocales = jsonObj[key + 'Locales'] = {};
  12077. localeValues.forEach(function (localValue) {
  12078. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  12079. });
  12080. }
  12081. }
  12082. } else {
  12083. compileJsonObj(value, localeValues, delimiters);
  12084. }
  12085. }
  12086. function compileJsonObj(jsonObj, localeValues, delimiters) {
  12087. walkJsonObj(jsonObj, function (jsonObj, key) {
  12088. compileValue(jsonObj, key, localeValues, delimiters);
  12089. });
  12090. return jsonObj;
  12091. }
  12092. function walkJsonObj(jsonObj, walk) {
  12093. if (Array.isArray(jsonObj)) {
  12094. for (var i = 0; i < jsonObj.length; i++) {
  12095. if (walk(jsonObj, i)) {
  12096. return true;
  12097. }
  12098. }
  12099. } else if (isObject(jsonObj)) {
  12100. for (var key in jsonObj) {
  12101. if (walk(jsonObj, key)) {
  12102. return true;
  12103. }
  12104. }
  12105. }
  12106. return false;
  12107. }
  12108. function resolveLocale(locales) {
  12109. return function (locale) {
  12110. if (!locale) {
  12111. return locale;
  12112. }
  12113. locale = normalizeLocale(locale) || locale;
  12114. return resolveLocaleChain(locale).find(function (locale) {
  12115. return locales.indexOf(locale) > -1;
  12116. });
  12117. };
  12118. }
  12119. function resolveLocaleChain(locale) {
  12120. var chain = [];
  12121. var tokens = locale.split('-');
  12122. while (tokens.length) {
  12123. chain.push(tokens.join('-'));
  12124. tokens.pop();
  12125. }
  12126. return chain;
  12127. }
  12128. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"], __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 3)))
  12129. /***/ }),
  12130. /***/ 23:
  12131. /*!***************************************************************!*\
  12132. !*** ./node_modules/@babel/runtime/helpers/classCallCheck.js ***!
  12133. \***************************************************************/
  12134. /*! no static exports found */
  12135. /***/ (function(module, exports) {
  12136. function _classCallCheck(instance, Constructor) {
  12137. if (!(instance instanceof Constructor)) {
  12138. throw new TypeError("Cannot call a class as a function");
  12139. }
  12140. }
  12141. module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
  12142. /***/ }),
  12143. /***/ 24:
  12144. /*!************************************************************!*\
  12145. !*** ./node_modules/@babel/runtime/helpers/createClass.js ***!
  12146. \************************************************************/
  12147. /*! no static exports found */
  12148. /***/ (function(module, exports, __webpack_require__) {
  12149. var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ 12);
  12150. function _defineProperties(target, props) {
  12151. for (var i = 0; i < props.length; i++) {
  12152. var descriptor = props[i];
  12153. descriptor.enumerable = descriptor.enumerable || false;
  12154. descriptor.configurable = true;
  12155. if ("value" in descriptor) descriptor.writable = true;
  12156. Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
  12157. }
  12158. }
  12159. function _createClass(Constructor, protoProps, staticProps) {
  12160. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  12161. if (staticProps) _defineProperties(Constructor, staticProps);
  12162. Object.defineProperty(Constructor, "prototype", {
  12163. writable: false
  12164. });
  12165. return Constructor;
  12166. }
  12167. module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
  12168. /***/ }),
  12169. /***/ 25:
  12170. /*!******************************************************************************************!*\
  12171. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  12172. \******************************************************************************************/
  12173. /*! exports provided: default */
  12174. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12175. "use strict";
  12176. __webpack_require__.r(__webpack_exports__);
  12177. /* WEBPACK VAR INJECTION */(function(global) {/*!
  12178. * Vue.js v2.6.11
  12179. * (c) 2014-2023 Evan You
  12180. * Released under the MIT License.
  12181. */
  12182. /* */
  12183. var emptyObject = Object.freeze({});
  12184. // These helpers produce better VM code in JS engines due to their
  12185. // explicitness and function inlining.
  12186. function isUndef (v) {
  12187. return v === undefined || v === null
  12188. }
  12189. function isDef (v) {
  12190. return v !== undefined && v !== null
  12191. }
  12192. function isTrue (v) {
  12193. return v === true
  12194. }
  12195. function isFalse (v) {
  12196. return v === false
  12197. }
  12198. /**
  12199. * Check if value is primitive.
  12200. */
  12201. function isPrimitive (value) {
  12202. return (
  12203. typeof value === 'string' ||
  12204. typeof value === 'number' ||
  12205. // $flow-disable-line
  12206. typeof value === 'symbol' ||
  12207. typeof value === 'boolean'
  12208. )
  12209. }
  12210. /**
  12211. * Quick object check - this is primarily used to tell
  12212. * Objects from primitive values when we know the value
  12213. * is a JSON-compliant type.
  12214. */
  12215. function isObject (obj) {
  12216. return obj !== null && typeof obj === 'object'
  12217. }
  12218. /**
  12219. * Get the raw type string of a value, e.g., [object Object].
  12220. */
  12221. var _toString = Object.prototype.toString;
  12222. function toRawType (value) {
  12223. return _toString.call(value).slice(8, -1)
  12224. }
  12225. /**
  12226. * Strict object type check. Only returns true
  12227. * for plain JavaScript objects.
  12228. */
  12229. function isPlainObject (obj) {
  12230. return _toString.call(obj) === '[object Object]'
  12231. }
  12232. function isRegExp (v) {
  12233. return _toString.call(v) === '[object RegExp]'
  12234. }
  12235. /**
  12236. * Check if val is a valid array index.
  12237. */
  12238. function isValidArrayIndex (val) {
  12239. var n = parseFloat(String(val));
  12240. return n >= 0 && Math.floor(n) === n && isFinite(val)
  12241. }
  12242. function isPromise (val) {
  12243. return (
  12244. isDef(val) &&
  12245. typeof val.then === 'function' &&
  12246. typeof val.catch === 'function'
  12247. )
  12248. }
  12249. /**
  12250. * Convert a value to a string that is actually rendered.
  12251. */
  12252. function toString (val) {
  12253. return val == null
  12254. ? ''
  12255. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  12256. ? JSON.stringify(val, null, 2)
  12257. : String(val)
  12258. }
  12259. /**
  12260. * Convert an input value to a number for persistence.
  12261. * If the conversion fails, return original string.
  12262. */
  12263. function toNumber (val) {
  12264. var n = parseFloat(val);
  12265. return isNaN(n) ? val : n
  12266. }
  12267. /**
  12268. * Make a map and return a function for checking if a key
  12269. * is in that map.
  12270. */
  12271. function makeMap (
  12272. str,
  12273. expectsLowerCase
  12274. ) {
  12275. var map = Object.create(null);
  12276. var list = str.split(',');
  12277. for (var i = 0; i < list.length; i++) {
  12278. map[list[i]] = true;
  12279. }
  12280. return expectsLowerCase
  12281. ? function (val) { return map[val.toLowerCase()]; }
  12282. : function (val) { return map[val]; }
  12283. }
  12284. /**
  12285. * Check if a tag is a built-in tag.
  12286. */
  12287. var isBuiltInTag = makeMap('slot,component', true);
  12288. /**
  12289. * Check if an attribute is a reserved attribute.
  12290. */
  12291. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  12292. /**
  12293. * Remove an item from an array.
  12294. */
  12295. function remove (arr, item) {
  12296. if (arr.length) {
  12297. var index = arr.indexOf(item);
  12298. if (index > -1) {
  12299. return arr.splice(index, 1)
  12300. }
  12301. }
  12302. }
  12303. /**
  12304. * Check whether an object has the property.
  12305. */
  12306. var hasOwnProperty = Object.prototype.hasOwnProperty;
  12307. function hasOwn (obj, key) {
  12308. return hasOwnProperty.call(obj, key)
  12309. }
  12310. /**
  12311. * Create a cached version of a pure function.
  12312. */
  12313. function cached (fn) {
  12314. var cache = Object.create(null);
  12315. return (function cachedFn (str) {
  12316. var hit = cache[str];
  12317. return hit || (cache[str] = fn(str))
  12318. })
  12319. }
  12320. /**
  12321. * Camelize a hyphen-delimited string.
  12322. */
  12323. var camelizeRE = /-(\w)/g;
  12324. var camelize = cached(function (str) {
  12325. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  12326. });
  12327. /**
  12328. * Capitalize a string.
  12329. */
  12330. var capitalize = cached(function (str) {
  12331. return str.charAt(0).toUpperCase() + str.slice(1)
  12332. });
  12333. /**
  12334. * Hyphenate a camelCase string.
  12335. */
  12336. var hyphenateRE = /\B([A-Z])/g;
  12337. var hyphenate = cached(function (str) {
  12338. return str.replace(hyphenateRE, '-$1').toLowerCase()
  12339. });
  12340. /**
  12341. * Simple bind polyfill for environments that do not support it,
  12342. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  12343. * since native bind is now performant enough in most browsers.
  12344. * But removing it would mean breaking code that was able to run in
  12345. * PhantomJS 1.x, so this must be kept for backward compatibility.
  12346. */
  12347. /* istanbul ignore next */
  12348. function polyfillBind (fn, ctx) {
  12349. function boundFn (a) {
  12350. var l = arguments.length;
  12351. return l
  12352. ? l > 1
  12353. ? fn.apply(ctx, arguments)
  12354. : fn.call(ctx, a)
  12355. : fn.call(ctx)
  12356. }
  12357. boundFn._length = fn.length;
  12358. return boundFn
  12359. }
  12360. function nativeBind (fn, ctx) {
  12361. return fn.bind(ctx)
  12362. }
  12363. var bind = Function.prototype.bind
  12364. ? nativeBind
  12365. : polyfillBind;
  12366. /**
  12367. * Convert an Array-like object to a real Array.
  12368. */
  12369. function toArray (list, start) {
  12370. start = start || 0;
  12371. var i = list.length - start;
  12372. var ret = new Array(i);
  12373. while (i--) {
  12374. ret[i] = list[i + start];
  12375. }
  12376. return ret
  12377. }
  12378. /**
  12379. * Mix properties into target object.
  12380. */
  12381. function extend (to, _from) {
  12382. for (var key in _from) {
  12383. to[key] = _from[key];
  12384. }
  12385. return to
  12386. }
  12387. /**
  12388. * Merge an Array of Objects into a single Object.
  12389. */
  12390. function toObject (arr) {
  12391. var res = {};
  12392. for (var i = 0; i < arr.length; i++) {
  12393. if (arr[i]) {
  12394. extend(res, arr[i]);
  12395. }
  12396. }
  12397. return res
  12398. }
  12399. /* eslint-disable no-unused-vars */
  12400. /**
  12401. * Perform no operation.
  12402. * Stubbing args to make Flow happy without leaving useless transpiled code
  12403. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  12404. */
  12405. function noop (a, b, c) {}
  12406. /**
  12407. * Always return false.
  12408. */
  12409. var no = function (a, b, c) { return false; };
  12410. /* eslint-enable no-unused-vars */
  12411. /**
  12412. * Return the same value.
  12413. */
  12414. var identity = function (_) { return _; };
  12415. /**
  12416. * Check if two values are loosely equal - that is,
  12417. * if they are plain objects, do they have the same shape?
  12418. */
  12419. function looseEqual (a, b) {
  12420. if (a === b) { return true }
  12421. var isObjectA = isObject(a);
  12422. var isObjectB = isObject(b);
  12423. if (isObjectA && isObjectB) {
  12424. try {
  12425. var isArrayA = Array.isArray(a);
  12426. var isArrayB = Array.isArray(b);
  12427. if (isArrayA && isArrayB) {
  12428. return a.length === b.length && a.every(function (e, i) {
  12429. return looseEqual(e, b[i])
  12430. })
  12431. } else if (a instanceof Date && b instanceof Date) {
  12432. return a.getTime() === b.getTime()
  12433. } else if (!isArrayA && !isArrayB) {
  12434. var keysA = Object.keys(a);
  12435. var keysB = Object.keys(b);
  12436. return keysA.length === keysB.length && keysA.every(function (key) {
  12437. return looseEqual(a[key], b[key])
  12438. })
  12439. } else {
  12440. /* istanbul ignore next */
  12441. return false
  12442. }
  12443. } catch (e) {
  12444. /* istanbul ignore next */
  12445. return false
  12446. }
  12447. } else if (!isObjectA && !isObjectB) {
  12448. return String(a) === String(b)
  12449. } else {
  12450. return false
  12451. }
  12452. }
  12453. /**
  12454. * Return the first index at which a loosely equal value can be
  12455. * found in the array (if value is a plain object, the array must
  12456. * contain an object of the same shape), or -1 if it is not present.
  12457. */
  12458. function looseIndexOf (arr, val) {
  12459. for (var i = 0; i < arr.length; i++) {
  12460. if (looseEqual(arr[i], val)) { return i }
  12461. }
  12462. return -1
  12463. }
  12464. /**
  12465. * Ensure a function is called only once.
  12466. */
  12467. function once (fn) {
  12468. var called = false;
  12469. return function () {
  12470. if (!called) {
  12471. called = true;
  12472. fn.apply(this, arguments);
  12473. }
  12474. }
  12475. }
  12476. var ASSET_TYPES = [
  12477. 'component',
  12478. 'directive',
  12479. 'filter'
  12480. ];
  12481. var LIFECYCLE_HOOKS = [
  12482. 'beforeCreate',
  12483. 'created',
  12484. 'beforeMount',
  12485. 'mounted',
  12486. 'beforeUpdate',
  12487. 'updated',
  12488. 'beforeDestroy',
  12489. 'destroyed',
  12490. 'activated',
  12491. 'deactivated',
  12492. 'errorCaptured',
  12493. 'serverPrefetch'
  12494. ];
  12495. /* */
  12496. var config = ({
  12497. /**
  12498. * Option merge strategies (used in core/util/options)
  12499. */
  12500. // $flow-disable-line
  12501. optionMergeStrategies: Object.create(null),
  12502. /**
  12503. * Whether to suppress warnings.
  12504. */
  12505. silent: false,
  12506. /**
  12507. * Show production mode tip message on boot?
  12508. */
  12509. productionTip: "development" !== 'production',
  12510. /**
  12511. * Whether to enable devtools
  12512. */
  12513. devtools: "development" !== 'production',
  12514. /**
  12515. * Whether to record perf
  12516. */
  12517. performance: false,
  12518. /**
  12519. * Error handler for watcher errors
  12520. */
  12521. errorHandler: null,
  12522. /**
  12523. * Warn handler for watcher warns
  12524. */
  12525. warnHandler: null,
  12526. /**
  12527. * Ignore certain custom elements
  12528. */
  12529. ignoredElements: [],
  12530. /**
  12531. * Custom user key aliases for v-on
  12532. */
  12533. // $flow-disable-line
  12534. keyCodes: Object.create(null),
  12535. /**
  12536. * Check if a tag is reserved so that it cannot be registered as a
  12537. * component. This is platform-dependent and may be overwritten.
  12538. */
  12539. isReservedTag: no,
  12540. /**
  12541. * Check if an attribute is reserved so that it cannot be used as a component
  12542. * prop. This is platform-dependent and may be overwritten.
  12543. */
  12544. isReservedAttr: no,
  12545. /**
  12546. * Check if a tag is an unknown element.
  12547. * Platform-dependent.
  12548. */
  12549. isUnknownElement: no,
  12550. /**
  12551. * Get the namespace of an element
  12552. */
  12553. getTagNamespace: noop,
  12554. /**
  12555. * Parse the real tag name for the specific platform.
  12556. */
  12557. parsePlatformTagName: identity,
  12558. /**
  12559. * Check if an attribute must be bound using property, e.g. value
  12560. * Platform-dependent.
  12561. */
  12562. mustUseProp: no,
  12563. /**
  12564. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  12565. * This will significantly reduce performance if set to false.
  12566. */
  12567. async: true,
  12568. /**
  12569. * Exposed for legacy reasons
  12570. */
  12571. _lifecycleHooks: LIFECYCLE_HOOKS
  12572. });
  12573. /* */
  12574. /**
  12575. * unicode letters used for parsing html tags, component names and property paths.
  12576. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  12577. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  12578. */
  12579. 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/;
  12580. /**
  12581. * Check if a string starts with $ or _
  12582. */
  12583. function isReserved (str) {
  12584. var c = (str + '').charCodeAt(0);
  12585. return c === 0x24 || c === 0x5F
  12586. }
  12587. /**
  12588. * Define a property.
  12589. */
  12590. function def (obj, key, val, enumerable) {
  12591. Object.defineProperty(obj, key, {
  12592. value: val,
  12593. enumerable: !!enumerable,
  12594. writable: true,
  12595. configurable: true
  12596. });
  12597. }
  12598. /**
  12599. * Parse simple path.
  12600. */
  12601. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  12602. function parsePath (path) {
  12603. if (bailRE.test(path)) {
  12604. return
  12605. }
  12606. var segments = path.split('.');
  12607. return function (obj) {
  12608. for (var i = 0; i < segments.length; i++) {
  12609. if (!obj) { return }
  12610. obj = obj[segments[i]];
  12611. }
  12612. return obj
  12613. }
  12614. }
  12615. /* */
  12616. // can we use __proto__?
  12617. var hasProto = '__proto__' in {};
  12618. // Browser environment sniffing
  12619. var inBrowser = typeof window !== 'undefined';
  12620. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  12621. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  12622. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  12623. var isIE = UA && /msie|trident/.test(UA);
  12624. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  12625. var isEdge = UA && UA.indexOf('edge/') > 0;
  12626. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  12627. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  12628. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  12629. var isPhantomJS = UA && /phantomjs/.test(UA);
  12630. var isFF = UA && UA.match(/firefox\/(\d+)/);
  12631. // Firefox has a "watch" function on Object.prototype...
  12632. var nativeWatch = ({}).watch;
  12633. if (inBrowser) {
  12634. try {
  12635. var opts = {};
  12636. Object.defineProperty(opts, 'passive', ({
  12637. get: function get () {
  12638. }
  12639. })); // https://github.com/facebook/flow/issues/285
  12640. window.addEventListener('test-passive', null, opts);
  12641. } catch (e) {}
  12642. }
  12643. // this needs to be lazy-evaled because vue may be required before
  12644. // vue-server-renderer can set VUE_ENV
  12645. var _isServer;
  12646. var isServerRendering = function () {
  12647. if (_isServer === undefined) {
  12648. /* istanbul ignore if */
  12649. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  12650. // detect presence of vue-server-renderer and avoid
  12651. // Webpack shimming the process
  12652. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  12653. } else {
  12654. _isServer = false;
  12655. }
  12656. }
  12657. return _isServer
  12658. };
  12659. // detect devtools
  12660. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  12661. /* istanbul ignore next */
  12662. function isNative (Ctor) {
  12663. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  12664. }
  12665. var hasSymbol =
  12666. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  12667. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  12668. var _Set;
  12669. /* istanbul ignore if */ // $flow-disable-line
  12670. if (typeof Set !== 'undefined' && isNative(Set)) {
  12671. // use native Set when available.
  12672. _Set = Set;
  12673. } else {
  12674. // a non-standard Set polyfill that only works with primitive keys.
  12675. _Set = /*@__PURE__*/(function () {
  12676. function Set () {
  12677. this.set = Object.create(null);
  12678. }
  12679. Set.prototype.has = function has (key) {
  12680. return this.set[key] === true
  12681. };
  12682. Set.prototype.add = function add (key) {
  12683. this.set[key] = true;
  12684. };
  12685. Set.prototype.clear = function clear () {
  12686. this.set = Object.create(null);
  12687. };
  12688. return Set;
  12689. }());
  12690. }
  12691. /* */
  12692. var warn = noop;
  12693. var tip = noop;
  12694. var generateComponentTrace = (noop); // work around flow check
  12695. var formatComponentName = (noop);
  12696. if (true) {
  12697. var hasConsole = typeof console !== 'undefined';
  12698. var classifyRE = /(?:^|[-_])(\w)/g;
  12699. var classify = function (str) { return str
  12700. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  12701. .replace(/[-_]/g, ''); };
  12702. warn = function (msg, vm) {
  12703. var trace = vm ? generateComponentTrace(vm) : '';
  12704. if (config.warnHandler) {
  12705. config.warnHandler.call(null, msg, vm, trace);
  12706. } else if (hasConsole && (!config.silent)) {
  12707. console.error(("[Vue warn]: " + msg + trace));
  12708. }
  12709. };
  12710. tip = function (msg, vm) {
  12711. if (hasConsole && (!config.silent)) {
  12712. console.warn("[Vue tip]: " + msg + (
  12713. vm ? generateComponentTrace(vm) : ''
  12714. ));
  12715. }
  12716. };
  12717. formatComponentName = function (vm, includeFile) {
  12718. if (vm.$root === vm) {
  12719. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  12720. return ('') + vm.$options.__file
  12721. }
  12722. return '<Root>'
  12723. }
  12724. var options = typeof vm === 'function' && vm.cid != null
  12725. ? vm.options
  12726. : vm._isVue
  12727. ? vm.$options || vm.constructor.options
  12728. : vm;
  12729. var name = options.name || options._componentTag;
  12730. var file = options.__file;
  12731. if (!name && file) {
  12732. var match = file.match(/([^/\\]+)\.vue$/);
  12733. name = match && match[1];
  12734. }
  12735. return (
  12736. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  12737. (file && includeFile !== false ? (" at " + file) : '')
  12738. )
  12739. };
  12740. var repeat = function (str, n) {
  12741. var res = '';
  12742. while (n) {
  12743. if (n % 2 === 1) { res += str; }
  12744. if (n > 1) { str += str; }
  12745. n >>= 1;
  12746. }
  12747. return res
  12748. };
  12749. generateComponentTrace = function (vm) {
  12750. if (vm._isVue && vm.$parent) {
  12751. var tree = [];
  12752. var currentRecursiveSequence = 0;
  12753. while (vm && vm.$options.name !== 'PageBody') {
  12754. if (tree.length > 0) {
  12755. var last = tree[tree.length - 1];
  12756. if (last.constructor === vm.constructor) {
  12757. currentRecursiveSequence++;
  12758. vm = vm.$parent;
  12759. continue
  12760. } else if (currentRecursiveSequence > 0) {
  12761. tree[tree.length - 1] = [last, currentRecursiveSequence];
  12762. currentRecursiveSequence = 0;
  12763. }
  12764. }
  12765. !vm.$options.isReserved && tree.push(vm);
  12766. vm = vm.$parent;
  12767. }
  12768. return '\n\nfound in\n\n' + tree
  12769. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  12770. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  12771. : formatComponentName(vm))); })
  12772. .join('\n')
  12773. } else {
  12774. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  12775. }
  12776. };
  12777. }
  12778. /* */
  12779. var uid = 0;
  12780. /**
  12781. * A dep is an observable that can have multiple
  12782. * directives subscribing to it.
  12783. */
  12784. var Dep = function Dep () {
  12785. this.id = uid++;
  12786. this.subs = [];
  12787. };
  12788. Dep.prototype.addSub = function addSub (sub) {
  12789. this.subs.push(sub);
  12790. };
  12791. Dep.prototype.removeSub = function removeSub (sub) {
  12792. remove(this.subs, sub);
  12793. };
  12794. Dep.prototype.depend = function depend () {
  12795. if (Dep.SharedObject.target) {
  12796. Dep.SharedObject.target.addDep(this);
  12797. }
  12798. };
  12799. Dep.prototype.notify = function notify () {
  12800. // stabilize the subscriber list first
  12801. var subs = this.subs.slice();
  12802. if ( true && !config.async) {
  12803. // subs aren't sorted in scheduler if not running async
  12804. // we need to sort them now to make sure they fire in correct
  12805. // order
  12806. subs.sort(function (a, b) { return a.id - b.id; });
  12807. }
  12808. for (var i = 0, l = subs.length; i < l; i++) {
  12809. subs[i].update();
  12810. }
  12811. };
  12812. // The current target watcher being evaluated.
  12813. // This is globally unique because only one watcher
  12814. // can be evaluated at a time.
  12815. // fixed by xxxxxx (nvue shared vuex)
  12816. /* eslint-disable no-undef */
  12817. Dep.SharedObject = {};
  12818. Dep.SharedObject.target = null;
  12819. Dep.SharedObject.targetStack = [];
  12820. function pushTarget (target) {
  12821. Dep.SharedObject.targetStack.push(target);
  12822. Dep.SharedObject.target = target;
  12823. Dep.target = target;
  12824. }
  12825. function popTarget () {
  12826. Dep.SharedObject.targetStack.pop();
  12827. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  12828. Dep.target = Dep.SharedObject.target;
  12829. }
  12830. /* */
  12831. var VNode = function VNode (
  12832. tag,
  12833. data,
  12834. children,
  12835. text,
  12836. elm,
  12837. context,
  12838. componentOptions,
  12839. asyncFactory
  12840. ) {
  12841. this.tag = tag;
  12842. this.data = data;
  12843. this.children = children;
  12844. this.text = text;
  12845. this.elm = elm;
  12846. this.ns = undefined;
  12847. this.context = context;
  12848. this.fnContext = undefined;
  12849. this.fnOptions = undefined;
  12850. this.fnScopeId = undefined;
  12851. this.key = data && data.key;
  12852. this.componentOptions = componentOptions;
  12853. this.componentInstance = undefined;
  12854. this.parent = undefined;
  12855. this.raw = false;
  12856. this.isStatic = false;
  12857. this.isRootInsert = true;
  12858. this.isComment = false;
  12859. this.isCloned = false;
  12860. this.isOnce = false;
  12861. this.asyncFactory = asyncFactory;
  12862. this.asyncMeta = undefined;
  12863. this.isAsyncPlaceholder = false;
  12864. };
  12865. var prototypeAccessors = { child: { configurable: true } };
  12866. // DEPRECATED: alias for componentInstance for backwards compat.
  12867. /* istanbul ignore next */
  12868. prototypeAccessors.child.get = function () {
  12869. return this.componentInstance
  12870. };
  12871. Object.defineProperties( VNode.prototype, prototypeAccessors );
  12872. var createEmptyVNode = function (text) {
  12873. if ( text === void 0 ) text = '';
  12874. var node = new VNode();
  12875. node.text = text;
  12876. node.isComment = true;
  12877. return node
  12878. };
  12879. function createTextVNode (val) {
  12880. return new VNode(undefined, undefined, undefined, String(val))
  12881. }
  12882. // optimized shallow clone
  12883. // used for static nodes and slot nodes because they may be reused across
  12884. // multiple renders, cloning them avoids errors when DOM manipulations rely
  12885. // on their elm reference.
  12886. function cloneVNode (vnode) {
  12887. var cloned = new VNode(
  12888. vnode.tag,
  12889. vnode.data,
  12890. // #7975
  12891. // clone children array to avoid mutating original in case of cloning
  12892. // a child.
  12893. vnode.children && vnode.children.slice(),
  12894. vnode.text,
  12895. vnode.elm,
  12896. vnode.context,
  12897. vnode.componentOptions,
  12898. vnode.asyncFactory
  12899. );
  12900. cloned.ns = vnode.ns;
  12901. cloned.isStatic = vnode.isStatic;
  12902. cloned.key = vnode.key;
  12903. cloned.isComment = vnode.isComment;
  12904. cloned.fnContext = vnode.fnContext;
  12905. cloned.fnOptions = vnode.fnOptions;
  12906. cloned.fnScopeId = vnode.fnScopeId;
  12907. cloned.asyncMeta = vnode.asyncMeta;
  12908. cloned.isCloned = true;
  12909. return cloned
  12910. }
  12911. /*
  12912. * not type checking this file because flow doesn't play well with
  12913. * dynamically accessing methods on Array prototype
  12914. */
  12915. var arrayProto = Array.prototype;
  12916. var arrayMethods = Object.create(arrayProto);
  12917. var methodsToPatch = [
  12918. 'push',
  12919. 'pop',
  12920. 'shift',
  12921. 'unshift',
  12922. 'splice',
  12923. 'sort',
  12924. 'reverse'
  12925. ];
  12926. /**
  12927. * Intercept mutating methods and emit events
  12928. */
  12929. methodsToPatch.forEach(function (method) {
  12930. // cache original method
  12931. var original = arrayProto[method];
  12932. def(arrayMethods, method, function mutator () {
  12933. var args = [], len = arguments.length;
  12934. while ( len-- ) args[ len ] = arguments[ len ];
  12935. var result = original.apply(this, args);
  12936. var ob = this.__ob__;
  12937. var inserted;
  12938. switch (method) {
  12939. case 'push':
  12940. case 'unshift':
  12941. inserted = args;
  12942. break
  12943. case 'splice':
  12944. inserted = args.slice(2);
  12945. break
  12946. }
  12947. if (inserted) { ob.observeArray(inserted); }
  12948. // notify change
  12949. ob.dep.notify();
  12950. return result
  12951. });
  12952. });
  12953. /* */
  12954. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  12955. /**
  12956. * In some cases we may want to disable observation inside a component's
  12957. * update computation.
  12958. */
  12959. var shouldObserve = true;
  12960. function toggleObserving (value) {
  12961. shouldObserve = value;
  12962. }
  12963. /**
  12964. * Observer class that is attached to each observed
  12965. * object. Once attached, the observer converts the target
  12966. * object's property keys into getter/setters that
  12967. * collect dependencies and dispatch updates.
  12968. */
  12969. var Observer = function Observer (value) {
  12970. this.value = value;
  12971. this.dep = new Dep();
  12972. this.vmCount = 0;
  12973. def(value, '__ob__', this);
  12974. if (Array.isArray(value)) {
  12975. if (hasProto) {
  12976. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  12977. if(value.push !== value.__proto__.push){
  12978. copyAugment(value, arrayMethods, arrayKeys);
  12979. } else {
  12980. protoAugment(value, arrayMethods);
  12981. }
  12982. }
  12983. } else {
  12984. copyAugment(value, arrayMethods, arrayKeys);
  12985. }
  12986. this.observeArray(value);
  12987. } else {
  12988. this.walk(value);
  12989. }
  12990. };
  12991. /**
  12992. * Walk through all properties and convert them into
  12993. * getter/setters. This method should only be called when
  12994. * value type is Object.
  12995. */
  12996. Observer.prototype.walk = function walk (obj) {
  12997. var keys = Object.keys(obj);
  12998. for (var i = 0; i < keys.length; i++) {
  12999. defineReactive$$1(obj, keys[i]);
  13000. }
  13001. };
  13002. /**
  13003. * Observe a list of Array items.
  13004. */
  13005. Observer.prototype.observeArray = function observeArray (items) {
  13006. for (var i = 0, l = items.length; i < l; i++) {
  13007. observe(items[i]);
  13008. }
  13009. };
  13010. // helpers
  13011. /**
  13012. * Augment a target Object or Array by intercepting
  13013. * the prototype chain using __proto__
  13014. */
  13015. function protoAugment (target, src) {
  13016. /* eslint-disable no-proto */
  13017. target.__proto__ = src;
  13018. /* eslint-enable no-proto */
  13019. }
  13020. /**
  13021. * Augment a target Object or Array by defining
  13022. * hidden properties.
  13023. */
  13024. /* istanbul ignore next */
  13025. function copyAugment (target, src, keys) {
  13026. for (var i = 0, l = keys.length; i < l; i++) {
  13027. var key = keys[i];
  13028. def(target, key, src[key]);
  13029. }
  13030. }
  13031. /**
  13032. * Attempt to create an observer instance for a value,
  13033. * returns the new observer if successfully observed,
  13034. * or the existing observer if the value already has one.
  13035. */
  13036. function observe (value, asRootData) {
  13037. if (!isObject(value) || value instanceof VNode) {
  13038. return
  13039. }
  13040. var ob;
  13041. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  13042. ob = value.__ob__;
  13043. } else if (
  13044. shouldObserve &&
  13045. !isServerRendering() &&
  13046. (Array.isArray(value) || isPlainObject(value)) &&
  13047. Object.isExtensible(value) &&
  13048. !value._isVue &&
  13049. !value.__v_isMPComponent
  13050. ) {
  13051. ob = new Observer(value);
  13052. }
  13053. if (asRootData && ob) {
  13054. ob.vmCount++;
  13055. }
  13056. return ob
  13057. }
  13058. /**
  13059. * Define a reactive property on an Object.
  13060. */
  13061. function defineReactive$$1 (
  13062. obj,
  13063. key,
  13064. val,
  13065. customSetter,
  13066. shallow
  13067. ) {
  13068. var dep = new Dep();
  13069. var property = Object.getOwnPropertyDescriptor(obj, key);
  13070. if (property && property.configurable === false) {
  13071. return
  13072. }
  13073. // cater for pre-defined getter/setters
  13074. var getter = property && property.get;
  13075. var setter = property && property.set;
  13076. if ((!getter || setter) && arguments.length === 2) {
  13077. val = obj[key];
  13078. }
  13079. var childOb = !shallow && observe(val);
  13080. Object.defineProperty(obj, key, {
  13081. enumerable: true,
  13082. configurable: true,
  13083. get: function reactiveGetter () {
  13084. var value = getter ? getter.call(obj) : val;
  13085. if (Dep.SharedObject.target) { // fixed by xxxxxx
  13086. dep.depend();
  13087. if (childOb) {
  13088. childOb.dep.depend();
  13089. if (Array.isArray(value)) {
  13090. dependArray(value);
  13091. }
  13092. }
  13093. }
  13094. return value
  13095. },
  13096. set: function reactiveSetter (newVal) {
  13097. var value = getter ? getter.call(obj) : val;
  13098. /* eslint-disable no-self-compare */
  13099. if (newVal === value || (newVal !== newVal && value !== value)) {
  13100. return
  13101. }
  13102. /* eslint-enable no-self-compare */
  13103. if ( true && customSetter) {
  13104. customSetter();
  13105. }
  13106. // #7981: for accessor properties without setter
  13107. if (getter && !setter) { return }
  13108. if (setter) {
  13109. setter.call(obj, newVal);
  13110. } else {
  13111. val = newVal;
  13112. }
  13113. childOb = !shallow && observe(newVal);
  13114. dep.notify();
  13115. }
  13116. });
  13117. }
  13118. /**
  13119. * Set a property on an object. Adds the new property and
  13120. * triggers change notification if the property doesn't
  13121. * already exist.
  13122. */
  13123. function set (target, key, val) {
  13124. if ( true &&
  13125. (isUndef(target) || isPrimitive(target))
  13126. ) {
  13127. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  13128. }
  13129. if (Array.isArray(target) && isValidArrayIndex(key)) {
  13130. target.length = Math.max(target.length, key);
  13131. target.splice(key, 1, val);
  13132. return val
  13133. }
  13134. if (key in target && !(key in Object.prototype)) {
  13135. target[key] = val;
  13136. return val
  13137. }
  13138. var ob = (target).__ob__;
  13139. if (target._isVue || (ob && ob.vmCount)) {
  13140. true && warn(
  13141. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  13142. 'at runtime - declare it upfront in the data option.'
  13143. );
  13144. return val
  13145. }
  13146. if (!ob) {
  13147. target[key] = val;
  13148. return val
  13149. }
  13150. defineReactive$$1(ob.value, key, val);
  13151. ob.dep.notify();
  13152. return val
  13153. }
  13154. /**
  13155. * Delete a property and trigger change if necessary.
  13156. */
  13157. function del (target, key) {
  13158. if ( true &&
  13159. (isUndef(target) || isPrimitive(target))
  13160. ) {
  13161. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  13162. }
  13163. if (Array.isArray(target) && isValidArrayIndex(key)) {
  13164. target.splice(key, 1);
  13165. return
  13166. }
  13167. var ob = (target).__ob__;
  13168. if (target._isVue || (ob && ob.vmCount)) {
  13169. true && warn(
  13170. 'Avoid deleting properties on a Vue instance or its root $data ' +
  13171. '- just set it to null.'
  13172. );
  13173. return
  13174. }
  13175. if (!hasOwn(target, key)) {
  13176. return
  13177. }
  13178. delete target[key];
  13179. if (!ob) {
  13180. return
  13181. }
  13182. ob.dep.notify();
  13183. }
  13184. /**
  13185. * Collect dependencies on array elements when the array is touched, since
  13186. * we cannot intercept array element access like property getters.
  13187. */
  13188. function dependArray (value) {
  13189. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  13190. e = value[i];
  13191. e && e.__ob__ && e.__ob__.dep.depend();
  13192. if (Array.isArray(e)) {
  13193. dependArray(e);
  13194. }
  13195. }
  13196. }
  13197. /* */
  13198. /**
  13199. * Option overwriting strategies are functions that handle
  13200. * how to merge a parent option value and a child option
  13201. * value into the final value.
  13202. */
  13203. var strats = config.optionMergeStrategies;
  13204. /**
  13205. * Options with restrictions
  13206. */
  13207. if (true) {
  13208. strats.el = strats.propsData = function (parent, child, vm, key) {
  13209. if (!vm) {
  13210. warn(
  13211. "option \"" + key + "\" can only be used during instance " +
  13212. 'creation with the `new` keyword.'
  13213. );
  13214. }
  13215. return defaultStrat(parent, child)
  13216. };
  13217. }
  13218. /**
  13219. * Helper that recursively merges two data objects together.
  13220. */
  13221. function mergeData (to, from) {
  13222. if (!from) { return to }
  13223. var key, toVal, fromVal;
  13224. var keys = hasSymbol
  13225. ? Reflect.ownKeys(from)
  13226. : Object.keys(from);
  13227. for (var i = 0; i < keys.length; i++) {
  13228. key = keys[i];
  13229. // in case the object is already observed...
  13230. if (key === '__ob__') { continue }
  13231. toVal = to[key];
  13232. fromVal = from[key];
  13233. if (!hasOwn(to, key)) {
  13234. set(to, key, fromVal);
  13235. } else if (
  13236. toVal !== fromVal &&
  13237. isPlainObject(toVal) &&
  13238. isPlainObject(fromVal)
  13239. ) {
  13240. mergeData(toVal, fromVal);
  13241. }
  13242. }
  13243. return to
  13244. }
  13245. /**
  13246. * Data
  13247. */
  13248. function mergeDataOrFn (
  13249. parentVal,
  13250. childVal,
  13251. vm
  13252. ) {
  13253. if (!vm) {
  13254. // in a Vue.extend merge, both should be functions
  13255. if (!childVal) {
  13256. return parentVal
  13257. }
  13258. if (!parentVal) {
  13259. return childVal
  13260. }
  13261. // when parentVal & childVal are both present,
  13262. // we need to return a function that returns the
  13263. // merged result of both functions... no need to
  13264. // check if parentVal is a function here because
  13265. // it has to be a function to pass previous merges.
  13266. return function mergedDataFn () {
  13267. return mergeData(
  13268. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  13269. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  13270. )
  13271. }
  13272. } else {
  13273. return function mergedInstanceDataFn () {
  13274. // instance merge
  13275. var instanceData = typeof childVal === 'function'
  13276. ? childVal.call(vm, vm)
  13277. : childVal;
  13278. var defaultData = typeof parentVal === 'function'
  13279. ? parentVal.call(vm, vm)
  13280. : parentVal;
  13281. if (instanceData) {
  13282. return mergeData(instanceData, defaultData)
  13283. } else {
  13284. return defaultData
  13285. }
  13286. }
  13287. }
  13288. }
  13289. strats.data = function (
  13290. parentVal,
  13291. childVal,
  13292. vm
  13293. ) {
  13294. if (!vm) {
  13295. if (childVal && typeof childVal !== 'function') {
  13296. true && warn(
  13297. 'The "data" option should be a function ' +
  13298. 'that returns a per-instance value in component ' +
  13299. 'definitions.',
  13300. vm
  13301. );
  13302. return parentVal
  13303. }
  13304. return mergeDataOrFn(parentVal, childVal)
  13305. }
  13306. return mergeDataOrFn(parentVal, childVal, vm)
  13307. };
  13308. /**
  13309. * Hooks and props are merged as arrays.
  13310. */
  13311. function mergeHook (
  13312. parentVal,
  13313. childVal
  13314. ) {
  13315. var res = childVal
  13316. ? parentVal
  13317. ? parentVal.concat(childVal)
  13318. : Array.isArray(childVal)
  13319. ? childVal
  13320. : [childVal]
  13321. : parentVal;
  13322. return res
  13323. ? dedupeHooks(res)
  13324. : res
  13325. }
  13326. function dedupeHooks (hooks) {
  13327. var res = [];
  13328. for (var i = 0; i < hooks.length; i++) {
  13329. if (res.indexOf(hooks[i]) === -1) {
  13330. res.push(hooks[i]);
  13331. }
  13332. }
  13333. return res
  13334. }
  13335. LIFECYCLE_HOOKS.forEach(function (hook) {
  13336. strats[hook] = mergeHook;
  13337. });
  13338. /**
  13339. * Assets
  13340. *
  13341. * When a vm is present (instance creation), we need to do
  13342. * a three-way merge between constructor options, instance
  13343. * options and parent options.
  13344. */
  13345. function mergeAssets (
  13346. parentVal,
  13347. childVal,
  13348. vm,
  13349. key
  13350. ) {
  13351. var res = Object.create(parentVal || null);
  13352. if (childVal) {
  13353. true && assertObjectType(key, childVal, vm);
  13354. return extend(res, childVal)
  13355. } else {
  13356. return res
  13357. }
  13358. }
  13359. ASSET_TYPES.forEach(function (type) {
  13360. strats[type + 's'] = mergeAssets;
  13361. });
  13362. /**
  13363. * Watchers.
  13364. *
  13365. * Watchers hashes should not overwrite one
  13366. * another, so we merge them as arrays.
  13367. */
  13368. strats.watch = function (
  13369. parentVal,
  13370. childVal,
  13371. vm,
  13372. key
  13373. ) {
  13374. // work around Firefox's Object.prototype.watch...
  13375. if (parentVal === nativeWatch) { parentVal = undefined; }
  13376. if (childVal === nativeWatch) { childVal = undefined; }
  13377. /* istanbul ignore if */
  13378. if (!childVal) { return Object.create(parentVal || null) }
  13379. if (true) {
  13380. assertObjectType(key, childVal, vm);
  13381. }
  13382. if (!parentVal) { return childVal }
  13383. var ret = {};
  13384. extend(ret, parentVal);
  13385. for (var key$1 in childVal) {
  13386. var parent = ret[key$1];
  13387. var child = childVal[key$1];
  13388. if (parent && !Array.isArray(parent)) {
  13389. parent = [parent];
  13390. }
  13391. ret[key$1] = parent
  13392. ? parent.concat(child)
  13393. : Array.isArray(child) ? child : [child];
  13394. }
  13395. return ret
  13396. };
  13397. /**
  13398. * Other object hashes.
  13399. */
  13400. strats.props =
  13401. strats.methods =
  13402. strats.inject =
  13403. strats.computed = function (
  13404. parentVal,
  13405. childVal,
  13406. vm,
  13407. key
  13408. ) {
  13409. if (childVal && "development" !== 'production') {
  13410. assertObjectType(key, childVal, vm);
  13411. }
  13412. if (!parentVal) { return childVal }
  13413. var ret = Object.create(null);
  13414. extend(ret, parentVal);
  13415. if (childVal) { extend(ret, childVal); }
  13416. return ret
  13417. };
  13418. strats.provide = mergeDataOrFn;
  13419. /**
  13420. * Default strategy.
  13421. */
  13422. var defaultStrat = function (parentVal, childVal) {
  13423. return childVal === undefined
  13424. ? parentVal
  13425. : childVal
  13426. };
  13427. /**
  13428. * Validate component names
  13429. */
  13430. function checkComponents (options) {
  13431. for (var key in options.components) {
  13432. validateComponentName(key);
  13433. }
  13434. }
  13435. function validateComponentName (name) {
  13436. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  13437. warn(
  13438. 'Invalid component name: "' + name + '". Component names ' +
  13439. 'should conform to valid custom element name in html5 specification.'
  13440. );
  13441. }
  13442. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  13443. warn(
  13444. 'Do not use built-in or reserved HTML elements as component ' +
  13445. 'id: ' + name
  13446. );
  13447. }
  13448. }
  13449. /**
  13450. * Ensure all props option syntax are normalized into the
  13451. * Object-based format.
  13452. */
  13453. function normalizeProps (options, vm) {
  13454. var props = options.props;
  13455. if (!props) { return }
  13456. var res = {};
  13457. var i, val, name;
  13458. if (Array.isArray(props)) {
  13459. i = props.length;
  13460. while (i--) {
  13461. val = props[i];
  13462. if (typeof val === 'string') {
  13463. name = camelize(val);
  13464. res[name] = { type: null };
  13465. } else if (true) {
  13466. warn('props must be strings when using array syntax.');
  13467. }
  13468. }
  13469. } else if (isPlainObject(props)) {
  13470. for (var key in props) {
  13471. val = props[key];
  13472. name = camelize(key);
  13473. res[name] = isPlainObject(val)
  13474. ? val
  13475. : { type: val };
  13476. }
  13477. } else if (true) {
  13478. warn(
  13479. "Invalid value for option \"props\": expected an Array or an Object, " +
  13480. "but got " + (toRawType(props)) + ".",
  13481. vm
  13482. );
  13483. }
  13484. options.props = res;
  13485. }
  13486. /**
  13487. * Normalize all injections into Object-based format
  13488. */
  13489. function normalizeInject (options, vm) {
  13490. var inject = options.inject;
  13491. if (!inject) { return }
  13492. var normalized = options.inject = {};
  13493. if (Array.isArray(inject)) {
  13494. for (var i = 0; i < inject.length; i++) {
  13495. normalized[inject[i]] = { from: inject[i] };
  13496. }
  13497. } else if (isPlainObject(inject)) {
  13498. for (var key in inject) {
  13499. var val = inject[key];
  13500. normalized[key] = isPlainObject(val)
  13501. ? extend({ from: key }, val)
  13502. : { from: val };
  13503. }
  13504. } else if (true) {
  13505. warn(
  13506. "Invalid value for option \"inject\": expected an Array or an Object, " +
  13507. "but got " + (toRawType(inject)) + ".",
  13508. vm
  13509. );
  13510. }
  13511. }
  13512. /**
  13513. * Normalize raw function directives into object format.
  13514. */
  13515. function normalizeDirectives (options) {
  13516. var dirs = options.directives;
  13517. if (dirs) {
  13518. for (var key in dirs) {
  13519. var def$$1 = dirs[key];
  13520. if (typeof def$$1 === 'function') {
  13521. dirs[key] = { bind: def$$1, update: def$$1 };
  13522. }
  13523. }
  13524. }
  13525. }
  13526. function assertObjectType (name, value, vm) {
  13527. if (!isPlainObject(value)) {
  13528. warn(
  13529. "Invalid value for option \"" + name + "\": expected an Object, " +
  13530. "but got " + (toRawType(value)) + ".",
  13531. vm
  13532. );
  13533. }
  13534. }
  13535. /**
  13536. * Merge two option objects into a new one.
  13537. * Core utility used in both instantiation and inheritance.
  13538. */
  13539. function mergeOptions (
  13540. parent,
  13541. child,
  13542. vm
  13543. ) {
  13544. if (true) {
  13545. checkComponents(child);
  13546. }
  13547. if (typeof child === 'function') {
  13548. child = child.options;
  13549. }
  13550. normalizeProps(child, vm);
  13551. normalizeInject(child, vm);
  13552. normalizeDirectives(child);
  13553. // Apply extends and mixins on the child options,
  13554. // but only if it is a raw options object that isn't
  13555. // the result of another mergeOptions call.
  13556. // Only merged options has the _base property.
  13557. if (!child._base) {
  13558. if (child.extends) {
  13559. parent = mergeOptions(parent, child.extends, vm);
  13560. }
  13561. if (child.mixins) {
  13562. for (var i = 0, l = child.mixins.length; i < l; i++) {
  13563. parent = mergeOptions(parent, child.mixins[i], vm);
  13564. }
  13565. }
  13566. }
  13567. var options = {};
  13568. var key;
  13569. for (key in parent) {
  13570. mergeField(key);
  13571. }
  13572. for (key in child) {
  13573. if (!hasOwn(parent, key)) {
  13574. mergeField(key);
  13575. }
  13576. }
  13577. function mergeField (key) {
  13578. var strat = strats[key] || defaultStrat;
  13579. options[key] = strat(parent[key], child[key], vm, key);
  13580. }
  13581. return options
  13582. }
  13583. /**
  13584. * Resolve an asset.
  13585. * This function is used because child instances need access
  13586. * to assets defined in its ancestor chain.
  13587. */
  13588. function resolveAsset (
  13589. options,
  13590. type,
  13591. id,
  13592. warnMissing
  13593. ) {
  13594. /* istanbul ignore if */
  13595. if (typeof id !== 'string') {
  13596. return
  13597. }
  13598. var assets = options[type];
  13599. // check local registration variations first
  13600. if (hasOwn(assets, id)) { return assets[id] }
  13601. var camelizedId = camelize(id);
  13602. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  13603. var PascalCaseId = capitalize(camelizedId);
  13604. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  13605. // fallback to prototype chain
  13606. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  13607. if ( true && warnMissing && !res) {
  13608. warn(
  13609. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  13610. options
  13611. );
  13612. }
  13613. return res
  13614. }
  13615. /* */
  13616. function validateProp (
  13617. key,
  13618. propOptions,
  13619. propsData,
  13620. vm
  13621. ) {
  13622. var prop = propOptions[key];
  13623. var absent = !hasOwn(propsData, key);
  13624. var value = propsData[key];
  13625. // boolean casting
  13626. var booleanIndex = getTypeIndex(Boolean, prop.type);
  13627. if (booleanIndex > -1) {
  13628. if (absent && !hasOwn(prop, 'default')) {
  13629. value = false;
  13630. } else if (value === '' || value === hyphenate(key)) {
  13631. // only cast empty string / same name to boolean if
  13632. // boolean has higher priority
  13633. var stringIndex = getTypeIndex(String, prop.type);
  13634. if (stringIndex < 0 || booleanIndex < stringIndex) {
  13635. value = true;
  13636. }
  13637. }
  13638. }
  13639. // check default value
  13640. if (value === undefined) {
  13641. value = getPropDefaultValue(vm, prop, key);
  13642. // since the default value is a fresh copy,
  13643. // make sure to observe it.
  13644. var prevShouldObserve = shouldObserve;
  13645. toggleObserving(true);
  13646. observe(value);
  13647. toggleObserving(prevShouldObserve);
  13648. }
  13649. if (
  13650. true
  13651. ) {
  13652. assertProp(prop, key, value, vm, absent);
  13653. }
  13654. return value
  13655. }
  13656. /**
  13657. * Get the default value of a prop.
  13658. */
  13659. function getPropDefaultValue (vm, prop, key) {
  13660. // no default, return undefined
  13661. if (!hasOwn(prop, 'default')) {
  13662. return undefined
  13663. }
  13664. var def = prop.default;
  13665. // warn against non-factory defaults for Object & Array
  13666. if ( true && isObject(def)) {
  13667. warn(
  13668. 'Invalid default value for prop "' + key + '": ' +
  13669. 'Props with type Object/Array must use a factory function ' +
  13670. 'to return the default value.',
  13671. vm
  13672. );
  13673. }
  13674. // the raw prop value was also undefined from previous render,
  13675. // return previous default value to avoid unnecessary watcher trigger
  13676. if (vm && vm.$options.propsData &&
  13677. vm.$options.propsData[key] === undefined &&
  13678. vm._props[key] !== undefined
  13679. ) {
  13680. return vm._props[key]
  13681. }
  13682. // call factory function for non-Function types
  13683. // a value is Function if its prototype is function even across different execution context
  13684. return typeof def === 'function' && getType(prop.type) !== 'Function'
  13685. ? def.call(vm)
  13686. : def
  13687. }
  13688. /**
  13689. * Assert whether a prop is valid.
  13690. */
  13691. function assertProp (
  13692. prop,
  13693. name,
  13694. value,
  13695. vm,
  13696. absent
  13697. ) {
  13698. if (prop.required && absent) {
  13699. warn(
  13700. 'Missing required prop: "' + name + '"',
  13701. vm
  13702. );
  13703. return
  13704. }
  13705. if (value == null && !prop.required) {
  13706. return
  13707. }
  13708. var type = prop.type;
  13709. var valid = !type || type === true;
  13710. var expectedTypes = [];
  13711. if (type) {
  13712. if (!Array.isArray(type)) {
  13713. type = [type];
  13714. }
  13715. for (var i = 0; i < type.length && !valid; i++) {
  13716. var assertedType = assertType(value, type[i]);
  13717. expectedTypes.push(assertedType.expectedType || '');
  13718. valid = assertedType.valid;
  13719. }
  13720. }
  13721. if (!valid) {
  13722. warn(
  13723. getInvalidTypeMessage(name, value, expectedTypes),
  13724. vm
  13725. );
  13726. return
  13727. }
  13728. var validator = prop.validator;
  13729. if (validator) {
  13730. if (!validator(value)) {
  13731. warn(
  13732. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  13733. vm
  13734. );
  13735. }
  13736. }
  13737. }
  13738. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  13739. function assertType (value, type) {
  13740. var valid;
  13741. var expectedType = getType(type);
  13742. if (simpleCheckRE.test(expectedType)) {
  13743. var t = typeof value;
  13744. valid = t === expectedType.toLowerCase();
  13745. // for primitive wrapper objects
  13746. if (!valid && t === 'object') {
  13747. valid = value instanceof type;
  13748. }
  13749. } else if (expectedType === 'Object') {
  13750. valid = isPlainObject(value);
  13751. } else if (expectedType === 'Array') {
  13752. valid = Array.isArray(value);
  13753. } else {
  13754. valid = value instanceof type;
  13755. }
  13756. return {
  13757. valid: valid,
  13758. expectedType: expectedType
  13759. }
  13760. }
  13761. /**
  13762. * Use function string name to check built-in types,
  13763. * because a simple equality check will fail when running
  13764. * across different vms / iframes.
  13765. */
  13766. function getType (fn) {
  13767. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  13768. return match ? match[1] : ''
  13769. }
  13770. function isSameType (a, b) {
  13771. return getType(a) === getType(b)
  13772. }
  13773. function getTypeIndex (type, expectedTypes) {
  13774. if (!Array.isArray(expectedTypes)) {
  13775. return isSameType(expectedTypes, type) ? 0 : -1
  13776. }
  13777. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  13778. if (isSameType(expectedTypes[i], type)) {
  13779. return i
  13780. }
  13781. }
  13782. return -1
  13783. }
  13784. function getInvalidTypeMessage (name, value, expectedTypes) {
  13785. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  13786. " Expected " + (expectedTypes.map(capitalize).join(', '));
  13787. var expectedType = expectedTypes[0];
  13788. var receivedType = toRawType(value);
  13789. var expectedValue = styleValue(value, expectedType);
  13790. var receivedValue = styleValue(value, receivedType);
  13791. // check if we need to specify expected value
  13792. if (expectedTypes.length === 1 &&
  13793. isExplicable(expectedType) &&
  13794. !isBoolean(expectedType, receivedType)) {
  13795. message += " with value " + expectedValue;
  13796. }
  13797. message += ", got " + receivedType + " ";
  13798. // check if we need to specify received value
  13799. if (isExplicable(receivedType)) {
  13800. message += "with value " + receivedValue + ".";
  13801. }
  13802. return message
  13803. }
  13804. function styleValue (value, type) {
  13805. if (type === 'String') {
  13806. return ("\"" + value + "\"")
  13807. } else if (type === 'Number') {
  13808. return ("" + (Number(value)))
  13809. } else {
  13810. return ("" + value)
  13811. }
  13812. }
  13813. function isExplicable (value) {
  13814. var explicitTypes = ['string', 'number', 'boolean'];
  13815. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  13816. }
  13817. function isBoolean () {
  13818. var args = [], len = arguments.length;
  13819. while ( len-- ) args[ len ] = arguments[ len ];
  13820. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  13821. }
  13822. /* */
  13823. function handleError (err, vm, info) {
  13824. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  13825. // See: https://github.com/vuejs/vuex/issues/1505
  13826. pushTarget();
  13827. try {
  13828. if (vm) {
  13829. var cur = vm;
  13830. while ((cur = cur.$parent)) {
  13831. var hooks = cur.$options.errorCaptured;
  13832. if (hooks) {
  13833. for (var i = 0; i < hooks.length; i++) {
  13834. try {
  13835. var capture = hooks[i].call(cur, err, vm, info) === false;
  13836. if (capture) { return }
  13837. } catch (e) {
  13838. globalHandleError(e, cur, 'errorCaptured hook');
  13839. }
  13840. }
  13841. }
  13842. }
  13843. }
  13844. globalHandleError(err, vm, info);
  13845. } finally {
  13846. popTarget();
  13847. }
  13848. }
  13849. function invokeWithErrorHandling (
  13850. handler,
  13851. context,
  13852. args,
  13853. vm,
  13854. info
  13855. ) {
  13856. var res;
  13857. try {
  13858. res = args ? handler.apply(context, args) : handler.call(context);
  13859. if (res && !res._isVue && isPromise(res) && !res._handled) {
  13860. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  13861. // issue #9511
  13862. // avoid catch triggering multiple times when nested calls
  13863. res._handled = true;
  13864. }
  13865. } catch (e) {
  13866. handleError(e, vm, info);
  13867. }
  13868. return res
  13869. }
  13870. function globalHandleError (err, vm, info) {
  13871. if (config.errorHandler) {
  13872. try {
  13873. return config.errorHandler.call(null, err, vm, info)
  13874. } catch (e) {
  13875. // if the user intentionally throws the original error in the handler,
  13876. // do not log it twice
  13877. if (e !== err) {
  13878. logError(e, null, 'config.errorHandler');
  13879. }
  13880. }
  13881. }
  13882. logError(err, vm, info);
  13883. }
  13884. function logError (err, vm, info) {
  13885. if (true) {
  13886. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  13887. }
  13888. /* istanbul ignore else */
  13889. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  13890. console.error(err);
  13891. } else {
  13892. throw err
  13893. }
  13894. }
  13895. /* */
  13896. var callbacks = [];
  13897. var pending = false;
  13898. function flushCallbacks () {
  13899. pending = false;
  13900. var copies = callbacks.slice(0);
  13901. callbacks.length = 0;
  13902. for (var i = 0; i < copies.length; i++) {
  13903. copies[i]();
  13904. }
  13905. }
  13906. // Here we have async deferring wrappers using microtasks.
  13907. // In 2.5 we used (macro) tasks (in combination with microtasks).
  13908. // However, it has subtle problems when state is changed right before repaint
  13909. // (e.g. #6813, out-in transitions).
  13910. // Also, using (macro) tasks in event handler would cause some weird behaviors
  13911. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  13912. // So we now use microtasks everywhere, again.
  13913. // A major drawback of this tradeoff is that there are some scenarios
  13914. // where microtasks have too high a priority and fire in between supposedly
  13915. // sequential events (e.g. #4521, #6690, which have workarounds)
  13916. // or even between bubbling of the same event (#6566).
  13917. var timerFunc;
  13918. // The nextTick behavior leverages the microtask queue, which can be accessed
  13919. // via either native Promise.then or MutationObserver.
  13920. // MutationObserver has wider support, however it is seriously bugged in
  13921. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  13922. // completely stops working after triggering a few times... so, if native
  13923. // Promise is available, we will use it:
  13924. /* istanbul ignore next, $flow-disable-line */
  13925. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  13926. var p = Promise.resolve();
  13927. timerFunc = function () {
  13928. p.then(flushCallbacks);
  13929. // In problematic UIWebViews, Promise.then doesn't completely break, but
  13930. // it can get stuck in a weird state where callbacks are pushed into the
  13931. // microtask queue but the queue isn't being flushed, until the browser
  13932. // needs to do some other work, e.g. handle a timer. Therefore we can
  13933. // "force" the microtask queue to be flushed by adding an empty timer.
  13934. if (isIOS) { setTimeout(noop); }
  13935. };
  13936. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  13937. isNative(MutationObserver) ||
  13938. // PhantomJS and iOS 7.x
  13939. MutationObserver.toString() === '[object MutationObserverConstructor]'
  13940. )) {
  13941. // Use MutationObserver where native Promise is not available,
  13942. // e.g. PhantomJS, iOS7, Android 4.4
  13943. // (#6466 MutationObserver is unreliable in IE11)
  13944. var counter = 1;
  13945. var observer = new MutationObserver(flushCallbacks);
  13946. var textNode = document.createTextNode(String(counter));
  13947. observer.observe(textNode, {
  13948. characterData: true
  13949. });
  13950. timerFunc = function () {
  13951. counter = (counter + 1) % 2;
  13952. textNode.data = String(counter);
  13953. };
  13954. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  13955. // Fallback to setImmediate.
  13956. // Technically it leverages the (macro) task queue,
  13957. // but it is still a better choice than setTimeout.
  13958. timerFunc = function () {
  13959. setImmediate(flushCallbacks);
  13960. };
  13961. } else {
  13962. // Fallback to setTimeout.
  13963. timerFunc = function () {
  13964. setTimeout(flushCallbacks, 0);
  13965. };
  13966. }
  13967. function nextTick (cb, ctx) {
  13968. var _resolve;
  13969. callbacks.push(function () {
  13970. if (cb) {
  13971. try {
  13972. cb.call(ctx);
  13973. } catch (e) {
  13974. handleError(e, ctx, 'nextTick');
  13975. }
  13976. } else if (_resolve) {
  13977. _resolve(ctx);
  13978. }
  13979. });
  13980. if (!pending) {
  13981. pending = true;
  13982. timerFunc();
  13983. }
  13984. // $flow-disable-line
  13985. if (!cb && typeof Promise !== 'undefined') {
  13986. return new Promise(function (resolve) {
  13987. _resolve = resolve;
  13988. })
  13989. }
  13990. }
  13991. /* */
  13992. /* not type checking this file because flow doesn't play well with Proxy */
  13993. var initProxy;
  13994. if (true) {
  13995. var allowedGlobals = makeMap(
  13996. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  13997. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  13998. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  13999. 'require' // for Webpack/Browserify
  14000. );
  14001. var warnNonPresent = function (target, key) {
  14002. warn(
  14003. "Property or method \"" + key + "\" is not defined on the instance but " +
  14004. 'referenced during render. Make sure that this property is reactive, ' +
  14005. 'either in the data option, or for class-based components, by ' +
  14006. 'initializing the property. ' +
  14007. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  14008. target
  14009. );
  14010. };
  14011. var warnReservedPrefix = function (target, key) {
  14012. warn(
  14013. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  14014. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  14015. 'prevent conflicts with Vue internals. ' +
  14016. 'See: https://vuejs.org/v2/api/#data',
  14017. target
  14018. );
  14019. };
  14020. var hasProxy =
  14021. typeof Proxy !== 'undefined' && isNative(Proxy);
  14022. if (hasProxy) {
  14023. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  14024. config.keyCodes = new Proxy(config.keyCodes, {
  14025. set: function set (target, key, value) {
  14026. if (isBuiltInModifier(key)) {
  14027. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  14028. return false
  14029. } else {
  14030. target[key] = value;
  14031. return true
  14032. }
  14033. }
  14034. });
  14035. }
  14036. var hasHandler = {
  14037. has: function has (target, key) {
  14038. var has = key in target;
  14039. var isAllowed = allowedGlobals(key) ||
  14040. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  14041. if (!has && !isAllowed) {
  14042. if (key in target.$data) { warnReservedPrefix(target, key); }
  14043. else { warnNonPresent(target, key); }
  14044. }
  14045. return has || !isAllowed
  14046. }
  14047. };
  14048. var getHandler = {
  14049. get: function get (target, key) {
  14050. if (typeof key === 'string' && !(key in target)) {
  14051. if (key in target.$data) { warnReservedPrefix(target, key); }
  14052. else { warnNonPresent(target, key); }
  14053. }
  14054. return target[key]
  14055. }
  14056. };
  14057. initProxy = function initProxy (vm) {
  14058. if (hasProxy) {
  14059. // determine which proxy handler to use
  14060. var options = vm.$options;
  14061. var handlers = options.render && options.render._withStripped
  14062. ? getHandler
  14063. : hasHandler;
  14064. vm._renderProxy = new Proxy(vm, handlers);
  14065. } else {
  14066. vm._renderProxy = vm;
  14067. }
  14068. };
  14069. }
  14070. /* */
  14071. var seenObjects = new _Set();
  14072. /**
  14073. * Recursively traverse an object to evoke all converted
  14074. * getters, so that every nested property inside the object
  14075. * is collected as a "deep" dependency.
  14076. */
  14077. function traverse (val) {
  14078. _traverse(val, seenObjects);
  14079. seenObjects.clear();
  14080. }
  14081. function _traverse (val, seen) {
  14082. var i, keys;
  14083. var isA = Array.isArray(val);
  14084. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  14085. return
  14086. }
  14087. if (val.__ob__) {
  14088. var depId = val.__ob__.dep.id;
  14089. if (seen.has(depId)) {
  14090. return
  14091. }
  14092. seen.add(depId);
  14093. }
  14094. if (isA) {
  14095. i = val.length;
  14096. while (i--) { _traverse(val[i], seen); }
  14097. } else {
  14098. keys = Object.keys(val);
  14099. i = keys.length;
  14100. while (i--) { _traverse(val[keys[i]], seen); }
  14101. }
  14102. }
  14103. var mark;
  14104. var measure;
  14105. if (true) {
  14106. var perf = inBrowser && window.performance;
  14107. /* istanbul ignore if */
  14108. if (
  14109. perf &&
  14110. perf.mark &&
  14111. perf.measure &&
  14112. perf.clearMarks &&
  14113. perf.clearMeasures
  14114. ) {
  14115. mark = function (tag) { return perf.mark(tag); };
  14116. measure = function (name, startTag, endTag) {
  14117. perf.measure(name, startTag, endTag);
  14118. perf.clearMarks(startTag);
  14119. perf.clearMarks(endTag);
  14120. // perf.clearMeasures(name)
  14121. };
  14122. }
  14123. }
  14124. /* */
  14125. var normalizeEvent = cached(function (name) {
  14126. var passive = name.charAt(0) === '&';
  14127. name = passive ? name.slice(1) : name;
  14128. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  14129. name = once$$1 ? name.slice(1) : name;
  14130. var capture = name.charAt(0) === '!';
  14131. name = capture ? name.slice(1) : name;
  14132. return {
  14133. name: name,
  14134. once: once$$1,
  14135. capture: capture,
  14136. passive: passive
  14137. }
  14138. });
  14139. function createFnInvoker (fns, vm) {
  14140. function invoker () {
  14141. var arguments$1 = arguments;
  14142. var fns = invoker.fns;
  14143. if (Array.isArray(fns)) {
  14144. var cloned = fns.slice();
  14145. for (var i = 0; i < cloned.length; i++) {
  14146. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  14147. }
  14148. } else {
  14149. // return handler return value for single handlers
  14150. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  14151. }
  14152. }
  14153. invoker.fns = fns;
  14154. return invoker
  14155. }
  14156. function updateListeners (
  14157. on,
  14158. oldOn,
  14159. add,
  14160. remove$$1,
  14161. createOnceHandler,
  14162. vm
  14163. ) {
  14164. var name, def$$1, cur, old, event;
  14165. for (name in on) {
  14166. def$$1 = cur = on[name];
  14167. old = oldOn[name];
  14168. event = normalizeEvent(name);
  14169. if (isUndef(cur)) {
  14170. true && warn(
  14171. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  14172. vm
  14173. );
  14174. } else if (isUndef(old)) {
  14175. if (isUndef(cur.fns)) {
  14176. cur = on[name] = createFnInvoker(cur, vm);
  14177. }
  14178. if (isTrue(event.once)) {
  14179. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  14180. }
  14181. add(event.name, cur, event.capture, event.passive, event.params);
  14182. } else if (cur !== old) {
  14183. old.fns = cur;
  14184. on[name] = old;
  14185. }
  14186. }
  14187. for (name in oldOn) {
  14188. if (isUndef(on[name])) {
  14189. event = normalizeEvent(name);
  14190. remove$$1(event.name, oldOn[name], event.capture);
  14191. }
  14192. }
  14193. }
  14194. /* */
  14195. /* */
  14196. // fixed by xxxxxx (mp properties)
  14197. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  14198. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  14199. if (isUndef(propOptions)) {
  14200. return res
  14201. }
  14202. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  14203. var attrs = data.attrs;
  14204. var props = data.props;
  14205. if (isDef(attrs) || isDef(props)) {
  14206. for (var key in propOptions) {
  14207. var altKey = hyphenate(key);
  14208. var result = checkProp(res, props, key, altKey, true) ||
  14209. checkProp(res, attrs, key, altKey, false);
  14210. // externalClass
  14211. if (
  14212. result &&
  14213. res[key] &&
  14214. externalClasses.indexOf(altKey) !== -1 &&
  14215. context[camelize(res[key])]
  14216. ) {
  14217. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  14218. res[key] = context[camelize(res[key])];
  14219. }
  14220. }
  14221. }
  14222. return res
  14223. }
  14224. function extractPropsFromVNodeData (
  14225. data,
  14226. Ctor,
  14227. tag,
  14228. context// fixed by xxxxxx
  14229. ) {
  14230. // we are only extracting raw values here.
  14231. // validation and default values are handled in the child
  14232. // component itself.
  14233. var propOptions = Ctor.options.props;
  14234. if (isUndef(propOptions)) {
  14235. // fixed by xxxxxx
  14236. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  14237. }
  14238. var res = {};
  14239. var attrs = data.attrs;
  14240. var props = data.props;
  14241. if (isDef(attrs) || isDef(props)) {
  14242. for (var key in propOptions) {
  14243. var altKey = hyphenate(key);
  14244. if (true) {
  14245. var keyInLowerCase = key.toLowerCase();
  14246. if (
  14247. key !== keyInLowerCase &&
  14248. attrs && hasOwn(attrs, keyInLowerCase)
  14249. ) {
  14250. tip(
  14251. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  14252. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  14253. " \"" + key + "\". " +
  14254. "Note that HTML attributes are case-insensitive and camelCased " +
  14255. "props need to use their kebab-case equivalents when using in-DOM " +
  14256. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  14257. );
  14258. }
  14259. }
  14260. checkProp(res, props, key, altKey, true) ||
  14261. checkProp(res, attrs, key, altKey, false);
  14262. }
  14263. }
  14264. // fixed by xxxxxx
  14265. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  14266. }
  14267. function checkProp (
  14268. res,
  14269. hash,
  14270. key,
  14271. altKey,
  14272. preserve
  14273. ) {
  14274. if (isDef(hash)) {
  14275. if (hasOwn(hash, key)) {
  14276. res[key] = hash[key];
  14277. if (!preserve) {
  14278. delete hash[key];
  14279. }
  14280. return true
  14281. } else if (hasOwn(hash, altKey)) {
  14282. res[key] = hash[altKey];
  14283. if (!preserve) {
  14284. delete hash[altKey];
  14285. }
  14286. return true
  14287. }
  14288. }
  14289. return false
  14290. }
  14291. /* */
  14292. // The template compiler attempts to minimize the need for normalization by
  14293. // statically analyzing the template at compile time.
  14294. //
  14295. // For plain HTML markup, normalization can be completely skipped because the
  14296. // generated render function is guaranteed to return Array<VNode>. There are
  14297. // two cases where extra normalization is needed:
  14298. // 1. When the children contains components - because a functional component
  14299. // may return an Array instead of a single root. In this case, just a simple
  14300. // normalization is needed - if any child is an Array, we flatten the whole
  14301. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  14302. // because functional components already normalize their own children.
  14303. function simpleNormalizeChildren (children) {
  14304. for (var i = 0; i < children.length; i++) {
  14305. if (Array.isArray(children[i])) {
  14306. return Array.prototype.concat.apply([], children)
  14307. }
  14308. }
  14309. return children
  14310. }
  14311. // 2. When the children contains constructs that always generated nested Arrays,
  14312. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  14313. // with hand-written render functions / JSX. In such cases a full normalization
  14314. // is needed to cater to all possible types of children values.
  14315. function normalizeChildren (children) {
  14316. return isPrimitive(children)
  14317. ? [createTextVNode(children)]
  14318. : Array.isArray(children)
  14319. ? normalizeArrayChildren(children)
  14320. : undefined
  14321. }
  14322. function isTextNode (node) {
  14323. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  14324. }
  14325. function normalizeArrayChildren (children, nestedIndex) {
  14326. var res = [];
  14327. var i, c, lastIndex, last;
  14328. for (i = 0; i < children.length; i++) {
  14329. c = children[i];
  14330. if (isUndef(c) || typeof c === 'boolean') { continue }
  14331. lastIndex = res.length - 1;
  14332. last = res[lastIndex];
  14333. // nested
  14334. if (Array.isArray(c)) {
  14335. if (c.length > 0) {
  14336. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  14337. // merge adjacent text nodes
  14338. if (isTextNode(c[0]) && isTextNode(last)) {
  14339. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  14340. c.shift();
  14341. }
  14342. res.push.apply(res, c);
  14343. }
  14344. } else if (isPrimitive(c)) {
  14345. if (isTextNode(last)) {
  14346. // merge adjacent text nodes
  14347. // this is necessary for SSR hydration because text nodes are
  14348. // essentially merged when rendered to HTML strings
  14349. res[lastIndex] = createTextVNode(last.text + c);
  14350. } else if (c !== '') {
  14351. // convert primitive to vnode
  14352. res.push(createTextVNode(c));
  14353. }
  14354. } else {
  14355. if (isTextNode(c) && isTextNode(last)) {
  14356. // merge adjacent text nodes
  14357. res[lastIndex] = createTextVNode(last.text + c.text);
  14358. } else {
  14359. // default key for nested array children (likely generated by v-for)
  14360. if (isTrue(children._isVList) &&
  14361. isDef(c.tag) &&
  14362. isUndef(c.key) &&
  14363. isDef(nestedIndex)) {
  14364. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  14365. }
  14366. res.push(c);
  14367. }
  14368. }
  14369. }
  14370. return res
  14371. }
  14372. /* */
  14373. function initProvide (vm) {
  14374. var provide = vm.$options.provide;
  14375. if (provide) {
  14376. vm._provided = typeof provide === 'function'
  14377. ? provide.call(vm)
  14378. : provide;
  14379. }
  14380. }
  14381. function initInjections (vm) {
  14382. var result = resolveInject(vm.$options.inject, vm);
  14383. if (result) {
  14384. toggleObserving(false);
  14385. Object.keys(result).forEach(function (key) {
  14386. /* istanbul ignore else */
  14387. if (true) {
  14388. defineReactive$$1(vm, key, result[key], function () {
  14389. warn(
  14390. "Avoid mutating an injected value directly since the changes will be " +
  14391. "overwritten whenever the provided component re-renders. " +
  14392. "injection being mutated: \"" + key + "\"",
  14393. vm
  14394. );
  14395. });
  14396. } else {}
  14397. });
  14398. toggleObserving(true);
  14399. }
  14400. }
  14401. function resolveInject (inject, vm) {
  14402. if (inject) {
  14403. // inject is :any because flow is not smart enough to figure out cached
  14404. var result = Object.create(null);
  14405. var keys = hasSymbol
  14406. ? Reflect.ownKeys(inject)
  14407. : Object.keys(inject);
  14408. for (var i = 0; i < keys.length; i++) {
  14409. var key = keys[i];
  14410. // #6574 in case the inject object is observed...
  14411. if (key === '__ob__') { continue }
  14412. var provideKey = inject[key].from;
  14413. var source = vm;
  14414. while (source) {
  14415. if (source._provided && hasOwn(source._provided, provideKey)) {
  14416. result[key] = source._provided[provideKey];
  14417. break
  14418. }
  14419. source = source.$parent;
  14420. }
  14421. if (!source) {
  14422. if ('default' in inject[key]) {
  14423. var provideDefault = inject[key].default;
  14424. result[key] = typeof provideDefault === 'function'
  14425. ? provideDefault.call(vm)
  14426. : provideDefault;
  14427. } else if (true) {
  14428. warn(("Injection \"" + key + "\" not found"), vm);
  14429. }
  14430. }
  14431. }
  14432. return result
  14433. }
  14434. }
  14435. /* */
  14436. /**
  14437. * Runtime helper for resolving raw children VNodes into a slot object.
  14438. */
  14439. function resolveSlots (
  14440. children,
  14441. context
  14442. ) {
  14443. if (!children || !children.length) {
  14444. return {}
  14445. }
  14446. var slots = {};
  14447. for (var i = 0, l = children.length; i < l; i++) {
  14448. var child = children[i];
  14449. var data = child.data;
  14450. // remove slot attribute if the node is resolved as a Vue slot node
  14451. if (data && data.attrs && data.attrs.slot) {
  14452. delete data.attrs.slot;
  14453. }
  14454. // named slots should only be respected if the vnode was rendered in the
  14455. // same context.
  14456. if ((child.context === context || child.fnContext === context) &&
  14457. data && data.slot != null
  14458. ) {
  14459. var name = data.slot;
  14460. var slot = (slots[name] || (slots[name] = []));
  14461. if (child.tag === 'template') {
  14462. slot.push.apply(slot, child.children || []);
  14463. } else {
  14464. slot.push(child);
  14465. }
  14466. } else {
  14467. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  14468. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  14469. (slots['page'] || (slots['page'] = [])).push(child);
  14470. }else{
  14471. (slots.default || (slots.default = [])).push(child);
  14472. }
  14473. }
  14474. }
  14475. // ignore slots that contains only whitespace
  14476. for (var name$1 in slots) {
  14477. if (slots[name$1].every(isWhitespace)) {
  14478. delete slots[name$1];
  14479. }
  14480. }
  14481. return slots
  14482. }
  14483. function isWhitespace (node) {
  14484. return (node.isComment && !node.asyncFactory) || node.text === ' '
  14485. }
  14486. /* */
  14487. function normalizeScopedSlots (
  14488. slots,
  14489. normalSlots,
  14490. prevSlots
  14491. ) {
  14492. var res;
  14493. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  14494. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  14495. var key = slots && slots.$key;
  14496. if (!slots) {
  14497. res = {};
  14498. } else if (slots._normalized) {
  14499. // fast path 1: child component re-render only, parent did not change
  14500. return slots._normalized
  14501. } else if (
  14502. isStable &&
  14503. prevSlots &&
  14504. prevSlots !== emptyObject &&
  14505. key === prevSlots.$key &&
  14506. !hasNormalSlots &&
  14507. !prevSlots.$hasNormal
  14508. ) {
  14509. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  14510. // only need to normalize once
  14511. return prevSlots
  14512. } else {
  14513. res = {};
  14514. for (var key$1 in slots) {
  14515. if (slots[key$1] && key$1[0] !== '$') {
  14516. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  14517. }
  14518. }
  14519. }
  14520. // expose normal slots on scopedSlots
  14521. for (var key$2 in normalSlots) {
  14522. if (!(key$2 in res)) {
  14523. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  14524. }
  14525. }
  14526. // avoriaz seems to mock a non-extensible $scopedSlots object
  14527. // and when that is passed down this would cause an error
  14528. if (slots && Object.isExtensible(slots)) {
  14529. (slots)._normalized = res;
  14530. }
  14531. def(res, '$stable', isStable);
  14532. def(res, '$key', key);
  14533. def(res, '$hasNormal', hasNormalSlots);
  14534. return res
  14535. }
  14536. function normalizeScopedSlot(normalSlots, key, fn) {
  14537. var normalized = function () {
  14538. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  14539. res = res && typeof res === 'object' && !Array.isArray(res)
  14540. ? [res] // single vnode
  14541. : normalizeChildren(res);
  14542. return res && (
  14543. res.length === 0 ||
  14544. (res.length === 1 && res[0].isComment) // #9658
  14545. ) ? undefined
  14546. : res
  14547. };
  14548. // this is a slot using the new v-slot syntax without scope. although it is
  14549. // compiled as a scoped slot, render fn users would expect it to be present
  14550. // on this.$slots because the usage is semantically a normal slot.
  14551. if (fn.proxy) {
  14552. Object.defineProperty(normalSlots, key, {
  14553. get: normalized,
  14554. enumerable: true,
  14555. configurable: true
  14556. });
  14557. }
  14558. return normalized
  14559. }
  14560. function proxyNormalSlot(slots, key) {
  14561. return function () { return slots[key]; }
  14562. }
  14563. /* */
  14564. /**
  14565. * Runtime helper for rendering v-for lists.
  14566. */
  14567. function renderList (
  14568. val,
  14569. render
  14570. ) {
  14571. var ret, i, l, keys, key;
  14572. if (Array.isArray(val) || typeof val === 'string') {
  14573. ret = new Array(val.length);
  14574. for (i = 0, l = val.length; i < l; i++) {
  14575. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  14576. }
  14577. } else if (typeof val === 'number') {
  14578. ret = new Array(val);
  14579. for (i = 0; i < val; i++) {
  14580. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  14581. }
  14582. } else if (isObject(val)) {
  14583. if (hasSymbol && val[Symbol.iterator]) {
  14584. ret = [];
  14585. var iterator = val[Symbol.iterator]();
  14586. var result = iterator.next();
  14587. while (!result.done) {
  14588. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  14589. result = iterator.next();
  14590. }
  14591. } else {
  14592. keys = Object.keys(val);
  14593. ret = new Array(keys.length);
  14594. for (i = 0, l = keys.length; i < l; i++) {
  14595. key = keys[i];
  14596. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  14597. }
  14598. }
  14599. }
  14600. if (!isDef(ret)) {
  14601. ret = [];
  14602. }
  14603. (ret)._isVList = true;
  14604. return ret
  14605. }
  14606. /* */
  14607. /**
  14608. * Runtime helper for rendering <slot>
  14609. */
  14610. function renderSlot (
  14611. name,
  14612. fallback,
  14613. props,
  14614. bindObject
  14615. ) {
  14616. var scopedSlotFn = this.$scopedSlots[name];
  14617. var nodes;
  14618. if (scopedSlotFn) { // scoped slot
  14619. props = props || {};
  14620. if (bindObject) {
  14621. if ( true && !isObject(bindObject)) {
  14622. warn(
  14623. 'slot v-bind without argument expects an Object',
  14624. this
  14625. );
  14626. }
  14627. props = extend(extend({}, bindObject), props);
  14628. }
  14629. // fixed by xxxxxx app-plus scopedSlot
  14630. nodes = scopedSlotFn(props, this, props._i) || fallback;
  14631. } else {
  14632. nodes = this.$slots[name] || fallback;
  14633. }
  14634. var target = props && props.slot;
  14635. if (target) {
  14636. return this.$createElement('template', { slot: target }, nodes)
  14637. } else {
  14638. return nodes
  14639. }
  14640. }
  14641. /* */
  14642. /**
  14643. * Runtime helper for resolving filters
  14644. */
  14645. function resolveFilter (id) {
  14646. return resolveAsset(this.$options, 'filters', id, true) || identity
  14647. }
  14648. /* */
  14649. function isKeyNotMatch (expect, actual) {
  14650. if (Array.isArray(expect)) {
  14651. return expect.indexOf(actual) === -1
  14652. } else {
  14653. return expect !== actual
  14654. }
  14655. }
  14656. /**
  14657. * Runtime helper for checking keyCodes from config.
  14658. * exposed as Vue.prototype._k
  14659. * passing in eventKeyName as last argument separately for backwards compat
  14660. */
  14661. function checkKeyCodes (
  14662. eventKeyCode,
  14663. key,
  14664. builtInKeyCode,
  14665. eventKeyName,
  14666. builtInKeyName
  14667. ) {
  14668. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  14669. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  14670. return isKeyNotMatch(builtInKeyName, eventKeyName)
  14671. } else if (mappedKeyCode) {
  14672. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  14673. } else if (eventKeyName) {
  14674. return hyphenate(eventKeyName) !== key
  14675. }
  14676. }
  14677. /* */
  14678. /**
  14679. * Runtime helper for merging v-bind="object" into a VNode's data.
  14680. */
  14681. function bindObjectProps (
  14682. data,
  14683. tag,
  14684. value,
  14685. asProp,
  14686. isSync
  14687. ) {
  14688. if (value) {
  14689. if (!isObject(value)) {
  14690. true && warn(
  14691. 'v-bind without argument expects an Object or Array value',
  14692. this
  14693. );
  14694. } else {
  14695. if (Array.isArray(value)) {
  14696. value = toObject(value);
  14697. }
  14698. var hash;
  14699. var loop = function ( key ) {
  14700. if (
  14701. key === 'class' ||
  14702. key === 'style' ||
  14703. isReservedAttribute(key)
  14704. ) {
  14705. hash = data;
  14706. } else {
  14707. var type = data.attrs && data.attrs.type;
  14708. hash = asProp || config.mustUseProp(tag, type, key)
  14709. ? data.domProps || (data.domProps = {})
  14710. : data.attrs || (data.attrs = {});
  14711. }
  14712. var camelizedKey = camelize(key);
  14713. var hyphenatedKey = hyphenate(key);
  14714. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  14715. hash[key] = value[key];
  14716. if (isSync) {
  14717. var on = data.on || (data.on = {});
  14718. on[("update:" + key)] = function ($event) {
  14719. value[key] = $event;
  14720. };
  14721. }
  14722. }
  14723. };
  14724. for (var key in value) loop( key );
  14725. }
  14726. }
  14727. return data
  14728. }
  14729. /* */
  14730. /**
  14731. * Runtime helper for rendering static trees.
  14732. */
  14733. function renderStatic (
  14734. index,
  14735. isInFor
  14736. ) {
  14737. var cached = this._staticTrees || (this._staticTrees = []);
  14738. var tree = cached[index];
  14739. // if has already-rendered static tree and not inside v-for,
  14740. // we can reuse the same tree.
  14741. if (tree && !isInFor) {
  14742. return tree
  14743. }
  14744. // otherwise, render a fresh tree.
  14745. tree = cached[index] = this.$options.staticRenderFns[index].call(
  14746. this._renderProxy,
  14747. null,
  14748. this // for render fns generated for functional component templates
  14749. );
  14750. markStatic(tree, ("__static__" + index), false);
  14751. return tree
  14752. }
  14753. /**
  14754. * Runtime helper for v-once.
  14755. * Effectively it means marking the node as static with a unique key.
  14756. */
  14757. function markOnce (
  14758. tree,
  14759. index,
  14760. key
  14761. ) {
  14762. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  14763. return tree
  14764. }
  14765. function markStatic (
  14766. tree,
  14767. key,
  14768. isOnce
  14769. ) {
  14770. if (Array.isArray(tree)) {
  14771. for (var i = 0; i < tree.length; i++) {
  14772. if (tree[i] && typeof tree[i] !== 'string') {
  14773. markStaticNode(tree[i], (key + "_" + i), isOnce);
  14774. }
  14775. }
  14776. } else {
  14777. markStaticNode(tree, key, isOnce);
  14778. }
  14779. }
  14780. function markStaticNode (node, key, isOnce) {
  14781. node.isStatic = true;
  14782. node.key = key;
  14783. node.isOnce = isOnce;
  14784. }
  14785. /* */
  14786. function bindObjectListeners (data, value) {
  14787. if (value) {
  14788. if (!isPlainObject(value)) {
  14789. true && warn(
  14790. 'v-on without argument expects an Object value',
  14791. this
  14792. );
  14793. } else {
  14794. var on = data.on = data.on ? extend({}, data.on) : {};
  14795. for (var key in value) {
  14796. var existing = on[key];
  14797. var ours = value[key];
  14798. on[key] = existing ? [].concat(existing, ours) : ours;
  14799. }
  14800. }
  14801. }
  14802. return data
  14803. }
  14804. /* */
  14805. function resolveScopedSlots (
  14806. fns, // see flow/vnode
  14807. res,
  14808. // the following are added in 2.6
  14809. hasDynamicKeys,
  14810. contentHashKey
  14811. ) {
  14812. res = res || { $stable: !hasDynamicKeys };
  14813. for (var i = 0; i < fns.length; i++) {
  14814. var slot = fns[i];
  14815. if (Array.isArray(slot)) {
  14816. resolveScopedSlots(slot, res, hasDynamicKeys);
  14817. } else if (slot) {
  14818. // marker for reverse proxying v-slot without scope on this.$slots
  14819. if (slot.proxy) {
  14820. slot.fn.proxy = true;
  14821. }
  14822. res[slot.key] = slot.fn;
  14823. }
  14824. }
  14825. if (contentHashKey) {
  14826. (res).$key = contentHashKey;
  14827. }
  14828. return res
  14829. }
  14830. /* */
  14831. function bindDynamicKeys (baseObj, values) {
  14832. for (var i = 0; i < values.length; i += 2) {
  14833. var key = values[i];
  14834. if (typeof key === 'string' && key) {
  14835. baseObj[values[i]] = values[i + 1];
  14836. } else if ( true && key !== '' && key !== null) {
  14837. // null is a special value for explicitly removing a binding
  14838. warn(
  14839. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  14840. this
  14841. );
  14842. }
  14843. }
  14844. return baseObj
  14845. }
  14846. // helper to dynamically append modifier runtime markers to event names.
  14847. // ensure only append when value is already string, otherwise it will be cast
  14848. // to string and cause the type check to miss.
  14849. function prependModifier (value, symbol) {
  14850. return typeof value === 'string' ? symbol + value : value
  14851. }
  14852. /* */
  14853. function installRenderHelpers (target) {
  14854. target._o = markOnce;
  14855. target._n = toNumber;
  14856. target._s = toString;
  14857. target._l = renderList;
  14858. target._t = renderSlot;
  14859. target._q = looseEqual;
  14860. target._i = looseIndexOf;
  14861. target._m = renderStatic;
  14862. target._f = resolveFilter;
  14863. target._k = checkKeyCodes;
  14864. target._b = bindObjectProps;
  14865. target._v = createTextVNode;
  14866. target._e = createEmptyVNode;
  14867. target._u = resolveScopedSlots;
  14868. target._g = bindObjectListeners;
  14869. target._d = bindDynamicKeys;
  14870. target._p = prependModifier;
  14871. }
  14872. /* */
  14873. function FunctionalRenderContext (
  14874. data,
  14875. props,
  14876. children,
  14877. parent,
  14878. Ctor
  14879. ) {
  14880. var this$1 = this;
  14881. var options = Ctor.options;
  14882. // ensure the createElement function in functional components
  14883. // gets a unique context - this is necessary for correct named slot check
  14884. var contextVm;
  14885. if (hasOwn(parent, '_uid')) {
  14886. contextVm = Object.create(parent);
  14887. // $flow-disable-line
  14888. contextVm._original = parent;
  14889. } else {
  14890. // the context vm passed in is a functional context as well.
  14891. // in this case we want to make sure we are able to get a hold to the
  14892. // real context instance.
  14893. contextVm = parent;
  14894. // $flow-disable-line
  14895. parent = parent._original;
  14896. }
  14897. var isCompiled = isTrue(options._compiled);
  14898. var needNormalization = !isCompiled;
  14899. this.data = data;
  14900. this.props = props;
  14901. this.children = children;
  14902. this.parent = parent;
  14903. this.listeners = data.on || emptyObject;
  14904. this.injections = resolveInject(options.inject, parent);
  14905. this.slots = function () {
  14906. if (!this$1.$slots) {
  14907. normalizeScopedSlots(
  14908. data.scopedSlots,
  14909. this$1.$slots = resolveSlots(children, parent)
  14910. );
  14911. }
  14912. return this$1.$slots
  14913. };
  14914. Object.defineProperty(this, 'scopedSlots', ({
  14915. enumerable: true,
  14916. get: function get () {
  14917. return normalizeScopedSlots(data.scopedSlots, this.slots())
  14918. }
  14919. }));
  14920. // support for compiled functional template
  14921. if (isCompiled) {
  14922. // exposing $options for renderStatic()
  14923. this.$options = options;
  14924. // pre-resolve slots for renderSlot()
  14925. this.$slots = this.slots();
  14926. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  14927. }
  14928. if (options._scopeId) {
  14929. this._c = function (a, b, c, d) {
  14930. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  14931. if (vnode && !Array.isArray(vnode)) {
  14932. vnode.fnScopeId = options._scopeId;
  14933. vnode.fnContext = parent;
  14934. }
  14935. return vnode
  14936. };
  14937. } else {
  14938. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  14939. }
  14940. }
  14941. installRenderHelpers(FunctionalRenderContext.prototype);
  14942. function createFunctionalComponent (
  14943. Ctor,
  14944. propsData,
  14945. data,
  14946. contextVm,
  14947. children
  14948. ) {
  14949. var options = Ctor.options;
  14950. var props = {};
  14951. var propOptions = options.props;
  14952. if (isDef(propOptions)) {
  14953. for (var key in propOptions) {
  14954. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  14955. }
  14956. } else {
  14957. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  14958. if (isDef(data.props)) { mergeProps(props, data.props); }
  14959. }
  14960. var renderContext = new FunctionalRenderContext(
  14961. data,
  14962. props,
  14963. children,
  14964. contextVm,
  14965. Ctor
  14966. );
  14967. var vnode = options.render.call(null, renderContext._c, renderContext);
  14968. if (vnode instanceof VNode) {
  14969. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  14970. } else if (Array.isArray(vnode)) {
  14971. var vnodes = normalizeChildren(vnode) || [];
  14972. var res = new Array(vnodes.length);
  14973. for (var i = 0; i < vnodes.length; i++) {
  14974. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  14975. }
  14976. return res
  14977. }
  14978. }
  14979. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  14980. // #7817 clone node before setting fnContext, otherwise if the node is reused
  14981. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  14982. // that should not be matched to match.
  14983. var clone = cloneVNode(vnode);
  14984. clone.fnContext = contextVm;
  14985. clone.fnOptions = options;
  14986. if (true) {
  14987. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  14988. }
  14989. if (data.slot) {
  14990. (clone.data || (clone.data = {})).slot = data.slot;
  14991. }
  14992. return clone
  14993. }
  14994. function mergeProps (to, from) {
  14995. for (var key in from) {
  14996. to[camelize(key)] = from[key];
  14997. }
  14998. }
  14999. /* */
  15000. /* */
  15001. /* */
  15002. /* */
  15003. // inline hooks to be invoked on component VNodes during patch
  15004. var componentVNodeHooks = {
  15005. init: function init (vnode, hydrating) {
  15006. if (
  15007. vnode.componentInstance &&
  15008. !vnode.componentInstance._isDestroyed &&
  15009. vnode.data.keepAlive
  15010. ) {
  15011. // kept-alive components, treat as a patch
  15012. var mountedNode = vnode; // work around flow
  15013. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  15014. } else {
  15015. var child = vnode.componentInstance = createComponentInstanceForVnode(
  15016. vnode,
  15017. activeInstance
  15018. );
  15019. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  15020. }
  15021. },
  15022. prepatch: function prepatch (oldVnode, vnode) {
  15023. var options = vnode.componentOptions;
  15024. var child = vnode.componentInstance = oldVnode.componentInstance;
  15025. updateChildComponent(
  15026. child,
  15027. options.propsData, // updated props
  15028. options.listeners, // updated listeners
  15029. vnode, // new parent vnode
  15030. options.children // new children
  15031. );
  15032. },
  15033. insert: function insert (vnode) {
  15034. var context = vnode.context;
  15035. var componentInstance = vnode.componentInstance;
  15036. if (!componentInstance._isMounted) {
  15037. callHook(componentInstance, 'onServiceCreated');
  15038. callHook(componentInstance, 'onServiceAttached');
  15039. componentInstance._isMounted = true;
  15040. callHook(componentInstance, 'mounted');
  15041. }
  15042. if (vnode.data.keepAlive) {
  15043. if (context._isMounted) {
  15044. // vue-router#1212
  15045. // During updates, a kept-alive component's child components may
  15046. // change, so directly walking the tree here may call activated hooks
  15047. // on incorrect children. Instead we push them into a queue which will
  15048. // be processed after the whole patch process ended.
  15049. queueActivatedComponent(componentInstance);
  15050. } else {
  15051. activateChildComponent(componentInstance, true /* direct */);
  15052. }
  15053. }
  15054. },
  15055. destroy: function destroy (vnode) {
  15056. var componentInstance = vnode.componentInstance;
  15057. if (!componentInstance._isDestroyed) {
  15058. if (!vnode.data.keepAlive) {
  15059. componentInstance.$destroy();
  15060. } else {
  15061. deactivateChildComponent(componentInstance, true /* direct */);
  15062. }
  15063. }
  15064. }
  15065. };
  15066. var hooksToMerge = Object.keys(componentVNodeHooks);
  15067. function createComponent (
  15068. Ctor,
  15069. data,
  15070. context,
  15071. children,
  15072. tag
  15073. ) {
  15074. if (isUndef(Ctor)) {
  15075. return
  15076. }
  15077. var baseCtor = context.$options._base;
  15078. // plain options object: turn it into a constructor
  15079. if (isObject(Ctor)) {
  15080. Ctor = baseCtor.extend(Ctor);
  15081. }
  15082. // if at this stage it's not a constructor or an async component factory,
  15083. // reject.
  15084. if (typeof Ctor !== 'function') {
  15085. if (true) {
  15086. warn(("Invalid Component definition: " + (String(Ctor))), context);
  15087. }
  15088. return
  15089. }
  15090. // async component
  15091. var asyncFactory;
  15092. if (isUndef(Ctor.cid)) {
  15093. asyncFactory = Ctor;
  15094. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  15095. if (Ctor === undefined) {
  15096. // return a placeholder node for async component, which is rendered
  15097. // as a comment node but preserves all the raw information for the node.
  15098. // the information will be used for async server-rendering and hydration.
  15099. return createAsyncPlaceholder(
  15100. asyncFactory,
  15101. data,
  15102. context,
  15103. children,
  15104. tag
  15105. )
  15106. }
  15107. }
  15108. data = data || {};
  15109. // resolve constructor options in case global mixins are applied after
  15110. // component constructor creation
  15111. resolveConstructorOptions(Ctor);
  15112. // transform component v-model data into props & events
  15113. if (isDef(data.model)) {
  15114. transformModel(Ctor.options, data);
  15115. }
  15116. // extract props
  15117. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  15118. // functional component
  15119. if (isTrue(Ctor.options.functional)) {
  15120. return createFunctionalComponent(Ctor, propsData, data, context, children)
  15121. }
  15122. // extract listeners, since these needs to be treated as
  15123. // child component listeners instead of DOM listeners
  15124. var listeners = data.on;
  15125. // replace with listeners with .native modifier
  15126. // so it gets processed during parent component patch.
  15127. data.on = data.nativeOn;
  15128. if (isTrue(Ctor.options.abstract)) {
  15129. // abstract components do not keep anything
  15130. // other than props & listeners & slot
  15131. // work around flow
  15132. var slot = data.slot;
  15133. data = {};
  15134. if (slot) {
  15135. data.slot = slot;
  15136. }
  15137. }
  15138. // install component management hooks onto the placeholder node
  15139. installComponentHooks(data);
  15140. // return a placeholder vnode
  15141. var name = Ctor.options.name || tag;
  15142. var vnode = new VNode(
  15143. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  15144. data, undefined, undefined, undefined, context,
  15145. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  15146. asyncFactory
  15147. );
  15148. return vnode
  15149. }
  15150. function createComponentInstanceForVnode (
  15151. vnode, // we know it's MountedComponentVNode but flow doesn't
  15152. parent // activeInstance in lifecycle state
  15153. ) {
  15154. var options = {
  15155. _isComponent: true,
  15156. _parentVnode: vnode,
  15157. parent: parent
  15158. };
  15159. // check inline-template render functions
  15160. var inlineTemplate = vnode.data.inlineTemplate;
  15161. if (isDef(inlineTemplate)) {
  15162. options.render = inlineTemplate.render;
  15163. options.staticRenderFns = inlineTemplate.staticRenderFns;
  15164. }
  15165. return new vnode.componentOptions.Ctor(options)
  15166. }
  15167. function installComponentHooks (data) {
  15168. var hooks = data.hook || (data.hook = {});
  15169. for (var i = 0; i < hooksToMerge.length; i++) {
  15170. var key = hooksToMerge[i];
  15171. var existing = hooks[key];
  15172. var toMerge = componentVNodeHooks[key];
  15173. if (existing !== toMerge && !(existing && existing._merged)) {
  15174. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  15175. }
  15176. }
  15177. }
  15178. function mergeHook$1 (f1, f2) {
  15179. var merged = function (a, b) {
  15180. // flow complains about extra args which is why we use any
  15181. f1(a, b);
  15182. f2(a, b);
  15183. };
  15184. merged._merged = true;
  15185. return merged
  15186. }
  15187. // transform component v-model info (value and callback) into
  15188. // prop and event handler respectively.
  15189. function transformModel (options, data) {
  15190. var prop = (options.model && options.model.prop) || 'value';
  15191. var event = (options.model && options.model.event) || 'input'
  15192. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  15193. var on = data.on || (data.on = {});
  15194. var existing = on[event];
  15195. var callback = data.model.callback;
  15196. if (isDef(existing)) {
  15197. if (
  15198. Array.isArray(existing)
  15199. ? existing.indexOf(callback) === -1
  15200. : existing !== callback
  15201. ) {
  15202. on[event] = [callback].concat(existing);
  15203. }
  15204. } else {
  15205. on[event] = callback;
  15206. }
  15207. }
  15208. /* */
  15209. var SIMPLE_NORMALIZE = 1;
  15210. var ALWAYS_NORMALIZE = 2;
  15211. // wrapper function for providing a more flexible interface
  15212. // without getting yelled at by flow
  15213. function createElement (
  15214. context,
  15215. tag,
  15216. data,
  15217. children,
  15218. normalizationType,
  15219. alwaysNormalize
  15220. ) {
  15221. if (Array.isArray(data) || isPrimitive(data)) {
  15222. normalizationType = children;
  15223. children = data;
  15224. data = undefined;
  15225. }
  15226. if (isTrue(alwaysNormalize)) {
  15227. normalizationType = ALWAYS_NORMALIZE;
  15228. }
  15229. return _createElement(context, tag, data, children, normalizationType)
  15230. }
  15231. function _createElement (
  15232. context,
  15233. tag,
  15234. data,
  15235. children,
  15236. normalizationType
  15237. ) {
  15238. if (isDef(data) && isDef((data).__ob__)) {
  15239. true && warn(
  15240. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  15241. 'Always create fresh vnode data objects in each render!',
  15242. context
  15243. );
  15244. return createEmptyVNode()
  15245. }
  15246. // object syntax in v-bind
  15247. if (isDef(data) && isDef(data.is)) {
  15248. tag = data.is;
  15249. }
  15250. if (!tag) {
  15251. // in case of component :is set to falsy value
  15252. return createEmptyVNode()
  15253. }
  15254. // warn against non-primitive key
  15255. if ( true &&
  15256. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  15257. ) {
  15258. {
  15259. warn(
  15260. 'Avoid using non-primitive value as key, ' +
  15261. 'use string/number value instead.',
  15262. context
  15263. );
  15264. }
  15265. }
  15266. // support single function children as default scoped slot
  15267. if (Array.isArray(children) &&
  15268. typeof children[0] === 'function'
  15269. ) {
  15270. data = data || {};
  15271. data.scopedSlots = { default: children[0] };
  15272. children.length = 0;
  15273. }
  15274. if (normalizationType === ALWAYS_NORMALIZE) {
  15275. children = normalizeChildren(children);
  15276. } else if (normalizationType === SIMPLE_NORMALIZE) {
  15277. children = simpleNormalizeChildren(children);
  15278. }
  15279. var vnode, ns;
  15280. if (typeof tag === 'string') {
  15281. var Ctor;
  15282. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  15283. if (config.isReservedTag(tag)) {
  15284. // platform built-in elements
  15285. if ( true && isDef(data) && isDef(data.nativeOn)) {
  15286. warn(
  15287. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  15288. context
  15289. );
  15290. }
  15291. vnode = new VNode(
  15292. config.parsePlatformTagName(tag), data, children,
  15293. undefined, undefined, context
  15294. );
  15295. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  15296. // component
  15297. vnode = createComponent(Ctor, data, context, children, tag);
  15298. } else {
  15299. // unknown or unlisted namespaced elements
  15300. // check at runtime because it may get assigned a namespace when its
  15301. // parent normalizes children
  15302. vnode = new VNode(
  15303. tag, data, children,
  15304. undefined, undefined, context
  15305. );
  15306. }
  15307. } else {
  15308. // direct component options / constructor
  15309. vnode = createComponent(tag, data, context, children);
  15310. }
  15311. if (Array.isArray(vnode)) {
  15312. return vnode
  15313. } else if (isDef(vnode)) {
  15314. if (isDef(ns)) { applyNS(vnode, ns); }
  15315. if (isDef(data)) { registerDeepBindings(data); }
  15316. return vnode
  15317. } else {
  15318. return createEmptyVNode()
  15319. }
  15320. }
  15321. function applyNS (vnode, ns, force) {
  15322. vnode.ns = ns;
  15323. if (vnode.tag === 'foreignObject') {
  15324. // use default namespace inside foreignObject
  15325. ns = undefined;
  15326. force = true;
  15327. }
  15328. if (isDef(vnode.children)) {
  15329. for (var i = 0, l = vnode.children.length; i < l; i++) {
  15330. var child = vnode.children[i];
  15331. if (isDef(child.tag) && (
  15332. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  15333. applyNS(child, ns, force);
  15334. }
  15335. }
  15336. }
  15337. }
  15338. // ref #5318
  15339. // necessary to ensure parent re-render when deep bindings like :style and
  15340. // :class are used on slot nodes
  15341. function registerDeepBindings (data) {
  15342. if (isObject(data.style)) {
  15343. traverse(data.style);
  15344. }
  15345. if (isObject(data.class)) {
  15346. traverse(data.class);
  15347. }
  15348. }
  15349. /* */
  15350. function initRender (vm) {
  15351. vm._vnode = null; // the root of the child tree
  15352. vm._staticTrees = null; // v-once cached trees
  15353. var options = vm.$options;
  15354. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  15355. var renderContext = parentVnode && parentVnode.context;
  15356. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  15357. vm.$scopedSlots = emptyObject;
  15358. // bind the createElement fn to this instance
  15359. // so that we get proper render context inside it.
  15360. // args order: tag, data, children, normalizationType, alwaysNormalize
  15361. // internal version is used by render functions compiled from templates
  15362. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  15363. // normalization is always applied for the public version, used in
  15364. // user-written render functions.
  15365. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  15366. // $attrs & $listeners are exposed for easier HOC creation.
  15367. // they need to be reactive so that HOCs using them are always updated
  15368. var parentData = parentVnode && parentVnode.data;
  15369. /* istanbul ignore else */
  15370. if (true) {
  15371. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  15372. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  15373. }, true);
  15374. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  15375. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  15376. }, true);
  15377. } else {}
  15378. }
  15379. var currentRenderingInstance = null;
  15380. function renderMixin (Vue) {
  15381. // install runtime convenience helpers
  15382. installRenderHelpers(Vue.prototype);
  15383. Vue.prototype.$nextTick = function (fn) {
  15384. return nextTick(fn, this)
  15385. };
  15386. Vue.prototype._render = function () {
  15387. var vm = this;
  15388. var ref = vm.$options;
  15389. var render = ref.render;
  15390. var _parentVnode = ref._parentVnode;
  15391. if (_parentVnode) {
  15392. vm.$scopedSlots = normalizeScopedSlots(
  15393. _parentVnode.data.scopedSlots,
  15394. vm.$slots,
  15395. vm.$scopedSlots
  15396. );
  15397. }
  15398. // set parent vnode. this allows render functions to have access
  15399. // to the data on the placeholder node.
  15400. vm.$vnode = _parentVnode;
  15401. // render self
  15402. var vnode;
  15403. try {
  15404. // There's no need to maintain a stack because all render fns are called
  15405. // separately from one another. Nested component's render fns are called
  15406. // when parent component is patched.
  15407. currentRenderingInstance = vm;
  15408. vnode = render.call(vm._renderProxy, vm.$createElement);
  15409. } catch (e) {
  15410. handleError(e, vm, "render");
  15411. // return error render result,
  15412. // or previous vnode to prevent render error causing blank component
  15413. /* istanbul ignore else */
  15414. if ( true && vm.$options.renderError) {
  15415. try {
  15416. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  15417. } catch (e) {
  15418. handleError(e, vm, "renderError");
  15419. vnode = vm._vnode;
  15420. }
  15421. } else {
  15422. vnode = vm._vnode;
  15423. }
  15424. } finally {
  15425. currentRenderingInstance = null;
  15426. }
  15427. // if the returned array contains only a single node, allow it
  15428. if (Array.isArray(vnode) && vnode.length === 1) {
  15429. vnode = vnode[0];
  15430. }
  15431. // return empty vnode in case the render function errored out
  15432. if (!(vnode instanceof VNode)) {
  15433. if ( true && Array.isArray(vnode)) {
  15434. warn(
  15435. 'Multiple root nodes returned from render function. Render function ' +
  15436. 'should return a single root node.',
  15437. vm
  15438. );
  15439. }
  15440. vnode = createEmptyVNode();
  15441. }
  15442. // set parent
  15443. vnode.parent = _parentVnode;
  15444. return vnode
  15445. };
  15446. }
  15447. /* */
  15448. function ensureCtor (comp, base) {
  15449. if (
  15450. comp.__esModule ||
  15451. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  15452. ) {
  15453. comp = comp.default;
  15454. }
  15455. return isObject(comp)
  15456. ? base.extend(comp)
  15457. : comp
  15458. }
  15459. function createAsyncPlaceholder (
  15460. factory,
  15461. data,
  15462. context,
  15463. children,
  15464. tag
  15465. ) {
  15466. var node = createEmptyVNode();
  15467. node.asyncFactory = factory;
  15468. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  15469. return node
  15470. }
  15471. function resolveAsyncComponent (
  15472. factory,
  15473. baseCtor
  15474. ) {
  15475. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  15476. return factory.errorComp
  15477. }
  15478. if (isDef(factory.resolved)) {
  15479. return factory.resolved
  15480. }
  15481. var owner = currentRenderingInstance;
  15482. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  15483. // already pending
  15484. factory.owners.push(owner);
  15485. }
  15486. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  15487. return factory.loadingComp
  15488. }
  15489. if (owner && !isDef(factory.owners)) {
  15490. var owners = factory.owners = [owner];
  15491. var sync = true;
  15492. var timerLoading = null;
  15493. var timerTimeout = null
  15494. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  15495. var forceRender = function (renderCompleted) {
  15496. for (var i = 0, l = owners.length; i < l; i++) {
  15497. (owners[i]).$forceUpdate();
  15498. }
  15499. if (renderCompleted) {
  15500. owners.length = 0;
  15501. if (timerLoading !== null) {
  15502. clearTimeout(timerLoading);
  15503. timerLoading = null;
  15504. }
  15505. if (timerTimeout !== null) {
  15506. clearTimeout(timerTimeout);
  15507. timerTimeout = null;
  15508. }
  15509. }
  15510. };
  15511. var resolve = once(function (res) {
  15512. // cache resolved
  15513. factory.resolved = ensureCtor(res, baseCtor);
  15514. // invoke callbacks only if this is not a synchronous resolve
  15515. // (async resolves are shimmed as synchronous during SSR)
  15516. if (!sync) {
  15517. forceRender(true);
  15518. } else {
  15519. owners.length = 0;
  15520. }
  15521. });
  15522. var reject = once(function (reason) {
  15523. true && warn(
  15524. "Failed to resolve async component: " + (String(factory)) +
  15525. (reason ? ("\nReason: " + reason) : '')
  15526. );
  15527. if (isDef(factory.errorComp)) {
  15528. factory.error = true;
  15529. forceRender(true);
  15530. }
  15531. });
  15532. var res = factory(resolve, reject);
  15533. if (isObject(res)) {
  15534. if (isPromise(res)) {
  15535. // () => Promise
  15536. if (isUndef(factory.resolved)) {
  15537. res.then(resolve, reject);
  15538. }
  15539. } else if (isPromise(res.component)) {
  15540. res.component.then(resolve, reject);
  15541. if (isDef(res.error)) {
  15542. factory.errorComp = ensureCtor(res.error, baseCtor);
  15543. }
  15544. if (isDef(res.loading)) {
  15545. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  15546. if (res.delay === 0) {
  15547. factory.loading = true;
  15548. } else {
  15549. timerLoading = setTimeout(function () {
  15550. timerLoading = null;
  15551. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  15552. factory.loading = true;
  15553. forceRender(false);
  15554. }
  15555. }, res.delay || 200);
  15556. }
  15557. }
  15558. if (isDef(res.timeout)) {
  15559. timerTimeout = setTimeout(function () {
  15560. timerTimeout = null;
  15561. if (isUndef(factory.resolved)) {
  15562. reject(
  15563. true
  15564. ? ("timeout (" + (res.timeout) + "ms)")
  15565. : undefined
  15566. );
  15567. }
  15568. }, res.timeout);
  15569. }
  15570. }
  15571. }
  15572. sync = false;
  15573. // return in case resolved synchronously
  15574. return factory.loading
  15575. ? factory.loadingComp
  15576. : factory.resolved
  15577. }
  15578. }
  15579. /* */
  15580. function isAsyncPlaceholder (node) {
  15581. return node.isComment && node.asyncFactory
  15582. }
  15583. /* */
  15584. function getFirstComponentChild (children) {
  15585. if (Array.isArray(children)) {
  15586. for (var i = 0; i < children.length; i++) {
  15587. var c = children[i];
  15588. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  15589. return c
  15590. }
  15591. }
  15592. }
  15593. }
  15594. /* */
  15595. /* */
  15596. function initEvents (vm) {
  15597. vm._events = Object.create(null);
  15598. vm._hasHookEvent = false;
  15599. // init parent attached events
  15600. var listeners = vm.$options._parentListeners;
  15601. if (listeners) {
  15602. updateComponentListeners(vm, listeners);
  15603. }
  15604. }
  15605. var target;
  15606. function add (event, fn) {
  15607. target.$on(event, fn);
  15608. }
  15609. function remove$1 (event, fn) {
  15610. target.$off(event, fn);
  15611. }
  15612. function createOnceHandler (event, fn) {
  15613. var _target = target;
  15614. return function onceHandler () {
  15615. var res = fn.apply(null, arguments);
  15616. if (res !== null) {
  15617. _target.$off(event, onceHandler);
  15618. }
  15619. }
  15620. }
  15621. function updateComponentListeners (
  15622. vm,
  15623. listeners,
  15624. oldListeners
  15625. ) {
  15626. target = vm;
  15627. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  15628. target = undefined;
  15629. }
  15630. function eventsMixin (Vue) {
  15631. var hookRE = /^hook:/;
  15632. Vue.prototype.$on = function (event, fn) {
  15633. var vm = this;
  15634. if (Array.isArray(event)) {
  15635. for (var i = 0, l = event.length; i < l; i++) {
  15636. vm.$on(event[i], fn);
  15637. }
  15638. } else {
  15639. (vm._events[event] || (vm._events[event] = [])).push(fn);
  15640. // optimize hook:event cost by using a boolean flag marked at registration
  15641. // instead of a hash lookup
  15642. if (hookRE.test(event)) {
  15643. vm._hasHookEvent = true;
  15644. }
  15645. }
  15646. return vm
  15647. };
  15648. Vue.prototype.$once = function (event, fn) {
  15649. var vm = this;
  15650. function on () {
  15651. vm.$off(event, on);
  15652. fn.apply(vm, arguments);
  15653. }
  15654. on.fn = fn;
  15655. vm.$on(event, on);
  15656. return vm
  15657. };
  15658. Vue.prototype.$off = function (event, fn) {
  15659. var vm = this;
  15660. // all
  15661. if (!arguments.length) {
  15662. vm._events = Object.create(null);
  15663. return vm
  15664. }
  15665. // array of events
  15666. if (Array.isArray(event)) {
  15667. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  15668. vm.$off(event[i$1], fn);
  15669. }
  15670. return vm
  15671. }
  15672. // specific event
  15673. var cbs = vm._events[event];
  15674. if (!cbs) {
  15675. return vm
  15676. }
  15677. if (!fn) {
  15678. vm._events[event] = null;
  15679. return vm
  15680. }
  15681. // specific handler
  15682. var cb;
  15683. var i = cbs.length;
  15684. while (i--) {
  15685. cb = cbs[i];
  15686. if (cb === fn || cb.fn === fn) {
  15687. cbs.splice(i, 1);
  15688. break
  15689. }
  15690. }
  15691. return vm
  15692. };
  15693. Vue.prototype.$emit = function (event) {
  15694. var vm = this;
  15695. if (true) {
  15696. var lowerCaseEvent = event.toLowerCase();
  15697. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  15698. tip(
  15699. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  15700. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  15701. "Note that HTML attributes are case-insensitive and you cannot use " +
  15702. "v-on to listen to camelCase events when using in-DOM templates. " +
  15703. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  15704. );
  15705. }
  15706. }
  15707. var cbs = vm._events[event];
  15708. if (cbs) {
  15709. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  15710. var args = toArray(arguments, 1);
  15711. var info = "event handler for \"" + event + "\"";
  15712. for (var i = 0, l = cbs.length; i < l; i++) {
  15713. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  15714. }
  15715. }
  15716. return vm
  15717. };
  15718. }
  15719. /* */
  15720. var activeInstance = null;
  15721. var isUpdatingChildComponent = false;
  15722. function setActiveInstance(vm) {
  15723. var prevActiveInstance = activeInstance;
  15724. activeInstance = vm;
  15725. return function () {
  15726. activeInstance = prevActiveInstance;
  15727. }
  15728. }
  15729. function initLifecycle (vm) {
  15730. var options = vm.$options;
  15731. // locate first non-abstract parent
  15732. var parent = options.parent;
  15733. if (parent && !options.abstract) {
  15734. while (parent.$options.abstract && parent.$parent) {
  15735. parent = parent.$parent;
  15736. }
  15737. parent.$children.push(vm);
  15738. }
  15739. vm.$parent = parent;
  15740. vm.$root = parent ? parent.$root : vm;
  15741. vm.$children = [];
  15742. vm.$refs = {};
  15743. vm._watcher = null;
  15744. vm._inactive = null;
  15745. vm._directInactive = false;
  15746. vm._isMounted = false;
  15747. vm._isDestroyed = false;
  15748. vm._isBeingDestroyed = false;
  15749. }
  15750. function lifecycleMixin (Vue) {
  15751. Vue.prototype._update = function (vnode, hydrating) {
  15752. var vm = this;
  15753. var prevEl = vm.$el;
  15754. var prevVnode = vm._vnode;
  15755. var restoreActiveInstance = setActiveInstance(vm);
  15756. vm._vnode = vnode;
  15757. // Vue.prototype.__patch__ is injected in entry points
  15758. // based on the rendering backend used.
  15759. if (!prevVnode) {
  15760. // initial render
  15761. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  15762. } else {
  15763. // updates
  15764. vm.$el = vm.__patch__(prevVnode, vnode);
  15765. }
  15766. restoreActiveInstance();
  15767. // update __vue__ reference
  15768. if (prevEl) {
  15769. prevEl.__vue__ = null;
  15770. }
  15771. if (vm.$el) {
  15772. vm.$el.__vue__ = vm;
  15773. }
  15774. // if parent is an HOC, update its $el as well
  15775. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  15776. vm.$parent.$el = vm.$el;
  15777. }
  15778. // updated hook is called by the scheduler to ensure that children are
  15779. // updated in a parent's updated hook.
  15780. };
  15781. Vue.prototype.$forceUpdate = function () {
  15782. var vm = this;
  15783. if (vm._watcher) {
  15784. vm._watcher.update();
  15785. }
  15786. };
  15787. Vue.prototype.$destroy = function () {
  15788. var vm = this;
  15789. if (vm._isBeingDestroyed) {
  15790. return
  15791. }
  15792. callHook(vm, 'beforeDestroy');
  15793. vm._isBeingDestroyed = true;
  15794. // remove self from parent
  15795. var parent = vm.$parent;
  15796. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  15797. remove(parent.$children, vm);
  15798. }
  15799. // teardown watchers
  15800. if (vm._watcher) {
  15801. vm._watcher.teardown();
  15802. }
  15803. var i = vm._watchers.length;
  15804. while (i--) {
  15805. vm._watchers[i].teardown();
  15806. }
  15807. // remove reference from data ob
  15808. // frozen object may not have observer.
  15809. if (vm._data.__ob__) {
  15810. vm._data.__ob__.vmCount--;
  15811. }
  15812. // call the last hook...
  15813. vm._isDestroyed = true;
  15814. // invoke destroy hooks on current rendered tree
  15815. vm.__patch__(vm._vnode, null);
  15816. // fire destroyed hook
  15817. callHook(vm, 'destroyed');
  15818. // turn off all instance listeners.
  15819. vm.$off();
  15820. // remove __vue__ reference
  15821. if (vm.$el) {
  15822. vm.$el.__vue__ = null;
  15823. }
  15824. // release circular reference (#6759)
  15825. if (vm.$vnode) {
  15826. vm.$vnode.parent = null;
  15827. }
  15828. };
  15829. }
  15830. function updateChildComponent (
  15831. vm,
  15832. propsData,
  15833. listeners,
  15834. parentVnode,
  15835. renderChildren
  15836. ) {
  15837. if (true) {
  15838. isUpdatingChildComponent = true;
  15839. }
  15840. // determine whether component has slot children
  15841. // we need to do this before overwriting $options._renderChildren.
  15842. // check if there are dynamic scopedSlots (hand-written or compiled but with
  15843. // dynamic slot names). Static scoped slots compiled from template has the
  15844. // "$stable" marker.
  15845. var newScopedSlots = parentVnode.data.scopedSlots;
  15846. var oldScopedSlots = vm.$scopedSlots;
  15847. var hasDynamicScopedSlot = !!(
  15848. (newScopedSlots && !newScopedSlots.$stable) ||
  15849. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  15850. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  15851. );
  15852. // Any static slot children from the parent may have changed during parent's
  15853. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  15854. // update is necessary to ensure correctness.
  15855. var needsForceUpdate = !!(
  15856. renderChildren || // has new static slots
  15857. vm.$options._renderChildren || // has old static slots
  15858. hasDynamicScopedSlot
  15859. );
  15860. vm.$options._parentVnode = parentVnode;
  15861. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  15862. if (vm._vnode) { // update child tree's parent
  15863. vm._vnode.parent = parentVnode;
  15864. }
  15865. vm.$options._renderChildren = renderChildren;
  15866. // update $attrs and $listeners hash
  15867. // these are also reactive so they may trigger child update if the child
  15868. // used them during render
  15869. vm.$attrs = parentVnode.data.attrs || emptyObject;
  15870. vm.$listeners = listeners || emptyObject;
  15871. // update props
  15872. if (propsData && vm.$options.props) {
  15873. toggleObserving(false);
  15874. var props = vm._props;
  15875. var propKeys = vm.$options._propKeys || [];
  15876. for (var i = 0; i < propKeys.length; i++) {
  15877. var key = propKeys[i];
  15878. var propOptions = vm.$options.props; // wtf flow?
  15879. props[key] = validateProp(key, propOptions, propsData, vm);
  15880. }
  15881. toggleObserving(true);
  15882. // keep a copy of raw propsData
  15883. vm.$options.propsData = propsData;
  15884. }
  15885. // fixed by xxxxxx update properties(mp runtime)
  15886. vm._$updateProperties && vm._$updateProperties(vm);
  15887. // update listeners
  15888. listeners = listeners || emptyObject;
  15889. var oldListeners = vm.$options._parentListeners;
  15890. vm.$options._parentListeners = listeners;
  15891. updateComponentListeners(vm, listeners, oldListeners);
  15892. // resolve slots + force update if has children
  15893. if (needsForceUpdate) {
  15894. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  15895. vm.$forceUpdate();
  15896. }
  15897. if (true) {
  15898. isUpdatingChildComponent = false;
  15899. }
  15900. }
  15901. function isInInactiveTree (vm) {
  15902. while (vm && (vm = vm.$parent)) {
  15903. if (vm._inactive) { return true }
  15904. }
  15905. return false
  15906. }
  15907. function activateChildComponent (vm, direct) {
  15908. if (direct) {
  15909. vm._directInactive = false;
  15910. if (isInInactiveTree(vm)) {
  15911. return
  15912. }
  15913. } else if (vm._directInactive) {
  15914. return
  15915. }
  15916. if (vm._inactive || vm._inactive === null) {
  15917. vm._inactive = false;
  15918. for (var i = 0; i < vm.$children.length; i++) {
  15919. activateChildComponent(vm.$children[i]);
  15920. }
  15921. callHook(vm, 'activated');
  15922. }
  15923. }
  15924. function deactivateChildComponent (vm, direct) {
  15925. if (direct) {
  15926. vm._directInactive = true;
  15927. if (isInInactiveTree(vm)) {
  15928. return
  15929. }
  15930. }
  15931. if (!vm._inactive) {
  15932. vm._inactive = true;
  15933. for (var i = 0; i < vm.$children.length; i++) {
  15934. deactivateChildComponent(vm.$children[i]);
  15935. }
  15936. callHook(vm, 'deactivated');
  15937. }
  15938. }
  15939. function callHook (vm, hook) {
  15940. // #7573 disable dep collection when invoking lifecycle hooks
  15941. pushTarget();
  15942. var handlers = vm.$options[hook];
  15943. var info = hook + " hook";
  15944. if (handlers) {
  15945. for (var i = 0, j = handlers.length; i < j; i++) {
  15946. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  15947. }
  15948. }
  15949. if (vm._hasHookEvent) {
  15950. vm.$emit('hook:' + hook);
  15951. }
  15952. popTarget();
  15953. }
  15954. /* */
  15955. var MAX_UPDATE_COUNT = 100;
  15956. var queue = [];
  15957. var activatedChildren = [];
  15958. var has = {};
  15959. var circular = {};
  15960. var waiting = false;
  15961. var flushing = false;
  15962. var index = 0;
  15963. /**
  15964. * Reset the scheduler's state.
  15965. */
  15966. function resetSchedulerState () {
  15967. index = queue.length = activatedChildren.length = 0;
  15968. has = {};
  15969. if (true) {
  15970. circular = {};
  15971. }
  15972. waiting = flushing = false;
  15973. }
  15974. // Async edge case #6566 requires saving the timestamp when event listeners are
  15975. // attached. However, calling performance.now() has a perf overhead especially
  15976. // if the page has thousands of event listeners. Instead, we take a timestamp
  15977. // every time the scheduler flushes and use that for all event listeners
  15978. // attached during that flush.
  15979. var currentFlushTimestamp = 0;
  15980. // Async edge case fix requires storing an event listener's attach timestamp.
  15981. var getNow = Date.now;
  15982. // Determine what event timestamp the browser is using. Annoyingly, the
  15983. // timestamp can either be hi-res (relative to page load) or low-res
  15984. // (relative to UNIX epoch), so in order to compare time we have to use the
  15985. // same timestamp type when saving the flush timestamp.
  15986. // All IE versions use low-res event timestamps, and have problematic clock
  15987. // implementations (#9632)
  15988. if (inBrowser && !isIE) {
  15989. var performance = window.performance;
  15990. if (
  15991. performance &&
  15992. typeof performance.now === 'function' &&
  15993. getNow() > document.createEvent('Event').timeStamp
  15994. ) {
  15995. // if the event timestamp, although evaluated AFTER the Date.now(), is
  15996. // smaller than it, it means the event is using a hi-res timestamp,
  15997. // and we need to use the hi-res version for event listener timestamps as
  15998. // well.
  15999. getNow = function () { return performance.now(); };
  16000. }
  16001. }
  16002. /**
  16003. * Flush both queues and run the watchers.
  16004. */
  16005. function flushSchedulerQueue () {
  16006. currentFlushTimestamp = getNow();
  16007. flushing = true;
  16008. var watcher, id;
  16009. // Sort queue before flush.
  16010. // This ensures that:
  16011. // 1. Components are updated from parent to child. (because parent is always
  16012. // created before the child)
  16013. // 2. A component's user watchers are run before its render watcher (because
  16014. // user watchers are created before the render watcher)
  16015. // 3. If a component is destroyed during a parent component's watcher run,
  16016. // its watchers can be skipped.
  16017. queue.sort(function (a, b) { return a.id - b.id; });
  16018. // do not cache length because more watchers might be pushed
  16019. // as we run existing watchers
  16020. for (index = 0; index < queue.length; index++) {
  16021. watcher = queue[index];
  16022. if (watcher.before) {
  16023. watcher.before();
  16024. }
  16025. id = watcher.id;
  16026. has[id] = null;
  16027. watcher.run();
  16028. // in dev build, check and stop circular updates.
  16029. if ( true && has[id] != null) {
  16030. circular[id] = (circular[id] || 0) + 1;
  16031. if (circular[id] > MAX_UPDATE_COUNT) {
  16032. warn(
  16033. 'You may have an infinite update loop ' + (
  16034. watcher.user
  16035. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  16036. : "in a component render function."
  16037. ),
  16038. watcher.vm
  16039. );
  16040. break
  16041. }
  16042. }
  16043. }
  16044. // keep copies of post queues before resetting state
  16045. var activatedQueue = activatedChildren.slice();
  16046. var updatedQueue = queue.slice();
  16047. resetSchedulerState();
  16048. // call component updated and activated hooks
  16049. callActivatedHooks(activatedQueue);
  16050. callUpdatedHooks(updatedQueue);
  16051. // devtool hook
  16052. /* istanbul ignore if */
  16053. if (devtools && config.devtools) {
  16054. devtools.emit('flush');
  16055. }
  16056. }
  16057. function callUpdatedHooks (queue) {
  16058. var i = queue.length;
  16059. while (i--) {
  16060. var watcher = queue[i];
  16061. var vm = watcher.vm;
  16062. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  16063. callHook(vm, 'updated');
  16064. }
  16065. }
  16066. }
  16067. /**
  16068. * Queue a kept-alive component that was activated during patch.
  16069. * The queue will be processed after the entire tree has been patched.
  16070. */
  16071. function queueActivatedComponent (vm) {
  16072. // setting _inactive to false here so that a render function can
  16073. // rely on checking whether it's in an inactive tree (e.g. router-view)
  16074. vm._inactive = false;
  16075. activatedChildren.push(vm);
  16076. }
  16077. function callActivatedHooks (queue) {
  16078. for (var i = 0; i < queue.length; i++) {
  16079. queue[i]._inactive = true;
  16080. activateChildComponent(queue[i], true /* true */);
  16081. }
  16082. }
  16083. /**
  16084. * Push a watcher into the watcher queue.
  16085. * Jobs with duplicate IDs will be skipped unless it's
  16086. * pushed when the queue is being flushed.
  16087. */
  16088. function queueWatcher (watcher) {
  16089. var id = watcher.id;
  16090. if (has[id] == null) {
  16091. has[id] = true;
  16092. if (!flushing) {
  16093. queue.push(watcher);
  16094. } else {
  16095. // if already flushing, splice the watcher based on its id
  16096. // if already past its id, it will be run next immediately.
  16097. var i = queue.length - 1;
  16098. while (i > index && queue[i].id > watcher.id) {
  16099. i--;
  16100. }
  16101. queue.splice(i + 1, 0, watcher);
  16102. }
  16103. // queue the flush
  16104. if (!waiting) {
  16105. waiting = true;
  16106. if ( true && !config.async) {
  16107. flushSchedulerQueue();
  16108. return
  16109. }
  16110. nextTick(flushSchedulerQueue);
  16111. }
  16112. }
  16113. }
  16114. /* */
  16115. var uid$2 = 0;
  16116. /**
  16117. * A watcher parses an expression, collects dependencies,
  16118. * and fires callback when the expression value changes.
  16119. * This is used for both the $watch() api and directives.
  16120. */
  16121. var Watcher = function Watcher (
  16122. vm,
  16123. expOrFn,
  16124. cb,
  16125. options,
  16126. isRenderWatcher
  16127. ) {
  16128. this.vm = vm;
  16129. if (isRenderWatcher) {
  16130. vm._watcher = this;
  16131. }
  16132. vm._watchers.push(this);
  16133. // options
  16134. if (options) {
  16135. this.deep = !!options.deep;
  16136. this.user = !!options.user;
  16137. this.lazy = !!options.lazy;
  16138. this.sync = !!options.sync;
  16139. this.before = options.before;
  16140. } else {
  16141. this.deep = this.user = this.lazy = this.sync = false;
  16142. }
  16143. this.cb = cb;
  16144. this.id = ++uid$2; // uid for batching
  16145. this.active = true;
  16146. this.dirty = this.lazy; // for lazy watchers
  16147. this.deps = [];
  16148. this.newDeps = [];
  16149. this.depIds = new _Set();
  16150. this.newDepIds = new _Set();
  16151. this.expression = true
  16152. ? expOrFn.toString()
  16153. : undefined;
  16154. // parse expression for getter
  16155. if (typeof expOrFn === 'function') {
  16156. this.getter = expOrFn;
  16157. } else {
  16158. this.getter = parsePath(expOrFn);
  16159. if (!this.getter) {
  16160. this.getter = noop;
  16161. true && warn(
  16162. "Failed watching path: \"" + expOrFn + "\" " +
  16163. 'Watcher only accepts simple dot-delimited paths. ' +
  16164. 'For full control, use a function instead.',
  16165. vm
  16166. );
  16167. }
  16168. }
  16169. this.value = this.lazy
  16170. ? undefined
  16171. : this.get();
  16172. };
  16173. /**
  16174. * Evaluate the getter, and re-collect dependencies.
  16175. */
  16176. Watcher.prototype.get = function get () {
  16177. pushTarget(this);
  16178. var value;
  16179. var vm = this.vm;
  16180. try {
  16181. value = this.getter.call(vm, vm);
  16182. } catch (e) {
  16183. if (this.user) {
  16184. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  16185. } else {
  16186. throw e
  16187. }
  16188. } finally {
  16189. // "touch" every property so they are all tracked as
  16190. // dependencies for deep watching
  16191. if (this.deep) {
  16192. traverse(value);
  16193. }
  16194. popTarget();
  16195. this.cleanupDeps();
  16196. }
  16197. return value
  16198. };
  16199. /**
  16200. * Add a dependency to this directive.
  16201. */
  16202. Watcher.prototype.addDep = function addDep (dep) {
  16203. var id = dep.id;
  16204. if (!this.newDepIds.has(id)) {
  16205. this.newDepIds.add(id);
  16206. this.newDeps.push(dep);
  16207. if (!this.depIds.has(id)) {
  16208. dep.addSub(this);
  16209. }
  16210. }
  16211. };
  16212. /**
  16213. * Clean up for dependency collection.
  16214. */
  16215. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  16216. var i = this.deps.length;
  16217. while (i--) {
  16218. var dep = this.deps[i];
  16219. if (!this.newDepIds.has(dep.id)) {
  16220. dep.removeSub(this);
  16221. }
  16222. }
  16223. var tmp = this.depIds;
  16224. this.depIds = this.newDepIds;
  16225. this.newDepIds = tmp;
  16226. this.newDepIds.clear();
  16227. tmp = this.deps;
  16228. this.deps = this.newDeps;
  16229. this.newDeps = tmp;
  16230. this.newDeps.length = 0;
  16231. };
  16232. /**
  16233. * Subscriber interface.
  16234. * Will be called when a dependency changes.
  16235. */
  16236. Watcher.prototype.update = function update () {
  16237. /* istanbul ignore else */
  16238. if (this.lazy) {
  16239. this.dirty = true;
  16240. } else if (this.sync) {
  16241. this.run();
  16242. } else {
  16243. queueWatcher(this);
  16244. }
  16245. };
  16246. /**
  16247. * Scheduler job interface.
  16248. * Will be called by the scheduler.
  16249. */
  16250. Watcher.prototype.run = function run () {
  16251. if (this.active) {
  16252. var value = this.get();
  16253. if (
  16254. value !== this.value ||
  16255. // Deep watchers and watchers on Object/Arrays should fire even
  16256. // when the value is the same, because the value may
  16257. // have mutated.
  16258. isObject(value) ||
  16259. this.deep
  16260. ) {
  16261. // set new value
  16262. var oldValue = this.value;
  16263. this.value = value;
  16264. if (this.user) {
  16265. try {
  16266. this.cb.call(this.vm, value, oldValue);
  16267. } catch (e) {
  16268. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  16269. }
  16270. } else {
  16271. this.cb.call(this.vm, value, oldValue);
  16272. }
  16273. }
  16274. }
  16275. };
  16276. /**
  16277. * Evaluate the value of the watcher.
  16278. * This only gets called for lazy watchers.
  16279. */
  16280. Watcher.prototype.evaluate = function evaluate () {
  16281. this.value = this.get();
  16282. this.dirty = false;
  16283. };
  16284. /**
  16285. * Depend on all deps collected by this watcher.
  16286. */
  16287. Watcher.prototype.depend = function depend () {
  16288. var i = this.deps.length;
  16289. while (i--) {
  16290. this.deps[i].depend();
  16291. }
  16292. };
  16293. /**
  16294. * Remove self from all dependencies' subscriber list.
  16295. */
  16296. Watcher.prototype.teardown = function teardown () {
  16297. if (this.active) {
  16298. // remove self from vm's watcher list
  16299. // this is a somewhat expensive operation so we skip it
  16300. // if the vm is being destroyed.
  16301. if (!this.vm._isBeingDestroyed) {
  16302. remove(this.vm._watchers, this);
  16303. }
  16304. var i = this.deps.length;
  16305. while (i--) {
  16306. this.deps[i].removeSub(this);
  16307. }
  16308. this.active = false;
  16309. }
  16310. };
  16311. /* */
  16312. var sharedPropertyDefinition = {
  16313. enumerable: true,
  16314. configurable: true,
  16315. get: noop,
  16316. set: noop
  16317. };
  16318. function proxy (target, sourceKey, key) {
  16319. sharedPropertyDefinition.get = function proxyGetter () {
  16320. return this[sourceKey][key]
  16321. };
  16322. sharedPropertyDefinition.set = function proxySetter (val) {
  16323. this[sourceKey][key] = val;
  16324. };
  16325. Object.defineProperty(target, key, sharedPropertyDefinition);
  16326. }
  16327. function initState (vm) {
  16328. vm._watchers = [];
  16329. var opts = vm.$options;
  16330. if (opts.props) { initProps(vm, opts.props); }
  16331. if (opts.methods) { initMethods(vm, opts.methods); }
  16332. if (opts.data) {
  16333. initData(vm);
  16334. } else {
  16335. observe(vm._data = {}, true /* asRootData */);
  16336. }
  16337. if (opts.computed) { initComputed(vm, opts.computed); }
  16338. if (opts.watch && opts.watch !== nativeWatch) {
  16339. initWatch(vm, opts.watch);
  16340. }
  16341. }
  16342. function initProps (vm, propsOptions) {
  16343. var propsData = vm.$options.propsData || {};
  16344. var props = vm._props = {};
  16345. // cache prop keys so that future props updates can iterate using Array
  16346. // instead of dynamic object key enumeration.
  16347. var keys = vm.$options._propKeys = [];
  16348. var isRoot = !vm.$parent;
  16349. // root instance props should be converted
  16350. if (!isRoot) {
  16351. toggleObserving(false);
  16352. }
  16353. var loop = function ( key ) {
  16354. keys.push(key);
  16355. var value = validateProp(key, propsOptions, propsData, vm);
  16356. /* istanbul ignore else */
  16357. if (true) {
  16358. var hyphenatedKey = hyphenate(key);
  16359. if (isReservedAttribute(hyphenatedKey) ||
  16360. config.isReservedAttr(hyphenatedKey)) {
  16361. warn(
  16362. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  16363. vm
  16364. );
  16365. }
  16366. defineReactive$$1(props, key, value, function () {
  16367. if (!isRoot && !isUpdatingChildComponent) {
  16368. {
  16369. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou' || vm.mpHost === 'mp-xhs'){//百度、快手、小红书 observer 在 setData callback 之后触发,直接忽略该 warn
  16370. return
  16371. }
  16372. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  16373. if(
  16374. key === 'value' &&
  16375. Array.isArray(vm.$options.behaviors) &&
  16376. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  16377. ){
  16378. return
  16379. }
  16380. if(vm._getFormData){
  16381. return
  16382. }
  16383. var $parent = vm.$parent;
  16384. while($parent){
  16385. if($parent.__next_tick_pending){
  16386. return
  16387. }
  16388. $parent = $parent.$parent;
  16389. }
  16390. }
  16391. warn(
  16392. "Avoid mutating a prop directly since the value will be " +
  16393. "overwritten whenever the parent component re-renders. " +
  16394. "Instead, use a data or computed property based on the prop's " +
  16395. "value. Prop being mutated: \"" + key + "\"",
  16396. vm
  16397. );
  16398. }
  16399. });
  16400. } else {}
  16401. // static props are already proxied on the component's prototype
  16402. // during Vue.extend(). We only need to proxy props defined at
  16403. // instantiation here.
  16404. if (!(key in vm)) {
  16405. proxy(vm, "_props", key);
  16406. }
  16407. };
  16408. for (var key in propsOptions) loop( key );
  16409. toggleObserving(true);
  16410. }
  16411. function initData (vm) {
  16412. var data = vm.$options.data;
  16413. data = vm._data = typeof data === 'function'
  16414. ? getData(data, vm)
  16415. : data || {};
  16416. if (!isPlainObject(data)) {
  16417. data = {};
  16418. true && warn(
  16419. 'data functions should return an object:\n' +
  16420. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  16421. vm
  16422. );
  16423. }
  16424. // proxy data on instance
  16425. var keys = Object.keys(data);
  16426. var props = vm.$options.props;
  16427. var methods = vm.$options.methods;
  16428. var i = keys.length;
  16429. while (i--) {
  16430. var key = keys[i];
  16431. if (true) {
  16432. if (methods && hasOwn(methods, key)) {
  16433. warn(
  16434. ("Method \"" + key + "\" has already been defined as a data property."),
  16435. vm
  16436. );
  16437. }
  16438. }
  16439. if (props && hasOwn(props, key)) {
  16440. true && warn(
  16441. "The data property \"" + key + "\" is already declared as a prop. " +
  16442. "Use prop default value instead.",
  16443. vm
  16444. );
  16445. } else if (!isReserved(key)) {
  16446. proxy(vm, "_data", key);
  16447. }
  16448. }
  16449. // observe data
  16450. observe(data, true /* asRootData */);
  16451. }
  16452. function getData (data, vm) {
  16453. // #7573 disable dep collection when invoking data getters
  16454. pushTarget();
  16455. try {
  16456. return data.call(vm, vm)
  16457. } catch (e) {
  16458. handleError(e, vm, "data()");
  16459. return {}
  16460. } finally {
  16461. popTarget();
  16462. }
  16463. }
  16464. var computedWatcherOptions = { lazy: true };
  16465. function initComputed (vm, computed) {
  16466. // $flow-disable-line
  16467. var watchers = vm._computedWatchers = Object.create(null);
  16468. // computed properties are just getters during SSR
  16469. var isSSR = isServerRendering();
  16470. for (var key in computed) {
  16471. var userDef = computed[key];
  16472. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  16473. if ( true && getter == null) {
  16474. warn(
  16475. ("Getter is missing for computed property \"" + key + "\"."),
  16476. vm
  16477. );
  16478. }
  16479. if (!isSSR) {
  16480. // create internal watcher for the computed property.
  16481. watchers[key] = new Watcher(
  16482. vm,
  16483. getter || noop,
  16484. noop,
  16485. computedWatcherOptions
  16486. );
  16487. }
  16488. // component-defined computed properties are already defined on the
  16489. // component prototype. We only need to define computed properties defined
  16490. // at instantiation here.
  16491. if (!(key in vm)) {
  16492. defineComputed(vm, key, userDef);
  16493. } else if (true) {
  16494. if (key in vm.$data) {
  16495. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  16496. } else if (vm.$options.props && key in vm.$options.props) {
  16497. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  16498. }
  16499. }
  16500. }
  16501. }
  16502. function defineComputed (
  16503. target,
  16504. key,
  16505. userDef
  16506. ) {
  16507. var shouldCache = !isServerRendering();
  16508. if (typeof userDef === 'function') {
  16509. sharedPropertyDefinition.get = shouldCache
  16510. ? createComputedGetter(key)
  16511. : createGetterInvoker(userDef);
  16512. sharedPropertyDefinition.set = noop;
  16513. } else {
  16514. sharedPropertyDefinition.get = userDef.get
  16515. ? shouldCache && userDef.cache !== false
  16516. ? createComputedGetter(key)
  16517. : createGetterInvoker(userDef.get)
  16518. : noop;
  16519. sharedPropertyDefinition.set = userDef.set || noop;
  16520. }
  16521. if ( true &&
  16522. sharedPropertyDefinition.set === noop) {
  16523. sharedPropertyDefinition.set = function () {
  16524. warn(
  16525. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  16526. this
  16527. );
  16528. };
  16529. }
  16530. Object.defineProperty(target, key, sharedPropertyDefinition);
  16531. }
  16532. function createComputedGetter (key) {
  16533. return function computedGetter () {
  16534. var watcher = this._computedWatchers && this._computedWatchers[key];
  16535. if (watcher) {
  16536. if (watcher.dirty) {
  16537. watcher.evaluate();
  16538. }
  16539. if (Dep.SharedObject.target) {// fixed by xxxxxx
  16540. watcher.depend();
  16541. }
  16542. return watcher.value
  16543. }
  16544. }
  16545. }
  16546. function createGetterInvoker(fn) {
  16547. return function computedGetter () {
  16548. return fn.call(this, this)
  16549. }
  16550. }
  16551. function initMethods (vm, methods) {
  16552. var props = vm.$options.props;
  16553. for (var key in methods) {
  16554. if (true) {
  16555. if (typeof methods[key] !== 'function') {
  16556. warn(
  16557. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  16558. "Did you reference the function correctly?",
  16559. vm
  16560. );
  16561. }
  16562. if (props && hasOwn(props, key)) {
  16563. warn(
  16564. ("Method \"" + key + "\" has already been defined as a prop."),
  16565. vm
  16566. );
  16567. }
  16568. if ((key in vm) && isReserved(key)) {
  16569. warn(
  16570. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  16571. "Avoid defining component methods that start with _ or $."
  16572. );
  16573. }
  16574. }
  16575. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  16576. }
  16577. }
  16578. function initWatch (vm, watch) {
  16579. for (var key in watch) {
  16580. var handler = watch[key];
  16581. if (Array.isArray(handler)) {
  16582. for (var i = 0; i < handler.length; i++) {
  16583. createWatcher(vm, key, handler[i]);
  16584. }
  16585. } else {
  16586. createWatcher(vm, key, handler);
  16587. }
  16588. }
  16589. }
  16590. function createWatcher (
  16591. vm,
  16592. expOrFn,
  16593. handler,
  16594. options
  16595. ) {
  16596. if (isPlainObject(handler)) {
  16597. options = handler;
  16598. handler = handler.handler;
  16599. }
  16600. if (typeof handler === 'string') {
  16601. handler = vm[handler];
  16602. }
  16603. return vm.$watch(expOrFn, handler, options)
  16604. }
  16605. function stateMixin (Vue) {
  16606. // flow somehow has problems with directly declared definition object
  16607. // when using Object.defineProperty, so we have to procedurally build up
  16608. // the object here.
  16609. var dataDef = {};
  16610. dataDef.get = function () { return this._data };
  16611. var propsDef = {};
  16612. propsDef.get = function () { return this._props };
  16613. if (true) {
  16614. dataDef.set = function () {
  16615. warn(
  16616. 'Avoid replacing instance root $data. ' +
  16617. 'Use nested data properties instead.',
  16618. this
  16619. );
  16620. };
  16621. propsDef.set = function () {
  16622. warn("$props is readonly.", this);
  16623. };
  16624. }
  16625. Object.defineProperty(Vue.prototype, '$data', dataDef);
  16626. Object.defineProperty(Vue.prototype, '$props', propsDef);
  16627. Vue.prototype.$set = set;
  16628. Vue.prototype.$delete = del;
  16629. Vue.prototype.$watch = function (
  16630. expOrFn,
  16631. cb,
  16632. options
  16633. ) {
  16634. var vm = this;
  16635. if (isPlainObject(cb)) {
  16636. return createWatcher(vm, expOrFn, cb, options)
  16637. }
  16638. options = options || {};
  16639. options.user = true;
  16640. var watcher = new Watcher(vm, expOrFn, cb, options);
  16641. if (options.immediate) {
  16642. try {
  16643. cb.call(vm, watcher.value);
  16644. } catch (error) {
  16645. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  16646. }
  16647. }
  16648. return function unwatchFn () {
  16649. watcher.teardown();
  16650. }
  16651. };
  16652. }
  16653. /* */
  16654. var uid$3 = 0;
  16655. function initMixin (Vue) {
  16656. Vue.prototype._init = function (options) {
  16657. var vm = this;
  16658. // a uid
  16659. vm._uid = uid$3++;
  16660. var startTag, endTag;
  16661. /* istanbul ignore if */
  16662. if ( true && config.performance && mark) {
  16663. startTag = "vue-perf-start:" + (vm._uid);
  16664. endTag = "vue-perf-end:" + (vm._uid);
  16665. mark(startTag);
  16666. }
  16667. // a flag to avoid this being observed
  16668. vm._isVue = true;
  16669. // merge options
  16670. if (options && options._isComponent) {
  16671. // optimize internal component instantiation
  16672. // since dynamic options merging is pretty slow, and none of the
  16673. // internal component options needs special treatment.
  16674. initInternalComponent(vm, options);
  16675. } else {
  16676. vm.$options = mergeOptions(
  16677. resolveConstructorOptions(vm.constructor),
  16678. options || {},
  16679. vm
  16680. );
  16681. }
  16682. /* istanbul ignore else */
  16683. if (true) {
  16684. initProxy(vm);
  16685. } else {}
  16686. // expose real self
  16687. vm._self = vm;
  16688. initLifecycle(vm);
  16689. initEvents(vm);
  16690. initRender(vm);
  16691. callHook(vm, 'beforeCreate');
  16692. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  16693. initState(vm);
  16694. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  16695. !vm._$fallback && callHook(vm, 'created');
  16696. /* istanbul ignore if */
  16697. if ( true && config.performance && mark) {
  16698. vm._name = formatComponentName(vm, false);
  16699. mark(endTag);
  16700. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  16701. }
  16702. if (vm.$options.el) {
  16703. vm.$mount(vm.$options.el);
  16704. }
  16705. };
  16706. }
  16707. function initInternalComponent (vm, options) {
  16708. var opts = vm.$options = Object.create(vm.constructor.options);
  16709. // doing this because it's faster than dynamic enumeration.
  16710. var parentVnode = options._parentVnode;
  16711. opts.parent = options.parent;
  16712. opts._parentVnode = parentVnode;
  16713. var vnodeComponentOptions = parentVnode.componentOptions;
  16714. opts.propsData = vnodeComponentOptions.propsData;
  16715. opts._parentListeners = vnodeComponentOptions.listeners;
  16716. opts._renderChildren = vnodeComponentOptions.children;
  16717. opts._componentTag = vnodeComponentOptions.tag;
  16718. if (options.render) {
  16719. opts.render = options.render;
  16720. opts.staticRenderFns = options.staticRenderFns;
  16721. }
  16722. }
  16723. function resolveConstructorOptions (Ctor) {
  16724. var options = Ctor.options;
  16725. if (Ctor.super) {
  16726. var superOptions = resolveConstructorOptions(Ctor.super);
  16727. var cachedSuperOptions = Ctor.superOptions;
  16728. if (superOptions !== cachedSuperOptions) {
  16729. // super option changed,
  16730. // need to resolve new options.
  16731. Ctor.superOptions = superOptions;
  16732. // check if there are any late-modified/attached options (#4976)
  16733. var modifiedOptions = resolveModifiedOptions(Ctor);
  16734. // update base extend options
  16735. if (modifiedOptions) {
  16736. extend(Ctor.extendOptions, modifiedOptions);
  16737. }
  16738. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  16739. if (options.name) {
  16740. options.components[options.name] = Ctor;
  16741. }
  16742. }
  16743. }
  16744. return options
  16745. }
  16746. function resolveModifiedOptions (Ctor) {
  16747. var modified;
  16748. var latest = Ctor.options;
  16749. var sealed = Ctor.sealedOptions;
  16750. for (var key in latest) {
  16751. if (latest[key] !== sealed[key]) {
  16752. if (!modified) { modified = {}; }
  16753. modified[key] = latest[key];
  16754. }
  16755. }
  16756. return modified
  16757. }
  16758. function Vue (options) {
  16759. if ( true &&
  16760. !(this instanceof Vue)
  16761. ) {
  16762. warn('Vue is a constructor and should be called with the `new` keyword');
  16763. }
  16764. this._init(options);
  16765. }
  16766. initMixin(Vue);
  16767. stateMixin(Vue);
  16768. eventsMixin(Vue);
  16769. lifecycleMixin(Vue);
  16770. renderMixin(Vue);
  16771. /* */
  16772. function initUse (Vue) {
  16773. Vue.use = function (plugin) {
  16774. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  16775. if (installedPlugins.indexOf(plugin) > -1) {
  16776. return this
  16777. }
  16778. // additional parameters
  16779. var args = toArray(arguments, 1);
  16780. args.unshift(this);
  16781. if (typeof plugin.install === 'function') {
  16782. plugin.install.apply(plugin, args);
  16783. } else if (typeof plugin === 'function') {
  16784. plugin.apply(null, args);
  16785. }
  16786. installedPlugins.push(plugin);
  16787. return this
  16788. };
  16789. }
  16790. /* */
  16791. function initMixin$1 (Vue) {
  16792. Vue.mixin = function (mixin) {
  16793. this.options = mergeOptions(this.options, mixin);
  16794. return this
  16795. };
  16796. }
  16797. /* */
  16798. function initExtend (Vue) {
  16799. /**
  16800. * Each instance constructor, including Vue, has a unique
  16801. * cid. This enables us to create wrapped "child
  16802. * constructors" for prototypal inheritance and cache them.
  16803. */
  16804. Vue.cid = 0;
  16805. var cid = 1;
  16806. /**
  16807. * Class inheritance
  16808. */
  16809. Vue.extend = function (extendOptions) {
  16810. extendOptions = extendOptions || {};
  16811. var Super = this;
  16812. var SuperId = Super.cid;
  16813. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  16814. if (cachedCtors[SuperId]) {
  16815. return cachedCtors[SuperId]
  16816. }
  16817. var name = extendOptions.name || Super.options.name;
  16818. if ( true && name) {
  16819. validateComponentName(name);
  16820. }
  16821. var Sub = function VueComponent (options) {
  16822. this._init(options);
  16823. };
  16824. Sub.prototype = Object.create(Super.prototype);
  16825. Sub.prototype.constructor = Sub;
  16826. Sub.cid = cid++;
  16827. Sub.options = mergeOptions(
  16828. Super.options,
  16829. extendOptions
  16830. );
  16831. Sub['super'] = Super;
  16832. // For props and computed properties, we define the proxy getters on
  16833. // the Vue instances at extension time, on the extended prototype. This
  16834. // avoids Object.defineProperty calls for each instance created.
  16835. if (Sub.options.props) {
  16836. initProps$1(Sub);
  16837. }
  16838. if (Sub.options.computed) {
  16839. initComputed$1(Sub);
  16840. }
  16841. // allow further extension/mixin/plugin usage
  16842. Sub.extend = Super.extend;
  16843. Sub.mixin = Super.mixin;
  16844. Sub.use = Super.use;
  16845. // create asset registers, so extended classes
  16846. // can have their private assets too.
  16847. ASSET_TYPES.forEach(function (type) {
  16848. Sub[type] = Super[type];
  16849. });
  16850. // enable recursive self-lookup
  16851. if (name) {
  16852. Sub.options.components[name] = Sub;
  16853. }
  16854. // keep a reference to the super options at extension time.
  16855. // later at instantiation we can check if Super's options have
  16856. // been updated.
  16857. Sub.superOptions = Super.options;
  16858. Sub.extendOptions = extendOptions;
  16859. Sub.sealedOptions = extend({}, Sub.options);
  16860. // cache constructor
  16861. cachedCtors[SuperId] = Sub;
  16862. return Sub
  16863. };
  16864. }
  16865. function initProps$1 (Comp) {
  16866. var props = Comp.options.props;
  16867. for (var key in props) {
  16868. proxy(Comp.prototype, "_props", key);
  16869. }
  16870. }
  16871. function initComputed$1 (Comp) {
  16872. var computed = Comp.options.computed;
  16873. for (var key in computed) {
  16874. defineComputed(Comp.prototype, key, computed[key]);
  16875. }
  16876. }
  16877. /* */
  16878. function initAssetRegisters (Vue) {
  16879. /**
  16880. * Create asset registration methods.
  16881. */
  16882. ASSET_TYPES.forEach(function (type) {
  16883. Vue[type] = function (
  16884. id,
  16885. definition
  16886. ) {
  16887. if (!definition) {
  16888. return this.options[type + 's'][id]
  16889. } else {
  16890. /* istanbul ignore if */
  16891. if ( true && type === 'component') {
  16892. validateComponentName(id);
  16893. }
  16894. if (type === 'component' && isPlainObject(definition)) {
  16895. definition.name = definition.name || id;
  16896. definition = this.options._base.extend(definition);
  16897. }
  16898. if (type === 'directive' && typeof definition === 'function') {
  16899. definition = { bind: definition, update: definition };
  16900. }
  16901. this.options[type + 's'][id] = definition;
  16902. return definition
  16903. }
  16904. };
  16905. });
  16906. }
  16907. /* */
  16908. function getComponentName (opts) {
  16909. return opts && (opts.Ctor.options.name || opts.tag)
  16910. }
  16911. function matches (pattern, name) {
  16912. if (Array.isArray(pattern)) {
  16913. return pattern.indexOf(name) > -1
  16914. } else if (typeof pattern === 'string') {
  16915. return pattern.split(',').indexOf(name) > -1
  16916. } else if (isRegExp(pattern)) {
  16917. return pattern.test(name)
  16918. }
  16919. /* istanbul ignore next */
  16920. return false
  16921. }
  16922. function pruneCache (keepAliveInstance, filter) {
  16923. var cache = keepAliveInstance.cache;
  16924. var keys = keepAliveInstance.keys;
  16925. var _vnode = keepAliveInstance._vnode;
  16926. for (var key in cache) {
  16927. var cachedNode = cache[key];
  16928. if (cachedNode) {
  16929. var name = getComponentName(cachedNode.componentOptions);
  16930. if (name && !filter(name)) {
  16931. pruneCacheEntry(cache, key, keys, _vnode);
  16932. }
  16933. }
  16934. }
  16935. }
  16936. function pruneCacheEntry (
  16937. cache,
  16938. key,
  16939. keys,
  16940. current
  16941. ) {
  16942. var cached$$1 = cache[key];
  16943. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  16944. cached$$1.componentInstance.$destroy();
  16945. }
  16946. cache[key] = null;
  16947. remove(keys, key);
  16948. }
  16949. var patternTypes = [String, RegExp, Array];
  16950. var KeepAlive = {
  16951. name: 'keep-alive',
  16952. abstract: true,
  16953. props: {
  16954. include: patternTypes,
  16955. exclude: patternTypes,
  16956. max: [String, Number]
  16957. },
  16958. created: function created () {
  16959. this.cache = Object.create(null);
  16960. this.keys = [];
  16961. },
  16962. destroyed: function destroyed () {
  16963. for (var key in this.cache) {
  16964. pruneCacheEntry(this.cache, key, this.keys);
  16965. }
  16966. },
  16967. mounted: function mounted () {
  16968. var this$1 = this;
  16969. this.$watch('include', function (val) {
  16970. pruneCache(this$1, function (name) { return matches(val, name); });
  16971. });
  16972. this.$watch('exclude', function (val) {
  16973. pruneCache(this$1, function (name) { return !matches(val, name); });
  16974. });
  16975. },
  16976. render: function render () {
  16977. var slot = this.$slots.default;
  16978. var vnode = getFirstComponentChild(slot);
  16979. var componentOptions = vnode && vnode.componentOptions;
  16980. if (componentOptions) {
  16981. // check pattern
  16982. var name = getComponentName(componentOptions);
  16983. var ref = this;
  16984. var include = ref.include;
  16985. var exclude = ref.exclude;
  16986. if (
  16987. // not included
  16988. (include && (!name || !matches(include, name))) ||
  16989. // excluded
  16990. (exclude && name && matches(exclude, name))
  16991. ) {
  16992. return vnode
  16993. }
  16994. var ref$1 = this;
  16995. var cache = ref$1.cache;
  16996. var keys = ref$1.keys;
  16997. var key = vnode.key == null
  16998. // same constructor may get registered as different local components
  16999. // so cid alone is not enough (#3269)
  17000. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  17001. : vnode.key;
  17002. if (cache[key]) {
  17003. vnode.componentInstance = cache[key].componentInstance;
  17004. // make current key freshest
  17005. remove(keys, key);
  17006. keys.push(key);
  17007. } else {
  17008. cache[key] = vnode;
  17009. keys.push(key);
  17010. // prune oldest entry
  17011. if (this.max && keys.length > parseInt(this.max)) {
  17012. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  17013. }
  17014. }
  17015. vnode.data.keepAlive = true;
  17016. }
  17017. return vnode || (slot && slot[0])
  17018. }
  17019. };
  17020. var builtInComponents = {
  17021. KeepAlive: KeepAlive
  17022. };
  17023. /* */
  17024. function initGlobalAPI (Vue) {
  17025. // config
  17026. var configDef = {};
  17027. configDef.get = function () { return config; };
  17028. if (true) {
  17029. configDef.set = function () {
  17030. warn(
  17031. 'Do not replace the Vue.config object, set individual fields instead.'
  17032. );
  17033. };
  17034. }
  17035. Object.defineProperty(Vue, 'config', configDef);
  17036. // exposed util methods.
  17037. // NOTE: these are not considered part of the public API - avoid relying on
  17038. // them unless you are aware of the risk.
  17039. Vue.util = {
  17040. warn: warn,
  17041. extend: extend,
  17042. mergeOptions: mergeOptions,
  17043. defineReactive: defineReactive$$1
  17044. };
  17045. Vue.set = set;
  17046. Vue.delete = del;
  17047. Vue.nextTick = nextTick;
  17048. // 2.6 explicit observable API
  17049. Vue.observable = function (obj) {
  17050. observe(obj);
  17051. return obj
  17052. };
  17053. Vue.options = Object.create(null);
  17054. ASSET_TYPES.forEach(function (type) {
  17055. Vue.options[type + 's'] = Object.create(null);
  17056. });
  17057. // this is used to identify the "base" constructor to extend all plain-object
  17058. // components with in Weex's multi-instance scenarios.
  17059. Vue.options._base = Vue;
  17060. extend(Vue.options.components, builtInComponents);
  17061. initUse(Vue);
  17062. initMixin$1(Vue);
  17063. initExtend(Vue);
  17064. initAssetRegisters(Vue);
  17065. }
  17066. initGlobalAPI(Vue);
  17067. Object.defineProperty(Vue.prototype, '$isServer', {
  17068. get: isServerRendering
  17069. });
  17070. Object.defineProperty(Vue.prototype, '$ssrContext', {
  17071. get: function get () {
  17072. /* istanbul ignore next */
  17073. return this.$vnode && this.$vnode.ssrContext
  17074. }
  17075. });
  17076. // expose FunctionalRenderContext for ssr runtime helper installation
  17077. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  17078. value: FunctionalRenderContext
  17079. });
  17080. Vue.version = '2.6.11';
  17081. /**
  17082. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  17083. */
  17084. var ARRAYTYPE = '[object Array]';
  17085. var OBJECTTYPE = '[object Object]';
  17086. var NULLTYPE = '[object Null]';
  17087. var UNDEFINEDTYPE = '[object Undefined]';
  17088. // const FUNCTIONTYPE = '[object Function]'
  17089. function diff(current, pre) {
  17090. var result = {};
  17091. syncKeys(current, pre);
  17092. _diff(current, pre, '', result);
  17093. return result
  17094. }
  17095. function syncKeys(current, pre) {
  17096. if (current === pre) { return }
  17097. var rootCurrentType = type(current);
  17098. var rootPreType = type(pre);
  17099. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  17100. if(Object.keys(current).length >= Object.keys(pre).length){
  17101. for (var key in pre) {
  17102. var currentValue = current[key];
  17103. if (currentValue === undefined) {
  17104. current[key] = null;
  17105. } else {
  17106. syncKeys(currentValue, pre[key]);
  17107. }
  17108. }
  17109. }
  17110. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  17111. if (current.length >= pre.length) {
  17112. pre.forEach(function (item, index) {
  17113. syncKeys(current[index], item);
  17114. });
  17115. }
  17116. }
  17117. }
  17118. function nullOrUndefined(currentType, preType) {
  17119. if(
  17120. (currentType === NULLTYPE || currentType === UNDEFINEDTYPE) &&
  17121. (preType === NULLTYPE || preType === UNDEFINEDTYPE)
  17122. ) {
  17123. return false
  17124. }
  17125. return true
  17126. }
  17127. function _diff(current, pre, path, result) {
  17128. if (current === pre) { return }
  17129. var rootCurrentType = type(current);
  17130. var rootPreType = type(pre);
  17131. if (rootCurrentType == OBJECTTYPE) {
  17132. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  17133. setResult(result, path, current);
  17134. } else {
  17135. var loop = function ( key ) {
  17136. var currentValue = current[key];
  17137. var preValue = pre[key];
  17138. var currentType = type(currentValue);
  17139. var preType = type(preValue);
  17140. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  17141. if (currentValue !== pre[key] && nullOrUndefined(currentType, preType)) {
  17142. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  17143. }
  17144. } else if (currentType == ARRAYTYPE) {
  17145. if (preType != ARRAYTYPE) {
  17146. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  17147. } else {
  17148. if (currentValue.length < preValue.length) {
  17149. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  17150. } else {
  17151. currentValue.forEach(function (item, index) {
  17152. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  17153. });
  17154. }
  17155. }
  17156. } else if (currentType == OBJECTTYPE) {
  17157. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  17158. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  17159. } else {
  17160. for (var subKey in currentValue) {
  17161. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  17162. }
  17163. }
  17164. }
  17165. };
  17166. for (var key in current) loop( key );
  17167. }
  17168. } else if (rootCurrentType == ARRAYTYPE) {
  17169. if (rootPreType != ARRAYTYPE) {
  17170. setResult(result, path, current);
  17171. } else {
  17172. if (current.length < pre.length) {
  17173. setResult(result, path, current);
  17174. } else {
  17175. current.forEach(function (item, index) {
  17176. _diff(item, pre[index], path + '[' + index + ']', result);
  17177. });
  17178. }
  17179. }
  17180. } else {
  17181. setResult(result, path, current);
  17182. }
  17183. }
  17184. function setResult(result, k, v) {
  17185. // if (type(v) != FUNCTIONTYPE) {
  17186. result[k] = v;
  17187. // }
  17188. }
  17189. function type(obj) {
  17190. return Object.prototype.toString.call(obj)
  17191. }
  17192. /* */
  17193. function flushCallbacks$1(vm) {
  17194. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  17195. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"hptwxMiniProgram","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  17196. var mpInstance = vm.$scope;
  17197. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  17198. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  17199. }
  17200. var copies = vm.__next_tick_callbacks.slice(0);
  17201. vm.__next_tick_callbacks.length = 0;
  17202. for (var i = 0; i < copies.length; i++) {
  17203. copies[i]();
  17204. }
  17205. }
  17206. }
  17207. function hasRenderWatcher(vm) {
  17208. return queue.find(function (watcher) { return vm._watcher === watcher; })
  17209. }
  17210. function nextTick$1(vm, cb) {
  17211. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  17212. //2.nextTick 之前存在 render watcher
  17213. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  17214. if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"hptwxMiniProgram","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  17215. var mpInstance = vm.$scope;
  17216. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  17217. ']:nextVueTick');
  17218. }
  17219. return nextTick(cb, vm)
  17220. }else{
  17221. if(Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"hptwxMiniProgram","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  17222. var mpInstance$1 = vm.$scope;
  17223. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  17224. ']:nextMPTick');
  17225. }
  17226. }
  17227. var _resolve;
  17228. if (!vm.__next_tick_callbacks) {
  17229. vm.__next_tick_callbacks = [];
  17230. }
  17231. vm.__next_tick_callbacks.push(function () {
  17232. if (cb) {
  17233. try {
  17234. cb.call(vm);
  17235. } catch (e) {
  17236. handleError(e, vm, 'nextTick');
  17237. }
  17238. } else if (_resolve) {
  17239. _resolve(vm);
  17240. }
  17241. });
  17242. // $flow-disable-line
  17243. if (!cb && typeof Promise !== 'undefined') {
  17244. return new Promise(function (resolve) {
  17245. _resolve = resolve;
  17246. })
  17247. }
  17248. }
  17249. /* */
  17250. function clearInstance(key, value) {
  17251. // 简易去除 Vue 和小程序组件实例
  17252. if (value) {
  17253. if (value._isVue || value.__v_isMPComponent) {
  17254. return {}
  17255. }
  17256. }
  17257. return value
  17258. }
  17259. function cloneWithData(vm) {
  17260. // 确保当前 vm 所有数据被同步
  17261. var ret = Object.create(null);
  17262. var dataKeys = [].concat(
  17263. Object.keys(vm._data || {}),
  17264. Object.keys(vm._computedWatchers || {}));
  17265. dataKeys.reduce(function(ret, key) {
  17266. ret[key] = vm[key];
  17267. return ret
  17268. }, ret);
  17269. // vue-composition-api
  17270. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  17271. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  17272. if (rawBindings) {
  17273. Object.keys(rawBindings).forEach(function (key) {
  17274. ret[key] = vm[key];
  17275. });
  17276. }
  17277. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  17278. Object.assign(ret, vm.$mp.data || {});
  17279. if (
  17280. Array.isArray(vm.$options.behaviors) &&
  17281. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  17282. ) { //form-field
  17283. ret['name'] = vm.name;
  17284. ret['value'] = vm.value;
  17285. }
  17286. return JSON.parse(JSON.stringify(ret, clearInstance))
  17287. }
  17288. var patch = function(oldVnode, vnode) {
  17289. var this$1 = this;
  17290. if (vnode === null) { //destroy
  17291. return
  17292. }
  17293. if (this.mpType === 'page' || this.mpType === 'component') {
  17294. var mpInstance = this.$scope;
  17295. var data = Object.create(null);
  17296. try {
  17297. data = cloneWithData(this);
  17298. } catch (err) {
  17299. console.error(err);
  17300. }
  17301. data.__webviewId__ = mpInstance.data.__webviewId__;
  17302. var mpData = Object.create(null);
  17303. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  17304. mpData[key] = mpInstance.data[key];
  17305. });
  17306. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  17307. if (Object.keys(diffData).length) {
  17308. if (Object({"VUE_APP_DARK_MODE":"false","VUE_APP_NAME":"hptwxMiniProgram","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  17309. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  17310. ']差量更新',
  17311. JSON.stringify(diffData));
  17312. }
  17313. this.__next_tick_pending = true;
  17314. mpInstance.setData(diffData, function () {
  17315. this$1.__next_tick_pending = false;
  17316. flushCallbacks$1(this$1);
  17317. });
  17318. } else {
  17319. flushCallbacks$1(this);
  17320. }
  17321. }
  17322. };
  17323. /* */
  17324. function createEmptyRender() {
  17325. }
  17326. function mountComponent$1(
  17327. vm,
  17328. el,
  17329. hydrating
  17330. ) {
  17331. if (!vm.mpType) {//main.js 中的 new Vue
  17332. return vm
  17333. }
  17334. if (vm.mpType === 'app') {
  17335. vm.$options.render = createEmptyRender;
  17336. }
  17337. if (!vm.$options.render) {
  17338. vm.$options.render = createEmptyRender;
  17339. if (true) {
  17340. /* istanbul ignore if */
  17341. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  17342. vm.$options.el || el) {
  17343. warn(
  17344. 'You are using the runtime-only build of Vue where the template ' +
  17345. 'compiler is not available. Either pre-compile the templates into ' +
  17346. 'render functions, or use the compiler-included build.',
  17347. vm
  17348. );
  17349. } else {
  17350. warn(
  17351. 'Failed to mount component: template or render function not defined.',
  17352. vm
  17353. );
  17354. }
  17355. }
  17356. }
  17357. !vm._$fallback && callHook(vm, 'beforeMount');
  17358. var updateComponent = function () {
  17359. vm._update(vm._render(), hydrating);
  17360. };
  17361. // we set this to vm._watcher inside the watcher's constructor
  17362. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  17363. // component's mounted hook), which relies on vm._watcher being already defined
  17364. new Watcher(vm, updateComponent, noop, {
  17365. before: function before() {
  17366. if (vm._isMounted && !vm._isDestroyed) {
  17367. callHook(vm, 'beforeUpdate');
  17368. }
  17369. }
  17370. }, true /* isRenderWatcher */);
  17371. hydrating = false;
  17372. return vm
  17373. }
  17374. /* */
  17375. function renderClass (
  17376. staticClass,
  17377. dynamicClass
  17378. ) {
  17379. if (isDef(staticClass) || isDef(dynamicClass)) {
  17380. return concat(staticClass, stringifyClass(dynamicClass))
  17381. }
  17382. /* istanbul ignore next */
  17383. return ''
  17384. }
  17385. function concat (a, b) {
  17386. return a ? b ? (a + ' ' + b) : a : (b || '')
  17387. }
  17388. function stringifyClass (value) {
  17389. if (Array.isArray(value)) {
  17390. return stringifyArray(value)
  17391. }
  17392. if (isObject(value)) {
  17393. return stringifyObject(value)
  17394. }
  17395. if (typeof value === 'string') {
  17396. return value
  17397. }
  17398. /* istanbul ignore next */
  17399. return ''
  17400. }
  17401. function stringifyArray (value) {
  17402. var res = '';
  17403. var stringified;
  17404. for (var i = 0, l = value.length; i < l; i++) {
  17405. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  17406. if (res) { res += ' '; }
  17407. res += stringified;
  17408. }
  17409. }
  17410. return res
  17411. }
  17412. function stringifyObject (value) {
  17413. var res = '';
  17414. for (var key in value) {
  17415. if (value[key]) {
  17416. if (res) { res += ' '; }
  17417. res += key;
  17418. }
  17419. }
  17420. return res
  17421. }
  17422. /* */
  17423. var parseStyleText = cached(function (cssText) {
  17424. var res = {};
  17425. var listDelimiter = /;(?![^(]*\))/g;
  17426. var propertyDelimiter = /:(.+)/;
  17427. cssText.split(listDelimiter).forEach(function (item) {
  17428. if (item) {
  17429. var tmp = item.split(propertyDelimiter);
  17430. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  17431. }
  17432. });
  17433. return res
  17434. });
  17435. // normalize possible array / string values into Object
  17436. function normalizeStyleBinding (bindingStyle) {
  17437. if (Array.isArray(bindingStyle)) {
  17438. return toObject(bindingStyle)
  17439. }
  17440. if (typeof bindingStyle === 'string') {
  17441. return parseStyleText(bindingStyle)
  17442. }
  17443. return bindingStyle
  17444. }
  17445. /* */
  17446. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  17447. function getTarget(obj, path) {
  17448. var parts = path.split('.');
  17449. var key = parts[0];
  17450. if (key.indexOf('__$n') === 0) { //number index
  17451. key = parseInt(key.replace('__$n', ''));
  17452. }
  17453. if (parts.length === 1) {
  17454. return obj[key]
  17455. }
  17456. return getTarget(obj[key], parts.slice(1).join('.'))
  17457. }
  17458. function internalMixin(Vue) {
  17459. Vue.config.errorHandler = function(err, vm, info) {
  17460. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  17461. console.error(err);
  17462. /* eslint-disable no-undef */
  17463. var app = typeof getApp === 'function' && getApp();
  17464. if (app && app.onError) {
  17465. app.onError(err);
  17466. }
  17467. };
  17468. var oldEmit = Vue.prototype.$emit;
  17469. Vue.prototype.$emit = function(event) {
  17470. if (this.$scope && event) {
  17471. var triggerEvent = this.$scope['_triggerEvent'] || this.$scope['triggerEvent'];
  17472. if (triggerEvent) {
  17473. try {
  17474. triggerEvent.call(this.$scope, event, {
  17475. __args__: toArray(arguments, 1)
  17476. });
  17477. } catch (error) {
  17478. }
  17479. }
  17480. }
  17481. return oldEmit.apply(this, arguments)
  17482. };
  17483. Vue.prototype.$nextTick = function(fn) {
  17484. return nextTick$1(this, fn)
  17485. };
  17486. MP_METHODS.forEach(function (method) {
  17487. Vue.prototype[method] = function(args) {
  17488. if (this.$scope && this.$scope[method]) {
  17489. return this.$scope[method](args)
  17490. }
  17491. // mp-alipay
  17492. if (typeof my === 'undefined') {
  17493. return
  17494. }
  17495. if (method === 'createSelectorQuery') {
  17496. /* eslint-disable no-undef */
  17497. return my.createSelectorQuery(args)
  17498. } else if (method === 'createIntersectionObserver') {
  17499. /* eslint-disable no-undef */
  17500. return my.createIntersectionObserver(args)
  17501. }
  17502. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  17503. };
  17504. });
  17505. Vue.prototype.__init_provide = initProvide;
  17506. Vue.prototype.__init_injections = initInjections;
  17507. Vue.prototype.__call_hook = function(hook, args) {
  17508. var vm = this;
  17509. // #7573 disable dep collection when invoking lifecycle hooks
  17510. pushTarget();
  17511. var handlers = vm.$options[hook];
  17512. var info = hook + " hook";
  17513. var ret;
  17514. if (handlers) {
  17515. for (var i = 0, j = handlers.length; i < j; i++) {
  17516. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  17517. }
  17518. }
  17519. if (vm._hasHookEvent) {
  17520. vm.$emit('hook:' + hook, args);
  17521. }
  17522. popTarget();
  17523. return ret
  17524. };
  17525. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  17526. if (Array.isArray(modifiers)) {
  17527. if (modifiers.indexOf('trim') !== -1) {
  17528. value = value.trim();
  17529. }
  17530. if (modifiers.indexOf('number') !== -1) {
  17531. value = this._n(value);
  17532. }
  17533. }
  17534. if (!target) {
  17535. target = this;
  17536. }
  17537. // 解决动态属性添加
  17538. Vue.set(target, key, value);
  17539. };
  17540. Vue.prototype.__set_sync = function(target, key, value) {
  17541. if (!target) {
  17542. target = this;
  17543. }
  17544. // 解决动态属性添加
  17545. Vue.set(target, key, value);
  17546. };
  17547. Vue.prototype.__get_orig = function(item) {
  17548. if (isPlainObject(item)) {
  17549. return item['$orig'] || item
  17550. }
  17551. return item
  17552. };
  17553. Vue.prototype.__get_value = function(dataPath, target) {
  17554. return getTarget(target || this, dataPath)
  17555. };
  17556. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  17557. return renderClass(staticClass, dynamicClass)
  17558. };
  17559. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  17560. if (!dynamicStyle && !staticStyle) {
  17561. return ''
  17562. }
  17563. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  17564. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  17565. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  17566. };
  17567. Vue.prototype.__map = function(val, iteratee) {
  17568. //TODO 暂不考虑 string
  17569. var ret, i, l, keys, key;
  17570. if (Array.isArray(val)) {
  17571. ret = new Array(val.length);
  17572. for (i = 0, l = val.length; i < l; i++) {
  17573. ret[i] = iteratee(val[i], i);
  17574. }
  17575. return ret
  17576. } else if (isObject(val)) {
  17577. keys = Object.keys(val);
  17578. ret = Object.create(null);
  17579. for (i = 0, l = keys.length; i < l; i++) {
  17580. key = keys[i];
  17581. ret[key] = iteratee(val[key], key, i);
  17582. }
  17583. return ret
  17584. } else if (typeof val === 'number') {
  17585. ret = new Array(val);
  17586. for (i = 0, l = val; i < l; i++) {
  17587. // 第一个参数暂时仍和小程序一致
  17588. ret[i] = iteratee(i, i);
  17589. }
  17590. return ret
  17591. }
  17592. return []
  17593. };
  17594. }
  17595. /* */
  17596. var LIFECYCLE_HOOKS$1 = [
  17597. //App
  17598. 'onLaunch',
  17599. 'onShow',
  17600. 'onHide',
  17601. 'onUniNViewMessage',
  17602. 'onPageNotFound',
  17603. 'onThemeChange',
  17604. 'onError',
  17605. 'onUnhandledRejection',
  17606. //Page
  17607. 'onInit',
  17608. 'onLoad',
  17609. // 'onShow',
  17610. 'onReady',
  17611. // 'onHide',
  17612. 'onUnload',
  17613. 'onPullDownRefresh',
  17614. 'onReachBottom',
  17615. 'onTabItemTap',
  17616. 'onAddToFavorites',
  17617. 'onShareTimeline',
  17618. 'onShareAppMessage',
  17619. 'onResize',
  17620. 'onPageScroll',
  17621. 'onNavigationBarButtonTap',
  17622. 'onBackPress',
  17623. 'onNavigationBarSearchInputChanged',
  17624. 'onNavigationBarSearchInputConfirmed',
  17625. 'onNavigationBarSearchInputClicked',
  17626. 'onUploadDouyinVideo',
  17627. 'onNFCReadMessage',
  17628. //Component
  17629. // 'onReady', // 兼容旧版本,应该移除该事件
  17630. 'onPageShow',
  17631. 'onPageHide',
  17632. 'onPageResize'
  17633. ];
  17634. function lifecycleMixin$1(Vue) {
  17635. //fixed vue-class-component
  17636. var oldExtend = Vue.extend;
  17637. Vue.extend = function(extendOptions) {
  17638. extendOptions = extendOptions || {};
  17639. var methods = extendOptions.methods;
  17640. if (methods) {
  17641. Object.keys(methods).forEach(function (methodName) {
  17642. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  17643. extendOptions[methodName] = methods[methodName];
  17644. delete methods[methodName];
  17645. }
  17646. });
  17647. }
  17648. return oldExtend.call(this, extendOptions)
  17649. };
  17650. var strategies = Vue.config.optionMergeStrategies;
  17651. var mergeHook = strategies.created;
  17652. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  17653. strategies[hook] = mergeHook;
  17654. });
  17655. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  17656. }
  17657. /* */
  17658. // install platform patch function
  17659. Vue.prototype.__patch__ = patch;
  17660. // public mount method
  17661. Vue.prototype.$mount = function(
  17662. el ,
  17663. hydrating
  17664. ) {
  17665. return mountComponent$1(this, el, hydrating)
  17666. };
  17667. lifecycleMixin$1(Vue);
  17668. internalMixin(Vue);
  17669. /* */
  17670. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  17671. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  17672. /***/ }),
  17673. /***/ 252:
  17674. /*!****************************************************************************************************************************!*\
  17675. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/index.js ***!
  17676. \****************************************************************************************************************************/
  17677. /*! no static exports found */
  17678. /***/ (function(module, exports, __webpack_require__) {
  17679. "use strict";
  17680. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  17681. Object.defineProperty(exports, "__esModule", {
  17682. value: true
  17683. });
  17684. exports.default = void 0;
  17685. var _en = _interopRequireDefault(__webpack_require__(/*! ./en.json */ 253));
  17686. var _zhHans = _interopRequireDefault(__webpack_require__(/*! ./zh-Hans.json */ 254));
  17687. var _zhHant = _interopRequireDefault(__webpack_require__(/*! ./zh-Hant.json */ 255));
  17688. var _default = {
  17689. en: _en.default,
  17690. 'zh-Hans': _zhHans.default,
  17691. 'zh-Hant': _zhHant.default
  17692. };
  17693. exports.default = _default;
  17694. /***/ }),
  17695. /***/ 253:
  17696. /*!***************************************************************************************************************************!*\
  17697. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/en.json ***!
  17698. \***************************************************************************************************************************/
  17699. /*! exports provided: uni-datetime-picker.selectDate, uni-datetime-picker.selectTime, uni-datetime-picker.selectDateTime, uni-datetime-picker.startDate, uni-datetime-picker.endDate, uni-datetime-picker.startTime, uni-datetime-picker.endTime, uni-datetime-picker.ok, uni-datetime-picker.clear, uni-datetime-picker.cancel, uni-datetime-picker.year, uni-datetime-picker.month, uni-calender.MON, uni-calender.TUE, uni-calender.WED, uni-calender.THU, uni-calender.FRI, uni-calender.SAT, uni-calender.SUN, uni-calender.confirm, default */
  17700. /***/ (function(module) {
  17701. module.exports = JSON.parse("{\"uni-datetime-picker.selectDate\":\"select date\",\"uni-datetime-picker.selectTime\":\"select time\",\"uni-datetime-picker.selectDateTime\":\"select date and time\",\"uni-datetime-picker.startDate\":\"start date\",\"uni-datetime-picker.endDate\":\"end date\",\"uni-datetime-picker.startTime\":\"start time\",\"uni-datetime-picker.endTime\":\"end time\",\"uni-datetime-picker.ok\":\"ok\",\"uni-datetime-picker.clear\":\"clear\",\"uni-datetime-picker.cancel\":\"cancel\",\"uni-datetime-picker.year\":\"-\",\"uni-datetime-picker.month\":\"\",\"uni-calender.MON\":\"MON\",\"uni-calender.TUE\":\"TUE\",\"uni-calender.WED\":\"WED\",\"uni-calender.THU\":\"THU\",\"uni-calender.FRI\":\"FRI\",\"uni-calender.SAT\":\"SAT\",\"uni-calender.SUN\":\"SUN\",\"uni-calender.confirm\":\"confirm\"}");
  17702. /***/ }),
  17703. /***/ 254:
  17704. /*!********************************************************************************************************************************!*\
  17705. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/zh-Hans.json ***!
  17706. \********************************************************************************************************************************/
  17707. /*! exports provided: uni-datetime-picker.selectDate, uni-datetime-picker.selectTime, uni-datetime-picker.selectDateTime, uni-datetime-picker.startDate, uni-datetime-picker.endDate, uni-datetime-picker.startTime, uni-datetime-picker.endTime, uni-datetime-picker.ok, uni-datetime-picker.clear, uni-datetime-picker.cancel, uni-datetime-picker.year, uni-datetime-picker.month, uni-calender.SUN, uni-calender.MON, uni-calender.TUE, uni-calender.WED, uni-calender.THU, uni-calender.FRI, uni-calender.SAT, uni-calender.confirm, default */
  17708. /***/ (function(module) {
  17709. module.exports = JSON.parse("{\"uni-datetime-picker.selectDate\":\"选择日期\",\"uni-datetime-picker.selectTime\":\"选择时间\",\"uni-datetime-picker.selectDateTime\":\"选择日期时间\",\"uni-datetime-picker.startDate\":\"开始日期\",\"uni-datetime-picker.endDate\":\"结束日期\",\"uni-datetime-picker.startTime\":\"开始时间\",\"uni-datetime-picker.endTime\":\"结束时间\",\"uni-datetime-picker.ok\":\"确定\",\"uni-datetime-picker.clear\":\"清除\",\"uni-datetime-picker.cancel\":\"取消\",\"uni-datetime-picker.year\":\"年\",\"uni-datetime-picker.month\":\"月\",\"uni-calender.SUN\":\"日\",\"uni-calender.MON\":\"一\",\"uni-calender.TUE\":\"二\",\"uni-calender.WED\":\"三\",\"uni-calender.THU\":\"四\",\"uni-calender.FRI\":\"五\",\"uni-calender.SAT\":\"六\",\"uni-calender.confirm\":\"确认\"}");
  17710. /***/ }),
  17711. /***/ 255:
  17712. /*!********************************************************************************************************************************!*\
  17713. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/zh-Hant.json ***!
  17714. \********************************************************************************************************************************/
  17715. /*! exports provided: uni-datetime-picker.selectDate, uni-datetime-picker.selectTime, uni-datetime-picker.selectDateTime, uni-datetime-picker.startDate, uni-datetime-picker.endDate, uni-datetime-picker.startTime, uni-datetime-picker.endTime, uni-datetime-picker.ok, uni-datetime-picker.clear, uni-datetime-picker.cancel, uni-datetime-picker.year, uni-datetime-picker.month, uni-calender.SUN, uni-calender.MON, uni-calender.TUE, uni-calender.WED, uni-calender.THU, uni-calender.FRI, uni-calender.SAT, uni-calender.confirm, default */
  17716. /***/ (function(module) {
  17717. module.exports = JSON.parse("{\"uni-datetime-picker.selectDate\":\"選擇日期\",\"uni-datetime-picker.selectTime\":\"選擇時間\",\"uni-datetime-picker.selectDateTime\":\"選擇日期時間\",\"uni-datetime-picker.startDate\":\"開始日期\",\"uni-datetime-picker.endDate\":\"結束日期\",\"uni-datetime-picker.startTime\":\"開始时间\",\"uni-datetime-picker.endTime\":\"結束时间\",\"uni-datetime-picker.ok\":\"確定\",\"uni-datetime-picker.clear\":\"清除\",\"uni-datetime-picker.cancel\":\"取消\",\"uni-datetime-picker.year\":\"年\",\"uni-datetime-picker.month\":\"月\",\"uni-calender.SUN\":\"日\",\"uni-calender.MON\":\"一\",\"uni-calender.TUE\":\"二\",\"uni-calender.WED\":\"三\",\"uni-calender.THU\":\"四\",\"uni-calender.FRI\":\"五\",\"uni-calender.SAT\":\"六\",\"uni-calender.confirm\":\"確認\"}");
  17718. /***/ }),
  17719. /***/ 256:
  17720. /*!**********************************************************************************************************************!*\
  17721. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-datetime-picker/components/uni-datetime-picker/util.js ***!
  17722. \**********************************************************************************************************************/
  17723. /*! no static exports found */
  17724. /***/ (function(module, exports, __webpack_require__) {
  17725. "use strict";
  17726. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  17727. Object.defineProperty(exports, "__esModule", {
  17728. value: true
  17729. });
  17730. exports.Calendar = void 0;
  17731. exports.addZero = addZero;
  17732. exports.checkDate = checkDate;
  17733. exports.dateCompare = dateCompare;
  17734. exports.fixIosDateFormat = fixIosDateFormat;
  17735. exports.getDate = getDate;
  17736. exports.getDateTime = getDateTime;
  17737. exports.getDefaultSecond = getDefaultSecond;
  17738. exports.getTime = getTime;
  17739. var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18));
  17740. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23));
  17741. var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ 24));
  17742. var Calendar = /*#__PURE__*/function () {
  17743. function Calendar() {
  17744. var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  17745. selected = _ref.selected,
  17746. startDate = _ref.startDate,
  17747. endDate = _ref.endDate,
  17748. range = _ref.range;
  17749. (0, _classCallCheck2.default)(this, Calendar);
  17750. // 当前日期
  17751. this.date = this.getDateObj(new Date()); // 当前初入日期
  17752. // 打点信息
  17753. this.selected = selected || [];
  17754. // 起始时间
  17755. this.startDate = startDate;
  17756. // 终止时间
  17757. this.endDate = endDate;
  17758. // 是否范围选择
  17759. this.range = range;
  17760. // 多选状态
  17761. this.cleanMultipleStatus();
  17762. // 每周日期
  17763. this.weeks = {};
  17764. this.lastHover = false;
  17765. }
  17766. /**
  17767. * 设置日期
  17768. * @param {Object} date
  17769. */
  17770. (0, _createClass2.default)(Calendar, [{
  17771. key: "setDate",
  17772. value: function setDate(date) {
  17773. var selectDate = this.getDateObj(date);
  17774. this.getWeeks(selectDate.fullDate);
  17775. }
  17776. /**
  17777. * 清理多选状态
  17778. */
  17779. }, {
  17780. key: "cleanMultipleStatus",
  17781. value: function cleanMultipleStatus() {
  17782. this.multipleStatus = {
  17783. before: '',
  17784. after: '',
  17785. data: []
  17786. };
  17787. }
  17788. }, {
  17789. key: "setStartDate",
  17790. value: function setStartDate(startDate) {
  17791. this.startDate = startDate;
  17792. }
  17793. }, {
  17794. key: "setEndDate",
  17795. value: function setEndDate(endDate) {
  17796. this.endDate = endDate;
  17797. }
  17798. }, {
  17799. key: "getPreMonthObj",
  17800. value: function getPreMonthObj(date) {
  17801. date = fixIosDateFormat(date);
  17802. date = new Date(date);
  17803. var oldMonth = date.getMonth();
  17804. date.setMonth(oldMonth - 1);
  17805. var newMonth = date.getMonth();
  17806. if (oldMonth !== 0 && newMonth - oldMonth === 0) {
  17807. date.setMonth(newMonth - 1);
  17808. }
  17809. return this.getDateObj(date);
  17810. }
  17811. }, {
  17812. key: "getNextMonthObj",
  17813. value: function getNextMonthObj(date) {
  17814. date = fixIosDateFormat(date);
  17815. date = new Date(date);
  17816. var oldMonth = date.getMonth();
  17817. date.setMonth(oldMonth + 1);
  17818. var newMonth = date.getMonth();
  17819. if (newMonth - oldMonth > 1) {
  17820. date.setMonth(newMonth - 1);
  17821. }
  17822. return this.getDateObj(date);
  17823. }
  17824. /**
  17825. * 获取指定格式Date对象
  17826. */
  17827. }, {
  17828. key: "getDateObj",
  17829. value: function getDateObj(date) {
  17830. date = fixIosDateFormat(date);
  17831. date = new Date(date);
  17832. return {
  17833. fullDate: getDate(date),
  17834. year: date.getFullYear(),
  17835. month: addZero(date.getMonth() + 1),
  17836. date: addZero(date.getDate()),
  17837. day: date.getDay()
  17838. };
  17839. }
  17840. /**
  17841. * 获取上一个月日期集合
  17842. */
  17843. }, {
  17844. key: "getPreMonthDays",
  17845. value: function getPreMonthDays(amount, dateObj) {
  17846. var _this = this;
  17847. var result = [];
  17848. var _loop = function _loop(i) {
  17849. var month = dateObj.month > 1 ? dateObj.month - 1 : 12;
  17850. var year = month === 12 ? dateObj.year - 1 : dateObj.year;
  17851. var date = new Date(year, month, -i).getDate();
  17852. var fullDate = "".concat(year, "-").concat(addZero(month), "-").concat(addZero(date));
  17853. var multiples = _this.multipleStatus.data;
  17854. var multiplesStatus = -1;
  17855. if (_this.range && multiples) {
  17856. multiplesStatus = multiples.findIndex(function (item) {
  17857. return _this.dateEqual(item, fullDate);
  17858. });
  17859. }
  17860. var checked = multiplesStatus !== -1;
  17861. // 获取打点信息
  17862. var extraInfo = _this.selected && _this.selected.find(function (item) {
  17863. if (_this.dateEqual(fullDate, item.date)) {
  17864. return item;
  17865. }
  17866. });
  17867. result.push({
  17868. fullDate: fullDate,
  17869. year: year,
  17870. month: month,
  17871. date: date,
  17872. multiple: _this.range ? checked : false,
  17873. beforeMultiple: _this.isLogicBefore(fullDate, _this.multipleStatus.before, _this.multipleStatus.after),
  17874. afterMultiple: _this.isLogicAfter(fullDate, _this.multipleStatus.before, _this.multipleStatus.after),
  17875. disable: _this.startDate && !dateCompare(_this.startDate, fullDate) || _this.endDate && !dateCompare(fullDate, _this.endDate),
  17876. isToday: fullDate === _this.date.fullDate,
  17877. userChecked: false,
  17878. extraInfo: extraInfo
  17879. });
  17880. };
  17881. for (var i = amount - 1; i >= 0; i--) {
  17882. _loop(i);
  17883. }
  17884. return result;
  17885. }
  17886. /**
  17887. * 获取本月日期集合
  17888. */
  17889. }, {
  17890. key: "getCurrentMonthDays",
  17891. value: function getCurrentMonthDays(amount, dateObj) {
  17892. var _this2 = this;
  17893. var result = [];
  17894. var fullDate = this.date.fullDate;
  17895. var _loop2 = function _loop2(i) {
  17896. var currentDate = "".concat(dateObj.year, "-").concat(dateObj.month, "-").concat(addZero(i));
  17897. var isToday = fullDate === currentDate;
  17898. // 获取打点信息
  17899. var extraInfo = _this2.selected && _this2.selected.find(function (item) {
  17900. if (_this2.dateEqual(currentDate, item.date)) {
  17901. return item;
  17902. }
  17903. });
  17904. // 日期禁用
  17905. var disableBefore = true;
  17906. var disableAfter = true;
  17907. if (_this2.startDate) {
  17908. disableBefore = dateCompare(_this2.startDate, currentDate);
  17909. }
  17910. if (_this2.endDate) {
  17911. disableAfter = dateCompare(currentDate, _this2.endDate);
  17912. }
  17913. var multiples = _this2.multipleStatus.data;
  17914. var multiplesStatus = -1;
  17915. if (_this2.range && multiples) {
  17916. multiplesStatus = multiples.findIndex(function (item) {
  17917. return _this2.dateEqual(item, currentDate);
  17918. });
  17919. }
  17920. var checked = multiplesStatus !== -1;
  17921. result.push({
  17922. fullDate: currentDate,
  17923. year: dateObj.year,
  17924. month: dateObj.month,
  17925. date: i,
  17926. multiple: _this2.range ? checked : false,
  17927. beforeMultiple: _this2.isLogicBefore(currentDate, _this2.multipleStatus.before, _this2.multipleStatus.after),
  17928. afterMultiple: _this2.isLogicAfter(currentDate, _this2.multipleStatus.before, _this2.multipleStatus.after),
  17929. disable: _this2.startDate && !dateCompare(_this2.startDate, currentDate) || _this2.endDate && !dateCompare(currentDate, _this2.endDate),
  17930. isToday: isToday,
  17931. userChecked: false,
  17932. extraInfo: extraInfo
  17933. });
  17934. };
  17935. for (var i = 1; i <= amount; i++) {
  17936. _loop2(i);
  17937. }
  17938. return result;
  17939. }
  17940. /**
  17941. * 获取下一个月日期集合
  17942. */
  17943. }, {
  17944. key: "_getNextMonthDays",
  17945. value: function _getNextMonthDays(amount, dateObj) {
  17946. var _this3 = this;
  17947. var result = [];
  17948. var month = dateObj.month + 1;
  17949. var _loop3 = function _loop3(i) {
  17950. var month = dateObj.month === 12 ? 1 : dateObj.month * 1 + 1;
  17951. var year = month === 1 ? dateObj.year + 1 : dateObj.year;
  17952. var fullDate = "".concat(year, "-").concat(addZero(month), "-").concat(addZero(i));
  17953. var multiples = _this3.multipleStatus.data;
  17954. var multiplesStatus = -1;
  17955. if (_this3.range && multiples) {
  17956. multiplesStatus = multiples.findIndex(function (item) {
  17957. return _this3.dateEqual(item, fullDate);
  17958. });
  17959. }
  17960. var checked = multiplesStatus !== -1;
  17961. // 获取打点信息
  17962. var extraInfo = _this3.selected && _this3.selected.find(function (item) {
  17963. if (_this3.dateEqual(fullDate, item.date)) {
  17964. return item;
  17965. }
  17966. });
  17967. result.push({
  17968. fullDate: fullDate,
  17969. year: year,
  17970. date: i,
  17971. month: month,
  17972. multiple: _this3.range ? checked : false,
  17973. beforeMultiple: _this3.isLogicBefore(fullDate, _this3.multipleStatus.before, _this3.multipleStatus.after),
  17974. afterMultiple: _this3.isLogicAfter(fullDate, _this3.multipleStatus.before, _this3.multipleStatus.after),
  17975. disable: _this3.startDate && !dateCompare(_this3.startDate, fullDate) || _this3.endDate && !dateCompare(fullDate, _this3.endDate),
  17976. isToday: fullDate === _this3.date.fullDate,
  17977. userChecked: false,
  17978. extraInfo: extraInfo
  17979. });
  17980. };
  17981. for (var i = 1; i <= amount; i++) {
  17982. _loop3(i);
  17983. }
  17984. return result;
  17985. }
  17986. /**
  17987. * 获取当前日期详情
  17988. * @param {Object} date
  17989. */
  17990. }, {
  17991. key: "getInfo",
  17992. value: function getInfo(date) {
  17993. var _this4 = this;
  17994. if (!date) {
  17995. date = new Date();
  17996. }
  17997. return this.calendar.find(function (item) {
  17998. return item.fullDate === _this4.getDateObj(date).fullDate;
  17999. });
  18000. }
  18001. /**
  18002. * 比较时间是否相等
  18003. */
  18004. }, {
  18005. key: "dateEqual",
  18006. value: function dateEqual(before, after) {
  18007. before = new Date(fixIosDateFormat(before));
  18008. after = new Date(fixIosDateFormat(after));
  18009. return before.valueOf() === after.valueOf();
  18010. }
  18011. /**
  18012. * 比较真实起始日期
  18013. */
  18014. }, {
  18015. key: "isLogicBefore",
  18016. value: function isLogicBefore(currentDate, before, after) {
  18017. var logicBefore = before;
  18018. if (before && after) {
  18019. logicBefore = dateCompare(before, after) ? before : after;
  18020. }
  18021. return this.dateEqual(logicBefore, currentDate);
  18022. }
  18023. }, {
  18024. key: "isLogicAfter",
  18025. value: function isLogicAfter(currentDate, before, after) {
  18026. var logicAfter = after;
  18027. if (before && after) {
  18028. logicAfter = dateCompare(before, after) ? after : before;
  18029. }
  18030. return this.dateEqual(logicAfter, currentDate);
  18031. }
  18032. /**
  18033. * 获取日期范围内所有日期
  18034. * @param {Object} begin
  18035. * @param {Object} end
  18036. */
  18037. }, {
  18038. key: "geDateAll",
  18039. value: function geDateAll(begin, end) {
  18040. var arr = [];
  18041. var ab = begin.split('-');
  18042. var ae = end.split('-');
  18043. var db = new Date();
  18044. db.setFullYear(ab[0], ab[1] - 1, ab[2]);
  18045. var de = new Date();
  18046. de.setFullYear(ae[0], ae[1] - 1, ae[2]);
  18047. var unixDb = db.getTime() - 24 * 60 * 60 * 1000;
  18048. var unixDe = de.getTime() - 24 * 60 * 60 * 1000;
  18049. for (var k = unixDb; k <= unixDe;) {
  18050. k = k + 24 * 60 * 60 * 1000;
  18051. arr.push(this.getDateObj(new Date(parseInt(k))).fullDate);
  18052. }
  18053. return arr;
  18054. }
  18055. /**
  18056. * 获取多选状态
  18057. */
  18058. }, {
  18059. key: "setMultiple",
  18060. value: function setMultiple(fullDate) {
  18061. if (!this.range) return;
  18062. var _this$multipleStatus = this.multipleStatus,
  18063. before = _this$multipleStatus.before,
  18064. after = _this$multipleStatus.after;
  18065. if (before && after) {
  18066. if (!this.lastHover) {
  18067. this.lastHover = true;
  18068. return;
  18069. }
  18070. this.multipleStatus.before = fullDate;
  18071. this.multipleStatus.after = '';
  18072. this.multipleStatus.data = [];
  18073. this.multipleStatus.fulldate = '';
  18074. this.lastHover = false;
  18075. } else {
  18076. if (!before) {
  18077. this.multipleStatus.before = fullDate;
  18078. this.lastHover = false;
  18079. } else {
  18080. this.multipleStatus.after = fullDate;
  18081. if (dateCompare(this.multipleStatus.before, this.multipleStatus.after)) {
  18082. this.multipleStatus.data = this.geDateAll(this.multipleStatus.before, this.multipleStatus.after);
  18083. } else {
  18084. this.multipleStatus.data = this.geDateAll(this.multipleStatus.after, this.multipleStatus.before);
  18085. }
  18086. this.lastHover = true;
  18087. }
  18088. }
  18089. this.getWeeks(fullDate);
  18090. }
  18091. /**
  18092. * 鼠标 hover 更新多选状态
  18093. */
  18094. }, {
  18095. key: "setHoverMultiple",
  18096. value: function setHoverMultiple(fullDate) {
  18097. if (!this.range || this.lastHover) return;
  18098. var before = this.multipleStatus.before;
  18099. if (!before) {
  18100. this.multipleStatus.before = fullDate;
  18101. } else {
  18102. this.multipleStatus.after = fullDate;
  18103. if (dateCompare(this.multipleStatus.before, this.multipleStatus.after)) {
  18104. this.multipleStatus.data = this.geDateAll(this.multipleStatus.before, this.multipleStatus.after);
  18105. } else {
  18106. this.multipleStatus.data = this.geDateAll(this.multipleStatus.after, this.multipleStatus.before);
  18107. }
  18108. }
  18109. this.getWeeks(fullDate);
  18110. }
  18111. /**
  18112. * 更新默认值多选状态
  18113. */
  18114. }, {
  18115. key: "setDefaultMultiple",
  18116. value: function setDefaultMultiple(before, after) {
  18117. this.multipleStatus.before = before;
  18118. this.multipleStatus.after = after;
  18119. if (before && after) {
  18120. if (dateCompare(before, after)) {
  18121. this.multipleStatus.data = this.geDateAll(before, after);
  18122. this.getWeeks(after);
  18123. } else {
  18124. this.multipleStatus.data = this.geDateAll(after, before);
  18125. this.getWeeks(before);
  18126. }
  18127. }
  18128. }
  18129. /**
  18130. * 获取每周数据
  18131. * @param {Object} dateData
  18132. */
  18133. }, {
  18134. key: "getWeeks",
  18135. value: function getWeeks(dateData) {
  18136. var _this$getDateObj = this.getDateObj(dateData),
  18137. year = _this$getDateObj.year,
  18138. month = _this$getDateObj.month;
  18139. var preMonthDayAmount = new Date(year, month - 1, 1).getDay();
  18140. var preMonthDays = this.getPreMonthDays(preMonthDayAmount, this.getDateObj(dateData));
  18141. var currentMonthDayAmount = new Date(year, month, 0).getDate();
  18142. var currentMonthDays = this.getCurrentMonthDays(currentMonthDayAmount, this.getDateObj(dateData));
  18143. var nextMonthDayAmount = 42 - preMonthDayAmount - currentMonthDayAmount;
  18144. var nextMonthDays = this._getNextMonthDays(nextMonthDayAmount, this.getDateObj(dateData));
  18145. var calendarDays = [].concat((0, _toConsumableArray2.default)(preMonthDays), (0, _toConsumableArray2.default)(currentMonthDays), (0, _toConsumableArray2.default)(nextMonthDays));
  18146. var weeks = new Array(6);
  18147. for (var i = 0; i < calendarDays.length; i++) {
  18148. var index = Math.floor(i / 7);
  18149. if (!weeks[index]) {
  18150. weeks[index] = new Array(7);
  18151. }
  18152. weeks[index][i % 7] = calendarDays[i];
  18153. }
  18154. this.calendar = calendarDays;
  18155. this.weeks = weeks;
  18156. }
  18157. }]);
  18158. return Calendar;
  18159. }();
  18160. exports.Calendar = Calendar;
  18161. function getDateTime(date, hideSecond) {
  18162. return "".concat(getDate(date), " ").concat(getTime(date, hideSecond));
  18163. }
  18164. function getDate(date) {
  18165. date = fixIosDateFormat(date);
  18166. date = new Date(date);
  18167. var year = date.getFullYear();
  18168. var month = date.getMonth() + 1;
  18169. var day = date.getDate();
  18170. return "".concat(year, "-").concat(addZero(month), "-").concat(addZero(day));
  18171. }
  18172. function getTime(date, hideSecond) {
  18173. date = fixIosDateFormat(date);
  18174. date = new Date(date);
  18175. var hour = date.getHours();
  18176. var minute = date.getMinutes();
  18177. var second = date.getSeconds();
  18178. return hideSecond ? "".concat(addZero(hour), ":").concat(addZero(minute)) : "".concat(addZero(hour), ":").concat(addZero(minute), ":").concat(addZero(second));
  18179. }
  18180. function addZero(num) {
  18181. if (num < 10) {
  18182. num = "0".concat(num);
  18183. }
  18184. return num;
  18185. }
  18186. function getDefaultSecond(hideSecond) {
  18187. return hideSecond ? '00:00' : '00:00:00';
  18188. }
  18189. function dateCompare(startDate, endDate) {
  18190. startDate = new Date(fixIosDateFormat(startDate));
  18191. endDate = new Date(fixIosDateFormat(endDate));
  18192. return startDate <= endDate;
  18193. }
  18194. function checkDate(date) {
  18195. var dateReg = /((19|20)\d{2})(-|\/)\d{1,2}(-|\/)\d{1,2}/g;
  18196. return date.match(dateReg);
  18197. }
  18198. var dateTimeReg = /^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])( [0-5]?[0-9]:[0-5]?[0-9]:[0-5]?[0-9])?$/;
  18199. function fixIosDateFormat(value) {
  18200. if (typeof value === 'string' && dateTimeReg.test(value)) {
  18201. value = value.replace(/-/g, '/');
  18202. }
  18203. return value;
  18204. }
  18205. /***/ }),
  18206. /***/ 26:
  18207. /*!**********************************************************!*\
  18208. !*** E:/work/Project_newGit/hptwxMiniProgram/pages.json ***!
  18209. \**********************************************************/
  18210. /*! no static exports found */
  18211. /***/ (function(module, exports) {
  18212. /***/ }),
  18213. /***/ 271:
  18214. /*!********************************************************************************************************************************!*\
  18215. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-file-picker/components/uni-file-picker/choose-and-upload-file.js ***!
  18216. \********************************************************************************************************************************/
  18217. /*! no static exports found */
  18218. /***/ (function(module, exports, __webpack_require__) {
  18219. "use strict";
  18220. /* WEBPACK VAR INJECTION */(function(uni, wx, uniCloud) {
  18221. Object.defineProperty(exports, "__esModule", {
  18222. value: true
  18223. });
  18224. exports.chooseAndUploadFile = chooseAndUploadFile;
  18225. exports.uploadCloudFiles = uploadCloudFiles;
  18226. var ERR_MSG_OK = 'chooseAndUploadFile:ok';
  18227. var ERR_MSG_FAIL = 'chooseAndUploadFile:fail';
  18228. function chooseImage(opts) {
  18229. var count = opts.count,
  18230. _opts$sizeType = opts.sizeType,
  18231. sizeType = _opts$sizeType === void 0 ? ['original', 'compressed'] : _opts$sizeType,
  18232. sourceType = opts.sourceType,
  18233. extension = opts.extension;
  18234. return new Promise(function (resolve, reject) {
  18235. uni.chooseImage({
  18236. count: count,
  18237. sizeType: sizeType,
  18238. sourceType: sourceType,
  18239. extension: extension,
  18240. success: function success(res) {
  18241. resolve(normalizeChooseAndUploadFileRes(res, 'image'));
  18242. },
  18243. fail: function fail(res) {
  18244. reject({
  18245. errMsg: res.errMsg.replace('chooseImage:fail', ERR_MSG_FAIL)
  18246. });
  18247. }
  18248. });
  18249. });
  18250. }
  18251. function chooseVideo(opts) {
  18252. var camera = opts.camera,
  18253. compressed = opts.compressed,
  18254. maxDuration = opts.maxDuration,
  18255. sourceType = opts.sourceType,
  18256. extension = opts.extension;
  18257. return new Promise(function (resolve, reject) {
  18258. uni.chooseVideo({
  18259. camera: camera,
  18260. compressed: compressed,
  18261. maxDuration: maxDuration,
  18262. sourceType: sourceType,
  18263. extension: extension,
  18264. success: function success(res) {
  18265. var tempFilePath = res.tempFilePath,
  18266. duration = res.duration,
  18267. size = res.size,
  18268. height = res.height,
  18269. width = res.width;
  18270. resolve(normalizeChooseAndUploadFileRes({
  18271. errMsg: 'chooseVideo:ok',
  18272. tempFilePaths: [tempFilePath],
  18273. tempFiles: [{
  18274. name: res.tempFile && res.tempFile.name || '',
  18275. path: tempFilePath,
  18276. size: size,
  18277. type: res.tempFile && res.tempFile.type || '',
  18278. width: width,
  18279. height: height,
  18280. duration: duration,
  18281. fileType: 'video',
  18282. cloudPath: ''
  18283. }]
  18284. }, 'video'));
  18285. },
  18286. fail: function fail(res) {
  18287. reject({
  18288. errMsg: res.errMsg.replace('chooseVideo:fail', ERR_MSG_FAIL)
  18289. });
  18290. }
  18291. });
  18292. });
  18293. }
  18294. function chooseAll(opts) {
  18295. var count = opts.count,
  18296. extension = opts.extension;
  18297. return new Promise(function (resolve, reject) {
  18298. var chooseFile = uni.chooseFile;
  18299. if (typeof wx !== 'undefined' && typeof wx.chooseMessageFile === 'function') {
  18300. chooseFile = wx.chooseMessageFile;
  18301. }
  18302. if (typeof chooseFile !== 'function') {
  18303. return reject({
  18304. errMsg: ERR_MSG_FAIL + ' 请指定 type 类型,该平台仅支持选择 image 或 video。'
  18305. });
  18306. }
  18307. chooseFile({
  18308. type: 'all',
  18309. count: count,
  18310. extension: extension,
  18311. success: function success(res) {
  18312. resolve(normalizeChooseAndUploadFileRes(res));
  18313. },
  18314. fail: function fail(res) {
  18315. reject({
  18316. errMsg: res.errMsg.replace('chooseFile:fail', ERR_MSG_FAIL)
  18317. });
  18318. }
  18319. });
  18320. });
  18321. }
  18322. function normalizeChooseAndUploadFileRes(res, fileType) {
  18323. res.tempFiles.forEach(function (item, index) {
  18324. if (!item.name) {
  18325. item.name = item.path.substring(item.path.lastIndexOf('/') + 1);
  18326. }
  18327. if (fileType) {
  18328. item.fileType = fileType;
  18329. }
  18330. item.cloudPath = Date.now() + '_' + index + item.name.substring(item.name.lastIndexOf('.'));
  18331. });
  18332. if (!res.tempFilePaths) {
  18333. res.tempFilePaths = res.tempFiles.map(function (file) {
  18334. return file.path;
  18335. });
  18336. }
  18337. return res;
  18338. }
  18339. function uploadCloudFiles(files) {
  18340. var max = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 5;
  18341. var _onUploadProgress = arguments.length > 2 ? arguments[2] : undefined;
  18342. files = JSON.parse(JSON.stringify(files));
  18343. var len = files.length;
  18344. var count = 0;
  18345. var self = this;
  18346. return new Promise(function (resolve) {
  18347. while (count < max) {
  18348. next();
  18349. }
  18350. function next() {
  18351. var cur = count++;
  18352. if (cur >= len) {
  18353. !files.find(function (item) {
  18354. return !item.url && !item.errMsg;
  18355. }) && resolve(files);
  18356. return;
  18357. }
  18358. var fileItem = files[cur];
  18359. var index = self.files.findIndex(function (v) {
  18360. return v.uuid === fileItem.uuid;
  18361. });
  18362. fileItem.url = '';
  18363. delete fileItem.errMsg;
  18364. uniCloud.uploadFile({
  18365. filePath: fileItem.path,
  18366. cloudPath: fileItem.cloudPath,
  18367. fileType: fileItem.fileType,
  18368. onUploadProgress: function onUploadProgress(res) {
  18369. res.index = index;
  18370. _onUploadProgress && _onUploadProgress(res);
  18371. }
  18372. }).then(function (res) {
  18373. fileItem.url = res.fileID;
  18374. fileItem.index = index;
  18375. if (cur < len) {
  18376. next();
  18377. }
  18378. }).catch(function (res) {
  18379. fileItem.errMsg = res.errMsg || res.message;
  18380. fileItem.index = index;
  18381. if (cur < len) {
  18382. next();
  18383. }
  18384. });
  18385. }
  18386. });
  18387. }
  18388. function uploadFiles(choosePromise, _ref) {
  18389. var onChooseFile = _ref.onChooseFile,
  18390. onUploadProgress = _ref.onUploadProgress;
  18391. return choosePromise.then(function (res) {
  18392. if (onChooseFile) {
  18393. var customChooseRes = onChooseFile(res);
  18394. if (typeof customChooseRes !== 'undefined') {
  18395. return Promise.resolve(customChooseRes).then(function (chooseRes) {
  18396. return typeof chooseRes === 'undefined' ? res : chooseRes;
  18397. });
  18398. }
  18399. }
  18400. return res;
  18401. }).then(function (res) {
  18402. if (res === false) {
  18403. return {
  18404. errMsg: ERR_MSG_OK,
  18405. tempFilePaths: [],
  18406. tempFiles: []
  18407. };
  18408. }
  18409. return res;
  18410. });
  18411. }
  18412. function chooseAndUploadFile() {
  18413. var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
  18414. type: 'all'
  18415. };
  18416. if (opts.type === 'image') {
  18417. return uploadFiles(chooseImage(opts), opts);
  18418. } else if (opts.type === 'video') {
  18419. return uploadFiles(chooseVideo(opts), opts);
  18420. }
  18421. return uploadFiles(chooseAll(opts), opts);
  18422. }
  18423. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"], __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"], __webpack_require__(/*! ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js */ 212)["default"]))
  18424. /***/ }),
  18425. /***/ 272:
  18426. /*!***************************************************************************************************************!*\
  18427. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-file-picker/components/uni-file-picker/utils.js ***!
  18428. \***************************************************************************************************************/
  18429. /*! no static exports found */
  18430. /***/ (function(module, exports, __webpack_require__) {
  18431. "use strict";
  18432. /* WEBPACK VAR INJECTION */(function(uni) {
  18433. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  18434. Object.defineProperty(exports, "__esModule", {
  18435. value: true
  18436. });
  18437. exports.get_files_and_is_max = exports.get_file_info = exports.get_file_ext = exports.get_file_data = exports.get_extname = void 0;
  18438. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 42));
  18439. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 44));
  18440. /**
  18441. * 获取文件名和后缀
  18442. * @param {String} name
  18443. */
  18444. var get_file_ext = function get_file_ext(name) {
  18445. var last_len = name.lastIndexOf('.');
  18446. var len = name.length;
  18447. return {
  18448. name: name.substring(0, last_len),
  18449. ext: name.substring(last_len + 1, len)
  18450. };
  18451. };
  18452. /**
  18453. * 获取扩展名
  18454. * @param {Array} fileExtname
  18455. */
  18456. exports.get_file_ext = get_file_ext;
  18457. var get_extname = function get_extname(fileExtname) {
  18458. if (!Array.isArray(fileExtname)) {
  18459. var extname = fileExtname.replace(/(\[|\])/g, '');
  18460. return extname.split(',');
  18461. } else {
  18462. return fileExtname;
  18463. }
  18464. return [];
  18465. };
  18466. /**
  18467. * 获取文件和检测是否可选
  18468. */
  18469. exports.get_extname = get_extname;
  18470. var get_files_and_is_max = function get_files_and_is_max(res, _extname) {
  18471. var filePaths = [];
  18472. var files = [];
  18473. if (!_extname || _extname.length === 0) {
  18474. return {
  18475. filePaths: filePaths,
  18476. files: files
  18477. };
  18478. }
  18479. res.tempFiles.forEach(function (v) {
  18480. var fileFullName = get_file_ext(v.name);
  18481. var extname = fileFullName.ext.toLowerCase();
  18482. if (_extname.indexOf(extname) !== -1) {
  18483. files.push(v);
  18484. filePaths.push(v.path);
  18485. }
  18486. });
  18487. if (files.length !== res.tempFiles.length) {
  18488. uni.showToast({
  18489. title: "\u5F53\u524D\u9009\u62E9\u4E86".concat(res.tempFiles.length, "\u4E2A\u6587\u4EF6 \uFF0C").concat(res.tempFiles.length - files.length, " \u4E2A\u6587\u4EF6\u683C\u5F0F\u4E0D\u6B63\u786E"),
  18490. icon: 'none',
  18491. duration: 5000
  18492. });
  18493. }
  18494. return {
  18495. filePaths: filePaths,
  18496. files: files
  18497. };
  18498. };
  18499. /**
  18500. * 获取图片信息
  18501. * @param {Object} filepath
  18502. */
  18503. exports.get_files_and_is_max = get_files_and_is_max;
  18504. var get_file_info = function get_file_info(filepath) {
  18505. return new Promise(function (resolve, reject) {
  18506. uni.getImageInfo({
  18507. src: filepath,
  18508. success: function success(res) {
  18509. resolve(res);
  18510. },
  18511. fail: function fail(err) {
  18512. reject(err);
  18513. }
  18514. });
  18515. });
  18516. };
  18517. /**
  18518. * 获取封装数据
  18519. */
  18520. exports.get_file_info = get_file_info;
  18521. var get_file_data = /*#__PURE__*/function () {
  18522. var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(files) {
  18523. var type,
  18524. fileFullName,
  18525. extname,
  18526. filedata,
  18527. imageinfo,
  18528. _args = arguments;
  18529. return _regenerator.default.wrap(function _callee$(_context) {
  18530. while (1) {
  18531. switch (_context.prev = _context.next) {
  18532. case 0:
  18533. type = _args.length > 1 && _args[1] !== undefined ? _args[1] : 'image';
  18534. // 最终需要上传数据库的数据
  18535. fileFullName = get_file_ext(files.name);
  18536. extname = fileFullName.ext.toLowerCase();
  18537. filedata = {
  18538. name: files.name,
  18539. uuid: files.uuid,
  18540. extname: extname || '',
  18541. cloudPath: files.cloudPath,
  18542. fileType: files.fileType,
  18543. url: files.path || files.path,
  18544. size: files.size,
  18545. //单位是字节
  18546. image: {},
  18547. path: files.path,
  18548. video: {}
  18549. };
  18550. if (!(type === 'image')) {
  18551. _context.next = 14;
  18552. break;
  18553. }
  18554. _context.next = 7;
  18555. return get_file_info(files.path);
  18556. case 7:
  18557. imageinfo = _context.sent;
  18558. delete filedata.video;
  18559. filedata.image.width = imageinfo.width;
  18560. filedata.image.height = imageinfo.height;
  18561. filedata.image.location = imageinfo.path;
  18562. _context.next = 15;
  18563. break;
  18564. case 14:
  18565. delete filedata.image;
  18566. case 15:
  18567. return _context.abrupt("return", filedata);
  18568. case 16:
  18569. case "end":
  18570. return _context.stop();
  18571. }
  18572. }
  18573. }, _callee);
  18574. }));
  18575. return function get_file_data(_x) {
  18576. return _ref.apply(this, arguments);
  18577. };
  18578. }();
  18579. exports.get_file_data = get_file_data;
  18580. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  18581. /***/ }),
  18582. /***/ 294:
  18583. /*!***************************************************************************************************!*\
  18584. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-icons/components/uni-icons/icons.js ***!
  18585. \***************************************************************************************************/
  18586. /*! no static exports found */
  18587. /***/ (function(module, exports, __webpack_require__) {
  18588. "use strict";
  18589. Object.defineProperty(exports, "__esModule", {
  18590. value: true
  18591. });
  18592. exports.default = void 0;
  18593. var _default = {
  18594. "id": "2852637",
  18595. "name": "uniui图标库",
  18596. "font_family": "uniicons",
  18597. "css_prefix_text": "uniui-",
  18598. "description": "",
  18599. "glyphs": [{
  18600. "icon_id": "25027049",
  18601. "name": "yanse",
  18602. "font_class": "color",
  18603. "unicode": "e6cf",
  18604. "unicode_decimal": 59087
  18605. }, {
  18606. "icon_id": "25027048",
  18607. "name": "wallet",
  18608. "font_class": "wallet",
  18609. "unicode": "e6b1",
  18610. "unicode_decimal": 59057
  18611. }, {
  18612. "icon_id": "25015720",
  18613. "name": "settings-filled",
  18614. "font_class": "settings-filled",
  18615. "unicode": "e6ce",
  18616. "unicode_decimal": 59086
  18617. }, {
  18618. "icon_id": "25015434",
  18619. "name": "shimingrenzheng-filled",
  18620. "font_class": "auth-filled",
  18621. "unicode": "e6cc",
  18622. "unicode_decimal": 59084
  18623. }, {
  18624. "icon_id": "24934246",
  18625. "name": "shop-filled",
  18626. "font_class": "shop-filled",
  18627. "unicode": "e6cd",
  18628. "unicode_decimal": 59085
  18629. }, {
  18630. "icon_id": "24934159",
  18631. "name": "staff-filled-01",
  18632. "font_class": "staff-filled",
  18633. "unicode": "e6cb",
  18634. "unicode_decimal": 59083
  18635. }, {
  18636. "icon_id": "24932461",
  18637. "name": "VIP-filled",
  18638. "font_class": "vip-filled",
  18639. "unicode": "e6c6",
  18640. "unicode_decimal": 59078
  18641. }, {
  18642. "icon_id": "24932462",
  18643. "name": "plus_circle_fill",
  18644. "font_class": "plus-filled",
  18645. "unicode": "e6c7",
  18646. "unicode_decimal": 59079
  18647. }, {
  18648. "icon_id": "24932463",
  18649. "name": "folder_add-filled",
  18650. "font_class": "folder-add-filled",
  18651. "unicode": "e6c8",
  18652. "unicode_decimal": 59080
  18653. }, {
  18654. "icon_id": "24932464",
  18655. "name": "yanse-filled",
  18656. "font_class": "color-filled",
  18657. "unicode": "e6c9",
  18658. "unicode_decimal": 59081
  18659. }, {
  18660. "icon_id": "24932465",
  18661. "name": "tune-filled",
  18662. "font_class": "tune-filled",
  18663. "unicode": "e6ca",
  18664. "unicode_decimal": 59082
  18665. }, {
  18666. "icon_id": "24932455",
  18667. "name": "a-rilidaka-filled",
  18668. "font_class": "calendar-filled",
  18669. "unicode": "e6c0",
  18670. "unicode_decimal": 59072
  18671. }, {
  18672. "icon_id": "24932456",
  18673. "name": "notification-filled",
  18674. "font_class": "notification-filled",
  18675. "unicode": "e6c1",
  18676. "unicode_decimal": 59073
  18677. }, {
  18678. "icon_id": "24932457",
  18679. "name": "wallet-filled",
  18680. "font_class": "wallet-filled",
  18681. "unicode": "e6c2",
  18682. "unicode_decimal": 59074
  18683. }, {
  18684. "icon_id": "24932458",
  18685. "name": "paihangbang-filled",
  18686. "font_class": "medal-filled",
  18687. "unicode": "e6c3",
  18688. "unicode_decimal": 59075
  18689. }, {
  18690. "icon_id": "24932459",
  18691. "name": "gift-filled",
  18692. "font_class": "gift-filled",
  18693. "unicode": "e6c4",
  18694. "unicode_decimal": 59076
  18695. }, {
  18696. "icon_id": "24932460",
  18697. "name": "fire-filled",
  18698. "font_class": "fire-filled",
  18699. "unicode": "e6c5",
  18700. "unicode_decimal": 59077
  18701. }, {
  18702. "icon_id": "24928001",
  18703. "name": "refreshempty",
  18704. "font_class": "refreshempty",
  18705. "unicode": "e6bf",
  18706. "unicode_decimal": 59071
  18707. }, {
  18708. "icon_id": "24926853",
  18709. "name": "location-ellipse",
  18710. "font_class": "location-filled",
  18711. "unicode": "e6af",
  18712. "unicode_decimal": 59055
  18713. }, {
  18714. "icon_id": "24926735",
  18715. "name": "person-filled",
  18716. "font_class": "person-filled",
  18717. "unicode": "e69d",
  18718. "unicode_decimal": 59037
  18719. }, {
  18720. "icon_id": "24926703",
  18721. "name": "personadd-filled",
  18722. "font_class": "personadd-filled",
  18723. "unicode": "e698",
  18724. "unicode_decimal": 59032
  18725. }, {
  18726. "icon_id": "24923351",
  18727. "name": "back",
  18728. "font_class": "back",
  18729. "unicode": "e6b9",
  18730. "unicode_decimal": 59065
  18731. }, {
  18732. "icon_id": "24923352",
  18733. "name": "forward",
  18734. "font_class": "forward",
  18735. "unicode": "e6ba",
  18736. "unicode_decimal": 59066
  18737. }, {
  18738. "icon_id": "24923353",
  18739. "name": "arrowthinright",
  18740. "font_class": "arrow-right",
  18741. "unicode": "e6bb",
  18742. "unicode_decimal": 59067
  18743. }, {
  18744. "icon_id": "24923353",
  18745. "name": "arrowthinright",
  18746. "font_class": "arrowthinright",
  18747. "unicode": "e6bb",
  18748. "unicode_decimal": 59067
  18749. }, {
  18750. "icon_id": "24923354",
  18751. "name": "arrowthinleft",
  18752. "font_class": "arrow-left",
  18753. "unicode": "e6bc",
  18754. "unicode_decimal": 59068
  18755. }, {
  18756. "icon_id": "24923354",
  18757. "name": "arrowthinleft",
  18758. "font_class": "arrowthinleft",
  18759. "unicode": "e6bc",
  18760. "unicode_decimal": 59068
  18761. }, {
  18762. "icon_id": "24923355",
  18763. "name": "arrowthinup",
  18764. "font_class": "arrow-up",
  18765. "unicode": "e6bd",
  18766. "unicode_decimal": 59069
  18767. }, {
  18768. "icon_id": "24923355",
  18769. "name": "arrowthinup",
  18770. "font_class": "arrowthinup",
  18771. "unicode": "e6bd",
  18772. "unicode_decimal": 59069
  18773. }, {
  18774. "icon_id": "24923356",
  18775. "name": "arrowthindown",
  18776. "font_class": "arrow-down",
  18777. "unicode": "e6be",
  18778. "unicode_decimal": 59070
  18779. }, {
  18780. "icon_id": "24923356",
  18781. "name": "arrowthindown",
  18782. "font_class": "arrowthindown",
  18783. "unicode": "e6be",
  18784. "unicode_decimal": 59070
  18785. }, {
  18786. "icon_id": "24923349",
  18787. "name": "arrowdown",
  18788. "font_class": "bottom",
  18789. "unicode": "e6b8",
  18790. "unicode_decimal": 59064
  18791. }, {
  18792. "icon_id": "24923349",
  18793. "name": "arrowdown",
  18794. "font_class": "arrowdown",
  18795. "unicode": "e6b8",
  18796. "unicode_decimal": 59064
  18797. }, {
  18798. "icon_id": "24923346",
  18799. "name": "arrowright",
  18800. "font_class": "right",
  18801. "unicode": "e6b5",
  18802. "unicode_decimal": 59061
  18803. }, {
  18804. "icon_id": "24923346",
  18805. "name": "arrowright",
  18806. "font_class": "arrowright",
  18807. "unicode": "e6b5",
  18808. "unicode_decimal": 59061
  18809. }, {
  18810. "icon_id": "24923347",
  18811. "name": "arrowup",
  18812. "font_class": "top",
  18813. "unicode": "e6b6",
  18814. "unicode_decimal": 59062
  18815. }, {
  18816. "icon_id": "24923347",
  18817. "name": "arrowup",
  18818. "font_class": "arrowup",
  18819. "unicode": "e6b6",
  18820. "unicode_decimal": 59062
  18821. }, {
  18822. "icon_id": "24923348",
  18823. "name": "arrowleft",
  18824. "font_class": "left",
  18825. "unicode": "e6b7",
  18826. "unicode_decimal": 59063
  18827. }, {
  18828. "icon_id": "24923348",
  18829. "name": "arrowleft",
  18830. "font_class": "arrowleft",
  18831. "unicode": "e6b7",
  18832. "unicode_decimal": 59063
  18833. }, {
  18834. "icon_id": "24923334",
  18835. "name": "eye",
  18836. "font_class": "eye",
  18837. "unicode": "e651",
  18838. "unicode_decimal": 58961
  18839. }, {
  18840. "icon_id": "24923335",
  18841. "name": "eye-filled",
  18842. "font_class": "eye-filled",
  18843. "unicode": "e66a",
  18844. "unicode_decimal": 58986
  18845. }, {
  18846. "icon_id": "24923336",
  18847. "name": "eye-slash",
  18848. "font_class": "eye-slash",
  18849. "unicode": "e6b3",
  18850. "unicode_decimal": 59059
  18851. }, {
  18852. "icon_id": "24923337",
  18853. "name": "eye-slash-filled",
  18854. "font_class": "eye-slash-filled",
  18855. "unicode": "e6b4",
  18856. "unicode_decimal": 59060
  18857. }, {
  18858. "icon_id": "24923305",
  18859. "name": "info-filled",
  18860. "font_class": "info-filled",
  18861. "unicode": "e649",
  18862. "unicode_decimal": 58953
  18863. }, {
  18864. "icon_id": "24923299",
  18865. "name": "reload-01",
  18866. "font_class": "reload",
  18867. "unicode": "e6b2",
  18868. "unicode_decimal": 59058
  18869. }, {
  18870. "icon_id": "24923195",
  18871. "name": "mic_slash_fill",
  18872. "font_class": "micoff-filled",
  18873. "unicode": "e6b0",
  18874. "unicode_decimal": 59056
  18875. }, {
  18876. "icon_id": "24923165",
  18877. "name": "map-pin-ellipse",
  18878. "font_class": "map-pin-ellipse",
  18879. "unicode": "e6ac",
  18880. "unicode_decimal": 59052
  18881. }, {
  18882. "icon_id": "24923166",
  18883. "name": "map-pin",
  18884. "font_class": "map-pin",
  18885. "unicode": "e6ad",
  18886. "unicode_decimal": 59053
  18887. }, {
  18888. "icon_id": "24923167",
  18889. "name": "location",
  18890. "font_class": "location",
  18891. "unicode": "e6ae",
  18892. "unicode_decimal": 59054
  18893. }, {
  18894. "icon_id": "24923064",
  18895. "name": "starhalf",
  18896. "font_class": "starhalf",
  18897. "unicode": "e683",
  18898. "unicode_decimal": 59011
  18899. }, {
  18900. "icon_id": "24923065",
  18901. "name": "star",
  18902. "font_class": "star",
  18903. "unicode": "e688",
  18904. "unicode_decimal": 59016
  18905. }, {
  18906. "icon_id": "24923066",
  18907. "name": "star-filled",
  18908. "font_class": "star-filled",
  18909. "unicode": "e68f",
  18910. "unicode_decimal": 59023
  18911. }, {
  18912. "icon_id": "24899646",
  18913. "name": "a-rilidaka",
  18914. "font_class": "calendar",
  18915. "unicode": "e6a0",
  18916. "unicode_decimal": 59040
  18917. }, {
  18918. "icon_id": "24899647",
  18919. "name": "fire",
  18920. "font_class": "fire",
  18921. "unicode": "e6a1",
  18922. "unicode_decimal": 59041
  18923. }, {
  18924. "icon_id": "24899648",
  18925. "name": "paihangbang",
  18926. "font_class": "medal",
  18927. "unicode": "e6a2",
  18928. "unicode_decimal": 59042
  18929. }, {
  18930. "icon_id": "24899649",
  18931. "name": "font",
  18932. "font_class": "font",
  18933. "unicode": "e6a3",
  18934. "unicode_decimal": 59043
  18935. }, {
  18936. "icon_id": "24899650",
  18937. "name": "gift",
  18938. "font_class": "gift",
  18939. "unicode": "e6a4",
  18940. "unicode_decimal": 59044
  18941. }, {
  18942. "icon_id": "24899651",
  18943. "name": "link",
  18944. "font_class": "link",
  18945. "unicode": "e6a5",
  18946. "unicode_decimal": 59045
  18947. }, {
  18948. "icon_id": "24899652",
  18949. "name": "notification",
  18950. "font_class": "notification",
  18951. "unicode": "e6a6",
  18952. "unicode_decimal": 59046
  18953. }, {
  18954. "icon_id": "24899653",
  18955. "name": "staff",
  18956. "font_class": "staff",
  18957. "unicode": "e6a7",
  18958. "unicode_decimal": 59047
  18959. }, {
  18960. "icon_id": "24899654",
  18961. "name": "VIP",
  18962. "font_class": "vip",
  18963. "unicode": "e6a8",
  18964. "unicode_decimal": 59048
  18965. }, {
  18966. "icon_id": "24899655",
  18967. "name": "folder_add",
  18968. "font_class": "folder-add",
  18969. "unicode": "e6a9",
  18970. "unicode_decimal": 59049
  18971. }, {
  18972. "icon_id": "24899656",
  18973. "name": "tune",
  18974. "font_class": "tune",
  18975. "unicode": "e6aa",
  18976. "unicode_decimal": 59050
  18977. }, {
  18978. "icon_id": "24899657",
  18979. "name": "shimingrenzheng",
  18980. "font_class": "auth",
  18981. "unicode": "e6ab",
  18982. "unicode_decimal": 59051
  18983. }, {
  18984. "icon_id": "24899565",
  18985. "name": "person",
  18986. "font_class": "person",
  18987. "unicode": "e699",
  18988. "unicode_decimal": 59033
  18989. }, {
  18990. "icon_id": "24899566",
  18991. "name": "email-filled",
  18992. "font_class": "email-filled",
  18993. "unicode": "e69a",
  18994. "unicode_decimal": 59034
  18995. }, {
  18996. "icon_id": "24899567",
  18997. "name": "phone-filled",
  18998. "font_class": "phone-filled",
  18999. "unicode": "e69b",
  19000. "unicode_decimal": 59035
  19001. }, {
  19002. "icon_id": "24899568",
  19003. "name": "phone",
  19004. "font_class": "phone",
  19005. "unicode": "e69c",
  19006. "unicode_decimal": 59036
  19007. }, {
  19008. "icon_id": "24899570",
  19009. "name": "email",
  19010. "font_class": "email",
  19011. "unicode": "e69e",
  19012. "unicode_decimal": 59038
  19013. }, {
  19014. "icon_id": "24899571",
  19015. "name": "personadd",
  19016. "font_class": "personadd",
  19017. "unicode": "e69f",
  19018. "unicode_decimal": 59039
  19019. }, {
  19020. "icon_id": "24899558",
  19021. "name": "chatboxes-filled",
  19022. "font_class": "chatboxes-filled",
  19023. "unicode": "e692",
  19024. "unicode_decimal": 59026
  19025. }, {
  19026. "icon_id": "24899559",
  19027. "name": "contact",
  19028. "font_class": "contact",
  19029. "unicode": "e693",
  19030. "unicode_decimal": 59027
  19031. }, {
  19032. "icon_id": "24899560",
  19033. "name": "chatbubble-filled",
  19034. "font_class": "chatbubble-filled",
  19035. "unicode": "e694",
  19036. "unicode_decimal": 59028
  19037. }, {
  19038. "icon_id": "24899561",
  19039. "name": "contact-filled",
  19040. "font_class": "contact-filled",
  19041. "unicode": "e695",
  19042. "unicode_decimal": 59029
  19043. }, {
  19044. "icon_id": "24899562",
  19045. "name": "chatboxes",
  19046. "font_class": "chatboxes",
  19047. "unicode": "e696",
  19048. "unicode_decimal": 59030
  19049. }, {
  19050. "icon_id": "24899563",
  19051. "name": "chatbubble",
  19052. "font_class": "chatbubble",
  19053. "unicode": "e697",
  19054. "unicode_decimal": 59031
  19055. }, {
  19056. "icon_id": "24881290",
  19057. "name": "upload-filled",
  19058. "font_class": "upload-filled",
  19059. "unicode": "e68e",
  19060. "unicode_decimal": 59022
  19061. }, {
  19062. "icon_id": "24881292",
  19063. "name": "upload",
  19064. "font_class": "upload",
  19065. "unicode": "e690",
  19066. "unicode_decimal": 59024
  19067. }, {
  19068. "icon_id": "24881293",
  19069. "name": "weixin",
  19070. "font_class": "weixin",
  19071. "unicode": "e691",
  19072. "unicode_decimal": 59025
  19073. }, {
  19074. "icon_id": "24881274",
  19075. "name": "compose",
  19076. "font_class": "compose",
  19077. "unicode": "e67f",
  19078. "unicode_decimal": 59007
  19079. }, {
  19080. "icon_id": "24881275",
  19081. "name": "qq",
  19082. "font_class": "qq",
  19083. "unicode": "e680",
  19084. "unicode_decimal": 59008
  19085. }, {
  19086. "icon_id": "24881276",
  19087. "name": "download-filled",
  19088. "font_class": "download-filled",
  19089. "unicode": "e681",
  19090. "unicode_decimal": 59009
  19091. }, {
  19092. "icon_id": "24881277",
  19093. "name": "pengyouquan",
  19094. "font_class": "pyq",
  19095. "unicode": "e682",
  19096. "unicode_decimal": 59010
  19097. }, {
  19098. "icon_id": "24881279",
  19099. "name": "sound",
  19100. "font_class": "sound",
  19101. "unicode": "e684",
  19102. "unicode_decimal": 59012
  19103. }, {
  19104. "icon_id": "24881280",
  19105. "name": "trash-filled",
  19106. "font_class": "trash-filled",
  19107. "unicode": "e685",
  19108. "unicode_decimal": 59013
  19109. }, {
  19110. "icon_id": "24881281",
  19111. "name": "sound-filled",
  19112. "font_class": "sound-filled",
  19113. "unicode": "e686",
  19114. "unicode_decimal": 59014
  19115. }, {
  19116. "icon_id": "24881282",
  19117. "name": "trash",
  19118. "font_class": "trash",
  19119. "unicode": "e687",
  19120. "unicode_decimal": 59015
  19121. }, {
  19122. "icon_id": "24881284",
  19123. "name": "videocam-filled",
  19124. "font_class": "videocam-filled",
  19125. "unicode": "e689",
  19126. "unicode_decimal": 59017
  19127. }, {
  19128. "icon_id": "24881285",
  19129. "name": "spinner-cycle",
  19130. "font_class": "spinner-cycle",
  19131. "unicode": "e68a",
  19132. "unicode_decimal": 59018
  19133. }, {
  19134. "icon_id": "24881286",
  19135. "name": "weibo",
  19136. "font_class": "weibo",
  19137. "unicode": "e68b",
  19138. "unicode_decimal": 59019
  19139. }, {
  19140. "icon_id": "24881288",
  19141. "name": "videocam",
  19142. "font_class": "videocam",
  19143. "unicode": "e68c",
  19144. "unicode_decimal": 59020
  19145. }, {
  19146. "icon_id": "24881289",
  19147. "name": "download",
  19148. "font_class": "download",
  19149. "unicode": "e68d",
  19150. "unicode_decimal": 59021
  19151. }, {
  19152. "icon_id": "24879601",
  19153. "name": "help",
  19154. "font_class": "help",
  19155. "unicode": "e679",
  19156. "unicode_decimal": 59001
  19157. }, {
  19158. "icon_id": "24879602",
  19159. "name": "navigate-filled",
  19160. "font_class": "navigate-filled",
  19161. "unicode": "e67a",
  19162. "unicode_decimal": 59002
  19163. }, {
  19164. "icon_id": "24879603",
  19165. "name": "plusempty",
  19166. "font_class": "plusempty",
  19167. "unicode": "e67b",
  19168. "unicode_decimal": 59003
  19169. }, {
  19170. "icon_id": "24879604",
  19171. "name": "smallcircle",
  19172. "font_class": "smallcircle",
  19173. "unicode": "e67c",
  19174. "unicode_decimal": 59004
  19175. }, {
  19176. "icon_id": "24879605",
  19177. "name": "minus-filled",
  19178. "font_class": "minus-filled",
  19179. "unicode": "e67d",
  19180. "unicode_decimal": 59005
  19181. }, {
  19182. "icon_id": "24879606",
  19183. "name": "micoff",
  19184. "font_class": "micoff",
  19185. "unicode": "e67e",
  19186. "unicode_decimal": 59006
  19187. }, {
  19188. "icon_id": "24879588",
  19189. "name": "closeempty",
  19190. "font_class": "closeempty",
  19191. "unicode": "e66c",
  19192. "unicode_decimal": 58988
  19193. }, {
  19194. "icon_id": "24879589",
  19195. "name": "clear",
  19196. "font_class": "clear",
  19197. "unicode": "e66d",
  19198. "unicode_decimal": 58989
  19199. }, {
  19200. "icon_id": "24879590",
  19201. "name": "navigate",
  19202. "font_class": "navigate",
  19203. "unicode": "e66e",
  19204. "unicode_decimal": 58990
  19205. }, {
  19206. "icon_id": "24879591",
  19207. "name": "minus",
  19208. "font_class": "minus",
  19209. "unicode": "e66f",
  19210. "unicode_decimal": 58991
  19211. }, {
  19212. "icon_id": "24879592",
  19213. "name": "image",
  19214. "font_class": "image",
  19215. "unicode": "e670",
  19216. "unicode_decimal": 58992
  19217. }, {
  19218. "icon_id": "24879593",
  19219. "name": "mic",
  19220. "font_class": "mic",
  19221. "unicode": "e671",
  19222. "unicode_decimal": 58993
  19223. }, {
  19224. "icon_id": "24879594",
  19225. "name": "paperplane",
  19226. "font_class": "paperplane",
  19227. "unicode": "e672",
  19228. "unicode_decimal": 58994
  19229. }, {
  19230. "icon_id": "24879595",
  19231. "name": "close",
  19232. "font_class": "close",
  19233. "unicode": "e673",
  19234. "unicode_decimal": 58995
  19235. }, {
  19236. "icon_id": "24879596",
  19237. "name": "help-filled",
  19238. "font_class": "help-filled",
  19239. "unicode": "e674",
  19240. "unicode_decimal": 58996
  19241. }, {
  19242. "icon_id": "24879597",
  19243. "name": "plus-filled",
  19244. "font_class": "paperplane-filled",
  19245. "unicode": "e675",
  19246. "unicode_decimal": 58997
  19247. }, {
  19248. "icon_id": "24879598",
  19249. "name": "plus",
  19250. "font_class": "plus",
  19251. "unicode": "e676",
  19252. "unicode_decimal": 58998
  19253. }, {
  19254. "icon_id": "24879599",
  19255. "name": "mic-filled",
  19256. "font_class": "mic-filled",
  19257. "unicode": "e677",
  19258. "unicode_decimal": 58999
  19259. }, {
  19260. "icon_id": "24879600",
  19261. "name": "image-filled",
  19262. "font_class": "image-filled",
  19263. "unicode": "e678",
  19264. "unicode_decimal": 59000
  19265. }, {
  19266. "icon_id": "24855900",
  19267. "name": "locked-filled",
  19268. "font_class": "locked-filled",
  19269. "unicode": "e668",
  19270. "unicode_decimal": 58984
  19271. }, {
  19272. "icon_id": "24855901",
  19273. "name": "info",
  19274. "font_class": "info",
  19275. "unicode": "e669",
  19276. "unicode_decimal": 58985
  19277. }, {
  19278. "icon_id": "24855903",
  19279. "name": "locked",
  19280. "font_class": "locked",
  19281. "unicode": "e66b",
  19282. "unicode_decimal": 58987
  19283. }, {
  19284. "icon_id": "24855884",
  19285. "name": "camera-filled",
  19286. "font_class": "camera-filled",
  19287. "unicode": "e658",
  19288. "unicode_decimal": 58968
  19289. }, {
  19290. "icon_id": "24855885",
  19291. "name": "chat-filled",
  19292. "font_class": "chat-filled",
  19293. "unicode": "e659",
  19294. "unicode_decimal": 58969
  19295. }, {
  19296. "icon_id": "24855886",
  19297. "name": "camera",
  19298. "font_class": "camera",
  19299. "unicode": "e65a",
  19300. "unicode_decimal": 58970
  19301. }, {
  19302. "icon_id": "24855887",
  19303. "name": "circle",
  19304. "font_class": "circle",
  19305. "unicode": "e65b",
  19306. "unicode_decimal": 58971
  19307. }, {
  19308. "icon_id": "24855888",
  19309. "name": "checkmarkempty",
  19310. "font_class": "checkmarkempty",
  19311. "unicode": "e65c",
  19312. "unicode_decimal": 58972
  19313. }, {
  19314. "icon_id": "24855889",
  19315. "name": "chat",
  19316. "font_class": "chat",
  19317. "unicode": "e65d",
  19318. "unicode_decimal": 58973
  19319. }, {
  19320. "icon_id": "24855890",
  19321. "name": "circle-filled",
  19322. "font_class": "circle-filled",
  19323. "unicode": "e65e",
  19324. "unicode_decimal": 58974
  19325. }, {
  19326. "icon_id": "24855891",
  19327. "name": "flag",
  19328. "font_class": "flag",
  19329. "unicode": "e65f",
  19330. "unicode_decimal": 58975
  19331. }, {
  19332. "icon_id": "24855892",
  19333. "name": "flag-filled",
  19334. "font_class": "flag-filled",
  19335. "unicode": "e660",
  19336. "unicode_decimal": 58976
  19337. }, {
  19338. "icon_id": "24855893",
  19339. "name": "gear-filled",
  19340. "font_class": "gear-filled",
  19341. "unicode": "e661",
  19342. "unicode_decimal": 58977
  19343. }, {
  19344. "icon_id": "24855894",
  19345. "name": "home",
  19346. "font_class": "home",
  19347. "unicode": "e662",
  19348. "unicode_decimal": 58978
  19349. }, {
  19350. "icon_id": "24855895",
  19351. "name": "home-filled",
  19352. "font_class": "home-filled",
  19353. "unicode": "e663",
  19354. "unicode_decimal": 58979
  19355. }, {
  19356. "icon_id": "24855896",
  19357. "name": "gear",
  19358. "font_class": "gear",
  19359. "unicode": "e664",
  19360. "unicode_decimal": 58980
  19361. }, {
  19362. "icon_id": "24855897",
  19363. "name": "smallcircle-filled",
  19364. "font_class": "smallcircle-filled",
  19365. "unicode": "e665",
  19366. "unicode_decimal": 58981
  19367. }, {
  19368. "icon_id": "24855898",
  19369. "name": "map-filled",
  19370. "font_class": "map-filled",
  19371. "unicode": "e666",
  19372. "unicode_decimal": 58982
  19373. }, {
  19374. "icon_id": "24855899",
  19375. "name": "map",
  19376. "font_class": "map",
  19377. "unicode": "e667",
  19378. "unicode_decimal": 58983
  19379. }, {
  19380. "icon_id": "24855825",
  19381. "name": "refresh-filled",
  19382. "font_class": "refresh-filled",
  19383. "unicode": "e656",
  19384. "unicode_decimal": 58966
  19385. }, {
  19386. "icon_id": "24855826",
  19387. "name": "refresh",
  19388. "font_class": "refresh",
  19389. "unicode": "e657",
  19390. "unicode_decimal": 58967
  19391. }, {
  19392. "icon_id": "24855808",
  19393. "name": "cloud-upload",
  19394. "font_class": "cloud-upload",
  19395. "unicode": "e645",
  19396. "unicode_decimal": 58949
  19397. }, {
  19398. "icon_id": "24855809",
  19399. "name": "cloud-download-filled",
  19400. "font_class": "cloud-download-filled",
  19401. "unicode": "e646",
  19402. "unicode_decimal": 58950
  19403. }, {
  19404. "icon_id": "24855810",
  19405. "name": "cloud-download",
  19406. "font_class": "cloud-download",
  19407. "unicode": "e647",
  19408. "unicode_decimal": 58951
  19409. }, {
  19410. "icon_id": "24855811",
  19411. "name": "cloud-upload-filled",
  19412. "font_class": "cloud-upload-filled",
  19413. "unicode": "e648",
  19414. "unicode_decimal": 58952
  19415. }, {
  19416. "icon_id": "24855813",
  19417. "name": "redo",
  19418. "font_class": "redo",
  19419. "unicode": "e64a",
  19420. "unicode_decimal": 58954
  19421. }, {
  19422. "icon_id": "24855814",
  19423. "name": "images-filled",
  19424. "font_class": "images-filled",
  19425. "unicode": "e64b",
  19426. "unicode_decimal": 58955
  19427. }, {
  19428. "icon_id": "24855815",
  19429. "name": "undo-filled",
  19430. "font_class": "undo-filled",
  19431. "unicode": "e64c",
  19432. "unicode_decimal": 58956
  19433. }, {
  19434. "icon_id": "24855816",
  19435. "name": "more",
  19436. "font_class": "more",
  19437. "unicode": "e64d",
  19438. "unicode_decimal": 58957
  19439. }, {
  19440. "icon_id": "24855817",
  19441. "name": "more-filled",
  19442. "font_class": "more-filled",
  19443. "unicode": "e64e",
  19444. "unicode_decimal": 58958
  19445. }, {
  19446. "icon_id": "24855818",
  19447. "name": "undo",
  19448. "font_class": "undo",
  19449. "unicode": "e64f",
  19450. "unicode_decimal": 58959
  19451. }, {
  19452. "icon_id": "24855819",
  19453. "name": "images",
  19454. "font_class": "images",
  19455. "unicode": "e650",
  19456. "unicode_decimal": 58960
  19457. }, {
  19458. "icon_id": "24855821",
  19459. "name": "paperclip",
  19460. "font_class": "paperclip",
  19461. "unicode": "e652",
  19462. "unicode_decimal": 58962
  19463. }, {
  19464. "icon_id": "24855822",
  19465. "name": "settings",
  19466. "font_class": "settings",
  19467. "unicode": "e653",
  19468. "unicode_decimal": 58963
  19469. }, {
  19470. "icon_id": "24855823",
  19471. "name": "search",
  19472. "font_class": "search",
  19473. "unicode": "e654",
  19474. "unicode_decimal": 58964
  19475. }, {
  19476. "icon_id": "24855824",
  19477. "name": "redo-filled",
  19478. "font_class": "redo-filled",
  19479. "unicode": "e655",
  19480. "unicode_decimal": 58965
  19481. }, {
  19482. "icon_id": "24841702",
  19483. "name": "list",
  19484. "font_class": "list",
  19485. "unicode": "e644",
  19486. "unicode_decimal": 58948
  19487. }, {
  19488. "icon_id": "24841489",
  19489. "name": "mail-open-filled",
  19490. "font_class": "mail-open-filled",
  19491. "unicode": "e63a",
  19492. "unicode_decimal": 58938
  19493. }, {
  19494. "icon_id": "24841491",
  19495. "name": "hand-thumbsdown-filled",
  19496. "font_class": "hand-down-filled",
  19497. "unicode": "e63c",
  19498. "unicode_decimal": 58940
  19499. }, {
  19500. "icon_id": "24841492",
  19501. "name": "hand-thumbsdown",
  19502. "font_class": "hand-down",
  19503. "unicode": "e63d",
  19504. "unicode_decimal": 58941
  19505. }, {
  19506. "icon_id": "24841493",
  19507. "name": "hand-thumbsup-filled",
  19508. "font_class": "hand-up-filled",
  19509. "unicode": "e63e",
  19510. "unicode_decimal": 58942
  19511. }, {
  19512. "icon_id": "24841494",
  19513. "name": "hand-thumbsup",
  19514. "font_class": "hand-up",
  19515. "unicode": "e63f",
  19516. "unicode_decimal": 58943
  19517. }, {
  19518. "icon_id": "24841496",
  19519. "name": "heart-filled",
  19520. "font_class": "heart-filled",
  19521. "unicode": "e641",
  19522. "unicode_decimal": 58945
  19523. }, {
  19524. "icon_id": "24841498",
  19525. "name": "mail-open",
  19526. "font_class": "mail-open",
  19527. "unicode": "e643",
  19528. "unicode_decimal": 58947
  19529. }, {
  19530. "icon_id": "24841488",
  19531. "name": "heart",
  19532. "font_class": "heart",
  19533. "unicode": "e639",
  19534. "unicode_decimal": 58937
  19535. }, {
  19536. "icon_id": "24839963",
  19537. "name": "loop",
  19538. "font_class": "loop",
  19539. "unicode": "e633",
  19540. "unicode_decimal": 58931
  19541. }, {
  19542. "icon_id": "24839866",
  19543. "name": "pulldown",
  19544. "font_class": "pulldown",
  19545. "unicode": "e632",
  19546. "unicode_decimal": 58930
  19547. }, {
  19548. "icon_id": "24813798",
  19549. "name": "scan",
  19550. "font_class": "scan",
  19551. "unicode": "e62a",
  19552. "unicode_decimal": 58922
  19553. }, {
  19554. "icon_id": "24813786",
  19555. "name": "bars",
  19556. "font_class": "bars",
  19557. "unicode": "e627",
  19558. "unicode_decimal": 58919
  19559. }, {
  19560. "icon_id": "24813788",
  19561. "name": "cart-filled",
  19562. "font_class": "cart-filled",
  19563. "unicode": "e629",
  19564. "unicode_decimal": 58921
  19565. }, {
  19566. "icon_id": "24813790",
  19567. "name": "checkbox",
  19568. "font_class": "checkbox",
  19569. "unicode": "e62b",
  19570. "unicode_decimal": 58923
  19571. }, {
  19572. "icon_id": "24813791",
  19573. "name": "checkbox-filled",
  19574. "font_class": "checkbox-filled",
  19575. "unicode": "e62c",
  19576. "unicode_decimal": 58924
  19577. }, {
  19578. "icon_id": "24813794",
  19579. "name": "shop",
  19580. "font_class": "shop",
  19581. "unicode": "e62f",
  19582. "unicode_decimal": 58927
  19583. }, {
  19584. "icon_id": "24813795",
  19585. "name": "headphones",
  19586. "font_class": "headphones",
  19587. "unicode": "e630",
  19588. "unicode_decimal": 58928
  19589. }, {
  19590. "icon_id": "24813796",
  19591. "name": "cart",
  19592. "font_class": "cart",
  19593. "unicode": "e631",
  19594. "unicode_decimal": 58929
  19595. }]
  19596. };
  19597. exports.default = _default;
  19598. /***/ }),
  19599. /***/ 3:
  19600. /*!***********************************!*\
  19601. !*** (webpack)/buildin/global.js ***!
  19602. \***********************************/
  19603. /*! no static exports found */
  19604. /***/ (function(module, exports) {
  19605. var g;
  19606. // This works in non-strict mode
  19607. g = (function() {
  19608. return this;
  19609. })();
  19610. try {
  19611. // This works if eval is allowed (see CSP)
  19612. g = g || new Function("return this")();
  19613. } catch (e) {
  19614. // This works if the window reference is available
  19615. if (typeof window === "object") g = window;
  19616. }
  19617. // g can still be undefined, but nothing to do about it...
  19618. // We return undefined, instead of nothing here, so it's
  19619. // easier to handle this case. if(!global) { ...}
  19620. module.exports = g;
  19621. /***/ }),
  19622. /***/ 309:
  19623. /*!****************************************************************************************************************!*\
  19624. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-load-more/components/uni-load-more/i18n/index.js ***!
  19625. \****************************************************************************************************************/
  19626. /*! no static exports found */
  19627. /***/ (function(module, exports, __webpack_require__) {
  19628. "use strict";
  19629. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  19630. Object.defineProperty(exports, "__esModule", {
  19631. value: true
  19632. });
  19633. exports.default = void 0;
  19634. var _en = _interopRequireDefault(__webpack_require__(/*! ./en.json */ 310));
  19635. var _zhHans = _interopRequireDefault(__webpack_require__(/*! ./zh-Hans.json */ 311));
  19636. var _zhHant = _interopRequireDefault(__webpack_require__(/*! ./zh-Hant.json */ 312));
  19637. var _default = {
  19638. en: _en.default,
  19639. 'zh-Hans': _zhHans.default,
  19640. 'zh-Hant': _zhHant.default
  19641. };
  19642. exports.default = _default;
  19643. /***/ }),
  19644. /***/ 310:
  19645. /*!***************************************************************************************************************!*\
  19646. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-load-more/components/uni-load-more/i18n/en.json ***!
  19647. \***************************************************************************************************************/
  19648. /*! exports provided: uni-load-more.contentdown, uni-load-more.contentrefresh, uni-load-more.contentnomore, default */
  19649. /***/ (function(module) {
  19650. 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\"}");
  19651. /***/ }),
  19652. /***/ 311:
  19653. /*!********************************************************************************************************************!*\
  19654. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hans.json ***!
  19655. \********************************************************************************************************************/
  19656. /*! exports provided: uni-load-more.contentdown, uni-load-more.contentrefresh, uni-load-more.contentnomore, default */
  19657. /***/ (function(module) {
  19658. module.exports = JSON.parse("{\"uni-load-more.contentdown\":\"上拉显示更多\",\"uni-load-more.contentrefresh\":\"正在加载...\",\"uni-load-more.contentnomore\":\"没有更多数据了\"}");
  19659. /***/ }),
  19660. /***/ 312:
  19661. /*!********************************************************************************************************************!*\
  19662. !*** E:/work/Project_newGit/hptwxMiniProgram/uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hant.json ***!
  19663. \********************************************************************************************************************/
  19664. /*! exports provided: uni-load-more.contentdown, uni-load-more.contentrefresh, uni-load-more.contentnomore, default */
  19665. /***/ (function(module) {
  19666. module.exports = JSON.parse("{\"uni-load-more.contentdown\":\"上拉顯示更多\",\"uni-load-more.contentrefresh\":\"正在加載...\",\"uni-load-more.contentnomore\":\"沒有更多數據了\"}");
  19667. /***/ }),
  19668. /***/ 32:
  19669. /*!**********************************************************************************************************!*\
  19670. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  19671. \**********************************************************************************************************/
  19672. /*! exports provided: default */
  19673. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19674. "use strict";
  19675. __webpack_require__.r(__webpack_exports__);
  19676. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  19677. /* globals __VUE_SSR_CONTEXT__ */
  19678. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  19679. // This module is a runtime utility for cleaner component module output and will
  19680. // be included in the final webpack user bundle.
  19681. function normalizeComponent (
  19682. scriptExports,
  19683. render,
  19684. staticRenderFns,
  19685. functionalTemplate,
  19686. injectStyles,
  19687. scopeId,
  19688. moduleIdentifier, /* server only */
  19689. shadowMode, /* vue-cli only */
  19690. components, // fixed by xxxxxx auto components
  19691. renderjs // fixed by xxxxxx renderjs
  19692. ) {
  19693. // Vue.extend constructor export interop
  19694. var options = typeof scriptExports === 'function'
  19695. ? scriptExports.options
  19696. : scriptExports
  19697. // fixed by xxxxxx auto components
  19698. if (components) {
  19699. if (!options.components) {
  19700. options.components = {}
  19701. }
  19702. var hasOwn = Object.prototype.hasOwnProperty
  19703. for (var name in components) {
  19704. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  19705. options.components[name] = components[name]
  19706. }
  19707. }
  19708. }
  19709. // fixed by xxxxxx renderjs
  19710. if (renderjs) {
  19711. if(typeof renderjs.beforeCreate === 'function'){
  19712. renderjs.beforeCreate = [renderjs.beforeCreate]
  19713. }
  19714. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  19715. this[renderjs.__module] = this
  19716. });
  19717. (options.mixins || (options.mixins = [])).push(renderjs)
  19718. }
  19719. // render functions
  19720. if (render) {
  19721. options.render = render
  19722. options.staticRenderFns = staticRenderFns
  19723. options._compiled = true
  19724. }
  19725. // functional template
  19726. if (functionalTemplate) {
  19727. options.functional = true
  19728. }
  19729. // scopedId
  19730. if (scopeId) {
  19731. options._scopeId = 'data-v-' + scopeId
  19732. }
  19733. var hook
  19734. if (moduleIdentifier) { // server build
  19735. hook = function (context) {
  19736. // 2.3 injection
  19737. context =
  19738. context || // cached call
  19739. (this.$vnode && this.$vnode.ssrContext) || // stateful
  19740. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  19741. // 2.2 with runInNewContext: true
  19742. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  19743. context = __VUE_SSR_CONTEXT__
  19744. }
  19745. // inject component styles
  19746. if (injectStyles) {
  19747. injectStyles.call(this, context)
  19748. }
  19749. // register component module identifier for async chunk inferrence
  19750. if (context && context._registeredComponents) {
  19751. context._registeredComponents.add(moduleIdentifier)
  19752. }
  19753. }
  19754. // used by ssr in case component is cached and beforeCreate
  19755. // never gets called
  19756. options._ssrRegister = hook
  19757. } else if (injectStyles) {
  19758. hook = shadowMode
  19759. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  19760. : injectStyles
  19761. }
  19762. if (hook) {
  19763. if (options.functional) {
  19764. // for template-only hot-reload because in that case the render fn doesn't
  19765. // go through the normalizer
  19766. options._injectStyles = hook
  19767. // register for functioal component in vue file
  19768. var originalRender = options.render
  19769. options.render = function renderWithStyleInjection (h, context) {
  19770. hook.call(context)
  19771. return originalRender(h, context)
  19772. }
  19773. } else {
  19774. // inject component registration as beforeCreate hook
  19775. var existing = options.beforeCreate
  19776. options.beforeCreate = existing
  19777. ? [].concat(existing, hook)
  19778. : [hook]
  19779. }
  19780. }
  19781. return {
  19782. exports: scriptExports,
  19783. options: options
  19784. }
  19785. }
  19786. /***/ }),
  19787. /***/ 33:
  19788. /*!************************************************************************!*\
  19789. !*** E:/work/Project_newGit/hptwxMiniProgram/uni.promisify.adaptor.js ***!
  19790. \************************************************************************/
  19791. /*! no static exports found */
  19792. /***/ (function(module, exports, __webpack_require__) {
  19793. /* WEBPACK VAR INJECTION */(function(uni) {var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ 13);
  19794. uni.addInterceptor({
  19795. returnValue: function returnValue(res) {
  19796. if (!(!!res && (_typeof(res) === "object" || typeof res === "function") && typeof res.then === "function")) {
  19797. return res;
  19798. }
  19799. return new Promise(function (resolve, reject) {
  19800. res.then(function (res) {
  19801. return res[0] ? reject(res[0]) : resolve(res[1]);
  19802. });
  19803. });
  19804. }
  19805. });
  19806. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  19807. /***/ }),
  19808. /***/ 4:
  19809. /*!**********************************************************************!*\
  19810. !*** ./node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
  19811. \**********************************************************************/
  19812. /*! no static exports found */
  19813. /***/ (function(module, exports) {
  19814. function _interopRequireDefault(obj) {
  19815. return obj && obj.__esModule ? obj : {
  19816. "default": obj
  19817. };
  19818. }
  19819. module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
  19820. /***/ }),
  19821. /***/ 40:
  19822. /*!**************************************************************!*\
  19823. !*** E:/work/Project_newGit/hptwxMiniProgram/api/openApi.js ***!
  19824. \**************************************************************/
  19825. /*! no static exports found */
  19826. /***/ (function(module, exports, __webpack_require__) {
  19827. "use strict";
  19828. Object.defineProperty(exports, "__esModule", {
  19829. value: true
  19830. });
  19831. exports.checklistBatchUpdate = checklistBatchUpdate;
  19832. exports.checklistCancel = checklistCancel;
  19833. exports.checklistComplete = checklistComplete;
  19834. exports.checklistInit = checklistInit;
  19835. exports.getByQr = getByQr;
  19836. exports.getChecklistByQr = getChecklistByQr;
  19837. exports.getchecklistByPage = getchecklistByPage;
  19838. exports.getchecklistRecord = getchecklistRecord;
  19839. exports.updateChecklistPoint = updateChecklistPoint;
  19840. exports.wxDecryptUserInfo = wxDecryptUserInfo;
  19841. exports.wxLogin = wxLogin;
  19842. var _request = __webpack_require__(/*! @/utils/request */ 41);
  19843. /**
  19844. * 扫码请求
  19845. * @param ocId 单位ID
  19846. * @param qrCode 二维码
  19847. * @returns
  19848. */
  19849. function getByQr(ocId, qrCode) {
  19850. return (0, _request.request)({
  19851. url: "/qr/request/".concat(ocId, "/").concat(qrCode),
  19852. method: 'GET'
  19853. });
  19854. }
  19855. /**
  19856. * WX登陆
  19857. * @param jsCode 二维码
  19858. * @returns
  19859. */
  19860. function wxLogin(jsCode) {
  19861. return (0, _request.request)({
  19862. url: "/wx/login/".concat(jsCode),
  19863. method: 'GET'
  19864. });
  19865. }
  19866. /**
  19867. * 解密WX用户数据
  19868. * @param jsCode 二维码
  19869. * @returns
  19870. */
  19871. function wxDecryptUserInfo(data) {
  19872. return (0, _request.request)({
  19873. url: "/wx/userInfo/decrypt",
  19874. method: 'POST',
  19875. data: data
  19876. });
  19877. }
  19878. /**
  19879. * 清单初始化
  19880. * ocId
  19881. * targetId ,targetType,targetTitle,targetGroupId,,targetGroupName
  19882. * checklistId
  19883. */
  19884. function checklistInit(data) {
  19885. return (0, _request.request)({
  19886. url: "/checklist/init",
  19887. method: 'POST',
  19888. data: data
  19889. });
  19890. }
  19891. /**
  19892. * 扫码请求checklist清单
  19893. * @param ocId 单位ID
  19894. * @param checklistId 清单ID
  19895. * @returns
  19896. */
  19897. function getChecklistByQr(ocId, targetId, checklistId) {
  19898. return (0, _request.request)({
  19899. url: "/qr/request/checklist/".concat(ocId, "/").concat(targetId, "/").concat(checklistId),
  19900. method: 'GET'
  19901. });
  19902. }
  19903. function updateChecklistPoint(data) {
  19904. return (0, _request.request)({
  19905. url: "/checklist/point/record/doing/update",
  19906. method: 'PUT',
  19907. data: data
  19908. });
  19909. }
  19910. function getchecklistRecord(checklistId, recordId) {
  19911. return (0, _request.request)({
  19912. url: "/checklist/record/view/".concat(recordId, "/").concat(checklistId),
  19913. method: 'GET'
  19914. });
  19915. }
  19916. function getchecklistByPage(data) {
  19917. return (0, _request.request)({
  19918. url: "/checklist/record/page",
  19919. method: 'GET',
  19920. data: data
  19921. });
  19922. }
  19923. // 巡检完成
  19924. function checklistComplete(recordId, checklistId) {
  19925. return (0, _request.request)({
  19926. url: "/checklist/record/complete/".concat(recordId, "/").concat(checklistId),
  19927. method: 'PUT'
  19928. });
  19929. }
  19930. // 巡检放弃
  19931. function checklistCancel(recordId) {
  19932. return (0, _request.request)({
  19933. url: "/checklist/record/cancel/".concat(recordId),
  19934. method: 'PUT'
  19935. });
  19936. }
  19937. // 批量操作
  19938. function checklistBatchUpdate(recordId, checkResult) {
  19939. return (0, _request.request)({
  19940. url: "/checklist/point/record/doing/batchUpdate/".concat(recordId, "/").concat(checkResult),
  19941. method: 'PUT'
  19942. });
  19943. }
  19944. /***/ }),
  19945. /***/ 41:
  19946. /*!****************************************************************!*\
  19947. !*** E:/work/Project_newGit/hptwxMiniProgram/utils/request.js ***!
  19948. \****************************************************************/
  19949. /*! no static exports found */
  19950. /***/ (function(module, exports, __webpack_require__) {
  19951. "use strict";
  19952. /* WEBPACK VAR INJECTION */(function(uni) {
  19953. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  19954. Object.defineProperty(exports, "__esModule", {
  19955. value: true
  19956. });
  19957. exports.request = request;
  19958. var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 42));
  19959. var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
  19960. var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 44));
  19961. var _index = _interopRequireDefault(__webpack_require__(/*! @/config/index.js */ 45));
  19962. var _auth = __webpack_require__(/*! @/utils/auth.js */ 46);
  19963. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
  19964. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
  19965. var baseUrl = true ? _index.default.base.dev : undefined;
  19966. function request(_x) {
  19967. return _request.apply(this, arguments);
  19968. }
  19969. function _request() {
  19970. _request = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(parmas) {
  19971. return _regenerator.default.wrap(function _callee$(_context) {
  19972. while (1) {
  19973. switch (_context.prev = _context.next) {
  19974. case 0:
  19975. return _context.abrupt("return", new Promise(function (resolve, reject) {
  19976. try {
  19977. uni.showLoading({
  19978. title: '加载中',
  19979. mask: true
  19980. });
  19981. uni.request(_objectSpread(_objectSpread({}, formatRequestBody(parmas)), {}, {
  19982. success: function success(response) {
  19983. var data = response.data;
  19984. var code = data.code;
  19985. var msg = data.msg;
  19986. if (code === 200) {
  19987. resolve(data);
  19988. } else {
  19989. if (code === 401) {
  19990. uni.showToast({
  19991. title: msg || "登录失效!",
  19992. mask: true,
  19993. icon: "none",
  19994. complete: function complete() {
  19995. uni.navigateTo({
  19996. url: '/pages/login/index'
  19997. });
  19998. }
  19999. });
  20000. } else {
  20001. reject(data);
  20002. uni.showToast({
  20003. title: msg,
  20004. mask: true,
  20005. icon: "none"
  20006. });
  20007. }
  20008. }
  20009. },
  20010. fail: function fail(res) {
  20011. uni.showToast({
  20012. title: res,
  20013. mask: true,
  20014. icon: "none"
  20015. });
  20016. reject(res);
  20017. },
  20018. complete: function complete(res) {
  20019. uni.hideLoading();
  20020. }
  20021. }));
  20022. } catch (err) {
  20023. console.log(err);
  20024. reject(err);
  20025. }
  20026. }));
  20027. case 1:
  20028. case "end":
  20029. return _context.stop();
  20030. }
  20031. }
  20032. }, _callee);
  20033. }));
  20034. return _request.apply(this, arguments);
  20035. }
  20036. function formatRequestBody(parmas) {
  20037. var url = parmas.url;
  20038. url = baseUrl + url;
  20039. var data = _objectSpread({}, parmas.data);
  20040. var header = _objectSpread({}, parmas.header);
  20041. header[_index.default.TokenKey] = (0, _auth.getToken)();
  20042. header['AppID'] = _index.default.appID;
  20043. header['AppKey'] = _index.default.appKey;
  20044. header['AppSecret'] = _index.default.appSecret;
  20045. var method = parmas.method || "get";
  20046. var dataType = parmas.dataType || "json";
  20047. var requestBody = {
  20048. url: url,
  20049. data: data,
  20050. header: header,
  20051. method: method,
  20052. dataType: dataType
  20053. };
  20054. return requestBody;
  20055. }
  20056. ;
  20057. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  20058. /***/ }),
  20059. /***/ 42:
  20060. /*!************************************************************************************************!*\
  20061. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/@babel/runtime/regenerator/index.js ***!
  20062. \************************************************************************************************/
  20063. /*! no static exports found */
  20064. /***/ (function(module, exports, __webpack_require__) {
  20065. // TODO(Babel 8): Remove this file.
  20066. var runtime = __webpack_require__(/*! @babel/runtime/helpers/regeneratorRuntime */ 43)();
  20067. module.exports = runtime;
  20068. /***/ }),
  20069. /***/ 43:
  20070. /*!*******************************************************************!*\
  20071. !*** ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
  20072. \*******************************************************************/
  20073. /*! no static exports found */
  20074. /***/ (function(module, exports, __webpack_require__) {
  20075. var _typeof = __webpack_require__(/*! ./typeof.js */ 13)["default"];
  20076. function _regeneratorRuntime() {
  20077. "use strict";
  20078. /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
  20079. module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
  20080. return exports;
  20081. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  20082. var exports = {},
  20083. Op = Object.prototype,
  20084. hasOwn = Op.hasOwnProperty,
  20085. defineProperty = Object.defineProperty || function (obj, key, desc) {
  20086. obj[key] = desc.value;
  20087. },
  20088. $Symbol = "function" == typeof Symbol ? Symbol : {},
  20089. iteratorSymbol = $Symbol.iterator || "@@iterator",
  20090. asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
  20091. toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  20092. function define(obj, key, value) {
  20093. return Object.defineProperty(obj, key, {
  20094. value: value,
  20095. enumerable: !0,
  20096. configurable: !0,
  20097. writable: !0
  20098. }), obj[key];
  20099. }
  20100. try {
  20101. define({}, "");
  20102. } catch (err) {
  20103. define = function define(obj, key, value) {
  20104. return obj[key] = value;
  20105. };
  20106. }
  20107. function wrap(innerFn, outerFn, self, tryLocsList) {
  20108. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
  20109. generator = Object.create(protoGenerator.prototype),
  20110. context = new Context(tryLocsList || []);
  20111. return defineProperty(generator, "_invoke", {
  20112. value: makeInvokeMethod(innerFn, self, context)
  20113. }), generator;
  20114. }
  20115. function tryCatch(fn, obj, arg) {
  20116. try {
  20117. return {
  20118. type: "normal",
  20119. arg: fn.call(obj, arg)
  20120. };
  20121. } catch (err) {
  20122. return {
  20123. type: "throw",
  20124. arg: err
  20125. };
  20126. }
  20127. }
  20128. exports.wrap = wrap;
  20129. var ContinueSentinel = {};
  20130. function Generator() {}
  20131. function GeneratorFunction() {}
  20132. function GeneratorFunctionPrototype() {}
  20133. var IteratorPrototype = {};
  20134. define(IteratorPrototype, iteratorSymbol, function () {
  20135. return this;
  20136. });
  20137. var getProto = Object.getPrototypeOf,
  20138. NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  20139. NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
  20140. var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
  20141. function defineIteratorMethods(prototype) {
  20142. ["next", "throw", "return"].forEach(function (method) {
  20143. define(prototype, method, function (arg) {
  20144. return this._invoke(method, arg);
  20145. });
  20146. });
  20147. }
  20148. function AsyncIterator(generator, PromiseImpl) {
  20149. function invoke(method, arg, resolve, reject) {
  20150. var record = tryCatch(generator[method], generator, arg);
  20151. if ("throw" !== record.type) {
  20152. var result = record.arg,
  20153. value = result.value;
  20154. return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
  20155. invoke("next", value, resolve, reject);
  20156. }, function (err) {
  20157. invoke("throw", err, resolve, reject);
  20158. }) : PromiseImpl.resolve(value).then(function (unwrapped) {
  20159. result.value = unwrapped, resolve(result);
  20160. }, function (error) {
  20161. return invoke("throw", error, resolve, reject);
  20162. });
  20163. }
  20164. reject(record.arg);
  20165. }
  20166. var previousPromise;
  20167. defineProperty(this, "_invoke", {
  20168. value: function value(method, arg) {
  20169. function callInvokeWithMethodAndArg() {
  20170. return new PromiseImpl(function (resolve, reject) {
  20171. invoke(method, arg, resolve, reject);
  20172. });
  20173. }
  20174. return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
  20175. }
  20176. });
  20177. }
  20178. function makeInvokeMethod(innerFn, self, context) {
  20179. var state = "suspendedStart";
  20180. return function (method, arg) {
  20181. if ("executing" === state) throw new Error("Generator is already running");
  20182. if ("completed" === state) {
  20183. if ("throw" === method) throw arg;
  20184. return doneResult();
  20185. }
  20186. for (context.method = method, context.arg = arg;;) {
  20187. var delegate = context.delegate;
  20188. if (delegate) {
  20189. var delegateResult = maybeInvokeDelegate(delegate, context);
  20190. if (delegateResult) {
  20191. if (delegateResult === ContinueSentinel) continue;
  20192. return delegateResult;
  20193. }
  20194. }
  20195. if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
  20196. if ("suspendedStart" === state) throw state = "completed", context.arg;
  20197. context.dispatchException(context.arg);
  20198. } else "return" === context.method && context.abrupt("return", context.arg);
  20199. state = "executing";
  20200. var record = tryCatch(innerFn, self, context);
  20201. if ("normal" === record.type) {
  20202. if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
  20203. return {
  20204. value: record.arg,
  20205. done: context.done
  20206. };
  20207. }
  20208. "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
  20209. }
  20210. };
  20211. }
  20212. function maybeInvokeDelegate(delegate, context) {
  20213. var methodName = context.method,
  20214. method = delegate.iterator[methodName];
  20215. if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
  20216. var record = tryCatch(method, delegate.iterator, context.arg);
  20217. if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
  20218. var info = record.arg;
  20219. return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
  20220. }
  20221. function pushTryEntry(locs) {
  20222. var entry = {
  20223. tryLoc: locs[0]
  20224. };
  20225. 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
  20226. }
  20227. function resetTryEntry(entry) {
  20228. var record = entry.completion || {};
  20229. record.type = "normal", delete record.arg, entry.completion = record;
  20230. }
  20231. function Context(tryLocsList) {
  20232. this.tryEntries = [{
  20233. tryLoc: "root"
  20234. }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
  20235. }
  20236. function values(iterable) {
  20237. if (iterable) {
  20238. var iteratorMethod = iterable[iteratorSymbol];
  20239. if (iteratorMethod) return iteratorMethod.call(iterable);
  20240. if ("function" == typeof iterable.next) return iterable;
  20241. if (!isNaN(iterable.length)) {
  20242. var i = -1,
  20243. next = function next() {
  20244. for (; ++i < iterable.length;) {
  20245. if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
  20246. }
  20247. return next.value = undefined, next.done = !0, next;
  20248. };
  20249. return next.next = next;
  20250. }
  20251. }
  20252. return {
  20253. next: doneResult
  20254. };
  20255. }
  20256. function doneResult() {
  20257. return {
  20258. value: undefined,
  20259. done: !0
  20260. };
  20261. }
  20262. return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
  20263. value: GeneratorFunctionPrototype,
  20264. configurable: !0
  20265. }), defineProperty(GeneratorFunctionPrototype, "constructor", {
  20266. value: GeneratorFunction,
  20267. configurable: !0
  20268. }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
  20269. var ctor = "function" == typeof genFun && genFun.constructor;
  20270. return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
  20271. }, exports.mark = function (genFun) {
  20272. return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
  20273. }, exports.awrap = function (arg) {
  20274. return {
  20275. __await: arg
  20276. };
  20277. }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
  20278. return this;
  20279. }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
  20280. void 0 === PromiseImpl && (PromiseImpl = Promise);
  20281. var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
  20282. return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
  20283. return result.done ? result.value : iter.next();
  20284. });
  20285. }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
  20286. return this;
  20287. }), define(Gp, "toString", function () {
  20288. return "[object Generator]";
  20289. }), exports.keys = function (val) {
  20290. var object = Object(val),
  20291. keys = [];
  20292. for (var key in object) {
  20293. keys.push(key);
  20294. }
  20295. return keys.reverse(), function next() {
  20296. for (; keys.length;) {
  20297. var key = keys.pop();
  20298. if (key in object) return next.value = key, next.done = !1, next;
  20299. }
  20300. return next.done = !0, next;
  20301. };
  20302. }, exports.values = values, Context.prototype = {
  20303. constructor: Context,
  20304. reset: function reset(skipTempReset) {
  20305. if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) {
  20306. "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
  20307. }
  20308. },
  20309. stop: function stop() {
  20310. this.done = !0;
  20311. var rootRecord = this.tryEntries[0].completion;
  20312. if ("throw" === rootRecord.type) throw rootRecord.arg;
  20313. return this.rval;
  20314. },
  20315. dispatchException: function dispatchException(exception) {
  20316. if (this.done) throw exception;
  20317. var context = this;
  20318. function handle(loc, caught) {
  20319. return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
  20320. }
  20321. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  20322. var entry = this.tryEntries[i],
  20323. record = entry.completion;
  20324. if ("root" === entry.tryLoc) return handle("end");
  20325. if (entry.tryLoc <= this.prev) {
  20326. var hasCatch = hasOwn.call(entry, "catchLoc"),
  20327. hasFinally = hasOwn.call(entry, "finallyLoc");
  20328. if (hasCatch && hasFinally) {
  20329. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  20330. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  20331. } else if (hasCatch) {
  20332. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  20333. } else {
  20334. if (!hasFinally) throw new Error("try statement without catch or finally");
  20335. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  20336. }
  20337. }
  20338. }
  20339. },
  20340. abrupt: function abrupt(type, arg) {
  20341. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  20342. var entry = this.tryEntries[i];
  20343. if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
  20344. var finallyEntry = entry;
  20345. break;
  20346. }
  20347. }
  20348. finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
  20349. var record = finallyEntry ? finallyEntry.completion : {};
  20350. return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
  20351. },
  20352. complete: function complete(record, afterLoc) {
  20353. if ("throw" === record.type) throw record.arg;
  20354. return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
  20355. },
  20356. finish: function finish(finallyLoc) {
  20357. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  20358. var entry = this.tryEntries[i];
  20359. if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
  20360. }
  20361. },
  20362. "catch": function _catch(tryLoc) {
  20363. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  20364. var entry = this.tryEntries[i];
  20365. if (entry.tryLoc === tryLoc) {
  20366. var record = entry.completion;
  20367. if ("throw" === record.type) {
  20368. var thrown = record.arg;
  20369. resetTryEntry(entry);
  20370. }
  20371. return thrown;
  20372. }
  20373. }
  20374. throw new Error("illegal catch attempt");
  20375. },
  20376. delegateYield: function delegateYield(iterable, resultName, nextLoc) {
  20377. return this.delegate = {
  20378. iterator: values(iterable),
  20379. resultName: resultName,
  20380. nextLoc: nextLoc
  20381. }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
  20382. }
  20383. }, exports;
  20384. }
  20385. module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
  20386. /***/ }),
  20387. /***/ 44:
  20388. /*!*****************************************************************!*\
  20389. !*** ./node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
  20390. \*****************************************************************/
  20391. /*! no static exports found */
  20392. /***/ (function(module, exports) {
  20393. function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
  20394. try {
  20395. var info = gen[key](arg);
  20396. var value = info.value;
  20397. } catch (error) {
  20398. reject(error);
  20399. return;
  20400. }
  20401. if (info.done) {
  20402. resolve(value);
  20403. } else {
  20404. Promise.resolve(value).then(_next, _throw);
  20405. }
  20406. }
  20407. function _asyncToGenerator(fn) {
  20408. return function () {
  20409. var self = this,
  20410. args = arguments;
  20411. return new Promise(function (resolve, reject) {
  20412. var gen = fn.apply(self, args);
  20413. function _next(value) {
  20414. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
  20415. }
  20416. function _throw(err) {
  20417. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
  20418. }
  20419. _next(undefined);
  20420. });
  20421. };
  20422. }
  20423. module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
  20424. /***/ }),
  20425. /***/ 45:
  20426. /*!***************************************************************!*\
  20427. !*** E:/work/Project_newGit/hptwxMiniProgram/config/index.js ***!
  20428. \***************************************************************/
  20429. /*! no static exports found */
  20430. /***/ (function(module, exports, __webpack_require__) {
  20431. "use strict";
  20432. Object.defineProperty(exports, "__esModule", {
  20433. value: true
  20434. });
  20435. exports.default = void 0;
  20436. var _default = {
  20437. base: {
  20438. // dev: 'http://192.168.3.253:8001',
  20439. dev: 'http://1.15.92.205:8001',
  20440. pro: 'http://1.15.92.205:8001'
  20441. },
  20442. appID: '10007',
  20443. appKey: '82a8bf439373e311',
  20444. appSecret: '82a8bf439373e311',
  20445. permitTplId: 7,
  20446. TokenKey: "Authorization"
  20447. };
  20448. exports.default = _default;
  20449. /***/ }),
  20450. /***/ 46:
  20451. /*!*************************************************************!*\
  20452. !*** E:/work/Project_newGit/hptwxMiniProgram/utils/auth.js ***!
  20453. \*************************************************************/
  20454. /*! no static exports found */
  20455. /***/ (function(module, exports, __webpack_require__) {
  20456. "use strict";
  20457. /* WEBPACK VAR INJECTION */(function(uni) {
  20458. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  20459. Object.defineProperty(exports, "__esModule", {
  20460. value: true
  20461. });
  20462. exports.getToken = getToken;
  20463. exports.removeToken = removeToken;
  20464. exports.setToken = setToken;
  20465. var _index = _interopRequireDefault(__webpack_require__(/*! ../config/index.js */ 45));
  20466. var TokenKey = _index.default.TokenKey;
  20467. function getToken() {
  20468. return uni.getStorageSync(TokenKey);
  20469. }
  20470. function setToken(token) {
  20471. return uni.setStorageSync(TokenKey, token);
  20472. }
  20473. function removeToken() {
  20474. return uni.removeStorageSync(TokenKey);
  20475. }
  20476. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  20477. /***/ }),
  20478. /***/ 5:
  20479. /*!**************************************************************!*\
  20480. !*** ./node_modules/@babel/runtime/helpers/slicedToArray.js ***!
  20481. \**************************************************************/
  20482. /*! no static exports found */
  20483. /***/ (function(module, exports, __webpack_require__) {
  20484. var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ 6);
  20485. var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ 7);
  20486. var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ 8);
  20487. var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ 10);
  20488. function _slicedToArray(arr, i) {
  20489. return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
  20490. }
  20491. module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  20492. /***/ }),
  20493. /***/ 55:
  20494. /*!*********************************************************************!*\
  20495. !*** E:/work/Project_newGit/hptwxMiniProgram/api/aqpt/dangerApi.js ***!
  20496. \*********************************************************************/
  20497. /*! no static exports found */
  20498. /***/ (function(module, exports, __webpack_require__) {
  20499. "use strict";
  20500. Object.defineProperty(exports, "__esModule", {
  20501. value: true
  20502. });
  20503. exports.deleteDangerById = deleteDangerById;
  20504. exports.getDangerById = getDangerById;
  20505. exports.getDangerByList = getDangerByList;
  20506. exports.getDangerByPage = getDangerByPage;
  20507. exports.handleDanger = handleDanger;
  20508. var _request = __webpack_require__(/*! @/utils/request.js */ 41);
  20509. /**
  20510. * 获取Danger列表
  20511. * @param data
  20512. * @returns
  20513. */
  20514. function getDangerByList(data) {
  20515. return (0, _request.request)({
  20516. url: '/danger',
  20517. method: 'GET',
  20518. data: data
  20519. });
  20520. }
  20521. /**
  20522. * 获取Danger分页
  20523. * @param data
  20524. * @returns
  20525. */
  20526. function getDangerByPage(data) {
  20527. return (0, _request.request)({
  20528. url: '/danger/page',
  20529. method: 'GET',
  20530. data: data
  20531. });
  20532. }
  20533. /**
  20534. * 根据Id获取Danger
  20535. * @param dangerId
  20536. * @returns
  20537. */
  20538. function getDangerById(dangerId) {
  20539. return (0, _request.request)({
  20540. url: "/danger/".concat(dangerId),
  20541. method: 'GET'
  20542. });
  20543. }
  20544. /**
  20545. * 删除Danger
  20546. * @param dangerId
  20547. * @returns
  20548. */
  20549. function deleteDangerById(dangerId) {
  20550. return (0, _request.request)({
  20551. url: "/danger/".concat(dangerId),
  20552. method: 'DELETE'
  20553. });
  20554. }
  20555. /**
  20556. * 处理Danger
  20557. * @param data
  20558. * @returns
  20559. */
  20560. function handleDanger(data) {
  20561. return (0, _request.request)({
  20562. url: "/danger/handle",
  20563. method: 'POST',
  20564. data: data
  20565. });
  20566. }
  20567. /***/ }),
  20568. /***/ 6:
  20569. /*!***************************************************************!*\
  20570. !*** ./node_modules/@babel/runtime/helpers/arrayWithHoles.js ***!
  20571. \***************************************************************/
  20572. /*! no static exports found */
  20573. /***/ (function(module, exports) {
  20574. function _arrayWithHoles(arr) {
  20575. if (Array.isArray(arr)) return arr;
  20576. }
  20577. module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  20578. /***/ }),
  20579. /***/ 7:
  20580. /*!*********************************************************************!*\
  20581. !*** ./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***!
  20582. \*********************************************************************/
  20583. /*! no static exports found */
  20584. /***/ (function(module, exports) {
  20585. function _iterableToArrayLimit(arr, i) {
  20586. var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
  20587. if (null != _i) {
  20588. var _s,
  20589. _e,
  20590. _x,
  20591. _r,
  20592. _arr = [],
  20593. _n = !0,
  20594. _d = !1;
  20595. try {
  20596. if (_x = (_i = _i.call(arr)).next, 0 === i) {
  20597. if (Object(_i) !== _i) return;
  20598. _n = !1;
  20599. } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) {
  20600. ;
  20601. }
  20602. } catch (err) {
  20603. _d = !0, _e = err;
  20604. } finally {
  20605. try {
  20606. if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
  20607. } finally {
  20608. if (_d) throw _e;
  20609. }
  20610. }
  20611. return _arr;
  20612. }
  20613. }
  20614. module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
  20615. /***/ }),
  20616. /***/ 72:
  20617. /*!******************************************************************!*\
  20618. !*** E:/work/Project_newGit/hptwxMiniProgram/api/system/user.js ***!
  20619. \******************************************************************/
  20620. /*! no static exports found */
  20621. /***/ (function(module, exports, __webpack_require__) {
  20622. "use strict";
  20623. Object.defineProperty(exports, "__esModule", {
  20624. value: true
  20625. });
  20626. exports.getUserInfo = getUserInfo;
  20627. exports.getUserList = getUserList;
  20628. exports.login = login;
  20629. exports.logout = logout;
  20630. exports.register = register;
  20631. exports.updatePwd = updatePwd;
  20632. exports.uploadFile = uploadFile;
  20633. exports.wxWorkLogin = wxWorkLogin;
  20634. var _request = __webpack_require__(/*! @/utils/request.js */ 41);
  20635. function login(data) {
  20636. return (0, _request.request)({
  20637. url: '/login',
  20638. method: 'post',
  20639. header: {
  20640. 'content-type': "application/x-www-form-urlencoded"
  20641. },
  20642. data: data
  20643. });
  20644. }
  20645. function getUserInfo() {
  20646. return (0, _request.request)({
  20647. url: '/user/profile'
  20648. });
  20649. }
  20650. function logout() {
  20651. return (0, _request.request)({
  20652. url: '/logout',
  20653. method: 'GET'
  20654. });
  20655. }
  20656. function register(data) {
  20657. return (0, _request.request)({
  20658. url: '/user/register',
  20659. method: 'post',
  20660. data: data
  20661. });
  20662. }
  20663. /**公用上传接口 */
  20664. function uploadFile(data) {
  20665. return (0, _request.request)({
  20666. url: '/upload/file',
  20667. method: "post",
  20668. headers: {
  20669. 'Content-Type': 'multipart/form-data'
  20670. },
  20671. data: data
  20672. });
  20673. }
  20674. function updatePwd(data) {
  20675. return (0, _request.request)({
  20676. url: '/user/updatePwd',
  20677. method: "post",
  20678. data: data
  20679. });
  20680. }
  20681. //查询用户的带岗位
  20682. function getUserList() {
  20683. return (0, _request.request)({
  20684. url: '/user/select',
  20685. method: 'get'
  20686. });
  20687. }
  20688. //企业微信登录
  20689. function wxWorkLogin(_ref) {
  20690. var userId = _ref.userId,
  20691. code = _ref.code;
  20692. return (0, _request.request)({
  20693. url: "/user/updateWxUserId/".concat(userId, "/").concat(code),
  20694. method: 'post'
  20695. });
  20696. }
  20697. /***/ }),
  20698. /***/ 8:
  20699. /*!***************************************************************************!*\
  20700. !*** ./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***!
  20701. \***************************************************************************/
  20702. /*! no static exports found */
  20703. /***/ (function(module, exports, __webpack_require__) {
  20704. var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ 9);
  20705. function _unsupportedIterableToArray(o, minLen) {
  20706. if (!o) return;
  20707. if (typeof o === "string") return arrayLikeToArray(o, minLen);
  20708. var n = Object.prototype.toString.call(o).slice(8, -1);
  20709. if (n === "Object" && o.constructor) n = o.constructor.name;
  20710. if (n === "Map" || n === "Set") return Array.from(o);
  20711. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
  20712. }
  20713. module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  20714. /***/ }),
  20715. /***/ 81:
  20716. /*!**************************************************************!*\
  20717. !*** E:/work/Project_newGit/hptwxMiniProgram/store/index.js ***!
  20718. \**************************************************************/
  20719. /*! no static exports found */
  20720. /***/ (function(module, exports, __webpack_require__) {
  20721. "use strict";
  20722. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  20723. Object.defineProperty(exports, "__esModule", {
  20724. value: true
  20725. });
  20726. exports.default = void 0;
  20727. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 25));
  20728. var _vuex = _interopRequireDefault(__webpack_require__(/*! vuex */ 82));
  20729. _vue.default.use(_vuex.default);
  20730. //实例store对象
  20731. var store = new _vuex.default.Store({
  20732. state: {
  20733. access_token: "",
  20734. jpush: null
  20735. },
  20736. mutations: {
  20737. setToken: function setToken(state, token) {
  20738. state.access_token = token;
  20739. },
  20740. initJpush: function initJpush(state, jpush) {
  20741. state.jpush = jpush;
  20742. }
  20743. }
  20744. });
  20745. //导出store对象
  20746. var _default = store;
  20747. exports.default = _default;
  20748. /***/ }),
  20749. /***/ 82:
  20750. /*!**************************************************************************************!*\
  20751. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vuex3/dist/vuex.common.js ***!
  20752. \**************************************************************************************/
  20753. /*! no static exports found */
  20754. /***/ (function(module, exports, __webpack_require__) {
  20755. "use strict";
  20756. /* WEBPACK VAR INJECTION */(function(global) {/*!
  20757. * vuex v3.6.2
  20758. * (c) 2021 Evan You
  20759. * @license MIT
  20760. */
  20761. function applyMixin (Vue) {
  20762. var version = Number(Vue.version.split('.')[0]);
  20763. if (version >= 2) {
  20764. Vue.mixin({ beforeCreate: vuexInit });
  20765. } else {
  20766. // override init and inject vuex init procedure
  20767. // for 1.x backwards compatibility.
  20768. var _init = Vue.prototype._init;
  20769. Vue.prototype._init = function (options) {
  20770. if ( options === void 0 ) options = {};
  20771. options.init = options.init
  20772. ? [vuexInit].concat(options.init)
  20773. : vuexInit;
  20774. _init.call(this, options);
  20775. };
  20776. }
  20777. /**
  20778. * Vuex init hook, injected into each instances init hooks list.
  20779. */
  20780. function vuexInit () {
  20781. var options = this.$options;
  20782. // store injection
  20783. if (options.store) {
  20784. this.$store = typeof options.store === 'function'
  20785. ? options.store()
  20786. : options.store;
  20787. } else if (options.parent && options.parent.$store) {
  20788. this.$store = options.parent.$store;
  20789. }
  20790. }
  20791. }
  20792. var target = typeof window !== 'undefined'
  20793. ? window
  20794. : typeof global !== 'undefined'
  20795. ? global
  20796. : {};
  20797. var devtoolHook = target.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  20798. function devtoolPlugin (store) {
  20799. if (!devtoolHook) { return }
  20800. store._devtoolHook = devtoolHook;
  20801. devtoolHook.emit('vuex:init', store);
  20802. devtoolHook.on('vuex:travel-to-state', function (targetState) {
  20803. store.replaceState(targetState);
  20804. });
  20805. store.subscribe(function (mutation, state) {
  20806. devtoolHook.emit('vuex:mutation', mutation, state);
  20807. }, { prepend: true });
  20808. store.subscribeAction(function (action, state) {
  20809. devtoolHook.emit('vuex:action', action, state);
  20810. }, { prepend: true });
  20811. }
  20812. /**
  20813. * Get the first item that pass the test
  20814. * by second argument function
  20815. *
  20816. * @param {Array} list
  20817. * @param {Function} f
  20818. * @return {*}
  20819. */
  20820. function find (list, f) {
  20821. return list.filter(f)[0]
  20822. }
  20823. /**
  20824. * Deep copy the given object considering circular structure.
  20825. * This function caches all nested objects and its copies.
  20826. * If it detects circular structure, use cached copy to avoid infinite loop.
  20827. *
  20828. * @param {*} obj
  20829. * @param {Array<Object>} cache
  20830. * @return {*}
  20831. */
  20832. function deepCopy (obj, cache) {
  20833. if ( cache === void 0 ) cache = [];
  20834. // just return if obj is immutable value
  20835. if (obj === null || typeof obj !== 'object') {
  20836. return obj
  20837. }
  20838. // if obj is hit, it is in circular structure
  20839. var hit = find(cache, function (c) { return c.original === obj; });
  20840. if (hit) {
  20841. return hit.copy
  20842. }
  20843. var copy = Array.isArray(obj) ? [] : {};
  20844. // put the copy into cache at first
  20845. // because we want to refer it in recursive deepCopy
  20846. cache.push({
  20847. original: obj,
  20848. copy: copy
  20849. });
  20850. Object.keys(obj).forEach(function (key) {
  20851. copy[key] = deepCopy(obj[key], cache);
  20852. });
  20853. return copy
  20854. }
  20855. /**
  20856. * forEach for object
  20857. */
  20858. function forEachValue (obj, fn) {
  20859. Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });
  20860. }
  20861. function isObject (obj) {
  20862. return obj !== null && typeof obj === 'object'
  20863. }
  20864. function isPromise (val) {
  20865. return val && typeof val.then === 'function'
  20866. }
  20867. function assert (condition, msg) {
  20868. if (!condition) { throw new Error(("[vuex] " + msg)) }
  20869. }
  20870. function partial (fn, arg) {
  20871. return function () {
  20872. return fn(arg)
  20873. }
  20874. }
  20875. // Base data struct for store's module, package with some attribute and method
  20876. var Module = function Module (rawModule, runtime) {
  20877. this.runtime = runtime;
  20878. // Store some children item
  20879. this._children = Object.create(null);
  20880. // Store the origin module object which passed by programmer
  20881. this._rawModule = rawModule;
  20882. var rawState = rawModule.state;
  20883. // Store the origin module's state
  20884. this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};
  20885. };
  20886. var prototypeAccessors = { namespaced: { configurable: true } };
  20887. prototypeAccessors.namespaced.get = function () {
  20888. return !!this._rawModule.namespaced
  20889. };
  20890. Module.prototype.addChild = function addChild (key, module) {
  20891. this._children[key] = module;
  20892. };
  20893. Module.prototype.removeChild = function removeChild (key) {
  20894. delete this._children[key];
  20895. };
  20896. Module.prototype.getChild = function getChild (key) {
  20897. return this._children[key]
  20898. };
  20899. Module.prototype.hasChild = function hasChild (key) {
  20900. return key in this._children
  20901. };
  20902. Module.prototype.update = function update (rawModule) {
  20903. this._rawModule.namespaced = rawModule.namespaced;
  20904. if (rawModule.actions) {
  20905. this._rawModule.actions = rawModule.actions;
  20906. }
  20907. if (rawModule.mutations) {
  20908. this._rawModule.mutations = rawModule.mutations;
  20909. }
  20910. if (rawModule.getters) {
  20911. this._rawModule.getters = rawModule.getters;
  20912. }
  20913. };
  20914. Module.prototype.forEachChild = function forEachChild (fn) {
  20915. forEachValue(this._children, fn);
  20916. };
  20917. Module.prototype.forEachGetter = function forEachGetter (fn) {
  20918. if (this._rawModule.getters) {
  20919. forEachValue(this._rawModule.getters, fn);
  20920. }
  20921. };
  20922. Module.prototype.forEachAction = function forEachAction (fn) {
  20923. if (this._rawModule.actions) {
  20924. forEachValue(this._rawModule.actions, fn);
  20925. }
  20926. };
  20927. Module.prototype.forEachMutation = function forEachMutation (fn) {
  20928. if (this._rawModule.mutations) {
  20929. forEachValue(this._rawModule.mutations, fn);
  20930. }
  20931. };
  20932. Object.defineProperties( Module.prototype, prototypeAccessors );
  20933. var ModuleCollection = function ModuleCollection (rawRootModule) {
  20934. // register root module (Vuex.Store options)
  20935. this.register([], rawRootModule, false);
  20936. };
  20937. ModuleCollection.prototype.get = function get (path) {
  20938. return path.reduce(function (module, key) {
  20939. return module.getChild(key)
  20940. }, this.root)
  20941. };
  20942. ModuleCollection.prototype.getNamespace = function getNamespace (path) {
  20943. var module = this.root;
  20944. return path.reduce(function (namespace, key) {
  20945. module = module.getChild(key);
  20946. return namespace + (module.namespaced ? key + '/' : '')
  20947. }, '')
  20948. };
  20949. ModuleCollection.prototype.update = function update$1 (rawRootModule) {
  20950. update([], this.root, rawRootModule);
  20951. };
  20952. ModuleCollection.prototype.register = function register (path, rawModule, runtime) {
  20953. var this$1 = this;
  20954. if ( runtime === void 0 ) runtime = true;
  20955. if ((true)) {
  20956. assertRawModule(path, rawModule);
  20957. }
  20958. var newModule = new Module(rawModule, runtime);
  20959. if (path.length === 0) {
  20960. this.root = newModule;
  20961. } else {
  20962. var parent = this.get(path.slice(0, -1));
  20963. parent.addChild(path[path.length - 1], newModule);
  20964. }
  20965. // register nested modules
  20966. if (rawModule.modules) {
  20967. forEachValue(rawModule.modules, function (rawChildModule, key) {
  20968. this$1.register(path.concat(key), rawChildModule, runtime);
  20969. });
  20970. }
  20971. };
  20972. ModuleCollection.prototype.unregister = function unregister (path) {
  20973. var parent = this.get(path.slice(0, -1));
  20974. var key = path[path.length - 1];
  20975. var child = parent.getChild(key);
  20976. if (!child) {
  20977. if ((true)) {
  20978. console.warn(
  20979. "[vuex] trying to unregister module '" + key + "', which is " +
  20980. "not registered"
  20981. );
  20982. }
  20983. return
  20984. }
  20985. if (!child.runtime) {
  20986. return
  20987. }
  20988. parent.removeChild(key);
  20989. };
  20990. ModuleCollection.prototype.isRegistered = function isRegistered (path) {
  20991. var parent = this.get(path.slice(0, -1));
  20992. var key = path[path.length - 1];
  20993. if (parent) {
  20994. return parent.hasChild(key)
  20995. }
  20996. return false
  20997. };
  20998. function update (path, targetModule, newModule) {
  20999. if ((true)) {
  21000. assertRawModule(path, newModule);
  21001. }
  21002. // update target module
  21003. targetModule.update(newModule);
  21004. // update nested modules
  21005. if (newModule.modules) {
  21006. for (var key in newModule.modules) {
  21007. if (!targetModule.getChild(key)) {
  21008. if ((true)) {
  21009. console.warn(
  21010. "[vuex] trying to add a new module '" + key + "' on hot reloading, " +
  21011. 'manual reload is needed'
  21012. );
  21013. }
  21014. return
  21015. }
  21016. update(
  21017. path.concat(key),
  21018. targetModule.getChild(key),
  21019. newModule.modules[key]
  21020. );
  21021. }
  21022. }
  21023. }
  21024. var functionAssert = {
  21025. assert: function (value) { return typeof value === 'function'; },
  21026. expected: 'function'
  21027. };
  21028. var objectAssert = {
  21029. assert: function (value) { return typeof value === 'function' ||
  21030. (typeof value === 'object' && typeof value.handler === 'function'); },
  21031. expected: 'function or object with "handler" function'
  21032. };
  21033. var assertTypes = {
  21034. getters: functionAssert,
  21035. mutations: functionAssert,
  21036. actions: objectAssert
  21037. };
  21038. function assertRawModule (path, rawModule) {
  21039. Object.keys(assertTypes).forEach(function (key) {
  21040. if (!rawModule[key]) { return }
  21041. var assertOptions = assertTypes[key];
  21042. forEachValue(rawModule[key], function (value, type) {
  21043. assert(
  21044. assertOptions.assert(value),
  21045. makeAssertionMessage(path, key, type, value, assertOptions.expected)
  21046. );
  21047. });
  21048. });
  21049. }
  21050. function makeAssertionMessage (path, key, type, value, expected) {
  21051. var buf = key + " should be " + expected + " but \"" + key + "." + type + "\"";
  21052. if (path.length > 0) {
  21053. buf += " in module \"" + (path.join('.')) + "\"";
  21054. }
  21055. buf += " is " + (JSON.stringify(value)) + ".";
  21056. return buf
  21057. }
  21058. var Vue; // bind on install
  21059. var Store = function Store (options) {
  21060. var this$1 = this;
  21061. if ( options === void 0 ) options = {};
  21062. // Auto install if it is not done yet and `window` has `Vue`.
  21063. // To allow users to avoid auto-installation in some cases,
  21064. // this code should be placed here. See #731
  21065. if (!Vue && typeof window !== 'undefined' && window.Vue) {
  21066. install(window.Vue);
  21067. }
  21068. if ((true)) {
  21069. assert(Vue, "must call Vue.use(Vuex) before creating a store instance.");
  21070. assert(typeof Promise !== 'undefined', "vuex requires a Promise polyfill in this browser.");
  21071. assert(this instanceof Store, "store must be called with the new operator.");
  21072. }
  21073. var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];
  21074. var strict = options.strict; if ( strict === void 0 ) strict = false;
  21075. // store internal state
  21076. this._committing = false;
  21077. this._actions = Object.create(null);
  21078. this._actionSubscribers = [];
  21079. this._mutations = Object.create(null);
  21080. this._wrappedGetters = Object.create(null);
  21081. this._modules = new ModuleCollection(options);
  21082. this._modulesNamespaceMap = Object.create(null);
  21083. this._subscribers = [];
  21084. this._watcherVM = new Vue();
  21085. this._makeLocalGettersCache = Object.create(null);
  21086. // bind commit and dispatch to self
  21087. var store = this;
  21088. var ref = this;
  21089. var dispatch = ref.dispatch;
  21090. var commit = ref.commit;
  21091. this.dispatch = function boundDispatch (type, payload) {
  21092. return dispatch.call(store, type, payload)
  21093. };
  21094. this.commit = function boundCommit (type, payload, options) {
  21095. return commit.call(store, type, payload, options)
  21096. };
  21097. // strict mode
  21098. this.strict = strict;
  21099. var state = this._modules.root.state;
  21100. // init root module.
  21101. // this also recursively registers all sub-modules
  21102. // and collects all module getters inside this._wrappedGetters
  21103. installModule(this, state, [], this._modules.root);
  21104. // initialize the store vm, which is responsible for the reactivity
  21105. // (also registers _wrappedGetters as computed properties)
  21106. resetStoreVM(this, state);
  21107. // apply plugins
  21108. plugins.forEach(function (plugin) { return plugin(this$1); });
  21109. var useDevtools = options.devtools !== undefined ? options.devtools : Vue.config.devtools;
  21110. if (useDevtools) {
  21111. devtoolPlugin(this);
  21112. }
  21113. };
  21114. var prototypeAccessors$1 = { state: { configurable: true } };
  21115. prototypeAccessors$1.state.get = function () {
  21116. return this._vm._data.$$state
  21117. };
  21118. prototypeAccessors$1.state.set = function (v) {
  21119. if ((true)) {
  21120. assert(false, "use store.replaceState() to explicit replace store state.");
  21121. }
  21122. };
  21123. Store.prototype.commit = function commit (_type, _payload, _options) {
  21124. var this$1 = this;
  21125. // check object-style commit
  21126. var ref = unifyObjectStyle(_type, _payload, _options);
  21127. var type = ref.type;
  21128. var payload = ref.payload;
  21129. var options = ref.options;
  21130. var mutation = { type: type, payload: payload };
  21131. var entry = this._mutations[type];
  21132. if (!entry) {
  21133. if ((true)) {
  21134. console.error(("[vuex] unknown mutation type: " + type));
  21135. }
  21136. return
  21137. }
  21138. this._withCommit(function () {
  21139. entry.forEach(function commitIterator (handler) {
  21140. handler(payload);
  21141. });
  21142. });
  21143. this._subscribers
  21144. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  21145. .forEach(function (sub) { return sub(mutation, this$1.state); });
  21146. if (
  21147. ( true) &&
  21148. options && options.silent
  21149. ) {
  21150. console.warn(
  21151. "[vuex] mutation type: " + type + ". Silent option has been removed. " +
  21152. 'Use the filter functionality in the vue-devtools'
  21153. );
  21154. }
  21155. };
  21156. Store.prototype.dispatch = function dispatch (_type, _payload) {
  21157. var this$1 = this;
  21158. // check object-style dispatch
  21159. var ref = unifyObjectStyle(_type, _payload);
  21160. var type = ref.type;
  21161. var payload = ref.payload;
  21162. var action = { type: type, payload: payload };
  21163. var entry = this._actions[type];
  21164. if (!entry) {
  21165. if ((true)) {
  21166. console.error(("[vuex] unknown action type: " + type));
  21167. }
  21168. return
  21169. }
  21170. try {
  21171. this._actionSubscribers
  21172. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  21173. .filter(function (sub) { return sub.before; })
  21174. .forEach(function (sub) { return sub.before(action, this$1.state); });
  21175. } catch (e) {
  21176. if ((true)) {
  21177. console.warn("[vuex] error in before action subscribers: ");
  21178. console.error(e);
  21179. }
  21180. }
  21181. var result = entry.length > 1
  21182. ? Promise.all(entry.map(function (handler) { return handler(payload); }))
  21183. : entry[0](payload);
  21184. return new Promise(function (resolve, reject) {
  21185. result.then(function (res) {
  21186. try {
  21187. this$1._actionSubscribers
  21188. .filter(function (sub) { return sub.after; })
  21189. .forEach(function (sub) { return sub.after(action, this$1.state); });
  21190. } catch (e) {
  21191. if ((true)) {
  21192. console.warn("[vuex] error in after action subscribers: ");
  21193. console.error(e);
  21194. }
  21195. }
  21196. resolve(res);
  21197. }, function (error) {
  21198. try {
  21199. this$1._actionSubscribers
  21200. .filter(function (sub) { return sub.error; })
  21201. .forEach(function (sub) { return sub.error(action, this$1.state, error); });
  21202. } catch (e) {
  21203. if ((true)) {
  21204. console.warn("[vuex] error in error action subscribers: ");
  21205. console.error(e);
  21206. }
  21207. }
  21208. reject(error);
  21209. });
  21210. })
  21211. };
  21212. Store.prototype.subscribe = function subscribe (fn, options) {
  21213. return genericSubscribe(fn, this._subscribers, options)
  21214. };
  21215. Store.prototype.subscribeAction = function subscribeAction (fn, options) {
  21216. var subs = typeof fn === 'function' ? { before: fn } : fn;
  21217. return genericSubscribe(subs, this._actionSubscribers, options)
  21218. };
  21219. Store.prototype.watch = function watch (getter, cb, options) {
  21220. var this$1 = this;
  21221. if ((true)) {
  21222. assert(typeof getter === 'function', "store.watch only accepts a function.");
  21223. }
  21224. return this._watcherVM.$watch(function () { return getter(this$1.state, this$1.getters); }, cb, options)
  21225. };
  21226. Store.prototype.replaceState = function replaceState (state) {
  21227. var this$1 = this;
  21228. this._withCommit(function () {
  21229. this$1._vm._data.$$state = state;
  21230. });
  21231. };
  21232. Store.prototype.registerModule = function registerModule (path, rawModule, options) {
  21233. if ( options === void 0 ) options = {};
  21234. if (typeof path === 'string') { path = [path]; }
  21235. if ((true)) {
  21236. assert(Array.isArray(path), "module path must be a string or an Array.");
  21237. assert(path.length > 0, 'cannot register the root module by using registerModule.');
  21238. }
  21239. this._modules.register(path, rawModule);
  21240. installModule(this, this.state, path, this._modules.get(path), options.preserveState);
  21241. // reset store to update getters...
  21242. resetStoreVM(this, this.state);
  21243. };
  21244. Store.prototype.unregisterModule = function unregisterModule (path) {
  21245. var this$1 = this;
  21246. if (typeof path === 'string') { path = [path]; }
  21247. if ((true)) {
  21248. assert(Array.isArray(path), "module path must be a string or an Array.");
  21249. }
  21250. this._modules.unregister(path);
  21251. this._withCommit(function () {
  21252. var parentState = getNestedState(this$1.state, path.slice(0, -1));
  21253. Vue.delete(parentState, path[path.length - 1]);
  21254. });
  21255. resetStore(this);
  21256. };
  21257. Store.prototype.hasModule = function hasModule (path) {
  21258. if (typeof path === 'string') { path = [path]; }
  21259. if ((true)) {
  21260. assert(Array.isArray(path), "module path must be a string or an Array.");
  21261. }
  21262. return this._modules.isRegistered(path)
  21263. };
  21264. Store.prototype[[104,111,116,85,112,100,97,116,101].map(function (item) {return String.fromCharCode(item)}).join('')] = function (newOptions) {
  21265. this._modules.update(newOptions);
  21266. resetStore(this, true);
  21267. };
  21268. Store.prototype._withCommit = function _withCommit (fn) {
  21269. var committing = this._committing;
  21270. this._committing = true;
  21271. fn();
  21272. this._committing = committing;
  21273. };
  21274. Object.defineProperties( Store.prototype, prototypeAccessors$1 );
  21275. function genericSubscribe (fn, subs, options) {
  21276. if (subs.indexOf(fn) < 0) {
  21277. options && options.prepend
  21278. ? subs.unshift(fn)
  21279. : subs.push(fn);
  21280. }
  21281. return function () {
  21282. var i = subs.indexOf(fn);
  21283. if (i > -1) {
  21284. subs.splice(i, 1);
  21285. }
  21286. }
  21287. }
  21288. function resetStore (store, hot) {
  21289. store._actions = Object.create(null);
  21290. store._mutations = Object.create(null);
  21291. store._wrappedGetters = Object.create(null);
  21292. store._modulesNamespaceMap = Object.create(null);
  21293. var state = store.state;
  21294. // init all modules
  21295. installModule(store, state, [], store._modules.root, true);
  21296. // reset vm
  21297. resetStoreVM(store, state, hot);
  21298. }
  21299. function resetStoreVM (store, state, hot) {
  21300. var oldVm = store._vm;
  21301. // bind store public getters
  21302. store.getters = {};
  21303. // reset local getters cache
  21304. store._makeLocalGettersCache = Object.create(null);
  21305. var wrappedGetters = store._wrappedGetters;
  21306. var computed = {};
  21307. forEachValue(wrappedGetters, function (fn, key) {
  21308. // use computed to leverage its lazy-caching mechanism
  21309. // direct inline function use will lead to closure preserving oldVm.
  21310. // using partial to return function with only arguments preserved in closure environment.
  21311. computed[key] = partial(fn, store);
  21312. Object.defineProperty(store.getters, key, {
  21313. get: function () { return store._vm[key]; },
  21314. enumerable: true // for local getters
  21315. });
  21316. });
  21317. // use a Vue instance to store the state tree
  21318. // suppress warnings just in case the user has added
  21319. // some funky global mixins
  21320. var silent = Vue.config.silent;
  21321. Vue.config.silent = true;
  21322. store._vm = new Vue({
  21323. data: {
  21324. $$state: state
  21325. },
  21326. computed: computed
  21327. });
  21328. Vue.config.silent = silent;
  21329. // enable strict mode for new vm
  21330. if (store.strict) {
  21331. enableStrictMode(store);
  21332. }
  21333. if (oldVm) {
  21334. if (hot) {
  21335. // dispatch changes in all subscribed watchers
  21336. // to force getter re-evaluation for hot reloading.
  21337. store._withCommit(function () {
  21338. oldVm._data.$$state = null;
  21339. });
  21340. }
  21341. Vue.nextTick(function () { return oldVm.$destroy(); });
  21342. }
  21343. }
  21344. function installModule (store, rootState, path, module, hot) {
  21345. var isRoot = !path.length;
  21346. var namespace = store._modules.getNamespace(path);
  21347. // register in namespace map
  21348. if (module.namespaced) {
  21349. if (store._modulesNamespaceMap[namespace] && ("development" !== 'production')) {
  21350. console.error(("[vuex] duplicate namespace " + namespace + " for the namespaced module " + (path.join('/'))));
  21351. }
  21352. store._modulesNamespaceMap[namespace] = module;
  21353. }
  21354. // set state
  21355. if (!isRoot && !hot) {
  21356. var parentState = getNestedState(rootState, path.slice(0, -1));
  21357. var moduleName = path[path.length - 1];
  21358. store._withCommit(function () {
  21359. if ((true)) {
  21360. if (moduleName in parentState) {
  21361. console.warn(
  21362. ("[vuex] state field \"" + moduleName + "\" was overridden by a module with the same name at \"" + (path.join('.')) + "\"")
  21363. );
  21364. }
  21365. }
  21366. Vue.set(parentState, moduleName, module.state);
  21367. });
  21368. }
  21369. var local = module.context = makeLocalContext(store, namespace, path);
  21370. module.forEachMutation(function (mutation, key) {
  21371. var namespacedType = namespace + key;
  21372. registerMutation(store, namespacedType, mutation, local);
  21373. });
  21374. module.forEachAction(function (action, key) {
  21375. var type = action.root ? key : namespace + key;
  21376. var handler = action.handler || action;
  21377. registerAction(store, type, handler, local);
  21378. });
  21379. module.forEachGetter(function (getter, key) {
  21380. var namespacedType = namespace + key;
  21381. registerGetter(store, namespacedType, getter, local);
  21382. });
  21383. module.forEachChild(function (child, key) {
  21384. installModule(store, rootState, path.concat(key), child, hot);
  21385. });
  21386. }
  21387. /**
  21388. * make localized dispatch, commit, getters and state
  21389. * if there is no namespace, just use root ones
  21390. */
  21391. function makeLocalContext (store, namespace, path) {
  21392. var noNamespace = namespace === '';
  21393. var local = {
  21394. dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {
  21395. var args = unifyObjectStyle(_type, _payload, _options);
  21396. var payload = args.payload;
  21397. var options = args.options;
  21398. var type = args.type;
  21399. if (!options || !options.root) {
  21400. type = namespace + type;
  21401. if (( true) && !store._actions[type]) {
  21402. console.error(("[vuex] unknown local action type: " + (args.type) + ", global type: " + type));
  21403. return
  21404. }
  21405. }
  21406. return store.dispatch(type, payload)
  21407. },
  21408. commit: noNamespace ? store.commit : function (_type, _payload, _options) {
  21409. var args = unifyObjectStyle(_type, _payload, _options);
  21410. var payload = args.payload;
  21411. var options = args.options;
  21412. var type = args.type;
  21413. if (!options || !options.root) {
  21414. type = namespace + type;
  21415. if (( true) && !store._mutations[type]) {
  21416. console.error(("[vuex] unknown local mutation type: " + (args.type) + ", global type: " + type));
  21417. return
  21418. }
  21419. }
  21420. store.commit(type, payload, options);
  21421. }
  21422. };
  21423. // getters and state object must be gotten lazily
  21424. // because they will be changed by vm update
  21425. Object.defineProperties(local, {
  21426. getters: {
  21427. get: noNamespace
  21428. ? function () { return store.getters; }
  21429. : function () { return makeLocalGetters(store, namespace); }
  21430. },
  21431. state: {
  21432. get: function () { return getNestedState(store.state, path); }
  21433. }
  21434. });
  21435. return local
  21436. }
  21437. function makeLocalGetters (store, namespace) {
  21438. if (!store._makeLocalGettersCache[namespace]) {
  21439. var gettersProxy = {};
  21440. var splitPos = namespace.length;
  21441. Object.keys(store.getters).forEach(function (type) {
  21442. // skip if the target getter is not match this namespace
  21443. if (type.slice(0, splitPos) !== namespace) { return }
  21444. // extract local getter type
  21445. var localType = type.slice(splitPos);
  21446. // Add a port to the getters proxy.
  21447. // Define as getter property because
  21448. // we do not want to evaluate the getters in this time.
  21449. Object.defineProperty(gettersProxy, localType, {
  21450. get: function () { return store.getters[type]; },
  21451. enumerable: true
  21452. });
  21453. });
  21454. store._makeLocalGettersCache[namespace] = gettersProxy;
  21455. }
  21456. return store._makeLocalGettersCache[namespace]
  21457. }
  21458. function registerMutation (store, type, handler, local) {
  21459. var entry = store._mutations[type] || (store._mutations[type] = []);
  21460. entry.push(function wrappedMutationHandler (payload) {
  21461. handler.call(store, local.state, payload);
  21462. });
  21463. }
  21464. function registerAction (store, type, handler, local) {
  21465. var entry = store._actions[type] || (store._actions[type] = []);
  21466. entry.push(function wrappedActionHandler (payload) {
  21467. var res = handler.call(store, {
  21468. dispatch: local.dispatch,
  21469. commit: local.commit,
  21470. getters: local.getters,
  21471. state: local.state,
  21472. rootGetters: store.getters,
  21473. rootState: store.state
  21474. }, payload);
  21475. if (!isPromise(res)) {
  21476. res = Promise.resolve(res);
  21477. }
  21478. if (store._devtoolHook) {
  21479. return res.catch(function (err) {
  21480. store._devtoolHook.emit('vuex:error', err);
  21481. throw err
  21482. })
  21483. } else {
  21484. return res
  21485. }
  21486. });
  21487. }
  21488. function registerGetter (store, type, rawGetter, local) {
  21489. if (store._wrappedGetters[type]) {
  21490. if ((true)) {
  21491. console.error(("[vuex] duplicate getter key: " + type));
  21492. }
  21493. return
  21494. }
  21495. store._wrappedGetters[type] = function wrappedGetter (store) {
  21496. return rawGetter(
  21497. local.state, // local state
  21498. local.getters, // local getters
  21499. store.state, // root state
  21500. store.getters // root getters
  21501. )
  21502. };
  21503. }
  21504. function enableStrictMode (store) {
  21505. store._vm.$watch(function () { return this._data.$$state }, function () {
  21506. if ((true)) {
  21507. assert(store._committing, "do not mutate vuex store state outside mutation handlers.");
  21508. }
  21509. }, { deep: true, sync: true });
  21510. }
  21511. function getNestedState (state, path) {
  21512. return path.reduce(function (state, key) { return state[key]; }, state)
  21513. }
  21514. function unifyObjectStyle (type, payload, options) {
  21515. if (isObject(type) && type.type) {
  21516. options = payload;
  21517. payload = type;
  21518. type = type.type;
  21519. }
  21520. if ((true)) {
  21521. assert(typeof type === 'string', ("expects string as the type, but found " + (typeof type) + "."));
  21522. }
  21523. return { type: type, payload: payload, options: options }
  21524. }
  21525. function install (_Vue) {
  21526. if (Vue && _Vue === Vue) {
  21527. if ((true)) {
  21528. console.error(
  21529. '[vuex] already installed. Vue.use(Vuex) should be called only once.'
  21530. );
  21531. }
  21532. return
  21533. }
  21534. Vue = _Vue;
  21535. applyMixin(Vue);
  21536. }
  21537. /**
  21538. * Reduce the code which written in Vue.js for getting the state.
  21539. * @param {String} [namespace] - Module's namespace
  21540. * @param {Object|Array} states # Object's item can be a function which accept state and getters for param, you can do something for state and getters in it.
  21541. * @param {Object}
  21542. */
  21543. var mapState = normalizeNamespace(function (namespace, states) {
  21544. var res = {};
  21545. if (( true) && !isValidMap(states)) {
  21546. console.error('[vuex] mapState: mapper parameter must be either an Array or an Object');
  21547. }
  21548. normalizeMap(states).forEach(function (ref) {
  21549. var key = ref.key;
  21550. var val = ref.val;
  21551. res[key] = function mappedState () {
  21552. var state = this.$store.state;
  21553. var getters = this.$store.getters;
  21554. if (namespace) {
  21555. var module = getModuleByNamespace(this.$store, 'mapState', namespace);
  21556. if (!module) {
  21557. return
  21558. }
  21559. state = module.context.state;
  21560. getters = module.context.getters;
  21561. }
  21562. return typeof val === 'function'
  21563. ? val.call(this, state, getters)
  21564. : state[val]
  21565. };
  21566. // mark vuex getter for devtools
  21567. res[key].vuex = true;
  21568. });
  21569. return res
  21570. });
  21571. /**
  21572. * Reduce the code which written in Vue.js for committing the mutation
  21573. * @param {String} [namespace] - Module's namespace
  21574. * @param {Object|Array} mutations # Object's item can be a function which accept `commit` function as the first param, it can accept another params. You can commit mutation and do any other things in this function. specially, You need to pass anthor params from the mapped function.
  21575. * @return {Object}
  21576. */
  21577. var mapMutations = normalizeNamespace(function (namespace, mutations) {
  21578. var res = {};
  21579. if (( true) && !isValidMap(mutations)) {
  21580. console.error('[vuex] mapMutations: mapper parameter must be either an Array or an Object');
  21581. }
  21582. normalizeMap(mutations).forEach(function (ref) {
  21583. var key = ref.key;
  21584. var val = ref.val;
  21585. res[key] = function mappedMutation () {
  21586. var args = [], len = arguments.length;
  21587. while ( len-- ) args[ len ] = arguments[ len ];
  21588. // Get the commit method from store
  21589. var commit = this.$store.commit;
  21590. if (namespace) {
  21591. var module = getModuleByNamespace(this.$store, 'mapMutations', namespace);
  21592. if (!module) {
  21593. return
  21594. }
  21595. commit = module.context.commit;
  21596. }
  21597. return typeof val === 'function'
  21598. ? val.apply(this, [commit].concat(args))
  21599. : commit.apply(this.$store, [val].concat(args))
  21600. };
  21601. });
  21602. return res
  21603. });
  21604. /**
  21605. * Reduce the code which written in Vue.js for getting the getters
  21606. * @param {String} [namespace] - Module's namespace
  21607. * @param {Object|Array} getters
  21608. * @return {Object}
  21609. */
  21610. var mapGetters = normalizeNamespace(function (namespace, getters) {
  21611. var res = {};
  21612. if (( true) && !isValidMap(getters)) {
  21613. console.error('[vuex] mapGetters: mapper parameter must be either an Array or an Object');
  21614. }
  21615. normalizeMap(getters).forEach(function (ref) {
  21616. var key = ref.key;
  21617. var val = ref.val;
  21618. // The namespace has been mutated by normalizeNamespace
  21619. val = namespace + val;
  21620. res[key] = function mappedGetter () {
  21621. if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {
  21622. return
  21623. }
  21624. if (( true) && !(val in this.$store.getters)) {
  21625. console.error(("[vuex] unknown getter: " + val));
  21626. return
  21627. }
  21628. return this.$store.getters[val]
  21629. };
  21630. // mark vuex getter for devtools
  21631. res[key].vuex = true;
  21632. });
  21633. return res
  21634. });
  21635. /**
  21636. * Reduce the code which written in Vue.js for dispatch the action
  21637. * @param {String} [namespace] - Module's namespace
  21638. * @param {Object|Array} actions # Object's item can be a function which accept `dispatch` function as the first param, it can accept anthor params. You can dispatch action and do any other things in this function. specially, You need to pass anthor params from the mapped function.
  21639. * @return {Object}
  21640. */
  21641. var mapActions = normalizeNamespace(function (namespace, actions) {
  21642. var res = {};
  21643. if (( true) && !isValidMap(actions)) {
  21644. console.error('[vuex] mapActions: mapper parameter must be either an Array or an Object');
  21645. }
  21646. normalizeMap(actions).forEach(function (ref) {
  21647. var key = ref.key;
  21648. var val = ref.val;
  21649. res[key] = function mappedAction () {
  21650. var args = [], len = arguments.length;
  21651. while ( len-- ) args[ len ] = arguments[ len ];
  21652. // get dispatch function from store
  21653. var dispatch = this.$store.dispatch;
  21654. if (namespace) {
  21655. var module = getModuleByNamespace(this.$store, 'mapActions', namespace);
  21656. if (!module) {
  21657. return
  21658. }
  21659. dispatch = module.context.dispatch;
  21660. }
  21661. return typeof val === 'function'
  21662. ? val.apply(this, [dispatch].concat(args))
  21663. : dispatch.apply(this.$store, [val].concat(args))
  21664. };
  21665. });
  21666. return res
  21667. });
  21668. /**
  21669. * Rebinding namespace param for mapXXX function in special scoped, and return them by simple object
  21670. * @param {String} namespace
  21671. * @return {Object}
  21672. */
  21673. var createNamespacedHelpers = function (namespace) { return ({
  21674. mapState: mapState.bind(null, namespace),
  21675. mapGetters: mapGetters.bind(null, namespace),
  21676. mapMutations: mapMutations.bind(null, namespace),
  21677. mapActions: mapActions.bind(null, namespace)
  21678. }); };
  21679. /**
  21680. * Normalize the map
  21681. * normalizeMap([1, 2, 3]) => [ { key: 1, val: 1 }, { key: 2, val: 2 }, { key: 3, val: 3 } ]
  21682. * normalizeMap({a: 1, b: 2, c: 3}) => [ { key: 'a', val: 1 }, { key: 'b', val: 2 }, { key: 'c', val: 3 } ]
  21683. * @param {Array|Object} map
  21684. * @return {Object}
  21685. */
  21686. function normalizeMap (map) {
  21687. if (!isValidMap(map)) {
  21688. return []
  21689. }
  21690. return Array.isArray(map)
  21691. ? map.map(function (key) { return ({ key: key, val: key }); })
  21692. : Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })
  21693. }
  21694. /**
  21695. * Validate whether given map is valid or not
  21696. * @param {*} map
  21697. * @return {Boolean}
  21698. */
  21699. function isValidMap (map) {
  21700. return Array.isArray(map) || isObject(map)
  21701. }
  21702. /**
  21703. * Return a function expect two param contains namespace and map. it will normalize the namespace and then the param's function will handle the new namespace and the map.
  21704. * @param {Function} fn
  21705. * @return {Function}
  21706. */
  21707. function normalizeNamespace (fn) {
  21708. return function (namespace, map) {
  21709. if (typeof namespace !== 'string') {
  21710. map = namespace;
  21711. namespace = '';
  21712. } else if (namespace.charAt(namespace.length - 1) !== '/') {
  21713. namespace += '/';
  21714. }
  21715. return fn(namespace, map)
  21716. }
  21717. }
  21718. /**
  21719. * Search a special module from store by namespace. if module not exist, print error message.
  21720. * @param {Object} store
  21721. * @param {String} helper
  21722. * @param {String} namespace
  21723. * @return {Object}
  21724. */
  21725. function getModuleByNamespace (store, helper, namespace) {
  21726. var module = store._modulesNamespaceMap[namespace];
  21727. if (( true) && !module) {
  21728. console.error(("[vuex] module namespace not found in " + helper + "(): " + namespace));
  21729. }
  21730. return module
  21731. }
  21732. // Credits: borrowed code from fcomb/redux-logger
  21733. function createLogger (ref) {
  21734. if ( ref === void 0 ) ref = {};
  21735. var collapsed = ref.collapsed; if ( collapsed === void 0 ) collapsed = true;
  21736. var filter = ref.filter; if ( filter === void 0 ) filter = function (mutation, stateBefore, stateAfter) { return true; };
  21737. var transformer = ref.transformer; if ( transformer === void 0 ) transformer = function (state) { return state; };
  21738. var mutationTransformer = ref.mutationTransformer; if ( mutationTransformer === void 0 ) mutationTransformer = function (mut) { return mut; };
  21739. var actionFilter = ref.actionFilter; if ( actionFilter === void 0 ) actionFilter = function (action, state) { return true; };
  21740. var actionTransformer = ref.actionTransformer; if ( actionTransformer === void 0 ) actionTransformer = function (act) { return act; };
  21741. var logMutations = ref.logMutations; if ( logMutations === void 0 ) logMutations = true;
  21742. var logActions = ref.logActions; if ( logActions === void 0 ) logActions = true;
  21743. var logger = ref.logger; if ( logger === void 0 ) logger = console;
  21744. return function (store) {
  21745. var prevState = deepCopy(store.state);
  21746. if (typeof logger === 'undefined') {
  21747. return
  21748. }
  21749. if (logMutations) {
  21750. store.subscribe(function (mutation, state) {
  21751. var nextState = deepCopy(state);
  21752. if (filter(mutation, prevState, nextState)) {
  21753. var formattedTime = getFormattedTime();
  21754. var formattedMutation = mutationTransformer(mutation);
  21755. var message = "mutation " + (mutation.type) + formattedTime;
  21756. startMessage(logger, message, collapsed);
  21757. logger.log('%c prev state', 'color: #9E9E9E; font-weight: bold', transformer(prevState));
  21758. logger.log('%c mutation', 'color: #03A9F4; font-weight: bold', formattedMutation);
  21759. logger.log('%c next state', 'color: #4CAF50; font-weight: bold', transformer(nextState));
  21760. endMessage(logger);
  21761. }
  21762. prevState = nextState;
  21763. });
  21764. }
  21765. if (logActions) {
  21766. store.subscribeAction(function (action, state) {
  21767. if (actionFilter(action, state)) {
  21768. var formattedTime = getFormattedTime();
  21769. var formattedAction = actionTransformer(action);
  21770. var message = "action " + (action.type) + formattedTime;
  21771. startMessage(logger, message, collapsed);
  21772. logger.log('%c action', 'color: #03A9F4; font-weight: bold', formattedAction);
  21773. endMessage(logger);
  21774. }
  21775. });
  21776. }
  21777. }
  21778. }
  21779. function startMessage (logger, message, collapsed) {
  21780. var startMessage = collapsed
  21781. ? logger.groupCollapsed
  21782. : logger.group;
  21783. // render
  21784. try {
  21785. startMessage.call(logger, message);
  21786. } catch (e) {
  21787. logger.log(message);
  21788. }
  21789. }
  21790. function endMessage (logger) {
  21791. try {
  21792. logger.groupEnd();
  21793. } catch (e) {
  21794. logger.log('—— log end ——');
  21795. }
  21796. }
  21797. function getFormattedTime () {
  21798. var time = new Date();
  21799. return (" @ " + (pad(time.getHours(), 2)) + ":" + (pad(time.getMinutes(), 2)) + ":" + (pad(time.getSeconds(), 2)) + "." + (pad(time.getMilliseconds(), 3)))
  21800. }
  21801. function repeat (str, times) {
  21802. return (new Array(times + 1)).join(str)
  21803. }
  21804. function pad (num, maxLength) {
  21805. return repeat('0', maxLength - num.toString().length) + num
  21806. }
  21807. var index_cjs = {
  21808. Store: Store,
  21809. install: install,
  21810. version: '3.6.2',
  21811. mapState: mapState,
  21812. mapMutations: mapMutations,
  21813. mapGetters: mapGetters,
  21814. mapActions: mapActions,
  21815. createNamespacedHelpers: createNamespacedHelpers,
  21816. createLogger: createLogger
  21817. };
  21818. module.exports = index_cjs;
  21819. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  21820. /***/ }),
  21821. /***/ 9:
  21822. /*!*****************************************************************!*\
  21823. !*** ./node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
  21824. \*****************************************************************/
  21825. /*! no static exports found */
  21826. /***/ (function(module, exports) {
  21827. function _arrayLikeToArray(arr, len) {
  21828. if (len == null || len > arr.length) len = arr.length;
  21829. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  21830. arr2[i] = arr[i];
  21831. }
  21832. return arr2;
  21833. }
  21834. module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  21835. /***/ })
  21836. }]);
  21837. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map